|
|
@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.plugin.power.dto.rent.RentContractFileDTO; |
|
|
@ -167,7 +169,9 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf |
|
|
|
rentTenantInfoService.deletePhysical(params); |
|
|
|
rentContractFileService.deletePhysical(params); |
|
|
|
|
|
|
|
if (!dto.getTenantList().isEmpty()) { |
|
|
|
if (dto.getTenantList().isEmpty()) { |
|
|
|
throw new EpmetException("租客不能为空"); |
|
|
|
} else { |
|
|
|
List<RentTenantInfoEntity> tenantList = ConvertUtils.sourceToTarget(dto.getTenantList(), RentTenantInfoEntity.class); |
|
|
|
tenantList.forEach(tenant -> { |
|
|
|
if (StringUtils.isNotBlank(tenant.getId())) { |
|
|
@ -182,7 +186,9 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf |
|
|
|
rentTenantInfoService.insertBatch(tenantList); |
|
|
|
// 处理租客头像
|
|
|
|
dto.getTenantList().forEach(tenant -> { |
|
|
|
if (!tenant.getImgList().isEmpty()) { |
|
|
|
if (tenant.getImgList().isEmpty()) { |
|
|
|
throw new EpmetException("租客照片不能为空"); |
|
|
|
} else { |
|
|
|
List<RentContractFileEntity> imgList = ConvertUtils.sourceToTarget(tenant.getImgList(), RentContractFileEntity.class); |
|
|
|
imgList.forEach(img -> { |
|
|
|
img.setReferenceId(tenant.getId()); |
|
|
@ -193,7 +199,9 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
if (!dto.getFileList().isEmpty()) { |
|
|
|
if (dto.getFileList().isEmpty()) { |
|
|
|
throw new EpmetException("合同附件不能为空"); |
|
|
|
} else { |
|
|
|
List<RentContractFileEntity> fileList = ConvertUtils.sourceToTarget(dto.getFileList(), RentContractFileEntity.class); |
|
|
|
fileList.forEach(item -> { |
|
|
|
item.setReferenceId(contractId); |
|
|
|