|
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.zksy.property.domain.AContractInfo;
|
|
import com.zksy.property.domain.AContractInfo;
|
|
|
import com.zksy.property.domain.AHouseInfoDetail;
|
|
import com.zksy.property.domain.AHouseInfoDetail;
|
|
|
import com.zksy.property.domain.ASimplifiedHouseInfo;
|
|
import com.zksy.property.domain.ASimplifiedHouseInfo;
|
|
|
|
|
+import com.zksy.property.domain.ATenantInfo;
|
|
|
import com.zksy.property.domain.bo.*;
|
|
import com.zksy.property.domain.bo.*;
|
|
|
import com.zksy.property.domain.dto.ContractFormDTO;
|
|
import com.zksy.property.domain.dto.ContractFormDTO;
|
|
|
import com.zksy.property.factory.ContractFactory;
|
|
import com.zksy.property.factory.ContractFactory;
|
|
@@ -32,6 +33,27 @@ import static com.zksy.utils.util.generateAssetNumber;
|
|
|
@Service
|
|
@Service
|
|
|
public class AContractInfoServiceImpl extends ServiceImpl<AContractInfoMapper, AContractInfo>
|
|
public class AContractInfoServiceImpl extends ServiceImpl<AContractInfoMapper, AContractInfo>
|
|
|
implements AContractInfoService {
|
|
implements AContractInfoService {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public String returnRent(String houseId) {
|
|
|
|
|
+ ASimplifiedHouseInfo houseInfo = aSimplifiedHouseInfoService.getById(houseId);
|
|
|
|
|
+ if(houseInfo.getStatus().equals("空闲")){
|
|
|
|
|
+ throw new RuntimeException("此房屋未出租");
|
|
|
|
|
+ }
|
|
|
|
|
+ AContractInfo contractInfo = this.getBySimplifiedHouseId(houseId);
|
|
|
|
|
+ if(contractInfo == null){
|
|
|
|
|
+ throw new RuntimeException("数据不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ houseInfo.setStatus("空闲");
|
|
|
|
|
+ //删除租户信息
|
|
|
|
|
+ ATenantInfo tenantInfo = aTenantInfoService.getBySimplifiedHouseId(houseId);
|
|
|
|
|
+ if(tenantInfo != null){
|
|
|
|
|
+ aTenantInfoService.removeById(tenantInfo);
|
|
|
|
|
+ }
|
|
|
|
|
+ aSimplifiedHouseInfoService.updateById(houseInfo);
|
|
|
|
|
+ contractInfo.setContractStatus("已退租");
|
|
|
|
|
+ this.updateById(contractInfo);
|
|
|
|
|
+ return "退租成功";
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
@Lazy
|
|
@Lazy
|
|
@@ -65,6 +87,7 @@ public class AContractInfoServiceImpl extends ServiceImpl<AContractInfoMapper, A
|
|
|
public AContractInfo getBySimplifiedHouseId(String simplifiedHouseId) {
|
|
public AContractInfo getBySimplifiedHouseId(String simplifiedHouseId) {
|
|
|
LambdaQueryWrapper<AContractInfo> queryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<AContractInfo> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(AContractInfo::getSimplifiedHouseId, simplifiedHouseId);
|
|
queryWrapper.eq(AContractInfo::getSimplifiedHouseId, simplifiedHouseId);
|
|
|
|
|
+ queryWrapper.eq(AContractInfo::getContractStatus, "有效");
|
|
|
return this.getOne(queryWrapper);
|
|
return this.getOne(queryWrapper);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -138,7 +161,7 @@ public class AContractInfoServiceImpl extends ServiceImpl<AContractInfoMapper, A
|
|
|
this.save(contractInfo);
|
|
this.save(contractInfo);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /*aSimplifiedHouseInfo.setStatus("已租");
|
|
|
|
|
|
|
+ aSimplifiedHouseInfo.setStatus("已租");
|
|
|
aSimplifiedHouseInfoService.updateById(aSimplifiedHouseInfo);
|
|
aSimplifiedHouseInfoService.updateById(aSimplifiedHouseInfo);
|
|
|
|
|
|
|
|
ATenantInfo aTenantInfo = new ATenantInfo();
|
|
ATenantInfo aTenantInfo = new ATenantInfo();
|
|
@@ -151,9 +174,9 @@ public class AContractInfoServiceImpl extends ServiceImpl<AContractInfoMapper, A
|
|
|
aTenantInfo.setSimplifiedHouseId(dto.getHouseId());
|
|
aTenantInfo.setSimplifiedHouseId(dto.getHouseId());
|
|
|
aTenantInfo.setCreateTime(LocalDateTime.now());
|
|
aTenantInfo.setCreateTime(LocalDateTime.now());
|
|
|
aTenantInfo.setUpdateTime(LocalDateTime.now());
|
|
aTenantInfo.setUpdateTime(LocalDateTime.now());
|
|
|
- aTenantInfoService.save(aTenantInfo);*/
|
|
|
|
|
|
|
+ aTenantInfoService.save(aTenantInfo);
|
|
|
|
|
|
|
|
- return resPath;
|
|
|
|
|
|
|
+ return "签约成功";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private static void processContractC(ContractC baseContract, RentalTempBo bo,String contractNumber) {
|
|
private static void processContractC(ContractC baseContract, RentalTempBo bo,String contractNumber) {
|