diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/List4ApplyResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/List4ApplyResultDTO.java index 49fdc3844b..0d74a3fdf2 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/List4ApplyResultDTO.java +++ b/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 children = new ArrayList<>(); +// private List children = new ArrayList<>(); } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdditiveRuleServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdditiveRuleServiceImpl.java index 371c861773..7146f105f1 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdditiveRuleServiceImpl.java +++ b/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> list4apply(List4applyFormDTO dto) { List list = baseDao.selectList4apply(dto); - List result = build(list); - result.removeIf(category ->CollectionUtils.isEmpty(category.getChildren())); - return new Result>().ok(result); + return new Result>().ok(list); } - /** - * 构建树节点 - */ - public static List build(List treeNodes) { - List result = new ArrayList<>(); - - //list转map - Map 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> list4tree(List4treeFormDTO dto) { diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdditiveRuleDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdditiveRuleDao.xml index 058d6db765..84a26d63e7 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdditiveRuleDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdditiveRuleDao.xml @@ -45,8 +45,7 @@ diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointApplyDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointApplyDao.xml index 500b87339d..4eff87f9b8 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointApplyDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointApplyDao.xml @@ -52,6 +52,7 @@ + @@ -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 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 60419614fc..b833fc339b 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -623,10 +623,6 @@ public interface GovOrgOpenFeignClient { /** * Desc: 房屋更新 - * <<<<<<< HEAD - * ======= - *

