From b69d2d4d17017009147efbb0a74b97a37a6f4351 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Sun, 24 Apr 2022 16:22:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E4=B8=9A=E5=8A=A1=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../power/dto/rent/RentContractFileDTO.java | 2 +- .../power/dto/rent/RentContractInfoDTO.java | 29 +++- .../power/dto/rent/RentTenantInfoDTO.java | 11 +- .../epmet/plugin/power/dto/rent/form/.gitkeep | 0 .../plugin/power/dto/rent/result/.gitkeep | 0 .../modules/rent/dao/RentContractFileDao.java | 14 +- .../modules/rent/dao/RentTenantInfoDao.java | 14 +- .../rent/entity/RentContractFileEntity.java | 2 +- .../rent/entity/RentContractInfoEntity.java | 15 ++ .../rent/entity/RentTenantInfoEntity.java | 13 +- .../rent/service/RentContractFileService.java | 10 ++ .../rent/service/RentTenantInfoService.java | 10 ++ .../impl/RentBlacklistServiceImpl.java | 10 ++ .../impl/RentContractFileServiceImpl.java | 16 ++- .../impl/RentContractInfoServiceImpl.java | 129 +++++++++++++++++- .../impl/RentTenantInfoServiceImpl.java | 11 +- .../mapper/rent/RentBlacklistDao.xml | 2 +- .../mapper/rent/RentContractFileDao.xml | 16 ++- .../mapper/rent/RentContractInfoDao.xml | 2 +- .../mapper/rent/RentTenantInfoDao.xml | 18 ++- 20 files changed, 297 insertions(+), 27 deletions(-) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/form/.gitkeep create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/result/.gitkeep diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractFileDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractFileDTO.java index 4880568..51f4ab8 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractFileDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractFileDTO.java @@ -32,7 +32,7 @@ public class RentContractFileDTO implements Serializable { private String fileUrl; /** - * 文件类型 + * 文件类型 0:图片,1 文件(合同) */ private String fileType; diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java index 0180fee..61e6a85 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java @@ -1,8 +1,10 @@ package com.epmet.plugin.power.dto.rent; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; +import java.util.List; /** @@ -31,6 +33,16 @@ public class RentContractInfoDTO implements Serializable { */ private String gridName; + /** + * 房屋小区ID + */ + private String villageId; + + /** + * 房屋小区 + */ + private String villageName; + /** * 楼号ID */ @@ -106,6 +118,11 @@ public class RentContractInfoDTO implements Serializable { */ private String signDate; + /** + * 审核日期 + */ + private String reviewDate; + /** * 合同开始日期 */ @@ -151,4 +168,14 @@ public class RentContractInfoDTO implements Serializable { */ private Date updatedTime; + /** + * 租客列表 + */ + private List tenantList; + + /** + * 附件列表 + */ + private List fileList; + } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java index 08954f5..80525ea 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java @@ -2,6 +2,8 @@ package com.epmet.plugin.power.dto.rent; import java.io.Serializable; import java.util.Date; +import java.util.List; + import lombok.Data; @@ -47,9 +49,9 @@ public class RentTenantInfoDTO implements Serializable { private String yfzgx; /** - * 照片 + * 人员类型 0:房东 1:租客 */ - private String img; + private String type; /** * 删除标记 0:未删除,1:已删除 @@ -81,4 +83,9 @@ public class RentTenantInfoDTO implements Serializable { */ private Date updatedTime; + /** + * 头像列表 + */ + private List imgList; + } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/form/.gitkeep b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/form/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/result/.gitkeep b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/result/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentContractFileDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentContractFileDao.java index 24b99e4..6626a7e 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentContractFileDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentContractFileDao.java @@ -4,6 +4,8 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.plugin.power.modules.rent.entity.RentContractFileEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.Map; + /** * 附件表 * @@ -12,5 +14,15 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface RentContractFileDao extends BaseDao { - + + /** + * 物理删除 + * + * @param params + * @return void + * @author zhy + * @date 2022/4/24 14:08 + */ + void deletePhysical(Map params); + } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentTenantInfoDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentTenantInfoDao.java index fa39fed..29cc2c7 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentTenantInfoDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentTenantInfoDao.java @@ -4,6 +4,8 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.plugin.power.modules.rent.entity.RentTenantInfoEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.Map; + /** * 租客表 * @@ -12,5 +14,15 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface RentTenantInfoDao extends BaseDao { - + + /** + * 物理删除 + * + * @param params + * @return void + * @author zhy + * @date 2022/4/24 14:08 + */ + void deletePhysical(Map params); + } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractFileEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractFileEntity.java index 26cf1be..9f63ed0 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractFileEntity.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractFileEntity.java @@ -32,7 +32,7 @@ public class RentContractFileEntity extends BaseEpmetEntity { private String fileUrl; /** - * 文件类型 + * 文件类型 0:图片,1 文件(合同) */ private String fileType; diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractInfoEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractInfoEntity.java index 8fa3055..42da24a 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractInfoEntity.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractInfoEntity.java @@ -31,6 +31,16 @@ public class RentContractInfoEntity extends BaseEpmetEntity { */ private String gridName; + /** + * 房屋小区ID + */ + private String villageId; + + /** + * 房屋小区 + */ + private String villageName; + /** * 楼号ID */ @@ -106,6 +116,11 @@ public class RentContractInfoEntity extends BaseEpmetEntity { */ private String signDate; + /** + * 审核日期 + */ + private String reviewDate; + /** * 合同开始日期 */ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java index 19a44d1..004388d 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java @@ -1,12 +1,15 @@ package com.epmet.plugin.power.modules.rent.entity; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import com.epmet.plugin.power.dto.rent.RentContractFileDTO; import lombok.Data; import lombok.EqualsAndHashCode; import java.util.Date; +import java.util.List; /** * 租客表 @@ -47,8 +50,14 @@ public class RentTenantInfoEntity extends BaseEpmetEntity { private String yfzgx; /** - * 照片 + * 人员类型 0:房东 1:租客 */ - private String img; + private String type; + + /** + * 头像列表 + */ + @TableField(exist = false) + private List imgList; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractFileService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractFileService.java index 509adfb..bb0b789 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractFileService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractFileService.java @@ -75,4 +75,14 @@ public interface RentContractFileService extends BaseService params); } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentTenantInfoService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentTenantInfoService.java index ce6cffd..0504cac 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentTenantInfoService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentTenantInfoService.java @@ -75,4 +75,14 @@ public interface RentTenantInfoService extends BaseService * @date 2022-04-22 */ void delete(String[] ids); + + /** + * 物理删除 + * + * @param params + * @return void + * @author zhy + * @date 2022/4/24 14:08 + */ + void deletePhysical(Map params); } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java index 510ac3c..1272ce8 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java @@ -50,9 +50,19 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); + String name = (String)params.get("name"); + String idCard = (String)params.get("idCard"); + String mobile = (String)params.get("mobile"); + String startTime = (String)params.get("startTime"); + String endTime = (String)params.get("endTime"); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.eq(StringUtils.isNotBlank(name), "NAME", name); + wrapper.eq(StringUtils.isNotBlank(idCard), "ID_CARD", idCard); + wrapper.eq(StringUtils.isNotBlank(mobile), "MOBILE", mobile); + wrapper.ge(StringUtils.isNotBlank(startTime), "JOIN_DATE", startTime); + wrapper.le(StringUtils.isNotBlank(endTime), "JOIN_DATE", endTime); return wrapper; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractFileServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractFileServiceImpl.java index f32f0b9..49a6d8e 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractFileServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractFileServiceImpl.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.metadata.IPage; 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.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.plugin.power.modules.rent.dao.RentContractFileDao; import com.epmet.plugin.power.dto.rent.RentContractFileDTO; +import com.epmet.plugin.power.modules.rent.dao.RentContractFileDao; import com.epmet.plugin.power.modules.rent.entity.RentContractFileEntity; import com.epmet.plugin.power.modules.rent.redis.RentContractFileRedis; import com.epmet.plugin.power.modules.rent.service.RentContractFileService; @@ -48,8 +48,8 @@ public class RentContractFileServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -84,4 +84,12 @@ public class RentContractFileServiceImpl extends BaseServiceImpl params) { + if (!params.isEmpty()) { + baseDao.deletePhysical(params); + } + } + } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java index 9860ff6..e0a0e86 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java @@ -3,20 +3,28 @@ package com.epmet.plugin.power.modules.rent.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.plugin.power.modules.rent.dao.RentContractInfoDao; +import com.epmet.plugin.power.dto.rent.RentContractFileDTO; import com.epmet.plugin.power.dto.rent.RentContractInfoDTO; +import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO; +import com.epmet.plugin.power.modules.rent.dao.RentContractInfoDao; +import com.epmet.plugin.power.modules.rent.entity.RentContractFileEntity; import com.epmet.plugin.power.modules.rent.entity.RentContractInfoEntity; +import com.epmet.plugin.power.modules.rent.entity.RentTenantInfoEntity; import com.epmet.plugin.power.modules.rent.redis.RentContractInfoRedis; +import com.epmet.plugin.power.modules.rent.service.RentContractFileService; import com.epmet.plugin.power.modules.rent.service.RentContractInfoService; +import com.epmet.plugin.power.modules.rent.service.RentTenantInfoService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -32,6 +40,12 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -48,11 +62,48 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + String gridId = (String) params.get("gridId"); + String villageId = (String) params.get("villageId"); + String buildId = (String) params.get("buildId"); + String unitId = (String) params.get("unitId"); + String homeId = (String) params.get("homeId"); + String state = (String) params.get("state"); + String lessorName = (String) params.get("lessorName"); + String lessorIdCard = (String) params.get("lessorIdCard"); + String lessorMobile = (String) params.get("lessorMobile"); + String lesseeName = (String) params.get("lesseeName"); + String lesseeIdCard = (String) params.get("lesseeIdCard"); + String lesseeMobile = (String) params.get("lesseeMobile"); + String startTime = (String) params.get("startTime"); + String endTime = (String) params.get("endTime"); + String reviewStartTime = (String) params.get("reviewStartTime"); + String reviewEndTime = (String) params.get("reviewEndTime"); + String signStartTime = (String) params.get("signStartTime"); + String signEndTime = (String) params.get("signEndTime"); + String endDate = (String) params.get("endDate"); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.eq(StringUtils.isNotBlank(gridId), "GRID_ID", gridId); + wrapper.eq(StringUtils.isNotBlank(villageId), "VILLAGE_ID", villageId); + wrapper.eq(StringUtils.isNotBlank(buildId), "BUILD_ID", buildId); + wrapper.eq(StringUtils.isNotBlank(unitId), "UNIT_ID", unitId); + wrapper.eq(StringUtils.isNotBlank(homeId), "HOME_ID", homeId); + wrapper.eq(StringUtils.isNotBlank(state), "STATE", state); + wrapper.eq(StringUtils.isNotBlank(lessorName), "LESSOR_NAME", lessorName); + wrapper.eq(StringUtils.isNotBlank(lessorIdCard), "LESSOR_ID_CARD", lessorIdCard); + wrapper.eq(StringUtils.isNotBlank(lessorMobile), "LESSOR_MOBILE", lessorMobile); + wrapper.eq(StringUtils.isNotBlank(lesseeName), "LESSEE_NAME", lesseeName); + wrapper.eq(StringUtils.isNotBlank(lesseeIdCard), "LESSEE_ID_CARD", lesseeIdCard); + wrapper.eq(StringUtils.isNotBlank(lesseeMobile), "LESSEE_MOBILE", lesseeMobile); + wrapper.ge(StringUtils.isNotBlank(reviewStartTime), "REVIEW_DATE", reviewStartTime); + wrapper.le(StringUtils.isNotBlank(reviewEndTime), "REVIEW_DATE", reviewEndTime); + wrapper.ge(StringUtils.isNotBlank(signStartTime), "SIGN_DATE", signStartTime); + wrapper.le(StringUtils.isNotBlank(signEndTime), "SIGN_DATE", signEndTime); + + wrapper.eq(StringUtils.isNotBlank(endDate), "END_DATE", endDate); return wrapper; } @@ -60,7 +111,29 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl params = new HashMap<>(4); + params.put("contractId", id); + + // 取出租客信息 + List tenantList = rentTenantInfoService.list(params); + tenantList.forEach(item -> { + // 租客信息补充照片信息 + params.put("referenceId", item.getId()); + params.put("fileType", NumConstant.ZERO_STR); + List imgList = rentContractFileService.list(params); + item.setImgList(imgList); + }); + dto.setTenantList(tenantList); + + params.put("referenceId", dto.getId()); + params.put("fileType", NumConstant.ONE_STR); + // 取出合同文件信息 + List fileList = rentContractFileService.list(params); + dto.setFileList(fileList); + + return dto; } @Override @@ -68,6 +141,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl params = new HashMap<>(8); + params.put("contractId", contractId); + params.put("referenceId", contractId); + // 删除租客和合同文件 + rentTenantInfoService.deletePhysical(params); + rentContractFileService.deletePhysical(params); + + if (!dto.getTenantList().isEmpty()) { + List tenantList = ConvertUtils.sourceToTarget(dto.getTenantList(), RentTenantInfoEntity.class); + tenantList.forEach(tenant -> { + if (StringUtils.isNotBlank(tenant.getId())) { + // 如果是修改,先删除之前的头像 + params.put("referenceId", tenant.getId()); + params.put("fileType", NumConstant.ZERO_STR); + rentContractFileService.deletePhysical(params); + } + tenant.setContractId(contractId); + tenant.setType(NumConstant.ONE_STR); + }); + rentTenantInfoService.insertBatch(tenantList); + // 处理租客头像 + dto.getTenantList().forEach(tenant -> { + if (!tenant.getImgList().isEmpty()) { + List imgList = ConvertUtils.sourceToTarget(tenant.getImgList(), RentContractFileEntity.class); + imgList.forEach(img -> { + img.setReferenceId(tenant.getId()); + img.setFileType(NumConstant.ZERO_STR); + }); + rentContractFileService.insertBatch(imgList); + } + }); + + } + if (!dto.getFileList().isEmpty()) { + List fileList = ConvertUtils.sourceToTarget(dto.getFileList(), RentContractFileEntity.class); + fileList.forEach(item -> { + item.setReferenceId(contractId); + item.setFileType(NumConstant.ONE_STR); + }); + rentContractFileService.insertBatch(fileList); + } + } + } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java index c355ea5..c8b7789 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java @@ -48,8 +48,8 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -84,4 +84,11 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl params) { + if (!params.isEmpty()) { + baseDao.deletePhysical(params); + } + } } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentBlacklistDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentBlacklistDao.xml index e1ab439..a223308 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentBlacklistDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentBlacklistDao.xml @@ -1,7 +1,7 @@ - + diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractFileDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractFileDao.xml index 113e13c..6f99d21 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractFileDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractFileDao.xml @@ -1,7 +1,7 @@ - + @@ -16,5 +16,17 @@ - + + DELETE + FROM + pli_rent_contract_file + + + AND REFERENCE_ID = #{referenceId} + + + AND FILE_TYPE = #{fileType} + + + \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml index e29ec50..af402ab 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml @@ -1,7 +1,7 @@ - + diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml index ddec336..08f588a 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml @@ -1,7 +1,7 @@ - + @@ -10,7 +10,7 @@ - + @@ -19,5 +19,17 @@ - + + DELETE + FROM + pli_rent_tenant_info + + + AND CONTRACT_ID = #{contractId} + + + AND TYPE = #{type} + + + \ No newline at end of file