|
|
@ -34,6 +34,7 @@ import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* 合同表 |
|
|
@ -133,6 +134,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf |
|
|
|
|
|
|
|
// 取出租客信息
|
|
|
|
List<RentTenantInfoDTO> tenantList = rentTenantInfoService.list(params); |
|
|
|
|
|
|
|
tenantList.forEach(item -> { |
|
|
|
// 租客信息补充照片信息
|
|
|
|
params.put("referenceId", item.getId()); |
|
|
@ -234,9 +236,14 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf |
|
|
|
rentContractFileService.deletePhysical(params); |
|
|
|
|
|
|
|
if (dto.getTenantList().isEmpty()) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "租客不能为空"); |
|
|
|
return new Result().error("租客不能为空"); |
|
|
|
} else { |
|
|
|
List<RentTenantInfoEntity> tenantList = ConvertUtils.sourceToTarget(dto.getTenantList(), RentTenantInfoEntity.class); |
|
|
|
long idCardNum = tenantList.stream().map(RentTenantInfoEntity::getIdCard).collect(Collectors.toList()).stream().distinct().count(); |
|
|
|
if (tenantList.size() != idCardNum) { |
|
|
|
return new Result().error("租客身份证重复"); |
|
|
|
} |
|
|
|
|
|
|
|
tenantList.forEach(tenant -> { |
|
|
|
if (StringUtils.isNotBlank(tenant.getId())) { |
|
|
|
// 如果是修改,先删除之前的头像
|
|
|
@ -266,7 +273,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf |
|
|
|
|
|
|
|
} |
|
|
|
if (dto.getFileList().isEmpty()) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "合同附件不能为空"); |
|
|
|
return new Result().error("合同附件不能为空"); |
|
|
|
} else { |
|
|
|
List<RentContractFileEntity> fileList = ConvertUtils.sourceToTarget(dto.getFileList(), RentContractFileEntity.class); |
|
|
|
fileList.forEach(item -> { |
|
|
|