Browse Source

Merge remote-tracking branch 'origin/feature/dev_information_register'

master
Jackwang 3 years ago
parent
commit
8fc4bdc4ab
  1. 34
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CollectUrlEnum.java
  2. 36
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CollectHouseFormDTO.java
  3. 25
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetHouseInfoToCollectFormDTO.java
  4. 124
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseInfoCollectResultDTO.java
  5. 6
      epmet-module/gov-org/gov-org-server/pom.xml
  6. 148
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java
  7. 28
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  8. 14
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java
  9. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java
  10. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodEntity.java
  11. 18
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java
  12. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java
  13. 90
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  14. 103
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java
  15. 1
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.41__ic_neighbor_hood_update.sql
  16. 8
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
  17. 144
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiCollectVisitorDTO.java
  18. 122
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/SaveCollectVisitorFormDTO.java
  19. 20
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectDetailFormDTO.java
  20. 76
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectDetailResultDTO.java
  21. 20
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectPageFormDTO.java
  22. 65
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectCheckFormDTO.java
  23. 28
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectGetDetailFormDTO.java
  24. 93
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemDetailDTO.java
  25. 11
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java
  26. 105
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SaveCollectFormDTO.java
  27. 26
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VisitListFormDTO.java
  28. 57
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectHouseInfoResultDTO.java
  29. 23
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java
  30. 56
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectPageListDTO.java
  31. 82
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java
  32. 137
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectVisitorController.java
  33. 21
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java
  34. 38
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectVisitorDao.java
  35. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiMemberDao.java
  36. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectEntity.java
  37. 111
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectVisitorEntity.java
  38. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiMemberEntity.java
  39. 90
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiCollectVisitorExcel.java
  40. 25
      epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java
  41. 15
      epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java
  42. 30
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcResiCollectVisitorRedis.java
  43. 53
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiCollectService.java
  44. 111
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiCollectVisitorService.java
  45. 337
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java
  46. 158
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectVisitorServiceImpl.java
  47. 36
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.63__alter_collect.sql
  48. 69
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml
  49. 108
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectVisitorDao.xml
  50. 9
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiMemberDao.xml

34
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CollectUrlEnum.java

@ -0,0 +1,34 @@
package com.epmet.commons.tools.enums;
public enum CollectUrlEnum {
URL_PRE("subpages/points/pages/fangyi/xinxi/create/index", "小程序码跳转地址"),
GET_CODE_URL("https://api.weixin.qq.com/wxa/getwxacode?access_token=", "获取二维码的url");
private String code;
private String name;
CollectUrlEnum(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;
}
}

36
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CollectHouseFormDTO.java

@ -0,0 +1,36 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @author wgf
* @date 2022/8/3 11:18
*/
@Data
public class CollectHouseFormDTO implements Serializable {
private static final long serialVersionUID = 2636608477324780974L;
private String id;
/**
* 房屋状态 1出租 0自住 2闲置 3未售出
*/
private Integer rentFlag;
/**
* 房主姓名
*/
private String ownerName;
/**
* 客户ID
*/
private String customerId;
/**
* 居住人数
*/
private Integer resiNumber;
}

25
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetHouseInfoToCollectFormDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @author wgf
* @date 2022/8/3 11:18
*/
@Data
public class GetHouseInfoToCollectFormDTO implements Serializable {
private static final long serialVersionUID = 2636608477324780974L;
/**
* 单元
*/
private String buildingUnitId;
/**
* 门牌号
*/
private String doorName;
}

124
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseInfoCollectResultDTO.java

@ -0,0 +1,124 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* desc:房屋列表结果类
*
* @author liujianjun
*/
@Data
public class IcHouseInfoCollectResultDTO implements Serializable {
private static final long serialVersionUID = 4963952996288796744L;
/**
* id
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 所属组织的PIDS包括agencygrid
*/
private String orgIdPath;
/**
* 小区id
*/
private String neighborHoodId;
/**
* 片区idneighbor_hood_part.id,可为空
*/
private String partId;
/**
* 所属楼栋id
*/
private String buildingId;
/**
* 所属单元id
*/
private String buildingUnitId;
/**
* 房屋名字后台插入时生成
*/
private String houseName;
/**
* 全名:小区楼栋单元房屋
*/
private String fullName;
/**
* 门牌号
*/
private String doorName;
/**
* 房屋类型这里存储字典value就可以
*/
private String houseType;
/**
* 存储字典value
*/
private String purpose;
/**
* 1出租 0自住 2闲置 3未出售
*/
private Integer rentFlag;
/**
* 房主姓名
*/
private String ownerName;
/**
* 房主电话
*/
private String ownerPhone;
/**
* 房主身份证号
*/
private String ownerIdCard;
/**
* 排序
*/
private BigDecimal sort;
/**
* 备注
*/
private String remark;
/**
* 房屋编码
*/
private String houseCode;
private String houseQrcodeUrl;
/**
* 居住人数
*/
private Integer resiNumber;
/**
* 房屋可编辑编码
*/
private String coding;
}

6
epmet-module/gov-org/gov-org-server/pom.xml

@ -147,6 +147,12 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-third-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

148
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java

@ -17,31 +17,35 @@
package com.epmet.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.RequirePermission;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.enums.EnvEnum;
import com.epmet.commons.tools.enums.CollectUrlEnum;
import com.epmet.commons.tools.enums.RequirePermissionEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.BarcodeUtils;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.CustomerAgencyConstant;
import com.epmet.constant.OrgInfoConstant;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.OssFeignClient;
import com.epmet.resi.group.dto.QRCodeMultipartFileDTO;
import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.AgencyService;
import com.epmet.service.CustomerAgencyService;
import com.epmet.service.IcNeighborHoodService;
import com.epmet.utils.ThirdUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
@ -56,9 +60,9 @@ import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -82,6 +86,8 @@ public class AgencyController {
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Autowired
private IcNeighborHoodService neighborHoodService;
@Autowired
private OssFeignClient ossFeignClient;
/**
* @param formDTO
@ -400,45 +406,60 @@ public class AgencyController {
public void createQrCode(@LoginUser TokenDto tokenDto, @RequestBody CreateQrCodeFormDTO formDTO, HttpServletResponse response) {
ValidatorUtils.validateEntity(formDTO, CreateQrCodeFormDTO.CreateQrCodeForm.class);
String id = formDTO.getId();
String type = formDTO.getType();
String name = "";
if(!formDTO.getType().equals(OrgInfoConstant.COMMUNITY)){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "只可生成社区码");
}
try {
if (type.equals(OrgInfoConstant.COMMUNITY)) {
CustomerAgencyDTO customerAgencyDTO = customerAgencyService.get(id);
if (customerAgencyDTO == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "组织信息不存在");
}
name = customerAgencyDTO.getOrganizationName();
} else if (type.equals(OrgInfoConstant.NEIGHBOR_HOOD)) {
IcNeighborHoodDTO icNeighborHoodDTO = neighborHoodService.get(id);
if (icNeighborHoodDTO == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "小区信息不存在");
//获取AccessToken
String accessToken = ThirdUtils.getAccessToken(tokenDto.getCustomerId()).getResiToken();
if (org.apache.commons.lang3.StringUtils.isBlank(accessToken)) {
log.warn("获取accessToken失败,customerId:{}", tokenDto.getCustomerId());
throw new RenException("获取accessToken失败,customerId:{}", tokenDto.getCustomerId());
}
CustomerAgencyDTO customerAgencyDTO = customerAgencyService.get(id);
if (customerAgencyDTO == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "组织信息不存在");
}
name = customerAgencyDTO.getOrganizationName();
//url组成:信息采集地址?社区id
StringBuilder path = new StringBuilder(CollectUrlEnum.URL_PRE.getCode());
path.append("?agencyId=").append(formDTO.getId());
//需要发送的Json
JSONObject data = new JSONObject();
data.put("path", path.toString());
data.put("width", 400);
//发送
byte[] buffer = HttpClientManager.getInstance().getMediaByteArray(CollectUrlEnum.GET_CODE_URL.getCode() + accessToken, JSON.toJSONString(data)).getData();
if (buffer != null && buffer.length < 500) {
String wxResult = "";
wxResult = new String(buffer, StandardCharsets.UTF_8);
if (-1 != wxResult.indexOf("errcode")) {
log.error("获取二维码接口返回错误:{}", wxResult);
throw new RenException("获取二维码失败");
}
name = icNeighborHoodDTO.getNeighborHoodName();
}
//url组成:数字社区地址?小区id&用户id
//String url = "https://demo.tduckapp.com/s/7314b64b3a26455ab793fb8c640856b6?id="+id;
String url = EnvEnum.getCurrentEnv().getUrl()
.replace("cloud", "open")
.replace("api/", StrConstant.EPMETY_STR)
.concat("epmet-oper-gov/#/caiji/")
.concat(id).concat("?")
.concat("name=").concat(URLEncoder.encode(name, StrConstant.UTF_8)).concat(StrConstant.AND_MARK)
.concat("customerId=").concat(tokenDto.getCustomerId()).concat(StrConstant.AND_MARK)
.concat("type=").concat(type).concat(StrConstant.AND_MARK)
.concat("userId=").concat(tokenDto.getUserId())
.concat(StrConstant.AND_MARK).concat(String.valueOf(LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli()));
BufferedImage image = BarcodeUtils.drawQRImage(name, url);
//BufferedImage 转 InputStream
//上传
QRCodeMultipartFileDTO qrCodeMultipartFile = new QRCodeMultipartFileDTO();
qrCodeMultipartFile.setBytes(buffer);
String originalFilename = name.concat(".jpg");
qrCodeMultipartFile.setOriginalFilename(originalFilename);
Result<UploadImgResultDTO> uploadResult = ossFeignClient.uploadQrCode(qrCodeMultipartFile);
if (!uploadResult.success()) {
throw new RenException("调用oss服务上传活动居民信息录入码失败");
}
URL url = new URL(uploadResult.getData().getUrl());
BufferedImage img = ImageIO.read(url);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
ImageOutputStream imageOutput = ImageIO.createImageOutputStream(byteArrayOutputStream);
ImageIO.write(image, "png", imageOutput);
ImageIO.write(img, "png", imageOutput);
InputStream inputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
long length = imageOutput.length();
String fileName = name + ".png";
response.setContentType("application/octet-stream");
response.setContentLength((int) length);
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, StrConstant.UTF_8));
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(originalFilename, StrConstant.UTF_8));
//输出流
byte[] bytes = new byte[1024];
@ -450,10 +471,69 @@ public class AgencyController {
outputStream.write(bytes, 0, len);
}
outputStream.flush();
} catch (Exception e) {
log.error("method exception", e);
}
}
// @PostMapping("create-qrcode")
// public void createQrCode(@LoginUser TokenDto tokenDto, @RequestBody CreateQrCodeFormDTO formDTO, HttpServletResponse response) {
// ValidatorUtils.validateEntity(formDTO, CreateQrCodeFormDTO.CreateQrCodeForm.class);
// String id = formDTO.getId();
// String type = formDTO.getType();
// String name = "";
// try {
// if (type.equals(OrgInfoConstant.COMMUNITY)) {
// CustomerAgencyDTO customerAgencyDTO = customerAgencyService.get(id);
// if (customerAgencyDTO == null) {
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "组织信息不存在");
// }
// name = customerAgencyDTO.getOrganizationName();
// } else if (type.equals(OrgInfoConstant.NEIGHBOR_HOOD)) {
// IcNeighborHoodDTO icNeighborHoodDTO = neighborHoodService.get(id);
// if (icNeighborHoodDTO == null) {
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "小区信息不存在");
// }
// name = icNeighborHoodDTO.getNeighborHoodName();
// }
// //url组成:数字社区地址?小区id&用户id
// //String url = "https://demo.tduckapp.com/s/7314b64b3a26455ab793fb8c640856b6?id="+id;
// String url = EnvEnum.getCurrentEnv().getUrl()
// .replace("cloud", "open")
// .replace("api/", StrConstant.EPMETY_STR)
// .concat("epmet-oper-gov/#/caiji/")
// .concat(id).concat("?")
// .concat("name=").concat(URLEncoder.encode(name, StrConstant.UTF_8)).concat(StrConstant.AND_MARK)
// .concat("customerId=").concat(tokenDto.getCustomerId()).concat(StrConstant.AND_MARK)
// .concat("type=").concat(type).concat(StrConstant.AND_MARK)
// .concat("userId=").concat(tokenDto.getUserId())
// .concat(StrConstant.AND_MARK).concat(String.valueOf(LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli()));
// BufferedImage image = BarcodeUtils.drawQRImage(name, 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 = name + ".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);
// }
// }
/**
* Desc: 查询工作人员所属组织下的所有社区

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

@ -200,6 +200,34 @@ public class HouseController implements ResultDataResolver {
return new Result();
}
/**
* 信息登记更新房屋信息
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author wgf
* @date 2022/8/3 11:16
*/
@NoRepeatSubmit
@PostMapping("updateCollect")
public Result updateCollect(@RequestBody CollectHouseFormDTO formDTO) {
houseService.updateCollect(formDTO);
return new Result();
}
/**
* 获取房屋信息
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author wgf
* @date 2022/8/3 11:16
*/
@PostMapping("getHouseInfoToCollect")
public Result<IcHouseInfoCollectResultDTO> getHouseInfoToCollect(@RequestBody GetHouseInfoToCollectFormDTO formDTO) {
return houseService.getHouseInfoToCollect(formDTO);
}
/**
* lzh
*

14
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java

@ -141,4 +141,18 @@ public class NeighborHoodController {
TemplateExportParams templatePath = new TemplateExportParams("excel/neighbor_template.xlsx");
ExcelPoiUtils.exportExcel(templatePath ,new HashMap<>(),"小区信息录入表",response);
}
/**
* @describe: 批量生成小区二维码
* @author wangtong
* @date 2022/8/4 15:15
* @params [loginUser]
* @return com.epmet.commons.tools.utils.Result
*/
@NoRepeatSubmit
@PostMapping("createBatchNeiQrUrl")
public Result createBatchNeiQrUrl(@LoginUser TokenDto loginUser) {
return neighborHoodService.createBatchNeiQrUrl(loginUser.getCustomerId());
}
}

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

@ -2,6 +2,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.GetHouseInfoToCollectFormDTO;
import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerOrgParameterEntity;
@ -192,4 +193,12 @@ public interface IcHouseDao extends BaseDao<IcHouseEntity> {
* @params [coding]
*/
IcHouseEntity selectByCoding(@Param("coding") String coding);
/**
* 获取房屋信息
* @param formDTO
* @return
*/
IcHouseInfoCollectResultDTO getHouseInfoToCollect(GetHouseInfoToCollectFormDTO formDTO);
}

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

@ -116,4 +116,9 @@ public class IcNeighborHoodEntity extends BaseEpmetEntity {
* 实有楼栋数
*/
private Integer realBuilding;
/**
* 二维码地址
*/
private String qrcodeUrl;
}

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

@ -43,6 +43,7 @@ public interface HouseService {
void updateHouse(String customerId, IcHouseAddFormDTO formDTO);
void updateCollect(CollectHouseFormDTO formDTO);
/**
* Desc: 房屋变更记录
@ -54,6 +55,16 @@ public interface HouseService {
*/
void houseChangeRecord(String houseId, String customerId, IcHouseDTO houseDTO);
/**
* Desc: 房屋变更记录(信息登记)
* @param houseId
* @param customerId
* @param houseDTO
* @author wgf
* @date 2022/5/10 10:57
*/
void houseChangeRecordCollect(String houseId, String customerId, IcHouseDTO houseDTO);
/**
* 小寨子社区-合同签订后变更成出租状态
*
@ -175,4 +186,11 @@ public interface HouseService {
Result getHomeInfoByHouseCode(HouseInfoFormDTO dto);
void orgIdPathInit();
/**
* 获取房屋信息
* @param formDTO
* @return
*/
Result<IcHouseInfoCollectResultDTO> getHouseInfoToCollect(GetHouseInfoToCollectFormDTO formDTO);
}

10
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java

@ -18,6 +18,7 @@
package com.epmet.service;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.form.IcNeighborHoodAddFormDTO;
import com.epmet.dto.form.IcNeighborHoodListFormDTO;
@ -51,4 +52,13 @@ public interface NeighborHoodService{
* @param response
*/
void exportNeighborhoodinfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception ;
/**
* @describe: 批量生成小区二维码
* @author wangtong
* @date 2022/8/4 15:18
* @params [customerId]
* @return com.epmet.commons.tools.utils.Result
*/
Result createBatchNeiQrUrl(String customerId);
}

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

