Browse Source

Merge branch 'master' into shibei_hlpt_master

feature/teamB_zz_wgh
YUJT 3 years ago
parent
commit
3353e6e6a6
  1. 6
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/List4ApplyResultDTO.java
  2. 28
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdditiveRuleServiceImpl.java
  3. 8
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdditiveRuleDao.xml
  4. 4
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointApplyDao.xml
  5. 17
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  6. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  7. 32
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java
  8. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java
  9. 17
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java
  10. 64
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ca/CaResidentUserDTO.java
  11. 14
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/GetResidentDetailByIdCardFormDTO.java
  12. 57
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/SaveCaResidentUserFormDTO.java
  13. 187
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/ResidentByIdCardResultDTO.java
  14. 10
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/feign/GuardarDatosFeignClient.java
  15. 13
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/feign/impl/GuardarDatosFeignClientFallBack.java
  16. 17
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaResidentController.java
  17. 88
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaResidentUserController.java
  18. 5
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaResidentDao.java
  19. 21
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaResidentUserDao.java
  20. 10
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/CaResidentEntity.java
  21. 42
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/CaResidentUserEntity.java
  22. 45
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/excel/CaResidentUserExcel.java
  23. 30
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/redis/CaResidentUserRedis.java
  24. 15
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaResidentService.java
  25. 82
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaResidentUserService.java
  26. 18
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaResidentServiceImpl.java
  27. 99
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaResidentUserServiceImpl.java
  28. 3
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/V0.0.7__drop_home_id_and_ic_resi_user.sql
  29. 52
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/V0.0.8__update_view_create_table.sql
  30. 14
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/V0.0.9__create_ca_resident_user_table.sql
  31. 2
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaLoudongDao.xml
  32. 2
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaPingfangDao.xml
  33. 2
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaRentalDao.xml
  34. 48
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaResidentDao.xml
  35. 8
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaResidentUserDao.xml
  36. 2
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaRotatorsDao.xml
  37. 29
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BindHomeFormDTO.java
  38. 6
      epmet-user/epmet-user-server/pom.xml
  39. 53
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  40. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java
  41. 31
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  42. 22
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  43. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  44. 305
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  45. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java
  46. 3
      epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml
  47. 36
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

6
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/List4ApplyResultDTO.java

@ -3,8 +3,6 @@ package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @program: epmet-cloud
@ -19,9 +17,9 @@ public class List4ApplyResultDTO implements Serializable {
private String name;
private String pid;
// private String pid;
private Integer pointValue;
private List<List4ApplyResultDTO> children = new ArrayList<>();
// private List<List4ApplyResultDTO> children = new ArrayList<>();
}

28
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdditiveRuleServiceImpl.java

@ -194,35 +194,9 @@ public class PointAdditiveRuleServiceImpl extends BaseServiceImpl<PointAdditiveR
@Override
public Result<List<List4ApplyResultDTO>> list4apply(List4applyFormDTO dto) {
List<List4ApplyResultDTO> list = baseDao.selectList4apply(dto);
List<List4ApplyResultDTO> result = build(list);
result.removeIf(category ->CollectionUtils.isEmpty(category.getChildren()));
return new Result<List<List4ApplyResultDTO>>().ok(result);
return new Result<List<List4ApplyResultDTO>>().ok(list);
}
/**
* 构建树节点
*/
public static List<List4ApplyResultDTO> build(List<List4ApplyResultDTO> treeNodes) {
List<List4ApplyResultDTO> result = new ArrayList<>();
//list转map
Map<String, List4ApplyResultDTO> nodeMap = new LinkedHashMap<>(treeNodes.size());
for(List4ApplyResultDTO treeNode : treeNodes){
nodeMap.put(treeNode.getId(), treeNode);
}
for(List4ApplyResultDTO node : nodeMap.values()) {
List4ApplyResultDTO parent = nodeMap.get(node.getPid());
if(parent != null && !(node.getId().equals(parent.getId()))){
parent.getChildren().add(node);
continue;
}
result.add(node);
}
return result;
}
@Override
public Result<List<PointAdditiveRuleDTO>> list4tree(List4treeFormDTO dto) {

8
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdditiveRuleDao.xml

@ -45,8 +45,7 @@
</select>
<select id="selectList4apply" resultType="com.epmet.dto.result.List4ApplyResultDTO">
select id,
if(CATEGORY_NAME is null,RULE_NAME,CATEGORY_NAME) as name,
pid,
RULE_NAME as name,
POINT_VALUE
from point_additive_rule
where DEL_FLAG='0'
@ -55,11 +54,12 @@
and APPLY_FLAG= #{applyFlag}
</if>
<if test="businessCode != null and businessCode != '' and businessCode == 'point_fine'.toString()">
and (( type='rule' and POINT_VALUE &lt; 0 )or TYPE='category')
and POINT_VALUE &lt; 0
</if>
<if test="businessCode != null and businessCode != '' and businessCode == 'point_reward'.toString()">
and (( type='rule' and POINT_VALUE &gt; 0 )or TYPE='category')
and POINT_VALUE &gt; 0
</if>
and type='rule'
and CUSTOMER_ID=#{customerId}
order by UPDATED_TIME desc
</select>

4
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointApplyDao.xml

@ -52,6 +52,7 @@
<result property="createdTime" column="CREATED_TIME"/>
<result property="ruleName" column="RULE_NAME"/>
<result property="pointValue" column="POINT_VALUE"/>
<result property="remark" column="REMARK"/>
<collection property="annexList" ofType="java.lang.String">
<result column="URL"/>
</collection>
@ -73,7 +74,8 @@
a.CREATED_TIME,
b.RULE_NAME,
b.POINT_VALUE,
c.URL
c.URL,
a.REMARK
FROM
point_apply a
INNER JOIN point_additive_rule b ON a.RULE_ID = b.ID AND a.CUSTOMER_ID = b.CUSTOMER_ID

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

@ -623,10 +623,6 @@ public interface GovOrgOpenFeignClient {
/**
* Desc: 房屋更新
* <<<<<<< HEAD
* =======
* <p>
* >>>>>>> feature/dev_sunjiatan
*
* @param formDTO
* @author zxc
@ -644,6 +640,17 @@ public interface GovOrgOpenFeignClient {
@GetMapping("/gov/org/customeragency/subOrgList/{agencyId}")
Result<List<SubOrgResDTO>> subOrgList(@PathVariable("agencyId") String agencyId);
/**
* 根据houseId查询数据
*
* @param houseId
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.HouseAgencyInfoResultDTO>
* @author LZN
* @date 2022/6/22 16:20
*/
@PostMapping("/gov/org/ichouse/getHouseAgencyInfo")
Result<HouseAgencyInfoResultDTO> getHouseAgencyInfo(@RequestParam("houseId") String houseId);
/**
* @Author sun
* @Description 获取当前组织及下级无效组织网格Id列表
@ -664,11 +671,11 @@ public interface GovOrgOpenFeignClient {
/**
* @return com.epmet.commons.tools.utils.Result
* @describe: 工作端-通过房屋编码获取房屋信息
* @author wangtong
* @date 2022/6/10 13:27
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("/gov/org/house/getHomeInfoByHouseCode")
Result<HouseInfoResultDTO> getHomeInfoByHouseCode(CommonHouseFormDTO dto);

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

@ -422,6 +422,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
}
@Override
public Result<HouseAgencyInfoResultDTO> getHouseAgencyInfo(String houseId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "subOrgList",houseId);
}
public Result<DelAgencyGridIdResultDTO> getDelAgencyGridIdList(String agencyId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getDelAgencyGridIdList", agencyId);
}

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

@ -23,6 +23,7 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.form.HouseFormDTO;
import com.epmet.dto.result.HouseAgencyInfoResultDTO;
import com.epmet.dto.result.HouseListResultDTO;
import com.epmet.dto.result.HousesNameResultDTO;
import com.epmet.service.IcHouseService;
@ -46,25 +47,25 @@ public class IcHouseController {
private IcHouseService icHouseService;
@GetMapping("{id}")
public Result<IcHouseDTO> get(@PathVariable("id") String id){
public Result<IcHouseDTO> get(@PathVariable("id") String id) {
IcHouseDTO data = icHouseService.get(id);
return new Result<IcHouseDTO>().ok(data);
}
@PostMapping("houseoption")
public Result<List<OptionResultDTO>> getHouseOption(@RequestBody HouseFormDTO formDTO){
public Result<List<OptionResultDTO>> getHouseOption(@RequestBody HouseFormDTO formDTO) {
return new Result<List<OptionResultDTO>>().ok(icHouseService.getHouseOption(formDTO));
}
/**
* @Description 查询房屋信息
* @param idCard
* @Description 查询房屋信息
* @author zxc
* @date 2021/11/3 3:30 下午
*/
@PostMapping("selecthouseinfobyidcard")
public Result<List<String>> selectHouseInfoByIdCard(@RequestParam("idCard")String idCard,@RequestParam("customerId")String customerId){
return new Result<List<String>>().ok(icHouseService.selectHouseInfoByIdCard(idCard,customerId));
public Result<List<String>> selectHouseInfoByIdCard(@RequestParam("idCard") String idCard, @RequestParam("customerId") String customerId) {
return new Result<List<String>>().ok(icHouseService.selectHouseInfoByIdCard(idCard, customerId));
}
/**
@ -75,23 +76,38 @@ public class IcHouseController {
* @Date 2021/11/5 16:01
*/
@PostMapping("houselist")
public Result<List<HouseListResultDTO>> getHouseList(@LoginUser TokenDto tokenDto, @RequestBody HouseFormDTO formDTO){
public Result<List<HouseListResultDTO>> getHouseList(@LoginUser TokenDto tokenDto, @RequestBody HouseFormDTO formDTO) {
return new Result<List<HouseListResultDTO>>().ok(icHouseService.getHouseList(tokenDto, formDTO));
}
/**
* Desc: 根据身份证查询房屋名
*
* @param idCards
* @author zxc
* @date 2022/4/12 16:42
*/
@PostMapping("houses-name")
public Result<List<HousesNameResultDTO>> getHousesNameByIdCards(@RequestBody List<String> idCards){
public Result<List<HousesNameResultDTO>> getHousesNameByIdCards(@RequestBody List<String> idCards) {
return new Result<List<HousesNameResultDTO>>().ok(icHouseService.getHousesNameByIdCards(idCards));
}
/**
* 根据houseId查询数据
*
* @param houseId
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.HouseAgencyInfoResultDTO>
* @author LZN
* @date 2022/6/22 16:18
*/
@PostMapping("getHouseAgencyInfo")
public Result<HouseAgencyInfoResultDTO> getHouseAgencyInfo(@RequestParam("houseId") String houseId) {
HouseAgencyInfoResultDTO dto = icHouseService.getHouseAgencyInfo(houseId);
return new Result<HouseAgencyInfoResultDTO>().ok(dto);
}
@GetMapping("getbyhousecode/{houseCode}")
public Result<IcHouseDTO> getByHouseCode(@PathVariable("houseCode") String houseCode){
public Result<IcHouseDTO> getByHouseCode(@PathVariable("houseCode") String houseCode) {
return new Result<IcHouseDTO>().ok(icHouseService.getByHouseCode(houseCode));
}
}

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

@ -7,6 +7,7 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.HouseFormDTO;
import com.epmet.dto.result.HouseAgencyInfoResultDTO;
import com.epmet.dto.result.HouseListResultDTO;
import com.epmet.dto.result.HousesNameResultDTO;
import com.epmet.entity.IcHouseEntity;
@ -127,6 +128,16 @@ public interface IcHouseService extends BaseService<IcHouseEntity> {
*/
List<HousesNameResultDTO> getHousesNameByIdCards(List<String> idCards);
/**
* 根据houseId查询数据
*
* @param houseId
* @return com.epmet.dto.result.HouseAgencyInfoResultDTO
* @author LZN
* @date 2022/6/22 16:18
*/
HouseAgencyInfoResultDTO getHouseAgencyInfo(String houseId);
/**
* 根据房屋编码查询房屋信息
*
@ -136,4 +147,4 @@ public interface IcHouseService extends BaseService<IcHouseEntity> {
* @date 2022/6/1/0001 16:21
*/
IcHouseDTO getByHouseCode(String houseCode);
}
}

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

@ -22,6 +22,7 @@ import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.HouseFormDTO;
import com.epmet.dto.result.HouseAgencyInfoResultDTO;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.HouseListResultDTO;
import com.epmet.dto.result.HousesNameResultDTO;
@ -222,7 +223,7 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
dto.setHouseId(item.getId());
dto.setHouseName(item.getHouseName());
String houseTypeName = HouseRentFlagEnums.getTypeValue(item.getRentFlag());
dto.setRentFlag(houseTypeName == null ? StrConstant.EPMETY_STR:houseTypeName);
dto.setRentFlag(houseTypeName == null ? StrConstant.EPMETY_STR : houseTypeName);
List<HouseListResultDTO.CategoryListBean> categories = new ArrayList<>();
if (null != countMap && CollectionUtils.isNotEmpty(categoryList)) {
for (IcResiCategoryStatsConfigDTO category : categoryList) {
@ -284,6 +285,20 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
return baseDao.getHousesNameByIdCards(idCards);
}
/**
* 根据houseId查询数据
*
* @param houseId
* @return com.epmet.dto.result.HouseAgencyInfoResultDTO
* @author LZN
* @date 2022/6/22 16:19
*/
@Override
public HouseAgencyInfoResultDTO getHouseAgencyInfo(String houseId) {
HouseAgencyInfoResultDTO dto = baseDao.getHouseAgencyInfo(houseId);
return dto;
}
@Override
public IcHouseDTO getByHouseCode(String houseCode) {
LambdaQueryWrapper<IcHouseEntity> lqw = Wrappers.lambdaQuery();

64
epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ca/CaResidentUserDTO.java

@ -0,0 +1,64 @@
package com.epmet.opendata.dto.ca;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
*
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-22
*/
@Data
public class CaResidentUserDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 身份证号
*/
private String idCard;
/**
* ic_resi_user表id
*/
private String icResiUserId;
/**
* 绑定的房屋id
*/
private String homeId;
/**
* 创建人
*/
private Long createBy;
/**
* 创建时间
*/
private Date createDate;
/**
* 最后修改人
*/
private Long updateBy;
/**
* 最后修改时间
*/
private Date updateDate;
/**
* 删除标记normal
*/
private String deleteFlag;
/**
* 乐观锁
*/
private Integer versions;
}

14
epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/GetResidentDetailByIdCardFormDTO.java

@ -0,0 +1,14 @@
package com.epmet.opendata.dto.form;
import lombok.Data;
import java.io.Serializable;
@Data
public class GetResidentDetailByIdCardFormDTO implements Serializable {
private static final long serialVersionUID = 2717574179375935921L;
private String idCard;
}

57
epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/SaveCaResidentUserFormDTO.java

@ -0,0 +1,57 @@
package com.epmet.opendata.dto.form;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class SaveCaResidentUserFormDTO implements Serializable {
private static final long serialVersionUID = -182571137927356144L;
/**
* 身份证号
*/
private String idCard;
/**
* ic_resi_user表id
*/
private String icResiUserId;
/**
* 房屋id
*/
private String homeId;
/**
* 创建人
*/
private Long createdBy;
/**
* 创建时间
*/
private Date createdDate;
/**
* 最后修改人
*/
private Long updatedBy;
/**
* 最后修改时间
*/
private Date updatedDate;
/**
* 删除标记
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer versions;
}

187
epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/ResidentByIdCardResultDTO.java

@ -0,0 +1,187 @@
package com.epmet.opendata.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class ResidentByIdCardResultDTO implements Serializable {
private static final long serialVersionUID = 3809219691923066512L;
/**
* 人口性质
*/
private String residentProperty;
/**
* 居民分类
*/
private String residentType;
/**
* 证件类型
*/
private String idType;
/**
* 证件号码公民身份证号
*/
private String idCard;
/**
* 姓名
*/
private String residentName;
/**
* 性别
*/
private String sex;
/**
* 出生日期
*/
private Date birthday;
/**
* 民族
*/
private String nation;
/**
* 联系方式
*/
private String telephone;
/**
* 户籍省
*/
private String householdProv;
/**
* 户籍市
*/
private String householdCity;
/**
* 户籍县()
*/
private String householdCounty;
/**
* 户籍镇街
*/
private String householdTown;
/**
* 户籍社区/
*/
private String householdVillage;
/**
* 户籍详址
*/
private String householdAddressDetail;
/**
* 现住省
*/
private String curliveProv;
/**
* 现住市
*/
private String curliveCity;
/**
* 现住县()
*/
private String curliveCounty;
/**
* 现住镇街
*/
private String curliveTown;
/**
* 现住社区/
*/
private String curliveVillage;
/**
* 现住详址
*/
private String curliveAddressDetail;
/**
* 籍贯省
*/
private String nativeAddressProv;
/**
* 籍贯市
*/
private String nativeAddressCity;
/**
* 籍贯县()
*/
private String nativeAddressCounty;
/**
* 曾用名
*/
private String formerName;
/**
* 学历
*/
private String education;
/**
* 职业
*/
private String occupation;
/**
* 职业类别
*/
private String occupationType;
/**
* 服务处所
*/
private String serviceAddress;
/**
* 婚姻状况
*/
private String marriageStatus;
/**
* 政治面貌
*/
private String party;
/**
* 宗教信仰
*/
private String religious;
/**
* 有无皈依已受洗
*/
private String conversionState;
/**
* 国籍
*/
private String nationality;
/**
* 数据来源
*/
private String platCode;
}

10
epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/feign/GuardarDatosFeignClient.java

@ -1,14 +1,24 @@
package com.epmet.opendata.feign;
import com.epmet.commons.tools.utils.Result;
import com.epmet.opendata.dto.form.GetResidentDetailByIdCardFormDTO;
import com.epmet.opendata.dto.form.PreserVationFormDTO;
import com.epmet.opendata.dto.form.SaveCaResidentUserFormDTO;
import com.epmet.opendata.dto.result.ResidentByIdCardResultDTO;
import com.epmet.opendata.feign.impl.GuardarDatosFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@FeignClient(name = "open-data-worker-server", fallback = GuardarDatosFeignClientFallBack.class)
public interface GuardarDatosFeignClient {
@PostMapping("/opendata/caTask/guardarDatosTask")
Result guardarDatosTask(PreserVationFormDTO dto);
@PostMapping("/opendata/caResident/getResidentDetailByIdCard")
Result<ResidentByIdCardResultDTO> getResidentDetailByIdCard(GetResidentDetailByIdCardFormDTO form);
@PostMapping("/opendata/caResidentUser/saveCaResidentUser")
Result saveCaResidentUser(@RequestBody SaveCaResidentUserFormDTO dto);
}

13
epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/feign/impl/GuardarDatosFeignClientFallBack.java

@ -2,7 +2,10 @@ package com.epmet.opendata.feign.impl;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.opendata.dto.form.GetResidentDetailByIdCardFormDTO;
import com.epmet.opendata.dto.form.PreserVationFormDTO;
import com.epmet.opendata.dto.form.SaveCaResidentUserFormDTO;
import com.epmet.opendata.dto.result.ResidentByIdCardResultDTO;
import com.epmet.opendata.feign.GuardarDatosFeignClient;
import org.springframework.stereotype.Component;
@ -14,4 +17,14 @@ public class GuardarDatosFeignClientFallBack implements GuardarDatosFeignClient
return ModuleUtils.feignConError("open-data-worker", "guardarDatosTask", dto);
}
@Override
public Result<ResidentByIdCardResultDTO> getResidentDetailByIdCard(GetResidentDetailByIdCardFormDTO form) {
return ModuleUtils.feignConError("open-data-worker", "guardarDatosTask", form);
}
@Override
public Result saveCaResidentUser(SaveCaResidentUserFormDTO dto) {
return ModuleUtils.feignConError("open-data-worker", "saveCaResidentUser", dto);
}
}

17
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaResidentController.java

@ -14,9 +14,12 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.opendata.dto.ca.CaResidentDTO;
import com.epmet.opendata.dto.form.CaResidentDetailsFormDTO;
import com.epmet.opendata.dto.form.CaResidentFormDTO;
import com.epmet.opendata.dto.form.GetResidentDetailByIdCardFormDTO;
import com.epmet.opendata.dto.form.PreserVationFormDTO;
import com.epmet.opendata.dto.result.CaResidentDetailsResultDTO;
import com.epmet.opendata.dto.result.CaResidentResultDTO;
import com.epmet.opendata.dto.result.ResidentByIdCardResultDTO;
import com.epmet.opendata.entity.CaResidentEntity;
import com.epmet.opendata.excel.CaResidentExcel;
import com.epmet.opendata.service.CaResidentService;
import org.springframework.beans.factory.annotation.Autowired;
@ -127,4 +130,18 @@ public class CaResidentController {
caResidentService.preserResidentVation(dto);
return new Result();
}
/**
* 根据idCard查询resident表数据
*
* @param form
* @return com.epmet.commons.tools.utils.Result
* @author LZN
* @date 2022/6/21 17:33
*/
@PostMapping("getResidentDetailByIdCard")
public Result<ResidentByIdCardResultDTO> getResidentDetailByIdCard(@RequestBody CaResidentDetailsFormDTO form) {
ResidentByIdCardResultDTO dto = caResidentService.getResidentDetailByIdCard(form);
return new Result<ResidentByIdCardResultDTO>().ok(dto);
}
}

88
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaResidentUserController.java

@ -0,0 +1,88 @@
package com.epmet.opendata.controller;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.opendata.dto.ca.CaResidentUserDTO;
import com.epmet.opendata.dto.form.SaveCaResidentUserFormDTO;
import com.epmet.opendata.excel.CaResidentUserExcel;
import com.epmet.opendata.service.CaResidentUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
*
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-22
*/
@RestController
@RequestMapping("caResidentUser")
public class CaResidentUserController {
@Autowired
private CaResidentUserService caResidentUserService;
@RequestMapping("page")
public Result<PageData<CaResidentUserDTO>> page(@RequestParam Map<String, Object> params){
PageData<CaResidentUserDTO> page = caResidentUserService.page(params);
return new Result<PageData<CaResidentUserDTO>>().ok(page);
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<CaResidentUserDTO> get(@PathVariable("id") String id){
CaResidentUserDTO data = caResidentUserService.get(id);
return new Result<CaResidentUserDTO>().ok(data);
}
@NoRepeatSubmit
@PostMapping("save")
public Result save(@RequestBody CaResidentUserDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
caResidentUserService.save(dto);
return new Result();
}
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody CaResidentUserDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
caResidentUserService.update(dto);
return new Result();
}
@PostMapping("delete")
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
caResidentUserService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<CaResidentUserDTO> list = caResidentUserService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, CaResidentUserExcel.class);
}
@PostMapping("saveCaResidentUser")
public Result saveCaResidentUser(@RequestBody SaveCaResidentUserFormDTO dto){
caResidentUserService.saveCaResidentUser(dto);
return new Result();
}
}

