Browse Source

居民信息同步

dev
wanggongfeng 3 years ago
parent
commit
eac65af60d
  1. 27
      epmet-plugins-common/src/main/java/com/epmet/plugin/commons/enums/IdCardTypeEnum.java
  2. 155
      epmet-plugins-common/src/main/java/com/epmet/plugin/commons/utils/IdCardRegexUtils.java
  3. 231
      epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/PliRentContractInfoLogDTO.java
  4. 60
      epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java
  5. 94
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/PliRentContractInfoLogController.java
  6. 3
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java
  7. 47
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/PliRentContractInfoLogDao.java
  8. 201
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/PliRentContractInfoLogEntity.java
  9. 149
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/PliRentContractInfoLogExcel.java
  10. 47
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/PliRentContractInfoLogRedis.java
  11. 96
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/PliRentContractInfoLogService.java
  12. 2
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java
  13. 118
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/PliRentContractInfoLogServiceImpl.java
  14. 6
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractFileServiceImpl.java
  15. 169
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java
  16. 55
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.16__add_pli_rent_tenant_info_log.sql
  17. 174
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/PliRentContractInfoLogDao.xml

27
epmet-plugins-common/src/main/java/com/epmet/plugin/commons/enums/IdCardTypeEnum.java

@ -0,0 +1,27 @@
package com.epmet.plugin.commons.enums;
/**
* 唯一整件类型
*/
public enum IdCardTypeEnum {
OTHERS("0", "其他"),
SFZH("1", "身份证号"),
PASSPORT("2", "护照");
private String type;
private String name;
IdCardTypeEnum(String type, String name) {
this.type = type;
this.name = name;
}
public String getType() {
return type;
}
public String getName() {
return name;
}
}

155
epmet-plugins-common/src/main/java/com/epmet/plugin/commons/utils/IdCardRegexUtils.java

@ -0,0 +1,155 @@
package com.epmet.plugin.commons.utils;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.plugin.commons.enums.IdCardTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.DateTimeException;
import java.time.LocalDate;
import java.time.Period;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* 唯一整件正则工具
*/
public class IdCardRegexUtils {
/**
* 15位身份证号的正则表达式
*/
private static final Pattern PATTERN_15_ID = Pattern.compile("^\\d{6}(?<year>\\d{2})(?<month>0[1-9]|1[0-2])(?<day>[0-2][0-9]|3[0-1])\\d{2}(?<sex>\\d)$");
/**
* 18位身份证号的正则表达式
*/
private static final Pattern PATTERN_18_ID = Pattern.compile("^\\d{6}(?<year>\\d{4})(?<month>0[1-9]|1[0-2])(?<day>[0-2][0-9]|3[0-1])\\d{2}(?<sex>\\d)[0-9a-xA-X]$");
/**
* 9位护照
*/
private static final Pattern PATTERN_9_PASSPORT = Pattern.compile("^[a-zA-Z0-9]{8,9}$");
private String inputText;
private Matcher matcher;
private IdCardTypeEnum idCardType;
private IdCardRegexUtils(IdCardTypeEnum idCardType, Matcher matcher, String inputText) {
this.idCardType = idCardType;
this.matcher = matcher;
this.inputText = inputText;
}
/**
* 正则解析结果
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public static class ParsedContent {
private String birthdayYear;
private String birthdayMonth;
private String birthdayDay;
private String sex;
private Integer age;
}
/**
* desc:校验输入的证件号是否合法
* @param input
* @return
*/
public static boolean validateIdCard(String input){
IdCardRegexUtils parse = IdCardRegexUtils.parse(input);
return parse != null;
}
/**
* 解析正则
* @param input
* @return
*/
public static IdCardRegexUtils parse(String input) {
if (input == null || input.trim().length() == 0) {
return null;
}
if (input.length() == 15) {
Matcher matcher = PATTERN_15_ID.matcher(input);
if (matcher.matches()) {
return new IdCardRegexUtils(IdCardTypeEnum.SFZH, matcher, input);
}
}
if (input.length() == 18) {
Matcher matcher = PATTERN_18_ID.matcher(input);
if (matcher.matches()) {
return new IdCardRegexUtils(IdCardTypeEnum.SFZH, matcher, input);
}
}
if (input.length() == 9 || input.length() == 8) {
Matcher matcher = PATTERN_9_PASSPORT.matcher(input);
if (matcher.matches()) {
return new IdCardRegexUtils(IdCardTypeEnum.PASSPORT, matcher, input);
}
}
return null;
}
/**
* 获取解析结果
* @return
*/
public ParsedContent getParsedResult() {
if (matcher == null || idCardType == null) {
return null;
}
if (IdCardTypeEnum.SFZH == idCardType) {
//是身份证号,可以解析
String year;
if (inputText.length() == 15) {
// 15位身份证号,years前需要拼上19
year = "19".concat(matcher.group("year"));
} else {
year = matcher.group("year");
}
String month = matcher.group("month");
String day = matcher.group("day");
String sex = matcher.group("sex");
// ------- 年龄Start----------
Integer age;
try {
LocalDate birthday = LocalDate.of(Integer.parseInt(year), Integer.parseInt(month), Integer.parseInt(day));
age = Period.between(birthday, LocalDate.now()).getYears();
} catch (DateTimeException e) {
throw new EpmetException("身份证号解析年龄失败:" + ExceptionUtils.getErrorStackTrace(e));
}
// ------- 年龄End----------
return new ParsedContent(year, month, day, sex, age);
}
// 其他类型暂时不可解析
return null;
}
/**
* 获取类型枚举
* @return
*/
public IdCardTypeEnum getTypeEnum() {
return idCardType;
}
public static void main(String[] args) {
IdCardRegexUtils parse = IdCardRegexUtils.parse("370282198801303017");
ParsedContent parsedResult = parse.getParsedResult();
System.out.println(parsedResult);
}
}

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

