Browse Source

合并孙家滩分支到master

feature/teamB_zz_wgh
YUJT 3 years ago
parent
commit
02fb2ce69e
  1. 42
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HomeMemberOperationEnum.java
  2. 40
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HouseQrcodeEnum.java
  3. 17
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/HouseInfoCache.java
  4. 171
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HouseQRcodeUtils.java
  5. 39
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseCodeInfoDTO.java
  6. 6
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java
  7. 19
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseQrcodeFormDTO.java
  8. 26
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseInfoFormDTO.java
  9. 28
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/TestFormDTO.java
  10. 37
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CreateHouseCodeAndUrlDTO.java
  11. 16
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java
  12. 65
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseInfoResultDTO.java
  13. 7
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseListResultDTO.java
  14. 114
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  15. 30
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  16. 170
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  17. 82
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseCodeInfoController.java
  18. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java
  19. 43
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseCodeInfoDao.java
  20. 56
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java
  21. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java
  22. 40
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseCodeInfoEntity.java
  23. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java
  24. 30
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcHouseCodeInfoExcel.java
  25. 30
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcHouseCodeInfoRedis.java
  26. 46
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java
  27. 78
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseCodeInfoService.java
  28. 15
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java
  29. 436
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  30. 87
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseCodeInfoServiceImpl.java
  31. 36
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java
  32. 64
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ConvertToMultipartFile.java
  33. 10
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.21__alter_ic_house.sql
  34. 30
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseCodeInfoDao.xml
  35. 46
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
  36. 11
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml
  37. 190
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserConfirmDTO.java
  38. 25
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserConfirmGetDTO.java
  39. 210
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserConfirmSubmitDTO.java
  40. 70
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RegisterAndBindFormDTO.java
  41. 22
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/HomeInfoResultDTO.java
  42. 95
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserConfirmController.java
  43. 162
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/MyHomeController.java
  44. 25
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserConfirmDao.java
  45. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  46. 157
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserConfirmEntity.java
  47. 105
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiUserConfirmExcel.java
  48. 30
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcResiUserConfirmRedis.java
  49. 127
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserConfirmService.java
  50. 27
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  51. 46
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/MyHomeService.java
  52. 175
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserConfirmServiceImpl.java
  53. 69
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  54. 210
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/MyHomeServiceImpl.java
  55. 39
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.52__ic_resi_user_confirm.sql
  56. 44
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserConfirmDao.xml
  57. 16
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

42
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HomeMemberOperationEnum.java