@ -244,6 +244,30 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
icHouseRedis.delHouseInfo(formDTO.getHouseId(), customerId);
}
/**
* 更新房屋信息登记
*
* @param
* @param formDTO
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void updateCollect(CollectHouseFormDTO formDTO) {
IcHouseEntity entity = new IcHouseEntity();
entity.setId(formDTO.getId());
entity.setRentFlag(formDTO.getRentFlag());
entity.setOwnerName(formDTO.getOwnerName());
entity.setResiNumber(formDTO.getResiNumber());
// 更新变更记录
IcHouseDTO icHouseDTO = ConvertUtils.sourceToTarget(formDTO, IcHouseDTO.class);
houseChangeRecordCollect(formDTO.getId(), formDTO.getCustomerId(), icHouseDTO);
icHouseDao.updateById(entity);
//删除房屋缓存
icHouseRedis.delHouseInfo(formDTO.getId(), entity.getCustomerId());
}
/**
* Desc: 房屋变更记录
*
@ -337,6 +361,64 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
}
}
/**
* Desc: 房屋变更记录(信息登记)
*
* @param houseId
* @param customerId
* @param houseDTO
* @author wgf
* @date 2022/5/10 10:57
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void houseChangeRecordCollect(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) {
throw new EpmetException("不存在此房屋...");
}
StringBuilder sbBefore = new StringBuilder();
StringBuilder sbAfter = new StringBuilder();
List<IcHouseChangeDetailEntity> entityList = new ArrayList<>();
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();
e.setChangeCol(HouseChangeEnums.RENT_FLAG.getColumn());
e.setChangeAfter(null == houseDTO.getRentName() ? HouseRentFlagEnums.getTypeValue(houseDTO.getRentFlag()) : houseDTO.getRentName());
e.setChangeBefore(HouseRentFlagEnums.getTypeValue(entity.getRentFlag()));
entityList.add(e);
}
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();
e.setChangeCol(HouseChangeEnums.OWNER_NAME.getColumn());
e.setChangeAfter(StringUtils.isNotBlank(houseDTO.getOwnerName()) ? houseDTO.getOwnerName() : "无");
e.setChangeBefore(StringUtils.isNotBlank(entity.getOwnerName()) ? entity.getOwnerName() : "无");
entityList.add(e);
}
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);
IcHouseChangeRecordEntity recordEntity = ConvertUtils.sourceToTarget(houseAgencyInfo, IcHouseChangeRecordEntity.class);
recordEntity.setCustomerId(customerId);
recordEntity.setChangeBefore(before);
recordEntity.setChangeAfter(after);
changeRecordService.insert(recordEntity);
entityList.forEach(e -> {
e.setCustomerId(customerId);
e.setRecordId(recordEntity.getId());
});
changeDetailService.insertBatch(entityList);
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update2Rent(RentHouseFormDTO formDTO) {
@ -1220,4 +1302,12 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
}
recureAppendParentAgencyId(pid, result);
}
@Override
public Result<IcHouseInfoCollectResultDTO> getHouseInfoToCollect(GetHouseInfoToCollectFormDTO formDTO) {
IcHouseInfoCollectResultDTO icHouseInfoCollectResultDTO = icHouseDao.getHouseInfoToCollect(formDTO);
return new Result<IcHouseInfoCollectResultDTO>().ok(icHouseInfoCollectResultDTO);
}
}

103
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java

@ -1,20 +1,22 @@
package com.epmet.service.impl;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.enums.CollectUrlEnum;
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.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.NeighborhoodConstant;
import com.epmet.dao.CustomerGridDao;
import com.epmet.dao.IcNeighborHoodDao;
import com.epmet.dao.IcNeighborHoodPropertyDao;
import com.epmet.dao.IcOrganizationCodeInfoDao;
import com.epmet.dao.*;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.IcNeighborHoodPropertyDTO;
@ -24,18 +26,19 @@ import com.epmet.dto.form.IcNeighborHoodListFormDTO;
import com.epmet.dto.form.IcUserBelongToChangedFormDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.dto.result.OrganizationCommunityDTO;
import com.epmet.entity.IcHouseEntity;
import com.epmet.entity.IcNeighborHoodEntity;
import com.epmet.entity.IcNeighborHoodPropertyEntity;
import com.epmet.entity.IcOrganizationCodeInfoEntity;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.entity.*;
import com.epmet.enums.OrganizationTypeEnums;
import com.epmet.excel.IcNeighborHoodExcel;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.OssFeignClient;
import com.epmet.resi.group.dto.QRCodeMultipartFileDTO;
import com.epmet.service.IcNeighborHoodPropertyService;
import com.epmet.service.IcNeighborHoodService;
import com.epmet.service.NeighborHoodService;
import com.epmet.util.ExcelPoiUtils;
import com.epmet.utils.ThirdUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
@ -46,6 +49,7 @@ import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -73,6 +77,10 @@ public class NeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao,I
private IcOrganizationCodeInfoDao icOrganizationCodeInfoDao;
@Autowired
private IcOrganizationCodeInfoServiceImpl icOrganizationCodeInfoServiceImpl;
@Autowired
private OssFeignClient ossFeignClient;
@Autowired
private CustomerAgencyDao customerAgencyDao;
@Override
@ -113,6 +121,63 @@ public class NeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao,I
icNeighborHoodPropertyDTO.setPropertyId(propertyId);
icNeighborHoodPropertyService.save(icNeighborHoodPropertyDTO);
}
//生成小区码
IcNeighborHoodEntity neiEntity = new IcNeighborHoodEntity();
neiEntity.setId(entity.getId());
try {
neiEntity.setQrcodeUrl(createNeiQrcodeUrl(entity));
} catch (Exception e) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"二维码生成失败","二维码生成失败");
}
baseDao.updateById(neiEntity);
}
/**
* @describe: 生成小区二维码地址
* @author wangtong
* @date 2022/8/4 14:28
* @params [NeighborHood]
* @return java.lang.String
*/
private String createNeiQrcodeUrl(IcNeighborHoodEntity entity) throws Exception {
if (null == entity) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "小区不可为空", "小区不可为空");
}
//获取AccessToken
String accessToken = ThirdUtils.getAccessToken(entity.getCustomerId()).getResiToken();
if (org.apache.commons.lang3.StringUtils.isBlank(accessToken)) {
log.warn("获取accessToken失败,customerId:{}", entity.getCustomerId());
throw new RenException("获取accessToken失败,customerId:{}", entity.getCustomerId());
}
//跳转的页面
StringBuilder path = new StringBuilder(CollectUrlEnum.URL_PRE.getCode());
path.append("?neiId=").append(entity.getId())
.append("&agencyId=").append(entity.getAgencyId());
//需要发送的Json
JSONObject data = new JSONObject();
data.put("path", path.toString());
data.put("width", 400);
//发送
byte[] buffer = HttpClientManager.getInstance().getMediaByteArray(CollectUrlEnum.GET_CODE_URL.getCode() + accessToken, JSON.toJSONString(data)).getData();
if (buffer != null && buffer.length < 500) {
String wxResult = "";
wxResult = new String(buffer, StandardCharsets.UTF_8);
if (-1 != wxResult.indexOf("errcode")) {
log.error("获取二维码接口返回错误:{}", wxResult);
throw new RenException("获取二维码失败");
}
}
//上传
QRCodeMultipartFileDTO qrCodeMultipartFile = new QRCodeMultipartFileDTO();
qrCodeMultipartFile.setBytes(buffer);
String originalFilename = entity.getNeighborHoodName().concat(".jpg");
qrCodeMultipartFile.setOriginalFilename(originalFilename);
Result<UploadImgResultDTO> uploadResult = ossFeignClient.uploadQrCode(qrCodeMultipartFile);
if (!uploadResult.success()) {
throw new RenException("调用oss服务上传活动居民信息录入码失败");
}
return uploadResult.getData().getUrl();
}
/**
@ -271,6 +336,28 @@ public class NeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao,I
ExcelPoiUtils.exportExcel(templatePath ,map,"小区信息录入表",response);
}
@Override
public Result createBatchNeiQrUrl(String customerId) {
//查询该客户下没有二维码的小区
QueryWrapper<IcNeighborHoodEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(IcNeighborHoodEntity::getCustomerId,customerId)
.eq(IcNeighborHoodEntity::getDelFlag, NumConstant.ZERO_STR);;
List<IcNeighborHoodEntity> neiList = baseDao.selectList(queryWrapper);
//保存二维码地址
neiList.forEach(nei->{
if(org.apache.commons.lang3.StringUtils.isBlank(nei.getQrcodeUrl())){
try {
nei.setQrcodeUrl(createNeiQrcodeUrl(nei));
} catch (Exception e) {
e.printStackTrace();
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"二维码生成失败<neiId>:"+nei.getId(),"二维码生成失败<neiId>:"+nei.getId());
}
}
baseDao.updateById(nei);
});
return new Result().ok("批量生成成功");
}
private List<IcNeighborHoodExcel> searchAllNeighborhood(IcHouseListFormDTO formDTO) {
IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class);
neighbor.setDelFlag("0");

1
epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.41__ic_neighbor_hood_update.sql

@ -0,0 +1 @@
alter table ic_neighbor_hood add COLUMN `QRCODE_URL` varchar(255) DEFAULT NULL COMMENT '二维码地址';

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

@ -541,5 +541,13 @@
and CODING=#{coding}
</select>
<select id="getHouseInfoToCollect" resultType="com.epmet.dto.result.IcHouseInfoCollectResultDTO">
select *
from ic_house
where del_flag = '0'
and BUILDING_UNIT_ID = #{buildingUnitId}
and DOOR_NAME = #{doorName}
</select>
</mapper>

144
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiCollectVisitorDTO.java

@ -0,0 +1,144 @@
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 居民信息采集-访客
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-02
*/
@Data
public class IcResiCollectVisitorDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 目的地
*/
private String address;
/**
* 客户Id customer.id
*/
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* 组织Id
*/
private String agencyId;
/**
* 组织的pids
*/
private String pids;
/**
* 所属小区ID
*/
private String villageId;
/**
* 所属小区名称
*/
private String villageName;
/**
* 所属楼宇Id
*/
private String buildId;
/**
* 所属楼宇名称
*/
private String buildName;
/**
* 单元id
*/
private String unitId;
/**
* 单元名
*/
private String unitName;
/**
* 所属家庭Id
*/
private String homeId;
/**
* 房间名
*/
private String homeName;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 身份证号
*/
private String idCard;
/**
* 来访事由
*/
private String comeReason;
/**
* 人脸照片
*/
private String faceImg;
/**
* 删除标识 0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

122
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/SaveCollectVisitorFormDTO.java

@ -0,0 +1,122 @@
package com.epmet.dto;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 居民信息采集-访客
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-02
*/
@Data
public class SaveCollectVisitorFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 客户Id customer.id
*/
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* 组织Id
*/
private String agencyId;
/**
* 组织的pids
*/
private String pids;
/**
* 所属小区ID
*/
@NotBlank(message = "小区ID不能为空")
private String villageId;
/**
* 所属小区名称
*/
@NotBlank(message = "小区名称不能为空")
private String villageName;
/**
* 所属楼宇Id
*/
@NotBlank(message = "楼宇Id不能为空")
private String buildId;
/**
* 所属楼宇名称
*/
@NotBlank(message = "楼宇名称不能为空")
private String buildName;
/**
* 单元id
*/
@NotBlank(message = "单元id不能为空")
private String unitId;
/**
* 单元名
*/
@NotBlank(message = "单元名不能为空")
private String unitName;
/**
* 所属家庭Id
*/
@NotBlank(message = "家庭Id不能为空")
private String homeId;
/**
* 房间名
*/
@NotBlank(message = "房间名不能为空")
private String homeName;
/**
* 详细地址
*/
@NotBlank(message = "家庭地址不能为空")
private String address;
/**
* 姓名
*/
@NotBlank(message = "姓名不能为空")
private String name;
/**
* 手机号
*/
@NotBlank(message = "手机号不能为空")
private String mobile;
/**
* 身份证号
*/
private String idCard;
/**
* 来访事由
*/
private String comeReason;
/**
* 人脸照片
*/
private String faceImg;
}

20
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectDetailFormDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @program: epmet-cloud
* @description:
* @author: wangtong
* @create: 2022-08-03 14:15
**/
@Data
public class CollectDetailFormDTO extends PageFormDTO implements Serializable {
@NotBlank(message = "id不可为空")
private String id;
}

76
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectDetailResultDTO.java

@ -0,0 +1,76 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 收集居民信息入参
*/
@Data
public class CollectDetailResultDTO implements Serializable {
private String id;
/**
* 组织Id
*/
private String agencyId;
/**
* 所属小区ID
*/
private String villageId;
private String villageName;
/**
* 所属楼宇Id
*/
private String buildId;
private String buildName;
/**
* 单元id
*/
private String unitId;
private String unitName;
/**
* 所属家庭Id
*/
private String homeId;
private String homeName;
/**
* 详细地址
*/
private String address;
/**
* 房屋状态
*/
private String houseType;
/**
* 户主姓名
*/
private String houseHolderName;
/**
* 居住成员人数
*/
private Integer totalResi;
/**
* 审核状态0待审核 1未通过 2已通过
*/
private String checkState;
/**
* 审核原因
*/
private String checkReason;
private List<IcResiCollectMemDetailDTO> memberList;
}

20
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectPageFormDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import java.io.Serializable;
/**
* @program: epmet-cloud
* @description:
* @author: wangtong
* @create: 2022-08-03 14:15
**/
@Data
public class CollectPageFormDTO extends PageFormDTO implements Serializable {
private String customerId;
private String userId;
}

65
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectCheckFormDTO.java

@ -0,0 +1,65 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
/**
* 居民信息采集-审核入参
*
* @author wgf
* @since v1.0.0 2022-08-02
*/
@Data
public class IcResiCollectCheckFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@NotBlank(message = "Id不能为空")
private String id;
/**
* 审核状态0待审核 1未通过 2已通过
*/
@NotBlank(message = "审核状态不能为空")
private String checkState;
/**
* 审核原因
*/
private String checkReason;
/**
* 单元号
*/
private String buildingUnitId;
/**
* 房间号
*/
private String doorName;
/**
* 客户ID(审核人)
*/
private String customerId;
/**
* 员工ID(审核人)
*/
private String userId;
/**
* 员工姓名(审核人)
*/
private String realName;
}

28
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectGetDetailFormDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 居民信息采集-获取房屋信息
*
* @author wgf
* @since v1.0.0 2022-08-02
*/
@Data
public class IcResiCollectGetDetailFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@NotBlank(message = "Id不能为空")
private String id;
}

93
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemDetailDTO.java

@ -0,0 +1,93 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* 家庭成员信息
* 前端做校验
*/
@Data
public class IcResiCollectMemDetailDTO implements Serializable {
/**
* 居住成员1姓名
*/
// @NotBlank(message = "姓名不能为空", groups = {ResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class})
private String name;
/**
* 居住成员1身份证号
*/
// @NotBlank(message = "身份证号不能为空", groups = {ResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class})
private String idNum;
/**
* 居住成员1手机号
*/
// @NotBlank(message = "手机号不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class})
private String mobile;
/**
* 居住成员1是否参加几轮全员核算检测数字1-10
*/
// @NotBlank(message = "核算检测情况不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class})
private String heSuanCount;
/**
* 居住成员1新冠疫苗接种情况;1:已全程接种2未全程接种0未接种
*/
// @NotNull(message = "疫苗接种情况不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class})
private Integer ymjz;
/**
* 户籍所在地
*/
private String domicilePlace;
/**
* 户籍所在地行政地区编码
*/
private String domicilePlaceCode;
/**
* 户籍所在地行政地区编码全路径包含自己,英文逗号隔开例如37,3702,370203
*/
private String domicilePlaceCodePath;
/**
* 学校或公司
*/
private String workPlace;
/**
* 备注
*/
private String remark;
/**
* 社区居民信息登记-查询返参用
*/
private String id;
/**
* 与房主关系
*/
private String relationship;
/**
* 人脸头像
*/
private String faceImg;
/**
* 是否是党员
*/
private String isParty;
/**
* 客户ID
*/
private String customerId;
}

11
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java

@ -73,4 +73,15 @@ public class IcResiCollectMemFormDTO implements Serializable {
* 社区居民信息登记-查询返参用
*/
private String id;
/**
* 与房主关系
*/
private String relationship;
/**
* 人脸头像
*/
private String faceImg;
}

105
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SaveCollectFormDTO.java

@ -0,0 +1,105 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* 收集居民信息入参
*/
@Data
public class SaveCollectFormDTO implements Serializable {
/**
* id
*/
private String id;
/**
* 客户Id customer.id
*/
private String customerId;
/**
* 内部internal外部external
*/
private String origin;
/**
* 网格ID_后端接口赋值
*/
private String gridId;
/**
* 组织Id_后端接口赋值
*/
private String agencyId;
/**
* 组织的pid_后端接口赋值
*/
private String pids;
/**
* 所属小区ID
*/
@NotBlank(message = "小区不能为空")
private String villageId;
@NotBlank(message = "小区名不能为空")
private String villageName;
/**
* 所属楼宇Id
*/
@NotBlank(message = "楼栋不能为空")
private String buildId;
@NotBlank(message = "楼栋名不能为空")
private String buildName;
/**
* 单元id
*/
@NotBlank(message = "单元不能为空")
private String unitId;
@NotBlank(message = "单元名不能为空")
private String unitName;
/**
* 所属家庭Id
*/
private String homeId;
@NotBlank(message = "家庭名不能为空")
private String homeName;
/**
* 详细地址
*/
@NotBlank(message = "家庭地址不能为空")
private String address;
/**
* 1自有0租住
*/
@NotBlank(message = "房子属于自有还是租住?")
private String houseType;
/**
* 户主姓名
*/
@NotBlank(message = "户主姓名不能为空")
private String houseHolderName;
/**
* 居住成员人数
*/
@NotNull(message = "居住成员人数不能为空")
private Integer totalResi;
@NotEmpty(message = "成员信息不能为空")
private List<IcResiCollectMemFormDTO> memberList;
}

26
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VisitListFormDTO.java

@ -0,0 +1,26 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
/**
* @Author wgf
* @DateTime 2022/8/5 8:00
* @DESC
*/
@Data
public class VisitListFormDTO extends PageFormDTO {
private static final long serialVersionUID = 2106773724057183577L;
private String startTime;
private String endTime;
private String userId;
private String customerId;
private String orgId;
}

57
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectHouseInfoResultDTO.java

@ -0,0 +1,57 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author wgf
* @DateTime 2022/3/18 19:00
* @DESC
*/
@Data
public class CollectHouseInfoResultDTO implements Serializable {
private static final long serialVersionUID = -6692672375850864451L;
/**
* label
*/
private String label;
/**
* 所属小区id
*/
private String neighborHoodId;
/**
* 所属小区姓名
*/
private String neighborHoodName;
/**
* 所属楼栋id
*/
private String buildingId;
/**
* 所属楼栋名称
*/
private String buildName;
/**
* 所属单元id
*/
private String buildingUnitId;
/**
* 所属单元名称
*/
private String buildingUnitName;
/**
* 门牌号
*/
private String doorName;
/**
* 房主姓名
*/
private String ownerName;
}

23
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java

@ -24,6 +24,9 @@ public class CollectListResultDTO implements Serializable {
// @JsonIgnore
private String id;
// 组织Id
private String agencyId;
/**
* 居住地址
*/
@ -39,6 +42,16 @@ public class CollectListResultDTO implements Serializable {
*/
private Integer totalResi;
/**
* 所属家庭Id
*/
private String homeId;
/**
* 审核状态0待审核 1审核不通过 2审核通过
*/
private String checkState;
private String domicilePlace;
private List<CollectListMemberResultDTO> list;
@ -95,5 +108,15 @@ public class CollectListResultDTO implements Serializable {
* 备注
*/
private String remark;
/**
* 与户主关系
*/
private String relationship;
/**
* 人脸照片
*/
private String faceImg;
}
}

56
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectPageListDTO.java

@ -0,0 +1,56 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/3/18 19:00
* @DESC
*/
@Data
public class CollectPageListDTO implements Serializable {
private static final long serialVersionUID = -6692672375850864451L;
private String id;
/**
* 居住地址
*/
private String address;
/**
* 居民resi 访客visitor
*/
private String type;
/**
* 居民登记/访客登记
*/
private String title;
/**
* 审核状态0待审核 1审核不通过 2审核通过
*/
private String checkState;
/**
* 审核状态名称
*/
private String checkStateName;
/**
* 审核原因
*/
private String checkReason;
/**
* 提交时间
*/
private String createTime;
}

82
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java

@ -10,14 +10,8 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.CollectListFormDTO;
import com.epmet.dto.form.IcResiCollectFormDTO;
import com.epmet.dto.form.LatestSubmitCollectFormDTO;
import com.epmet.dto.form.ResiCollectFormDTO;
import com.epmet.dto.result.CollectListExcelResultDTO;
import com.epmet.dto.result.CollectListMemberExcelResultDTO;
import com.epmet.dto.result.CollectListResultDTO;
import com.epmet.dto.result.LatestCollectResDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.service.IcResiCollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -156,4 +150,76 @@ public class IcResiCollectController {
ValidatorUtils.validateEntity(formDTO,LatestSubmitCollectFormDTO.AddUserInternalGroup.class);
return new Result<LatestCollectResDTO>().ok(icResiCollectService.latestSubmit(formDTO));
}
/**
* 信息采集-审核
* @param formDTO
* @param tokenDto
* @return
*/
@PostMapping("collectCheck")
public Result collectCheck(@RequestBody IcResiCollectCheckFormDTO formDTO, @LoginUser TokenDto tokenDto) {
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
icResiCollectService.collectCheck(formDTO,tokenDto);
return new Result();
}
/**
* @describe: 扫描社区/小区二维码进行居民信息登记
* @author wangtong
* @date 2022/8/2 16:01
* @params [formDTO]
* @return com.epmet.commons.tools.utils.Result
*/
@NoRepeatSubmit
@PostMapping("saveCollectInfo")
public Result saveCollectInfo(@RequestBody SaveCollectFormDTO formDTO) {
//效验数据
ValidatorUtils.validateEntity(formDTO);
formDTO.setOrigin("internal");//固定为内部
return icResiCollectService.saveCollectInfo(formDTO);
}
/**
* @describe: 我的登记列表
* @author wangtong
* @date 2022/8/3 13:59
* @params [dto]
* @return com.epmet.commons.tools.utils.Result<com.epmet.commons.tools.page.PageData<com.epmet.dto.result.CollectPageListDTO>>
*/
@PostMapping("getCollectPage")
public Result<PageData<CollectPageListDTO>> getCollectPage(@LoginUser TokenDto tokenDto,@RequestBody CollectPageFormDTO dto) {
dto.setUserId(tokenDto.getUserId());
dto.setCustomerId(tokenDto.getCustomerId());
PageData<CollectPageListDTO> page = icResiCollectService.getCollectPage(dto);
return new Result<PageData<CollectPageListDTO>>().ok(page);
}
/**
* 信息采集-审核通过-新增房屋-复显房屋信息
* @param formDTO
* @param tokenDto
* @return
*/
@PostMapping("getHouseDetailByCollect")
public Result<CollectHouseInfoResultDTO> getHouseDetailByCollect(@RequestBody IcResiCollectGetDetailFormDTO formDTO, @LoginUser TokenDto tokenDto) {
return new Result<CollectHouseInfoResultDTO>().ok(icResiCollectService.getHouseDetailByCollect(formDTO));
}
/**
* @describe: 查看居民采集信息详情
* @author wangtong
* @date 2022/8/3 15:05
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("getCollectDetail")
public Result getCollectDetail(@RequestBody CollectDetailFormDTO dto) {
ValidatorUtils.validateEntity(dto);
return icResiCollectService.getCollectDetail(dto);
}
}

137
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectVisitorController.java

@ -0,0 +1,137 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.MaskResponse;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
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.IcResiCollectVisitorDTO;
import com.epmet.dto.SaveCollectVisitorFormDTO;
import com.epmet.dto.form.CollectDetailFormDTO;
import com.epmet.dto.form.CollectListFormDTO;
import com.epmet.dto.form.VisitListFormDTO;
import com.epmet.dto.result.CollectListResultDTO;
import com.epmet.excel.IcResiCollectVisitorExcel;
import com.epmet.service.IcResiCollectVisitorService;
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-08-02
*/
@RestController
@RequestMapping("icResiCollectVisitor")
public class IcResiCollectVisitorController {
@Autowired
private IcResiCollectVisitorService icResiCollectVisitorService;
@RequestMapping("page")
public Result<PageData<IcResiCollectVisitorDTO>> page(@RequestParam Map<String, Object> params){
// PageData<IcResiCollectVisitorDTO> page = icResiCollectVisitorService.page(params);
PageData<IcResiCollectVisitorDTO> page = icResiCollectVisitorService.getPhrasePage(params);
return new Result<PageData<IcResiCollectVisitorDTO>>().ok(page);
}
/**
* Desc: 访客记录列表
* @param formDTO
* @param tokenDto
* @author wgf
* @date 2022/8/5 8:23
*/
@PostMapping("list")
// @MaskResponse(fieldNames = { "memberIdNum", "memberMobile" },
// fieldsMaskType = { MaskResponse.MASK_TYPE_ID_CARD, MaskResponse.MASK_TYPE_MOBILE })
public Result<PageData<IcResiCollectVisitorDTO>> getVisitorList(@RequestBody VisitListFormDTO formDTO, @LoginUser TokenDto tokenDto){
ValidatorUtils.validateEntity(formDTO,CollectListFormDTO.CollectListForm.class);
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<PageData<IcResiCollectVisitorDTO>>().ok(icResiCollectVisitorService.getVisitorList(formDTO));
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<IcResiCollectVisitorDTO> get(@PathVariable("id") String id){
IcResiCollectVisitorDTO data = icResiCollectVisitorService.get(id);
return new Result<IcResiCollectVisitorDTO>().ok(data);
}
@NoRepeatSubmit
@PostMapping("save")
public Result save(@RequestBody IcResiCollectVisitorDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icResiCollectVisitorService.save(dto);
return new Result();
}
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody IcResiCollectVisitorDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icResiCollectVisitorService.update(dto);
return new Result();
}
@PostMapping("delete")
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
icResiCollectVisitorService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<IcResiCollectVisitorDTO> list = icResiCollectVisitorService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, IcResiCollectVisitorExcel.class);
}
/**
* @describe: 保存访客信息
* @author wangtong
* @date 2022/8/3 10:33
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
@NoRepeatSubmit
@PostMapping("saveInfo")
public Result saveInfo(@RequestBody SaveCollectVisitorFormDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto);
return icResiCollectVisitorService.saveInfo(dto);
}
/**
* @describe: 访客信息详情
* @author wangtong
* @date 2022/8/3 15:41
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("getVisitorDetail")
public Result getVisitorDetail(@RequestBody CollectDetailFormDTO dto) {
ValidatorUtils.validateEntity(dto);
return icResiCollectVisitorService.getVisitorDetail(dto);
}
}

21
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java

@ -2,7 +2,10 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.CollectListFormDTO;
import com.epmet.dto.form.IcResiCollectGetDetailFormDTO;
import com.epmet.dto.result.CollectHouseInfoResultDTO;
import com.epmet.dto.result.CollectListResultDTO;
import com.epmet.dto.result.CollectPageListDTO;
import com.epmet.entity.IcResiCollectEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -43,4 +46,20 @@ public interface IcResiCollectDao extends BaseDao<IcResiCollectEntity> {
* @return
*/
List<String> selectLastSubmitId(@Param("customerId") String customerId, @Param("userId") String userId);
}
/**
* @describe: 我的登记列表
* @author wangtong
* @date 2022/8/3 14:19
* @params [customerId]
* @return java.util.List<com.epmet.dto.result.CollectPageListDTO>
*/
List<CollectPageListDTO> getCollectPage(@Param("customerId") String customerId, @Param("userId") String userId);
/**
* 获取房屋信息
* @param formDTO
* @return
*/
CollectHouseInfoResultDTO getHouseDetailByCollect(IcResiCollectGetDetailFormDTO formDTO);
}

38
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectVisitorDao.java

@ -0,0 +1,38 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcResiCollectVisitorDTO;
import com.epmet.dto.form.CollectListFormDTO;
import com.epmet.dto.form.VisitListFormDTO;
import com.epmet.dto.result.CollectListResultDTO;
import com.epmet.entity.IcResiCollectVisitorEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* 居民信息采集-访客
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-02
*/
@Mapper
public interface IcResiCollectVisitorDao extends BaseDao<IcResiCollectVisitorEntity> {
/**
* 条件查询
* @param params
* @return
*/
List<IcResiCollectVisitorDTO> getPhrasePage(Map<String, Object> params);
/**
* Desc: 查询访客信息
* @param formDTO
* @author wgf
* @date 2022/8/5 8:41
*/
List<IcResiCollectVisitorDTO> getCollectList(VisitListFormDTO formDTO);
}

11
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiMemberDao.java

@ -1,6 +1,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.IcResiCollectMemDetailDTO;
import com.epmet.dto.form.IcResiCollectMemFormDTO;
import com.epmet.entity.IcResiMemberEntity;
import org.apache.ibatis.annotations.Mapper;
@ -18,4 +19,12 @@ import java.util.List;
public interface IcResiMemberDao extends BaseDao<IcResiMemberEntity> {
List<IcResiCollectMemFormDTO> selectMySubmit(@Param("latestResiCollectId") String latestResiCollectId, @Param("userId")String userId);
}
/**
* 审核在用
* @param collectId
* @return
*/
List<IcResiCollectMemDetailDTO> selectListByCollectId(@Param("collectId") String collectId);
}

10
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectEntity.java

@ -86,4 +86,14 @@ public class IcResiCollectEntity extends BaseEpmetEntity {
private String buildName;
private String unitName;
private String homeName;
/**
* 审核状态0待审核 1未通过 2已通过
*/
private String checkState;
/**
* 审核原因
*/
private String checkReason;
}

111
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectVisitorEntity.java

@ -0,0 +1,111 @@
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-08-02
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_resi_collect_visitor")
public class IcResiCollectVisitorEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id customer.id
*/
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* 组织Id
*/
private String agencyId;
/**
* 组织的pids
*/
private String pids;
/**
* 所属小区ID
*/
private String villageId;
/**
* 所属小区名称
*/
private String villageName;
/**
* 所属楼宇Id
*/
private String buildId;
/**
* 所属楼宇名称
*/
private String buildName;
/**
* 单元id
*/
private String unitId;
/**
* 单元名
*/
private String unitName;
/**
* 所属家庭Id
*/
private String homeId;
/**
* 房间名
*/
private String homeName;
/**
* 详细地址
*/
private String address;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 身份证号
*/
private String idCard;
/**
* 来访事由
*/
private String comeReason;
/**
* 人脸照片
*/
private String faceImg;
}

10
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiMemberEntity.java

@ -77,4 +77,14 @@ public class IcResiMemberEntity extends BaseEpmetEntity {
* 备注
*/
private String remark;
/**
* 与房主关系
*/
private String relationship;
/**
* 人脸头像
*/
private String faceImg;
}

90
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiCollectVisitorExcel.java

@ -0,0 +1,90 @@
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-08-02
*/
@Data
public class IcResiCollectVisitorExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "客户Id customer.id")
private String customerId;
@Excel(name = "网格ID")
private String gridId;
@Excel(name = "组织Id")
private String agencyId;
@Excel(name = "组织的pids")
private String pids;
@Excel(name = "所属小区ID;")
private String villageId;
@Excel(name = "所属小区名称")
private String villageName;
@Excel(name = "所属楼宇Id")
private String buildId;
@Excel(name = "所属楼宇名称")
private String buildName;
@Excel(name = "单元id")
private String unitId;
@Excel(name = "单元名")
private String unitName;
@Excel(name = "所属家庭Id")
private String homeId;
@Excel(name = "房间名")
private String homeName;
@Excel(name = "姓名")
private String name;
@Excel(name = "手机号")
private String mobile;
@Excel(name = "身份证号")
private String idCard;
@Excel(name = "来访事由")
private String comeReason;
@Excel(name = "人脸照片")
private String faceImg;
@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;
}

25
epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java

@ -3,11 +3,10 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.CommonGridIdFormDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.form.OrgInfoPointFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.CommunityInfoResultDTO;
import com.epmet.dto.result.GridInfoResultDTO;
import com.epmet.dto.result.IcHouseInfoCollectResultDTO;
import com.epmet.feign.fallback.GovOrgFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
@ -85,4 +84,24 @@ public interface GovOrgFeignClient {
@GetMapping("/gov/org/customeragency/getCommunityInfoByUserId/{userId}")
Result<CommunityInfoResultDTO> getCommunityInfoByUserId(@PathVariable("userId") String userId);
/**
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.CommunityInfoResultDTO>
* @Author wgf
* @Description 更新房屋新
* @Date 2020/4/26 23:16
**/
@PostMapping("/gov/org/house/updateCollect")
Result<CommunityInfoResultDTO> updateCollect(CollectHouseFormDTO formDTO);
/**
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.CommunityInfoResultDTO>
* @Author wgf
* @Description 获取房屋信息
* @Date 2020/4/26 23:16
**/
@PostMapping("/gov/org/house/getHouseInfoToCollect")
Result<IcHouseInfoCollectResultDTO> getHouseInfoToCollect(GetHouseInfoToCollectFormDTO formDTO);
}

15
epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java

@ -4,11 +4,10 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.CommonGridIdFormDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.form.OrgInfoPointFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.CommunityInfoResultDTO;
import com.epmet.dto.result.GridInfoResultDTO;
import com.epmet.dto.result.IcHouseInfoCollectResultDTO;
import com.epmet.feign.GovOrgFeignClient;
import org.springframework.stereotype.Component;
@ -51,4 +50,14 @@ public class GovOrgFeignClientFallBack implements GovOrgFeignClient {
public Result<CommunityInfoResultDTO> getCommunityInfoByUserId(String userId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getCommunityInfoByUserId",userId);
}
@Override
public Result<CommunityInfoResultDTO> updateCollect(CollectHouseFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "updateCollect",formDTO);
}
@Override
public Result<IcHouseInfoCollectResultDTO> getHouseInfoToCollect(GetHouseInfoToCollectFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getHouseInfoToCollect",formDTO);
}
}

30
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcResiCollectVisitorRedis.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-08-02
*/
@Component
public class IcResiCollectVisitorRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

53
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiCollectService.java

@ -2,11 +2,12 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.form.CollectListFormDTO;
import com.epmet.dto.form.IcResiCollectFormDTO;
import com.epmet.dto.form.LatestSubmitCollectFormDTO;
import com.epmet.dto.form.ResiCollectFormDTO;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.*;
import com.epmet.dto.result.CollectHouseInfoResultDTO;
import com.epmet.dto.result.CollectListResultDTO;
import com.epmet.dto.result.CollectPageListDTO;
import com.epmet.dto.result.LatestCollectResDTO;
import com.epmet.entity.IcResiCollectEntity;
@ -56,4 +57,46 @@ public interface IcResiCollectService extends BaseService<IcResiCollectEntity> {
* @return
*/
CollectListResultDTO detail(CollectListFormDTO formDTO);
}
/**
* 信息登记审核
* @param formDTO
* @return
*/
void collectCheck(IcResiCollectCheckFormDTO formDTO, TokenDto tokenDto);
/**
* @describe: 扫描社区/小区二维码进行居民信息登记
* @author wangtong
* @date 2022/8/2 17:14
* @params [formDTO]
* @return com.epmet.commons.tools.utils.Result
*/
Result saveCollectInfo(SaveCollectFormDTO formDTO);
/**
* @describe: 我的登记列表
* @author wangtong
* @date 2022/8/3 14:14
* @params [dto]
* @return com.epmet.commons.tools.page.PageData<com.epmet.dto.result.CollectPageListDTO>
*/
PageData<CollectPageListDTO> getCollectPage(CollectPageFormDTO dto);
/**
* @describe: 查看居民采集信息详情
* @author wangtong
* @date 2022/8/3 15:08
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
Result getCollectDetail(CollectDetailFormDTO dto);
/**
* 信息采集-获取房屋信息
* @param formDTO
* @return
*/
CollectHouseInfoResultDTO getHouseDetailByCollect(IcResiCollectGetDetailFormDTO formDTO);
}

111
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiCollectVisitorService.java

@ -0,0 +1,111 @@
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.IcResiCollectVisitorDTO;
import com.epmet.dto.SaveCollectVisitorFormDTO;
import com.epmet.dto.form.CollectDetailFormDTO;
import com.epmet.dto.form.CollectListFormDTO;
import com.epmet.dto.form.VisitListFormDTO;
import com.epmet.dto.result.CollectListResultDTO;
import com.epmet.entity.IcResiCollectVisitorEntity;
import java.util.List;
import java.util.Map;
/**
* 居民信息采集-访客
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-02
*/
public interface IcResiCollectVisitorService extends BaseService<IcResiCollectVisitorEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IcResiCollectVisitorDTO>
* @author generator
* @date 2022-08-02
*/
PageData<IcResiCollectVisitorDTO> page(Map<String, Object> params);
/**
* 分页条件查询
* @param params
* @return
*/
PageData<IcResiCollectVisitorDTO> getPhrasePage(Map<String, Object> params);
PageData<IcResiCollectVisitorDTO> getVisitorList(VisitListFormDTO formDTO);
/**
* 默认查询
*
* @param params
* @return java.util.List<IcResiCollectVisitorDTO>
* @author generator
* @date 2022-08-02
*/
List<IcResiCollectVisitorDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return IcResiCollectVisitorDTO
* @author generator
* @date 2022-08-02
*/
IcResiCollectVisitorDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-08-02
*/
void save(IcResiCollectVisitorDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2022-08-02
*/
void update(IcResiCollectVisitorDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2022-08-02
*/
void delete(String[] ids);
/**
* @describe: 保存访客信息
* @author wangtong
* @date 2022/8/3 10:44
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
Result saveInfo(SaveCollectVisitorFormDTO dto);
/**
* @describe: 访客信息详情
* @author wangtong
* @date 2022/8/3 15:43
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
Result getVisitorDetail(CollectDetailFormDTO dto);
}

337
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java

@ -5,6 +5,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
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.RelationshipEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
@ -12,18 +13,24 @@ 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.GridInfoCache;
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.IcResiCollectDao;
import com.epmet.dao.IcResiMemberDao;
import com.epmet.dao.IcResiUserDao;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.CollectListResultDTO;
import com.epmet.dto.result.LatestCollectResDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.IcResiCollectEntity;
import com.epmet.entity.IcResiMemberEntity;
import com.epmet.entity.IcResiUserEntity;
import com.epmet.entity.IcUserChangeRecordEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.IcResiCollectService;
import com.epmet.service.IcUserChangeRecordService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
@ -51,6 +58,19 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao,
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private IcResiMemberDao icResiMemberDao;
@Autowired
private IcResiUserDao icResiUserDao;
@Autowired
private IcResiCollectDao icResiCollectDao;
@Autowired
private GovOrgFeignClient govOrgFeignClient;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private IcUserChangeRecordService icUserChangeRecordService;
@Override
@Transactional(rollbackFor = Exception.class)
@ -81,7 +101,7 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao,
List<IcResiMemberEntity> newMemberList = ConvertUtils.sourceToTarget(formDTO.getMemberList(), IcResiMemberEntity.class);
//查询之前录入的成员表
Map<String, IcResiMemberEntity> memMap = queryOriginMem(origin.getId());
saveOrUpdateMem(newMemberList, memMap,origin.getId());
saveOrUpdateMem(newMemberList, memMap,origin);
}
}
@ -130,7 +150,64 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao,
return null;
}
private IcNeighborHoodDTO queryIcNeighborHood(String villageId) {
@Override
@Transactional(rollbackFor = Exception.class)
public Result saveCollectInfo(SaveCollectFormDTO formDTO) {
if (StringUtils.isBlank(formDTO.getId())) {
//插入主表
IcResiCollectEntity entity = ConvertUtils.sourceToTarget(formDTO, IcResiCollectEntity.class);
//根据小区id查询网格相关信息
IcNeighborHoodDTO neighborHoodDTO = queryIcNeighborHood(formDTO.getVillageId());
entity.setGridId(neighborHoodDTO.getGridId());
entity.setAgencyId(neighborHoodDTO.getAgencyId());
entity.setPids(neighborHoodDTO.getAgencyPids());
entity.setCustomerId(neighborHoodDTO.getCustomerId());
entity.setCheckState("0");//待审核
baseDao.insert(entity);
//插入成员表
List<IcResiMemberEntity> memberList = ConvertUtils.sourceToTarget(formDTO.getMemberList(), IcResiMemberEntity.class);
memberList.forEach(mem -> {
if (StringUtils.isNotBlank(mem.getName()) || StringUtils.isNotBlank(mem.getIdNum())) {
//姓名或份身份证号不为空时插入
mem.setCustomerId(neighborHoodDTO.getCustomerId());
mem.setIcResiCollectId(entity.getId());
icResiMemberDao.insert(mem);
}
});
} else {
IcResiCollectEntity collectInfo = baseDao.selectByAddress(formDTO.getAddress());
//更新主表
baseDao.updateRec(collectInfo.getId(), formDTO.getHouseType(), formDTO.getHouseHolderName(), formDTO.getTotalResi(),null);
List<IcResiMemberEntity> newMemberList = ConvertUtils.sourceToTarget(formDTO.getMemberList(), IcResiMemberEntity.class);
//查询之前录入的成员表
Map<String, IcResiMemberEntity> memMap = queryOriginMem(collectInfo.getId());
saveOrUpdateMem(newMemberList, memMap,collectInfo);
}
return new Result().ok("提交成功");
}
@Override
public PageData<CollectPageListDTO> getCollectPage(CollectPageFormDTO dto) {
PageHelper.startPage(dto.getPageNo(), dto.getPageSize());
List<CollectPageListDTO> list = baseDao.getCollectPage(dto.getCustomerId(),dto.getUserId());
PageInfo<CollectPageListDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
}
@Override
public Result getCollectDetail(CollectDetailFormDTO dto) {
IcResiCollectEntity entity = baseDao.selectById(dto.getId());
if(null == entity){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "暂无查询到信息","暂无查询到信息");
}
CollectDetailResultDTO result = ConvertUtils.sourceToTarget(entity, CollectDetailResultDTO.class);
//查询成员信息
List<IcResiCollectMemDetailDTO> memberList = icResiMemberDao.selectListByCollectId(dto.getId());
result.setMemberList(memberList);
return new Result().ok(result);
}
public IcNeighborHoodDTO queryIcNeighborHood(String villageId) {
Result<IcNeighborHoodDTO> res = govOrgOpenFeignClient.getIcNeighbordhoodById(villageId);
if (!res.success() || null == res.getData()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "小区信息查询异常", "小区信息查询异常");
@ -146,12 +223,12 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao,
return memMap;
}
private void saveOrUpdateMem(List<IcResiMemberEntity> newMemberList, Map<String, IcResiMemberEntity> memMap, String originIcResiCollectId) {
private void saveOrUpdateMem(List<IcResiMemberEntity> newMemberList, Map<String, IcResiMemberEntity> memMap, IcResiCollectEntity collectInfo) {
for (IcResiMemberEntity entity : newMemberList) {
if(StringUtils.isNotBlank(entity.getIdNum())){
if (MapUtils.isNotEmpty(memMap) && memMap.containsKey(entity.getIdNum())) {
entity.setIcResiCollectId(originIcResiCollectId);
entity.setCustomerId(memMap.get(entity.getIdNum()).getCustomerId());
entity.setIcResiCollectId(collectInfo.getId());
entity.setCustomerId(collectInfo.getCustomerId());
entity.setId(memMap.get(entity.getIdNum()).getId());
icResiMemberDao.updateById(entity);
continue;
@ -161,7 +238,8 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao,
if (StringUtils.isNotBlank(entity.getName()) || StringUtils.isNotBlank(entity.getIdNum())) {
//姓名或份身份证号不为空时插入
entity.setId(null);
entity.setIcResiCollectId(originIcResiCollectId);
entity.setCustomerId(collectInfo.getCustomerId());
entity.setIcResiCollectId(collectInfo.getId());
icResiMemberDao.insert(entity);
}
}
@ -197,7 +275,7 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao,
List<IcResiMemberEntity> newMemberList = ConvertUtils.sourceToTarget(formDTO.getMemberList(), IcResiMemberEntity.class);
//查询之前录入的成员表
Map<String, IcResiMemberEntity> memMap = queryOriginMem(origin.getId());
saveOrUpdateMem(newMemberList, memMap,origin.getId());
saveOrUpdateMem(newMemberList, memMap,origin);
}
}
@ -254,4 +332,245 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao,
resDTO.setUnitName(StringUtils.isBlank(entity.getUnitName()) ? StrConstant.EPMETY_STR : entity.getUnitName());
resDTO.setHomeName(StringUtils.isBlank(entity.getHomeName()) ? StrConstant.EPMETY_STR : entity.getHomeName());
}
@Override
@Transactional(rollbackFor = Exception.class)
public void collectCheck(IcResiCollectCheckFormDTO formDTO, TokenDto tokenDto) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(),tokenDto.getUserId());
formDTO.setRealName(staffInfo.getRealName());
// 获取登记表信息
IcResiCollectEntity icResiCollectEntity = baseDao.selectById(formDTO.getId());
// 获取登记的成员
List<IcResiCollectMemDetailDTO> memberList = icResiMemberDao.selectListByCollectId(formDTO.getId());
// 更新审核信息
icResiCollectEntity.setCheckState(formDTO.getCheckState());
icResiCollectEntity.setCheckReason(formDTO.getCheckReason());
baseDao.updateById(icResiCollectEntity);
// 审核状态:0待审核 1未通过 2已通过
if("2".equals(formDTO.getCheckState())){
if("other".equals(icResiCollectEntity.getHomeId())){
// 新增房屋(新增房屋操作已在审核接口之前,前端调用新增接口实现)
// 更新登记表房屋ID
icResiCollectEntity = updateHomeId(icResiCollectEntity,formDTO);
for(int i = 0 ; i < memberList.size() ; i++){
// 根据身份证号和房屋ID获取人员信息
IcResiUserEntity userIdCardEntity = queryOriginUserByIdCard(memberList.get(i).getIdNum(),icResiCollectEntity.getCustomerId());
if(userIdCardEntity != null){
// 已存在人员 人员房屋不一致(更新人员信息和变更记录)
updateUserInfo(icResiCollectEntity,memberList.get(i),true,formDTO,userIdCardEntity);
}else{
// 不存在人员
insertUserInfo(icResiCollectEntity,memberList.get(i),formDTO);
}
}
}else{
// 更新房屋
updateHouseInfo(icResiCollectEntity);
for(int i = 0 ; i < memberList.size() ; i++){
// 根据身份证号和房屋ID获取人员信息
IcResiUserEntity userIdCardEntity = queryOriginUserByIdCard(memberList.get(i).getIdNum(),icResiCollectEntity.getCustomerId());
Map<String, IcResiUserEntity> userMap = queryOriginUserByHomeId(icResiCollectEntity.getHomeId(),icResiCollectEntity.getCustomerId());
if(userIdCardEntity != null){
// 已存在人员
if(userMap.containsKey(memberList.get(i).getIdNum())){
// 人员房屋一致(只更新人员信息)
updateUserInfo(icResiCollectEntity,memberList.get(i),false,formDTO,userIdCardEntity);
}else{
// 人员房屋不一致(更新人员信息和变更记录)
updateUserInfo(icResiCollectEntity,memberList.get(i),true,formDTO,userIdCardEntity);
}
}else{
// 不存在人员
insertUserInfo(icResiCollectEntity,memberList.get(i),formDTO);
}
}
}
}
}
/**
* 更新登记表房屋ID
* @param icResiCollectEntity
* @param formDTO
* @return
*/
private IcResiCollectEntity updateHomeId(IcResiCollectEntity icResiCollectEntity,IcResiCollectCheckFormDTO formDTO){
// fegin获取房屋信息
GetHouseInfoToCollectFormDTO getHouseInfoToCollectFormDTO = new GetHouseInfoToCollectFormDTO();
getHouseInfoToCollectFormDTO.setBuildingUnitId(formDTO.getBuildingUnitId());
getHouseInfoToCollectFormDTO.setDoorName(formDTO.getDoorName());
Result<IcHouseInfoCollectResultDTO> resultDTOResult = govOrgFeignClient.getHouseInfoToCollect(getHouseInfoToCollectFormDTO);
IcHouseInfoCollectResultDTO icHouseInfoCollectResultDTO = resultDTOResult.getData();
// 新增房屋后需要collect更新上房屋ID
// log
icResiCollectEntity.setHomeId(icHouseInfoCollectResultDTO.getId());
baseDao.updateById(icResiCollectEntity);
return icResiCollectEntity;
}
/**
* 更新房屋信息
* @param icResiCollectEntity
*/
private void updateHouseInfo(IcResiCollectEntity icResiCollectEntity){
CollectHouseFormDTO collectHouseFormDTO = new CollectHouseFormDTO();
collectHouseFormDTO.setId(icResiCollectEntity.getHomeId());
collectHouseFormDTO.setOwnerName(icResiCollectEntity.getHouseHolderName());
collectHouseFormDTO.setRentFlag(Integer.parseInt(icResiCollectEntity.getHouseType()));
collectHouseFormDTO.setCustomerId(icResiCollectEntity.getCustomerId());
collectHouseFormDTO.setResiNumber(icResiCollectEntity.getTotalResi());
govOrgFeignClient.updateCollect(collectHouseFormDTO);
}
/**
* 更新人员信息
* @param icResiCollectEntity 登记信息
* @param icResiCollectMemDetailDTO 登记城阳信息
* @param isUpdateLog 是否更新记录
* @param formDTO 入参
* @param userEntity 根据身份证号查询到的user信息
*/
private void updateUserInfo(IcResiCollectEntity icResiCollectEntity,IcResiCollectMemDetailDTO icResiCollectMemDetailDTO,Boolean isUpdateLog,
IcResiCollectCheckFormDTO formDTO,IcResiUserEntity userEntity){
// 这个房屋下已经设置了户主后,再次选择户主时提示提示“房屋下已存在户主” PS.户主指与户主关系是本人的用户
if (RelationshipEnum.SELF.getCode().equals(icResiCollectMemDetailDTO.getRelationship())) {
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiUserEntity::getHomeId, icResiCollectEntity.getHomeId());
wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode());
List<IcResiUserEntity> entityList = icResiUserDao.selectList(wrapper);
if (CollectionUtils.isNotEmpty(entityList)) {
String errorMsg = "房屋下已存在户主";
throw new EpmetException(EpmetErrorCode.ORG_ADD_FAILED.getCode(), errorMsg, errorMsg);
}
}
userEntity.setPids(icResiCollectEntity.getPids() + ":" + icResiCollectEntity.getAgencyId()); // ic_resi_user表的组织的pids 含agencyId本身
userEntity.setAgencyId(icResiCollectEntity.getAgencyId());
userEntity.setGridId(icResiCollectEntity.getGridId());
userEntity.setVillageId(icResiCollectEntity.getVillageId());
userEntity.setBuildId(icResiCollectEntity.getBuildId());
userEntity.setUnitId(icResiCollectEntity.getUnitId());
userEntity.setHomeId(icResiCollectEntity.getHomeId());
userEntity.setName(icResiCollectMemDetailDTO.getName());
userEntity.setMobile(icResiCollectMemDetailDTO.getMobile());
userEntity.setIdCard(icResiCollectMemDetailDTO.getIdNum());
userEntity.setYhzgx(icResiCollectMemDetailDTO.getRelationship());
userEntity.setGzdw(icResiCollectMemDetailDTO.getWorkPlace());
userEntity.setRemarks(icResiCollectMemDetailDTO.getRemark());
userEntity.setHjszd(icResiCollectMemDetailDTO.getDomicilePlace());
icResiUserDao.updateById(userEntity);
// 判断是否需要更新记录
if(isUpdateLog){
//变更记录表
IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity();
changeRecordEntity.setCustomerId(icResiCollectEntity.getCustomerId());
changeRecordEntity.setOperatorId(formDTO.getUserId());
changeRecordEntity.setIcUserId(userEntity.getId());
changeRecordEntity.setOperatorName(formDTO.getRealName());
changeRecordEntity.setIcUserName(userEntity.getName());
changeRecordEntity.setType("update");
changeRecordEntity.setTypeName("修改");
changeRecordEntity.setBeforeChangeName("-");
changeRecordEntity.setAfterChangeName("-");
changeRecordEntity.setChangeTime(new java.util.Date());
icUserChangeRecordService.insert(changeRecordEntity);
}
}
/**
* 新增人员信息
* @param icResiCollectMemDetailDTO
*/
private void insertUserInfo(IcResiCollectEntity icResiCollectEntity,IcResiCollectMemDetailDTO icResiCollectMemDetailDTO,IcResiCollectCheckFormDTO formDTO){
// 这个房屋下已经设置了户主后,再次选择户主时提示提示“房屋下已存在户主” PS.户主指与户主关系是本人的用户
if (RelationshipEnum.SELF.getCode().equals(icResiCollectMemDetailDTO.getRelationship())) {
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiUserEntity::getHomeId, icResiCollectEntity.getHomeId());
wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode());
List<IcResiUserEntity> entityList = icResiUserDao.selectList(wrapper);
if (CollectionUtils.isNotEmpty(entityList)) {
String errorMsg = "房屋下已存在户主";
throw new EpmetException(EpmetErrorCode.ORG_ADD_FAILED.getCode(), errorMsg, errorMsg);
}
}
// 新增人员
IcResiUserEntity userEntity = new IcResiUserEntity();
userEntity.setPids(icResiCollectEntity.getPids() + ":" + icResiCollectEntity.getAgencyId()); // ic_resi_user表的组织的pids 含agencyId本身
userEntity.setAgencyId(icResiCollectEntity.getAgencyId());
userEntity.setGridId(icResiCollectEntity.getGridId());
userEntity.setVillageId(icResiCollectEntity.getVillageId());
userEntity.setBuildId(icResiCollectEntity.getBuildId());
userEntity.setUnitId(icResiCollectEntity.getUnitId());
userEntity.setHomeId(icResiCollectEntity.getHomeId());
userEntity.setName(icResiCollectMemDetailDTO.getName());
userEntity.setMobile(icResiCollectMemDetailDTO.getMobile());
userEntity.setIdCard(icResiCollectMemDetailDTO.getIdNum());
userEntity.setYhzgx(icResiCollectMemDetailDTO.getRelationship());
userEntity.setGzdw(icResiCollectMemDetailDTO.getWorkPlace());
userEntity.setRemarks(icResiCollectMemDetailDTO.getRemark());
userEntity.setCustomerId(icResiCollectMemDetailDTO.getCustomerId());
userEntity.setHjszd(icResiCollectMemDetailDTO.getDomicilePlace());
icResiUserDao.insert(userEntity);
//变更记录表
IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity();
changeRecordEntity.setCustomerId(icResiCollectEntity.getCustomerId());
changeRecordEntity.setOperatorId(formDTO.getUserId());
changeRecordEntity.setIcUserId(userEntity.getId());
changeRecordEntity.setOperatorName(formDTO.getRealName());
changeRecordEntity.setIcUserName(userEntity.getName());
changeRecordEntity.setType("add");
changeRecordEntity.setTypeName("新增");
changeRecordEntity.setBeforeChangeName("-");
changeRecordEntity.setAfterChangeName("-");
changeRecordEntity.setChangeTime(new java.util.Date());
icUserChangeRecordService.insert(changeRecordEntity);
}
/**
* 获取人员信息
* @param idCard
* @return
*/
private IcResiUserEntity queryOriginUserByIdCard(String idCard,String customerId) {
LambdaQueryWrapper<IcResiUserEntity> query = new LambdaQueryWrapper<>();
query.eq(IcResiUserEntity::getIdCard, idCard);
query.eq(IcResiUserEntity::getCustomerId, customerId);
IcResiUserEntity originUser = icResiUserDao.selectOne(query);
return originUser;
}
private Map<String, IcResiUserEntity> queryOriginUserByHomeId(String homeId,String customerId) {
LambdaQueryWrapper<IcResiUserEntity> query = new LambdaQueryWrapper<>();
query.eq(IcResiUserEntity::getHomeId, homeId);
query.eq(IcResiUserEntity::getCustomerId, customerId);
List<IcResiUserEntity> originUserList = icResiUserDao.selectList(query);
Map<String, IcResiUserEntity> memMap = originUserList.stream().collect(Collectors.toMap(IcResiUserEntity::getIdCard, Function.identity()));
return memMap;
}
@Override
public CollectHouseInfoResultDTO getHouseDetailByCollect(IcResiCollectGetDetailFormDTO formDTO) {
CollectHouseInfoResultDTO collectHouseInfoResultDTO = baseDao.getHouseDetailByCollect(formDTO);
return collectHouseInfoResultDTO;
}
}