@ -0,0 +1,231 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.plugin.power.dto.rent;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 合同记录表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2022-11-30
*/
@Data
public class PliRentContractInfoLogDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 合同ID
*/
private String contractId;
/**
* 社区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 lessorRelation;
/**
* 承租人姓名
*/
private String lesseeName;
/**
* 承租人身份证
*/
private String lesseeIdCard;
/**
* 承租人手机
*/
private String lesseeMobile;
/**
* 承租人工作单位
*/
private String lesseeUnit;
/**
* 签署日期
*/
private String signDate;
/**
* 审核日期
*/
private String reviewDate;
/**
* 合同开始日期
*/
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;
/**
* 客户ID
*/
private String customerId;
/**
* 出租人现居住地
*/
private String lessorLiveAddress;
/**
* 承租人户籍地地址
*/
private String lesseeHouseAddress;
/**
* 是否来源于PC端录入0:1:
*/
private String isPcInput;
}

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

@ -120,5 +120,65 @@ public class RentTenantInfoDTO implements Serializable {
@NotBlank(message = "户籍地不能为空")
private String hjszd;
/**
* 性别
*/
private String gender;
/**
* 出生日期
*/
private String birthday;
/**
* 民族字典表
*/
private String mz;
/**
* 是否接种0否1是
*/
private String isVaccination;
/**
* 第一次接种时间
*/
private String firstVacTime;
/**
* 第一次接种地点
*/
private String firstVacSite;
/**
* 第二次接种时间
*/
private String secondVacTime;
/**
* 第二次接种地点
*/
private String secondVacSite;
/**
* 第三次接种时间
*/
private String thirdVacTime;
/**
* 第三次接种地点
*/
private String thirdVacSite;
/**
* 原因禁忌症/拒绝接种/其他原因
*/
private String uninoculatedReason;
/**
* 备注
*/
private String note;
}

94
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/PliRentContractInfoLogController.java

@ -0,0 +1,94 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.plugin.power.modules.rent.controller;
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.PliRentContractInfoLogDTO;
import com.epmet.plugin.power.modules.rent.excel.PliRentContractInfoLogExcel;
import com.epmet.plugin.power.modules.rent.service.PliRentContractInfoLogService;
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 elink elink@elink-cn.com
* @since v1.0.0 2022-11-30
*/
@RestController
@RequestMapping("plirentcontractinfolog")
public class PliRentContractInfoLogController {
@Autowired
private PliRentContractInfoLogService pliRentContractInfoLogService;
@RequestMapping("page")
public Result<PageData<PliRentContractInfoLogDTO>> page(@RequestParam Map<String, Object> params){
PageData<PliRentContractInfoLogDTO> page = pliRentContractInfoLogService.page(params);
return new Result<PageData<PliRentContractInfoLogDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<PliRentContractInfoLogDTO> get(@PathVariable("id") String id){
PliRentContractInfoLogDTO data = pliRentContractInfoLogService.get(id);
return new Result<PliRentContractInfoLogDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody PliRentContractInfoLogDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
pliRentContractInfoLogService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody PliRentContractInfoLogDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
pliRentContractInfoLogService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
pliRentContractInfoLogService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<PliRentContractInfoLogDTO> list = pliRentContractInfoLogService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, PliRentContractInfoLogExcel.class);
}
}

3
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java