5
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaResidentDao.java

@ -2,8 +2,11 @@ package com.epmet.opendata.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.opendata.dto.form.CaResidentDetailsFormDTO;
import com.epmet.opendata.dto.form.GetResidentDetailByIdCardFormDTO;
import com.epmet.opendata.dto.result.CaResidentDetailsResultDTO;
import com.epmet.opendata.dto.result.CaResidentResultDTO;
import com.epmet.opendata.dto.result.ResidentByIdCardResultDTO;
import com.epmet.opendata.entity.CaResidentEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -39,4 +42,6 @@ public interface CaResidentDao extends BaseDao<CaResidentEntity> {
* @return
*/
CaResidentDetailsResultDTO getResidentDetails(@Param("idCard") String idCard);
ResidentByIdCardResultDTO getResidentDetailByIdCard(@Param("form") CaResidentDetailsFormDTO form);
}

21
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaResidentUserDao.java

@ -0,0 +1,21 @@
package com.epmet.opendata.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.opendata.dto.form.SaveCaResidentUserFormDTO;
import com.epmet.opendata.entity.CaResidentUserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
*
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-22
*/
@Mapper
public interface CaResidentUserDao extends BaseDao<CaResidentUserEntity> {
}

10
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/CaResidentEntity.java

@ -21,16 +21,6 @@ public class CaResidentEntity {
private static final long serialVersionUID = 1L;
/**
* 人口ID
*/
private Long residentId;
/**
* homeId
*/
private String homeId;
/**
* 对应的ic_resi_user主表Id
*/

42
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/CaResidentUserEntity.java

@ -0,0 +1,42 @@
package com.epmet.opendata.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEntity;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
*
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-22
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ca_resident_user")
public class CaResidentUserEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 身份证号
*/
private String idCard;
/**
* ic_resi_user表id
*/
private String icResiUserId;
/**
* 绑定的房屋id
*/
private String homeId;
}

45
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/excel/CaResidentUserExcel.java

@ -0,0 +1,45 @@
package com.epmet.opendata.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
*
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-22
*/
@Data
public class CaResidentUserExcel {
@Excel(name = "身份证号")
private String idCard;
@Excel(name = "ic_resi_user表id")
private String icResiUserId;
@Excel(name = "绑定的房屋id")
private String homeId;
@Excel(name = "创建人")
private Long createBy;
@Excel(name = "创建时间")
private Date createDate;
@Excel(name = "最后修改人")
private Long updateBy;
@Excel(name = "最后修改时间")
private Date updateDate;
@Excel(name = "删除标记,normal")
private String deleteFlag;
@Excel(name = "乐观锁")
private Integer versions;
}

30
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/redis/CaResidentUserRedis.java

@ -0,0 +1,30 @@
package com.epmet.opendata.redis;
import com.epmet.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
*
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-22
*/
@Component
public class CaResidentUserRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

15
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaResidentService.java

@ -5,12 +5,13 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.opendata.dto.ca.CaResidentDTO;
import com.epmet.opendata.dto.form.CaResidentDetailsFormDTO;
import com.epmet.opendata.dto.form.CaResidentFormDTO;
import com.epmet.opendata.dto.form.GetResidentDetailByIdCardFormDTO;
import com.epmet.opendata.dto.form.PreserVationFormDTO;
import com.epmet.opendata.dto.result.CaResidentDetailsResultDTO;
import com.epmet.opendata.dto.result.CaResidentResultDTO;
import com.epmet.opendata.dto.result.ResidentByIdCardResultDTO;
import com.epmet.opendata.entity.CaResidentEntity;
import java.util.List;
import java.util.Map;
@ -104,4 +105,14 @@ public interface CaResidentService extends BaseService<CaResidentEntity> {
* @return
*/
CaResidentDetailsResultDTO getResidentDetails(CaResidentDetailsFormDTO dto);
}
/**
* 根据idCard查询resident表数据
*
* @param form
* @return com.epmet.opendata.dto.result.ResidentByIdCardResultDTO
* @author LZN
* @date 2022/6/21 17:33
*/
ResidentByIdCardResultDTO getResidentDetailByIdCard(CaResidentDetailsFormDTO form);
}

82
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaResidentUserService.java

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

18
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaResidentServiceImpl.java

@ -5,9 +5,11 @@ import com.alibaba.fastjson.JSONObject;
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.annotation.LoginUser;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.commons.tools.utils.Result;
@ -17,9 +19,11 @@ import com.epmet.opendata.dto.ca.CaResidentDTO;
import com.epmet.opendata.dto.constant.CaWghDataConstant;
import com.epmet.opendata.dto.form.CaResidentDetailsFormDTO;
import com.epmet.opendata.dto.form.CaResidentFormDTO;
import com.epmet.opendata.dto.form.GetResidentDetailByIdCardFormDTO;
import com.epmet.opendata.dto.form.PreserVationFormDTO;
import com.epmet.opendata.dto.result.CaResidentDetailsResultDTO;
import com.epmet.opendata.dto.result.CaResidentResultDTO;
import com.epmet.opendata.dto.result.ResidentByIdCardResultDTO;
import com.epmet.opendata.entity.CaResidentEntity;
import com.epmet.opendata.redis.CaResidentRedis;
import com.epmet.opendata.service.CaResidentService;
@ -155,6 +159,20 @@ public class CaResidentServiceImpl extends BaseServiceImpl<CaResidentDao, CaResi
return result;
}
/**
* 根据idCard查询resident表数据
*
* @param form
* @return com.epmet.opendata.dto.result.ResidentByIdCardResultDTO
* @author LZN
* @date 2022/6/21 17:33
*/
@Override
public ResidentByIdCardResultDTO getResidentDetailByIdCard(CaResidentDetailsFormDTO form) {
ResidentByIdCardResultDTO dto = baseDao.getResidentDetailByIdCard(form);
return dto;
}
private int listResident(PreserVationFormDTO dto) throws Exception {
String aes = AesUtils.encryptByAES(JSONObject.toJSONString(dto), CaWghDataConstant.AESKEY);

99
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaResidentUserServiceImpl.java

@ -0,0 +1,99 @@
package com.epmet.opendata.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.opendata.dao.CaResidentUserDao;
import com.epmet.opendata.dto.ca.CaResidentUserDTO;
import com.epmet.opendata.dto.form.SaveCaResidentUserFormDTO;
import com.epmet.opendata.entity.CaResidentEntity;
import com.epmet.opendata.entity.CaResidentUserEntity;
import com.epmet.opendata.redis.CaResidentUserRedis;
import com.epmet.opendata.service.CaResidentUserService;
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.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
*
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-22
*/
@Service
public class CaResidentUserServiceImpl extends BaseServiceImpl<CaResidentUserDao, CaResidentUserEntity> implements CaResidentUserService {
@Autowired
private CaResidentUserRedis caResidentUserRedis;
@Override
public PageData<CaResidentUserDTO> page(Map<String, Object> params) {
IPage<CaResidentUserEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, CaResidentUserDTO.class);
}
@Override
public List<CaResidentUserDTO> list(Map<String, Object> params) {
List<CaResidentUserEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, CaResidentUserDTO.class);
}
private QueryWrapper<CaResidentUserEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<CaResidentUserEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public CaResidentUserDTO get(String id) {
CaResidentUserEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, CaResidentUserDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(CaResidentUserDTO dto) {
CaResidentUserEntity entity = ConvertUtils.sourceToTarget(dto, CaResidentUserEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(CaResidentUserDTO dto) {
CaResidentUserEntity entity = ConvertUtils.sourceToTarget(dto, CaResidentUserEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public void saveCaResidentUser(SaveCaResidentUserFormDTO dto) {
CaResidentUserEntity entity = ConvertUtils.sourceToTarget(dto,CaResidentUserEntity.class);
insert(entity);
}
}

3
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/V0.0.7__drop_home_id_and_ic_resi_user.sql

@ -0,0 +1,3 @@
ALTER TABLE `epmet_open_data`.`ca_resident`
DROP COLUMN `home_id`,
DROP COLUMN `ic_resi_user`;

52
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/V0.0.8__update_view_create_table.sql

@ -0,0 +1,52 @@
DROP TABLE IF EXISTS `business_bind_org`;
CREATE TABLE `business_bind_org` (
`ID` varchar(64) CHARACTER SET utf8mb4 NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 NOT NULL COMMENT '客户Id',
`business_org_id` varchar(64) CHARACTER SET utf8mb4 NOT NULL COMMENT '本系统业务机构ID',
`business_code` varchar(32) CHARACTER SET utf8mb4 NOT NULL COMMENT '综治ca;网格化wgh',
`third_org_id` varchar(64) CHARACTER SET utf8mb4 NOT NULL COMMENT '第三方机构ID',
`DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除',
`REVISION` int(11) NOT NULL DEFAULT '1' COMMENT '乐观锁',
`CREATED_BY` varchar(64) CHARACTER SET utf8mb4 NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`),
KEY `idx_grid_grid_id` (`third_org_id`(8)) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
DROP VIEW IF EXISTS `view_grid_comm_street`;
CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `view_grid_comm_street_ca` AS SELECT
`g4`.`grid_id` AS `grid_id`,
`g4`.`grid_name` AS `grid_name`,
`g3`.`grid_id` AS `community_id`,
`g3`.`grid_name` AS `community_name`,
`g2`.`grid_id` AS `street_id`,
`g2`.`grid_name` AS `street_name`,
concat( `g2`.`grid_id`, ':', `g3`.`grid_id`, ':', `g4`.`grid_id` ) AS `grid_id_path`,
`bbo`.`business_org_id` AS `business_org_id`
FROM
(((
`ca_bm_grid` `g4`
JOIN `ca_bm_grid` `g3` ON (((
`g3`.`grid_id` = `g4`.`parent_id`
)
AND ( `g3`.`grid_level` = 'level3' )
AND ( `g3`.`delete_flag` = 'normal' ))))
JOIN `ca_bm_grid` `g2` ON (((
`g2`.`grid_id` = `g3`.`parent_id`
)
AND ( `g2`.`grid_level` = 'level2' )
AND ( `g2`.`delete_flag` = 'normal' ))))
LEFT JOIN `business_bind_org` `bbo` ON (((
`g4`.`grid_id` = `bbo`.`business_org_id`
)
AND ( `bbo`.`business_code` = 'ca' )
AND ( `bbo`.`DEL_FLAG` = '0' ))))
WHERE
((
`g4`.`grid_level` = 'level4'
)
AND ( `g4`.`delete_flag` = 'normal' ))

14
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/V0.0.9__create_ca_resident_user_table.sql

@ -0,0 +1,14 @@
DROP TABLE IF EXISTS `ca_resident_user`;
CREATE TABLE `ca_resident_user` (
`id` varchar(64) NOT NULL,
`id_card` varchar(64) DEFAULT NULL COMMENT '身份证号',
`ic_resi_user_id` varchar(255) DEFAULT NULL COMMENT 'ic_resi_user表id',
`home_id` varchar(200) DEFAULT NULL COMMENT '绑定的房屋id',
`created_by` varchar(64) DEFAULT NULL COMMENT '创建人',
`CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`updated_by` varchar(64) DEFAULT NULL COMMENT '最后修改人',
`updated_time` datetime DEFAULT NULL COMMENT '最后修改时间',
`del_flag` varchar(1) DEFAULT NULL COMMENT '删除标记,normal',
`revision` int(11) DEFAULT '1' COMMENT '乐观锁',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

2
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaLoudongDao.xml

@ -88,7 +88,7 @@
vs.street_name
FROM
ca_loudong as ca
LEFT JOIN view_grid_comm_street as vs on ca.grid_id = vs.grid_id
LEFT JOIN view_grid_comm_street_ca as vs on ca.grid_id = vs.grid_id
<where>
ca.delete_flag = 'normal'
<if test="communityName != null and communityName != ''">

2
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaPingfangDao.xml

@ -85,7 +85,7 @@
vs.street_name
FROM
ca_pingfang as ca
left join view_grid_comm_street as vs on ca.grid_id = vs.grid_id
left join view_grid_comm_street_ca as vs on ca.grid_id = vs.grid_id
<where>
ca.delete_flag = 'normal'
<if test="buildingName != null and buildingName != ''">

2
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaRentalDao.xml

@ -77,7 +77,7 @@
vs.street_name
FROM
ca_rental as ca
left join view_grid_comm_street as vs on ca.grid_id = vs.grid_id
left join view_grid_comm_street_ca as vs on ca.grid_id = vs.grid_id
<where>
ca.delete_flag = 'normal'
<if test="residentName != null and residentName != ''">

48
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaResidentDao.xml

@ -106,7 +106,7 @@
vs.street_name
FROM
ca_resident as ca
left join view_grid_comm_street as vs on ca.grid_id = vs.grid_id
left join view_grid_comm_street_ca as vs on ca.grid_id = vs.grid_id
<where>
ca.delete_flag = 'normal'
<if test="residentName != null and residentName != ''">
@ -136,6 +136,52 @@
</if>
</where>
</select>
<select id="getResidentDetailByIdCard"
resultType="com.epmet.opendata.dto.result.ResidentByIdCardResultDTO">
SELECT
resident_property,
resident_type,
id_type,
ID_CARD,
resident_name,
sex,
BIRTHDAY,
nation,
telephone,
household_prov,
household_city,
household_county,
household_town,
household_address_detail,
curlive_prov,
curlive_city,
curlive_county,
curlive_town,
curlive_village,
curlive_address_detail,
native_address_prov,
native_address_city,
native_address_county,
former_name,
EDUCATION,
occupation,
occupation_type,
service_address,
marriage_status,
party,
religious,
conversion_state,
nationality,
plat_code
FROM
ca_resident
<where>
delete_flag = 'normal'
<if test="form.idCard != null and form.idCard != ''">
AND id_card = #{form.idCard}
</if>
</where>
</select>
</mapper>

8
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaResidentUserDao.xml

@ -0,0 +1,8 @@
<?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.opendata.dao.CaResidentUserDao">
</mapper>

2
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaRotatorsDao.xml

@ -109,7 +109,7 @@
vs.street_name
FROM
ca_rotators as ca
left join view_grid_comm_street as vs on vs.grid_id = ca.grid_id
left join view_grid_comm_street_ca as vs on vs.grid_id = ca.grid_id
<where>
ca.delete_flag = 'normal'
<if test="rotatorsName != null and rotatorsName != ''">

29
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BindHomeFormDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
@Data
public class BindHomeFormDTO implements Serializable {
private static final long serialVersionUID = -6084569462551209768L;
/**
* 身份证号
*/
@NotBlank(message = "身份证号不能为空")
private String idCard;
/**
* 房屋id
*/
@NotBlank(message = "房屋id不能为空")
private String homeId;
/**
* 用户id
*/
private String customerId;
}

6
epmet-user/epmet-user-server/pom.xml

@ -159,6 +159,12 @@
<artifactId>common-service-client</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>open-data-worker-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

53
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java

@ -227,14 +227,15 @@ public class IcResiUserController implements ResultDataResolver {
/**
* desc:发送 志愿者变动消息
*
* @param customerId
* @param resiUserId
*/
private void sendVolunteerMsg(String customerId, String resiUserId) {
//发送志愿者人员消息变动
boolean flag = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendRocketMqMsg(SystemMessageType.VOLUNTEER_CHANGED, new MqBaseFormDTO(customerId, resiUserId));
if (!flag){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"发送志愿者变动消息失败","发送志愿者变动消息失败");
if (!flag) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "发送志愿者变动消息失败", "发送志愿者变动消息失败");
}
}
@ -262,13 +263,13 @@ public class IcResiUserController implements ResultDataResolver {
*/
@NoRepeatSubmit
@PostMapping("changeIcResiUserBelongTo")
Result<Boolean> changeIcResiUserBelongTo(@LoginUser TokenDto tokenDto, @RequestBody IcUserBelongToChangedFormDTO formDTO){
Result<Boolean> changeIcResiUserBelongTo(@LoginUser TokenDto tokenDto, @RequestBody IcUserBelongToChangedFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO);
List<String> changedUserIds = icResiUserService.changeIcResiUserBelongTo(tokenDto,formDTO);
List<String> changedUserIds = icResiUserService.changeIcResiUserBelongTo(tokenDto, formDTO);
//推送MQ事件
if (CollectionUtils.isNotEmpty(changedUserIds)){
changedUserIds.forEach(resiUserId->editResiMq(tokenDto.getCustomerId(), resiUserId));
if (CollectionUtils.isNotEmpty(changedUserIds)) {
changedUserIds.forEach(resiUserId -> editResiMq(tokenDto.getCustomerId(), resiUserId));
}
return new Result<Boolean>().ok(true);
@ -498,7 +499,7 @@ public class IcResiUserController implements ResultDataResolver {
* @return void
* @author LiuJanJun
* @date 2021/11/19 4:24 下午
* @remark:分页批量导出 oss目录在 各个环境对应的前缀文件夹/file-template/resi-template/客户ID.xlsx,
* @remark:分页批量导出 oss目录在 各个环境对应的前缀文件夹/file-template/resi-template/客户ID.xlsx,
* 如果某个客户需要更新模版 则替换掉上面的模版文件然后 更新缓存里的值或者删除也行 再导出就会下载新的模版了
*/
@NoRepeatSubmit
@ -507,22 +508,23 @@ public class IcResiUserController implements ResultDataResolver {
try {
//获取导出配置
String aDefault = tokenDto.getCustomerId().concat(StrConstant.UNDER_LINE).concat("default");
if (pageFormDTO.getTemplateId().equals(aDefault)){
if (pageFormDTO.getTemplateId().equals(aDefault)) {
log.info("通过原来的模板下载,tokenDto:{}", JSON.toJSONString(tokenDto));
this.exportExcelByEasyExcel(tokenDto,pageFormDTO.getSearchForm(),response);
}else{
icResiUserExportService.exportIcResiUser(tokenDto,pageFormDTO,response);
this.exportExcelByEasyExcel(tokenDto, pageFormDTO.getSearchForm(), response);
} else {
icResiUserExportService.exportIcResiUser(tokenDto, pageFormDTO, response);
}
} catch (EpmetException e) {
response.reset();
response.setCharacterEncoding("UTF-8");
response.setHeader("content-type", "application/json; charset=UTF-8");
PrintWriter printWriter = response.getWriter();
Result<Object> result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),e.getMsg());
Result<Object> result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg());
printWriter.write(JSON.toJSONString(result));
printWriter.close();
}
}
/**
* desc:根据客户id 先从oss下载模版,如果有没有则使用系统默认模板 如果不存在则返回null
*
@ -726,7 +728,7 @@ public class IcResiUserController implements ResultDataResolver {
* 新增需求需求人列表展示当前工作人员所属组织+页面已选择所属网格 下的居民列
*/
@PostMapping("demandusers")
public Result<List<DemandUserResDTO>> queryDemandUsers(@LoginUser TokenDto tokenDto,@RequestBody DemandUserFormDTO formDTO) {
public Result<List<DemandUserResDTO>> queryDemandUsers(@LoginUser TokenDto tokenDto, @RequestBody DemandUserFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, DemandUserFormDTO.InternalGroup.class);
@ -993,8 +995,8 @@ public class IcResiUserController implements ResultDataResolver {
* @date 2022/1/17 4:25 下午
*/
@PostMapping("personwarn/rightlist")
@MaskResponse(fieldNames = "mobile", fieldsMaskType = { MaskResponse.MASK_TYPE_MOBILE })
public Result<PersonWarnRightListResultDTO> personWarnRightList(@RequestBody PersonWarnRightListFormDTO formDTO, @LoginUser TokenDto tokenDto){
@MaskResponse(fieldNames = "mobile", fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE})
public Result<PersonWarnRightListResultDTO> personWarnRightList(@RequestBody PersonWarnRightListFormDTO formDTO, @LoginUser TokenDto tokenDto) {
ValidatorUtils.validateEntity(formDTO, PersonWarnRightListFormDTO.PersonWarnRightListForm.class);
return new Result<PersonWarnRightListResultDTO>().ok(icResiUserService.personWarnRightList(formDTO, tokenDto));
}
@ -1049,6 +1051,7 @@ public class IcResiUserController implements ResultDataResolver {
/**
* 根据房屋id,查询居民信息表中-家庭信息-本人 的居民如果有多个返回最近一个
*
* @param homeId
* @param loginUser
* @return
@ -1075,6 +1078,7 @@ public class IcResiUserController implements ResultDataResolver {
/**
* desc:条件获取房屋内的居民 按房屋分组
*
* @param formDTO
* @return
*/
@ -1085,6 +1089,7 @@ public class IcResiUserController implements ResultDataResolver {
/**
* 使用身份证号查询家属信息
*
* @param idCard
* @return
*/
@ -1096,6 +1101,7 @@ public class IcResiUserController implements ResultDataResolver {
/**
* 身份证号查询居民信息
*
* @param idCard
* @return
*/
@ -1149,8 +1155,25 @@ public class IcResiUserController implements ResultDataResolver {
return new Result<IcResiUserInfoDTO>().ok(icResiUserService.getUserByIdCard(formDTO));
}
/**
* 绑定房屋
*
* @param form
* @return com.epmet.commons.tools.utils.Result
* @author LZN
* @date 2022/6/22 16:29
*/
@PostMapping("/bindHome")
public Result bindHome(@RequestBody BindHomeFormDTO form, @LoginUser TokenDto tokenDto) {
ValidatorUtils.validateEntity(form);
form.setCustomerId(tokenDto.getCustomerId());
icResiUserService.bindHome(form);
return new Result();
}
/**
* 根据身份证获取居民角色目前只有是否是志愿者
*
* @Param tokenDto
* @Param formDTO
* @Return {@link Result<IcUserRoleResultDTO>}

4
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java

@ -127,7 +127,9 @@ public interface CustomerStaffDao extends BaseDao<CustomerStaffEntity> {
* @Author sun
* @Description 根据staffId集合查询工作人员基础信息
**/
List<StaffListResultDTO> selectStaffByIds(@Param("staffIdList") List<String> staffIdList);
List<StaffListResultDTO> selectStaffByIds(@Param("staffIdList") List<String> staffIdList,
@Param("enableFlag") String enableFlag);
/**
* @param staffId

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

@ -341,6 +341,37 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
*/
List<IcVolunteerPolyDTO> getVolunteerList(@Param("customerId") String customerId, @Param("userId") String userId);
/**
* 统计数据
*
* @param idCard
* @param customerId
* @return int
* @author LZN
* @date 2022/6/23 9:47
*/
int selectCountByIdCard(@Param("idCard") String idCard, @Param("customerId") String customerId);
/**
* 根据身份证号修改数据
*
* @param entity
* @return void
* @author LZN
* @date 2022/6/23 9:47
*/
void updateIcResiUserByIdCard(@Param("entity") IcResiUserEntity entity);
/**
* 根据身份证号查询id
*
* @param customerId
* @param idCard
* @return
*/
String seletIdByIdCard(@Param("customerId") String customerId, @Param("idCard") String idCard);
/**
* @return com.epmet.dto.IcResiUserConfirmDTO
* @describe: 查询家庭成员信息

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

@ -382,6 +382,16 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
*/
IcResiUserInfoDTO getUserByIdCard(IcResiUserDTO formDTO);
/**
* 绑定房屋
*
* @param form
* @return void
* @author LZN
* @date 2022/6/22 16:30
*/
void bindHome(BindHomeFormDTO form);
/**
* 根据身份证获取居民角色目前只有是否是志愿者
*
@ -411,12 +421,12 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
Result editMember(IcResiUserConfirmSubmitDTO dto);
/**
* @describe: 工作端-新增家庭成员
* @author wangtong
* @date 2022/6/10 13:32
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
* @return com.epmet.commons.tools.utils.Result
* @describe: 工作端-新增家庭成员
* @author wangtong
* @date 2022/6/10 13:32
* @params [dto]
*/
Result addWorkMember(IcResiUserConfirmSubmitDTO dto);
/**

12
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -22,10 +22,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.entity.DataScope;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.constant.*;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ExceptionUtils;
@ -505,7 +502,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
@Override
public CustomerStaffListResultDTO getCustomerStaffList(List<String> staffIdList) {
//1:批量查询人员基本信息
List<StaffListResultDTO> staffList = baseDao.selectStaffByIds(staffIdList);
List<StaffListResultDTO> staffList = baseDao.selectStaffByIds(staffIdList, null);
//2:批量查询人员拥有的所有角色信息
List<CustomerStaffRoleResultDTO> roleList = staffRoleDao.selectStaffRoleList(staffIdList);
CustomerStaffListResultDTO list = new CustomerStaffListResultDTO();
@ -640,7 +637,6 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
return staffInfoList;
}
/**
* @param staffParam
* @return
@ -725,6 +721,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
return new Result<List<CustomerListResultDTO>>().ok(listResultDTO);
}
@Override
public Result<StaffBasicInfoResultDTO> selectStaffBasicInfo(String userId, String customerId) {
StaffBasicInfoResultDTO resultDTO = baseDao.selectStaffBasicInfo(userId);
@ -777,6 +774,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
* @author sun
*/
@Override
public BasicInfoResultDTO getStaffBasicInfo(StaffBasicInfoFromDTO fromDTO) {
return baseDao.getStaffBasicInfo(fromDTO);
}
@ -838,7 +836,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
//3.查询工作人员基础信息
List<String> staffIdList = staffRoleList.stream().map(GridMobileListResultDTO.Role::getStaffId).collect(Collectors.toList());
staffIdList = staffIdList.stream().distinct().collect(Collectors.toList());
List<StaffListResultDTO> list = baseDao.selectStaffByIds(staffIdList);
List<StaffListResultDTO> list = baseDao.selectStaffByIds(staffIdList, Constant.ENABLE);
//4.封装数据并返回
resultList = ConvertUtils.sourceToTarget(list, GridMobileListResultDTO.class);

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

@ -56,12 +56,16 @@ import com.epmet.dto.form.*;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.dto.result.*;
import com.epmet.dto.result.demand.IcResiDemandDictDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.*;
import com.epmet.excel.support.ExportResiUserItemDTO;
import com.epmet.feign.*;
import com.epmet.opendata.dto.form.GetResidentDetailByIdCardFormDTO;
import com.epmet.opendata.dto.form.SaveCaResidentUserFormDTO;
import com.epmet.opendata.dto.result.ResidentByIdCardResultDTO;
import com.epmet.opendata.feign.GuardarDatosFeignClient;
import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient;
import com.epmet.service.*;
import com.epmet.dto.result.demand.OptionDTO;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@ -80,9 +84,10 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.Date;
import java.sql.Timestamp;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
@ -139,9 +144,13 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
private IcPartyMemberDao icPartyMemberDao;
@Resource
private IcVolunteerDao icVolunteerDao;
@Autowired
private GuardarDatosFeignClient guardarDatosFeignClient;
@Resource
private ResiPartyMemberOpenFeignClient resiPartyMemberOpenFeignClient;
@Resource
private GovOrgOpenFeignClient getGovOrgOpenFeignClient;
@Resource
private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient;
@Resource
private UserBaseInfoDao userBaseInfoDao;
@ -194,7 +203,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
});
});
if (str.length() > NumConstant.ZERO ) {
if (str.length() > NumConstant.ZERO) {
String errorMsg = String.format("新增居民信息,必要字段值为空,%s值为空", str);
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
}
@ -208,7 +217,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
String name = "";
LinkedHashMap<String, String> map = new LinkedHashMap<>();
com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO partyMemberDTO = new com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO();
Map<String, List<LinkedHashMap<String,String>>> formMap = formDTO.stream().collect(Collectors.toMap(IcResiUserFormDTO::getTableName, IcResiUserFormDTO::getList));
Map<String, List<LinkedHashMap<String, String>>> formMap = formDTO.stream().collect(Collectors.toMap(IcResiUserFormDTO::getTableName, IcResiUserFormDTO::getList));
boolean isDyzxh = false;
//判断是否是党员中心户
if (formMap.containsKey("ic_party_member")) {
@ -326,13 +335,13 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
//2022.05.18 start zhaoqf 党员信息同步
if ("ic_party_member".equals(d.getTableName())) {
for (LinkedHashMap<String, String> hash : d.getList()) {
partyMemberDTO.setRdsj(hash.get("RDSJ"));
partyMemberDTO.setSszb(hash.get("SSZB"));
partyMemberDTO.setIsLd(hash.get("IS_LD"));
partyMemberDTO.setLdzh(hash.get("LDZH"));
partyMemberDTO.setPartyZw(hash.get("PARTY_ZW"));
partyMemberDTO.setIsTx(hash.get("IS_TX"));
partyMemberDTO.setIsDyzxh(hash.get("IS_DYZXH"));
partyMemberDTO.setRdsj(hash.get("RDSJ"));
partyMemberDTO.setSszb(hash.get("SSZB"));
partyMemberDTO.setIsLd(hash.get("IS_LD"));
partyMemberDTO.setLdzh(hash.get("LDZH"));
partyMemberDTO.setPartyZw(hash.get("PARTY_ZW"));
partyMemberDTO.setIsTx(hash.get("IS_TX"));
partyMemberDTO.setIsDyzxh(hash.get("IS_DYZXH"));
}
}
if ("ic_volunteer".equals(d.getTableName())) {
@ -349,7 +358,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
}
//3.变更记录表和变更记录明细表新增数据
saveUserChangeRecord(tokenDto,map,resiUserId,name);
saveUserChangeRecord(tokenDto, map, resiUserId, name);
return resiUserId;
@ -437,7 +446,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
String resiUserId = "";
LinkedHashMap<String, String> map = new LinkedHashMap<>();
com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO partyMemberDTO = new com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO();
Map<String, List<LinkedHashMap<String,String>>> formMap = formDTO.stream().collect(Collectors.toMap(IcResiUserFormDTO::getTableName, IcResiUserFormDTO::getList));
Map<String, List<LinkedHashMap<String, String>>> formMap = formDTO.stream().collect(Collectors.toMap(IcResiUserFormDTO::getTableName, IcResiUserFormDTO::getList));
boolean isDyzxh = false;
//判断是否是党员中心户
if (formMap.containsKey("ic_party_member")) {
@ -498,7 +507,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
}
if ((map.containsKey("IS_PARTY") && NumConstant.ONE_STR.equals(map.get("IS_PARTY")))
|| (!map.containsKey("IS_PARTY") && NumConstant.ONE_STR.equals(icResiUser.getIsParty()))) {
|| (!map.containsKey("IS_PARTY") && NumConstant.ONE_STR.equals(icResiUser.getIsParty()))) {
partyMemberDTO.setCustomerId(tokenDto.getCustomerId());
partyMemberDTO.setAgencyId(icResiUser.getAgencyId());
partyMemberDTO.setAgencyPids(icResiUser.getPids());
@ -745,13 +754,6 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
@Override
public PageData<Map<String, Object>> pageResiMap(IcResiUserPageFormDTO formDTO) {
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
String staffOrgPath;
if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) {
staffOrgPath = staffInfoCacheResult.getAgencyPIds().concat(":").concat(staffInfoCacheResult.getAgencyId());
} else {
staffOrgPath = staffInfoCacheResult.getAgencyId();
}
// 查询列表展示项,如果没有,直接返回
CustomerFormQueryDTO queryDTO1 = new CustomerFormQueryDTO();
@ -765,7 +767,36 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
List<IcFormResColumnDTO> resultColumns = resultColumnRes.getData();
// 查询结果列对应的表:
Set<String> resultColumnTables = resultColumns.stream().map(IcFormResColumnDTO::getTableName).collect(Collectors.toSet());
List<String> queryAgencyIdList = formDTO.getConditions().stream()
.filter(o -> IcResiUserConstant.IC_RESI_USER.equals(o.getTableName()) && "AGENCY_ID".equals(o.getColumnName()))
.flatMap(o -> o.getColumnValue().stream()).collect(Collectors.toList());
//添加数据权限
String staffOrgPath;
String agencyId;
//如果查询条件中 有居民表的agencyId 则匹配查询该组织下的 数据
if (queryAgencyIdList.isEmpty()){
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
agencyId = staffInfoCacheResult.getAgencyId();
if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) {
staffOrgPath = staffInfoCacheResult.getAgencyPIds().concat(":").concat(staffInfoCacheResult.getAgencyId());
} else {
staffOrgPath = staffInfoCacheResult.getAgencyId();
}
} else {
formDTO.getConditions().removeIf(o->IcResiUserConstant.IC_RESI_USER.equals(o.getTableName()) && "AGENCY_ID".equals(o.getColumnName()));
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(queryAgencyIdList.get(NumConstant.ZERO));
if (agencyInfo == null){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"获取组织信息失败");
}
agencyId = agencyInfo.getId();
staffOrgPath = agencyInfo.getPids();
if (StringUtils.isBlank(staffOrgPath)){
staffOrgPath = agencyId;
}else{
staffOrgPath = staffOrgPath+StrConstant.COLON+agencyInfo.getId();
}
}
// 查询列表展示项需要用到哪些子表
Result<List<SubTableJoinDTO>> subTablesRes = operCustomizeOpenFeignClient.querySubTables(queryDTO1);
List<SubTableJoinDTO> subTables = subTablesRes.getData();
@ -778,20 +809,20 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
tables.addAll(resultColumnTables);
// log.info("2、查询条件+查询列对应的tables并集去重:"+ JSON.toJSONString(tables,true));
//最终关联的子表对应的sql:
List<String> finalSubTables =new ArrayList<>();
List<String> finalSubTables = new ArrayList<>();
//groupBy用到的表
Set<String> groupByTables=new HashSet<>();
subTables.forEach(subTable->{
if(tables.contains(subTable.getTableName())){
Set<String> groupByTables = new HashSet<>();
subTables.forEach(subTable -> {
if (tables.contains(subTable.getTableName())) {
finalSubTables.add(subTable.getJoinTableSql());
if(subTable.getSupportAdd()){
if (subTable.getSupportAdd()) {
groupByTables.add(subTable.getTableName());
}
}
});
PageInfo<Map<String, Object>> pageInfo=new PageInfo<>();
if (null == formDTO.getIsPage()||formDTO.getIsPage()) {
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>();
if (null == formDTO.getIsPage() || formDTO.getIsPage()) {
//分页
String finalStaffOrgPath = staffOrgPath;
pageInfo = PageHelper.startPage(formDTO.getPageNo(),
@ -800,19 +831,19 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
formDTO.getConditions(),
resultColumns,
finalSubTables,
staffInfoCacheResult.getAgencyId(), finalStaffOrgPath,null, formDTO.getKeyword(),
agencyId, finalStaffOrgPath,null, formDTO.getKeyword(),
groupByTables));
}else{
List<Map<String,Object>> list=baseDao.selectListResiMap(formDTO.getCustomerId(),
} else {
List<Map<String, Object>> list = baseDao.selectListResiMap(formDTO.getCustomerId(),
formDTO.getFormCode(),
formDTO.getConditions(),
resultColumns,
finalSubTables,
staffInfoCacheResult.getAgencyId(),
agencyId,
staffOrgPath,null,
formDTO.getKeyword(),
groupByTables);
pageInfo.setTotal(CollectionUtils.isEmpty(list)?NumConstant.ZERO:list.size());
pageInfo.setTotal(CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size());
pageInfo.setList(list);
}
@ -910,8 +941,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
if (CollectionUtils.isEmpty(demandCodePath)) {
return StrConstant.EPMETY_STR;
}
Set<String> nameList=new HashSet<>();
for(String codePath:demandCodePath){
Set<String> nameList = new HashSet<>();
for (String codePath : demandCodePath) {
if (StringUtils.isNotBlank(codePath) && codePath.contains(StrConstant.COMMA)) {
String[] codeAtt = codePath.split(StrConstant.COMMA);
String code = codeAtt[codeAtt.length - 1];
@ -973,48 +1004,48 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
* @return
*/
@Override
public List<Map<String,Object>> dynamicQuery(String customerId,
String formCode,
String resultTableName,
List<ResiUserQueryValueDTO> conditions,
String currentStaffAgencyId,
String staffOrgPath){
public List<Map<String, Object>> dynamicQuery(String customerId,
String formCode,
String resultTableName,
List<ResiUserQueryValueDTO> conditions,
String currentStaffAgencyId,
String staffOrgPath) {
// List<String> finalSubTables = getFinalSubables(customerId, formCode, resultTableName, conditions);
Map<String,List<String>> map=getFinalSubables(customerId, formCode, resultTableName, conditions, null);
return baseDao.dynamicQuery(customerId,resultTableName,conditions,map.get("finalSubTables"), null, currentStaffAgencyId,staffOrgPath,map.get("groupByTables"));
Map<String, List<String>> map = getFinalSubables(customerId, formCode, resultTableName, conditions, null);
return baseDao.dynamicQuery(customerId, resultTableName, conditions, map.get("finalSubTables"), null, currentStaffAgencyId, staffOrgPath, map.get("groupByTables"));
}
@NotNull
public Map<String,List<String>> getFinalSubables(String customerId, String formCode, String resultTableName, List<ResiUserQueryValueDTO> conditions, List<String> exportNeedTableList) {
Map<String,List<String>> map=new HashMap<>();
CustomerFormQueryDTO queryDTO=new CustomerFormQueryDTO();
public Map<String, List<String>> getFinalSubables(String customerId, String formCode, String resultTableName, List<ResiUserQueryValueDTO> conditions, List<String> exportNeedTableList) {
Map<String, List<String>> map = new HashMap<>();
CustomerFormQueryDTO queryDTO = new CustomerFormQueryDTO();
queryDTO.setCustomerId(customerId);
queryDTO.setFormCode(formCode);
//所有的子表
Result<List<SubTableJoinDTO>> subTablesRes=operCustomizeOpenFeignClient.querySubTables(queryDTO);
Result<List<SubTableJoinDTO>> subTablesRes = operCustomizeOpenFeignClient.querySubTables(queryDTO);
List<SubTableJoinDTO> subTables =subTablesRes.getData();
List<SubTableJoinDTO> subTables = subTablesRes.getData();
// log.info("1、所有的子表subTables:"+JSON.toJSONString(subTables,true));
//关联哪些子表:查询条件用到的表名+查询的列对应的表 并集去重
Set<String> tables = conditions.stream().map(ResiUserQueryValueDTO::getTableName).collect(Collectors.toSet());
tables.add(resultTableName);
if (CollectionUtils.isNotEmpty(exportNeedTableList)){
if (CollectionUtils.isNotEmpty(exportNeedTableList)) {
tables.addAll(exportNeedTableList);
}
// log.info("2、查询条件+查询列对应的tables并集去重:"+ JSON.toJSONString(tables,true));
//最终关联的子表对应的sql:
List<String> finalSubTables =new ArrayList<>();
List<String> finalSubTables = new ArrayList<>();
//groupBy用到的表
Set<String> groupByTables=new HashSet<>();
subTables.forEach(subTable->{
if(tables.contains(subTable.getTableName())){
Set<String> groupByTables = new HashSet<>();
subTables.forEach(subTable -> {
if (tables.contains(subTable.getTableName())) {
finalSubTables.add(subTable.getJoinTableSql());
if(subTable.getSupportAdd()){
if (subTable.getSupportAdd()) {
groupByTables.add(subTable.getTableName());
}
}
});
map.put("finalSubTables",finalSubTables);
map.put("finalSubTables", finalSubTables);
map.put("groupByTables", new ArrayList<>(groupByTables));
return map;
}
@ -1126,7 +1157,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
formDTO.getLevel(),
formDTO.getId(),
staffInfo.getAgencyId(),
no,formDTO.getCustomerId()));
no, formDTO.getCustomerId()));
List<SearchByNameResultDTO> result = pageInfo.getList();
if (CollectionUtils.isEmpty(result)) {
return new PageData<>(new ArrayList<>(), pageInfo.getTotal());
@ -1581,13 +1612,13 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
list = baseDao.vaccineList(formDTO);
}
Set<String> homeIds = list.stream().filter(m -> StringUtils.isNotBlank(m.getIdCard())).map(m -> m.getHomeId()).distinct().collect(Collectors.toSet());
if (CollectionUtils.isNotEmpty(homeIds)){
if (CollectionUtils.isNotEmpty(homeIds)) {
Result<List<HouseInfoDTO>> houseInfoRes = govOrgOpenFeignClient.queryListHouseInfo(homeIds, formDTO.getCustomerId());
if (!houseInfoRes.success()){
if (!houseInfoRes.success()) {
throw new EpmetException("查询居民所属房屋失败...");
}
if (CollectionUtils.isNotEmpty(houseInfoRes.getData())){
list.forEach(l -> houseInfoRes.getData().stream().filter( h -> h.getHomeId().equals(l.getHomeId())).forEach(h -> l.setHouseName(h.getAllName())));
if (CollectionUtils.isNotEmpty(houseInfoRes.getData())) {
list.forEach(l -> houseInfoRes.getData().stream().filter(h -> h.getHomeId().equals(l.getHomeId())).forEach(h -> l.setHouseName(h.getAllName())));
}
}
PageInfo<EpidemicPreventionResultDTO> pageInfo = new PageInfo<>(list);
@ -1774,7 +1805,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return new PageData<>(list, pageInfo.getTotal());
}
List<PartyMemberAgeResultDTO> list = baseDao.getPartyMemberAgeList(formDTO.getOrgType(), formDTO.getOrgId(), formDTO.getCode());
return new PageData<>(list, null == list?NumConstant.ZERO:list.size());
return new PageData<>(list, null == list ? NumConstant.ZERO : list.size());
}
/**
@ -1849,7 +1880,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
item.setEducation(null == mapResult.getData().get(item.getEducation()) ? "" : mapResult.getData().get(item.getEducation()));
});
}
return new PageData<>(list, null == list?NumConstant.ZERO:list.size());
return new PageData<>(list, null == list ? NumConstant.ZERO : list.size());
}
@ -2028,7 +2059,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
LambdaQueryWrapper<IcResiUserEntity> lqw = new LambdaQueryWrapper<>();
lqw.eq(IcResiUserEntity::getCustomerId, customerId)
.eq(IcResiUserEntity::getHomeId, homeId)
.eq(IcResiUserEntity::getYhzgx,RelationshipEnum.SELF.getCode())
.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode())
.select(
IcResiUserEntity::getId,
IcResiUserEntity::getName
@ -2079,17 +2110,13 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
@Override
public List<HouseIcResiUserResultDTO> getResiUserGroupHomeId(RentTenantDataFormDTO formDTO) {
//如果是组织 且非顶级组织 则利用pids 查询 本级及下级
if (StringUtils.isNotBlank(formDTO.getAgencyId())){
if (StringUtils.isNotBlank(formDTO.getAgencyId())) {
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getAgencyId());
if (agencyInfo == null){
log.warn("getResiUserGroupHomeId agencyId:{} is not exist",formDTO.getAgencyId());
if (agencyInfo == null) {
log.warn("getResiUserGroupHomeId agencyId:{} is not exist", formDTO.getAgencyId());
return null;
}
if (!NumConstant.ZERO_STR.equals(agencyInfo.getPid())) {
@ -2099,35 +2126,35 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
Page<HouseIcResiUserResultDTO> listPage = PageHelper
.startPage(formDTO.getPageNo(),formDTO.getPageSize(),formDTO.getIsPage())
.doSelectPage(()->baseDao.getResiUserGroupHomeId(formDTO));
.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage())
.doSelectPage(() -> baseDao.getResiUserGroupHomeId(formDTO));
List<String> dictTypeList = Arrays.asList(DictTypeEnum.EDUCATION.getCode(), DictTypeEnum.RELATIONSHIP.getCode(), DictTypeEnum.NATION.getCode());
Map<String,Map<String, String>> dictResult = new HashMap<>();
dictTypeList.forEach(dict->{
Map<String, Map<String, String>> dictResult = new HashMap<>();
dictTypeList.forEach(dict -> {
Result<Map<String, String>> mapResult = epmetAdminOpenFeignClient.dictMap(dict);
if (mapResult!=null && mapResult.success()){
dictResult.put(dict,mapResult.getData());
if (mapResult != null && mapResult.success()) {
dictResult.put(dict, mapResult.getData());
}
});
//婚姻状况
Map<String, String> hyzkMap = getOptionMap(formDTO.getCustomerId(),"HYZK");
Map<String, String> hyzkMap = getOptionMap(formDTO.getCustomerId(), "HYZK");
//遍历数据 转换为中文
listPage.getResult().forEach(e->{
e.getHouseMemberList().parallelStream().forEach(o->{
if (StringUtils.isNotBlank(o.getIsParty())){
o.setIsParty(NumConstant.ZERO_STR.equals(o.getIsParty())?StrConstant.NO:StrConstant.YES);
listPage.getResult().forEach(e -> {
e.getHouseMemberList().parallelStream().forEach(o -> {
if (StringUtils.isNotBlank(o.getIsParty())) {
o.setIsParty(NumConstant.ZERO_STR.equals(o.getIsParty()) ? StrConstant.NO : StrConstant.YES);
}
if (StringUtils.isNotBlank(o.getGender())){
if (StringUtils.isNotBlank(o.getGender())) {
o.setGender(GenderEnum.getName(o.getGender()));
}
if (StringUtils.isNotBlank(o.getIsTenant())){
o.setIsTenant(NumConstant.ZERO_STR.equals(o.getIsTenant())?StrConstant.NO:StrConstant.YES);
if (StringUtils.isNotBlank(o.getIsTenant())) {
o.setIsTenant(NumConstant.ZERO_STR.equals(o.getIsTenant()) ? StrConstant.NO : StrConstant.YES);
}
if (StringUtils.isNotBlank(o.getIsFloating())){
o.setIsFloating(NumConstant.ZERO_STR.equals(o.getIsFloating())?StrConstant.NO:StrConstant.YES);
if (StringUtils.isNotBlank(o.getIsFloating())) {
o.setIsFloating(NumConstant.ZERO_STR.equals(o.getIsFloating()) ? StrConstant.NO : StrConstant.YES);
}
Map<String, String> mzMap = dictResult.get(DictTypeEnum.NATION.getCode());
Map<String, String> whcdMap = dictResult.get(DictTypeEnum.EDUCATION.getCode());
@ -2153,8 +2180,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
@Transactional(rollbackFor = Exception.class)
@Override
public List<String> changeIcResiUserBelongTo(TokenDto tokenDto, IcUserBelongToChangedFormDTO formDTO) {
List<String> resiUserIdList = baseDao.listUserIds(formDTO.getCustomerId(),formDTO.getSourceGridId());
if (CollectionUtils.isEmpty(resiUserIdList)){
List<String> resiUserIdList = baseDao.listUserIds(formDTO.getCustomerId(), formDTO.getSourceGridId());
if (CollectionUtils.isEmpty(resiUserIdList)) {
return null;
}
List<IcResiUserFormDTO> icResiUserFormDTOS = new ArrayList<>();
@ -2168,9 +2195,9 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
e.setList(list);
icResiUserFormDTOS.add(e);
resiUserIdList.forEach(userId->{
resiUserIdList.forEach(userId -> {
map.put(FieldConstant.ID, userId);
this.edit(tokenDto,icResiUserFormDTOS);
this.edit(tokenDto, icResiUserFormDTOS);
});
return resiUserIdList;
@ -2193,7 +2220,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
//获取居民信息
IcResiUserEntity user = baseDao.selectById(formDTO.getIcResiUser());
//居民信息不存在时返回
if(null == user) {
if (null == user) {
return dto;
}
if (!user.getIdCard().equals(dto.getIdCard())) {
@ -2202,7 +2229,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
wrapper.eq(IcResiUserEntity::getIdCard, formDTO.getIdCard());
wrapper.eq(IcResiUserEntity::getStatus, NumConstant.ZERO_STR);
user = baseDao.selectOne(wrapper);
if(null == user) {
if (null == user) {
return dto;
}
}
@ -2228,7 +2255,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
wrapper.eq(IcResiUserEntity::getStatus, NumConstant.ZERO_STR);
IcResiUserEntity user = baseDao.selectOne(wrapper);
//居民信息不存在时返回
if(null == user) {
if (null == user) {
return dto;
}
dto.setIcResiUser(user.getId());
@ -2595,20 +2622,106 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return result;
}
/**
* 绑定房屋
*
* @param form
* @return void
* @author LZN
* @date 2022/6/22 16:30
*/
@Override
public void bindHome(BindHomeFormDTO form) {
// 根据idCard获取ca_redident表的数据
if (StringUtils.isBlank(form.getIdCard())) {
throw new RenException("身份证号不能为空");
}
GetResidentDetailByIdCardFormDTO dto = new GetResidentDetailByIdCardFormDTO();
dto.setIdCard(form.getIdCard());
Result<ResidentByIdCardResultDTO> result = guardarDatosFeignClient.getResidentDetailByIdCard(dto);
ResidentByIdCardResultDTO residentDetailByIdCard = result.getData();
if (org.springframework.util.StringUtils.isEmpty(residentDetailByIdCard)) {
throw new RenException("获取不到人的信息");
}
// 根据房屋id获取房屋信息
if (StringUtils.isBlank(form.getHomeId())) {
throw new RenException("房屋id不能为空");
}
HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(form.getCustomerId(), form.getHomeId());
if (org.springframework.util.StringUtils.isEmpty(houseInfo)) {
throw new RenException("获取不到房屋信息");
}
// 将人的信息放入ic_resi_user对象中
IcResiUserEntity entity = new IcResiUserEntity();
entity.setCustomerId(form.getCustomerId());
// 进行日期转换
if(residentDetailByIdCard.getBirthday() == null){
throw new RenException("出生日期为空");
}
Date d = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String birthday = sdf.format(residentDetailByIdCard.getBirthday());
if (StringUtils.isNotBlank(residentDetailByIdCard.getIdCard())
&& StringUtils.isNotBlank(residentDetailByIdCard.getResidentName())
&& StringUtils.isNotBlank(residentDetailByIdCard.getTelephone())
&& StringUtils.isNotBlank(birthday)) {
entity.setIdCard(residentDetailByIdCard.getIdCard());
entity.setName(residentDetailByIdCard.getResidentName());
entity.setMobile(residentDetailByIdCard.getTelephone());
entity.setBirthday(birthday);
} else {
throw new RenException("人信息不全");
}
// 将房屋的信息放入ic_resi_user对象中
if (StringUtils.isNotBlank(houseInfo.getHomeId())
&& StringUtils.isNotBlank(houseInfo.getNeighborHoodId())
&& StringUtils.isNotBlank(houseInfo.getBuildingId())
&& StringUtils.isNotBlank(houseInfo.getBuildingUnitId())) {
entity.setHomeId(houseInfo.getHomeId());
entity.setVillageId(houseInfo.getNeighborHoodId());
entity.setBuildId(houseInfo.getBuildingId());
entity.setUnitId(houseInfo.getBuildingUnitId());
entity.setAgencyId(houseInfo.getAgencyId());
// 根据homeId获取gridId和pids
Result<HouseAgencyInfoResultDTO> resultDTOResult = getGovOrgOpenFeignClient.getHouseAgencyInfo(houseInfo.getHomeId());
entity.setGridId(resultDTOResult.getData().getGridId());
entity.setPids(resultDTOResult.getData().getPids());
} else {
throw new RenException("房屋信息不全");
}
SaveCaResidentUserFormDTO saveForm = new SaveCaResidentUserFormDTO();
saveForm.setHomeId(form.getHomeId());
saveForm.setIdCard(form.getIdCard());
if (baseDao.selectCountByIdCard(form.getIdCard(), form.getCustomerId()) > 0) {
String id = baseDao.seletIdByIdCard(entity.getCustomerId(),entity.getIdCard());
baseDao.updateIcResiUserByIdCard(entity);
saveForm.setIcResiUserId(id);
guardarDatosFeignClient.saveCaResidentUser(saveForm);
} else {
baseDao.insert(entity);
String id = baseDao.seletIdByIdCard(entity.getCustomerId(),entity.getIdCard());
saveForm.setIcResiUserId(id);
guardarDatosFeignClient.saveCaResidentUser(saveForm);
}
}
/**
* desc:根据字段值获取 options
*
* @param customerId
* @param columnName
* @return
*/
private Map<String, String> getOptionMap(String customerId,String columnName) {
private Map<String, String> getOptionMap(String customerId, String columnName) {
IcFormOptionsQueryFormDTO optionsForm = new IcFormOptionsQueryFormDTO();
optionsForm.setCustomerId(customerId);
optionsForm.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode());
optionsForm.setColumnName(columnName);
Result<List<IcFormItemOptionsDTO>> listResult = operCustomizeOpenFeignClient.listOptionsByItemConditions(optionsForm);
if (!listResult.success()){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"获取item失败,"+listResult.getInternalMsg());
if (!listResult.success()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取item失败," + listResult.getInternalMsg());
}
return listResult.getData().stream()
.collect(Collectors.toMap(IcFormItemOptionsDTO::getOptionValue, IcFormItemOptionsDTO::getOptionLabel, (o1, o2) -> o1));

6
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java

@ -81,6 +81,9 @@ public class UserBadgeServiceImpl implements UserBadgeService {
this.reloadCustomerBadge(userBadgeListFormDTO.getCustomerId());
userBadge = userBadgeRedis.getCustomerBadge(userBadgeListFormDTO.getCustomerId());
}
if (null == userBadge){
return new ArrayList<>();
}
List<UserBadgeListResultDTO> redisUserBadgeList = JSON.parseArray(userBadge.toString(), UserBadgeListResultDTO.class);
List<UserBadgeListResultDTO> userBadgeListResultDTOS = userBadgeDao.selectBadgeList(userBadgeListFormDTO);
if (CollectionUtils.isEmpty(userBadgeListResultDTOS)){
@ -116,6 +119,9 @@ public class UserBadgeServiceImpl implements UserBadgeService {
public List<UserOperListResultDTO> selectOperList(UserOperListFormDTO userOperListFormDTO) {
List<UserOperListResultDTO> userAuthBadgeList = userBadgeDao.selectAuthRecord(userOperListFormDTO.getUserId());
Object userBadge = userBadgeRedis.getCustomerBadge(userOperListFormDTO.getCustomerId());
if (null == userBadge){
return new ArrayList<>();
}
List<UserOperListResultDTO> userOperListResultDTOS = JSON.parseArray(userBadge.toString(), UserOperListResultDTO.class);
// 没有任何记录
if (CollectionUtils.isEmpty(userAuthBadgeList)){

3
epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml

@ -191,6 +191,9 @@
customer_staff
WHERE
del_flag = '0'
<if test="enableFlag != null and enableFlag != ''">
and ENABLE_FLAG = #{enableFlag}
</if>
<foreach item="userId" collection="staffIdList" separator="OR" open="AND (" close=")" index="">
user_id = #{userId}
</foreach>

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

@ -90,8 +90,7 @@
<if test="resultTableName != null and resultTableName != ''">
AND ${resultTableName}.ID IS NOT NULL
</if>
and ic_resi_user.customer_id=#{customerId}
and (ic_resi_user.AGENCY_ID =#{currentStaffAgencyId} or ic_resi_user.pids like concat(#{staffOrgPath},'%'))
and ic_resi_user.pids like concat(#{staffOrgPath},'%')
<if test="null != conditions and conditions.size() > 0">
<foreach item="subCondition" collection="conditions" open="" separator="" close="">
<if test="null != subCondition.columnValue and subCondition.columnValue.size() > 0">
@ -229,6 +228,24 @@
<update id="updateSubTableToDel" parameterType="map">
update ${subTalbeName} set del_flag='1' where IC_RESI_USER=#{icResiUserId}
</update>
<update id="updateIcResiUserByIdCard">
update
ic_resi_user
set
name = #{entity.name},
mobile = #{entity.mobile},
birthday = #{entity.birthday},
home_id = #{entity.homeId},
village_id = #{entity.villageId},
build_id = #{entity.buildId},
unit_id = #{entity.unitId},
pids = #{entity.pids},
grid_id = #{entity.gridId},
updated_time = now()
where
id_card = #{entity.idCard}
AND customer_id = #{entity.customerId}
</update>
<select id="dynamicQuery" parameterType="map" resultType="java.util.LinkedHashMap">
select
@ -1088,6 +1105,21 @@
AND a.ID = #{userId}
</if>
</select>
<select id="selectCountByIdCard" resultType="java.lang.Integer">
select
count(*)
from
ic_resi_user
where
id_card = #{idCard}
and customer_id = #{customerId}
and del_flag = '0'
</select>
<select id="seletIdByIdCard" resultType="java.lang.String">
select id from ic_resi_user where id_card = #{idCard} and customer_id = #{customerId}
</select>
<select id="selectMemberDetail" resultType="com.epmet.dto.IcResiUserConfirmDTO">
select
ID as icResiUserId,

Loading…
Cancel
Save