@ -0,0 +1,42 @@
package com.epmet.commons.tools.enums;
/**
* 组织级别枚举类
* dev|test|prod
*
* @author jianjun liu
* @date 2020-07-03 11:14
**/
public enum HomeMemberOperationEnum {
ADD("add", "新增"),
UPDATE("update", "修改"),
DELETE("delele", "删除");
private String code;
private String name;
HomeMemberOperationEnum(String code, String name) {
this.code = code;
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

40
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HouseQrcodeEnum.java

@ -0,0 +1,40 @@
package com.epmet.commons.tools.enums;
/**
* @describe: 一户一档二维码信息
* @author wangtong
* @date 2022/6/1 13:34
* @params
* @return
*/
public enum HouseQrcodeEnum {
SUFFIX(".png", "二维码格式的后缀");
// PREFIX("https://epmet-dev.elinkservice.cn/cqrcode-ty/", "二维码地址的前缀");
private String code;
private String name;
HouseQrcodeEnum(String code, String name) {
this.code = code;
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

17
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/HouseInfoCache.java

@ -89,4 +89,21 @@ public class HouseInfoCache implements Serializable {
* 组织的area_code
*/
private String areaCode;
/**
* 网格id
*/
private String gridId;
/**
* 网格名称
*/
private String gridName;
/**
* 房屋编码
*/
private String houseCode;
/**
* 二维码地址
*/
private String houseQrcodeUrl;
}

171
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HouseQRcodeUtils.java

@ -0,0 +1,171 @@
package com.epmet.commons.tools.utils;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.WriterException;
import com.google.zxing.client.j2se.MatrixToImageConfig;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.common.CharacterSetECI;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import lombok.extern.slf4j.Slf4j;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
/**
* Date 2022/06/7 10:01
* Description:房屋一户一码生成工具类
*/
@Slf4j
public class HouseQRcodeUtils {
/**
* 二维码颜色 默认是黑色
*/
private static final Color QRCOLOR = Color.black;
/**
* 背景颜色
*/
private static final Color BGWHITE = Color.white;
public static final int WIDTH = 800;
public static final int HEIGHT = 800;
public static final int MARGIN = 10;
public static final int FONTSIZE = 40;
/**
* 房屋一户一码生成-指定像素
*
* @param contents 说明
* @return BufferedImage
* @throws Exception
*/
public static BufferedImage drawHouseQRImage(String pressText, String contents) throws Exception {
BufferedImage qRImage = null;
if (contents == null || "".equals(contents)) {
throw new Exception("content说明不能为空");
}
// 二维码参数设置
HashMap<EncodeHintType, Object> hints = new HashMap<>();
hints.put(EncodeHintType.CHARACTER_SET, CharacterSetECI.UTF8); // 编码设置
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); // 安全等级,最高h
hints.put(EncodeHintType.MARGIN, MARGIN); // 设置margin=0-10
// 二维码图片的生成
BarcodeFormat format = BarcodeFormat.QR_CODE;
// 创建矩阵容器
BitMatrix matrix = null;
try {
matrix = new MultiFormatWriter().encode(contents, format, WIDTH, HEIGHT, hints);
} catch (WriterException e) {
log.error("method exception", e);
}
// 设置矩阵转为图片的参数
MatrixToImageConfig toImageConfig = new MatrixToImageConfig(QRCOLOR.getRGB(), BGWHITE.getRGB());
// 矩阵转换图像
qRImage = MatrixToImageWriter.toBufferedImage(matrix, toImageConfig);
return pressHouseText(pressText, qRImage);
}
/**
* @param pressText 二维码下方插入文字
* @param image 需要添加文字的图片
* @为图片添加文字
*/
private static BufferedImage pressHouseText(String pressText, BufferedImage image) throws Exception {
BufferedImage outImage = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB);
//计算文字开始的位置
//x开始的位置:(图片宽度-字体大小*字的个数)/2
int startX = (WIDTH - (FONTSIZE * pressText.length())) / 2;
//y开始的位置:图片高度-(图片高度-图片宽度)/2
// int startY = HEIGHT - (HEIGHT - WIDTH) / 2 + FONTSIZE;
int startY = 740;
int imageW = outImage.getWidth();
int imageH = outImage.getHeight();
Graphics2D g = outImage.createGraphics();
g.drawImage(image, 0, 0, imageW, imageH, null);
g.setColor(QRCOLOR);
g.setFont(new Font("Noto Sans SC Light", Font.BOLD, FONTSIZE));
g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g.setBackground(Color.white);
// 获取文字数量 按照字节展示
int size = pressText.getBytes("GBK").length;
// 获取一行最多能容纳多少文字 按照文字字节展示
int maxSize = (WIDTH / FONTSIZE - 2) * 2;
if (size > maxSize) {
int v = size % maxSize;
for (int a = 0; a < (size / maxSize); a++) {
String s = outStringByByte(pressText, maxSize);
g.drawString(s, (WIDTH - (FONTSIZE * (WIDTH / FONTSIZE - 2))) / 2, startY);
pressText = pressText.substring(s.length(), pressText.length());
startY = startY + 35;
}
if (v != 0) {
g.drawString(pressText, (WIDTH - (FONTSIZE * v)) / 2, startY);
}
} else {
g.drawString(pressText, (WIDTH - ((pressText.getBytes("GBK").length) / 2) * FONTSIZE) / 2, startY);
}
g.dispose();
return outImage;
}
/**
* 保存二维码图片到本地
*
* @param contents
* @throws Exception
*/
public static void createImg(String pressText, String contents, String filename, String filePath) throws Exception {
BufferedImage qRImageWithLogo = drawHouseQRImage(pressText, contents);
// 写入返回
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ImageIO.write(qRImageWithLogo, "jpg", baos);
//图片类型
String imageType = "jpg";
//生成二维码存放文件
File file = new File(filePath + filename + ".jpg");
if (!file.exists()) {
file.mkdirs();
}
ImageIO.write(qRImageWithLogo, imageType, file);
baos.close();
}
private static String outStringByByte(String str, int len) throws IOException {
byte[] btf = str.getBytes("GBK");
int count = 0;
for (int j = len - 1; j >= 0; j--) {
if (btf[j] < 0) {
count++;
} else {
break;
}
}
if (count % 2 == 0) {
return new String(btf, 0, len, "GBK");
} else {
return new String(btf, 0, len - 1, "GBK");
}
}
}

39
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseCodeInfoDTO.java

@ -0,0 +1,39 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
/**
*
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-01
*/
@Data
public class IcHouseCodeInfoDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 所属楼栋id
*/
private String buildingId;
/**
* 最大的楼栋编码序列号
*/
private String buildingMaxNum;
/**
* 该楼栋下最大的房屋编码序列号
*/
private String houseMaxNum;
}

6
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java

@ -111,6 +111,12 @@ public class IcHouseDTO implements Serializable {
*/
private BigDecimal sort;
/**
* 房屋编码
*/
private String houseCode;
private String houseQrcodeUrl;
/**
* 删除标识 0未删除1已删除
*/

19
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseQrcodeFormDTO.java

@ -0,0 +1,19 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @program: epmet-cloud
* @description:
* @author: wangtong
* @create: 2022-06-01 13:44
**/
@Data
public class HouseQrcodeFormDTO implements Serializable {
@NotNull(message = "id不可为空")
private String id;
}

26
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseInfoFormDTO.java

@ -0,0 +1,26 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* @describe: 根据房屋编码获取房屋信息
* @author wangtong
* @date 2022/6/1 18:17
* @params
* @return
*/
@Data
public class IcHouseInfoFormDTO extends PageFormDTO {
private static final long serialVersionUID = -1L;
@NotNull(message = "房屋编码不可为空")
private String houseCode;
private String customerId;
}

28
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/TestFormDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* @describe: 根据房屋编码获取房屋信息
* @author wangtong
* @date 2022/6/1 18:17
* @params
* @return
*/
@Data
public class TestFormDTO extends PageFormDTO {
private static final long serialVersionUID = -1L;
private String buildingId;
private String customerId;
private String areaCode;
private String houseId;
}

37
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CreateHouseCodeAndUrlDTO.java

@ -0,0 +1,37 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @program: epmet-cloud
* @description:
* @author: wangtong
* @create: 2022-06-06 15:08
**/
@Data
public class CreateHouseCodeAndUrlDTO implements Serializable {
/**
* 房屋id
*/
private String houseId;
/**
* 客户id
*/
private String customerId;
/**
* 楼栋id
*/
private String buildingId;
/**
* 区划代码
*/
private String areaCode;
}

16
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java

@ -91,4 +91,20 @@ public class HouseInfoDTO implements Serializable {
* 组织的area_code
*/
private String areaCode;
/**
* 网格id
*/
private String gridId;
/**
* 网格名称
*/
private String gridName;
/**
* 房屋编码
*/
private String houseCode;
/**
* 二维码地址
*/
private String houseQrcodeUrl;
}

65
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseInfoResultDTO.java

@ -0,0 +1,65 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* desc:房屋列表结果类
*
* @author liujianjun
*/
@Data
public class IcHouseInfoResultDTO implements Serializable {
private static final long serialVersionUID = 4963952996288796744L;
/**
* 所属网格
*/
private String gridName;
private String gridId;
/**
* 所属小区
*/
private String neighborHoodId;
private String neighborHoodName;
/**
* 所属楼栋
*/
private String buildingId;
private String buildingName;
/**
* 所属单元id
*/
private String buildingUnitId;
private String unitName;
/**
* 房间名称
*/
private String houseName;
/**
* 门牌号
*/
private String doorName;
/**
* 房屋id
*/
private String houseId;
/**
* 客户id
*/
private String customerId;
}

7
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseListResultDTO.java

@ -16,6 +16,8 @@ public class IcHouseListResultDTO implements Serializable {
private static final long serialVersionUID = 4963952996288796744L;
private String customerId;
private String houseId;
private String doorName;
@ -82,5 +84,10 @@ public class IcHouseListResultDTO implements Serializable {
private String remark;
private Double sort;
/**
* 房屋编码
*/
private String houseCode;
}

114
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -94,17 +94,17 @@ public interface GovOrgOpenFeignClient {
* @param partyBranchId
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.CustomerPartyBranchDTO>
* @author yinzuomei
* @description 根据党支部id,查询党支部信息
* @description 根据党支部id, 查询党支部信息
* @Date 2020/6/17 18:01
**/
@GetMapping(value = "gov/org/customerpartybranch/get/{id}")
Result<CustomerPartyBranchDTO> getPartyBranchById(@PathVariable("id") String partyBranchId);
/**
* @return com.epmet.commons.tools.utils.Result
* @param partyBranchId
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei
* @description 根据党支部id,删除党支部存在党员的不允许删除
* @description 根据党支部id, 删除党支部存在党员的不允许删除
* @Date 2020/6/17 18:08
**/
@GetMapping(value = "gov/org/customerpartybranch/delete/{id}")
@ -121,8 +121,8 @@ public interface GovOrgOpenFeignClient {
Result<GridInfoResultDTO> queryGridInfo(@PathVariable("gridId") String gridId);
/**
* @return com.epmet.commons.tools.utils.Result
* @param partyBranchId
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei
* @description 党支部宗人数-1
* @Date 2020/6/18 18:28
@ -158,8 +158,8 @@ public interface GovOrgOpenFeignClient {
Result<List<GridByStaffResultDTO>> listGridsbystaffid(@PathVariable("staffId") String staffId);
/**
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.ActSponsorResultDTO>
* @param staffId
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.ActSponsorResultDTO>
* @author yinzuomei
* @description 发布活动-主办方列表
* @Date 2020/7/23 20:47
@ -168,7 +168,6 @@ public interface GovOrgOpenFeignClient {
Result<ActSponsorResultDTO> querySponsorList(@PathVariable("staffId") String staffId);
/**
*
* @Description 根据网格id查询网格名称
* @Author zxc
* @CreatedTime 2020/4/27 9:22
@ -177,20 +176,19 @@ public interface GovOrgOpenFeignClient {
Result<BelongGridNameResultDTO> getGridNameByGridId(@RequestBody BelongGridNameFormDTO formDTO);
/**
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.StaffOrgsResultDTO>>
* @param staffOrgFormDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.StaffOrgsResultDTO>>
* @Author yinzuomei
* @Description 获取客户对应的根级组织名称
* @Date 2020/4/20 21:37
**/
@PostMapping(value = "/gov/org/customeragency/getStaffOrgList",consumes = MediaType.APPLICATION_JSON_VALUE)
@PostMapping(value = "/gov/org/customeragency/getStaffOrgList", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<List<StaffOrgsResultDTO>> getStaffOrgList(StaffOrgFormDTO staffOrgFormDTO);
/**
* @description 通过staffId查询跟组织列表
*
* @param input
* @return
* @description 通过staffId查询跟组织列表
* @author wxz
* @date 2021.10.25 14:53:53
*/
@ -198,8 +196,8 @@ public interface GovOrgOpenFeignClient {
Result<List<StaffOrgsResultDTO>> getStaffOrgListByStaffId(@RequestBody RootOrgListByStaffIdFormDTO input);
/**
* @Description 查询一个网格下的所有工作人员
* @param gridIdFormDTO
* @Description 查询一个网格下的所有工作人员
* @author zxc
* @date 2020/8/13 10:46 上午
*/
@ -207,8 +205,8 @@ public interface GovOrgOpenFeignClient {
Result<List<String>> getGridStaffs(@RequestBody CommonGridIdFormDTO gridIdFormDTO);
/**
* @Description 查询部门下工作人员
* @param formDTO
* @Description 查询部门下工作人员
* @author zxc
* @date 2020/8/13 2:46 下午
*/
@ -216,8 +214,8 @@ public interface GovOrgOpenFeignClient {
Result<List<String>> getDepartmentStaffs(@RequestBody DepartmentIdFormDTO formDTO);
/**
* @Description 查询客户下的网格数量
* @param customerIdFormDTO
* @Description 查询客户下的网格数量
* @author zxc
* @date 2020/8/14 9:31 上午
*/
@ -225,8 +223,8 @@ public interface GovOrgOpenFeignClient {
Result<CustomerGridCountResultDTO> selectGridCount(@RequestBody CustomerIdFormDTO customerIdFormDTO);
/**
* @Description 查询机关下工作人员
* @param formDTO
* @Description 查询机关下工作人员
* @author zxc
* @date 2020/8/17
*/
@ -234,19 +232,19 @@ public interface GovOrgOpenFeignClient {
Result<List<String>> getAgencyStaffs(@RequestBody AgencyIdFormDTO formDTO);
/**
* @Description User模块调用gov-org查询工作人员所在机关的信息以及客户信息
* @param result
* @return
* @Description User模块调用gov-org查询工作人员所在机关的信息以及客户信息
* @author wangc
* @date 2020.08.17 14:11
**/
**/
@PostMapping("/gov/org/customeragency/staffinfoext")
Result<ExtStaffInfoResultDTO> staffInfoExt(@RequestBody ExtStaffInfoResultDTO result);
/**
* @Description 根据staffId查询当前这个用户的数据权限对外接口
* @param staffId
* @return
* @Description 根据staffId查询当前这个用户的数据权限对外接口
* @author wangc
* @date 2020.08.17 17:30
**/
@ -254,9 +252,9 @@ public interface GovOrgOpenFeignClient {
Result<ExtStaffPermissionResultDTO> staffPermissionExt(@PathVariable(value = "staffId") String staffId);
/**
* @param result ExtStaffInfoResultDTO.class
* @return Result<ExtStaffInfoResultDTO>
* @Description User模块调用gov-org查询用户所在机关的信息以及客户信息
* @param result ExtStaffInfoResultDTO.class
* @return Result<ExtStaffInfoResultDTO>
* @author wangc
* @date 2020.08.17 13:52
**/
@ -289,7 +287,7 @@ public interface GovOrgOpenFeignClient {
Result<OrganizeTreeResultDTO> organizeTree(@PathVariable("agencyId") String agencyId);
/**
* @Description 查询org信息
* @Description 查询org信息
* @Param orgInfoFormDTO
* @author zxc
* @date 2020/11/10 2:55 下午
@ -307,8 +305,8 @@ public interface GovOrgOpenFeignClient {
Result<List<AllGridsByUserIdResultDTO>> getGridListByGridIds(List<String> gridIdList);
/**
* @Description 查询网格名 不限制是否同步条件 SYNC_FLAG
* @param gridIdList
* @Description 查询网格名 不限制是否同步条件 SYNC_FLAG
* @author zxc
* @date 2022/1/12 9:37 上午
*/
@ -316,9 +314,9 @@ public interface GovOrgOpenFeignClient {
Result<List<AllGridsByUserIdResultDTO>> getAllGridListByGridIds(List<String> gridIdList);
/**
* @Description 根据网格Id查询用户数据
* @param customerGridFormDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.CustomerGridDTO>
* @Description 根据网格Id查询用户数据
* @Author liushaowen
* @Date 2020/11/18 15:34
*/
@ -337,8 +335,9 @@ public interface GovOrgOpenFeignClient {
/**
* 根据 网格id查询同属于一个社区下的所有网格id
*
* @param gridId
* @return com.epmet.commons.tools.utils.Result<java.util.List<java.lang.String>>
* @return com.epmet.commons.tools.utils.Result<java.util.List < java.lang.String>>
* @Author zhangyong
* @Date 17:44 2020-12-28
**/
@ -355,7 +354,7 @@ public interface GovOrgOpenFeignClient {
Result<ProcessorListResultDTO> getProcessorList(@PathVariable("agencyId") String agencyId);
/**
* @Description 查询网格下的网格员
* @Description 查询网格下的网格员
* @Param gridIds
* @author zxc
* @date 2021/6/8 3:36 下午
@ -364,17 +363,17 @@ public interface GovOrgOpenFeignClient {
Result<List<GridStaffResultDTO>> selectGridStaffByGridIds(@RequestBody List<String> gridIds);
/**
* @return com.epmet.commons.tools.utils.Result<java.lang.String>
* @param customerId
* @return com.epmet.commons.tools.utils.Result<java.lang.String>
* @author yinzuomei
* @description 根据customerId查询参数(area_code_switch)值open: 选择地区编码必填closed: 无需选择地区编码;;0409新增返参;没配置,返回closed
* @description 根据customerId查询参数(area_code_switch)值open: 选择地区编码必填closed: 无需选择地区编码;;0409新增返参;没配置,返回closed
* @Date 2021/6/24 16:11
**/
@GetMapping(value = "/gov/org/customeragency/getareacodeswitch/{customerId}")
Result<String> getAreaCodeSwitch(@PathVariable("customerId")String customerId);
Result<String> getAreaCodeSwitch(@PathVariable("customerId") String customerId);
/**
* @Description 根据网格ID查询pids
* @Description 根据网格ID查询pids
* @Param gridId
* @author zxc
* @date 2021/7/16 9:52 上午
@ -384,6 +383,7 @@ public interface GovOrgOpenFeignClient {
/**
* 工作人员的个人信息
*
* @param fromDTO
* @return
*/
@ -391,25 +391,25 @@ public interface GovOrgOpenFeignClient {
Result<MineResultDTO> queryStaffProfile(@RequestBody StaffInfoFromDTO fromDTO);
/**
* @Description 查询工作人员名字 xx组织-章三
* @Description 查询工作人员名字 xx组织-章三
* @Param userId
* @author zxc
* @date 2021/8/4 4:23 下午
*/
@PostMapping("/gov/org/staff/staffname")
Result<String> staffName(@RequestParam("userId")String userId);
Result<String> staffName(@RequestParam("userId") String userId);
/**
* @Description 查询网格名字
* @Description 查询网格名字
* @Param gridName
* @author zxc
* @date 2021/8/4 4:26 下午
*/
@PostMapping("/gov/org/customergrid/selectgridname")
Result<String> gridName(@RequestParam("gridId")String gridId);
Result<String> gridName(@RequestParam("gridId") String gridId);
/**
* @Description 根据类型查询组织名称
* @Description 根据类型查询组织名称
* @Param formList
* @author zxc
* @date 2021/8/4 6:14 下午
@ -418,19 +418,19 @@ public interface GovOrgOpenFeignClient {
Result<List<String>> selectOrgNameByType(@RequestBody List<String> formList);
/**
* @Description 根据人查询所在组织
* @Description 根据人查询所在组织
* @Param userId
* @author zxc
* @date 2021/8/5 10:08 上午
*/
@PostMapping("/gov/org/customergrid/selectorgsbyuserid")
Result<List<String>> selectOrgsByUserId(@RequestParam("userId")String userId);
Result<List<String>> selectOrgsByUserId(@RequestParam("userId") String userId);
/**
* 架构里面的人
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.Set<java.lang.String>>
* @return com.epmet.commons.tools.utils.Result<java.util.Set < java.lang.String>>
* @author yinzuomei
* @date 2021/8/19 2:27 下午
*/
@ -459,9 +459,8 @@ public interface GovOrgOpenFeignClient {
@PostMapping("/gov/org/grid/getbaseinfo")
Result<CustomerGridDTO> getGridBaseInfoByGridId(CustomerGridFormDTO customerGridFormDTO);
@PostMapping(value = "/gov/org/house/queryListHouseInfo",consumes = MediaType.APPLICATION_JSON_VALUE)
Result<List<HouseInfoDTO>> queryListHouseInfo(@RequestBody Set<String> houseIds, @RequestParam("customerId") String customerId);
@PostMapping(value = "/gov/org/house/queryListHouseInfo", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<List<HouseInfoDTO>> queryListHouseInfo(@RequestBody Set<String> houseIds, @RequestParam("customerId") String customerId);
/**
@ -476,6 +475,7 @@ public interface GovOrgOpenFeignClient {
/**
* 获取网格下支部小组
*
* @Param formDTO
* @Return {@link Result<List<OptionResultDTO>>}
* @Author zhaoqifeng
@ -518,13 +518,13 @@ public interface GovOrgOpenFeignClient {
Result<List<OptionResultDTO>> getNeighborHoodOptions(IcNeighborHoodDTO dto);
/**
* @Description 查询房屋信息
* @param idCard
* @Description 查询房屋信息
* @author zxc
* @date 2021/11/3 3:30 下午
*/
@PostMapping("/gov/org/ichouse/selecthouseinfobyidcard")
Result<List<String>> selectHouseInfoByIdCard(@RequestParam("idCard")String idCard,@RequestParam("customerId")String customerId);
Result<List<String>> selectHouseInfoByIdCard(@RequestParam("idCard") String idCard, @RequestParam("customerId") String customerId);
@GetMapping("/gov/org/ichouse/{id}")
Result<IcHouseDTO> get(@PathVariable("id") String id);
@ -533,7 +533,7 @@ public interface GovOrgOpenFeignClient {
Result<List<BuildingResultDTO>> buildingListByIds(@RequestBody List<String> buildingIdList);
@PostMapping("/gov/org/building/buildinglistbyidsPage/{pageNo}/{pageSize}")
Result<BuildingResultPagedDTO> buildinglistbyidsPage(@RequestBody List<String> buildingIdList,@PathVariable("pageNo") Integer pageNo,@PathVariable("pageSize")Integer pageSize);
Result<BuildingResultPagedDTO> buildinglistbyidsPage(@RequestBody List<String> buildingIdList, @PathVariable("pageNo") Integer pageNo, @PathVariable("pageSize") Integer pageSize);
@PostMapping("/gov/org/icneighborhood/getlistbyids")
Result<List<IcNeighborHoodDTO>> getListByIds(@RequestBody List<String> ids);
@ -542,18 +542,19 @@ public interface GovOrgOpenFeignClient {
Result<List<CustomerGridDTO>> getGridIListByAgency(@PathVariable("agencyId") String agencyId);
/**
* @Description 查询下级agencyId
* @param orgId
* @Description 查询下级agencyId
* @author zxc
* @date 2021/12/9 4:42 下午
*/
@PostMapping("/gov/org/agency/getsonagencyid")
Result<List<SonOrgResultDTO>> getSonAgencyId(@RequestParam("orgId")String orgId,@RequestParam("type")String type);
Result<List<SonOrgResultDTO>> getSonAgencyId(@RequestParam("orgId") String orgId, @RequestParam("type") String type);
// /icbuilding/{id}?id=demoData
/**
* 根据ID查询楼栋信息
*
* @param id
* @return
*/
@ -562,6 +563,7 @@ public interface GovOrgOpenFeignClient {
/**
* 通过ID查询小区信息
*
* @param id
* @return
*/
@ -571,6 +573,7 @@ public interface GovOrgOpenFeignClient {
/**
* 运营端-客户管理修改客户信息调用gov-org服务修改组织区划开关修改根组织areaCode入参
*
* @param formDTO
* @return
*/
@ -591,6 +594,7 @@ public interface GovOrgOpenFeignClient {
/**
* 查询单元
*
* @param id
* @return
*/
@ -599,15 +603,17 @@ public interface GovOrgOpenFeignClient {
/**
* Desc: 查询网格下所有的工作人员
*
* @param gridId
* @author zxc
* @date 2022/3/21 16:02
*/
@PostMapping("/gov/org/customerstaffgrid/getallstaffbygridid")
Result<List<String>> getAllStaffByGridId(@RequestParam("gridId")String gridId);
Result<List<String>> getAllStaffByGridId(@RequestParam("gridId") String gridId);
/**
* Desc: 根据身份证查询房屋名
*
* @param idCards
* @author zxc
* @date 2022/4/12 16:42
@ -617,6 +623,11 @@ public interface GovOrgOpenFeignClient {
/**
* Desc: 房屋更新
* <<<<<<< HEAD
* =======
* <p>
* >>>>>>> feature/dev_sunjiatan
*
* @param formDTO
* @author zxc
* @date 2022/5/11 09:46
@ -626,11 +637,12 @@ public interface GovOrgOpenFeignClient {
/**
* 直属网格+下一级组织
*
* @param agencyId
* @return
*/
@GetMapping("/gov/org/customeragency/subOrgList/{agencyId}")
Result<List<SubOrgResDTO>> subOrgList(@PathVariable("agencyId")String agencyId);
Result<List<SubOrgResDTO>> subOrgList(@PathVariable("agencyId") String agencyId);
/**
* @Author sun
@ -639,4 +651,14 @@ public interface GovOrgOpenFeignClient {
@PostMapping(value = "/gov/org/customeragency/getDelAgencyGridIdList/{agencyId}")
Result<DelAgencyGridIdResultDTO> getDelAgencyGridIdList(@PathVariable("agencyId") String agencyId);
/**
* 根据房屋编码查询房屋信息
*
* @param houseCode
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.IcHouseDTO>
* @author work@yujt.net.cn
* @date 2022/6/1/0001 16:18
*/
@GetMapping("/gov/org/ichouse/getbyhousecode/{houseCode}")
Result<IcHouseDTO> getByHouseCode(@PathVariable("houseCode") String houseCode);
}

30
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -67,12 +67,12 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
@Override
public Result<GridInfoResultDTO> queryGridInfo(String gridId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridInfo",gridId);
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridInfo", gridId);
}
@Override
public Result decrPartyBranchMember(String partyBranchId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "decrPartyBranchMember",partyBranchId);
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "decrPartyBranchMember", partyBranchId);
}
@Override
@ -276,7 +276,7 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
}
@Override
public Result<List<HouseInfoDTO>> queryListHouseInfo(Set<String> houseIds ,String customerId) {
public Result<List<HouseInfoDTO>> queryListHouseInfo(Set<String> houseIds, String customerId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "queryListHouseInfo", houseIds, customerId);
}
@ -311,7 +311,7 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
}
@Override
public Result<List<String>> selectHouseInfoByIdCard(String idCard,String customerId) {
public Result<List<String>> selectHouseInfoByIdCard(String idCard, String customerId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectHouseInfoByIdCard", idCard, customerId);
}
@ -324,9 +324,10 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
public Result<List<BuildingResultDTO>> buildingListByIds(List<String> buildingIdList) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "buildingListByIds", buildingIdList);
}
@Override
public Result<BuildingResultPagedDTO> buildinglistbyidsPage(List<String> buildingIdList,Integer pageNo,Integer pageSize) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "buildinglistbyidsPage", buildingIdList,pageNo,pageSize);
public Result<BuildingResultPagedDTO> buildinglistbyidsPage(List<String> buildingIdList, Integer pageNo, Integer pageSize) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "buildinglistbyidsPage", buildingIdList, pageNo, pageSize);
}
@Override
@ -340,8 +341,8 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
}
@Override
public Result<List<SonOrgResultDTO>> getSonAgencyId(String orgId,String type) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getSonAgencyId", orgId,type);
public Result<List<SonOrgResultDTO>> getSonAgencyId(String orgId, String type) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getSonAgencyId", orgId, type);
}
@Override
@ -372,7 +373,7 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
@Override
public Result<List<CustomerStaffGridResultDTO>> getStaffGridList(String customerId, String orgId, String orgType) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffGridList",customerId, orgId, orgType);
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffGridList", customerId, orgId, orgType);
}
/**
@ -400,8 +401,8 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
}
@Override
public Result houseUpdate( IcHouseAddFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "houseUpdate",formDTO);
public Result houseUpdate(IcHouseAddFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "houseUpdate", formDTO);
}
/**
@ -412,7 +413,12 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
*/
@Override
public Result<List<SubOrgResDTO>> subOrgList(String agencyId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "subOrgList",agencyId);
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "subOrgList", agencyId);
}
@Override
public Result<IcHouseDTO> getByHouseCode(String houseCode) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getByHouseCode", houseCode);
}
@Override

170
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java

@ -30,6 +30,7 @@ import com.epmet.commons.tools.annotation.MaskResponse;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.form.IcHouseFormDTO;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
@ -39,13 +40,17 @@ import com.epmet.commons.tools.redis.common.bean.HouseInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.HouseQRcodeUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.poi.excel.handler.ExcelFillRowMergeStrategy;
import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcHouseDao;
import com.epmet.dto.SysDictDataDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.service.HouseService;
@ -61,9 +66,12 @@ import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.imageio.ImageIO;
import javax.imageio.stream.ImageOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.io.PrintWriter;
import java.awt.image.BufferedImage;
import java.io.*;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -90,9 +98,15 @@ public class HouseController implements ResultDataResolver {
@Autowired
private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient;
@Autowired
private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient;
@Autowired
private IcHouseDao icHouseDao;
@PostMapping("houselist")
@MaskResponse(fieldNames = {"ownerIdCard", "ownerPhone"},
fieldsMaskType = { MaskResponse.MASK_TYPE_ID_CARD, MaskResponse.MASK_TYPE_MOBILE })
fieldsMaskType = {MaskResponse.MASK_TYPE_ID_CARD, MaskResponse.MASK_TYPE_MOBILE})
public Result<PageData<IcHouseListResultDTO>> houseList(@LoginUser TokenDto loginUser, @RequestBody IcHouseListFormDTO formDTO) {
//效验数据
LoginUserDetailsResultDTO loginUserDetail = getLoginUserDetailsResultDTO(loginUser, "【查询房屋】查询当前staff所在组织信息失败");
@ -149,7 +163,7 @@ public class HouseController implements ResultDataResolver {
@NoRepeatSubmit
@PostMapping("houseadd")
public Result houseAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseAddFormDTO formDTO) {
public Result houseAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseAddFormDTO formDTO) throws Exception {
//效验数据
ValidatorUtils.validateEntity(formDTO, IcHouseAddFormDTO.AddShowGroup.class);
String customerId = tokenDTO.getCustomerId();
@ -321,12 +335,13 @@ public class HouseController implements ResultDataResolver {
/**
* Desc: 根据类型更新排序
*
* @param formDTO
* @author zxc
* @date 2022/5/6 08:50
*/
@PostMapping("update-sort")
public Result updateSort(@RequestBody UpdateSortFormDTO formDTO){
public Result updateSort(@RequestBody UpdateSortFormDTO formDTO) {
houseService.updateSort(formDTO);
return new Result();
}
@ -348,7 +363,7 @@ public class HouseController implements ResultDataResolver {
formDTO.setIsPage(false);
formDTO.setPageSize(NumConstant.TEN_THOUSAND);
//效验数据
if (StringUtils.isBlank(formDTO.getAgencyId())){
if (StringUtils.isBlank(formDTO.getAgencyId())) {
LoginUserDetailsResultDTO loginUserDetail = getLoginUserDetailsResultDTO(tokenDto, "【查询房屋】查询当前staff所在组织信息失败");
formDTO.setAgencyId(loginUserDetail.getAgencyId());
}
@ -368,34 +383,34 @@ public class HouseController implements ResultDataResolver {
.registerWriteHandler(horizontalCellStyleStrategy)
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
.build();
int[] mergeRowArr = new int[]{0,1,2,3,4,5,6,7,8,9,10,11,12};
int[] mergeRowArr = new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
//冻结表头 2行
FreezeAndFilter writeHandler = new FreezeAndFilter();
writeHandler.rowSplit = 2;
//ExcelFillCellMergeStrategy mergeStrategy = new ExcelFillCellMergeStrategy(2,mergeRowArr,false);
ExcelFillRowMergeStrategy mergeStrategy2 = new ExcelFillRowMergeStrategy(mergeRowArr,false);
ExcelFillRowMergeStrategy mergeStrategy2 = new ExcelFillRowMergeStrategy(mergeRowArr, false);
WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1")
.head(HouseMemberResultDTO.class)
.registerWriteHandler(mergeStrategy2)
.registerWriteHandler(writeHandler)
.build();
PageData<HouseMemberResultDTO> dataList = null;
Cache<String,Boolean> haveSearchCache = CacheBuilder.newBuilder().maximumSize(NumConstant.ONE_HUNDRED).expireAfterWrite(NumConstant.THIRTY, TimeUnit.MINUTES).build();
Cache<String, Boolean> haveSearchCache = CacheBuilder.newBuilder().maximumSize(NumConstant.ONE_HUNDRED).expireAfterWrite(NumConstant.THIRTY, TimeUnit.MINUTES).build();
do {
dataList = houseService.getHouseUser(tokenDto,formDTO,haveSearchCache);
dataList = houseService.getHouseUser(tokenDto, formDTO, haveSearchCache);
formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE);
long start = System.currentTimeMillis();
//设置合并策略中的 本次数据的总条数
mergeStrategy2.setSecTotalCount(dataList.getList().size()+1);
mergeStrategy2.setSecTotalCount(dataList.getList().size() + 1);
excelWriter.write(dataList.getList(), writeSheet);
log.info("getHouseUser doWrite cost:{}ms",System.currentTimeMillis() - start);
if (CollectionUtils.isEmpty(dataList.getList())){
log.info("getHouseUser doWrite cost:{}ms", System.currentTimeMillis() - start);
if (CollectionUtils.isEmpty(dataList.getList())) {
break;
}
}while (dataList.getTotal() == formDTO.getPageSize());
} while (dataList.getTotal() == formDTO.getPageSize());
//获取导出配置
haveSearchCache.invalidateAll();
@ -404,15 +419,136 @@ public class HouseController implements ResultDataResolver {
response.setCharacterEncoding("UTF-8");
response.setHeader("content-type", "application/json; charset=UTF-8");
PrintWriter printWriter = response.getWriter();
Result<Object> result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),e.getMsg());
Result<Object> result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg());
printWriter.write(JSON.toJSONString(result));
printWriter.close();
} finally {
if (excelWriter != null){
if (excelWriter != null) {
excelWriter.finish();
}
log.info("getHouseUser final cost:{}ms",System.currentTimeMillis() - startTime);
log.info("getHouseUser final cost:{}ms", System.currentTimeMillis() - startTime);
}
}
/**
* @return void
* @describe: 下载房屋编码
* @author wangtong
* @date 2022/6/1 17:24
* @params [formDTO, response]
*/
@PostMapping("createHouseQrcode")
public void createQrCode(@RequestBody HouseQrcodeFormDTO formDTO, HttpServletResponse response) {
ValidatorUtils.validateEntity(formDTO);
try {
IcHouseListResultDTO house = icHouseDao.selectHouseQrcodeById(formDTO.getId());
if (null == house) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到房屋信息", "未查到房屋信息");
}
//url组成:小程序地址?房屋编码
Result<List<SysDictDataDTO>> dict = epmetAdminOpenFeignClient.dictDataList("house_qrcode_pre");
if (!dict.success() || CollectionUtils.isEmpty(dict.getData())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "一户一码前缀查询异常", "一户一码前缀查询异常");
}
String url = dict.getData().get(0).getDictValue() + house.getHouseCode();
BufferedImage image = HouseQRcodeUtils.drawHouseQRImage(house.getBuildingName() + house.getUnitNum() + house.getDoorName(), url);
//BufferedImage 转 InputStream
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
ImageOutputStream imageOutput = ImageIO.createImageOutputStream(byteArrayOutputStream);
ImageIO.write(image, "png", imageOutput);
InputStream inputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
long length = imageOutput.length();
String fileName = house.getBuildingName() + house.getUnitNum() + house.getDoorName() + ".png";
response.setContentType("application/octet-stream");
response.setContentLength((int) length);
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, StrConstant.UTF_8));
//输出流
byte[] bytes = new byte[1024];
OutputStream outputStream = response.getOutputStream();
long count = 0;
while (count < length) {
int len = inputStream.read(bytes, 0, 1024);
count += len;
outputStream.write(bytes, 0, len);
}
outputStream.flush();
} catch (Exception e) {
log.error("method exception", e);
}
}
/**
* @return void
* @describe: 批量下载一户一档的二维码
* @author wangtong
* @date 2022/5/31 17:58
* @params [loginUser, formDTO, response]
*/
@NoRepeatSubmit
@PostMapping(value = "/downloadZip")
public void downloadZip(@LoginUser TokenDto loginUser, @RequestBody IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception {
//效验数据
LoginUserDetailsResultDTO loginUserDetail = getLoginUserDetailsResultDTO(loginUser, "【查询房屋】查询当前staff所在组织信息失败");
formDTO.setAgencyId(loginUserDetail.getAgencyId());
ValidatorUtils.validateEntity(formDTO);
houseService.downloadZip(response, formDTO);
}
/**
* @return com.epmet.dto.result.IcHouseInfoResultDTO
* @describe: 根据房屋编码获取信息
* @author wangtong
* @date 2022/6/1 18:24
* @params [formDTO]
*/
@PostMapping("getHouseInfoByCode")
public Result<IcHouseInfoResultDTO> getHouseInfoByCode(@LoginUser TokenDto loginUser, @RequestBody IcHouseInfoFormDTO formDTO) {
//效验数据
ValidatorUtils.validateEntity(formDTO);
formDTO.setCustomerId(loginUser.getCustomerId());
return houseService.getHouseInfoByCode(formDTO);
}
/**
* @describe: 批量生成房屋的房屋编码和一户一档二维码
* @author wangtong
* @date 2022/6/6 14:39
* @params []
* @return java.lang.String
*/
@NoRepeatSubmit
@PostMapping("createBatchHouseCodeAndUrl")
public Result createBatchHouseCodeAndUrl(@LoginUser TokenDto loginUser) {
return houseService.createBatchHouseCodeAndUrl(loginUser);
}
/**
* @describe: 测试生成Service接口-生成房屋编码
* @author wangtong
* @date 2022/6/6 14:39
* @params [formDTO]
* @return java.lang.String
*/
@PostMapping("createHouseCode")
public String createHouseCode(@RequestBody TestFormDTO formDTO) {
//效验数据
return houseService.createHouseCode(formDTO.getCustomerId(), formDTO.getBuildingId(), formDTO.getAreaCode());
}
/**
* @describe: 测试生成Service接口-生成房屋一户一档二维码
* @author wangtong
* @date 2022/6/6 14:40
* @params [formDTO]
* @return java.lang.String
*/
@PostMapping("createHouseQrcodeUrl")
public String createHouseQrcodeUrl(@RequestBody TestFormDTO formDTO) throws Exception {
return houseService.createHouseQrcodeUrl(formDTO.getHouseId());
}
}

82
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseCodeInfoController.java

@ -0,0 +1,82 @@
package com.epmet.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.dto.IcHouseCodeInfoDTO;
import com.epmet.excel.IcHouseCodeInfoExcel;
import com.epmet.service.IcHouseCodeInfoService;
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-06-01
*/
@RestController
@RequestMapping("icHouseCodeInfo")
public class IcHouseCodeInfoController {
@Autowired
private IcHouseCodeInfoService icHouseCodeInfoService;
@RequestMapping("page")
public Result<PageData<IcHouseCodeInfoDTO>> page(@RequestParam Map<String, Object> params){
PageData<IcHouseCodeInfoDTO> page = icHouseCodeInfoService.page(params);
return new Result<PageData<IcHouseCodeInfoDTO>>().ok(page);
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<IcHouseCodeInfoDTO> get(@PathVariable("id") String id){
IcHouseCodeInfoDTO data = icHouseCodeInfoService.get(id);
return new Result<IcHouseCodeInfoDTO>().ok(data);
}
@NoRepeatSubmit
@PostMapping("save")
public Result save(@RequestBody IcHouseCodeInfoDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icHouseCodeInfoService.save(dto);
return new Result();
}
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody IcHouseCodeInfoDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icHouseCodeInfoService.update(dto);
return new Result();
}
@PostMapping("delete")
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
icHouseCodeInfoService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<IcHouseCodeInfoDTO> list = icHouseCodeInfoService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, IcHouseCodeInfoExcel.class);
}
}

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java

@ -90,4 +90,8 @@ public class IcHouseController {
return new Result<List<HousesNameResultDTO>>().ok(icHouseService.getHousesNameByIdCards(idCards));
}
@GetMapping("getbyhousecode/{houseCode}")
public Result<IcHouseDTO> getByHouseCode(@PathVariable("houseCode") String houseCode){
return new Result<IcHouseDTO>().ok(icHouseService.getByHouseCode(houseCode));
}
}

43
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseCodeInfoDao.java

@ -0,0 +1,43 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.IcHouseCodeInfoEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
*
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-01
*/
@Mapper
public interface IcHouseCodeInfoDao extends BaseDao<IcHouseCodeInfoEntity> {
/**
* @describe: 通过客户id和楼栋id查询
* @author wangtong
* @date 2022/6/1 17:01
* @params [customerId, buildingId]
* @return com.epmet.entity.IcHouseCodeInfoEntity
*/
IcHouseCodeInfoEntity selectByCuIdAndBuilId(@Param("customerId") String customerId,@Param("buildingId") String buildingId);
/**
* @describe: 查询数据库里最大的楼栋编号
* @author wangtong
* @date 2022/6/1 17:15
* @params []
* @return com.epmet.entity.IcHouseCodeInfoEntity
*/
IcHouseCodeInfoEntity selectMaxHouseMaxNum();
/**
* @describe: 根据客户id和楼栋id更新房屋最大编码
* @author wangtong
* @date 2022/6/2 9:37
* @params [codeEntity]
* @return void
*/
void updateByCuIdAndBuId(IcHouseCodeInfoEntity codeEntity);
}

56
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java

@ -27,45 +27,49 @@ public interface IcHouseDao extends BaseDao<IcHouseEntity> {
HouseInfoDTO queryHouseInfoByHouseId(@Param("houseId") String houseId);
/**
* @Description 查询房屋信息
* @param idCard
* @Description 查询房屋信息
* @author zxc
* @date 2021/11/3 3:30 下午
*/
List<String> selectHouseInfoByIdCard(@Param("idCard") String idCard,@Param("customerId")String customerId);
List<String> selectHouseInfoByIdCard(@Param("idCard") String idCard, @Param("customerId") String customerId);
Integer checkDoorNameUq(@Param("neighborHoodId") String neighborHoodId,
@Param("buildingId")String buildingId,
@Param("buildingUnitId")String buildingUnitId,
@Param("doorName")String doorName,
@Param("houseId")String houseId);
@Param("buildingId") String buildingId,
@Param("buildingUnitId") String buildingUnitId,
@Param("doorName") String doorName,
@Param("houseId") String houseId);
/**
* Desc: 根据小区IDs查询小区下是否有存在楼栋的
*
* @param ids
* @author zxc
* @date 2022/3/2 9:51 上午
*/
List<NeighborHoodManageDelResultDTO> selectExistBuildingByNeighborHoodIds(@Param("ids")List<String> ids);
List<NeighborHoodManageDelResultDTO> selectExistBuildingByNeighborHoodIds(@Param("ids") List<String> ids);
/**
* Desc: 根据楼栋IDs查询楼栋下是否有存在房屋的
*
* @param ids
* @author zxc
* @date 2022/3/2 9:53 上午
*/
List<NeighborHoodManageDelResultDTO> selectExistHouseByBuildingIds(@Param("ids")List<String> ids);
List<NeighborHoodManageDelResultDTO> selectExistHouseByBuildingIds(@Param("ids") List<String> ids);
/**
* Desc: 根据房屋ID查询名字
*
* @param ids
* @author zxc
* @date 2022/3/2 11:00 上午
*/
List<String> selectHouseNames(@Param("ids")List<String> ids);
List<String> selectHouseNames(@Param("ids") List<String> ids);
/**
* Desc: 批量更新房屋信息
*
* @param houses
* @author zxc
* @date 2022/3/25 10:22
@ -74,6 +78,7 @@ public interface IcHouseDao extends BaseDao<IcHouseEntity> {
/**
* Desc: 根据身份证查询房屋名
*
* @param idCards
* @author zxc
* @date 2022/4/12 16:42
@ -82,11 +87,12 @@ public interface IcHouseDao extends BaseDao<IcHouseEntity> {
/**
* Desc: 根据楼栋ID修改房屋名
*
* @param buildingId
* @author zxc
* @date 2022/4/26 13:49
*/
void houseUpdateHouseName(@Param("buildingId")String buildingId);
void houseUpdateHouseName(@Param("buildingId") String buildingId);
/**
* @Author sun
@ -96,6 +102,7 @@ public interface IcHouseDao extends BaseDao<IcHouseEntity> {
/**
* Desc: 根据房屋ID获取房屋信息
*
* @param houseId
* @author zxc
* @date 2022/5/10 09:23
@ -104,10 +111,37 @@ public interface IcHouseDao extends BaseDao<IcHouseEntity> {
/**
* Desc: 获取单元下的房屋数
*
* @param unitIds
* @author zxc
* @date 2022/5/31 15:53
*/
Integer getHouseCountByUnitIds(@Param("unitIds")List<String> unitIds);
Integer getHouseCountByUnitIds(@Param("unitIds") List<String> unitIds);
/**
* @return com.epmet.dto.result.IcHouseListResultDTO
* @describe: 通过id查询房屋信息
* @author wangtong
* @date 2022/6/1 13:56
* @params [id]
*/
IcHouseListResultDTO selectHouseQrcodeById(@Param("id") String id);
/**
* @return com.epmet.entity.IcHouseEntity
* @describe: 通过房屋编码获取信息
* @author wangtong
* @date 2022/6/1 18:29
* @params [houseCode]
*/
IcHouseEntity selectByHouseCode(@Param("houseCode") String houseCode);
/**
* @return java.util.List<com.epmet.dto.result.CreateHouseCodeAndUrlDTO>
* @describe: 查询需要补充房屋编码和URL的房屋信息
* @author wangtong
* @date 2022/6/6 15:09
* @params []
*/
List<CreateHouseCodeAndUrlDTO> selectBatchHouseCodeAndUrl(@Param("customerId") String customerId);
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java

@ -89,4 +89,6 @@ public interface IcNeighborHoodDao extends BaseDao<IcNeighborHoodEntity> {
void delProperty(@Param("neighborHoodIds")List<String> neighborHoodIds);
void updateOneNeighborHood(ImportGeneralDTO info);
String getAreaCode(@Param("neighborHoodId")String neighborHoodId);
}

40
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseCodeInfoEntity.java

@ -0,0 +1,40 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
*
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-01
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_house_code_info")
public class IcHouseCodeInfoEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 所属楼栋id
*/
private String buildingId;
/**
* 最大的楼栋编码序列号
*/
private String buildingMaxNum;
/**
* 该楼栋下最大的房屋编码序列号
*/
private String houseMaxNum;
}

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java

@ -112,4 +112,9 @@ public class IcHouseEntity extends BaseEpmetEntity {
*/
private String remark;
/**
* 房屋编码
*/
private String houseCode;
private String houseQrcodeUrl;
}

30
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcHouseCodeInfoExcel.java

@ -0,0 +1,30 @@
package com.epmet.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-06-01
*/
@Data
public class IcHouseCodeInfoExcel {
@Excel(name = "客户id")
private String customerId;
@Excel(name = "所属楼栋id")
private String buildingId;
@Excel(name = "最大的楼栋编码序列号")
private Integer buildingMaxNum;
@Excel(name = "该楼栋下最大的房屋编码序列号")
private Integer houseMaxNum;
}

30
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcHouseCodeInfoRedis.java

@ -0,0 +1,30 @@
package com.epmet.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-06-01
*/
@Component
public class IcHouseCodeInfoRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

46
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java

@ -117,4 +117,50 @@ public interface HouseService {
* @return
*/
PageData<HouseMemberResultDTO> getHouseUser(TokenDto tokenDto, IcHouseListFormDTO formDTO, Cache<String, Boolean> haveSearchCache);
/**
* @describe: 批量下载一户一档的二维码
* @author wangtong
* @date 2022/5/31 18:00
* @params [formDTO]
* @return void
*/
void downloadZip(HttpServletResponse response,IcHouseListFormDTO formDTO) throws Exception;
/**
* @describe: 生成自增的房屋编码编码规则
* 国家统计局社区区划代码37021101004212位数字+楼栋序列码(5位数字自增)+房屋码(5位数字自增)
* @author wangtong
* @date 2022/6/1 16:58
* @params [customerId-客户id, buildingId-楼栋id, areaCode-区划代码]
* @return java.lang.String
*/
String createHouseCode(String customerId,String buildingId,String areaCode);
/**
* @describe: 生成一户一码的二维码地址
* @author wangtong
* @date 2022/6/1 17:41
* @params [houseId]
* @return java.lang.String
*/
String createHouseQrcodeUrl(String houseId) throws Exception;
/**
* @describe: 根据房屋编码获取信息
* @author wangtong
* @date 2022/6/1 18:24
* @params [formDTO]
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.IcHouseInfoResultDTO>
*/
Result<IcHouseInfoResultDTO> getHouseInfoByCode(IcHouseInfoFormDTO formDTO);
/**
* @describe: 批量生成房屋的房屋编码和一户一档二维码
* @author wangtong
* @date 2022/6/6 14:44
* @params []
* @return com.epmet.commons.tools.utils.Result
*/
Result createBatchHouseCodeAndUrl(TokenDto loginUser);
}

78
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseCodeInfoService.java

@ -0,0 +1,78 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcHouseCodeInfoDTO;
import com.epmet.entity.IcHouseCodeInfoEntity;
import java.util.List;
import java.util.Map;
/**
*
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-01
*/
public interface IcHouseCodeInfoService extends BaseService<IcHouseCodeInfoEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IcHouseCodeInfoDTO>
* @author generator
* @date 2022-06-01
*/
PageData<IcHouseCodeInfoDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<IcHouseCodeInfoDTO>
* @author generator
* @date 2022-06-01
*/
List<IcHouseCodeInfoDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return IcHouseCodeInfoDTO
* @author generator
* @date 2022-06-01
*/
IcHouseCodeInfoDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-06-01
*/
void save(IcHouseCodeInfoDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2022-06-01
*/
void update(IcHouseCodeInfoDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2022-06-01
*/
void delete(String[] ids);
}

15
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java

@ -92,12 +92,12 @@ public interface IcHouseService extends BaseService<IcHouseEntity> {
List<OptionResultDTO> getHouseOption(HouseFormDTO formDTO);
/**
* @Description 查询房屋信息
* @param idCard
* @Description 查询房屋信息
* @author zxc
* @date 2021/11/3 3:30 下午
*/
List<String> selectHouseInfoByIdCard(String idCard,String customerId);
List<String> selectHouseInfoByIdCard(String idCard, String customerId);
/**
* @Description 楼栋下房屋列表
@ -111,6 +111,7 @@ public interface IcHouseService extends BaseService<IcHouseEntity> {
/**
* Desc: 批量更新房屋信息
*
* @param houses
* @author zxc
* @date 2022/3/25 10:22
@ -119,10 +120,20 @@ public interface IcHouseService extends BaseService<IcHouseEntity> {
/**
* Desc: 根据身份证查询房屋名
*
* @param idCards
* @author zxc
* @date 2022/4/12 16:42
*/
List<HousesNameResultDTO> getHousesNameByIdCards(List<String> idCards);
/**
* 根据房屋编码查询房屋信息
*
* @param houseCode
* @return com.epmet.dto.IcHouseDTO
* @author work@yujt.net.cn
* @date 2022/6/1/0001 16:21
*/
IcHouseDTO getByHouseCode(String houseCode);
}

436
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -8,17 +8,23 @@ import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.HouseQrcodeEnum;
import com.epmet.commons.tools.enums.OrgTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.HouseInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.FileUtils;
import com.epmet.commons.tools.utils.HouseQRcodeUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.CustomerGridConstant;
import com.epmet.constants.ImportTaskConstants;
@ -28,13 +34,16 @@ import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.IcHouseChangeDetailEntity;
import com.epmet.entity.IcHouseChangeRecordEntity;
import com.epmet.entity.IcHouseCodeInfoEntity;
import com.epmet.entity.IcHouseEntity;
import com.epmet.enums.HouseChangeEnums;
import com.epmet.enums.HousePurposeEnums;
import com.epmet.enums.HouseRentFlagEnums;
import com.epmet.enums.HouseTypeEnums;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.OssFeignClient;
import com.epmet.model.HouseInfoModel;
import com.epmet.model.ImportHouseInfoListener;
import com.epmet.redis.IcHouseRedis;
@ -45,21 +54,30 @@ import com.github.pagehelper.PageInfo;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.awt.image.BufferedImage;
import java.io.*;
import java.net.URLEncoder;
import java.text.NumberFormat;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
@Slf4j
@Service
@ -68,7 +86,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
/**
* 导出房屋内家庭成员时本地缓存
*/
private static final Cache<String,List<HouseIcResiUserResultDTO.HouseMemberResultDTO>> memberCacheMap = CacheBuilder.newBuilder().expireAfterAccess(1, TimeUnit.MINUTES).expireAfterWrite(30,TimeUnit.MINUTES).build();
private static final Cache<String, List<HouseIcResiUserResultDTO.HouseMemberResultDTO>> memberCacheMap = CacheBuilder.newBuilder().expireAfterAccess(1, TimeUnit.MINUTES).expireAfterWrite(30, TimeUnit.MINUTES).build();
@Autowired
private IcHouseService icHouseService;
@ -104,34 +122,56 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
private IcHouseChangeDetailService changeDetailService;
@Autowired
private HouseService houseService;
@Autowired
private IcHouseCodeInfoDao icHouseCodeInfoDao;
@Autowired
private OssFeignClient ossFeignClient;
@Autowired
private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient;
@Override
@Transactional(rollbackFor = Exception.class)
public void addHouse(String customerId, IcHouseAddFormDTO formDTO) {
//同一楼栋,单元内,房屋名称唯一
Integer count = icHouseDao.checkDoorNameUq(formDTO.getNeighborHoodId(), formDTO.getBuildingId(), formDTO.getBuildingUnitId(), formDTO.getDoorName(),null);
Integer count = icHouseDao.checkDoorNameUq(formDTO.getNeighborHoodId(), formDTO.getBuildingId(), formDTO.getBuildingUnitId(), formDTO.getDoorName(), null);
if (null != count && count > 0) {
throw new RenException(EpmetErrorCode.DOOR_NAME_EXITED.getCode(), EpmetErrorCode.DOOR_NAME_EXITED.getMsg());
}
IcHouseDTO icHouseDTO= ConvertUtils.sourceToTarget(formDTO, IcHouseDTO.class);
IcHouseEntity icHouseDTO = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class);
icHouseDTO.setCustomerId(customerId);
icHouseDTO.setHouseName(getHouseName(formDTO));
icHouseService.save(icHouseDTO);
//获取所属组织地区码
String areaCode = icNeighborHoodDao.getAreaCode(formDTO.getNeighborHoodId());
if (StringUtils.isNotBlank(areaCode)) {
areaCode = numberAfterFillZero(areaCode, NumConstant.TWELVE);
icHouseDTO.setHouseCode(createHouseCode(customerId, formDTO.getBuildingId(), areaCode));
}
icHouseDao.insert(icHouseDTO);
IcHouseEntity entity = new IcHouseEntity();
entity.setId(icHouseDTO.getId());
try {
entity.setHouseQrcodeUrl(createHouseQrcodeUrl(icHouseDTO.getId()));
} catch (Exception e) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"二维码生成失败","二维码生成失败");
}
icHouseDao.updateById(entity);
}
private String getHouseName(IcHouseAddFormDTO formDTO){
private String getHouseName(IcHouseAddFormDTO formDTO) {
//设置房间名 楼栋-单元号-门牌号
IcBuildingDTO icBuilding = icBuildingService.get(formDTO.getBuildingId());
IcBuildingUnitDTO icBuildingUnit = icBuildingUnitService.get(formDTO.getBuildingUnitId());
String doorName = formDTO.getDoorName();
String buildingName = Optional.ofNullable(icBuilding).map(u->u.getBuildingName()).orElse("");
String unitName = Optional.ofNullable(icBuildingUnit).map(u->u.getUnitNum()).orElse("");
return new StringBuilder().append(buildingName).append("-").append(unitName).append("-").append(doorName).toString();
String buildingName = Optional.ofNullable(icBuilding).map(u -> u.getBuildingName()).orElse("");
String unitName = Optional.ofNullable(icBuildingUnit).map(u -> u.getUnitNum()).orElse("");
return new StringBuilder().append(buildingName).append("-").append(unitName).append("-").append(doorName).toString();
}
/**
* 更新
*
* @param customerId
* @param formDTO
*/
@ -139,7 +179,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
@Transactional(rollbackFor = Exception.class)
public void updateHouse(String customerId, IcHouseAddFormDTO formDTO) {
//同一楼栋,单元内,房屋名称唯一
Integer count = icHouseDao.checkDoorNameUq(formDTO.getNeighborHoodId(), formDTO.getBuildingId(), formDTO.getBuildingUnitId(),formDTO.getDoorName(), formDTO.getHouseId());
Integer count = icHouseDao.checkDoorNameUq(formDTO.getNeighborHoodId(), formDTO.getBuildingId(), formDTO.getBuildingUnitId(), formDTO.getDoorName(), formDTO.getHouseId());
if (null != count && count > 0) {
throw new RenException(EpmetErrorCode.DOOR_NAME_EXITED.getCode(), EpmetErrorCode.DOOR_NAME_EXITED.getMsg());
}
@ -155,11 +195,12 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
houseChangeRecord(formDTO.getHouseId(), customerId, icHouseDTO);
icHouseService.update(icHouseDTO);
//删除房屋缓存
icHouseRedis.delHouseInfo(formDTO.getHouseId(),customerId);
icHouseRedis.delHouseInfo(formDTO.getHouseId(), customerId);
}
/**
* Desc: 房屋变更记录
*
* @param houseId
* @param customerId
* @param houseDTO
@ -168,18 +209,18 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void houseChangeRecord(String houseId, String customerId, IcHouseDTO houseDTO){
public void houseChangeRecord(String houseId, String customerId, IcHouseDTO houseDTO) {
IcHouseEntity entity = icHouseService.selectById(houseId);
entity.setOwnerName(null == entity.getOwnerName() ? "" : entity.getOwnerName());
entity.setOwnerPhone(null == entity.getOwnerPhone() ? "" : entity.getOwnerPhone());
entity.setOwnerIdCard(null == entity.getOwnerIdCard() ? "" : entity.getOwnerIdCard());
if (null == entity){
if (null == entity) {
throw new EpmetException("不存在此房屋...");
}
StringBuilder sbBefore = new StringBuilder();
StringBuilder sbAfter = new StringBuilder();
List<IcHouseChangeDetailEntity> entityList = new ArrayList<>();
if (!houseDTO.getHouseType().equals(entity.getHouseType())){
if (!houseDTO.getHouseType().equals(entity.getHouseType())) {
sbAfter.append(HouseChangeEnums.HOUSE_TYPE.getColumnName()).append(":").append(null == houseDTO.getHouseTypeName() ? HouseTypeEnums.getTypeValue(houseDTO.getHouseType()) : houseDTO.getHouseTypeName()).append(";");
sbBefore.append(HouseChangeEnums.HOUSE_TYPE.getColumnName()).append(":").append(HouseTypeEnums.getTypeValue(entity.getHouseType())).append(";");
IcHouseChangeDetailEntity e = new IcHouseChangeDetailEntity();
@ -188,7 +229,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
e.setChangeAfter(null == houseDTO.getHouseTypeName() ? HouseTypeEnums.getTypeValue(houseDTO.getHouseType()) : houseDTO.getHouseTypeName());
entityList.add(e);
}
if (!houseDTO.getPurpose().equals(entity.getPurpose())){
if (!houseDTO.getPurpose().equals(entity.getPurpose())) {
sbAfter.append(HouseChangeEnums.PURPOSE.getColumnName()).append(":").append(null == houseDTO.getPurposeName() ? HousePurposeEnums.getTypeValue(houseDTO.getPurpose()) : houseDTO.getPurposeName()).append(";");
sbBefore.append(HouseChangeEnums.PURPOSE.getColumnName()).append(":").append(HousePurposeEnums.getTypeValue(entity.getPurpose())).append(";");
IcHouseChangeDetailEntity e = new IcHouseChangeDetailEntity();
@ -197,7 +238,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
e.setChangeBefore(HousePurposeEnums.getTypeValue(entity.getPurpose()));
entityList.add(e);
}
if (!houseDTO.getRentFlag().equals(entity.getRentFlag())){
if (!houseDTO.getRentFlag().equals(entity.getRentFlag())) {
sbAfter.append(HouseChangeEnums.RENT_FLAG.getColumnName()).append(":").append(null == houseDTO.getRentName() ? HouseRentFlagEnums.getTypeValue(houseDTO.getRentFlag()) : houseDTO.getRentName()).append(";");
sbBefore.append(HouseChangeEnums.RENT_FLAG.getColumnName()).append(":").append(HouseRentFlagEnums.getTypeValue(entity.getRentFlag())).append(";");
IcHouseChangeDetailEntity e = new IcHouseChangeDetailEntity();
@ -206,7 +247,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
e.setChangeBefore(HouseRentFlagEnums.getTypeValue(entity.getRentFlag()));
entityList.add(e);
}
if (null != houseDTO.getOwnerName() && !houseDTO.getOwnerName().equals(entity.getOwnerName())){
if (null != houseDTO.getOwnerName() && !houseDTO.getOwnerName().equals(entity.getOwnerName())) {
sbAfter.append(HouseChangeEnums.OWNER_NAME.getColumnName()).append(":").append(StringUtils.isNotBlank(houseDTO.getOwnerName()) ? houseDTO.getOwnerName() : "无").append(";");
sbBefore.append(HouseChangeEnums.OWNER_NAME.getColumnName()).append(":").append(StringUtils.isNotBlank(entity.getOwnerName()) ? entity.getOwnerName() : "无").append(";");
IcHouseChangeDetailEntity e = new IcHouseChangeDetailEntity();
@ -215,7 +256,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
e.setChangeBefore(StringUtils.isNotBlank(entity.getOwnerName()) ? entity.getOwnerName() : "无");
entityList.add(e);
}
if (null != houseDTO.getOwnerPhone() && !houseDTO.getOwnerPhone().equals(entity.getOwnerPhone())){
if (null != houseDTO.getOwnerPhone() && !houseDTO.getOwnerPhone().equals(entity.getOwnerPhone())) {
sbAfter.append(HouseChangeEnums.OWNER_PHONE.getColumnName()).append(":").append(StringUtils.isNotBlank(houseDTO.getOwnerPhone()) ? houseDTO.getOwnerPhone() : "无").append(";");
sbBefore.append(HouseChangeEnums.OWNER_PHONE.getColumnName()).append(":").append(StringUtils.isNotBlank(entity.getOwnerPhone()) ? entity.getOwnerPhone() : "无").append(";");
IcHouseChangeDetailEntity e = new IcHouseChangeDetailEntity();
@ -224,7 +265,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
e.setChangeBefore(StringUtils.isNotBlank(entity.getOwnerPhone()) ? entity.getOwnerPhone() : "无");
entityList.add(e);
}
if (null != houseDTO.getOwnerIdCard() && !houseDTO.getOwnerIdCard().equals(entity.getOwnerIdCard())){
if (null != houseDTO.getOwnerIdCard() && !houseDTO.getOwnerIdCard().equals(entity.getOwnerIdCard())) {
sbAfter.append(HouseChangeEnums.OWNER_ID_CARD.getColumnName()).append(":").append(StringUtils.isNotBlank(houseDTO.getOwnerIdCard()) ? houseDTO.getOwnerIdCard() : "无").append(";");
sbBefore.append(HouseChangeEnums.OWNER_ID_CARD.getColumnName()).append(":").append(StringUtils.isNotBlank(entity.getOwnerIdCard()) ? entity.getOwnerIdCard() : "无").append(";");
IcHouseChangeDetailEntity e = new IcHouseChangeDetailEntity();
@ -233,7 +274,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
e.setChangeBefore(StringUtils.isNotBlank(entity.getOwnerIdCard()) ? entity.getOwnerIdCard() : "无");
entityList.add(e);
}
if (StringUtils.isNotBlank(sbAfter)){
if (StringUtils.isNotBlank(sbAfter)) {
String before = sbBefore.substring(NumConstant.ZERO, sbBefore.length() - NumConstant.ONE);
String after = sbAfter.substring(NumConstant.ZERO, sbAfter.length() - NumConstant.ONE);
HouseAgencyInfoResultDTO houseAgencyInfo = icHouseDao.getHouseAgencyInfo(houseId);
@ -259,15 +300,16 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
/**
* 删除
*
* @param houseId
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void delHouse(String houseId) {
//单个删除房屋,房屋内有居民不允许删除
NeighborHoodManageDelFormDTO formDTO=new NeighborHoodManageDelFormDTO();
NeighborHoodManageDelFormDTO formDTO = new NeighborHoodManageDelFormDTO();
formDTO.setType(CustomerGridConstant.HOUSE);
List<String> ids=new ArrayList<>();
List<String> ids = new ArrayList<>();
ids.add(houseId);
formDTO.setIds(ids);
allDelete(formDTO);
@ -281,24 +323,25 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
if (StringUtils.isNotBlank(formDTO.getAgencyId())) {
pids = getPids(formDTO.getAgencyId());
}
if (StringUtils.isNotBlank(formDTO.getLevel()) && OrgTypeEnum.AGENCY.getCode().equals(formDTO.getLevel())){
if (StringUtils.isNotBlank(formDTO.getLevel()) && OrgTypeEnum.AGENCY.getCode().equals(formDTO.getLevel())) {
pids = getPids(formDTO.getAgencyId());
}
formDTO.setPids(pids);
PageInfo<IcHouseListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getIsPage())
.doSelectPageInfo(() -> icHouseDao.searchHouseByPage(formDTO));
PageInfo<IcHouseListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage())
.doSelectPageInfo(() -> icHouseDao.searchHouseByPage(formDTO));
List<IcHouseListResultDTO> records = pageInfo.getList();
records.forEach(item->{
records.forEach(item -> {
item.setHouseType(HouseTypeEnums.getTypeValue(item.getHouseTypeKey()));
item.setPurpose(HousePurposeEnums.getTypeValue(item.getPurposeKey()));
});
return new PageData<>(records == null? new ArrayList<>():records,pageInfo.getTotal());
return new PageData<>(records == null ? new ArrayList<>() : records, pageInfo.getTotal());
}
public String getPids(String agencyId){
public String getPids(String agencyId) {
String pids = null;
CustomerAgencyDTO agency = agencyservice.getAgencyById(agencyId);
@ -319,33 +362,33 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
public void exportBuildinginfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception {
//如果类型是house 查房屋
//导出房屋
PageData<IcHouseListResultDTO> icHouseExcels = new PageData<>(new ArrayList<>(),NumConstant.ZERO);
PageData<IcHouseListResultDTO> icHouseExcels = new PageData<>(new ArrayList<>(), NumConstant.ZERO);
List<IcHouseListResultDTO> list = new ArrayList<>();
Integer pageNo = NumConstant.ONE;
do {
formDTO.setPageNo(pageNo);
icHouseExcels = getHouseList(formDTO);
if (CollectionUtils.isEmpty(icHouseExcels.getList())){
if (CollectionUtils.isEmpty(icHouseExcels.getList())) {
break;
}
list.addAll(icHouseExcels.getList());
pageNo++;
}while (icHouseExcels.getList().size() == formDTO.getPageSize());
} while (icHouseExcels.getList().size() == formDTO.getPageSize());
TemplateExportParams templatePath = new TemplateExportParams("excel/house_export.xlsx");
Map<String,Object> map = new HashMap<>();
Map<String, Object> map = new HashMap<>();
map.put("maplist", list);
ExcelPoiUtils.exportExcel(templatePath ,map,"房屋信息录入表",response);
ExcelPoiUtils.exportExcel(templatePath, map, "房屋信息录入表", response);
}
@Override
public List<HouseInfoDTO> queryListHouseInfo(Set<String> houseIdList, String customerId) {
if(org.apache.commons.collections4.CollectionUtils.isEmpty(houseIdList)){
if (org.apache.commons.collections4.CollectionUtils.isEmpty(houseIdList)) {
return new ArrayList<>();
}
List<HouseInfoDTO> result = new ArrayList<>();
houseIdList.forEach(h -> {
HouseInfoDTO houseInfo = icHouseRedis.getHouseInfo(h, customerId);
if (null != houseInfo){
if (null != houseInfo) {
result.add(houseInfo);
}
});
@ -360,11 +403,11 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
excelReader = EasyExcel.read(inputStream).build();
// 这里为了简单 所以注册了 同样的head 和Listener 自己使用功能必须不同的Listener
ReadSheet readSheet = EasyExcel.readSheet(0).head(HouseInfoModel.class)
.registerReadListener(new ImportHouseInfoListener(formDTO,icBuildingDao,icHouseRedis,neighborHoodService,icHouseService,epmetCommonServiceOpenFeignClient,importTask.getData().getTaskId(),houseService))
.registerReadListener(new ImportHouseInfoListener(formDTO, icBuildingDao, icHouseRedis, neighborHoodService, icHouseService, epmetCommonServiceOpenFeignClient, importTask.getData().getTaskId(), houseService))
.build();
excelReader.read(readSheet);
} catch (Exception e){
log.error("dispose exception",e);
} catch (Exception e) {
log.error("dispose exception", e);
ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO();
input.setOperatorId(formDTO.getUserId());
input.setTaskId(importTask.getData().getTaskId());
@ -381,79 +424,80 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
/**
* Desc 小区管理中批量删除
*
* @param formDTO
* @author zxc
* @date 2022/3/1 4:57 下午
*/
@Override
public void allDelete(NeighborHoodManageDelFormDTO formDTO) {
if (CollectionUtils.isEmpty(formDTO.getIds())){
if (CollectionUtils.isEmpty(formDTO.getIds())) {
return;
}
List<String> ids = formDTO.getIds();
if (formDTO.getType().equals(CustomerGridConstant.NEIGHBORHOOD)){
if (formDTO.getType().equals(CustomerGridConstant.NEIGHBORHOOD)) {
List<NeighborHoodManageDelResultDTO> exists = icHouseDao.selectExistBuildingByNeighborHoodIds(ids);
if (!CollectionUtils.isEmpty(exists)){
if (!CollectionUtils.isEmpty(exists)) {
exists.forEach(e -> {
for (int i = NumConstant.ZERO; i < ids.size(); i++) {
if (ids.get(i).equals(e.getNeighborHoodId())){
if (ids.get(i).equals(e.getNeighborHoodId())) {
ids.remove(i);
continue;
}
}
});
}
if (!CollectionUtils.isEmpty(ids)){
if (!CollectionUtils.isEmpty(ids)) {
icNeighborHoodDao.deleteBatchIds(ids);
}
if (!CollectionUtils.isEmpty(exists)){
if (!CollectionUtils.isEmpty(exists)) {
String collect = exists.stream().map(m -> m.getName()).collect(Collectors.joining(","));
EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.setMsg(String.format("%s内包含楼栋信息,暂无法删除",collect));
EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.setMsg(String.format("%s内包含楼栋信息,暂无法删除", collect));
throw new EpmetException(EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.getCode());
}
}else if (formDTO.getType().equals(CustomerGridConstant.BUILDING)){
} else if (formDTO.getType().equals(CustomerGridConstant.BUILDING)) {
List<NeighborHoodManageDelResultDTO> exists = icHouseDao.selectExistHouseByBuildingIds(ids);
if (!CollectionUtils.isEmpty(exists)){
if (!CollectionUtils.isEmpty(exists)) {
exists.forEach(e -> {
for (int i = NumConstant.ZERO; i < ids.size(); i++) {
if (ids.get(i).equals(e.getBuildingId())){
if (ids.get(i).equals(e.getBuildingId())) {
ids.remove(i);
continue;
}
}
});
}
if (!CollectionUtils.isEmpty(ids)){
if (!CollectionUtils.isEmpty(ids)) {
icBuildingDao.deleteBatchIds(ids);
}
if (!CollectionUtils.isEmpty(exists)){
if (!CollectionUtils.isEmpty(exists)) {
String collect = exists.stream().map(m -> m.getName()).collect(Collectors.joining(","));
EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.setMsg(String.format("%s内包含房屋信息,暂无法删除",collect));
EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.setMsg(String.format("%s内包含房屋信息,暂无法删除", collect));
throw new EpmetException(EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.getCode());
}
}else if (formDTO.getType().equals(CustomerGridConstant.HOUSE)){
} else if (formDTO.getType().equals(CustomerGridConstant.HOUSE)) {
Result<List<String>> existUsers = epmetUserOpenFeignClient.getExistUserByHouseIds(ids);
if (!existUsers.success()){
if (!existUsers.success()) {
throw new EpmetException("根据房屋IDs查询房屋下是否有存在居民失败...");
}
List<String> exists = existUsers.getData();
if (!CollectionUtils.isEmpty(exists)){
if (!CollectionUtils.isEmpty(exists)) {
exists.forEach(e -> {
for (int i = NumConstant.ZERO; i < ids.size(); i++) {
if (ids.get(i).equals(e)){
if (ids.get(i).equals(e)) {
ids.remove(i);
continue;
}
}
});
}
if (!CollectionUtils.isEmpty(ids)){
if (!CollectionUtils.isEmpty(ids)) {
icHouseDao.deleteBatchIds(ids);
}
if (!CollectionUtils.isEmpty(exists)){
if (!CollectionUtils.isEmpty(exists)) {
List<String> list = icHouseDao.selectHouseNames(exists);
String collect = list.stream().collect(Collectors.joining(","));
EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.setMsg(String.format("%s内包含居民信息,暂无法删除",collect));
EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.setMsg(String.format("%s内包含居民信息,暂无法删除", collect));
throw new EpmetException(EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.getCode());
}
}
@ -464,8 +508,8 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
HouseInfoDTO houseInfo = icHouseRedis.getHouseInfo(houseId, customerId);
if (null != houseInfo && StringUtils.isNotBlank(houseInfo.getAgencyId())) {
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(houseInfo.getAgencyId());
houseInfo.setAgencyPathName(StringUtils.isNotBlank(agencyInfoCache.getAllParentName())?agencyInfoCache.getAllParentName().concat(StrConstant.HYPHEN).concat(agencyInfoCache.getOrganizationName()):agencyInfoCache.getOrganizationName());
houseInfo.setAreaCode(StringUtils.isNotBlank(agencyInfoCache.getAreaCode())?agencyInfoCache.getAreaCode():StrConstant.EPMETY_STR);
houseInfo.setAgencyPathName(StringUtils.isNotBlank(agencyInfoCache.getAllParentName()) ? agencyInfoCache.getAllParentName().concat(StrConstant.HYPHEN).concat(agencyInfoCache.getOrganizationName()) : agencyInfoCache.getOrganizationName());
houseInfo.setAreaCode(StringUtils.isNotBlank(agencyInfoCache.getAreaCode()) ? agencyInfoCache.getAreaCode() : StrConstant.EPMETY_STR);
} else {
houseInfo.setAgencyPathName(StrConstant.EPMETY_STR);
houseInfo.setAreaCode(StrConstant.EPMETY_STR);
@ -575,6 +619,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
/**
* Desc: 根据类型更新排序
*
* @param formDTO
* @author zxc
* @date 2022/5/6 08:50
@ -582,10 +627,10 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
@Override
@Transactional(rollbackFor = Exception.class)
public void updateSort(UpdateSortFormDTO formDTO) {
if (formDTO.getType().equals(CustomerGridConstant.HOUSE)){
if (formDTO.getType().equals(CustomerGridConstant.HOUSE)) {
IcHouseDTO icHouseDTO = ConvertUtils.sourceToTarget(formDTO, IcHouseDTO.class);
icHouseService.update(icHouseDTO);
}else if(formDTO.getType().equals(CustomerGridConstant.BUILDING)){
} else if (formDTO.getType().equals(CustomerGridConstant.BUILDING)) {
IcBuildingDTO icBuildingDTO = ConvertUtils.sourceToTarget(formDTO, IcBuildingDTO.class);
icBuildingService.update(icBuildingDTO);
}
@ -604,53 +649,53 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
int searchLevel = 0;
//如果小区id不为空 则直接查询小区内的居民
if (StringUtils.isNotEmpty(formDTO.getNeighborHoodId())){
if (StringUtils.isNotEmpty(formDTO.getNeighborHoodId())) {
searchLevel = 1;
}
//如果楼宇id不为空 则直接查询楼宇内的居民
if (StringUtils.isNotEmpty(formDTO.getBuildingId())){
if (StringUtils.isNotEmpty(formDTO.getBuildingId())) {
searchLevel = 2;
}
//如果有具体的查询套件 则直接按照房屋Id 来查
if (StringUtils.isNotEmpty(formDTO.getOwnerName()) || StringUtils.isNotEmpty(formDTO.getOwnerPhone()) || StringUtils.isNotEmpty(formDTO.getRentFlag())){
if (StringUtils.isNotEmpty(formDTO.getOwnerName()) || StringUtils.isNotEmpty(formDTO.getOwnerPhone()) || StringUtils.isNotEmpty(formDTO.getRentFlag())) {
searchLevel = 3;
}
long start = System.currentTimeMillis();
long start = System.currentTimeMillis();
PageData<IcHouseListResultDTO> houseData = this.getHouseList(formDTO);
log.info("getHouseUser getHoseList cost:{}ms",System.currentTimeMillis() - start);
log.info("getHouseUser getHoseList cost:{}ms", System.currentTimeMillis() - start);
List<HouseMemberResultDTO> resultList = new ArrayList<>();
PageData<HouseMemberResultDTO> result = new PageData<>(resultList,houseData.getList().size());
PageData<HouseMemberResultDTO> result = new PageData<>(resultList, houseData.getList().size());
int finalSearchLevel = searchLevel;
AtomicInteger num = new AtomicInteger((formDTO.getPageNo()-1) * formDTO.getPageSize());
AtomicInteger num = new AtomicInteger((formDTO.getPageNo() - 1) * formDTO.getPageSize());
houseData.getList().forEach(o ->{
houseData.getList().forEach(o -> {
resiParam.setAgencyId(o.getAgencyId());
if (finalSearchLevel == 1){
if (finalSearchLevel == 1) {
resiParam.setNeighborHoodId(o.getNeighborHoodId());
}
if (finalSearchLevel == 2){
if (finalSearchLevel == 2) {
resiParam.setBuildingId(o.getBuildingId());
}
if (finalSearchLevel == 3){
if (finalSearchLevel == 3) {
resiParam.setHouseId(o.getHouseId());
}
this.getHouseMembers(resiParam, memberCacheMap,haveSearchCache);
this.getHouseMembers(resiParam, memberCacheMap, haveSearchCache);
List<HouseIcResiUserResultDTO.HouseMemberResultDTO> members = memberCacheMap.getIfPresent(o.getHouseId());
//序号 一个houseId为一个序号
int n = num.incrementAndGet();
//没有住户 则直接写房屋
if (CollectionUtils.isEmpty(members)){
if (CollectionUtils.isEmpty(members)) {
HouseMemberResultDTO resultDTO = ConvertUtils.sourceToTarget(o, HouseMemberResultDTO.class);
resultDTO.setNum(n);
resultList.add(resultDTO);
return;
}
//有住户 房屋信息是重复的
members.forEach(m->{
members.forEach(m -> {
HouseMemberResultDTO resultDTO = ConvertUtils.sourceToTarget(m, HouseMemberResultDTO.class);
resultDTO.setNum(n);
resultDTO.setAgencyName(o.getAgencyName());
@ -673,37 +718,38 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
/**
* desc:分情况获取 房屋内居民
*
* @param resiParam
* @param memberMap
* @param haveSearchCache
*/
public void getHouseMembers(RentTenantDataFormDTO resiParam, Cache<String, List<HouseIcResiUserResultDTO.HouseMemberResultDTO>> memberMap, Cache<String, Boolean> haveSearchCache) {
String searchKey = resiParam.getHouseId()+resiParam.getBuildingId()+resiParam.getNeighborHoodId()+resiParam.getGridId()+resiParam.getAgencyId();
String searchKey = resiParam.getHouseId() + resiParam.getBuildingId() + resiParam.getNeighborHoodId() + resiParam.getGridId() + resiParam.getAgencyId();
Boolean haveSearch = haveSearchCache.getIfPresent(searchKey);
//log.info("getHouseUser getHouseMembers searchKey:"+searchKey);
if (haveSearch!= null && haveSearch){
if (haveSearch != null && haveSearch) {
return;
}
long startT = System.currentTimeMillis();
haveSearchCache.put(searchKey,true);
haveSearchCache.put(searchKey, true);
List<HouseIcResiUserResultDTO> memberListTemp = null;
resiParam.setPageNo(NumConstant.ONE);
do {
Result<List<HouseIcResiUserResultDTO>> memberResult = epmetUserOpenFeignClient.getHouseMemberList(resiParam);
log.debug("=======查询居民:"+ resiParam.getPageNo()+",size:"+resiParam.getPageSize()+",result:"+memberResult.getData().size());
log.debug("=======查询居民:" + resiParam.getPageNo() + ",size:" + resiParam.getPageSize() + ",result:" + memberResult.getData().size());
if (!memberResult.success()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "调用user服务失败");
}
memberListTemp = memberResult.getData();
log.debug("=======查询居民结果:"+ JSON.toJSONString(memberListTemp));
log.debug("=======查询居民结果:" + JSON.toJSONString(memberListTemp));
if (CollectionUtils.isEmpty(memberListTemp)) {
break;
}
resiParam.setPageNo(resiParam.getPageNo()+1);
resiParam.setPageNo(resiParam.getPageNo() + 1);
memberListTemp.forEach(h -> memberMap.put(h.getHomeId(), h.getHouseMemberList()));
} while (memberListTemp.size() == resiParam.getPageSize());
log.info("getHouseUser getHouseMembers cost:{}ms,param:{}",System.currentTimeMillis() - startT,JSON.toJSONString(resiParam));
log.info("getHouseUser getHouseMembers cost:{}ms,param:{}", System.currentTimeMillis() - startT, JSON.toJSONString(resiParam));
}
/**
@ -760,4 +806,228 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
return list;
}
@Override
public void downloadZip(HttpServletResponse response, IcHouseListFormDTO formDTO) throws Exception {
// 查询pids
String pids = null;
if (StringUtils.isNotBlank(formDTO.getAgencyId())) {
pids = getPids(formDTO.getAgencyId());
}
if (StringUtils.isNotBlank(formDTO.getLevel()) && OrgTypeEnum.AGENCY.getCode().equals(formDTO.getLevel())) {
pids = getPids(formDTO.getAgencyId());
}
formDTO.setPids(pids);
//response
response.reset();
//文件的名称
String downloadFilename = "二维码压缩包.zip";
//转换中文否则可能会产生乱码
downloadFilename = URLEncoder.encode(downloadFilename, "UTF-8");
// 指明response的返回对象是文件流
response.setContentType("application/octet-stream; charset=UTF-8");
//设置下载格式和名称
response.setHeader("Content-Disposition", "attachment;filename=" + downloadFilename);
ZipOutputStream zip = new ZipOutputStream(response.getOutputStream());
List<IcHouseListResultDTO> houseList = icHouseDao.searchHouseByPage(formDTO);
//获取一户一码前缀地址
Result<List<SysDictDataDTO>> dict = epmetAdminOpenFeignClient.dictDataList("house_qrcode_pre");
if (!dict.success() || CollectionUtils.isEmpty(dict.getData())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "一户一码前缀查询异常", "一户一码前缀查询异常");
}
for (IcHouseListResultDTO house : houseList) {
BufferedImage image = HouseQRcodeUtils.drawHouseQRImage(house.getBuildingName() + house.getUnitNum() + house.getDoorName(),
dict.getData().get(0).getDictValue() + house.getHouseCode());
try {
byte[] buf = new byte[8192];
int len;
//添加到zip
zip.putNextEntry(new ZipEntry(getFileName(house)));
InputStream inputStream = bufferedImageToInputStream(image);
//输出压缩包
while ((len = inputStream.read(buf)) > 0) {
zip.write(buf, 0, len);
}
inputStream.close();
} catch (IOException e) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "组装zip信息有误", "组装zip信息有误");
}
}
zip.close();
}
/**
* 将BufferedImage转换为InputStream
*
* @param image: 图片流
* @date 2022/4/8 15:29
* @author YD
*/
public static InputStream bufferedImageToInputStream(BufferedImage image) throws IOException {
ByteArrayOutputStream os = new ByteArrayOutputStream();
ImageIO.write(image, "png", os);
try (InputStream input = new ByteArrayInputStream(os.toByteArray())) {
return input;
}
}
/**
* 获取文件名
*/
public static String getFileName(IcHouseListResultDTO house) {
return house.getNeighborHoodName() + File.separator + house.getBuildingName() + File.separator + house.getUnitNum() + File.separator + house.getDoorName() + HouseQrcodeEnum.SUFFIX.getCode();
}
@Override
public String createHouseCode(String customerId, String buildingId, String areaCode) {
if (StringUtils.isBlank(customerId) || StringUtils.isBlank(buildingId) || StringUtils.isBlank(areaCode)) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所有字段不可为空", "所有字段不可为空");
}
String result = "";
IcHouseCodeInfoEntity codeEntity = icHouseCodeInfoDao.selectByCuIdAndBuilId(customerId, buildingId);
if (null == codeEntity) {
//查询数据库里最大的楼栋编号
IcHouseCodeInfoEntity maxCodeEntity = icHouseCodeInfoDao.selectMaxHouseMaxNum();
//新增楼栋信息
IcHouseCodeInfoEntity newEntity = new IcHouseCodeInfoEntity();
if (null != maxCodeEntity) {
Integer buildingMaxNum = Integer.valueOf(maxCodeEntity.getBuildingMaxNum()) + 1;
result = areaCode + getNewMaxIndex(buildingMaxNum) + "00001";
newEntity.setBuildingMaxNum(getNewMaxIndex(buildingMaxNum));
newEntity.setHouseMaxNum("00001");
} else {
//数据库里面的第一条数据
result = areaCode + "00001" + "00001";
newEntity.setBuildingMaxNum("00001");
newEntity.setHouseMaxNum("00001");
}
newEntity.setCustomerId(customerId);
newEntity.setBuildingId(buildingId);
icHouseCodeInfoDao.insert(newEntity);
} else {
Integer houseMaxNum = Integer.valueOf(codeEntity.getHouseMaxNum()) + 1;
result = areaCode + codeEntity.getBuildingMaxNum() + getNewMaxIndex(houseMaxNum);
//更新该楼栋下最大的房间编号
codeEntity.setHouseMaxNum(getNewMaxIndex(houseMaxNum));
icHouseCodeInfoDao.updateByCuIdAndBuId(codeEntity);
}
return result;
}
@Override
public String createHouseQrcodeUrl(String houseId) throws Exception {
if (StringUtils.isBlank(houseId)) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "房屋id不可为空", "房屋id不可为空");
}
IcHouseListResultDTO house = icHouseDao.selectHouseQrcodeById(houseId);
if (null == house) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到房屋信息", "未查到房屋信息");
}
//url组成:小程序地址?房屋编码
Result<List<SysDictDataDTO>> dict = epmetAdminOpenFeignClient.dictDataList("house_qrcode_pre");
if (!dict.success() || CollectionUtils.isEmpty(dict.getData())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "一户一码前缀查询异常", "一户一码前缀查询异常");
}
String url = dict.getData().get(0).getDictValue() + house.getHouseCode();
String fileName = house.getBuildingName() + house.getUnitNum() + house.getDoorName() + ".png";
BufferedImage image = HouseQRcodeUtils.drawHouseQRImage(house.getBuildingName() + house.getUnitNum() + house.getDoorName(), url);
FileItem fileItem = new DiskFileItemFactory(DiskFileItemFactory.DEFAULT_SIZE_THRESHOLD, FileUtils.getAndCreateDirUnderEpmetFilesDir("temp").toFile())
.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), false, fileName);
OutputStream os = fileItem.getOutputStream();
Result<UploadImgResultDTO> uploadResult = null;
try {
ImageIO.write(image, "png", os);
uploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem));
} catch (Exception e) {
String errormsg = ExceptionUtils.getErrorStackTrace(e);
log.error("上传一户一档二维码:{}", errormsg);
} finally {
try {
os.close();
} catch (IOException e) {
String errormsg = ExceptionUtils.getErrorStackTrace(e);
log.error("上传一户一档二维码关闭输出流:{}", errormsg);
}
try {
fileItem.delete();
} catch (Exception e) {
String errormsg = ExceptionUtils.getErrorStackTrace(e);
log.error("上传一户一档二维码删除临时文件:{}", errormsg);
}
}
if (uploadResult == null || !uploadResult.success()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "上传一户一档二维码失败", "上传一户一档二维码失败");
} else {
return uploadResult.getData().getUrl();
}
}
@Override
public Result<IcHouseInfoResultDTO> getHouseInfoByCode(IcHouseInfoFormDTO formDTO) {
IcHouseEntity house = icHouseDao.selectByHouseCode(formDTO.getHouseCode());
if(null == house){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查询到相关房屋","未查询到相关房屋");
}
HouseInfoCache cache = CustomerIcHouseRedis.getHouseInfo(formDTO.getCustomerId(), house.getId());
IcHouseInfoResultDTO resut = ConvertUtils.sourceToTarget(cache, IcHouseInfoResultDTO.class);
resut.setHouseId(cache.getHomeId());
return new Result<IcHouseInfoResultDTO>().ok(resut);
}
@Override
public Result createBatchHouseCodeAndUrl(TokenDto loginUser) {
List<CreateHouseCodeAndUrlDTO> houseList = icHouseDao.selectBatchHouseCodeAndUrl(loginUser.getCustomerId());
houseList.forEach(house->{
IcHouseEntity entity = icHouseDao.selectById(house.getHouseId());
if(StringUtils.isNotBlank(house.getAreaCode())){
String areaCode = numberAfterFillZero(house.getAreaCode(), NumConstant.TWELVE);
entity.setHouseCode(createHouseCode(house.getCustomerId(),house.getBuildingId(),areaCode));
}
try {
entity.setHouseQrcodeUrl(createHouseQrcodeUrl(house.getHouseId()));
} catch (Exception e) {
e.printStackTrace();
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"二维码生成失败<houseId>:"+house.getHouseId(),"二维码生成失败<houseId>:"+house.getHouseId());
}
icHouseDao.updateById(entity);
});
return new Result().ok("批量生成成功");
}
/**
* @return java.lang.String
* @describe: 把数字转换成5位的字符串不够的前面补0
* @author wangtong
* @date 2022/6/1 14:27
* @params [maxIndex]
*/
private String getNewMaxIndex(Integer maxIndex) {
String result = maxIndex.toString();
while (result.length() < 5) {
result = "0" + result;
}
return result;
}
private String numberAfterFillZero(String str, int length) {
StringBuilder buffer = new StringBuilder(str);
if (buffer.length() >= length) {
return buffer.toString();
} else {
while (buffer.length() < length) {
buffer.append("0");
}
}
return buffer.toString();
}
}

87
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseCodeInfoServiceImpl.java

@ -0,0 +1,87 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.IcHouseCodeInfoDao;
import com.epmet.dto.IcHouseCodeInfoDTO;
import com.epmet.entity.IcHouseCodeInfoEntity;
import com.epmet.redis.IcHouseCodeInfoRedis;
import com.epmet.service.IcHouseCodeInfoService;
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-06-01
*/
@Service
public class IcHouseCodeInfoServiceImpl extends BaseServiceImpl<IcHouseCodeInfoDao, IcHouseCodeInfoEntity> implements IcHouseCodeInfoService {
@Autowired
private IcHouseCodeInfoRedis icHouseCodeInfoRedis;
@Override
public PageData<IcHouseCodeInfoDTO> page(Map<String, Object> params) {
IPage<IcHouseCodeInfoEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IcHouseCodeInfoDTO.class);
}
@Override
public List<IcHouseCodeInfoDTO> list(Map<String, Object> params) {
List<IcHouseCodeInfoEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IcHouseCodeInfoDTO.class);
}
private QueryWrapper<IcHouseCodeInfoEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcHouseCodeInfoEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public IcHouseCodeInfoDTO get(String id) {
IcHouseCodeInfoEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IcHouseCodeInfoDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcHouseCodeInfoDTO dto) {
IcHouseCodeInfoEntity entity = ConvertUtils.sourceToTarget(dto, IcHouseCodeInfoEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcHouseCodeInfoDTO dto) {
IcHouseCodeInfoEntity entity = ConvertUtils.sourceToTarget(dto, IcHouseCodeInfoEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

36
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java

@ -1,8 +1,10 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
@ -78,8 +80,8 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
return ConvertUtils.sourceToTarget(entityList, IcHouseDTO.class);
}
private QueryWrapper<IcHouseEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
private QueryWrapper<IcHouseEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcHouseEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
@ -152,7 +154,7 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
wrapper.eq(StringUtils.isNotBlank(formDTO.getUnitId()), IcHouseEntity::getBuildingUnitId, formDTO.getUnitId());
wrapper.last("ORDER BY CONVERT ( HOUSE_NAME USING gbk ) ASC");
List<IcHouseEntity> list = baseDao.selectList(wrapper);
if(CollectionUtils.isEmpty(list)) {
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
}
return list.stream().map(item -> {
@ -165,15 +167,15 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
}
/**
* @Description 查询房屋信息
* @param idCard
* @Description 查询房屋信息
* @author zxc
* @date 2021/11/3 3:30 下午
*/
@Override
public List<String> selectHouseInfoByIdCard(String idCard,String customerId) {
List<String> result = baseDao.selectHouseInfoByIdCard(idCard,customerId);
if (CollectionUtils.isEmpty(result)){
public List<String> selectHouseInfoByIdCard(String idCard, String customerId) {
List<String> result = baseDao.selectHouseInfoByIdCard(idCard, customerId);
if (CollectionUtils.isEmpty(result)) {
return new ArrayList<>();
}
return result;
@ -189,19 +191,19 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
* @Date 2021/11/5 16:01
*/
@Override
public List<HouseListResultDTO> getHouseList(TokenDto tokenDto, HouseFormDTO formDTO) {
public List<HouseListResultDTO> getHouseList(TokenDto tokenDto, HouseFormDTO formDTO) {
//查询楼栋下房屋列表
LambdaQueryWrapper<IcHouseEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcHouseEntity::getBuildingId, formDTO.getBuildingId());
wrapper.last("ORDER BY CONVERT ( HOUSE_NAME USING gbk ) ASC");
List<IcHouseEntity> list = baseDao.selectList(wrapper);
if(CollectionUtils.isEmpty(list)) {
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
}
//获取居民分类列表
IcResiCategoryStatsConfigDTO categoryDto = new IcResiCategoryStatsConfigDTO();
categoryDto.setCustomerId(tokenDto.getCustomerId());
Result<List<IcResiCategoryStatsConfigDTO>> categoryResult = operCustomizeOpenFeignClient.getCategoryList(categoryDto);
Result<List<IcResiCategoryStatsConfigDTO>> categoryResult = operCustomizeOpenFeignClient.getCategoryList(categoryDto);
if (!categoryResult.success()) {
throw new RenException(categoryResult.getCode(), categoryResult.getMsg());
}
@ -220,7 +222,7 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
HouseListResultDTO dto = new HouseListResultDTO();
dto.setHouseId(item.getId());
dto.setHouseName(item.getHouseName());
switch (item.getRentFlag()){
switch (item.getRentFlag()) {
case NumConstant.ZERO:
dto.setRentFlag("自住");
break;
@ -251,7 +253,7 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
}
}
//将党员放在最前面
if(CollectionUtils.isNotEmpty(categories)) {
if (CollectionUtils.isNotEmpty(categories)) {
int a = 0;
for (int i = 0; i < categories.size(); i++) {
if ("党员".equals(categories.get(i).getName())) {
@ -268,6 +270,7 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
/**
* Desc: 批量更新房屋信息
*
* @param houses
* @author zxc
* @date 2022/3/25 10:22
@ -280,16 +283,23 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
/**
* Desc: 根据身份证查询房屋名
*
* @param idCards
* @author zxc
* @date 2022/4/12 16:42
*/
@Override
public List<HousesNameResultDTO> getHousesNameByIdCards(List<String> idCards) {
if (CollectionUtils.isEmpty(idCards)){
if (CollectionUtils.isEmpty(idCards)) {
return new ArrayList<>();
}
return baseDao.getHousesNameByIdCards(idCards);
}
@Override
public IcHouseDTO getByHouseCode(String houseCode) {
LambdaQueryWrapper<IcHouseEntity> lqw = Wrappers.lambdaQuery();
lqw.eq(IcHouseEntity::getHouseCode, houseCode);
return ConvertUtils.sourceToTarget(baseDao.selectOne(lqw), IcHouseDTO.class);
}
}

64
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ConvertToMultipartFile.java

@ -0,0 +1,64 @@
package com.epmet.util;
import org.springframework.web.multipart.MultipartFile;
import java.io.*;
public class ConvertToMultipartFile implements MultipartFile {
private byte[] fileBytes;
String name;
String originalFilename;
String contentType;
boolean isEmpty;
long size;
public ConvertToMultipartFile(byte[] fileBytes, String name, String originalFilename, String contentType,
long size) {
this.fileBytes = fileBytes;
this.name = name;
this.originalFilename = originalFilename;
this.contentType = contentType;
this.size = size;
this.isEmpty = false;
}
@Override
public String getName() {
return name;
}
@Override
public String getOriginalFilename() {
return originalFilename;
}
@Override
public String getContentType() {
return contentType;
}
@Override
public boolean isEmpty() {
return isEmpty;
}
@Override
public long getSize() {
return size;
}
@Override
public byte[] getBytes() throws IOException {
return fileBytes;
}
@Override
public InputStream getInputStream() throws IOException {
return new ByteArrayInputStream(fileBytes);
}
@Override
public void transferTo(File dest) throws IOException, IllegalStateException {
new FileOutputStream(dest).write(fileBytes);
}
}

10
epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.21__alter_ic_house.sql

@ -0,0 +1,10 @@
alter table ic_house add COLUMN `HOUSE_CODE` varchar(32) DEFAULT NULL COMMENT '房屋编码';
alter table ic_house add COLUMN `HOUSE_QRCODE_URL` varchar(255) DEFAULT NULL COMMENT '一户一码的二维码地址';
CREATE TABLE `ic_house_code_info` (
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
`BUILDING_ID` varchar(64) NOT NULL COMMENT '所属楼栋id',
`BUILDING_MAX_NUM` varchar(10) NOT NULL COMMENT '最大的楼栋编码序列号',
`HOUSE_MAX_NUM` varchar(10) NOT NULL COMMENT '该楼栋下最大的房屋编码序列号'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='房屋编码辅助表';

30
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseCodeInfoDao.xml

@ -0,0 +1,30 @@
<?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.dao.IcHouseCodeInfoDao">
<resultMap type="com.epmet.entity.IcHouseCodeInfoEntity" id="icHouseCodeInfoMap">
<result property="customerId" column="CUSTOMER_ID"/>
<result property="buildingId" column="BUILDING_ID"/>
<result property="buildingMaxNum" column="BUILDING_MAX_NUM"/>
<result property="houseMaxNum" column="HOUSE_MAX_NUM"/>
</resultMap>
<select id="selectByCuIdAndBuilId" resultType="com.epmet.entity.IcHouseCodeInfoEntity">
select * from ic_house_code_info
where CUSTOMER_ID=#{customerId}
and BUILDING_ID=#{buildingId}
</select>
<select id="selectMaxHouseMaxNum" resultType="com.epmet.entity.IcHouseCodeInfoEntity">
select * from ic_house_code_info
order by BUILDING_MAX_NUM desc
limit 1
</select>
<update id="updateByCuIdAndBuId">
update ic_house_code_info
set HOUSE_MAX_NUM=#{houseMaxNum}
where CUSTOMER_ID = #{customerId}
and BUILDING_ID = #{buildingId}
</update>
</mapper>

46
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml

@ -100,6 +100,7 @@
a.OWNER_NAME as ownerName,
a.OWNER_PHONE as ownerPhone,
a.OWNER_ID_CARD as ownerIdCard,
a.HOUSE_CODE,
a.ID as houseId,
c.ID as neighborHoodId,
@ -113,7 +114,8 @@
c.GRID_ID as gridId,
gr.GRID_NAME,
IFNULL(a.sort,0) as sort,
IFNULL(a.REMARK,'') AS remark
IFNULL(a.REMARK,'') AS remark,
a.CUSTOMER_ID
from ic_house a
LEFT JOIN ic_building b on a.BUILDING_ID = b.ID and b.DEL_FLAG = '0'
LEFT JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID and c.DEL_FLAG = '0'
@ -266,11 +268,16 @@
IFNULL(ib.LATITUDE,'') as buildingLatitude,
ih.CUSTOMER_ID AS customerId,
concat(IFNULL(n.NEIGHBOR_HOOD_NAME,''),IFNULL(ib.BUILDING_NAME,''),IFNULL(u.UNIT_NAME,''),IFNULL(ih.DOOR_NAME,'')) AS allName,
n.AGENCY_ID as agencyId
n.AGENCY_ID as agencyId,
n.GRID_ID,
gr.GRID_NAME,
ih.HOUSE_CODE,
ih.HOUSE_QRCODE_URL
FROM ic_house ih
left JOIN ic_neighbor_hood n ON ( ih.NEIGHBOR_HOOD_ID = n.id AND n.DEL_FLAG = '0')
left JOIN ic_building ib ON ( ih.BUILDING_ID = ib.id AND ib.DEL_FLAG = '0')
left JOIN ic_building_unit u ON ( ih.BUILDING_UNIT_ID = u.ID AND u.DEL_FLAG = '0')
left join customer_grid gr ON (gr.id=n.GRID_ID and gr.ABANDON_FLAG=0 and gr.DEL_FLAG=0)
WHERE
ih.DEL_FLAG = '0'
AND ih.ID = #{houseId}
@ -387,6 +394,41 @@
INNER JOIN ic_neighbor_hood nh ON (nh.ID = h.NEIGHBOR_HOOD_ID AND nh.DEL_FLAG = '0')
WHERE h.ID = #{houseId}
</select>
<select id="selectHouseQrcodeById" resultType="com.epmet.dto.result.IcHouseListResultDTO">
select
concat(b.BUILDING_NAME,'-',d.UNIT_NUM,'-',a.DOOR_NAME) as houseName,
c.NEIGHBOR_HOOD_NAME as neighborHoodName,
b.BUILDING_NAME as buildingName,
CONCAT(d.UNIT_NUM,'单元') as unitNum,
a.DOOR_NAME as doorName,
a.HOUSE_CODE,
a.CUSTOMER_ID,
c.GRID_ID
from ic_house a
LEFT JOIN ic_building b on a.BUILDING_ID = b.ID and b.DEL_FLAG = '0'
LEFT JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID and c.DEL_FLAG = '0'
LEFT JOIN ic_building_unit d on a.BUILDING_UNIT_ID = d.ID and d.DEL_FLAG = '0'
where a.id=#{id}
and a.del_flag = '0'
</select>
<select id="selectByHouseCode" resultType="com.epmet.entity.IcHouseEntity">
select * from ic_house
where HOUSE_CODE=#{houseCode}
and del_flag = '0'
</select>
<select id="selectBatchHouseCodeAndUrl" resultType="com.epmet.dto.result.CreateHouseCodeAndUrlDTO">
select h.id as houseId,
h.customer_id,
h.BUILDING_ID,
b.AREA_CODE
from ic_house h
left join ic_neighbor_hood n on h.NEIGHBOR_HOOD_ID=n.id
left join customer_agency b ON n.agency_Id = b.ID
where h.DEL_FLAG='0'
and h.CUSTOMER_ID = #{customerId}
and(h.HOUSE_CODE is null or h.HOUSE_CODE = '')
order by h.CREATED_TIME desc
</select>
<!-- 获取单元下的房屋数 -->
<select id="getHouseCountByUnitIds" resultType="java.lang.Integer">

11
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml

@ -301,4 +301,15 @@
del_flag = '0'
AND grid_id = #{gridId}
</select>
<select id="getAreaCode" resultType="java.lang.String">
SELECT
AREA_CODE
FROM
ic_neighbor_hood a
INNER JOIN customer_agency b ON a.agency_Id = b.ID
AND b.del_flag = '0'
WHERE
a.del_flag = '0'
AND a.ID = #{neighborHoodId}
</select>
</mapper>

190
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserConfirmDTO.java

@ -0,0 +1,190 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 居民信息审核表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-01
*/
@Data
public class IcResiUserConfirmDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户Id customer.id
*/
private String customerId;
/**
* 组织Id
*/
private String agencyId;
/**
* 组织的pids
*/
private String pids;
/**
* 网格ID
*/
private String gridId;
/**
*
*/
private String surname;
/**
*
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 性别
*/
private String gender;
/**
* 身份证号
*/
private String idCard;
/**
* 出生日期
*/
private String birthday;
/**
* 户籍所在地
*/
private String hjszd;
/**
* 户籍所在地地区码
*/
private String hjszdCode;
/**
* 户籍所在地层级编码
*/
private String hjszdPathCode;
/**
* 现居住地
*/
private String xjzd;
/**
* 现居住地地区码
*/
private String xjzdCode;
/**
* 现居住地层级编码
*/
private String xjzdPathCode;
/**
* 详细地址
*/
private String xxdz;
/**
* 民族字典表
*/
private String mz;
/**
* 名族名称
*/
private String mzName;
/**
* 与户主关系
*/
private String yhzgx;
/**
* 与户主关系名称
*/
private String yhzgxName;
/**
* 审核状态0未审核1审核通过2审核不通过
*/
private String confirmResult;
/**
* 审核不通过的原因
*/
private String reason;
/**
* 删除标识 0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* ic_resi_user表id
*/
private String icResiUserId;
/**
* 操作类型新增add 修改 update 删除 delete
*/
private String submitType;
/**
* 删除原因
*/
private String deleteReason;
/**
* 操作说明
*/
private String operationDescribe;
}

25
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserConfirmGetDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 查询家庭成员信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-01
*/
@Data
public class IcResiUserConfirmGetDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ic_resi_user表id
*/
private String icResiUserId;
}

210
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserConfirmSubmitDTO.java

@ -0,0 +1,210 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 居民信息审核表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-01
*/
@Data
public class IcResiUserConfirmSubmitDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户Id customer.id
*/
private String customerId;
/**
* 组织Id
*/
private String agencyId;
/**
* 组织的pids
*/
private String pids;
/**
* 网格ID
*/
private String gridId;
/**
* 所属小区ID
*/
private String villageId;
/**
* 所属楼宇Id
*/
private String buildId;
/**
* 单元id
*/
private String unitId;
/**
* 所属家庭Id
*/
private String homeId;
/**
*
*/
private String surname;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 性别
*/
private String gender;
/**
* 身份证号
*/
private String idCard;
/**
* 出生日期
*/
private String birthday;
/**
* 户籍所在地
*/
private String hjszd;
/**
* 户籍所在地地区码
*/
private String hjszdCode;
/**
* 户籍所在地层级编码
*/
private String hjszdPathCode;
/**
* 现居住地
*/
private String xjzd;
/**
* 现居住地地区码
*/
private String xjzdCode;
/**
* 现居住地层级编码
*/
private String xjzdPathCode;
/**
* 详细地址
*/
private String xxdz;
/**
* 民族字典表
*/
private String mz;
/**
* 名族名称
*/
private String mzName;
/**
* 与户主关系
*/
private String yhzgx;
/**
* 与户主关系名称
*/
private String yhzgxName;
/**
* 审核状态0未审核1审核通过2审核不通过
*/
private String confirmResult;
/**
* 审核不通过的原因
*/
private String reason;
/**
* 删除标识 0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* ic_resi_user表id
*/
private String icResiUserId;
/**
* 操作类型新增add 修改 update 删除 delete
*/
private String submitType;
/**
* 删除原因
*/
private String deleteReason;
/**
* 操作说明
*/
private String operationDescribe;
}

70
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RegisterAndBindFormDTO.java

@ -0,0 +1,70 @@
package com.epmet.dto.form;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/6/1 9:39
*/
@NoArgsConstructor
@Data
public class RegisterAndBindFormDTO implements Serializable {
private static final long serialVersionUID = 7068763631425911170L;
private String customerId;
private String userId;
/**
*
*/
private String surname;
/**
*
*/
private String name;
/**
* 昵称
*/
private String nickname;
/**
* 头像
*/
private String headImgUrl;
/**
* 身份证
*/
private String idCard;
/**
* 手机号
*/
private String mobile;
/**
* 网格
*/
private String gridId;
/**
* 小区
*/
private String villageId;
/**
* 楼栋
*/
private String buildId;
/**
* 单元
*/
private String unitId;
/**
* 房屋
*/
private String homeId;
/**
* 路牌号
*/
private String address;
private String visitId;
}

22
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/HomeInfoResultDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/6/1 16:49
*/
@NoArgsConstructor
@Data
public class HomeInfoResultDTO implements Serializable {
private static final long serialVersionUID = -6109420020924607393L;
private String icResiUserId;
private String houseName;
private String houseCode;
private String qrCodeUrl;
}

95
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserConfirmController.java

@ -0,0 +1,95 @@
package com.epmet.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.dto.IcResiUserConfirmDTO;
import com.epmet.excel.IcResiUserConfirmExcel;
import com.epmet.service.IcResiUserConfirmService;
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-06-01
*/
@RestController
@RequestMapping("icResiUserConfirm")
public class IcResiUserConfirmController {
@Autowired
private IcResiUserConfirmService icResiUserConfirmService;
@RequestMapping("page")
public Result<PageData<IcResiUserConfirmDTO>> page(@RequestParam Map<String, Object> params){
PageData<IcResiUserConfirmDTO> page = icResiUserConfirmService.page(params);
return new Result<PageData<IcResiUserConfirmDTO>>().ok(page);
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<IcResiUserConfirmDTO> get(@PathVariable("id") String id){
IcResiUserConfirmDTO data = icResiUserConfirmService.get(id);
return new Result<IcResiUserConfirmDTO>().ok(data);
}
@NoRepeatSubmit
@PostMapping("save")
public Result save(@RequestBody IcResiUserConfirmDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icResiUserConfirmService.save(dto);
return new Result();
}
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody IcResiUserConfirmDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icResiUserConfirmService.update(dto);
return new Result();
}
@PostMapping("delete")
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
icResiUserConfirmService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<IcResiUserConfirmDTO> list = icResiUserConfirmService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, IcResiUserConfirmExcel.class);
}
/**
* 审核
*
* @Param tokenDto
* @Return {@link Result}
* @Author zhaoqifeng
* @Date 2022/6/1 17:26
*/
@PostMapping("confirm")
public Result confirm(@RequestBody IcResiUserConfirmDTO dto) {
icResiUserConfirmService.confirm(dto);
return new Result();
}
}

162
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/MyHomeController.java

@ -0,0 +1,162 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.enums.HomeMemberOperationEnum;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
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.dto.IcResiUserConfirmDTO;
import com.epmet.dto.form.IcResiUserConfirmGetDTO;
import com.epmet.dto.form.IcResiUserConfirmSubmitDTO;
import com.epmet.dto.form.RegisterAndBindFormDTO;
import com.epmet.dto.result.HomeInfoResultDTO;
import com.epmet.dto.result.HomeUserBriefResultDTO;
import com.epmet.service.IcResiUserConfirmService;
import com.epmet.service.IcResiUserService;
import com.epmet.service.MyHomeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/5/31 16:20
*/
@Slf4j
@RestController
@RequestMapping("myHome")
public class MyHomeController {
@Autowired
private MyHomeService myHomeService;
@Autowired
private IcResiUserConfirmService icResiUserConfirmService;
@Autowired
private IcResiUserService icResiUserService;
@PostMapping("memberList/{houseCode}")
public Result<List<HomeUserBriefResultDTO>> selectListHomeMember(@PathVariable("houseCode") String houseCode, @LoginUser TokenDto tokenDto) {
return new Result().ok(myHomeService.selectListHomeMember(houseCode, tokenDto.getCustomerId()));
}
// /**
// * @describe: 新增家庭成员
// * @author wangtong
// * @date 2022/6/1 15:50
// * @params [dto]
// * @return com.epmet.commons.tools.utils.Result
// */
// @PostMapping("addMember")
// public Result addMember(@RequestBody IcResiUserConfirmSubmitDTO dto){
// //效验数据
// ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
// dto.setSubmitType(HomeMemberOperationEnum.ADD.getCode());
// return icResiUserConfirmService.addMember(dto);
// }
//
// /**
// * @describe: 修改家庭成员
// * @author wangtong
// * @date 2022/6/1 15:27
// * @params [dto]
// * @return com.epmet.commons.tools.utils.Result
// */
// @PostMapping("editMember")
// public Result save(@RequestBody IcResiUserConfirmSubmitDTO dto){
// //效验数据
// ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
// dto.setSubmitType(HomeMemberOperationEnum.UPDATE.getCode());
// return icResiUserConfirmService.editMember(dto);
// }
//
/**
* @describe: 删除家庭成员
* @author wangtong
* @date 2022/6/1 16:10
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("delMember")
public Result delMember(@RequestBody IcResiUserConfirmSubmitDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
dto.setSubmitType(HomeMemberOperationEnum.DELETE.getCode());
return icResiUserConfirmService.delMember(dto);
}
/**
* @describe: 新增家庭成员
* @author wangtong
* @date 2022/6/1 15:50
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("addMember")
public Result addMember(@RequestBody IcResiUserConfirmSubmitDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
return icResiUserService.addMember(dto);
}
/**
* @describe: 修改家庭成员
* @author wangtong
* @date 2022/6/1 15:27
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("editMember")
public Result editMember(@RequestBody IcResiUserConfirmSubmitDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
return icResiUserService.editMember(dto);
}
/**
* @describe: 查询家庭成员信息
* @author wangtong
* @date 2022/6/1 16:14
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("getMemberDetail")
public Result<IcResiUserConfirmDTO> getMemberDetail(@RequestBody IcResiUserConfirmGetDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
return icResiUserConfirmService.getMemberDetail(dto);
}
/**
* 注册绑定家庭信息
*
* @Param tokenDto
* @Param formDTO
* @Return {@link Result}
* @Author zhaoqifeng
* @Date 2022/6/1 10:26
*/
@PostMapping("registerAndBind")
public Result registerAndBind(@LoginUser TokenDto tokenDto, @RequestBody RegisterAndBindFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
myHomeService.registerAndBind(formDTO);
return new Result();
}
@PostMapping("homeInfo")
public Result<HomeInfoResultDTO> getHomeInfo(@LoginUser TokenDto tokenDto) {
HomeInfoResultDTO result = myHomeService.getHomeInfo(tokenDto);
return new Result<HomeInfoResultDTO>().ok(result);
}
}

25
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserConfirmDao.java

@ -0,0 +1,25 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.IcResiUserConfirmEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 居民信息审核表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-01
*/
@Mapper
public interface IcResiUserConfirmDao extends BaseDao<IcResiUserConfirmEntity> {
/**
* @describe: 根据icResiUserId查询
* @author wangtong
* @date 2022/6/1 16:01
* @params [icResiUserId]
* @return com.epmet.entity.IcResiUserConfirmEntity
*/
IcResiUserConfirmEntity selectByIcResiUserId(@Param("icResiUserId") String icResiUserId);
}

10
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java

@ -19,6 +19,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
import com.epmet.dto.IcResiUserConfirmDTO;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.IcVolunteerPolyDTO;
import com.epmet.dto.form.EpidemicPreventionFormDTO;
@ -334,4 +335,13 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
* @Date 2022/5/19 10:40
*/
List<IcVolunteerPolyDTO> getVolunteerList(@Param("customerId") String customerId, @Param("userId") String userId);
/**
* @describe: 查询家庭成员信息
* @author wangtong
* @date 2022/6/1 16:16
* @params [icResiUserId]
* @return com.epmet.dto.IcResiUserConfirmDTO
*/
IcResiUserConfirmDTO selectMemberDetail(@Param("icResiUserId") String icResiUserId);
}

157
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserConfirmEntity.java

@ -0,0 +1,157 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 居民信息审核表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-01
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_resi_user_confirm")
public class IcResiUserConfirmEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id customer.id
*/
private String customerId;
/**
* 组织Id
*/
private String agencyId;
/**
* 组织的pids
*/
private String pids;
/**
* 网格ID
*/
private String gridId;
/**
*
*/
private String surname;
/**
*
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 性别
*/
private String gender;
/**
* 身份证号
*/
private String idCard;
/**
* 出生日期
*/
private String birthday;
/**
* 户籍所在地
*/
private String hjszd;
/**
* 户籍所在地地区码
*/
private String hjszdCode;
/**
* 户籍所在地层级编码
*/
private String hjszdPathCode;
/**
* 现居住地
*/
private String xjzd;
/**
* 现居住地地区码
*/
private String xjzdCode;
/**
* 现居住地层级编码
*/
private String xjzdPathCode;
/**
* 详细地址
*/
private String xxdz;
/**
* 民族字典表
*/
private String mz;
/**
* 名族名称
*/
private String mzName;
/**
* 与户主关系
*/
private String yhzgx;
/**
* 与户主关系名称
*/
private String yhzgxName;
/**
* 审核状态0未审核1审核通过2审核不通过
*/
private String confirmResult;
/**
* 审核不通过的原因
*/
private String reason;
/**
* ic_resi_user表id
*/
private String icResiUserId;
/**
* 操作类型新增add 修改 update 删除 delete
*/
private String submitType;
/**
* 删除原因
*/
private String deleteReason;
/**
* 操作说明
*/
private String operationDescribe;
}

105
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiUserConfirmExcel.java

@ -0,0 +1,105 @@
package com.epmet.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-06-01
*/
@Data
public class IcResiUserConfirmExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "客户Id customer.id")
private String customerId;
@Excel(name = "组织Id")
private String agencyId;
@Excel(name = "组织的pids")
private String pids;
@Excel(name = "网格ID")
private String gridId;
@Excel(name = "姓")
private String surname;
@Excel(name = "名")
private String name;
@Excel(name = "手机号")
private String mobile;
@Excel(name = "性别")
private String gender;
@Excel(name = "身份证号")
private String idCard;
@Excel(name = "出生日期")
private String birthday;
@Excel(name = "户籍所在地地区码")
private String hjszdCode;
@Excel(name = "户籍所在地")
private String hjszd;
@Excel(name = "现居住地地区码")
private String xjzdCode;
@Excel(name = "现居住地")
private String xjzd;
@Excel(name = "民族【字典表】")
private String mz;
@Excel(name = "与户主关系")
private String yhzgx;
@Excel(name = "审核状态0未审核,1审核通过,2审核不通过")
private String confirmResult;
@Excel(name = "审核不通过的原因")
private String reason;
@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;
@Excel(name = "ic_resi_user表id")
private String icUserId;
@Excel(name = "操作类型:新增add 修改 update 删除 delete")
private String submitType;
@Excel(name = "删除原因")
private String deleteReason;
@Excel(name = "操作说明")
private String operationDescribe;
}

30
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcResiUserConfirmRedis.java

@ -0,0 +1,30 @@
package com.epmet.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-06-01
*/
@Component
public class IcResiUserConfirmRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

127
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserConfirmService.java

@ -0,0 +1,127 @@
package com.epmet.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.dto.IcResiUserConfirmDTO;
import com.epmet.dto.form.IcResiUserConfirmGetDTO;
import com.epmet.dto.form.IcResiUserConfirmSubmitDTO;
import com.epmet.entity.IcResiUserConfirmEntity;
import java.util.List;
import java.util.Map;
/**
* 居民信息审核表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-01
*/
public interface IcResiUserConfirmService extends BaseService<IcResiUserConfirmEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IcResiUserConfirmDTO>
* @author generator
* @date 2022-06-01
*/
PageData<IcResiUserConfirmDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<IcResiUserConfirmDTO>
* @author generator
* @date 2022-06-01
*/
List<IcResiUserConfirmDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return IcResiUserConfirmDTO
* @author generator
* @date 2022-06-01
*/
IcResiUserConfirmDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-06-01
*/
void save(IcResiUserConfirmDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2022-06-01
*/
void update(IcResiUserConfirmDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2022-06-01
*/
void delete(String[] ids);
/**
* @describe: 新增家庭成员
* @author wangtong
* @date 2022/6/1 15:30
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
Result editMember(IcResiUserConfirmSubmitDTO dto);
/**
* @describe: 新增家庭成员
* @author wangtong
* @date 2022/6/1 15:50
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
Result addMember(IcResiUserConfirmSubmitDTO dto);
/**
* @describe: 删除家庭成员
* @author wangtong
* @date 2022/6/1 16:11
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
Result delMember(IcResiUserConfirmSubmitDTO dto);
/**
* @describe: 查询家庭成员信息
* @author wangtong
* @date 2022/6/1 16:15
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
Result<IcResiUserConfirmDTO> getMemberDetail(IcResiUserConfirmGetDTO dto);
/**
* 审核
*
* @Param dto
* @Return
* @Author zhaoqifeng
* @Date 2022/6/1 17:27
*/
void confirm(IcResiUserConfirmDTO dto);
}

27
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
@ -89,17 +90,17 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
String staffOrgPath);
/**
* @Description 查询个人数据
* @param formDTO
* @Description 查询个人数据
* @author zxc
* @date 2021/11/3 9:21 上午
*/
PersonDataResultDTO personData(PersonDataFormDTO formDTO);
/**
* @Description 根据名字搜索
* @param formDTO
* @Description 根据名字搜索
* @Description 根据名字搜索
* @author zxc
* @date 2021/11/3 1:42 下午
*/
@ -278,7 +279,7 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
*/
List<HomeUserBriefResultDTO> listHomeUserBrief(String houseId, String customerId);
List<Map<String,Object>> dynamicQuery(String loginUserCustomerId, String formCode, String icResiUser, List<IcCustomExportResultDTO.SqlColumn> showSqlColumns, List<ResiUserQueryValueDTO> conditions, String agencyId, String finalStaffOrgPath);
List<Map<String, Object>> dynamicQuery(String loginUserCustomerId, String formCode, String icResiUser, List<IcCustomExportResultDTO.SqlColumn> showSqlColumns, List<ResiUserQueryValueDTO> conditions, String agencyId, String finalStaffOrgPath);
/**
* 租客房东黑名单查询个人数据
@ -331,8 +332,10 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
* @return
*/
SyncResiResDTO checkUser(String customerId, String idCard, String agencyId);
/**
* desc:条件获取居民基础信息
*
* @param formDTO
* @return
*/
@ -384,4 +387,22 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
* @Date 2022/5/31 9:50
*/
IcUserRoleResultDTO getUserRoleByIdCard(IcResiUserDTO formDTO);
/**
* @return com.epmet.commons.tools.utils.Result
* @describe: 新增家庭成员
* @author wangtong
* @date 2022/6/6 10:36
* @params [dto]
*/
Result addMember(IcResiUserConfirmSubmitDTO dto);
/**
* @return com.epmet.commons.tools.utils.Result
* @describe: 修改家庭成员
* @author wangtong
* @date 2022/6/6 10:36
* @params [dto]
*/
Result editMember(IcResiUserConfirmSubmitDTO dto);
}

46
epmet-user/epmet-user-server/src/main/java/com/epmet/service/MyHomeService.java

@ -0,0 +1,46 @@
package com.epmet.service;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.form.RegisterAndBindFormDTO;
import com.epmet.dto.result.HomeInfoResultDTO;
import com.epmet.dto.result.HomeUserBriefResultDTO;
import java.util.List;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/5/31 16:21
*/
public interface MyHomeService {
/**
* 注册绑定房屋信息
*
* @Param formDTO
* @Return
* @Author zhaoqifeng
* @Date 2022/6/1 16:33
*/
void registerAndBind(RegisterAndBindFormDTO formDTO);
/**
* 获取用户绑定的房屋信息
*
* @Param tokenDto
* @Return {@link HomeInfoResultDTO}
* @Author zhaoqifeng
* @Date 2022/6/1 16:52
*/
HomeInfoResultDTO getHomeInfo(TokenDto tokenDto);
/**
* 查询家庭成员
*
* @param houseCode 房屋编码
* @param customerId
* @return java.util.List<com.epmet.dto.result.HomeUserBriefResultDTO>
* @author work@yujt.net.cn
* @date 2022/6/1/0001 16:12
*/
List<HomeUserBriefResultDTO> selectListHomeMember(String houseCode, String customerId);
}

175
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserConfirmServiceImpl.java

@ -0,0 +1,175 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcResiUserConfirmDao;
import com.epmet.dao.IcResiUserDao;
import com.epmet.dto.IcResiUserConfirmDTO;
import com.epmet.dto.form.IcResiUserConfirmGetDTO;
import com.epmet.dto.form.IcResiUserConfirmSubmitDTO;
import com.epmet.entity.IcResiUserConfirmEntity;
import com.epmet.entity.IcResiUserEntity;
import com.epmet.redis.IcResiUserConfirmRedis;
import com.epmet.service.IcResiUserConfirmService;
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-06-01
*/
@Service
public class IcResiUserConfirmServiceImpl extends BaseServiceImpl<IcResiUserConfirmDao, IcResiUserConfirmEntity> implements IcResiUserConfirmService {
@Autowired
private IcResiUserConfirmRedis icResiUserConfirmRedis;
@Autowired
private IcResiUserDao icResiUserDao;
@Override
public PageData<IcResiUserConfirmDTO> page(Map<String, Object> params) {
IPage<IcResiUserConfirmEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IcResiUserConfirmDTO.class);
}
@Override
public List<IcResiUserConfirmDTO> list(Map<String, Object> params) {
List<IcResiUserConfirmEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IcResiUserConfirmDTO.class);
}
private QueryWrapper<IcResiUserConfirmEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcResiUserConfirmEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public IcResiUserConfirmDTO get(String id) {
IcResiUserConfirmEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IcResiUserConfirmDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcResiUserConfirmDTO dto) {
IcResiUserConfirmEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserConfirmEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcResiUserConfirmDTO dto) {
IcResiUserConfirmEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserConfirmEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public Result editMember(IcResiUserConfirmSubmitDTO dto) {
IcResiUserConfirmEntity oldEntity = baseDao.selectByIcResiUserId(dto.getIcResiUserId());
if(null != oldEntity){
dto.setId(oldEntity.getId());
IcResiUserConfirmEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserConfirmEntity.class);
updateById(entity);
}else{
addMember(dto);
}
return new Result().ok("修改成功");
}
@Override
public Result addMember(IcResiUserConfirmSubmitDTO dto) {
IcResiUserEntity user = icResiUserDao.selectById(dto.getIcResiUserId());
dto.setCustomerId(user.getCustomerId());
dto.setAgencyId(user.getAgencyId());
dto.setPids(user.getPids());
dto.setGridId(user.getGridId());
IcResiUserConfirmEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserConfirmEntity.class);
entity.setIcResiUserId(null);
insert(entity);
return new Result().ok("新增成功");
}
@Override
public Result delMember(IcResiUserConfirmSubmitDTO dto) {
IcResiUserConfirmEntity oldEntity = baseDao.selectByIcResiUserId(dto.getIcResiUserId());
if(null != oldEntity){
dto.setId(oldEntity.getId());
IcResiUserConfirmEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserConfirmEntity.class);
updateById(entity);
}else{
addMember(dto);
}
return new Result().ok("删除成功");
}
@Override
public Result<IcResiUserConfirmDTO> getMemberDetail(IcResiUserConfirmGetDTO dto) {
IcResiUserConfirmDTO result = icResiUserDao.selectMemberDetail(dto.getIcResiUserId());
return new Result().ok(result);
}
/**
* 审核
*
* @param dto
* @Param dto
* @Return
* @Author zhaoqifeng
* @Date 2022/6/1 17:27
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void confirm(IcResiUserConfirmDTO dto) {
baseDao.updateById(ConvertUtils.sourceToTarget(dto, IcResiUserConfirmEntity.class));
if (NumConstant.ONE_STR.equals(dto.getConfirmResult())) {
//审核通过,修改居民信息
IcResiUserConfirmEntity confirmEntity = baseDao.selectById(dto.getId());
if ("edit".equals(confirmEntity.getSubmitType())) {
IcResiUserEntity entity = ConvertUtils.sourceToTarget(confirmEntity, IcResiUserEntity.class);
entity.setName(confirmEntity.getSurname() + confirmEntity.getName());
entity.setId(confirmEntity.getIcResiUserId());
icResiUserDao.updateById(entity);
} else if ("delete".equals(confirmEntity.getSubmitType())){
IcResiUserEntity entity = new IcResiUserEntity();
entity.setId(confirmEntity.getIcResiUserId());
entity.setStatus(confirmEntity.getDeleteReason());
icResiUserDao.updateById(entity);
}
} else {
//TODO 发送消息
}
}
}

69
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -1899,6 +1899,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
LambdaQueryWrapper<IcResiUserEntity> lqw = new LambdaQueryWrapper<>();
lqw.eq(IcResiUserEntity::getCustomerId, customerId)
.eq(IcResiUserEntity::getHomeId, houseId)
.eq(IcResiUserEntity::getStatus,"0")
.select(
IcResiUserEntity::getId,
IcResiUserEntity::getHomeId,
@ -2288,6 +2289,74 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return result;
}
@Override
public Result addMember(IcResiUserConfirmSubmitDTO dto) {
IcResiUserEntity user = icResiUserDao.selectById(dto.getIcResiUserId());
IcResiUserDTO userDTO = baseDao.getResiUserByIdCard(dto.getIdCard(), user.getCustomerId());
if (null != userDTO && null != userDTO.getIdCard()) {
String errorMsg = "新增居民信息失败,身份证号已存在!";
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
}
//这个房屋下已经设置了户主后,再次选择户主时提示提示“房屋下已存在户主” PS.户主指与户主关系是本人的用户
if (RelationshipEnum.SELF.getCode().equals(dto.getYhzgx())) {
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiUserEntity::getHomeId, user.getHomeId());
wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode());
List<IcResiUserEntity> entityList = baseDao.selectList(wrapper);
if (CollectionUtils.isNotEmpty(entityList)) {
String errorMsg = "房屋下已存在户主";
throw new EpmetException(EpmetErrorCode.ORG_ADD_FAILED.getCode(), errorMsg, errorMsg);
}
}
dto.setCustomerId(user.getCustomerId());
dto.setAgencyId(user.getAgencyId());
dto.setPids(user.getPids());
dto.setGridId(user.getGridId());
dto.setVillageId(user.getVillageId());
dto.setBuildId(user.getBuildId());
dto.setUnitId(user.getUnitId());
dto.setHomeId(user.getHomeId());
IcResiUserEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserEntity.class);
insert(entity);
return new Result().ok("新增成功");
}
@Override
public Result editMember(IcResiUserConfirmSubmitDTO dto) {
IcResiUserEntity user = icResiUserDao.selectById(dto.getIcResiUserId());
LambdaQueryWrapper<IcResiUserEntity> userWrapper = new LambdaQueryWrapper<>();
userWrapper.ne(IcResiUserEntity::getId, dto.getIcResiUserId());
userWrapper.eq(IcResiUserEntity::getIdCard, dto.getIdCard());
userWrapper.eq(IcResiUserEntity::getCustomerId, user.getCustomerId());
List<IcResiUserEntity> userList = baseDao.selectList(userWrapper);
if (CollectionUtils.isNotEmpty(userList)) {
String errorMsg = "修改居民信息失败,身份证号已存在!";
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
}
//这个房屋下已经设置了户主后,再次选择户主时提示提示“房屋下已存在户主” PS.户主指与户主关系是本人的用户
if (RelationshipEnum.SELF.getCode().equals(dto.getYhzgx())) {
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiUserEntity::getHomeId, user.getHomeId());
wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode());
List<IcResiUserEntity> entityList = baseDao.selectList(wrapper);
if (CollectionUtils.isNotEmpty(entityList)) {
String errorMsg = "房屋下已存在户主";
throw new EpmetException(EpmetErrorCode.ORG_ADD_FAILED.getCode(), errorMsg, errorMsg);
}
}
IcResiUserEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserEntity.class);
entity.setId(dto.getIcResiUserId());
updateById(entity);
return new Result().ok("修改成功");
}
/**
* 根据身份证获取居民角色目前只有是否是志愿者
*

210
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/MyHomeServiceImpl.java

@ -0,0 +1,210 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.HouseInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.*;
import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.UserResiInfoDTO;
import com.epmet.dto.form.EnterGridFormDTO;
import com.epmet.dto.form.GetRoleKeyListFormDTO;
import com.epmet.dto.form.RegisterAndBindFormDTO;
import com.epmet.dto.result.HomeInfoResultDTO;
import com.epmet.dto.result.HomeUserBriefResultDTO;
import com.epmet.dto.result.ResiUserBaseInfoResultDTO;
import com.epmet.entity.IcResiUserEntity;
import com.epmet.entity.UserBaseInfoEntity;
import com.epmet.entity.UserResiInfoEntity;
import com.epmet.entity.UserResiRegisterVisitEntity;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/5/31 16:22
*/
@Service
@Slf4j
public class MyHomeServiceImpl implements MyHomeService {
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private IcResiUserService icResiUserService;
@Resource
private UserRoleDao userRoleDao;
@Resource
private UserResiInfoService userResiInfoService;
@Resource
private UserResiInfoDao userResiInfoDao;
@Resource
private UserBaseInfoService userBaseInfoService;
@Resource
private UserBaseInfoDao userBaseInfoDao;
@Resource
private IcResiUserDao icResiUserDao;
@Resource
private RegisterRelationService registerRelationService;
@Resource
private UserResiRegisterVisitDao userResiRegisterVisitDao;
@Override
public List<HomeUserBriefResultDTO> selectListHomeMember(String houseCode, String customerId) {
Result<IcHouseDTO> byHouseCode = govOrgOpenFeignClient.getByHouseCode(houseCode);
if (byHouseCode.success() && null != byHouseCode.getData()) {
return icResiUserService.listHomeUserBrief(byHouseCode.getData().getId(), customerId);
}
return Lists.newArrayList();
}
/**
* 注册绑定房屋信息
*
* @Param formDTO
* @Return
* @Author zhaoqifeng
* @Date 2022/6/1 16:33
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void registerAndBind(RegisterAndBindFormDTO formDTO) {
LambdaQueryWrapper<IcResiUserEntity> userWrapper = new LambdaQueryWrapper<>();
userWrapper.eq(IcResiUserEntity::getCustomerId, formDTO.getCustomerId());
userWrapper.eq(IcResiUserEntity::getIdCard, formDTO.getIdCard());
IcResiUserEntity icUser = icResiUserDao.selectOne(userWrapper);
if (null != icUser && !icUser.getHomeId().equals(formDTO.getHomeId())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "已绑定其他房屋", "已绑定其他房屋");
}
//进入网格(entergrid)流程
EnterGridFormDTO userInfoParams = new EnterGridFormDTO();
userInfoParams.setUserId(formDTO.getUserId());
userInfoParams.setCustomerId(formDTO.getCustomerId());
userInfoParams.setGridId(formDTO.getGridId());
registerRelationService.getUserInfoAndRoles(userInfoParams);
//1.判断是否是居民,如果不是则注册居民,如果是则更新居民信息
GetRoleKeyListFormDTO getRoleKeyListFormDTO = new GetRoleKeyListFormDTO();
getRoleKeyListFormDTO.setUserId(formDTO.getUserId());
getRoleKeyListFormDTO.setGridId(formDTO.getGridId());
List<String> roleList = userRoleDao.selectUserRoleKeyList(getRoleKeyListFormDTO);
if (CollectionUtils.isNotEmpty(roleList) && roleList.contains("registered_resi")) {
//更新user_resi_info和user_base_info的信息
UserResiInfoEntity userResiInfo = new UserResiInfoEntity();
userResiInfo.setUserId(formDTO.getUserId());
userResiInfo.setSurname(formDTO.getSurname());
userResiInfo.setName(formDTO.getName());
userResiInfo.setIdNum(formDTO.getIdCard());
userResiInfo.setRegMobile(formDTO.getMobile());
userResiInfo.setResiVisitId(formDTO.getVisitId());
userResiInfo.setStreet(formDTO.getAddress());
LambdaQueryWrapper<UserResiInfoEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(UserResiInfoEntity::getCustomerId, formDTO.getCustomerId());
wrapper.eq(UserResiInfoEntity::getUserId, formDTO.getUserId());
userResiInfoDao.update(userResiInfo, wrapper);
UserBaseInfoEntity userBaseInfoEntity = ConvertUtils.sourceToTarget(userResiInfo, UserBaseInfoEntity.class);
userBaseInfoService.insertOrUpdate(userBaseInfoEntity);
} else {
//visit表添加数据
UserResiRegisterVisitEntity visit = new UserResiRegisterVisitEntity();
visit.setCustomerId(formDTO.getCustomerId());
visit.setGridId(formDTO.getGridId());
visit.setUserId(formDTO.getUserId());
visit.setVisitFrom("register_and_bind");
visit.setLastOperateVisit("success");
visit.setVisitTime(new Date());
userResiRegisterVisitDao.insert(visit);
//注册居民
UserResiInfoDTO userResiInfoDTO = ConvertUtils.sourceToTarget(formDTO, UserResiInfoDTO.class);
userResiInfoDTO.setUserId(formDTO.getUserId());
userResiInfoDTO.setIdNum(formDTO.getIdCard());
userResiInfoDTO.setRegMobile(formDTO.getMobile());
userResiInfoDTO.setResiVisitId(visit.getId());
userResiInfoDTO.setStreet(formDTO.getAddress());
userResiInfoDTO.setCustomerId(formDTO.getCustomerId());
userResiInfoDTO.setApp("resi");
userResiInfoService.saveResiInfo(userResiInfoDTO);
}
//2.添加ic_resi_user信息
HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(formDTO.getCustomerId(), formDTO.getHomeId());
if (null == houseInfo) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取房屋信息失败", "获取房屋信息失败");
}
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(houseInfo.getAgencyId());
if (null == agencyInfo) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取组织信息失败", "获取组织信息失败");
}
IcResiUserEntity icUserEntity = ConvertUtils.sourceToTarget(formDTO, IcResiUserEntity.class);
icUserEntity.setName(formDTO.getSurname() + formDTO.getName());
icUserEntity.setAgencyId(houseInfo.getAgencyId());
icUserEntity.setPids(agencyInfo.getPids());
if (null != icUser) {
icUserEntity.setId(icUser.getId());
icResiUserDao.updateById(icUserEntity);
} else {
icResiUserDao.insert(icUserEntity);
}
}
/**
* 获取用户绑定的房屋信息
*
* @param tokenDto
* @Param tokenDto
* @Return {@link HomeInfoResultDTO}
* @Author zhaoqifeng
* @Date 2022/6/1 16:52
*/
@Override
public HomeInfoResultDTO getHomeInfo(TokenDto tokenDto) {
HomeInfoResultDTO resultDto = new HomeInfoResultDTO();
ResiUserBaseInfoResultDTO baseInfo = userBaseInfoDao.selecUserBaseInfoByUserId(tokenDto.getUserId());
if (null == baseInfo) {
return resultDto;
}
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiUserEntity::getCustomerId, tokenDto.getCustomerId());
wrapper.eq(IcResiUserEntity::getIdCard, baseInfo.getIdNum());
IcResiUserEntity icUser = icResiUserDao.selectOne(wrapper);
if (null == icUser) {
return resultDto;
}
resultDto.setIcResiUserId(icUser.getId());
HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(tokenDto.getCustomerId(), icUser.getHomeId());
if (null == houseInfo) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取房屋信息失败", "获取房屋信息失败");
}
resultDto.setHouseName(houseInfo.getAllName());
resultDto.setHouseCode(houseInfo.getHouseCode());
resultDto.setQrCodeUrl(houseInfo.getHouseQrcodeUrl());
return resultDto;
}
}

39
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.52__ic_resi_user_confirm.sql

@ -0,0 +1,39 @@
CREATE TABLE `ic_resi_user_confirm`
(
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id customer.id',
`AGENCY_ID` varchar(64) NOT NULL COMMENT '组织Id',
`PIDS` varchar(255) NOT NULL COMMENT '组织的pids',
`GRID_ID` varchar(64) NOT NULL COMMENT '网格ID',
`SURNAME` varchar(64) COMMENT '',
`NAME` varchar(64) COMMENT '',
`MOBILE` varchar(15) DEFAULT NULL COMMENT '手机号',
`GENDER` char(2) DEFAULT NULL COMMENT '性别',
`ID_CARD` varchar(18) NOT NULL COMMENT '身份证号',
`BIRTHDAY` varchar(64) DEFAULT NULL COMMENT '出生日期',
`HJSZD` varchar(256) DEFAULT NULL COMMENT '户籍所在地',
`HJSZD_CODE` varchar(256) DEFAULT NULL COMMENT '户籍所在地地区码',
`HJSZD_PATH_CODE` varchar(255) DEFAULT NULL COMMENT '户籍所在地层级编码',
`XJZD` varchar(256) DEFAULT NULL COMMENT '现居住地',
`XJZD_CODE` varchar(256) DEFAULT NULL COMMENT '现居住地地区码',
`XJZD_PATH_CODE` varchar(255) DEFAULT NULL COMMENT '现居住地层级编码',
`XXDZ` varchar(255) DEFAULT NULL COMMENT '详细地址',
`MZ` varchar(64) DEFAULT NULL COMMENT '民族【字典表】',
`MZ_NAME` varchar(255) DEFAULT NULL COMMENT '名族名称',
`YHZGX` varchar(64) DEFAULT NULL COMMENT '与户主关系',
`YHZGX_NAME` varchar(255) DEFAULT NULL COMMENT '与户主关系名称',
`CONFIRM_RESULT` varchar(64) DEFAULT '0' COMMENT '审核状态0未审核,1审核通过,2审核不通过',
`REASON` varchar(64) DEFAULT NULL COMMENT '审核不通过的原因',
`DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(64) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
`IC_RESI_USER_ID` varchar(64) DEFAULT NULL COMMENT 'ic_resi_user表id',
`SUBMIT_TYPE` varchar(255) DEFAULT NULL COMMENT '操作类型:新增add 修改 update 删除 delete',
`DELETE_REASON` varchar(255) DEFAULT NULL COMMENT '删除原因',
`OPERATION_DESCRIBE` varchar(255) DEFAULT NULL COMMENT '操作说明',
PRIMARY KEY (`ID`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='居民信息审核表';

44
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserConfirmDao.xml

@ -0,0 +1,44 @@
<?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.dao.IcResiUserConfirmDao">
<resultMap type="com.epmet.entity.IcResiUserConfirmEntity" id="icResiUserConfirmMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="pids" column="PIDS"/>
<result property="gridId" column="GRID_ID"/>
<result property="surname" column="SURNAME"/>
<result property="name" column="NAME"/>
<result property="mobile" column="MOBILE"/>
<result property="gender" column="GENDER"/>
<result property="idCard" column="ID_CARD"/>
<result property="birthday" column="BIRTHDAY"/>
<result property="hjszdCode" column="HJSZD_CODE"/>
<result property="hjszd" column="HJSZD"/>
<result property="xjzdCode" column="XJZD_CODE"/>
<result property="xjzd" column="XJZD"/>
<result property="mz" column="MZ"/>
<result property="yhzgx" column="YHZGX"/>
<result property="confirmResult" column="CONFIRM_RESULT"/>
<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="icResiUserId" column="IC_RESI_USER_ID"/>
<result property="submitType" column="SUBMIT_TYPE"/>
<result property="deleteReason" column="DELETE_REASON"/>
<result property="operationDescribe" column="OPERATION_DESCRIBE"/>
</resultMap>
<select id="selectByIcResiUserId" resultType="com.epmet.entity.IcResiUserConfirmEntity">
select * from ic_resi_user_confirm
where IC_RESI_USER_ID=#{icResiUserId}
and del_flag='0'
</select>
</mapper>

16
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -1078,5 +1078,21 @@
AND a.ID = #{userId}
</if>
</select>
<select id="selectMemberDetail" resultType="com.epmet.dto.IcResiUserConfirmDTO">
select
ID as icResiUserId,
name,
ID_CARD,
gender,
birthday,
MOBILE,
mz,
HJSZD,
yhzgx,
XJZD
from ic_resi_user
where DEL_FLAG='0'
and id=#{icResiUserId}
</select>
</mapper>

Loading…
Cancel
Save