- * >>>>>>> feature/dev_sunjiatan * * @param formDTO * @author zxc @@ -644,6 +640,17 @@ public interface GovOrgOpenFeignClient { @GetMapping("/gov/org/customeragency/subOrgList/{agencyId}") Result> subOrgList(@PathVariable("agencyId") String agencyId); + /** + * 根据houseId查询数据 + * + * @param houseId + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/6/22 16:20 + */ + @PostMapping("/gov/org/ichouse/getHouseAgencyInfo") + Result 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 getHomeInfoByHouseCode(CommonHouseFormDTO dto); diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index 23054533c7..56da609bd2 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/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 getHouseAgencyInfo(String houseId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "subOrgList",houseId); + } public Result getDelAgencyGridIdList(String agencyId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getDelAgencyGridIdList", agencyId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java index e6f1522353..a4a6a65dd7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java +++ b/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 get(@PathVariable("id") String id){ + public Result get(@PathVariable("id") String id) { IcHouseDTO data = icHouseService.get(id); return new Result().ok(data); } @PostMapping("houseoption") - public Result> getHouseOption(@RequestBody HouseFormDTO formDTO){ + public Result> getHouseOption(@RequestBody HouseFormDTO formDTO) { return new Result>().ok(icHouseService.getHouseOption(formDTO)); } /** - * @Description 查询房屋信息 * @param idCard + * @Description 查询房屋信息 * @author zxc * @date 2021/11/3 3:30 下午 */ @PostMapping("selecthouseinfobyidcard") - public Result> selectHouseInfoByIdCard(@RequestParam("idCard")String idCard,@RequestParam("customerId")String customerId){ - return new Result>().ok(icHouseService.selectHouseInfoByIdCard(idCard,customerId)); + public Result> selectHouseInfoByIdCard(@RequestParam("idCard") String idCard, @RequestParam("customerId") String customerId) { + return new Result>().ok(icHouseService.selectHouseInfoByIdCard(idCard, customerId)); } /** @@ -75,23 +76,38 @@ public class IcHouseController { * @Date 2021/11/5 16:01 */ @PostMapping("houselist") - public Result> getHouseList(@LoginUser TokenDto tokenDto, @RequestBody HouseFormDTO formDTO){ + public Result> getHouseList(@LoginUser TokenDto tokenDto, @RequestBody HouseFormDTO formDTO) { return new Result>().ok(icHouseService.getHouseList(tokenDto, formDTO)); } /** * Desc: 根据身份证查询房屋名 + * * @param idCards * @author zxc * @date 2022/4/12 16:42 */ @PostMapping("houses-name") - public Result> getHousesNameByIdCards(@RequestBody List idCards){ + public Result> getHousesNameByIdCards(@RequestBody List idCards) { return new Result>().ok(icHouseService.getHousesNameByIdCards(idCards)); } + /** + * 根据houseId查询数据 + * + * @param houseId + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/6/22 16:18 + */ + @PostMapping("getHouseAgencyInfo") + public Result getHouseAgencyInfo(@RequestParam("houseId") String houseId) { + HouseAgencyInfoResultDTO dto = icHouseService.getHouseAgencyInfo(houseId); + return new Result().ok(dto); + } + @GetMapping("getbyhousecode/{houseCode}") - public Result getByHouseCode(@PathVariable("houseCode") String houseCode){ + public Result getByHouseCode(@PathVariable("houseCode") String houseCode) { return new Result().ok(icHouseService.getByHouseCode(houseCode)); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java index 161aad6c4e..7ed2819ea7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java +++ b/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 { */ List getHousesNameByIdCards(List 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 { * @date 2022/6/1/0001 16:21 */ IcHouseDTO getByHouseCode(String houseCode); -} \ No newline at end of file +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java index ef99e35c94..6f92962f4a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java +++ b/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 categories = new ArrayList<>(); if (null != countMap && CollectionUtils.isNotEmpty(categoryList)) { for (IcResiCategoryStatsConfigDTO category : categoryList) { @@ -284,6 +285,20 @@ public class IcHouseServiceImpl extends BaseServiceImpl lqw = Wrappers.lambdaQuery(); diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ca/CaResidentUserDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ca/CaResidentUserDTO.java new file mode 100644 index 0000000000..d117f7f783 --- /dev/null +++ b/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; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/GetResidentDetailByIdCardFormDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/GetResidentDetailByIdCardFormDTO.java new file mode 100644 index 0000000000..3af9406944 --- /dev/null +++ b/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; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/SaveCaResidentUserFormDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/SaveCaResidentUserFormDTO.java new file mode 100644 index 0000000000..a155e5cab3 --- /dev/null +++ b/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; +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/ResidentByIdCardResultDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/ResidentByIdCardResultDTO.java new file mode 100644 index 0000000000..195d499f25 --- /dev/null +++ b/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; +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/feign/GuardarDatosFeignClient.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/feign/GuardarDatosFeignClient.java index 62aa02fd0c..caab7744b4 100644 --- a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/feign/GuardarDatosFeignClient.java +++ b/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 getResidentDetailByIdCard(GetResidentDetailByIdCardFormDTO form); + + @PostMapping("/opendata/caResidentUser/saveCaResidentUser") + Result saveCaResidentUser(@RequestBody SaveCaResidentUserFormDTO dto); } diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/feign/impl/GuardarDatosFeignClientFallBack.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/feign/impl/GuardarDatosFeignClientFallBack.java index 4a688e5ae5..b8199a96b9 100644 --- a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/feign/impl/GuardarDatosFeignClientFallBack.java +++ b/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 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); + } + } diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaResidentController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaResidentController.java index ac27374d80..8b29c65cf2 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaResidentController.java +++ b/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 getResidentDetailByIdCard(@RequestBody CaResidentDetailsFormDTO form) { + ResidentByIdCardResultDTO dto = caResidentService.getResidentDetailByIdCard(form); + return new Result().ok(dto); + } } diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaResidentUserController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaResidentUserController.java new file mode 100644 index 0000000000..7cda2a538e --- /dev/null +++ b/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> page(@RequestParam Map params){ + PageData page = caResidentUserService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + CaResidentUserDTO data = caResidentUserService.get(id); + return new Result().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 params, HttpServletResponse response) throws Exception { + List 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(); + } + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaResidentDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaResidentDao.java index 3f907c76e2..2558268345 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaResidentDao.java +++ b/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 { * @return */ CaResidentDetailsResultDTO getResidentDetails(@Param("idCard") String idCard); + + ResidentByIdCardResultDTO getResidentDetailByIdCard(@Param("form") CaResidentDetailsFormDTO form); } diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaResidentUserDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaResidentUserDao.java new file mode 100644 index 0000000000..a80b654b82 --- /dev/null +++ b/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 { + + + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/CaResidentEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/CaResidentEntity.java index a65dcc6574..34b3f93d8e 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/CaResidentEntity.java +++ b/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 */ diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/CaResidentUserEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/CaResidentUserEntity.java new file mode 100644 index 0000000000..566d3f046f --- /dev/null +++ b/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; + + + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/excel/CaResidentUserExcel.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/excel/CaResidentUserExcel.java new file mode 100644 index 0000000000..d20ef54f7e --- /dev/null +++ b/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; + + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/redis/CaResidentUserRedis.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/redis/CaResidentUserRedis.java new file mode 100644 index 0000000000..17145e5f5f --- /dev/null +++ b/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; + } + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaResidentService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaResidentService.java index 0f1406b524..a28a87ed6b 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaResidentService.java +++ b/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 { * @return */ CaResidentDetailsResultDTO getResidentDetails(CaResidentDetailsFormDTO dto); -} \ No newline at end of file + + /** + * 根据idCard查询resident表数据 + * + * @param form + * @return com.epmet.opendata.dto.result.ResidentByIdCardResultDTO + * @author LZN + * @date 2022/6/21 17:33 + */ + ResidentByIdCardResultDTO getResidentDetailByIdCard(CaResidentDetailsFormDTO form); +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaResidentUserService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaResidentUserService.java new file mode 100644 index 0000000000..00795d3387 --- /dev/null +++ b/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 { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-06-22 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-06-22 + */ + List list(Map 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); +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaResidentServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaResidentServiceImpl.java index b0f71b2f42..6477389d46 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaResidentServiceImpl.java +++ b/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 implements CaResidentUserService { + + @Autowired + private CaResidentUserRedis caResidentUserRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CaResidentUserDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CaResidentUserDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper 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); + } + +} diff --git a/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 b/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 new file mode 100644 index 0000000000..a830b88c7e --- /dev/null +++ b/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`; diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/V0.0.8__update_view_create_table.sql b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/V0.0.8__update_view_create_table.sql new file mode 100644 index 0000000000..8fa7fbec46 --- /dev/null +++ b/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' )) diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/V0.0.9__create_ca_resident_user_table.sql b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/V0.0.9__create_ca_resident_user_table.sql new file mode 100644 index 0000000000..83328c08be --- /dev/null +++ b/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; diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaLoudongDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaLoudongDao.xml index 24afdf1451..8d91b0b087 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaLoudongDao.xml +++ b/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 ca.delete_flag = 'normal' diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaPingfangDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaPingfangDao.xml index f3c7bb973e..4fa522780d 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaPingfangDao.xml +++ b/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 ca.delete_flag = 'normal' diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaRentalDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaRentalDao.xml index c350e49bb1..4dedc59b1f 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaRentalDao.xml +++ b/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 ca.delete_flag = 'normal' diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaResidentDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaResidentDao.xml index 0f00defec3..c541483cf0 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaResidentDao.xml +++ b/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 ca.delete_flag = 'normal' @@ -136,6 +136,52 @@ + diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaResidentUserDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaResidentUserDao.xml new file mode 100644 index 0000000000..4cbc139aa5 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaResidentUserDao.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaRotatorsDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaRotatorsDao.xml index 0c109d744b..593b137b9a 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaRotatorsDao.xml +++ b/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 ca.delete_flag = 'normal' diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BindHomeFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BindHomeFormDTO.java new file mode 100644 index 0000000000..767dcf1231 --- /dev/null +++ b/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; +} diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index e3aedaca0b..862f53985e 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -159,6 +159,12 @@ common-service-client 2.0.0 + + com.epmet + open-data-worker-client + 2.0.0 + compile + diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index 8e9e6a41c7..b166ceca92 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/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 changeIcResiUserBelongTo(@LoginUser TokenDto tokenDto, @RequestBody IcUserBelongToChangedFormDTO formDTO){ + Result changeIcResiUserBelongTo(@LoginUser TokenDto tokenDto, @RequestBody IcUserBelongToChangedFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); ValidatorUtils.validateEntity(formDTO); - List changedUserIds = icResiUserService.changeIcResiUserBelongTo(tokenDto,formDTO); + List 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().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 result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),e.getMsg()); + Result 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> queryDemandUsers(@LoginUser TokenDto tokenDto,@RequestBody DemandUserFormDTO formDTO) { + public Result> 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 personWarnRightList(@RequestBody PersonWarnRightListFormDTO formDTO, @LoginUser TokenDto tokenDto){ + @MaskResponse(fieldNames = "mobile", fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE}) + public Result personWarnRightList(@RequestBody PersonWarnRightListFormDTO formDTO, @LoginUser TokenDto tokenDto) { ValidatorUtils.validateEntity(formDTO, PersonWarnRightListFormDTO.PersonWarnRightListForm.class); return new Result().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().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} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java index f877b1e50b..725a456b46 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java @@ -127,7 +127,9 @@ public interface CustomerStaffDao extends BaseDao { * @Author sun * @Description 根据staffId集合查询工作人员基础信息 **/ - List selectStaffByIds(@Param("staffIdList") List staffIdList); + List selectStaffByIds(@Param("staffIdList") List staffIdList, + @Param("enableFlag") String enableFlag); + /** * @param staffId diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index 4b8a562045..c6dc017584 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -341,6 +341,37 @@ public interface IcResiUserDao extends BaseDao { */ List 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: 查询家庭成员信息 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java index 1cc0bce0bd..2f80e11187 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java @@ -382,6 +382,16 @@ public interface IcResiUserService extends BaseService { */ 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 { 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); /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 3b836920e9..024d3aed37 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/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 staffIdList) { //1:批量查询人员基本信息 - List staffList = baseDao.selectStaffByIds(staffIdList); + List staffList = baseDao.selectStaffByIds(staffIdList, null); //2:批量查询人员拥有的所有角色信息 List roleList = staffRoleDao.selectStaffRoleList(staffIdList); CustomerStaffListResultDTO list = new CustomerStaffListResultDTO(); @@ -640,7 +637,6 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl>().ok(listResultDTO); } + @Override public Result selectStaffBasicInfo(String userId, String customerId) { StaffBasicInfoResultDTO resultDTO = baseDao.selectStaffBasicInfo(userId); @@ -777,6 +774,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl staffIdList = staffRoleList.stream().map(GridMobileListResultDTO.Role::getStaffId).collect(Collectors.toList()); staffIdList = staffIdList.stream().distinct().collect(Collectors.toList()); - List list = baseDao.selectStaffByIds(staffIdList); + List list = baseDao.selectStaffByIds(staffIdList, Constant.ENABLE); //4.封装数据并返回 resultList = ConvertUtils.sourceToTarget(list, GridMobileListResultDTO.class); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index d968b9c84b..6bdc67e96d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/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 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 map = new LinkedHashMap<>(); com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO partyMemberDTO = new com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO(); - Map>> formMap = formDTO.stream().collect(Collectors.toMap(IcResiUserFormDTO::getTableName, IcResiUserFormDTO::getList)); + Map>> 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 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 map = new LinkedHashMap<>(); com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO partyMemberDTO = new com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO(); - Map>> formMap = formDTO.stream().collect(Collectors.toMap(IcResiUserFormDTO::getTableName, IcResiUserFormDTO::getList)); + Map>> 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> 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 resultColumns = resultColumnRes.getData(); // 查询结果列对应的表: Set resultColumnTables = resultColumns.stream().map(IcFormResColumnDTO::getTableName).collect(Collectors.toSet()); + List 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> subTablesRes = operCustomizeOpenFeignClient.querySubTables(queryDTO1); List subTables = subTablesRes.getData(); @@ -778,20 +809,20 @@ public class IcResiUserServiceImpl extends BaseServiceImpl finalSubTables =new ArrayList<>(); + List finalSubTables = new ArrayList<>(); //groupBy用到的表 - Set groupByTables=new HashSet<>(); - subTables.forEach(subTable->{ - if(tables.contains(subTable.getTableName())){ + Set 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> pageInfo=new PageInfo<>(); - if (null == formDTO.getIsPage()||formDTO.getIsPage()) { + PageInfo> 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> list=baseDao.selectListResiMap(formDTO.getCustomerId(), + } else { + List> 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 nameList=new HashSet<>(); - for(String codePath:demandCodePath){ + Set 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> dynamicQuery(String customerId, - String formCode, - String resultTableName, - List conditions, - String currentStaffAgencyId, - String staffOrgPath){ + public List> dynamicQuery(String customerId, + String formCode, + String resultTableName, + List conditions, + String currentStaffAgencyId, + String staffOrgPath) { // List finalSubTables = getFinalSubables(customerId, formCode, resultTableName, conditions); - Map> map=getFinalSubables(customerId, formCode, resultTableName, conditions, null); - return baseDao.dynamicQuery(customerId,resultTableName,conditions,map.get("finalSubTables"), null, currentStaffAgencyId,staffOrgPath,map.get("groupByTables")); + Map> 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> getFinalSubables(String customerId, String formCode, String resultTableName, List conditions, List exportNeedTableList) { - Map> map=new HashMap<>(); - CustomerFormQueryDTO queryDTO=new CustomerFormQueryDTO(); + public Map> getFinalSubables(String customerId, String formCode, String resultTableName, List conditions, List exportNeedTableList) { + Map> map = new HashMap<>(); + CustomerFormQueryDTO queryDTO = new CustomerFormQueryDTO(); queryDTO.setCustomerId(customerId); queryDTO.setFormCode(formCode); //所有的子表 - Result> subTablesRes=operCustomizeOpenFeignClient.querySubTables(queryDTO); + Result> subTablesRes = operCustomizeOpenFeignClient.querySubTables(queryDTO); - List subTables =subTablesRes.getData(); + List subTables = subTablesRes.getData(); // log.info("1、所有的子表subTables:"+JSON.toJSONString(subTables,true)); //关联哪些子表:查询条件用到的表名+查询的列对应的表 并集去重 Set 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 finalSubTables =new ArrayList<>(); + List finalSubTables = new ArrayList<>(); //groupBy用到的表 - Set groupByTables=new HashSet<>(); - subTables.forEach(subTable->{ - if(tables.contains(subTable.getTableName())){ + Set 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 result = pageInfo.getList(); if (CollectionUtils.isEmpty(result)) { return new PageData<>(new ArrayList<>(), pageInfo.getTotal()); @@ -1581,13 +1612,13 @@ public class IcResiUserServiceImpl extends BaseServiceImpl 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> 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 pageInfo = new PageInfo<>(list); @@ -1774,7 +1805,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl(list, pageInfo.getTotal()); } List 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(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 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 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 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 dictTypeList = Arrays.asList(DictTypeEnum.EDUCATION.getCode(), DictTypeEnum.RELATIONSHIP.getCode(), DictTypeEnum.NATION.getCode()); - Map> dictResult = new HashMap<>(); - dictTypeList.forEach(dict->{ + Map> dictResult = new HashMap<>(); + dictTypeList.forEach(dict -> { Result> 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 hyzkMap = getOptionMap(formDTO.getCustomerId(),"HYZK"); + Map 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 mzMap = dictResult.get(DictTypeEnum.NATION.getCode()); Map whcdMap = dictResult.get(DictTypeEnum.EDUCATION.getCode()); @@ -2153,8 +2180,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl changeIcResiUserBelongTo(TokenDto tokenDto, IcUserBelongToChangedFormDTO formDTO) { - List resiUserIdList = baseDao.listUserIds(formDTO.getCustomerId(),formDTO.getSourceGridId()); - if (CollectionUtils.isEmpty(resiUserIdList)){ + List resiUserIdList = baseDao.listUserIds(formDTO.getCustomerId(), formDTO.getSourceGridId()); + if (CollectionUtils.isEmpty(resiUserIdList)) { return null; } List icResiUserFormDTOS = new ArrayList<>(); @@ -2168,9 +2195,9 @@ public class IcResiUserServiceImpl extends BaseServiceImpl{ + 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 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 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 getOptionMap(String customerId,String columnName) { + private Map getOptionMap(String customerId, String columnName) { IcFormOptionsQueryFormDTO optionsForm = new IcFormOptionsQueryFormDTO(); optionsForm.setCustomerId(customerId); optionsForm.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode()); optionsForm.setColumnName(columnName); Result> 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)); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index a9bf66fbd7..f36dffda3f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/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 redisUserBadgeList = JSON.parseArray(userBadge.toString(), UserBadgeListResultDTO.class); List userBadgeListResultDTOS = userBadgeDao.selectBadgeList(userBadgeListFormDTO); if (CollectionUtils.isEmpty(userBadgeListResultDTOS)){ @@ -116,6 +119,9 @@ public class UserBadgeServiceImpl implements UserBadgeService { public List selectOperList(UserOperListFormDTO userOperListFormDTO) { List userAuthBadgeList = userBadgeDao.selectAuthRecord(userOperListFormDTO.getUserId()); Object userBadge = userBadgeRedis.getCustomerBadge(userOperListFormDTO.getCustomerId()); + if (null == userBadge){ + return new ArrayList<>(); + } List userOperListResultDTOS = JSON.parseArray(userBadge.toString(), UserOperListResultDTO.class); // 没有任何记录 if (CollectionUtils.isEmpty(userAuthBadgeList)){ diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml index f441f419af..10965b93ce 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml @@ -191,6 +191,9 @@ customer_staff WHERE del_flag = '0' + + and ENABLE_FLAG = #{enableFlag} + user_id = #{userId} diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index edb2455bee..46a101db60 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -90,8 +90,7 @@ AND ${resultTableName}.ID IS NOT NULL - 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},'%') @@ -229,6 +228,24 @@ update ${subTalbeName} set del_flag='1' where IC_RESI_USER=#{icResiUserId} + + 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} + + + + +