From 316f8d4c232a3f18b4ae1d202050667dd9b1eb60 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Fri, 22 Apr 2022 18:12:28 +0800 Subject: [PATCH 01/20] init --- .../power/dto/rent/RentBlacklistDTO.java | 104 ++++++++++++ .../power/dto/rent/RentContractFileDTO.java | 69 ++++++++ .../power/dto/rent/RentContractInfoDTO.java | 154 ++++++++++++++++++ .../power/dto/rent/RentTenantInfoDTO.java | 84 ++++++++++ .../controller/RentBlacklistController.java | 82 ++++++++++ .../RentContractFileController.java | 82 ++++++++++ .../RentContractInfoController.java | 82 ++++++++++ .../controller/RentTenantInfoController.java | 82 ++++++++++ .../modules/rent/dao/RentBlacklistDao.java | 16 ++ .../modules/rent/dao/RentContractFileDao.java | 16 ++ .../modules/rent/dao/RentContractInfoDao.java | 16 ++ .../modules/rent/dao/RentTenantInfoDao.java | 16 ++ .../rent/entity/RentBlacklistEntity.java | 74 +++++++++ .../rent/entity/RentContractFileEntity.java | 39 +++++ .../rent/entity/RentContractInfoEntity.java | 124 ++++++++++++++ .../rent/entity/RentTenantInfoEntity.java | 54 ++++++ .../rent/excel/RentBlacklistExcel.java | 69 ++++++++ .../rent/excel/RentContractFileExcel.java | 48 ++++++ .../rent/excel/RentContractInfoExcel.java | 99 +++++++++++ .../rent/excel/RentTenantInfoExcel.java | 57 +++++++ .../rent/redis/RentBlacklistRedis.java | 30 ++++ .../rent/redis/RentContractFileRedis.java | 30 ++++ .../rent/redis/RentContractInfoRedis.java | 30 ++++ .../rent/redis/RentTenantInfoRedis.java | 30 ++++ .../rent/service/RentBlacklistService.java | 78 +++++++++ .../rent/service/RentContractFileService.java | 78 +++++++++ .../rent/service/RentContractInfoService.java | 78 +++++++++ .../rent/service/RentTenantInfoService.java | 78 +++++++++ .../impl/RentBlacklistServiceImpl.java | 87 ++++++++++ .../impl/RentContractFileServiceImpl.java | 87 ++++++++++ .../impl/RentContractInfoServiceImpl.java | 87 ++++++++++ .../impl/RentTenantInfoServiceImpl.java | 87 ++++++++++ .../mapper/rent/RentBlacklistDao.xml | 27 +++ .../mapper/rent/RentContractFileDao.xml | 20 +++ .../mapper/rent/RentContractInfoDao.xml | 37 +++++ .../mapper/rent/RentTenantInfoDao.xml | 23 +++ 36 files changed, 2254 insertions(+) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentBlacklistDTO.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractFileDTO.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentBlacklistController.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractFileController.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentBlacklistDao.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentContractFileDao.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentContractInfoDao.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentTenantInfoDao.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentBlacklistEntity.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractFileEntity.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractInfoEntity.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentBlacklistExcel.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentContractFileExcel.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentContractInfoExcel.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentTenantInfoExcel.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentBlacklistRedis.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentContractFileRedis.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentContractInfoRedis.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentTenantInfoRedis.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentBlacklistService.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractFileService.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentTenantInfoService.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractFileServiceImpl.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentBlacklistDao.xml create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractFileDao.xml create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentBlacklistDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentBlacklistDTO.java new file mode 100644 index 0000000..0c55a06 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentBlacklistDTO.java @@ -0,0 +1,104 @@ +package com.epmet.plugin.power.dto.rent; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 黑名单表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Data +public class RentBlacklistDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * epmet用户主键 + */ + private String userId; + + /** + * 姓名 + */ + private String name; + + /** + * 身份证 + */ + private String idCard; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 0女 1男 + */ + private String gender; + + /** + * 类型 0 租客 1 房东 + */ + private String type; + + /** + * 加入时间 + */ + private String joinDate; + + /** + * 加入原因 + */ + private String joinReason; + + /** + * 移除时间 + */ + private String removeDate; + + /** + * 移除原因 + */ + private String removeReason; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ 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/RentContractFileDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractFileDTO.java new file mode 100644 index 0000000..4880568 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractFileDTO.java @@ -0,0 +1,69 @@ +package com.epmet.plugin.power.dto.rent; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Data +public class RentContractFileDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 引用ID + */ + private String referenceId; + + /** + * 文件地址 + */ + private String fileUrl; + + /** + * 文件类型 + */ + private String fileType; + + /** + * 删除标识 0:未删除,1:删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ 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/RentContractInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java new file mode 100644 index 0000000..0180fee --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java @@ -0,0 +1,154 @@ +package com.epmet.plugin.power.dto.rent; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 合同表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Data +public class RentContractInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格 + */ + private String gridName; + + /** + * 楼号ID + */ + private String buildId; + + /** + * 楼号 + */ + private String buildName; + + /** + * 单元ID + */ + private String unitId; + + /** + * 单元 + */ + private String unitName; + + /** + * 房屋ID + */ + private String homeId; + + /** + * 房屋 + */ + private String homeName; + + /** + * 房主姓名 + */ + private String ownerName; + + /** + * 状态:0未审核,1审核通过,2审核不通过 + */ + private String state; + + /** + * 出租人姓名 + */ + private String lessorName; + + /** + * 出租人身份证 + */ + private String lessorIdCard; + + /** + * 出租人手机 + */ + private String lessorMobile; + + /** + * 承租人姓名 + */ + private String lesseeName; + + /** + * 承租人身份证 + */ + private String lesseeIdCard; + + /** + * 承租人手机 + */ + private String lesseeMobile; + + /** + * 签署日期 + */ + private String signDate; + + /** + * 合同开始日期 + */ + private String startDate; + + /** + * 合同结束日期 + */ + private String endDate; + + /** + * 审核-原因 + */ + private String reason; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ 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 new file mode 100644 index 0000000..08954f5 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java @@ -0,0 +1,84 @@ +package com.epmet.plugin.power.dto.rent; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 租客表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Data +public class RentTenantInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 合同ID + */ + private String contractId; + + /** + * 姓名 + */ + private String name; + + /** + * 身份证 + */ + private String idCard; + + /** + * 手机号 + */ + private String mobile; + + /** + * 与房主关系 + */ + private String yfzgx; + + /** + * 照片 + */ + private String img; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ 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/controller/RentBlacklistController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentBlacklistController.java new file mode 100644 index 0000000..3ef97f5 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentBlacklistController.java @@ -0,0 +1,82 @@ +package com.epmet.plugin.power.modules.rent.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.plugin.power.dto.rent.RentBlacklistDTO; +import com.epmet.plugin.power.modules.rent.excel.RentBlacklistExcel; +import com.epmet.plugin.power.modules.rent.service.RentBlacklistService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 黑名单表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@RestController +@RequestMapping("rentBlacklist") +public class RentBlacklistController { + + @Autowired + private RentBlacklistService rentBlacklistService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = rentBlacklistService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + RentBlacklistDTO data = rentBlacklistService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody RentBlacklistDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + rentBlacklistService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody RentBlacklistDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + rentBlacklistService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + rentBlacklistService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = rentBlacklistService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, RentBlacklistExcel.class); + } + + + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractFileController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractFileController.java new file mode 100644 index 0000000..0511f7f --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractFileController.java @@ -0,0 +1,82 @@ +package com.epmet.plugin.power.modules.rent.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.plugin.power.dto.rent.RentContractFileDTO; +import com.epmet.plugin.power.modules.rent.excel.RentContractFileExcel; +import com.epmet.plugin.power.modules.rent.service.RentContractFileService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@RestController +@RequestMapping("rentContractFile") +public class RentContractFileController { + + @Autowired + private RentContractFileService rentContractFileService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = rentContractFileService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + RentContractFileDTO data = rentContractFileService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody RentContractFileDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + rentContractFileService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody RentContractFileDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + rentContractFileService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + rentContractFileService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = rentContractFileService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, RentContractFileExcel.class); + } + + + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java new file mode 100644 index 0000000..6659de5 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java @@ -0,0 +1,82 @@ +package com.epmet.plugin.power.modules.rent.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.plugin.power.dto.rent.RentContractInfoDTO; +import com.epmet.plugin.power.modules.rent.excel.RentContractInfoExcel; +import com.epmet.plugin.power.modules.rent.service.RentContractInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 合同表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@RestController +@RequestMapping("rentContractInfo") +public class RentContractInfoController { + + @Autowired + private RentContractInfoService rentContractInfoService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = rentContractInfoService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + RentContractInfoDTO data = rentContractInfoService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody RentContractInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + rentContractInfoService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody RentContractInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + rentContractInfoService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + rentContractInfoService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = rentContractInfoService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, RentContractInfoExcel.class); + } + + + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java new file mode 100644 index 0000000..4fb8f7a --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java @@ -0,0 +1,82 @@ +package com.epmet.plugin.power.modules.rent.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO; +import com.epmet.plugin.power.modules.rent.excel.RentTenantInfoExcel; +import com.epmet.plugin.power.modules.rent.service.RentTenantInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 租客表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@RestController +@RequestMapping("rentTenantInfo") +public class RentTenantInfoController { + + @Autowired + private RentTenantInfoService rentTenantInfoService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = rentTenantInfoService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + RentTenantInfoDTO data = rentTenantInfoService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody RentTenantInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + rentTenantInfoService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody RentTenantInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + rentTenantInfoService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + rentTenantInfoService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = rentTenantInfoService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, RentTenantInfoExcel.class); + } + + + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentBlacklistDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentBlacklistDao.java new file mode 100644 index 0000000..85106da --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentBlacklistDao.java @@ -0,0 +1,16 @@ +package com.epmet.plugin.power.modules.rent.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.plugin.power.modules.rent.entity.RentBlacklistEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 黑名单表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Mapper +public interface RentBlacklistDao extends BaseDao { + +} \ 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/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 new file mode 100644 index 0000000..24b99e4 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentContractFileDao.java @@ -0,0 +1,16 @@ +package com.epmet.plugin.power.modules.rent.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.plugin.power.modules.rent.entity.RentContractFileEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Mapper +public interface RentContractFileDao extends BaseDao { + +} \ 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/RentContractInfoDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentContractInfoDao.java new file mode 100644 index 0000000..5627f0e --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentContractInfoDao.java @@ -0,0 +1,16 @@ +package com.epmet.plugin.power.modules.rent.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.plugin.power.modules.rent.entity.RentContractInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 合同表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Mapper +public interface RentContractInfoDao extends BaseDao { + +} \ 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 new file mode 100644 index 0000000..fa39fed --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentTenantInfoDao.java @@ -0,0 +1,16 @@ +package com.epmet.plugin.power.modules.rent.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.plugin.power.modules.rent.entity.RentTenantInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 租客表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Mapper +public interface RentTenantInfoDao extends BaseDao { + +} \ 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/RentBlacklistEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentBlacklistEntity.java new file mode 100644 index 0000000..4a5d593 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentBlacklistEntity.java @@ -0,0 +1,74 @@ +package com.epmet.plugin.power.modules.rent.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 黑名单表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pli_rent_blacklist") +public class RentBlacklistEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * epmet用户主键 + */ + private String userId; + + /** + * 姓名 + */ + private String name; + + /** + * 身份证 + */ + private String idCard; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 0女 1男 + */ + private String gender; + + /** + * 类型 0 租客 1 房东 + */ + private String type; + + /** + * 加入时间 + */ + private String joinDate; + + /** + * 加入原因 + */ + private String joinReason; + + /** + * 移除时间 + */ + private String removeDate; + + /** + * 移除原因 + */ + private String removeReason; + +} 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 new file mode 100644 index 0000000..26cf1be --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractFileEntity.java @@ -0,0 +1,39 @@ +package com.epmet.plugin.power.modules.rent.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pli_rent_contract_file") +public class RentContractFileEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 引用ID + */ + private String referenceId; + + /** + * 文件地址 + */ + private String fileUrl; + + /** + * 文件类型 + */ + 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 new file mode 100644 index 0000000..8fa3055 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractInfoEntity.java @@ -0,0 +1,124 @@ +package com.epmet.plugin.power.modules.rent.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 合同表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pli_rent_contract_info") +public class RentContractInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格 + */ + private String gridName; + + /** + * 楼号ID + */ + private String buildId; + + /** + * 楼号 + */ + private String buildName; + + /** + * 单元ID + */ + private String unitId; + + /** + * 单元 + */ + private String unitName; + + /** + * 房屋ID + */ + private String homeId; + + /** + * 房屋 + */ + private String homeName; + + /** + * 房主姓名 + */ + private String ownerName; + + /** + * 状态:0未审核,1审核通过,2审核不通过 + */ + private String state; + + /** + * 出租人姓名 + */ + private String lessorName; + + /** + * 出租人身份证 + */ + private String lessorIdCard; + + /** + * 出租人手机 + */ + private String lessorMobile; + + /** + * 承租人姓名 + */ + private String lesseeName; + + /** + * 承租人身份证 + */ + private String lesseeIdCard; + + /** + * 承租人手机 + */ + private String lesseeMobile; + + /** + * 签署日期 + */ + private String signDate; + + /** + * 合同开始日期 + */ + private String startDate; + + /** + * 合同结束日期 + */ + private String endDate; + + /** + * 审核-原因 + */ + private String reason; + +} 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 new file mode 100644 index 0000000..19a44d1 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java @@ -0,0 +1,54 @@ +package com.epmet.plugin.power.modules.rent.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 租客表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pli_rent_tenant_info") +public class RentTenantInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 合同ID + */ + private String contractId; + + /** + * 姓名 + */ + private String name; + + /** + * 身份证 + */ + private String idCard; + + /** + * 手机号 + */ + private String mobile; + + /** + * 与房主关系 + */ + private String yfzgx; + + /** + * 照片 + */ + private String img; + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentBlacklistExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentBlacklistExcel.java new file mode 100644 index 0000000..6aeb30e --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentBlacklistExcel.java @@ -0,0 +1,69 @@ +package com.epmet.plugin.power.modules.rent.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 黑名单表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Data +public class RentBlacklistExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "epmet用户主键") + private String userId; + + @Excel(name = "姓名") + private String name; + + @Excel(name = "身份证") + private String idCard; + + @Excel(name = "手机号") + private String mobile; + + @Excel(name = "性别 0女 1男") + private String gender; + + @Excel(name = "类型 0 租客 1 房东") + private String type; + + @Excel(name = "加入时间") + private String joinDate; + + @Excel(name = "加入原因") + private String joinReason; + + @Excel(name = "移除时间") + private String removeDate; + + @Excel(name = "移除原因") + private String removeReason; + + @Excel(name = "删除标记 0:未删除,1:已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ 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/excel/RentContractFileExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentContractFileExcel.java new file mode 100644 index 0000000..3e665d6 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentContractFileExcel.java @@ -0,0 +1,48 @@ +package com.epmet.plugin.power.modules.rent.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Data +public class RentContractFileExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "引用ID") + private String referenceId; + + @Excel(name = "文件地址") + private String fileUrl; + + @Excel(name = "文件类型") + private String fileType; + + @Excel(name = "删除标识 0:未删除,1:删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ 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/excel/RentContractInfoExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentContractInfoExcel.java new file mode 100644 index 0000000..02fdbc6 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentContractInfoExcel.java @@ -0,0 +1,99 @@ +package com.epmet.plugin.power.modules.rent.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 合同表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Data +public class RentContractInfoExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "网格ID") + private String gridId; + + @Excel(name = "网格") + private String gridName; + + @Excel(name = "楼号ID") + private String buildId; + + @Excel(name = "楼号") + private String buildName; + + @Excel(name = "单元ID") + private String unitId; + + @Excel(name = "单元") + private String unitName; + + @Excel(name = "房屋ID") + private String homeId; + + @Excel(name = "房屋") + private String homeName; + + @Excel(name = "房主姓名") + private String ownerName; + + @Excel(name = "状态:0未审核,1审核通过,2审核不通过") + private String state; + + @Excel(name = "出租人姓名") + private String lessorName; + + @Excel(name = "出租人身份证") + private String lessorIdCard; + + @Excel(name = "出租人手机") + private String lessorMobile; + + @Excel(name = "承租人姓名") + private String lesseeName; + + @Excel(name = "承租人身份证") + private String lesseeIdCard; + + @Excel(name = "承租人手机") + private String lesseeMobile; + + @Excel(name = "签署日期") + private String signDate; + + @Excel(name = "合同开始日期") + private String startDate; + + @Excel(name = "合同结束日期") + private String endDate; + + @Excel(name = "审核-原因") + private String reason; + + @Excel(name = "删除标记 0:未删除,1:已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ 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/excel/RentTenantInfoExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentTenantInfoExcel.java new file mode 100644 index 0000000..55ba1b0 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentTenantInfoExcel.java @@ -0,0 +1,57 @@ +package com.epmet.plugin.power.modules.rent.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 租客表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Data +public class RentTenantInfoExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "合同ID") + private String contractId; + + @Excel(name = "姓名") + private String name; + + @Excel(name = "身份证") + private String idCard; + + @Excel(name = "手机号") + private String mobile; + + @Excel(name = "与房主关系") + private String yfzgx; + + @Excel(name = "照片") + private String img; + + @Excel(name = "删除标记 0:未删除,1:已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ 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/redis/RentBlacklistRedis.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentBlacklistRedis.java new file mode 100644 index 0000000..f0899a3 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentBlacklistRedis.java @@ -0,0 +1,30 @@ +package com.epmet.plugin.power.modules.rent.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 黑名单表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Component +public class RentBlacklistRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ 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/redis/RentContractFileRedis.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentContractFileRedis.java new file mode 100644 index 0000000..96c655d --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentContractFileRedis.java @@ -0,0 +1,30 @@ +package com.epmet.plugin.power.modules.rent.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Component +public class RentContractFileRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ 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/redis/RentContractInfoRedis.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentContractInfoRedis.java new file mode 100644 index 0000000..a7d6da9 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentContractInfoRedis.java @@ -0,0 +1,30 @@ +package com.epmet.plugin.power.modules.rent.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 合同表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Component +public class RentContractInfoRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ 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/redis/RentTenantInfoRedis.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentTenantInfoRedis.java new file mode 100644 index 0000000..e871663 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentTenantInfoRedis.java @@ -0,0 +1,30 @@ +package com.epmet.plugin.power.modules.rent.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 租客表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Component +public class RentTenantInfoRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ 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/RentBlacklistService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentBlacklistService.java new file mode 100644 index 0000000..13fe18e --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentBlacklistService.java @@ -0,0 +1,78 @@ +package com.epmet.plugin.power.modules.rent.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.plugin.power.dto.rent.RentBlacklistDTO; +import com.epmet.plugin.power.modules.rent.entity.RentBlacklistEntity; + +import java.util.List; +import java.util.Map; + +/** + * 黑名单表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +public interface RentBlacklistService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-04-22 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-04-22 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return RentBlacklistDTO + * @author generator + * @date 2022-04-22 + */ + RentBlacklistDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-04-22 + */ + void save(RentBlacklistDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-04-22 + */ + void update(RentBlacklistDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-04-22 + */ + void delete(String[] ids); +} \ 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/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 new file mode 100644 index 0000000..509adfb --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractFileService.java @@ -0,0 +1,78 @@ +package com.epmet.plugin.power.modules.rent.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.plugin.power.dto.rent.RentContractFileDTO; +import com.epmet.plugin.power.modules.rent.entity.RentContractFileEntity; + +import java.util.List; +import java.util.Map; + +/** + * 附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +public interface RentContractFileService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-04-22 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-04-22 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return RentContractFileDTO + * @author generator + * @date 2022-04-22 + */ + RentContractFileDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-04-22 + */ + void save(RentContractFileDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-04-22 + */ + void update(RentContractFileDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-04-22 + */ + void delete(String[] ids); +} \ 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/RentContractInfoService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java new file mode 100644 index 0000000..8175861 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java @@ -0,0 +1,78 @@ +package com.epmet.plugin.power.modules.rent.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.plugin.power.dto.rent.RentContractInfoDTO; +import com.epmet.plugin.power.modules.rent.entity.RentContractInfoEntity; + +import java.util.List; +import java.util.Map; + +/** + * 合同表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +public interface RentContractInfoService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-04-22 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-04-22 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return RentContractInfoDTO + * @author generator + * @date 2022-04-22 + */ + RentContractInfoDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-04-22 + */ + void save(RentContractInfoDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-04-22 + */ + void update(RentContractInfoDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-04-22 + */ + void delete(String[] ids); +} \ 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 new file mode 100644 index 0000000..ce6cffd --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentTenantInfoService.java @@ -0,0 +1,78 @@ +package com.epmet.plugin.power.modules.rent.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO; +import com.epmet.plugin.power.modules.rent.entity.RentTenantInfoEntity; + +import java.util.List; +import java.util.Map; + +/** + * 租客表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +public interface RentTenantInfoService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-04-22 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-04-22 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return RentTenantInfoDTO + * @author generator + * @date 2022-04-22 + */ + RentTenantInfoDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-04-22 + */ + void save(RentTenantInfoDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-04-22 + */ + void update(RentTenantInfoDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-04-22 + */ + void delete(String[] ids); +} \ 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 new file mode 100644 index 0000000..510ac3c --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java @@ -0,0 +1,87 @@ +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.plugin.power.modules.rent.dao.RentBlacklistDao; +import com.epmet.plugin.power.dto.rent.RentBlacklistDTO; +import com.epmet.plugin.power.modules.rent.entity.RentBlacklistEntity; +import com.epmet.plugin.power.modules.rent.redis.RentBlacklistRedis; +import com.epmet.plugin.power.modules.rent.service.RentBlacklistService; +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.List; +import java.util.Map; + +/** + * 黑名单表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Service +public class RentBlacklistServiceImpl extends BaseServiceImpl implements RentBlacklistService { + + @Autowired + private RentBlacklistRedis rentBlacklistRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, RentBlacklistDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, RentBlacklistDTO.class); + } + + 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); + + return wrapper; + } + + @Override + public RentBlacklistDTO get(String id) { + RentBlacklistEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, RentBlacklistDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(RentBlacklistDTO dto) { + RentBlacklistEntity entity = ConvertUtils.sourceToTarget(dto, RentBlacklistEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(RentBlacklistDTO dto) { + RentBlacklistEntity entity = ConvertUtils.sourceToTarget(dto, RentBlacklistEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ 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/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 new file mode 100644 index 0000000..f32f0b9 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractFileServiceImpl.java @@ -0,0 +1,87 @@ +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.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.entity.RentContractFileEntity; +import com.epmet.plugin.power.modules.rent.redis.RentContractFileRedis; +import com.epmet.plugin.power.modules.rent.service.RentContractFileService; +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.List; +import java.util.Map; + +/** + * 附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Service +public class RentContractFileServiceImpl extends BaseServiceImpl implements RentContractFileService { + + @Autowired + private RentContractFileRedis rentContractFileRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, RentContractFileDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, RentContractFileDTO.class); + } + + 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); + + return wrapper; + } + + @Override + public RentContractFileDTO get(String id) { + RentContractFileEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, RentContractFileDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(RentContractFileDTO dto) { + RentContractFileEntity entity = ConvertUtils.sourceToTarget(dto, RentContractFileEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(RentContractFileDTO dto) { + RentContractFileEntity entity = ConvertUtils.sourceToTarget(dto, RentContractFileEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ 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 new file mode 100644 index 0000000..9860ff6 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java @@ -0,0 +1,87 @@ +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.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.RentContractInfoDTO; +import com.epmet.plugin.power.modules.rent.entity.RentContractInfoEntity; +import com.epmet.plugin.power.modules.rent.redis.RentContractInfoRedis; +import com.epmet.plugin.power.modules.rent.service.RentContractInfoService; +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.List; +import java.util.Map; + +/** + * 合同表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Service +public class RentContractInfoServiceImpl extends BaseServiceImpl implements RentContractInfoService { + + @Autowired + private RentContractInfoRedis rentContractInfoRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, RentContractInfoDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, RentContractInfoDTO.class); + } + + 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); + + return wrapper; + } + + @Override + public RentContractInfoDTO get(String id) { + RentContractInfoEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, RentContractInfoDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(RentContractInfoDTO dto) { + RentContractInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentContractInfoEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(RentContractInfoDTO dto) { + RentContractInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentContractInfoEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ 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 new file mode 100644 index 0000000..c355ea5 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java @@ -0,0 +1,87 @@ +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.page.PageData; +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.modules.rent.entity.RentTenantInfoEntity; +import com.epmet.plugin.power.modules.rent.redis.RentTenantInfoRedis; +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.List; +import java.util.Map; + +/** + * 租客表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Service +public class RentTenantInfoServiceImpl extends BaseServiceImpl implements RentTenantInfoService { + + @Autowired + private RentTenantInfoRedis rentTenantInfoRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, RentTenantInfoDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, RentTenantInfoDTO.class); + } + + 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); + + return wrapper; + } + + @Override + public RentTenantInfoDTO get(String id) { + RentTenantInfoEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, RentTenantInfoDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(RentTenantInfoDTO dto) { + RentTenantInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentTenantInfoEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(RentTenantInfoDTO dto) { + RentTenantInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentTenantInfoEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ 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 new file mode 100644 index 0000000..e1ab439 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentBlacklistDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file 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 new file mode 100644 index 0000000..113e13c --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractFileDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ 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 new file mode 100644 index 0000000..e29ec50 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file 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 new file mode 100644 index 0000000..ddec336 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From b69d2d4d17017009147efbb0a74b97a37a6f4351 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Sun, 24 Apr 2022 16:22:42 +0800 Subject: [PATCH 02/20] =?UTF-8?q?=E8=A1=A5=E5=85=85=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E9=80=BB=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 From ce86526f3a890e7d82e8708fb0539dceef14f9ae Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Sun, 24 Apr 2022 16:52:17 +0800 Subject: [PATCH 03/20] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BF=85=E5=A1=AB?= =?UTF-8?q?=E9=A1=B9=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=9F=A5=E8=AF=A2=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/RentContractFileServiceImpl.java | 4 ++++ .../service/impl/RentContractInfoServiceImpl.java | 14 +++++++++++--- .../service/impl/RentTenantInfoServiceImpl.java | 8 ++++++-- 3 files changed, 21 insertions(+), 5 deletions(-) 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 49a6d8e..e362927 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 @@ -50,9 +50,13 @@ public class RentContractFileServiceImpl extends BaseServiceImpl getWrapper(Map params) { String id = (String) params.get(FieldConstant.ID_HUMP); + String referenceId = (String) params.get("referenceId"); + String fileType = (String) params.get("fileType"); QueryWrapper wrapper = new QueryWrapper<>(); 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; } 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 e0a0e86..a98971b 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 @@ -5,6 +5,8 @@ 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.exception.EpmetException; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.plugin.power.dto.rent.RentContractFileDTO; @@ -167,7 +169,9 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl tenantList = ConvertUtils.sourceToTarget(dto.getTenantList(), RentTenantInfoEntity.class); tenantList.forEach(tenant -> { if (StringUtils.isNotBlank(tenant.getId())) { @@ -182,7 +186,9 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl { - if (!tenant.getImgList().isEmpty()) { + if (tenant.getImgList().isEmpty()) { + throw new EpmetException("租客照片不能为空"); + } else { List imgList = ConvertUtils.sourceToTarget(tenant.getImgList(), RentContractFileEntity.class); imgList.forEach(img -> { img.setReferenceId(tenant.getId()); @@ -193,7 +199,9 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl fileList = ConvertUtils.sourceToTarget(dto.getFileList(), RentContractFileEntity.class); fileList.forEach(item -> { item.setReferenceId(contractId); 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 c8b7789..47590dc 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 @@ -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.RentTenantInfoDao; 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.redis.RentTenantInfoRedis; import com.epmet.plugin.power.modules.rent.service.RentTenantInfoService; @@ -50,9 +50,13 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl getWrapper(Map params) { String id = (String) params.get(FieldConstant.ID_HUMP); + String contractId = (String) params.get("contractId"); + String type = (String) params.get("type"); QueryWrapper wrapper = new QueryWrapper<>(); 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; } From 3b22c5a042ac000ae21113bf5bd52db8a901ef2b Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Sun, 24 Apr 2022 17:04:05 +0800 Subject: [PATCH 04/20] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../power/dto/rent/RentContractInfoDTO.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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 61e6a85..fa79a92 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 @@ -2,6 +2,8 @@ package com.epmet.plugin.power.dto.rent; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; import java.io.Serializable; import java.util.Date; import java.util.List; @@ -26,6 +28,7 @@ public class RentContractInfoDTO implements Serializable { /** * 网格ID */ + @NotBlank(message = "网格信息不能为空") private String gridId; /** @@ -36,6 +39,7 @@ public class RentContractInfoDTO implements Serializable { /** * 房屋小区ID */ + @NotBlank(message = "小区信息不能为空") private String villageId; /** @@ -46,6 +50,7 @@ public class RentContractInfoDTO implements Serializable { /** * 楼号ID */ + @NotBlank(message = "楼栋信息不能为空") private String buildId; /** @@ -56,6 +61,7 @@ public class RentContractInfoDTO implements Serializable { /** * 单元ID */ + @NotBlank(message = "单元信息不能为空") private String unitId; /** @@ -66,6 +72,7 @@ public class RentContractInfoDTO implements Serializable { /** * 房屋ID */ + @NotBlank(message = "房屋信息不能为空") private String homeId; /** @@ -76,6 +83,7 @@ public class RentContractInfoDTO implements Serializable { /** * 房主姓名 */ + @NotBlank(message = "房主信息不能为空") private String ownerName; /** @@ -86,36 +94,43 @@ public class RentContractInfoDTO implements Serializable { /** * 出租人姓名 */ + @NotBlank(message = "出租人姓名不能为空") private String lessorName; /** * 出租人身份证 */ + @NotBlank(message = "出租人身份证不能为空") private String lessorIdCard; /** * 出租人手机 */ + @NotBlank(message = "出租人手机不能为空") private String lessorMobile; /** * 承租人姓名 */ + @NotBlank(message = "承租人姓名不能为空") private String lesseeName; /** * 承租人身份证 */ + @NotBlank(message = "承租人身份证不能为空") private String lesseeIdCard; /** * 承租人手机 */ + @NotBlank(message = "承租人手机不能为空") private String lesseeMobile; /** * 签署日期 */ + @NotBlank(message = "签订时间不能为空") private String signDate; /** @@ -126,11 +141,13 @@ public class RentContractInfoDTO implements Serializable { /** * 合同开始日期 */ + @NotBlank(message = "合同开始时间不能为空") private String startDate; /** * 合同结束日期 */ + @NotBlank(message = "合同结束时间不能为空") private String endDate; /** @@ -171,11 +188,13 @@ public class RentContractInfoDTO implements Serializable { /** * 租客列表 */ + @NotEmpty private List tenantList; /** * 附件列表 */ + @NotEmpty private List fileList; } \ No newline at end of file From 73ca308db4ae3d214780f7e614bc87c61e8deda4 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Sun, 24 Apr 2022 17:31:42 +0800 Subject: [PATCH 05/20] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E9=BB=91=E5=90=8D=E5=8D=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../power/dto/rent/RentBlacklistDTO.java | 3 +++ .../power/dto/rent/RentContractInfoDTO.java | 4 ++++ .../modules/rent/dao/RentContractInfoDao.java | 15 ++++++++++++- .../impl/RentBlacklistServiceImpl.java | 22 +++++++++++++------ .../impl/RentContractInfoServiceImpl.java | 10 ++++----- .../mapper/rent/RentContractInfoDao.xml | 10 ++++++++- 6 files changed, 49 insertions(+), 15 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentBlacklistDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentBlacklistDTO.java index 0c55a06..8c98b7b 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentBlacklistDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentBlacklistDTO.java @@ -4,6 +4,8 @@ import java.io.Serializable; import java.util.Date; import lombok.Data; +import javax.validation.constraints.NotBlank; + /** * 黑名单表 @@ -34,6 +36,7 @@ public class RentBlacklistDTO implements Serializable { /** * 身份证 */ + @NotBlank(message = "身份证不能为空") private String idCard; /** 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 fa79a92..eafdb9c 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 @@ -197,4 +197,8 @@ public class RentContractInfoDTO implements Serializable { @NotEmpty private List fileList; + /** + * 是否黑名单 + */ + private String isBlack; } \ 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/RentContractInfoDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentContractInfoDao.java index 5627f0e..52eb08e 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentContractInfoDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentContractInfoDao.java @@ -1,9 +1,13 @@ package com.epmet.plugin.power.modules.rent.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.plugin.power.dto.rent.RentContractInfoDTO; import com.epmet.plugin.power.modules.rent.entity.RentContractInfoEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; +import java.util.Map; + /** * 合同表 * @@ -12,5 +16,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface RentContractInfoDao extends BaseDao { - + + /** + * 获取合同列表 + * + * @param params + * @return java.util.List + * @author zhy + * @date 2022/4/24 17:18 + */ + List getContractInfoList(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 1272ce8..e27c9e5 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 @@ -3,6 +3,7 @@ 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.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; @@ -17,6 +18,7 @@ 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; @@ -48,13 +50,13 @@ 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"); + private QueryWrapper 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); @@ -76,6 +78,12 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl params = new HashMap<>(4); + params.put("idCard", dto.getIdCard()); + if (!list(params).isEmpty()) { + throw new EpmetException("该人员已经在黑名单"); + } + RentBlacklistEntity entity = ConvertUtils.sourceToTarget(dto, RentBlacklistEntity.class); insert(entity); } 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 a98971b..894bd92 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 @@ -6,7 +6,6 @@ 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.exception.EpmetException; -import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.plugin.power.dto.rent.RentContractFileDTO; @@ -50,11 +49,10 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, RentContractInfoDTO.class); + IPage page = getPage(params); + List list = baseDao.getContractInfoList(params); + return new PageData<>(list, page.getTotal()); + } @Override 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 af402ab..6d550e2 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 @@ -33,5 +33,13 @@ - + \ No newline at end of file From 1a963cb5a39f81dbfe77d274754ee0a0e4fc24fd Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 25 Apr 2022 13:21:58 +0800 Subject: [PATCH 06/20] =?UTF-8?q?=E6=9C=AC=E6=9C=BAnacos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pli-power-base/pli-power-base-server/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml index 770b347..0009c57 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml @@ -187,7 +187,7 @@ false - 192.168.43.218 + 192.168.43.98 false From 027c8249ffb7be80bdfe9012c1f377de5f275b56 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 25 Apr 2022 16:16:18 +0800 Subject: [PATCH 07/20] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/rent/RentContractInfoDao.xml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) 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 6d550e2..0e27096 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 @@ -41,5 +41,58 @@ FROM pli_rent_contract_info i LEFT JOIN pli_rent_blacklist b ON i.LESSEE_ID_CARD = b.ID_CARD + + + AND i.GRID_ID = #{gridId} + + + AND i.VILLAGE_ID = #{villageId} + + + AND i.BUILD_ID = #{buildId} + + + AND i.UNIT_ID = #{unitId} + + + AND i.HOME_ID = #{homeId} + + + AND i.STATE = #{state} + + + AND i.LESSOR_NAME = #{lessorName} + + + AND i.LESSOR_ID_CARD = #{lessorIdCard} + + + AND i.LESSOR_MOBILE = #{lessorMobile} + + + AND i.LESSEE_NAME = #{lesseeName} + + + AND i.LESSEE_ID_CARD = #{lesseeIdCard} + + + AND i.LESSEE_MOBILE = #{lesseeMobile} + + + AND i.REVIEW_DATE >= #{reviewStartTime} + + + AND i.REVIEW_DATE <= #{reviewEndTime} + + + AND i.SIGN_DATE >= #{signStartTime} + + + AND i.SIGN_DATE <= #{signEndTime} + + + AND REFERENCE_ID = #{endDate} + + \ No newline at end of file From 7eb364374d0ffad78b30993880352776dc5e8bdd Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 25 Apr 2022 17:59:42 +0800 Subject: [PATCH 08/20] =?UTF-8?q?=E7=A7=9F=E6=88=B7=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java | 5 +++++ .../rent/service/impl/RentContractInfoServiceImpl.java | 1 + 2 files changed, 6 insertions(+) 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 eafdb9c..442fc6e 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 @@ -86,6 +86,11 @@ public class RentContractInfoDTO implements Serializable { @NotBlank(message = "房主信息不能为空") private String ownerName; + /** + * 租户数 + */ + private Integer tenantNum; + /** * 状态:0未审核,1审核通过,2审核不通过 */ 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 894bd92..6ec64da 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 @@ -126,6 +126,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl Date: Tue, 26 Apr 2022 09:29:39 +0800 Subject: [PATCH 09/20] =?UTF-8?q?=E6=88=BF=E4=B8=9C=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/RentContractInfoController.java | 9 +++++++++ .../rent/service/RentContractInfoService.java | 10 ++++++++++ .../impl/RentContractInfoServiceImpl.java | 10 ++++++++++ .../impl/RentTenantInfoServiceImpl.java | 18 ++++++++++++++++++ 4 files changed, 47 insertions(+) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java index 6659de5..f66d4b6 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java @@ -54,6 +54,15 @@ public class RentContractInfoController { return new Result(); } + @NoRepeatSubmit + @PostMapping("review") + public Result review(@RequestBody RentContractInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + rentContractInfoService.review(dto); + return new Result(); + } + @NoRepeatSubmit @PostMapping("update") public Result update(@RequestBody RentContractInfoDTO dto){ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java index 8175861..e114863 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java @@ -56,6 +56,16 @@ public interface RentContractInfoService extends BaseService page(Map params) { IPage page = baseDao.selectPage( @@ -72,6 +79,17 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl imgList = ConvertUtils.sourceToTarget(dto.getImgList(), RentContractFileEntity.class); + imgList.forEach(img -> { + img.setReferenceId(entity.getId()); + img.setFileType(NumConstant.ZERO_STR); + }); + rentContractFileService.insertBatch(imgList); + } } @Override From b117ffb08571fc2c1bcf155a5dc4603cd94bd184 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Tue, 26 Apr 2022 15:38:01 +0800 Subject: [PATCH 10/20] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AE=A2=E6=88=B7ID?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=EF=BC=8C=E5=A2=9E=E5=8A=A0=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E4=BA=A7=E5=93=81feign=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pli-power-base/pli-power-base-server/pom.xml | 2 +- .../modules/rent/entity/RentBlacklistEntity.java | 5 +++++ .../rent/entity/RentContractFileEntity.java | 5 +++++ .../rent/entity/RentContractInfoEntity.java | 5 +++++ .../modules/rent/entity/RentTenantInfoEntity.java | 5 +++++ .../service/impl/RentBlacklistServiceImpl.java | 5 +++++ .../service/impl/RentContractInfoServiceImpl.java | 12 ++++++++++-- .../service/impl/RentTenantInfoServiceImpl.java | 15 +++++++++++++-- 8 files changed, 49 insertions(+), 5 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml index eb336a1..3d3ac34 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml @@ -187,7 +187,7 @@ false - 192.168.43.98 + 192.168.43.168 false diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentBlacklistEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentBlacklistEntity.java index 4a5d593..a9bb81e 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentBlacklistEntity.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentBlacklistEntity.java @@ -71,4 +71,9 @@ public class RentBlacklistEntity extends BaseEpmetEntity { */ private String removeReason; + /** + * 客户ID + */ + private String customerId; + } 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 9f63ed0..d423815 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 @@ -36,4 +36,9 @@ public class RentContractFileEntity extends BaseEpmetEntity { */ private String fileType; + /** + * 客户ID + */ + private String customerId; + } 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 42da24a..b80f5f2 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 @@ -136,4 +136,9 @@ public class RentContractInfoEntity extends BaseEpmetEntity { */ private String reason; + /** + * 客户ID + */ + private String customerId; + } 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 004388d..5aec950 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 @@ -54,6 +54,11 @@ public class RentTenantInfoEntity extends BaseEpmetEntity { */ private String type; + /** + * 客户ID + */ + private String customerId; + /** * 头像列表 */ 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 e27c9e5..aa90430 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 @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.plugin.power.modules.rent.dao.RentBlacklistDao; @@ -34,6 +35,9 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -85,6 +89,7 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl { img.setReferenceId(tenant.getId()); img.setFileType(NumConstant.ZERO_STR); + img.setCustomerId(loginUserUtil.getLoginUserCustomerId()); }); rentContractFileService.insertBatch(imgList); } @@ -215,6 +222,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl { item.setReferenceId(contractId); item.setFileType(NumConstant.ONE_STR); + item.setCustomerId(loginUserUtil.getLoginUserCustomerId()); }); rentContractFileService.insertBatch(fileList); } 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 6c7162a..f7efe24 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 @@ -7,6 +7,7 @@ import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO; import com.epmet.plugin.power.modules.rent.dao.RentTenantInfoDao; @@ -36,6 +37,9 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl imgList = ConvertUtils.sourceToTarget(dto.getImgList(), RentContractFileEntity.class); imgList.forEach(img -> { img.setReferenceId(entity.getId()); img.setFileType(NumConstant.ZERO_STR); + img.setCustomerId(loginUserUtil.getLoginUserCustomerId()); }); rentContractFileService.insertBatch(imgList); } + + if (NumConstant.ZERO_STR.equals(dto.getType())) { + // todo 更新头像到产品人员库 + } } @Override From 5f5ebde53e002bf6223c6c40acb060620abd1ba3 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Wed, 27 Apr 2022 10:13:22 +0800 Subject: [PATCH 11/20] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E7=B1=BB=E4=B8=BArenexception?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../power/dto/rent/RentContractInfoDTO.java | 10 +++++++ .../pli-power-base-server/pom.xml | 8 +++++- .../controller/RentBlacklistController.java | 2 +- .../rent/entity/RentContractInfoEntity.java | 10 +++++++ .../impl/RentBlacklistServiceImpl.java | 28 +++++++++++++++---- .../impl/RentContractInfoServiceImpl.java | 8 +++--- .../impl/RentTenantInfoServiceImpl.java | 4 +-- 7 files changed, 56 insertions(+), 14 deletions(-) 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 442fc6e..0431d6b 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 @@ -25,6 +25,16 @@ public class RentContractInfoDTO implements Serializable { */ private String id; + /** + * 社区ID + */ + private String communityId; + + /** + * 社区 + */ + private String communityName; + /** * 网格ID */ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml index 3d3ac34..ba1db0d 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml @@ -20,6 +20,12 @@ 2.0.0 + + com.epmet + epmet-user-client + 2.0.0 + + com.epmet epmet-plugins-common @@ -187,7 +193,7 @@ false - 192.168.43.168 + 192.168.43.26 false diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentBlacklistController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentBlacklistController.java index 3ef97f5..12ac4ce 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentBlacklistController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentBlacklistController.java @@ -63,7 +63,7 @@ public class RentBlacklistController { return new Result(); } - @PostMapping("delete") + @DeleteMapping("delete") public Result delete(@RequestBody String[] ids){ //效验数据 AssertUtils.isArrayEmpty(ids, "id"); 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 b80f5f2..11b0433 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 @@ -21,6 +21,16 @@ public class RentContractInfoEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; + /** + * 社区ID + */ + private String communityId; + + /** + * 社区 + */ + private String communityName; + /** * 网格ID */ 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 aa90430..28204a4 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 @@ -3,11 +3,17 @@ 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.exception.EpmetException; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.RentTenantDataFormDTO; +import com.epmet.dto.result.RentTenantDataResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.plugin.power.modules.rent.dao.RentBlacklistDao; import com.epmet.plugin.power.dto.rent.RentBlacklistDTO; import com.epmet.plugin.power.modules.rent.entity.RentBlacklistEntity; @@ -18,10 +24,7 @@ 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; +import java.util.*; /** * 黑名单表 @@ -35,6 +38,9 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl result = client.tenantData(formDTO); + + dto.setIdCard(result.getData().getIdCard()); + dto.setMobile(result.getData().getMobile()); Map params = new HashMap<>(4); params.put("idCard", dto.getIdCard()); if (!list(params).isEmpty()) { - throw new EpmetException("该人员已经在黑名单"); + throw new RenException("该人员已经在黑名单"); } + dto.setJoinDate(DateUtils.format(new Date())); RentBlacklistEntity entity = ConvertUtils.sourceToTarget(dto, RentBlacklistEntity.class); entity.setCustomerId(loginUserUtil.getLoginUserCustomerId()); insert(entity); @@ -96,8 +110,10 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl tenantList = ConvertUtils.sourceToTarget(dto.getTenantList(), RentTenantInfoEntity.class); tenantList.forEach(tenant -> { @@ -202,7 +202,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl { if (tenant.getImgList().isEmpty()) { - throw new EpmetException("租客照片不能为空"); + throw new RenException("租客照片不能为空"); } else { List imgList = ConvertUtils.sourceToTarget(tenant.getImgList(), RentContractFileEntity.class); imgList.forEach(img -> { @@ -216,7 +216,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl fileList = ConvertUtils.sourceToTarget(dto.getFileList(), RentContractFileEntity.class); fileList.forEach(item -> { 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 f7efe24..fb2c69f 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 @@ -5,7 +5,7 @@ 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.exception.EpmetException; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; @@ -83,7 +83,7 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl Date: Wed, 27 Apr 2022 15:45:38 +0800 Subject: [PATCH 12/20] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=88=BF=E4=B8=9C?= =?UTF-8?q?=E7=9A=84=E5=A4=B4=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../power/dto/rent/RentBlacklistDTO.java | 38 +++-------------- .../power/dto/rent/RentContractInfoDTO.java | 31 -------------- .../power/dto/rent/RentTenantInfoDTO.java | 42 ++++--------------- .../pli-power-base-server/pom.xml | 2 +- .../controller/RentBlacklistController.java | 16 ++++--- .../rent/service/RentBlacklistService.java | 3 +- .../impl/RentBlacklistServiceImpl.java | 19 +++++---- .../impl/RentContractInfoServiceImpl.java | 16 ++++--- .../impl/RentTenantInfoServiceImpl.java | 34 ++++++++++++--- 9 files changed, 76 insertions(+), 125 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentBlacklistDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentBlacklistDTO.java index 8c98b7b..f0ff8cb 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentBlacklistDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentBlacklistDTO.java @@ -1,10 +1,9 @@ package com.epmet.plugin.power.dto.rent; -import java.io.Serializable; -import java.util.Date; import lombok.Data; import javax.validation.constraints.NotBlank; +import java.io.Serializable; /** @@ -26,11 +25,13 @@ public class RentBlacklistDTO implements Serializable { /** * epmet用户主键 */ + @NotBlank(message = "用户ID不能为空") private String userId; /** * 姓名 */ + @NotBlank(message = "姓名不能为空") private String name; /** @@ -42,16 +43,19 @@ public class RentBlacklistDTO implements Serializable { /** * 手机号 */ + @NotBlank(message = "手机号不能为空") private String mobile; /** * 性别 0女 1男 */ + @NotBlank(message = "性别不能为空") private String gender; /** * 类型 0 租客 1 房东 */ + @NotBlank(message = "人员类型不能为空") private String type; /** @@ -74,34 +78,4 @@ public class RentBlacklistDTO implements Serializable { */ private String removeReason; - /** - * 删除标记 0:未删除,1:已删除 - */ - private String delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; - } \ 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/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 0431d6b..c540588 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 @@ -5,7 +5,6 @@ import lombok.Data; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotEmpty; import java.io.Serializable; -import java.util.Date; import java.util.List; @@ -170,36 +169,6 @@ public class RentContractInfoDTO implements Serializable { */ private String reason; - /** - * 删除标记 0:未删除,1:已删除 - */ - private String delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; - /** * 租客列表 */ 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 80525ea..e7ffb7b 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 @@ -1,11 +1,12 @@ package com.epmet.plugin.power.dto.rent; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; import java.io.Serializable; -import java.util.Date; import java.util.List; -import lombok.Data; - /** * 租客表 @@ -31,16 +32,19 @@ public class RentTenantInfoDTO implements Serializable { /** * 姓名 */ + @NotBlank(message = "姓名不能为空") private String name; /** * 身份证 */ + @NotBlank(message = "身份证不能为空") private String idCard; /** * 手机号 */ + @NotBlank(message = "手机号不能为空") private String mobile; /** @@ -51,41 +55,13 @@ public class RentTenantInfoDTO implements Serializable { /** * 人员类型 0:房东 1:租客 */ + @NotBlank(message = "人员类型不能为空") private String type; - /** - * 删除标记 0:未删除,1:已删除 - */ - private String delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; - /** * 头像列表 */ + @NotEmpty private List imgList; } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml index ba1db0d..cca48e1 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml @@ -193,7 +193,7 @@ false - 192.168.43.26 + 192.168.43.104 false diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentBlacklistController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentBlacklistController.java index 12ac4ce..a7f68f2 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentBlacklistController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentBlacklistController.java @@ -34,29 +34,28 @@ public class RentBlacklistController { private RentBlacklistService rentBlacklistService; @RequestMapping("page") - public Result> page(@RequestParam Map params){ + public Result> page(@RequestParam Map params) { PageData page = rentBlacklistService.page(params); return new Result>().ok(page); } - @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) - public Result get(@PathVariable("id") String id){ + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id) { RentBlacklistDTO data = rentBlacklistService.get(id); return new Result().ok(data); } @NoRepeatSubmit @PostMapping("save") - public Result save(@RequestBody RentBlacklistDTO dto){ + public Result save(@RequestBody RentBlacklistDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - rentBlacklistService.save(dto); - return new Result(); + return rentBlacklistService.save(dto); } @NoRepeatSubmit @PostMapping("update") - public Result update(@RequestBody RentBlacklistDTO dto){ + public Result update(@RequestBody RentBlacklistDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); rentBlacklistService.update(dto); @@ -64,7 +63,7 @@ public class RentBlacklistController { } @DeleteMapping("delete") - public Result delete(@RequestBody String[] ids){ + public Result delete(@RequestBody String[] ids) { //效验数据 AssertUtils.isArrayEmpty(ids, "id"); rentBlacklistService.delete(ids); @@ -78,5 +77,4 @@ public class RentBlacklistController { } - } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentBlacklistService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentBlacklistService.java index 13fe18e..8f9b8a5 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentBlacklistService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentBlacklistService.java @@ -2,6 +2,7 @@ package com.epmet.plugin.power.modules.rent.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; import com.epmet.plugin.power.dto.rent.RentBlacklistDTO; import com.epmet.plugin.power.modules.rent.entity.RentBlacklistEntity; @@ -54,7 +55,7 @@ public interface RentBlacklistService extends BaseService { * @author generator * @date 2022-04-22 */ - void save(RentBlacklistDTO dto); + Result save(RentBlacklistDTO dto); /** * 默认更新 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 28204a4..38805dd 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 @@ -3,19 +3,20 @@ 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.NumConstant; -import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.form.RentTenantDataFormDTO; import com.epmet.dto.result.RentTenantDataResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; -import com.epmet.plugin.power.modules.rent.dao.RentBlacklistDao; import com.epmet.plugin.power.dto.rent.RentBlacklistDTO; +import com.epmet.plugin.power.modules.rent.dao.RentBlacklistDao; import com.epmet.plugin.power.modules.rent.entity.RentBlacklistEntity; import com.epmet.plugin.power.modules.rent.redis.RentBlacklistRedis; import com.epmet.plugin.power.modules.rent.service.RentBlacklistService; @@ -39,7 +40,7 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl result = client.tenantData(formDTO); + ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class); + Result result = epmetUserOpenFeignClient.tenantData(formDTO); dto.setIdCard(result.getData().getIdCard()); dto.setMobile(result.getData().getMobile()); Map params = new HashMap<>(4); params.put("idCard", dto.getIdCard()); if (!list(params).isEmpty()) { - throw new RenException("该人员已经在黑名单"); + return new Result().error("该人员已经在黑名单"); } dto.setJoinDate(DateUtils.format(new Date())); RentBlacklistEntity entity = ConvertUtils.sourceToTarget(dto, RentBlacklistEntity.class); entity.setCustomerId(loginUserUtil.getLoginUserCustomerId()); insert(entity); + return new Result(); } @Override 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 4235406..4acff95 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 @@ -5,7 +5,8 @@ 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.exception.RenException; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; @@ -155,8 +156,13 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl{ + + + + }); } } @@ -184,7 +190,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl tenantList = ConvertUtils.sourceToTarget(dto.getTenantList(), RentTenantInfoEntity.class); tenantList.forEach(tenant -> { @@ -202,7 +208,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl { if (tenant.getImgList().isEmpty()) { - throw new RenException("租客照片不能为空"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "租客照片不能为空"); } else { List imgList = ConvertUtils.sourceToTarget(tenant.getImgList(), RentContractFileEntity.class); imgList.forEach(img -> { @@ -216,7 +222,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl fileList = ConvertUtils.sourceToTarget(dto.getFileList(), RentContractFileEntity.class); fileList.forEach(item -> { 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 fb2c69f..17b84e9 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 @@ -5,10 +5,15 @@ 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.exception.RenException; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dto.IcResiUserAttachmentDTO; +import com.epmet.dto.form.RentTenantFormDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; 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.RentContractFileEntity; @@ -21,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -40,6 +46,12 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl images = new ArrayList<>(); // 处理头像 if (dto.getImgList().isEmpty()) { - throw new RenException("照片不能为空"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "照片不能为空"); } else { RentTenantInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentTenantInfoEntity.class); entity.setCustomerId(loginUserUtil.getLoginUserCustomerId()); @@ -94,12 +107,23 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl Date: Wed, 27 Apr 2022 17:36:05 +0800 Subject: [PATCH 13/20] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E4=BF=9D=E5=AD=98=E5=B1=85=E6=B0=91=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=92=8C=E5=A4=B4=E5=83=8F=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/RentBlacklistServiceImpl.java | 2 +- .../impl/RentContractInfoServiceImpl.java | 58 +++++++++++++++++-- .../impl/RentTenantInfoServiceImpl.java | 7 +-- 3 files changed, 55 insertions(+), 12 deletions(-) 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 38805dd..6849786 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 @@ -93,7 +93,7 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl result = epmetUserOpenFeignClient.tenantData(formDTO); + Result result = epmetUserOpenFeignClient.getRentResiUserInfo(formDTO); dto.setIdCard(result.getData().getIdCard()); dto.setMobile(result.getData().getMobile()); 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 4acff95..2f8223c 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 @@ -10,6 +10,14 @@ import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.IcResiUserAttachmentDTO; +import com.epmet.dto.IcResiUserDTO; +import com.epmet.dto.form.RentTenantFormDTO; +import com.epmet.dto.result.GridInfoResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.plugin.power.dto.rent.RentContractFileDTO; import com.epmet.plugin.power.dto.rent.RentContractInfoDTO; import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO; @@ -26,10 +34,7 @@ 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; +import java.util.*; /** * 合同表 @@ -46,6 +51,12 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl{ + dto.getTenantList().forEach(tenant -> { + RentTenantFormDTO formDTO = new RentTenantFormDTO(); + List images = new ArrayList<>(); + formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + formDTO.setIdCard(tenant.getIdCard()); + formDTO.setImages(images); + formDTO.setType(NumConstant.ONE_STR); + + tenant.getImgList().forEach(img -> { + // 更新基础库的人员头像 + IcResiUserAttachmentDTO image = new IcResiUserAttachmentDTO(); + image.setAttachmentUrl(img.getFileUrl()); + image.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + images.add(image); + }); + formDTO.setImages(images); + + // 初始化居民信息 + IcResiUserDTO user = new IcResiUserDTO(); + user.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + user.setGridId(dto.getGridId()); + user.setVillageId(dto.getVillageId()); + user.setBuildId(dto.getBuildId()); + user.setUnitId(dto.getUnitId()); + user.setHomeId(dto.getHomeId()); + user.setName(tenant.getName()); + user.setIdCard(tenant.getIdCard()); + user.setMobile(tenant.getMobile()); + + Result gridInfo = govOrgOpenFeignClient.queryGridInfo(dto.getGridId()); + user.setAgencyId(gridInfo.getData().getParentAgencyId()); + Result agencyInfo = govOrgOpenFeignClient.getAgencyById(gridInfo.getData().getParentAgencyId()); + user.setPids(agencyInfo.getData().getPids()); + + formDTO.setUser(user); + epmetUserOpenFeignClient.updateImage(formDTO); }); 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 17b84e9..e4a48bc 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 @@ -13,7 +13,6 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dto.IcResiUserAttachmentDTO; import com.epmet.dto.form.RentTenantFormDTO; import com.epmet.feign.EpmetUserOpenFeignClient; -import com.epmet.feign.GovOrgOpenFeignClient; 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.RentContractFileEntity; @@ -49,9 +48,6 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl Date: Wed, 27 Apr 2022 17:45:01 +0800 Subject: [PATCH 14/20] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=BF=85=E5=AE=9A=E5=AD=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rent/service/impl/RentContractInfoServiceImpl.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 2f8223c..479898d 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 @@ -15,7 +15,6 @@ import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.IcResiUserAttachmentDTO; import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.form.RentTenantFormDTO; -import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.plugin.power.dto.rent.RentContractFileDTO; @@ -198,9 +197,8 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl gridInfo = govOrgOpenFeignClient.queryGridInfo(dto.getGridId()); - user.setAgencyId(gridInfo.getData().getParentAgencyId()); - Result agencyInfo = govOrgOpenFeignClient.getAgencyById(gridInfo.getData().getParentAgencyId()); + user.setAgencyId(dto.getCommunityId()); + Result agencyInfo = govOrgOpenFeignClient.getAgencyById(dto.getCommunityId()); user.setPids(agencyInfo.getData().getPids()); formDTO.setUser(user); From 6be59ae7e14233f13b3d36691c1cbc86921599d5 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Wed, 27 Apr 2022 18:34:47 +0800 Subject: [PATCH 15/20] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E9=83=A8=E5=88=86=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RentContractInfoController.java | 20 ++++++++---------- .../controller/RentTenantInfoController.java | 3 +-- .../rent/service/RentContractInfoService.java | 3 ++- .../rent/service/RentTenantInfoService.java | 3 ++- .../impl/RentContractInfoServiceImpl.java | 7 ++++--- .../impl/RentTenantInfoServiceImpl.java | 21 ++++++++++++------- 6 files changed, 31 insertions(+), 26 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java index f66d4b6..de058a8 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java @@ -7,8 +7,8 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.plugin.power.dto.rent.RentContractInfoDTO; import com.epmet.plugin.power.modules.rent.excel.RentContractInfoExcel; import com.epmet.plugin.power.modules.rent.service.RentContractInfoService; @@ -34,29 +34,28 @@ public class RentContractInfoController { private RentContractInfoService rentContractInfoService; @RequestMapping("page") - public Result> page(@RequestParam Map params){ + public Result> page(@RequestParam Map params) { PageData page = rentContractInfoService.page(params); return new Result>().ok(page); } - @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) - public Result get(@PathVariable("id") String id){ + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id) { RentContractInfoDTO data = rentContractInfoService.get(id); return new Result().ok(data); } @NoRepeatSubmit @PostMapping("save") - public Result save(@RequestBody RentContractInfoDTO dto){ + public Result save(@RequestBody RentContractInfoDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - rentContractInfoService.save(dto); - return new Result(); + return rentContractInfoService.save(dto); } @NoRepeatSubmit @PostMapping("review") - public Result review(@RequestBody RentContractInfoDTO dto){ + public Result review(@RequestBody RentContractInfoDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); rentContractInfoService.review(dto); @@ -65,7 +64,7 @@ public class RentContractInfoController { @NoRepeatSubmit @PostMapping("update") - public Result update(@RequestBody RentContractInfoDTO dto){ + public Result update(@RequestBody RentContractInfoDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); rentContractInfoService.update(dto); @@ -73,7 +72,7 @@ public class RentContractInfoController { } @PostMapping("delete") - public Result delete(@RequestBody String[] ids){ + public Result delete(@RequestBody String[] ids) { //效验数据 AssertUtils.isArrayEmpty(ids, "id"); rentContractInfoService.delete(ids); @@ -87,5 +86,4 @@ public class RentContractInfoController { } - } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java index 4fb8f7a..ad5d1b2 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java @@ -50,8 +50,7 @@ public class RentTenantInfoController { public Result save(@RequestBody RentTenantInfoDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - rentTenantInfoService.save(dto); - return new Result(); + return rentTenantInfoService.save(dto); } @NoRepeatSubmit diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java index e114863..5a552ea 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java @@ -2,6 +2,7 @@ package com.epmet.plugin.power.modules.rent.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; import com.epmet.plugin.power.dto.rent.RentContractInfoDTO; import com.epmet.plugin.power.modules.rent.entity.RentContractInfoEntity; @@ -54,7 +55,7 @@ public interface RentContractInfoService extends BaseService * @author generator * @date 2022-04-22 */ - void save(RentTenantInfoDTO dto); + Result save(RentTenantInfoDTO dto); /** * 默认更新 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 479898d..c407ffc 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 @@ -154,11 +154,11 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl params = new HashMap<>(8); params.put("contractId", contractId); params.put("referenceId", contractId); @@ -276,6 +276,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl getWrapper(Map params) { String id = (String) params.get(FieldConstant.ID_HUMP); String contractId = (String) params.get("contractId"); + String idCard = (String) params.get("idCard"); String type = (String) params.get("type"); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); wrapper.eq(StringUtils.isNotBlank(contractId), "CONTRACT_ID", contractId); + wrapper.eq(StringUtils.isNotBlank(idCard), "ID_CARD", idCard); wrapper.eq(StringUtils.isNotBlank(type), "TYPE", type); return wrapper; @@ -88,11 +86,17 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl params = new HashMap<>(4); + params.put("idCard",dto.getIdCard()); + if(!list(params).isEmpty()){ + return new Result().error("用户已存在"); + } + List images = new ArrayList<>(); // 处理头像 if (dto.getImgList().isEmpty()) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "照片不能为空"); + return new Result().error("照片不能为空"); } else { RentTenantInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentTenantInfoEntity.class); entity.setCustomerId(loginUserUtil.getLoginUserCustomerId()); @@ -122,6 +126,7 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl Date: Thu, 28 Apr 2022 09:20:16 +0800 Subject: [PATCH 16/20] =?UTF-8?q?=E8=BA=AB=E4=BB=BD=E8=AF=81=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/RentContractInfoServiceImpl.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 c407ffc..2fb3100 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 @@ -34,6 +34,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.*; +import java.util.stream.Collectors; /** * 合同表 @@ -133,6 +134,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl tenantList = rentTenantInfoService.list(params); + tenantList.forEach(item -> { // 租客信息补充照片信息 params.put("referenceId", item.getId()); @@ -234,9 +236,14 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl tenantList = ConvertUtils.sourceToTarget(dto.getTenantList(), RentTenantInfoEntity.class); + long idCardNum = tenantList.stream().map(RentTenantInfoEntity::getIdCard).collect(Collectors.toList()).stream().distinct().count(); + if (tenantList.size() != idCardNum) { + return new Result().error("租客身份证重复"); + } + tenantList.forEach(tenant -> { if (StringUtils.isNotBlank(tenant.getId())) { // 如果是修改,先删除之前的头像 @@ -266,7 +273,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl fileList = ConvertUtils.sourceToTarget(dto.getFileList(), RentContractFileEntity.class); fileList.forEach(item -> { From 569a0686b65a41dc97b18d8710fb649a4a02cd78 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 28 Apr 2022 09:32:38 +0800 Subject: [PATCH 17/20] =?UTF-8?q?=E7=A7=9F=E5=AE=A2=E8=BA=AB=E4=BB=BD?= =?UTF-8?q?=E8=AF=81=E9=87=8D=E5=A4=8D=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rent/service/impl/RentContractInfoServiceImpl.java | 6 +++--- .../rent/service/impl/RentTenantInfoServiceImpl.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) 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 2fb3100..bb47a4f 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 @@ -235,7 +235,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl tenantList = ConvertUtils.sourceToTarget(dto.getTenantList(), RentTenantInfoEntity.class); @@ -258,7 +258,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl { - if (tenant.getImgList().isEmpty()) { + if (null == tenant.getImgList() || tenant.getImgList().isEmpty()) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "租客照片不能为空"); } else { List imgList = ConvertUtils.sourceToTarget(tenant.getImgList(), RentContractFileEntity.class); @@ -272,7 +272,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl fileList = ConvertUtils.sourceToTarget(dto.getFileList(), RentContractFileEntity.class); 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 721f145..80eb329 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 @@ -88,14 +88,14 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl params = new HashMap<>(4); - params.put("idCard",dto.getIdCard()); - if(!list(params).isEmpty()){ + params.put("idCard", dto.getIdCard()); + if (!list(params).isEmpty()) { return new Result().error("用户已存在"); } List images = new ArrayList<>(); // 处理头像 - if (dto.getImgList().isEmpty()) { + if (null == dto.getImgList() || dto.getImgList().isEmpty()) { return new Result().error("照片不能为空"); } else { RentTenantInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentTenantInfoEntity.class); From 2968473e9cd8e6bc36476a83cf85d479972f906c Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 28 Apr 2022 10:34:01 +0800 Subject: [PATCH 18/20] =?UTF-8?q?=E5=90=88=E5=90=8C=E7=9A=84=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/RentContractInfoServiceImpl.java | 9 +------ .../mapper/rent/RentContractInfoDao.xml | 24 +++++++++++++++---- 2 files changed, 20 insertions(+), 13 deletions(-) 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 bb47a4f..285ff8f 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 @@ -94,10 +94,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); @@ -114,10 +111,6 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl AND i.REVIEW_DATE <= #{reviewEndTime} - - AND i.SIGN_DATE >= #{signStartTime} + + AND i.SIGN_DATE >= #{startTime} - - AND i.SIGN_DATE <= #{signEndTime} + + AND i.SIGN_DATE <= #{endTime} - AND REFERENCE_ID = #{endDate} + + AND DATE( i.END_DATE ) <= DATE_ADD( curdate(), INTERVAL 1 MONTH ) + AND DATE( i.END_DATE ) > CURDATE() + + + AND DATE( i.END_DATE ) <= DATE_ADD( curdate(), INTERVAL 2 MONTH ) + AND DATE( i.END_DATE ) > CURDATE() + + + AND DATE( i.END_DATE ) <= DATE_ADD( curdate(), INTERVAL 3 MONTH ) + AND DATE( i.END_DATE ) > CURDATE() + + + AND DATE( i.END_DATE ) <= CURDATE() + From 894922bb1708d8d77fe528850ec4b76ae922a621 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 28 Apr 2022 10:36:48 +0800 Subject: [PATCH 19/20] =?UTF-8?q?=E5=8F=98=E6=9B=B4=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E4=B8=BAdeletemapping?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/rent/controller/RentContractInfoController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java index de058a8..fcbfb40 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java @@ -71,7 +71,7 @@ public class RentContractInfoController { return new Result(); } - @PostMapping("delete") + @DeleteMapping("delete") public Result delete(@RequestBody String[] ids) { //效验数据 AssertUtils.isArrayEmpty(ids, "id"); From 78f9fe6f8348873473597ea5ed00c1725c30ad56 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 28 Apr 2022 14:51:37 +0800 Subject: [PATCH 20/20] =?UTF-8?q?=20=E7=A7=BB=E9=99=A4=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rent/controller/RentContractFileController.java | 13 ++++++------- .../rent/controller/RentTenantInfoController.java | 13 ++++++------- .../rent/service/impl/RentBlacklistServiceImpl.java | 2 +- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractFileController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractFileController.java index 0511f7f..7ea49af 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractFileController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractFileController.java @@ -34,20 +34,20 @@ public class RentContractFileController { private RentContractFileService rentContractFileService; @RequestMapping("page") - public Result> page(@RequestParam Map params){ + public Result> page(@RequestParam Map params) { PageData page = rentContractFileService.page(params); return new Result>().ok(page); } - @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) - public Result get(@PathVariable("id") String id){ + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id) { RentContractFileDTO data = rentContractFileService.get(id); return new Result().ok(data); } @NoRepeatSubmit @PostMapping("save") - public Result save(@RequestBody RentContractFileDTO dto){ + public Result save(@RequestBody RentContractFileDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); rentContractFileService.save(dto); @@ -56,7 +56,7 @@ public class RentContractFileController { @NoRepeatSubmit @PostMapping("update") - public Result update(@RequestBody RentContractFileDTO dto){ + public Result update(@RequestBody RentContractFileDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); rentContractFileService.update(dto); @@ -64,7 +64,7 @@ public class RentContractFileController { } @PostMapping("delete") - public Result delete(@RequestBody String[] ids){ + public Result delete(@RequestBody String[] ids) { //效验数据 AssertUtils.isArrayEmpty(ids, "id"); rentContractFileService.delete(ids); @@ -78,5 +78,4 @@ public class RentContractFileController { } - } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java index ad5d1b2..7fdd761 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java @@ -34,20 +34,20 @@ public class RentTenantInfoController { private RentTenantInfoService rentTenantInfoService; @RequestMapping("page") - public Result> page(@RequestParam Map params){ + public Result> page(@RequestParam Map params) { PageData page = rentTenantInfoService.page(params); return new Result>().ok(page); } - @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) - public Result get(@PathVariable("id") String id){ + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id) { RentTenantInfoDTO data = rentTenantInfoService.get(id); return new Result().ok(data); } @NoRepeatSubmit @PostMapping("save") - public Result save(@RequestBody RentTenantInfoDTO dto){ + public Result save(@RequestBody RentTenantInfoDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); return rentTenantInfoService.save(dto); @@ -55,7 +55,7 @@ public class RentTenantInfoController { @NoRepeatSubmit @PostMapping("update") - public Result update(@RequestBody RentTenantInfoDTO dto){ + public Result update(@RequestBody RentTenantInfoDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); rentTenantInfoService.update(dto); @@ -63,7 +63,7 @@ public class RentTenantInfoController { } @PostMapping("delete") - public Result delete(@RequestBody String[] ids){ + public Result delete(@RequestBody String[] ids) { //效验数据 AssertUtils.isArrayEmpty(ids, "id"); rentTenantInfoService.delete(ids); @@ -77,5 +77,4 @@ public class RentTenantInfoController { } - } 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 6849786..8a2c413 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 @@ -113,7 +113,7 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl