|
|
@ -141,21 +141,16 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf |
|
|
|
|
|
|
|
tenantList.forEach(item -> { |
|
|
|
// 租客信息补充照片信息
|
|
|
|
Map<String, Object> imgParams = new HashMap<>(4); |
|
|
|
imgParams.put("referenceId", item.getId()); |
|
|
|
imgParams.put("fileType", NumConstant.ZERO_STR); |
|
|
|
List<RentContractFileDTO> imgList = rentContractFileService.list(imgParams); |
|
|
|
item.setImgList(imgList); |
|
|
|
item.setImgList(rentContractFileService.listByRefAndType(item.getId(), NumConstant.ZERO_STR)); |
|
|
|
// 租客信息补充身份证照片信息
|
|
|
|
item.setIdCardImgList(rentContractFileService.listByRefAndType(item.getId(), NumConstant.TWO_STR)); |
|
|
|
}); |
|
|
|
dto.setTenantList(tenantList); |
|
|
|
dto.setTenantNum(tenantList.size()); |
|
|
|
|
|
|
|
// 取出合同文件信息
|
|
|
|
Map<String, Object> fileParams = new HashMap<>(4); |
|
|
|
fileParams.put("referenceId", dto.getId()); |
|
|
|
fileParams.put("fileType", NumConstant.ONE_STR); |
|
|
|
List<RentContractFileDTO> fileList = rentContractFileService.list(fileParams); |
|
|
|
dto.setFileList(fileList); |
|
|
|
dto.setFileList(rentContractFileService.listByRefAndType(dto.getId(), NumConstant.ONE_STR)); |
|
|
|
dto.setAgencyImgList(rentContractFileService.listByRefAndType(dto.getId(), NumConstant.THREE_STR)); |
|
|
|
|
|
|
|
return dto; |
|
|
|
} |
|
|
@ -191,10 +186,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf |
|
|
|
formDTO.setIdCard(tenant.getIdCard()); |
|
|
|
formDTO.setType(NumConstant.ONE_STR); |
|
|
|
|
|
|
|
Map<String, Object> imgParams = new HashMap<>(4); |
|
|
|
imgParams.put("referenceId", tenant.getId()); |
|
|
|
imgParams.put("fileType", NumConstant.ZERO_STR); |
|
|
|
List<RentContractFileDTO> imgList = rentContractFileService.list(imgParams); |
|
|
|
List<RentContractFileDTO> imgList = rentContractFileService.listByRefAndType(tenant.getId(), NumConstant.ZERO_STR); |
|
|
|
|
|
|
|
imgList.forEach(img -> { |
|
|
|
// 更新基础库的人员头像
|
|
|
@ -275,13 +267,17 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf |
|
|
|
params.put("referenceId", tenant.getId()); |
|
|
|
params.put("fileType", NumConstant.ZERO_STR); |
|
|
|
rentContractFileService.deletePhysical(params); |
|
|
|
// 如果是修改,先删除之前的身份证照片
|
|
|
|
params.put("referenceId", tenant.getId()); |
|
|
|
params.put("fileType", NumConstant.TWO_STR); |
|
|
|
rentContractFileService.deletePhysical(params); |
|
|
|
} |
|
|
|
tenant.setContractId(contractId); |
|
|
|
tenant.setType(NumConstant.ONE_STR); |
|
|
|
tenant.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
|
|
|
}); |
|
|
|
rentTenantInfoService.insertBatch(tenantList); |
|
|
|
// 处理租客头像
|
|
|
|
// 处理租客头像和身份证照片
|
|
|
|
tenantList.forEach(tenant -> { |
|
|
|
if (null == tenant.getImgList() || tenant.getImgList().isEmpty()) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "租客照片不能为空"); |
|
|
@ -294,9 +290,21 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf |
|
|
|
}); |
|
|
|
rentContractFileService.insertBatch(imgList); |
|
|
|
} |
|
|
|
if (null == tenant.getIdCardImgList() || tenant.getIdCardImgList().isEmpty()) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "租客身份证照片不能为空"); |
|
|
|
} else { |
|
|
|
List<RentContractFileEntity> idCardImgList = ConvertUtils.sourceToTarget(tenant.getIdCardImgList(), RentContractFileEntity.class); |
|
|
|
idCardImgList.forEach(img -> { |
|
|
|
img.setReferenceId(tenant.getId()); |
|
|
|
img.setFileType(NumConstant.TWO_STR); |
|
|
|
img.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
|
|
|
}); |
|
|
|
rentContractFileService.insertBatch(idCardImgList); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
// 附件处理
|
|
|
|
if (null == dto.getFileList() || dto.getFileList().isEmpty()) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "合同附件不能为空"); |
|
|
|
} else { |
|
|
@ -308,6 +316,17 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf |
|
|
|
}); |
|
|
|
rentContractFileService.insertBatch(fileList); |
|
|
|
} |
|
|
|
|
|
|
|
// 中介资料处理
|
|
|
|
if (null != dto.getAgencyImgList() && dto.getAgencyImgList().size() > 0) { |
|
|
|
List<RentContractFileEntity> fileList = ConvertUtils.sourceToTarget(dto.getAgencyImgList(), RentContractFileEntity.class); |
|
|
|
fileList.forEach(item -> { |
|
|
|
item.setReferenceId(contractId); |
|
|
|
item.setFileType(NumConstant.THREE_STR); |
|
|
|
item.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
|
|
|
}); |
|
|
|
rentContractFileService.insertBatch(fileList); |
|
|
|
} |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|