@ -68,8 +68,7 @@ public class RentContractInfoController {
public Result review(@RequestBody RentContractInfoDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
rentContractInfoService.review(dto);
return new Result();
return rentContractInfoService.review(dto);
}
@NoRepeatSubmit

47
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/PliRentContractInfoLogDao.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.plugin.power.modules.rent.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.plugin.power.dto.rent.PliRentContractInfoLogDTO;
import com.epmet.plugin.power.modules.rent.entity.PliRentContractInfoLogEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* 合同记录表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2022-11-30
*/
@Mapper
public interface PliRentContractInfoLogDao extends BaseDao<PliRentContractInfoLogEntity> {
/**
* 获取合同记录列表
*
* @param params
* @return java.util.List<com.epmet.plugin.power.dto.rent.PliRentContractInfoLogDTO>
* @author wgf
* @date 2022/11/30 8:18
*/
List<PliRentContractInfoLogDTO> getContractInfoList(Map<String, Object> params);
}

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

@ -0,0 +1,201 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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 elink elink@elink-cn.com
* @since v1.0.0 2022-11-30
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("pli_rent_contract_info_log")
public class PliRentContractInfoLogEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 合同ID
*/
private String contractId;
/**
* 社区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 lessorRelation;
/**
* 承租人姓名
*/
private String lesseeName;
/**
* 承租人身份证
*/
private String lesseeIdCard;
/**
* 承租人手机
*/
private String lesseeMobile;
/**
* 承租人工作单位
*/
private String lesseeUnit;
/**
* 签署日期
*/
private String signDate;
/**
* 审核日期
*/
private String reviewDate;
/**
* 合同开始日期
*/
private String startDate;
/**
* 合同结束日期
*/
private String endDate;
/**
* 审核-原因
*/
private String reason;
/**
* 客户ID
*/
private String customerId;
/**
* 出租人现居住地
*/
private String lessorLiveAddress;
/**
* 承租人户籍地地址
*/
private String lesseeHouseAddress;
/**
* 是否来源于PC端录入0:1:
*/
private String isPcInput;
}

149
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/PliRentContractInfoLogExcel.java

@ -0,0 +1,149 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.plugin.power.modules.rent.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 合同记录表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2022-11-30
*/
@Data
public class PliRentContractInfoLogExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "社区ID")
private String communityId;
@Excel(name = "社区")
private String communityName;
@Excel(name = "网格ID")
private String gridId;
@Excel(name = "网格")
private String gridName;
@Excel(name = "房屋小区ID")
private String villageId;
@Excel(name = "房屋小区")
private String villageName;
@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 lessorRelation;
@Excel(name = "承租人姓名")
private String lesseeName;
@Excel(name = "承租人身份证")
private String lesseeIdCard;
@Excel(name = "承租人手机")
private String lesseeMobile;
@Excel(name = "承租人工作单位")
private String lesseeUnit;
@Excel(name = "签署日期")
private String signDate;
@Excel(name = "审核日期")
private String reviewDate;
@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;
@Excel(name = "客户ID")
private String customerId;
@Excel(name = "出租人现居住地")
private String lessorLiveAddress;
@Excel(name = "承租人户籍地地址")
private String lesseeHouseAddress;
@Excel(name = "是否来源于PC端录入(0:否;1:是)")
private String isPcInput;
}

47
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/PliRentContractInfoLogRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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 elink elink@elink-cn.com
* @since v1.0.0 2022-11-30
*/
@Component
public class PliRentContractInfoLogRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

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

