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