158
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectVisitorServiceImpl.java

@ -0,0 +1,158 @@
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.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcResiCollectVisitorDao;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.IcResiCollectVisitorDTO;
import com.epmet.dto.SaveCollectVisitorFormDTO;
import com.epmet.dto.form.CollectDetailFormDTO;
import com.epmet.dto.form.CollectListFormDTO;
import com.epmet.dto.form.VisitListFormDTO;
import com.epmet.dto.result.CollectListResultDTO;
import com.epmet.entity.IcResiCollectVisitorEntity;
import com.epmet.redis.IcResiCollectVisitorRedis;
import com.epmet.service.IcResiCollectVisitorService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
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.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 居民信息采集-访客
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-02
*/
@Service
public class IcResiCollectVisitorServiceImpl extends BaseServiceImpl<IcResiCollectVisitorDao, IcResiCollectVisitorEntity> implements IcResiCollectVisitorService {
@Autowired
private IcResiCollectVisitorRedis icResiCollectVisitorRedis;
@Autowired
private IcResiCollectServiceImpl icResiCollectServiceImpl;
@Override
public PageData<IcResiCollectVisitorDTO> page(Map<String, Object> params) {
IPage<IcResiCollectVisitorEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IcResiCollectVisitorDTO.class);
}
/**
* 条件查询
* @param params
* @return
*/
@Override
public PageData<IcResiCollectVisitorDTO> getPhrasePage(Map<String, Object> params) {
IPage<IcResiCollectVisitorDTO> page = getPage(params);
List<IcResiCollectVisitorDTO> list = baseDao.getPhrasePage(params);
return new PageData<>(list, page.getTotal());
}
/**
* Desc: 查询访客信息
* @param formDTO
* @author wgf
* @date 2022/8/5 8:23
*/
@Override
public PageData<IcResiCollectVisitorDTO> getVisitorList(VisitListFormDTO formDTO) {
PageData<IcResiCollectVisitorDTO> result = new PageData<>(new ArrayList<>(), 0);
if (StringUtils.isBlank(formDTO.getStartTime()) && StringUtils.isBlank(formDTO.getEndTime()) ){
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo){
throw new EpmetException("查询人员信息失败"+formDTO.getUserId());
}
formDTO.setOrgId(staffInfo.getAgencyId());
}
PageInfo<IcResiCollectVisitorDTO> pageList = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.getCollectList(formDTO));
result.setList(pageList.getList());
result.setTotal(Integer.parseInt(String.valueOf(pageList.getTotal())));
return result;
}
@Override
public List<IcResiCollectVisitorDTO> list(Map<String, Object> params) {
List<IcResiCollectVisitorEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IcResiCollectVisitorDTO.class);
}
private QueryWrapper<IcResiCollectVisitorEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcResiCollectVisitorEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public IcResiCollectVisitorDTO get(String id) {
IcResiCollectVisitorEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IcResiCollectVisitorDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcResiCollectVisitorDTO dto) {
IcResiCollectVisitorEntity entity = ConvertUtils.sourceToTarget(dto, IcResiCollectVisitorEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcResiCollectVisitorDTO dto) {
IcResiCollectVisitorEntity entity = ConvertUtils.sourceToTarget(dto, IcResiCollectVisitorEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result saveInfo(SaveCollectVisitorFormDTO dto) {
IcResiCollectVisitorEntity entity = ConvertUtils.sourceToTarget(dto, IcResiCollectVisitorEntity.class);
//根据小区id查询网格相关信息
IcNeighborHoodDTO neighborHoodDTO = icResiCollectServiceImpl.queryIcNeighborHood(dto.getVillageId());
entity.setGridId(neighborHoodDTO.getGridId());
entity.setAgencyId(neighborHoodDTO.getAgencyId());
entity.setPids(neighborHoodDTO.getAgencyPids());
entity.setCustomerId(neighborHoodDTO.getCustomerId());
insert(entity);
return new Result().ok("提交成功");
}
@Override
public Result getVisitorDetail(CollectDetailFormDTO dto) {
IcResiCollectVisitorEntity entity = baseDao.selectById(dto.getId());
return new Result().ok(entity);
}
}

36
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.63__alter_collect.sql

@ -0,0 +1,36 @@
alter table ic_resi_collect add COLUMN `CHECK_STATE` varchar(1) DEFAULT NULL COMMENT '审核状态:0待审核 1审核不通过 2审核通过';
alter table ic_resi_collect add COLUMN `CHECK_REASON` varchar(255) DEFAULT NULL COMMENT '审核理由';
alter table ic_resi_member add COLUMN `RELATIONSHIP` varchar(10) DEFAULT NULL COMMENT '与户主关系';
alter table ic_resi_member add COLUMN `FACE_IMG` varchar(255) DEFAULT NULL COMMENT '人脸照片';
CREATE TABLE `ic_resi_collect_visitor` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id customer.id',
`GRID_ID` varchar(64) DEFAULT NULL COMMENT '网格ID',
`AGENCY_ID` varchar(64) DEFAULT NULL COMMENT '组织Id',
`PIDS` varchar(255) DEFAULT NULL COMMENT '组织的pids',
`VILLAGE_ID` varchar(64) DEFAULT NULL COMMENT '所属小区ID;',
`VILLAGE_NAME` varchar(64) DEFAULT NULL COMMENT '所属小区名称',
`BUILD_ID` varchar(64) DEFAULT NULL COMMENT '所属楼宇Id',
`BUILD_NAME` varchar(64) DEFAULT NULL COMMENT '所属楼宇名称',
`UNIT_ID` varchar(64) DEFAULT NULL COMMENT '单元id',
`UNIT_NAME` varchar(64) DEFAULT NULL COMMENT '单元名',
`HOME_ID` varchar(64) DEFAULT NULL COMMENT '所属家庭Id',
`HOME_NAME` varchar(64) DEFAULT NULL COMMENT '房间名',
`ADDRESS` varchar(255) NOT NULL COMMENT '详细地址',
`NAME` varchar(64) NOT NULL COMMENT '姓名',
`MOBILE` varchar(15) NOT NULL COMMENT '手机号',
`ID_CARD` varchar(18) DEFAULT NULL COMMENT '身份证号',
`COME_REASON` varchar(255) DEFAULT NULL COMMENT '来访事由',
`FACE_IMG` varchar(255) 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 '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='居民信息采集-访客';

69
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml

@ -4,7 +4,7 @@
<mapper namespace="com.epmet.dao.IcResiCollectDao">
<select id="selectByAddress" parameterType="java.lang.String" resultType="com.epmet.entity.IcResiCollectEntity">
select c.id from ic_resi_collect c
select c.id,c.CUSTOMER_ID from ic_resi_collect c
where c.address=#{address}
and c.DEL_FLAG='0'
</select>
@ -16,6 +16,9 @@
<result property="address" column="address"/>
<result property="houseType" column="houseType"/>
<result property="totalResi" column="totalResi"/>
<result property="homeId" column="homeId"/>
<result property="checkState" column="checkState"/>
<result property="agencyId" column="agencyId"/>
<result property="domicilePlace" column="domicilePlace"></result>
<collection property="list" ofType="com.epmet.dto.result.CollectListResultDTO$CollectListMemberResultDTO" column="{id=id,domicilePlace=domicile_place}" select="selectMemberList"/>
</resultMap>
@ -26,6 +29,9 @@
c.ADDRESS AS address,
c.HOUSE_TYPE AS houseType,
c.TOTAL_RESI AS totalResi,
c.HOME_ID as homeId,
c.CHECK_STATE as checkState,
c.AGENCY_ID as agencyId,
#{domicilePlace} as domicile_place
FROM ic_resi_collect c
left join ic_resi_member m on(c.id=m.IC_RESI_COLLECT_ID and m.del_flag='0')
@ -61,7 +67,9 @@
m.DOMICILE_PLACE_CODE as domicilePlaceCode,
m.DOMICILE_PLACE_CODE_PATH as domicilePlaceCodePath,
m.WORK_PLACE as workPlace,
m.REMARK as remark
m.REMARK as remark,
m.RELATIONSHIP as relationship,
m.FACE_IMG as faceImg
from ic_resi_member m
where m.DEL_FLAG = 0
and m.IC_RESI_COLLECT_ID = #{id}
@ -85,7 +93,8 @@
<if test="updatedBy != null and updatedBy !=''">
UPDATED_BY = #{updatedBy},
</if>
UPDATED_TIME = NOW()
UPDATED_TIME = NOW(),
CHECK_STATE = '0'
WHERE
id = #{id}
</update>
@ -102,4 +111,56 @@
ORDER BY
m.UPDATED_TIME DESC
</select>
</mapper>
<select id="getCollectPage" resultType="com.epmet.dto.result.CollectPageListDTO">
select tot.*
from (select id,
'resi' as type,
'居民登记' as title,
ADDRESS,
CHECK_STATE,
case CHECK_STATE
when '0' then '待审核'
when '1' then '审核不通过'
when '2' then '审核通过'
else ''
end as checkStateName,
CHECK_REASON,
CREATED_TIME
from ic_resi_collect
where DEL_FLAG='0'
and CUSTOMER_ID=#{customerId}
and ( UPDATED_BY = #{userId} OR UPDATED_BY = #{userId} )
union
select id,
'visitor' as type,
'访客登记' as title,
ADDRESS,
'2' as checkState,
'审核通过' as checkStateName,
'' as checkReason,
CREATED_TIME
from ic_resi_collect_visitor
where DEL_FLAG='0'
and CUSTOMER_ID=#{customerId}
and ( UPDATED_BY = #{userId} OR UPDATED_BY = #{userId} ))tot
order by tot.CREATED_TIME desc
</select>
<select id="getHouseDetailByCollect" resultType="com.epmet.dto.result.CollectHouseInfoResultDTO"
parameterType="com.epmet.dto.form.IcResiCollectGetDetailFormDTO">
select
concat(VILLAGE_NAME,'-',BUILD_NAME) label,
VILLAGE_ID as neighborHoodId,
VILLAGE_NAME as neighborHoodName,
BUILD_ID as buildingId,
BUILD_NAME as buildName,
UNIT_ID as buildingUnitId,
UNIT_NAME as buildingUnitName,
HOME_NAME as doorName,
HOUSE_HOLDER_NAME as ownerName
from ic_resi_collect
where DEL_FLAG = 0
and ID = #{id}
</select>
</mapper>

108
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectVisitorDao.xml

@ -0,0 +1,108 @@
<?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.IcResiCollectVisitorDao">
<resultMap type="com.epmet.entity.IcResiCollectVisitorEntity" id="icResiCollectVisitorMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="pids" column="PIDS"/>
<result property="villageId" column="VILLAGE_ID"/>
<result property="villageName" column="VILLAGE_NAME"/>
<result property="buildId" column="BUILD_ID"/>
<result property="buildName" column="BUILD_NAME"/>
<result property="unitId" column="UNIT_ID"/>
<result property="unitName" column="UNIT_NAME"/>
<result property="homeId" column="HOME_ID"/>
<result property="homeName" column="HOME_NAME"/>
<result property="name" column="NAME"/>
<result property="mobile" column="MOBILE"/>
<result property="idCard" column="ID_CARD"/>
<result property="comeReason" column="COME_REASON"/>
<result property="faceImg" column="FACE_IMG"/>
<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"/>
</resultMap>
<select id="getPhrasePage" resultType="com.epmet.dto.IcResiCollectVisitorDTO">
select
ID,
concat(VILLAGE_NAME,BUILD_NAME,UNIT_NAME,HOME_NAME) as address,
CUSTOMER_ID,
GRID_ID,
AGENCY_ID,
PIDS,
VILLAGE_ID,
VILLAGE_NAME,
BUILD_ID,
BUILD_NAME,
UNIT_ID,
UNIT_NAME,
HOME_ID,
HOME_NAME,
ADDRESS,
NAME,
MOBILE,
ID_CARD,
COME_REASON,
FACE_IMG,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
from ic_resi_collect_visitor
where DEL_FLAG = '0'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
order by CREATED_TIME desc
</select>
<select id="getCollectList" resultType="com.epmet.dto.IcResiCollectVisitorDTO">
select
ID,
CUSTOMER_ID,
GRID_ID,
AGENCY_ID,
PIDS,
VILLAGE_ID,
VILLAGE_NAME,
BUILD_ID,
BUILD_NAME,
UNIT_ID,
UNIT_NAME,
HOME_ID,
HOME_NAME,
ADDRESS,
NAME,
MOBILE,
ID_CARD,
COME_REASON,
FACE_IMG,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
from ic_resi_collect_visitor
where DEL_FLAG = '0'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<if test='orgId != null and orgId != "" '>
AND CONCAT(PIDS,':',AGENCY_ID) LIKE CONCAT('%',#{orgId},'%')
</if>
order by CREATED_TIME desc
</select>
</mapper>

9
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiMemberDao.xml

@ -25,4 +25,11 @@
AND m.DEL_FLAG = '0'
AND ( m.CREATED_BY = #{userId} OR m.UPDATED_BY = #{userId} )
</select>
</mapper>
<select id="selectListByCollectId" resultType="com.epmet.dto.form.IcResiCollectMemDetailDTO">
select *
from ic_resi_member
where IC_RESI_COLLECT_ID =#{collectId}
and DEL_FLAG = '0'
order by CREATED_TIME asc
</select>
</mapper>

Loading…
Cancel
Save