Browse Source

Merge branch 'dev' into test

test
zhangyuan 3 years ago
parent
commit
9ed438c08e
  1. 5
      epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java
  2. 6
      epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java
  3. 6
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java
  4. 11
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractFileService.java
  5. 8
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractFileServiceImpl.java
  6. 49
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java
  7. 25
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java

5
epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java

@ -186,6 +186,11 @@ public class RentContractInfoDTO implements Serializable {
@NotEmpty @NotEmpty
private List<RentContractFileDTO> fileList; private List<RentContractFileDTO> fileList;
/**
* 中介资料
*/
private List<RentContractFileDTO> agencyImgList;
/** /**
* 是否黑名单 * 是否黑名单
*/ */

6
epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java

@ -88,4 +88,10 @@ public class RentTenantInfoDTO implements Serializable {
@NotEmpty @NotEmpty
private List<RentContractFileDTO> imgList; private List<RentContractFileDTO> imgList;
/**
* 身份证列表
*/
@NotEmpty
private List<RentContractFileDTO> idCardImgList;
} }

6
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java

@ -75,4 +75,10 @@ public class RentTenantInfoEntity extends BaseEpmetEntity {
@TableField(exist = false) @TableField(exist = false)
private List<RentContractFileDTO> imgList; private List<RentContractFileDTO> imgList;
/**
* 身份证照片列表
*/
@TableField(exist = false)
private List<RentContractFileDTO> idCardImgList;
} }

11
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractFileService.java

@ -85,4 +85,15 @@ public interface RentContractFileService extends BaseService<RentContractFileEnt
* @date 2022/4/24 14:08 * @date 2022/4/24 14:08
*/ */
void deletePhysical(Map<String, Object> params); void deletePhysical(Map<String, Object> params);
/**
* 查出对应资料
*
* @param referenceId
* @param fileType
* @return java.util.List<com.epmet.plugin.power.dto.rent.RentContractFileDTO>
* @author zhy
* @date 2022/5/17 20:31
*/
List<RentContractFileDTO> listByRefAndType(String referenceId, String fileType);
} }

8
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractFileServiceImpl.java

@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -96,4 +97,11 @@ public class RentContractFileServiceImpl extends BaseServiceImpl<RentContractFil
} }
} }
@Override
public List<RentContractFileDTO> listByRefAndType(String referenceId, String fileType) {
Map<String, Object> params = new HashMap<>(4);
params.put("referenceId", referenceId);
params.put("fileType", fileType);
return list(params);
}
} }

49
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java

@ -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();
} }

25
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java

@ -104,6 +104,13 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl<RentTenantInfoDao
params.put("fileType", NumConstant.ZERO_STR); params.put("fileType", NumConstant.ZERO_STR);
List<RentContractFileDTO> imgList = rentContractFileService.list(params); List<RentContractFileDTO> imgList = rentContractFileService.list(params);
dto.setImgList(imgList); dto.setImgList(imgList);
// 补充身份证照片信息
params = new HashMap<>(4);
params.put("referenceId", id);
params.put("fileType", NumConstant.TWO_STR);
List<RentContractFileDTO> idCardImgList = rentContractFileService.list(params);
dto.setIdCardImgList(idCardImgList);
return dto; return dto;
} }
@ -121,6 +128,8 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl<RentTenantInfoDao
// 处理头像 // 处理头像
if (null == dto.getImgList() || dto.getImgList().isEmpty()) { if (null == dto.getImgList() || dto.getImgList().isEmpty()) {
return new Result().error("照片不能为空"); return new Result().error("照片不能为空");
} else if (null == dto.getIdCardImgList() || dto.getIdCardImgList().isEmpty()) {
return new Result().error("身份证照片不能为空");
} else { } else {
RentTenantInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentTenantInfoEntity.class); RentTenantInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentTenantInfoEntity.class);
entity.setCustomerId(loginUserUtil.getLoginUserCustomerId()); entity.setCustomerId(loginUserUtil.getLoginUserCustomerId());
@ -133,14 +142,22 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl<RentTenantInfoDao
img.setFileType(NumConstant.ZERO_STR); img.setFileType(NumConstant.ZERO_STR);
img.setCustomerId(loginUserUtil.getLoginUserCustomerId()); img.setCustomerId(loginUserUtil.getLoginUserCustomerId());
// 更新基础库的人员头像 // // 更新基础库的人员头像
IcResiUserAttachmentDTO image = new IcResiUserAttachmentDTO(); // IcResiUserAttachmentDTO image = new IcResiUserAttachmentDTO();
image.setAttachmentUrl(img.getFileUrl()); // image.setAttachmentUrl(img.getFileUrl());
image.setCustomerId(loginUserUtil.getLoginUserCustomerId()); // image.setCustomerId(loginUserUtil.getLoginUserCustomerId());
// images.add(image); // images.add(image);
}); });
rentContractFileService.insertBatch(imgList); rentContractFileService.insertBatch(imgList);
List<RentContractFileEntity> idCardImgList = ConvertUtils.sourceToTarget(dto.getIdCardImgList(), RentContractFileEntity.class);
idCardImgList.forEach(img -> {
img.setReferenceId(entity.getId());
img.setFileType(NumConstant.TWO_STR);
img.setCustomerId(loginUserUtil.getLoginUserCustomerId());
});
rentContractFileService.insertBatch(idCardImgList);
// // 如果是房东信息立马去更新照片 // // 如果是房东信息立马去更新照片
// if (NumConstant.ZERO_STR.equals(dto.getType())) { // if (NumConstant.ZERO_STR.equals(dto.getType())) {
// RentTenantFormDTO formDTO = new RentTenantFormDTO(); // RentTenantFormDTO formDTO = new RentTenantFormDTO();

Loading…
Cancel
Save