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..f0ff8cb --- /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,81 @@ +package com.epmet.plugin.power.dto.rent; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 黑名单表 + * + * @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用户主键 + */ + @NotBlank(message = "用户ID不能为空") + private String userId; + + /** + * 姓名 + */ + @NotBlank(message = "姓名不能为空") + private String name; + + /** + * 身份证 + */ + @NotBlank(message = "身份证不能为空") + private String idCard; + + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空") + private String mobile; + + /** + * 性别 0女 1男 + */ + @NotBlank(message = "性别不能为空") + private String gender; + + /** + * 类型 0 租客 1 房东 + */ + @NotBlank(message = "人员类型不能为空") + private String type; + + /** + * 加入时间 + */ + private String joinDate; + + /** + * 加入原因 + */ + private String joinReason; + + /** + * 移除时间 + */ + private String removeDate; + + /** + * 移除原因 + */ + private String removeReason; + +} \ 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..51f4ab8 --- /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; + + /** + * 文件类型 0:图片,1 文件(合同) + */ + 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..c540588 --- /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,188 @@ +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.List; + + +/** + * 合同表 + * + * @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 communityId; + + /** + * 社区 + */ + private String communityName; + + /** + * 网格ID + */ + @NotBlank(message = "网格信息不能为空") + private String gridId; + + /** + * 网格 + */ + private String gridName; + + /** + * 房屋小区ID + */ + @NotBlank(message = "小区信息不能为空") + private String villageId; + + /** + * 房屋小区 + */ + private String villageName; + + /** + * 楼号ID + */ + @NotBlank(message = "楼栋信息不能为空") + private String buildId; + + /** + * 楼号 + */ + private String buildName; + + /** + * 单元ID + */ + @NotBlank(message = "单元信息不能为空") + private String unitId; + + /** + * 单元 + */ + private String unitName; + + /** + * 房屋ID + */ + @NotBlank(message = "房屋信息不能为空") + private String homeId; + + /** + * 房屋 + */ + private String homeName; + + /** + * 房主姓名 + */ + @NotBlank(message = "房主信息不能为空") + private String ownerName; + + /** + * 租户数 + */ + private Integer tenantNum; + + /** + * 状态:0未审核,1审核通过,2审核不通过 + */ + private String state; + + /** + * 出租人姓名 + */ + @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; + + /** + * 审核日期 + */ + private String reviewDate; + + /** + * 合同开始日期 + */ + @NotBlank(message = "合同开始时间不能为空") + private String startDate; + + /** + * 合同结束日期 + */ + @NotBlank(message = "合同结束时间不能为空") + private String endDate; + + /** + * 审核-原因 + */ + private String reason; + + /** + * 租客列表 + */ + @NotEmpty + private List tenantList; + + /** + * 附件列表 + */ + @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-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..e7ffb7b --- /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,67 @@ +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.List; + + +/** + * 租客表 + * + * @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; + + /** + * 姓名 + */ + @NotBlank(message = "姓名不能为空") + private String name; + + /** + * 身份证 + */ + @NotBlank(message = "身份证不能为空") + private String idCard; + + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空") + private String mobile; + + /** + * 与房主关系 + */ + private String yfzgx; + + /** + * 人员类型 0:房东 1:租客 + */ + @NotBlank(message = "人员类型不能为空") + private String type; + + /** + * 头像列表 + */ + @NotEmpty + 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/pom.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml index 21b2391..af1b196 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.218 + 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 new file mode 100644 index 0000000..a7f68f2 --- /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,80 @@ +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); + return rentBlacklistService.save(dto); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody RentBlacklistDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + rentBlacklistService.update(dto); + return new Result(); + } + + @DeleteMapping("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..7ea49af --- /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,81 @@ +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..fcbfb40 --- /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,89 @@ +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.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; +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); + return rentContractInfoService.save(dto); + } + + @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) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + rentContractInfoService.update(dto); + return new Result(); + } + + @DeleteMapping("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..7fdd761 --- /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,80 @@ +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); + return rentTenantInfoService.save(dto); + } + + @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..6626a7e --- /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,28 @@ +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; + +import java.util.Map; + +/** + * 附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@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/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..52eb08e --- /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,29 @@ +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; + +/** + * 合同表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@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/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..29cc2c7 --- /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,28 @@ +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; + +import java.util.Map; + +/** + * 租客表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@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/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..a9bb81e --- /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,79 @@ +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; + + /** + * 客户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 new file mode 100644 index 0000000..d423815 --- /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,44 @@ +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; + + /** + * 文件类型 0:图片,1 文件(合同) + */ + 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 new file mode 100644 index 0000000..11b0433 --- /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,154 @@ +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 communityId; + + /** + * 社区 + */ + private String communityName; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格 + */ + private String gridName; + + /** + * 房屋小区ID + */ + private String villageId; + + /** + * 房屋小区 + */ + private String villageName; + + /** + * 楼号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 reviewDate; + + /** + * 合同开始日期 + */ + private String startDate; + + /** + * 合同结束日期 + */ + private String endDate; + + /** + * 审核-原因 + */ + 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 new file mode 100644 index 0000000..5aec950 --- /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,68 @@ +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; + +/** + * 租客表 + * + * @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; + + /** + * 人员类型 0:房东 1:租客 + */ + private String type; + + /** + * 客户ID + */ + private String customerId; + + /** + * 头像列表 + */ + @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/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..8f9b8a5 --- /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,79 @@ +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; + +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 + */ + Result 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..bb0b789 --- /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,88 @@ +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); + + /** + * 物理删除 + * + * @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/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..5a552ea --- /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,89 @@ +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; + +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 + */ + Result save(RentContractInfoDTO dto); + + /** + * 审核 + * + * @param dto + * @return void + * @author generator + * @date 2022-04-22 + */ + void review(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..bbe0401 --- /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,89 @@ +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.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 + */ + Result 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); + + /** + * 物理删除 + * + * @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 new file mode 100644 index 0000000..8a2c413 --- /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,129 @@ +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.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.ConvertUtils; +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.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; +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.*; + +/** + * 黑名单表 + * + * @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; + + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + @Autowired + LoginUserUtil loginUserUtil; + + @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); + 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; + } + + @Override + public RentBlacklistDTO get(String id) { + RentBlacklistEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, RentBlacklistDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result save(RentBlacklistDTO dto) { + RentTenantDataFormDTO formDTO = new RentTenantDataFormDTO(); + formDTO.setUserId(dto.getUserId()); + formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class); + Result result = epmetUserOpenFeignClient.getRentResiUserInfo(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()) { + 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 + @Transactional(rollbackFor = Exception.class) + public void update(RentBlacklistDTO dto) { + dto.setRemoveDate(DateUtils.format(new Date())); + RentBlacklistEntity entity = ConvertUtils.sourceToTarget(dto, RentBlacklistEntity.class); + updateById(entity); + baseDao.deleteBatchIds(Collections.singletonList(entity.getId())); + } + + @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..e362927 --- /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,99 @@ +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.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; +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); + 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; + } + + @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)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deletePhysical(Map 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 new file mode 100644 index 0000000..285ff8f --- /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,282 @@ +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.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.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.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; +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.*; +import java.util.stream.Collectors; + +/** + * 合同表 + * + * @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; + + @Autowired + LoginUserUtil loginUserUtil; + + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + @Autowired + private RentTenantInfoService rentTenantInfoService; + + @Autowired + private RentContractFileService rentContractFileService; + + @Override + public PageData page(Map params) { + IPage page = getPage(params); + List list = baseDao.getContractInfoList(params); + return new PageData<>(list, page.getTotal()); + + } + + @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); + 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 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.eq(StringUtils.isNotBlank(endDate), "END_DATE", endDate); + + return wrapper; + } + + @Override + public RentContractInfoDTO get(String id) { + RentContractInfoEntity entity = baseDao.selectById(id); + RentContractInfoDTO dto = ConvertUtils.sourceToTarget(entity, RentContractInfoDTO.class); + + Map 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); + dto.setTenantNum(tenantList.size()); + + params.put("referenceId", dto.getId()); + params.put("fileType", NumConstant.ONE_STR); + // 取出合同文件信息 + List fileList = rentContractFileService.list(params); + dto.setFileList(fileList); + + return dto; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result save(RentContractInfoDTO dto) { + RentContractInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentContractInfoEntity.class); + entity.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + insert(entity); + return updateTenantAndFile(entity.getId(), dto); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void review(RentContractInfoDTO dto) { + RentContractInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentContractInfoEntity.class); + updateById(entity); + // 如果审核通过,就去更新基础库头像信息以及居民信息 + if (NumConstant.ONE_STR.equals(entity.getState())) { + 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()); + + user.setAgencyId(dto.getCommunityId()); + Result agencyInfo = govOrgOpenFeignClient.getAgencyById(dto.getCommunityId()); + user.setPids(agencyInfo.getData().getPids()); + + formDTO.setUser(user); + + epmetUserOpenFeignClient.updateImage(formDTO); + + + }); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(RentContractInfoDTO dto) { + RentContractInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentContractInfoEntity.class); + updateById(entity); + updateTenantAndFile(entity.getId(), dto); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + private Result updateTenantAndFile(String contractId, RentContractInfoDTO dto) { + Map params = new HashMap<>(8); + params.put("contractId", contractId); + params.put("referenceId", contractId); + // 删除租客和合同文件 + rentTenantInfoService.deletePhysical(params); + rentContractFileService.deletePhysical(params); + + if (null == dto.getTenantList() || dto.getTenantList().isEmpty()) { + return new Result().error("租客不能为空"); + } else { + List 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())) { + // 如果是修改,先删除之前的头像 + params.put("referenceId", tenant.getId()); + params.put("fileType", NumConstant.ZERO_STR); + rentContractFileService.deletePhysical(params); + } + tenant.setContractId(contractId); + tenant.setType(NumConstant.ONE_STR); + tenant.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + }); + rentTenantInfoService.insertBatch(tenantList); + // 处理租客头像 + dto.getTenantList().forEach(tenant -> { + 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); + imgList.forEach(img -> { + img.setReferenceId(tenant.getId()); + img.setFileType(NumConstant.ZERO_STR); + img.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + }); + rentContractFileService.insertBatch(imgList); + } + }); + + } + if (null == dto.getFileList() || dto.getFileList().isEmpty()) { + return new Result().error("合同附件不能为空"); + } else { + List fileList = ConvertUtils.sourceToTarget(dto.getFileList(), RentContractFileEntity.class); + fileList.forEach(item -> { + item.setReferenceId(contractId); + item.setFileType(NumConstant.ONE_STR); + item.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + }); + rentContractFileService.insertBatch(fileList); + } + return new Result(); + } + +} \ 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..80eb329 --- /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,153 @@ +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.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.IcResiUserAttachmentDTO; +import com.epmet.dto.form.RentTenantFormDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +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; +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.RentContractFileService; +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.*; + +/** + * 租客表 + * + * @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; + + @Autowired + LoginUserUtil loginUserUtil; + + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + @Autowired + private RentContractFileService rentContractFileService; + + @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); + 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; + } + + @Override + public RentTenantInfoDTO get(String id) { + RentTenantInfoEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, RentTenantInfoDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result save(RentTenantInfoDTO dto) { + Map params = new HashMap<>(4); + params.put("idCard", dto.getIdCard()); + if (!list(params).isEmpty()) { + return new Result().error("用户已存在"); + } + + List images = new ArrayList<>(); + // 处理头像 + if (null == dto.getImgList() || dto.getImgList().isEmpty()) { + return new Result().error("照片不能为空"); + } else { + RentTenantInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentTenantInfoEntity.class); + entity.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + insert(entity); + + List imgList = ConvertUtils.sourceToTarget(dto.getImgList(), RentContractFileEntity.class); + imgList.forEach(img -> { + img.setReferenceId(entity.getId()); + img.setFileType(NumConstant.ZERO_STR); + img.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + + // 更新基础库的人员头像 + IcResiUserAttachmentDTO image = new IcResiUserAttachmentDTO(); + image.setAttachmentUrl(img.getFileUrl()); + image.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + images.add(image); + }); + rentContractFileService.insertBatch(imgList); + + // 如果是房东信息立马去更新照片 + if (NumConstant.ZERO_STR.equals(dto.getType())) { + RentTenantFormDTO formDTO = new RentTenantFormDTO(); + formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + formDTO.setIdCard(dto.getIdCard()); + formDTO.setImages(images); + formDTO.setType(dto.getType()); + epmetUserOpenFeignClient.updateImage(formDTO); + } + } + return new Result(); + } + + @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)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deletePhysical(Map 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 new file mode 100644 index 0000000..a223308 --- /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..6f99d21 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractFileDao.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 0000000..753bf93 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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..08f588a --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + DELETE + FROM + pli_rent_tenant_info + + + AND CONTRACT_ID = #{contractId} + + + AND TYPE = #{type} + + + + \ No newline at end of file