@ -0,0 +1,96 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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.PliRentContractInfoLogDTO;
import com.epmet.plugin.power.modules.rent.entity.PliRentContractInfoLogEntity;
import java.util.List;
import java.util.Map;
/**
* 合同记录表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2022-11-30
*/
public interface PliRentContractInfoLogService extends BaseService<PliRentContractInfoLogEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<PliRentContractInfoLogDTO>
* @author generator
* @date 2022-11-30
*/
PageData<PliRentContractInfoLogDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<PliRentContractInfoLogDTO>
* @author generator
* @date 2022-11-30
*/
List<PliRentContractInfoLogDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return PliRentContractInfoLogDTO
* @author generator
* @date 2022-11-30
*/
PliRentContractInfoLogDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-11-30
*/
void save(PliRentContractInfoLogDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2022-11-30
*/
void update(PliRentContractInfoLogDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2022-11-30
*/
void delete(String[] ids);
}

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

@ -75,7 +75,7 @@ public interface RentContractInfoService extends BaseService<RentContractInfoEnt
* @author generator
* @date 2022-04-22
*/
void review(RentContractInfoDTO dto);
Result review(RentContractInfoDTO dto);
/**
* 下发

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

@ -0,0 +1,118 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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.plugin.power.dto.rent.PliRentContractInfoLogDTO;
import com.epmet.plugin.power.dto.rent.RentContractInfoDTO;
import com.epmet.plugin.power.modules.rent.dao.PliRentContractInfoLogDao;
import com.epmet.plugin.power.modules.rent.entity.PliRentContractInfoLogEntity;
import com.epmet.plugin.power.modules.rent.redis.PliRentContractInfoLogRedis;
import com.epmet.plugin.power.modules.rent.service.PliRentContractInfoLogService;
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 elink elink@elink-cn.com
* @since v1.0.0 2022-11-30
*/
@Service
public class PliRentContractInfoLogServiceImpl extends BaseServiceImpl<PliRentContractInfoLogDao, PliRentContractInfoLogEntity> implements PliRentContractInfoLogService {
@Autowired
private PliRentContractInfoLogRedis pliRentContractInfoLogRedis;
@Autowired
private LoginUserUtil loginUserUtil;
@Override
public PageData<PliRentContractInfoLogDTO> page(Map<String, Object> params) {
// IPage<PliRentContractInfoLogEntity> page = baseDao.selectPage(
// getPage(params, FieldConstant.CREATED_TIME, false),
// getWrapper(params)
// );
// return getPageData(page, PliRentContractInfoLogDTO.class);
params.put("customerId", loginUserUtil.getLoginUserCustomerId());
if (StringUtils.isNotBlank((String) params.get("dataFlag"))) {
params.put("createdBy", loginUserUtil.getLoginUserId());
}
IPage<PliRentContractInfoLogDTO> page = getPage(params);
List<PliRentContractInfoLogDTO> list = baseDao.getContractInfoList(params);
return new PageData<>(list, page.getTotal());
}
@Override
public List<PliRentContractInfoLogDTO> list(Map<String, Object> params) {
List<PliRentContractInfoLogEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, PliRentContractInfoLogDTO.class);
}
private QueryWrapper<PliRentContractInfoLogEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<PliRentContractInfoLogEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public PliRentContractInfoLogDTO get(String id) {
PliRentContractInfoLogEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, PliRentContractInfoLogDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(PliRentContractInfoLogDTO dto) {
PliRentContractInfoLogEntity entity = ConvertUtils.sourceToTarget(dto, PliRentContractInfoLogEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(PliRentContractInfoLogDTO dto) {
PliRentContractInfoLogEntity entity = ConvertUtils.sourceToTarget(dto, PliRentContractInfoLogEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

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

@ -101,7 +101,9 @@ public class RentContractFileServiceImpl extends BaseServiceImpl<RentContractFil
public List<RentContractFileDTO> listByRefAndType(String referenceId, String fileType) {
Map<String, Object> params = new HashMap<>(4);
params.put("referenceId", referenceId);
params.put("fileType", fileType);
if(StringUtils.isNotBlank(fileType)){
params.put("fileType", fileType);
}
return list(params);
}
}
}

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

@ -12,14 +12,12 @@ 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.commons.tools.validator.IdCardNoValidatorUtils;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.IcResiUserAttachmentDTO;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.*;
import com.epmet.dto.form.IcHouseAddFormDTO;
import com.epmet.dto.form.RentTenantFormDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.plugin.commons.utils.IdCardRegexUtils;
import com.epmet.plugin.power.dto.hik.HikCommunityInfoDTO;
import com.epmet.plugin.power.dto.hik.HikDeviceInfoDTO;
import com.epmet.plugin.power.dto.hik.HikErrorInfoDTO;
@ -33,10 +31,12 @@ import com.epmet.plugin.power.modules.hik.service.HikDeviceInfoService;
import com.epmet.plugin.power.modules.hik.service.HikErrorInfoService;
import com.epmet.plugin.power.modules.hik.utils.HkDeviceUtil;
import com.epmet.plugin.power.modules.rent.dao.RentContractInfoDao;
import com.epmet.plugin.power.modules.rent.entity.PliRentContractInfoLogEntity;
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.PliRentContractInfoLogService;
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;
@ -90,6 +90,9 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf
@Autowired
private HikDeviceInfoService hikDeviceInfoService;
@Autowired
private PliRentContractInfoLogService pliRentContractInfoLogService;
@Override
public PageData<RentContractInfoDTO> page(Map<String, Object> params) {
params.put("customerId", loginUserUtil.getLoginUserCustomerId());
@ -271,7 +274,8 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf
@Override
@Transactional(rollbackFor = Exception.class)
public void review(RentContractInfoDTO dto) {
public Result review(RentContractInfoDTO dto) {
RentContractInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentContractInfoEntity.class);
updateById(entity);
// 如果审核通过,就去更新基础库头像信息以及居民信息,最后更新房屋的状态
@ -279,12 +283,38 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf
// 获取基本信息
RentContractInfoDTO contractDto = get(dto.getId());
// 1、审核通过,插入合同记录表
PliRentContractInfoLogEntity logEntity = ConvertUtils.sourceToTarget(contractDto, PliRentContractInfoLogEntity.class);
logEntity.setId(null);
logEntity.setContractId(contractDto.getId()); // 设置合同ID
pliRentContractInfoLogService.insert(logEntity);
// 2、审核通过,插入合同记录的文件信息
List<RentContractFileDTO> contractFileList = rentContractFileService.listByRefAndType(contractDto.getId(), "");
List<RentContractFileEntity> contractFileEntities = ConvertUtils.sourceToTarget(contractFileList, RentContractFileEntity.class);
for(RentContractFileEntity file : contractFileEntities){
file.setId(null);
file.setReferenceId(logEntity.getId());
}
rentContractFileService.insertBatch(contractFileEntities);
// 获取租客信息
Map<String, Object> tenantParams = new HashMap<>(4);
tenantParams.put("contractId", contractDto.getId());
List<RentTenantInfoDTO> tenantList = rentTenantInfoService.list(tenantParams);
tenantList.forEach(tenant -> {
// 1、审核通过,插入合同记录表的租客信息
RentTenantInfoEntity rentTenantInfoEntity = ConvertUtils.sourceToTarget(tenant, RentTenantInfoEntity.class);
rentTenantInfoEntity.setId(null);
rentTenantInfoEntity.setContractId(logEntity.getId());
rentTenantInfoService.insert(rentTenantInfoEntity);
IdCardRegexUtils regex = IdCardRegexUtils.parse(tenant.getIdCard());
if (regex == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), tenant.getName()+"证件号错误", tenant.getName()+"证件号错误");
}
RentTenantFormDTO formDTO = new RentTenantFormDTO();
List<IcResiUserAttachmentDTO> images = new ArrayList<>();
formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId());
@ -293,6 +323,15 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf
List<RentContractFileDTO> imgList = rentContractFileService.listByRefAndType(tenant.getId(), NumConstant.ZERO_STR);
// 2、审核通过,插入合同记录表的租客文件信息
List<RentContractFileDTO> fileList = rentContractFileService.listByRefAndType(tenant.getId(), "");
List<RentContractFileEntity> fileEntities = ConvertUtils.sourceToTarget(fileList, RentContractFileEntity.class);
for(RentContractFileEntity file : fileEntities){
file.setId(null);
file.setReferenceId(rentTenantInfoEntity.getId());
}
rentContractFileService.insertBatch(fileEntities);
imgList.forEach(img -> {
// 更新基础库的人员头像
IcResiUserAttachmentDTO image = new IcResiUserAttachmentDTO();
@ -308,42 +347,12 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf
user.setMobile(tenant.getMobile()); // 手机
user.setIdCard(tenant.getIdCard()); // 证件号
// 补充字段
// 与房主关系
if("本人".equals(tenant.getYfzgx())){
user.setYhzgx("1");
}else if("配偶".equals(tenant.getYfzgx())){
user.setYhzgx("2");
}else if("子女".equals(tenant.getYfzgx())){
user.setYhzgx("3");
}else if ("父母".equals(tenant.getYfzgx())){
user.setYhzgx("4");
}else if ("岳父母或公婆".equals(tenant.getYfzgx())){
user.setYhzgx("5");
}else if ("祖父母".equals(tenant.getYfzgx())){
user.setYhzgx("6");
}else if ("媳婿".equals(tenant.getYfzgx())){
user.setYhzgx("7");
}else if ("孙子女".equals(tenant.getYfzgx())){
user.setYhzgx("8");
}else if ("兄弟姐妹".equals(tenant.getYfzgx())){
user.setYhzgx("9");
}else {
// 【中介】存为【其他】
user.setYhzgx("10");
}
// 是否党员【是:1 否:0】
if("党员".equals(tenant.getPoliticalStatus())){
user.setIsParty("1"); // 政治面貌
}else{
user.setIsParty("0"); // 政治面貌
}
// 是否退役军人【是:1 否:0】
if("是".equals(tenant.getIsMilitary())){
user.setIsVeterans("1"); // 是否服过兵役
}else{
user.setIsVeterans("0"); // 是否服过兵役
}
// 补充字段(字典相关的)
perfectDictField(user,tenant);
// 设置接种信息
perfectVaccineLog(user,tenant);
// 户籍所在地
user.setHjszd(tenant.getHjszd());
// 工作单位
@ -355,7 +364,9 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf
user.setBuildId(contractDto.getBuildId());
user.setUnitId(contractDto.getUnitId());
user.setHomeId(contractDto.getHomeId());
user.setGender(IdCardNoValidatorUtils.getGender(tenant.getIdCard()));
user.setGender(tenant.getGender());
user.setBirthday(tenant.getBirthday());
user.setMz(tenant.getMz());
user.setAgencyId(contractDto.getCommunityId());
Result<CustomerAgencyDTO> agencyInfo = govOrgOpenFeignClient.getAgencyById(contractDto.getCommunityId());
if(StringUtils.isNotBlank(agencyInfo.getData().getPids())){
@ -363,7 +374,11 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf
}else{
user.setPids(agencyInfo.getData().getId());
}
formDTO.setUser(user);
formDTO.setStartDate(dto.getStartDate()); // 合同开始时间
formDTO.setEndDate(dto.getEndDate()); // 合同结束时间
Result result = epmetUserOpenFeignClient.updateImage(formDTO);
});
@ -374,6 +389,76 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf
formDTO.setHouseId(dto.getHomeId());
govOrgOpenFeignClient.houseUpdate(formDTO);
}
return new Result();
}
/**
* 完善字典相关字段信息
*/
public void perfectDictField(IcResiUserDTO user,RentTenantInfoDTO tenant){
// 与房主关系
if("本人".equals(tenant.getYfzgx())){
user.setYhzgx("1");
}else if("配偶".equals(tenant.getYfzgx())){
user.setYhzgx("2");
}else if("子女".equals(tenant.getYfzgx())){
user.setYhzgx("3");
}else if ("父母".equals(tenant.getYfzgx())){
user.setYhzgx("4");
}else if ("岳父母或公婆".equals(tenant.getYfzgx())){
user.setYhzgx("5");
}else if ("祖父母".equals(tenant.getYfzgx())){
user.setYhzgx("6");
}else if ("媳婿".equals(tenant.getYfzgx())){
user.setYhzgx("7");
}else if ("孙子女".equals(tenant.getYfzgx())){
user.setYhzgx("8");
}else if ("兄弟姐妹".equals(tenant.getYfzgx())){
user.setYhzgx("9");
}else {
user.setYhzgx("10");
}
// 是否党员【是:1 否:0】
if("党员".equals(tenant.getPoliticalStatus())){
user.setIsParty("1"); // 政治面貌
}else{
user.setIsParty("0"); // 政治面貌
}
// 是否退役军人【是:1 否:0】
if("是".equals(tenant.getIsMilitary())){
user.setIsVeterans("1"); // 是否服过兵役
}else{
user.setIsVeterans("0"); // 是否服过兵役
}
}
/**
* 完善疫苗接种记录信息
* @param user
* @param tenant
* @return
*/
public void perfectVaccineLog(IcResiUserDTO user,RentTenantInfoDTO tenant){
List<VaccineLogDetailDTO> vaccineLog = new ArrayList<VaccineLogDetailDTO>();
if(StringUtils.isNotBlank(tenant.getFirstVacTime())){
VaccineLogDetailDTO vaccineLogDetailDTO = new VaccineLogDetailDTO();
vaccineLogDetailDTO.setVacSite(tenant.getFirstVacSite());
vaccineLogDetailDTO.setVacTime(tenant.getFirstVacTime());
vaccineLog.add(vaccineLogDetailDTO);
}
if(StringUtils.isNotBlank(tenant.getSecondVacTime())){
VaccineLogDetailDTO vaccineLogDetailDTO = new VaccineLogDetailDTO();
vaccineLogDetailDTO.setVacSite(tenant.getSecondVacSite());
vaccineLogDetailDTO.setVacTime(tenant.getSecondVacTime());
vaccineLog.add(vaccineLogDetailDTO);
}
if(StringUtils.isNotBlank(tenant.getThirdVacTime())){
VaccineLogDetailDTO vaccineLogDetailDTO = new VaccineLogDetailDTO();
vaccineLogDetailDTO.setVacSite(tenant.getThirdVacSite());
vaccineLogDetailDTO.setVacTime(tenant.getThirdVacTime());
vaccineLog.add(vaccineLogDetailDTO);
}
user.setVaccineLog(vaccineLog);
}
@Override

55
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.16__add_pli_rent_tenant_info_log.sql

@ -0,0 +1,55 @@
ALTER TABLE epmet_pli_power.pli_rent_tenant_info ADD MZ varchar(1) DEFAULT NULL COMMENT '民族';
ALTER TABLE epmet_pli_power.pli_rent_tenant_info ADD IS_VACCINATION varchar(1) DEFAULT NULL COMMENT '是否接种:0否1是';
ALTER TABLE epmet_pli_power.pli_rent_tenant_info ADD FIRST_VAC_TIME varchar(64) DEFAULT NULL COMMENT '第一次接种时间';
ALTER TABLE epmet_pli_power.pli_rent_tenant_info ADD FIRST_VAC_SITE varchar(10) DEFAULT NULL COMMENT '第一次接种地点';
ALTER TABLE epmet_pli_power.pli_rent_tenant_info ADD SECOND_VAC_TIME varchar(64) DEFAULT NULL COMMENT '第二次接种时间';
ALTER TABLE epmet_pli_power.pli_rent_tenant_info ADD SECOND_VAC_SITE varchar(10) DEFAULT NULL COMMENT '第二次接种地点';
ALTER TABLE epmet_pli_power.pli_rent_tenant_info ADD THIRD_VAC_TIME varchar(64) DEFAULT NULL COMMENT '第三次接种时间';
ALTER TABLE epmet_pli_power.pli_rent_tenant_info ADD THIRD_VAC_SITE varchar(10) DEFAULT NULL COMMENT '第三次接种地点';
ALTER TABLE epmet_pli_power.pli_rent_tenant_info ADD UNINOCULATED_REASON varchar(255) DEFAULT NULL COMMENT '原因:禁忌症/拒绝接种/其他原因';
ALTER TABLE epmet_pli_power.pli_rent_tenant_info ADD NOTE varchar(255) DEFAULT NULL COMMENT '备注';
DROP TABLE IF EXISTS `pli_rent_contract_info_log`;
CREATE TABLE `pli_rent_contract_info_log` (
`ID` varchar(32) NOT NULL COMMENT '主键',
`CONTRACT_ID` varchar(32) NOT NULL COMMENT '合同关系ID',
`COMMUNITY_ID` varchar(32) NOT NULL COMMENT '社区ID',
`COMMUNITY_NAME` varchar(32) DEFAULT NULL COMMENT '社区',
`GRID_ID` varchar(32) NOT NULL COMMENT '网格ID',
`GRID_NAME` varchar(32) DEFAULT NULL COMMENT '网格',
`VILLAGE_ID` varchar(32) DEFAULT NULL COMMENT '房屋小区ID',
`VILLAGE_NAME` varchar(32) DEFAULT NULL COMMENT '房屋小区',
`BUILD_ID` varchar(32) DEFAULT NULL COMMENT '楼号ID',
`BUILD_NAME` varchar(32) DEFAULT NULL COMMENT '楼号',
`UNIT_ID` varchar(32) DEFAULT NULL COMMENT '单元ID',
`UNIT_NAME` varchar(32) DEFAULT NULL COMMENT '单元',
`HOME_ID` varchar(32) DEFAULT NULL COMMENT '房屋ID',
`HOME_NAME` varchar(32) DEFAULT NULL COMMENT '房屋',
`OWNER_NAME` varchar(32) DEFAULT NULL COMMENT '房主姓名',
`STATE` varchar(32) DEFAULT '0' COMMENT '状态:0未审核,1审核通过,2审核不通过(盈余字段)',
`LESSOR_NAME` varchar(32) DEFAULT NULL COMMENT '出租人姓名',
`LESSOR_ID_CARD` varchar(32) DEFAULT NULL COMMENT '出租人身份证',
`LESSOR_MOBILE` varchar(32) DEFAULT NULL COMMENT '出租人手机',
`LESSOR_RELATION` varchar(32) DEFAULT NULL COMMENT '出租人关系',
`LESSEE_NAME` varchar(32) DEFAULT NULL COMMENT '承租人姓名',
`LESSEE_ID_CARD` varchar(32) DEFAULT NULL COMMENT '承租人身份证',
`LESSEE_MOBILE` varchar(32) DEFAULT NULL COMMENT '承租人手机',
`LESSEE_UNIT` varchar(255) DEFAULT NULL COMMENT '承租人工作单位',
`SIGN_DATE` varchar(32) DEFAULT NULL COMMENT '签署日期',
`REVIEW_DATE` varchar(32) DEFAULT NULL COMMENT '审核日期',
`START_DATE` varchar(32) DEFAULT NULL COMMENT '合同开始日期',
`END_DATE` varchar(32) DEFAULT NULL COMMENT '合同结束日期',
`REASON` varchar(255) DEFAULT NULL COMMENT '审核-原因',
`DEL_FLAG` varchar(1) DEFAULT NULL COMMENT '删除标记 0:未删除,1:已删除',
`REVISION` int(11) DEFAULT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建人',
`CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人',
`UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`LESSOR_LIVE_ADDRESS` varchar(255) DEFAULT NULL COMMENT '出租人现居住地',
`LESSEE_HOUSE_ADDRESS` varchar(255) DEFAULT NULL COMMENT '承租人户籍地地址',
`IS_PC_INPUT` varchar(1) DEFAULT NULL COMMENT '是否来源于PC端录入(0:否;1:是)',
PRIMARY KEY (`ID`) USING BTREE,
KEY `epdc_master_topic_USER_ID_IDX` (`HOME_NAME`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='合同记录表';

174
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/PliRentContractInfoLogDao.xml

@ -0,0 +1,174 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.plugin.power.modules.rent.dao.PliRentContractInfoLogDao">
<resultMap type="com.epmet.plugin.power.modules.rent.entity.PliRentContractInfoLogEntity" id="pliRentContractInfoLogMap">
<result property="id" column="ID"/>
<result property="communityId" column="COMMUNITY_ID"/>
<result property="communityName" column="COMMUNITY_NAME"/>
<result property="gridId" column="GRID_ID"/>
<result property="gridName" column="GRID_NAME"/>
<result property="villageId" column="VILLAGE_ID"/>
<result property="villageName" column="VILLAGE_NAME"/>
<result property="buildId" column="BUILD_ID"/>
<result property="buildName" column="BUILD_NAME"/>
<result property="unitId" column="UNIT_ID"/>
<result property="unitName" column="UNIT_NAME"/>
<result property="homeId" column="HOME_ID"/>
<result property="homeName" column="HOME_NAME"/>
<result property="ownerName" column="OWNER_NAME"/>
<result property="state" column="STATE"/>
<result property="lessorName" column="LESSOR_NAME"/>
<result property="lessorIdCard" column="LESSOR_ID_CARD"/>
<result property="lessorMobile" column="LESSOR_MOBILE"/>
<result property="lessorRelation" column="LESSOR_RELATION"/>
<result property="lesseeName" column="LESSEE_NAME"/>
<result property="lesseeIdCard" column="LESSEE_ID_CARD"/>
<result property="lesseeMobile" column="LESSEE_MOBILE"/>
<result property="lesseeUnit" column="LESSEE_UNIT"/>
<result property="signDate" column="SIGN_DATE"/>
<result property="reviewDate" column="REVIEW_DATE"/>
<result property="startDate" column="START_DATE"/>
<result property="endDate" column="END_DATE"/>
<result property="reason" column="REASON"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="lessorLiveAddress" column="LESSOR_LIVE_ADDRESS"/>
<result property="lesseeHouseAddress" column="LESSEE_HOUSE_ADDRESS"/>
<result property="isPcInput" column="IS_PC_INPUT"/>
</resultMap>
<select id="getContractInfoList" resultType="com.epmet.plugin.power.dto.rent.PliRentContractInfoLogDTO">
SELECT
i.ID,
i.CONTRACT_ID,
i.COMMUNITY_ID,
i.COMMUNITY_NAME,
i.GRID_ID,
i.GRID_NAME,
i.VILLAGE_ID,
i.VILLAGE_NAME,
i.BUILD_ID,
i.BUILD_NAME,
i.UNIT_ID,
i.UNIT_NAME,
i.HOME_ID,
i.HOME_NAME,
i.OWNER_NAME,
i.STATE,
i.LESSOR_NAME,
i.LESSOR_ID_CARD,
i.LESSOR_MOBILE,
i.LESSOR_RELATION,
i.LESSEE_NAME,
i.LESSEE_ID_CARD,
i.LESSEE_MOBILE,
i.LESSEE_UNIT,
i.SIGN_DATE,
i.REVIEW_DATE,
i.START_DATE,
i.END_DATE,
i.REASON,
i.DEL_FLAG,
i.REVISION,
i.CREATED_BY,
i.CREATED_TIME,
i.UPDATED_BY,
i.UPDATED_TIME,
i.CUSTOMER_ID,
i.LESSOR_LIVE_ADDRESS,
i.LESSEE_HOUSE_ADDRESS,
i.IS_PC_INPUT,
IF( b.id IS NULL, '否', '是' ) AS isBlack
FROM pli_rent_contract_info_log i
left join pli_rent_contract_info c on c.ID = i.CONTRACT_ID and c.DEL_FLAG = '0'
LEFT JOIN pli_rent_blacklist b ON c.LESSEE_ID_CARD = b.ID_CARD AND b.DEL_FLAG = '0'
WHERE i.DEL_FLAG = '0'
<if test="isPcInput == 1 or isPcInput == '1'">
AND i.IS_PC_INPUT = '1'
</if>
<if test="isPcInput == 2 or isPcInput == '2'">
AND (i.IS_PC_INPUT != '1' or i.IS_PC_INPUT is null)
</if>
<if test="customerId != null and customerId != ''">
AND i.CUSTOMER_ID = #{customerId}
</if>
<if test="gridId != null and gridId != ''">
AND i.GRID_ID = #{gridId}
</if>
<if test="villageId != null and villageId != ''">
AND i.VILLAGE_ID = #{villageId}
</if>
<if test="buildId != null and buildId != ''">
AND i.BUILD_ID = #{buildId}
</if>
<if test="unitId != null and unitId != ''">
AND i.UNIT_ID = #{unitId}
</if>
<if test="homeId != null and homeId != ''">
AND i.HOME_ID = #{homeId}
</if>
<if test="state != null and state != ''">
AND i.STATE = #{state}
</if>
<if test="lessorName != null and lessorName != ''">
AND i.LESSOR_NAME = #{lessorName}
</if>
<if test="lessorIdCard != null and lessorIdCard != ''">
AND i.LESSOR_ID_CARD = #{lessorIdCard}
</if>
<if test="lessorMobile != null and lessorMobile != ''">
AND i.LESSOR_MOBILE = #{lessorMobile}
</if>
<if test="lesseeName != null and lesseeName != ''">
AND i.LESSEE_NAME = #{lesseeName}
</if>
<if test="lesseeIdCard != null and lesseeIdCard != ''">
AND i.LESSEE_ID_CARD = #{lesseeIdCard}
</if>
<if test="lesseeMobile != null and lesseeMobile != ''">
AND i.LESSEE_MOBILE = #{lesseeMobile}
</if>
<if test="reviewStartTime != null and reviewStartTime != ''">
AND i.REVIEW_DATE >= #{reviewStartTime}
</if>
<if test="reviewEndTime != null and reviewEndTime != ''">
AND i.REVIEW_DATE &lt;= #{reviewEndTime}
</if>
<if test="startTime != null and startTime != ''">
AND i.SIGN_DATE >= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND i.SIGN_DATE &lt;= #{endTime}
</if>
<if test="createdBy != null and createdBy != ''">
AND i.CREATED_BY = #{createdBy}
</if>
<if test="endDate != null and endDate != ''">
<if test="endDate == '0' or endDate == 0">
AND DATE( i.END_DATE ) &lt;= DATE_ADD( curdate(), INTERVAL 1 MONTH )
AND DATE( i.END_DATE ) > CURDATE()
</if>
<if test="endDate == '1' or endDate == 1">
AND DATE( i.END_DATE ) &lt;= DATE_ADD( curdate(), INTERVAL 2 MONTH )
AND DATE( i.END_DATE ) > CURDATE()
</if>
<if test="endDate == '2' or endDate == 2">
AND DATE( i.END_DATE ) &lt;= DATE_ADD( curdate(), INTERVAL 3 MONTH )
AND DATE( i.END_DATE ) > CURDATE()
</if>
<if test="endDate == '3' or endDate == 3">
AND DATE( i.END_DATE ) &lt;= CURDATE()
</if>
</if>
order by i.CREATED_TIME desc
</select>
</mapper>
Loading…
Cancel
Save