Browse Source

增加必填项,增加查询条件

dev_power_axis
zhangyuan 3 years ago
parent
commit
ce86526f3a
  1. 4
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractFileServiceImpl.java
  2. 14
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java
  3. 8
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java

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

@ -50,9 +50,13 @@ public class RentContractFileServiceImpl extends BaseServiceImpl<RentContractFil
private QueryWrapper<RentContractFileEntity> getWrapper(Map<String, Object> params) { private QueryWrapper<RentContractFileEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP); String id = (String) params.get(FieldConstant.ID_HUMP);
String referenceId = (String) params.get("referenceId");
String fileType = (String) params.get("fileType");
QueryWrapper<RentContractFileEntity> wrapper = new QueryWrapper<>(); QueryWrapper<RentContractFileEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
wrapper.eq(StringUtils.isNotBlank(referenceId), "REFERENCE_ID", referenceId);
wrapper.eq(StringUtils.isNotBlank(fileType), "FILE_TYPE", fileType);
return wrapper; return wrapper;
} }

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

@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant; 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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.plugin.power.dto.rent.RentContractFileDTO; import com.epmet.plugin.power.dto.rent.RentContractFileDTO;
@ -167,7 +169,9 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf
rentTenantInfoService.deletePhysical(params); rentTenantInfoService.deletePhysical(params);
rentContractFileService.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); List<RentTenantInfoEntity> tenantList = ConvertUtils.sourceToTarget(dto.getTenantList(), RentTenantInfoEntity.class);
tenantList.forEach(tenant -> { tenantList.forEach(tenant -> {
if (StringUtils.isNotBlank(tenant.getId())) { if (StringUtils.isNotBlank(tenant.getId())) {
@ -182,7 +186,9 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf
rentTenantInfoService.insertBatch(tenantList); rentTenantInfoService.insertBatch(tenantList);
// 处理租客头像 // 处理租客头像
dto.getTenantList().forEach(tenant -> { 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); List<RentContractFileEntity> imgList = ConvertUtils.sourceToTarget(tenant.getImgList(), RentContractFileEntity.class);
imgList.forEach(img -> { imgList.forEach(img -> {
img.setReferenceId(tenant.getId()); 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); List<RentContractFileEntity> fileList = ConvertUtils.sourceToTarget(dto.getFileList(), RentContractFileEntity.class);
fileList.forEach(item -> { fileList.forEach(item -> {
item.setReferenceId(contractId); item.setReferenceId(contractId);

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

@ -3,11 +3,11 @@ package com.epmet.plugin.power.modules.rent.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.plugin.power.modules.rent.dao.RentTenantInfoDao;
import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO; import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO;
import com.epmet.plugin.power.modules.rent.dao.RentTenantInfoDao;
import com.epmet.plugin.power.modules.rent.entity.RentTenantInfoEntity; import com.epmet.plugin.power.modules.rent.entity.RentTenantInfoEntity;
import com.epmet.plugin.power.modules.rent.redis.RentTenantInfoRedis; import com.epmet.plugin.power.modules.rent.redis.RentTenantInfoRedis;
import com.epmet.plugin.power.modules.rent.service.RentTenantInfoService; import com.epmet.plugin.power.modules.rent.service.RentTenantInfoService;
@ -50,9 +50,13 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl<RentTenantInfoDao
private QueryWrapper<RentTenantInfoEntity> getWrapper(Map<String, Object> params) { private QueryWrapper<RentTenantInfoEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP); String id = (String) params.get(FieldConstant.ID_HUMP);
String contractId = (String) params.get("contractId");
String type = (String) params.get("type");
QueryWrapper<RentTenantInfoEntity> wrapper = new QueryWrapper<>(); QueryWrapper<RentTenantInfoEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
wrapper.eq(StringUtils.isNotBlank(contractId), "CONTRACT_ID", contractId);
wrapper.eq(StringUtils.isNotBlank(type), "TYPE", type);
return wrapper; return wrapper;
} }

Loading…
Cancel
Save