diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/page/PageData.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/page/PageData.java index 380d5ec0e5..55a331c4e2 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/page/PageData.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/page/PageData.java @@ -9,6 +9,7 @@ package com.epmet.commons.tools.page; import lombok.Data; +import lombok.NoArgsConstructor; import java.io.Serializable; import java.util.List; @@ -20,6 +21,7 @@ import java.util.List; * @since 1.0.0 */ @Data +@NoArgsConstructor public class PageData implements Serializable { private static final long serialVersionUID = 1L; diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResisByPolicyRulesFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResisByPolicyRulesFormDTO.java index cfcedbed03..ea4bd8cb0a 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResisByPolicyRulesFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResisByPolicyRulesFormDTO.java @@ -40,7 +40,7 @@ public class ResisByPolicyRulesFormDTO { @AllArgsConstructor public static class ResiRule { private String ruleDesc; - private String lastLogicalRel; + private String nextLogicalRel; private String itemGroupId; private String itemId; private String queryType; @@ -57,7 +57,7 @@ public class ResisByPolicyRulesFormDTO { private String colKey; private String colVal; private String ruleDesc; - private String lastLogicalRel; + private String nextLogicalRel; private String queryType; } @@ -67,7 +67,7 @@ public class ResisByPolicyRulesFormDTO { public static class StatRule { private String colKey; private String colVal; - private String lastLogicalRel; + private String nextLogicalRel; private String ruleDesc; private String queryType; private String colTable; diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java index 9bda005a8b..f979ead709 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java @@ -2,6 +2,7 @@ package com.epmet.dataaggre.feign; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO; @@ -31,5 +32,5 @@ public interface DataAggregatorOpenFeignClient { * @return */ @PostMapping("data/aggregator/icuser/listByPolicyRules") - Result> listByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input); + Result> listByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input); } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java index b50b31441f..2cec07e6b3 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java @@ -1,9 +1,11 @@ package com.epmet.dataaggre.feign.impl; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; +import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO; import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO; import com.epmet.dataaggre.feign.DataAggregatorOpenFeignClient; @@ -19,7 +21,7 @@ public class DataAggregatorOpenFeignClientFallback implements DataAggregatorOpen } @Override - public Result listByPolicyRules(ResisByPolicyRulesFormDTO input) { + public Result> listByPolicyRules(ResisByPolicyRulesFormDTO input) { return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "listByPolicyRules", input); } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java index 8e68a00431..32f41b81e4 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java @@ -2,6 +2,7 @@ package com.epmet.dataaggre.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -53,7 +54,7 @@ public class IcUserController { * @return */ @PostMapping("listByPolicyRules") - public Result> listByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input) { + public Result> listByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input) { Integer pageNo = input.getPageNo(); Integer pageSize = input.getPageSize(); @@ -77,9 +78,9 @@ public class IcUserController { return new Result().ok(new ArrayList<>()); } - List resis = icResiService.listByPolicyRules(orgId, orgType, neighborHoodId, buildingId, unitId, + PageData page = icResiService.listByPolicyRules(orgId, orgType, neighborHoodId, buildingId, unitId, houseId, idCard, name, pageNo, pageSize, resiRule, houseRule, statRule); - return new Result>().ok(resis); + return new Result>().ok(page); } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java index b15f39e5fc..ee9feb43c4 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java @@ -1,7 +1,9 @@ package com.epmet.dataaggre.service; +import com.epmet.commons.tools.page.PageData; import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO; +import com.github.pagehelper.PageInfo; import java.util.List; import java.util.Set; @@ -18,7 +20,7 @@ public interface ResiService { * @param resiRule * @param houseRule */ - List listByPolicyRules( + PageData listByPolicyRules( String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, String houseId, String idCard, String name, Integer pageNo, Integer pageSize, List resiRule, diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java index 1e81a3c520..178f70ead8 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.dataaggre.service.impl; import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO; @@ -10,6 +11,7 @@ import com.epmet.dataaggre.service.ResiService; import com.epmet.dataaggre.service.epmetuser.EpmetUserService; import com.epmet.dataaggre.service.govorg.GovOrgService; import com.epmet.dto.IcNeighborHoodDTO; +import com.github.pagehelper.PageInfo; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -28,7 +30,7 @@ public class ResiServiceImpl implements ResiService { private GovOrgService govOrgService; @Override - public List listByPolicyRules(String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, + public PageData listByPolicyRules(String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, String houseId, String idCard, String name, Integer pageNo, Integer pageSize, List resiRule, List houseRule, @@ -40,8 +42,9 @@ public class ResiServiceImpl implements ResiService { // 1.用户没配置house和stat规则,直接按照居民规则查询 if (CollectionUtils.isEmpty(houseRule) && CollectionUtils.isEmpty(statRule)) { - return epmetUserService.listByPolicyRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId, + List resis = epmetUserService.listByPolicyRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId, houseId, idCard, name, pageNo, pageSize, resiRule, null); + return new PageData<>(resis, new PageInfo(resis).getTotal()); } // 2.用户至少配置了house和stat规则的一个,那么就先查询房屋出来,然后根据房屋去找居民 @@ -80,7 +83,8 @@ public class ResiServiceImpl implements ResiService { // 补充额外信息 fillResisExtraInfoForPolicy(resultResis); - return resultResis; + // todo + return new PageData<>(resultResis, 100); } /** diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml index 651c9c806f..f5939ad993 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml @@ -125,7 +125,7 @@ and - ${rule.colTable}.${rule.colKey} ${rule.queryType} #{rule.colVal} ${rule.lastLogicalRel} + ${rule.colTable}.${rule.colKey} ${rule.queryType} #{rule.colVal} ${rule.nextLogicalRel} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDetailDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDetailDTO.java index 8a87279bcf..10e875d312 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDetailDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDetailDTO.java @@ -49,7 +49,7 @@ public class IcPolicyRuleDetailDTO implements Serializable { /** * 与上一条的关系;and、or */ - private String lastLogicalRel; + private String nextLogicalRel; /** * 分组id;人员信息有值; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/HeartResisByPolicyRulesFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/HeartResisByPolicyRulesFormDTO.java index d195372b96..11ff13ac65 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/HeartResisByPolicyRulesFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/HeartResisByPolicyRulesFormDTO.java @@ -38,7 +38,7 @@ public class HeartResisByPolicyRulesFormDTO { @Data public static class ResiRule { private String ruleDesc; - private String lastLogicalRel; + private String nextLogicalRel; private String itemGroupId; private String itemId; private String queryType; @@ -53,7 +53,7 @@ public class HeartResisByPolicyRulesFormDTO { private String colKey; private String colVal; private String ruleDesc; - private String lastLogicalRel; + private String nextLogicalRel; private String queryType; } @@ -61,7 +61,7 @@ public class HeartResisByPolicyRulesFormDTO { public static class StatRule { private String colKey; private String colVal; - private String lastLogicalRel; + private String nextLogicalRel; private String ruleDesc; private String queryType; private String colTable; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResisByPolicyRulesFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResisByPolicyRulesFormDTO.java index 2f9fd654a4..4437c9de35 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResisByPolicyRulesFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResisByPolicyRulesFormDTO.java @@ -31,7 +31,7 @@ public class ResisByPolicyRulesFormDTO { @Data public static class ResiRule { private String ruleDesc; - private String lastLogicalRel; + private String nextLogicalRel; private String itemGroupId; private String itemId; private String queryType; @@ -46,7 +46,7 @@ public class ResisByPolicyRulesFormDTO { private String colKey; private String colVal; private String ruleDesc; - private String lastLogicalRel; + private String nextLogicalRel; private String queryType; } @@ -54,7 +54,7 @@ public class ResisByPolicyRulesFormDTO { public static class StatRule { private String colKey; private String colVal; - private String lastLogicalRel; + private String nextLogicalRel; private String ruleDesc; private String queryType; private String colTable; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiByPolicyInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiByPolicyInfoResultDTO.java index 313f70560b..2faa7c9b82 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiByPolicyInfoResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiByPolicyInfoResultDTO.java @@ -4,18 +4,24 @@ import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Date; + @Data @NoArgsConstructor @AllArgsConstructor public class ResiByPolicyInfoResultDTO { + private String icResiUserId; private String name; private String mobile; private String idCard; /** * 小区全名,包含小区前面的属性,比如网格等 */ - private String neighborhoodFullName; + private String gridId; + private String neighborhoodId; + private String neighborHoodName; private Integer age; + private Date birthday; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java index a383b5ffd9..d8536ce6c2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java @@ -14,6 +14,7 @@ import com.epmet.dto.IcPolicyRuleDTO; import com.epmet.dto.form.policy.IcPolicyFormDTO; import com.epmet.dto.form.policy.IcPolicyPageFormDTO; import com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO; +import com.epmet.dto.result.resi.ResiByPolicyInfoResultDTO; import com.epmet.service.IcPolicyService; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -51,8 +52,8 @@ public class IcPolicyController { public Result listResiUserByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input) { // 调整错位的逻辑符号位置 //adjustMalpositionLogicalOperatorPosition(input); - icPolicyService.listResiUserByPolicyRules(input); - return null; + PageData page = icPolicyService.listResiUserByPolicyRules(input); + return new Result().ok(page); } /** diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java index b0f0fe2636..1b18091b4a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java @@ -47,5 +47,5 @@ public interface IcPolicyService extends BaseService { IcPolicyDTO policyDetail(String customerId,String policyId); - List listResiUserByPolicyRules(ResisByPolicyRulesFormDTO input); + PageData listResiUserByPolicyRules(ResisByPolicyRulesFormDTO input); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index 0745a52db3..e287d43e84 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -311,7 +311,7 @@ public class IcPolicyServiceImpl extends BaseServiceImpl listResiUserByPolicyRules(com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO input) { + public PageData listResiUserByPolicyRules(com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO input) { String customerId = EpmetRequestHolder.getLoginUserCustomerId(); String ruleId = input.getRuleId(); @@ -363,9 +363,13 @@ public class IcPolicyServiceImpl extends BaseServiceImpl resis = getResultDataOrReturnNull(dataAggregatorOpenFeignClient.listByPolicyRules(aggForm), ServiceConstant.DATA_AGGREGATOR_SERVER); - return resis.stream() - .map((r) -> new ResiByPolicyInfoResultDTO(r.getName(), r.getMobile(), r.getIdCard(), r.getNeighborHoodName(), r.getAge())) + // 调用aggre服务查询结果 + Result> result = dataAggregatorOpenFeignClient.listByPolicyRules(aggForm); + List list = result.getData().getList().stream() + .map((r) -> new ResiByPolicyInfoResultDTO(r.getIcResiUserId() ,r.getName(), r.getMobile(), r.getIdCard(), r.getGridId() + ,r.getNeighborhoodId(), r.getNeighborHoodName(), r.getAge(), r.getBirthday())) .collect(Collectors.toList()); + + return new PageData(list, result.getData().getTotal()); } } \ No newline at end of file