Browse Source

Merge remote-tracking branch 'origin/dev_policy_service' into dev_policy_service

master
yinzuomei 3 years ago
parent
commit
e7e82efd17
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/page/PageData.java
  2. 6
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResisByPolicyRulesFormDTO.java
  3. 3
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java
  4. 4
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java
  5. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java
  6. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java
  7. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java
  8. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml
  9. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDetailDTO.java
  10. 6
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/HeartResisByPolicyRulesFormDTO.java
  11. 6
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResisByPolicyRulesFormDTO.java
  12. 8
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiByPolicyInfoResultDTO.java
  13. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java
  14. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java
  15. 12
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java

2
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<T> implements Serializable {
private static final long serialVersionUID = 1L;

6
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;

3
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<List<ResiByPolicyInfoResultDTO>> listByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input);
Result<PageData<ResiByPolicyInfoResultDTO>> listByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input);
}

4
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<PageData<ResiByPolicyInfoResultDTO>> listByPolicyRules(ResisByPolicyRulesFormDTO input) {
return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "listByPolicyRules", input);
}
}

7
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<List<ResiByPolicyInfoResultDTO>> listByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input) {
public Result<PageData<ResiByPolicyInfoResultDTO>> 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<ResiByPolicyInfoResultDTO> resis = icResiService.listByPolicyRules(orgId, orgType, neighborHoodId, buildingId, unitId,
PageData<ResiByPolicyInfoResultDTO> page = icResiService.listByPolicyRules(orgId, orgType, neighborHoodId, buildingId, unitId,
houseId, idCard, name, pageNo, pageSize, resiRule, houseRule, statRule);
return new Result<List<ResiByPolicyInfoResultDTO>>().ok(resis);
return new Result<PageData<ResiByPolicyInfoResultDTO>>().ok(page);
}
}

4
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<ResiByPolicyInfoResultDTO> listByPolicyRules(
PageData<ResiByPolicyInfoResultDTO> listByPolicyRules(
String orgId, String orgType, String neighborHoodId, String buildingId, String unitId,
String houseId, String idCard, String name, Integer pageNo, Integer pageSize,
List<ResisByPolicyRulesFormDTO.ResiRule> resiRule,

10
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<ResiByPolicyInfoResultDTO> listByPolicyRules(String orgId, String orgType, String neighborHoodId, String buildingId, String unitId,
public PageData<ResiByPolicyInfoResultDTO> listByPolicyRules(String orgId, String orgType, String neighborHoodId, String buildingId, String unitId,
String houseId, String idCard, String name, Integer pageNo, Integer pageSize,
List<ResisByPolicyRulesFormDTO.ResiRule> resiRule,
List<ResisByPolicyRulesFormDTO.HouseRule> 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<ResiByPolicyInfoResultDTO> 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);
}
/**

2
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml

@ -125,7 +125,7 @@
<if test="resiRules != null and resiRules.size() > 0">
and
<foreach collection="resiRules" item="rule" open="(" close=")">
${rule.colTable}.${rule.colKey} ${rule.queryType} #{rule.colVal} ${rule.lastLogicalRel}
${rule.colTable}.${rule.colKey} ${rule.queryType} #{rule.colVal} ${rule.nextLogicalRel}
</foreach>
</if>
</where>

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDetailDTO.java

@ -49,7 +49,7 @@ public class IcPolicyRuleDetailDTO implements Serializable {
/**
* 与上一条的关系andor
*/
private String lastLogicalRel;
private String nextLogicalRel;
/**
* 分组id人员信息有值

6
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;

6
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;

8
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;
}

5
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<ResiByPolicyInfoResultDTO> page = icPolicyService.listResiUserByPolicyRules(input);
return new Result().ok(page);
}
/**

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java

@ -47,5 +47,5 @@ public interface IcPolicyService extends BaseService<IcPolicyEntity> {
IcPolicyDTO policyDetail(String customerId,String policyId);
List<ResiByPolicyInfoResultDTO> listResiUserByPolicyRules(ResisByPolicyRulesFormDTO input);
PageData<ResiByPolicyInfoResultDTO> listResiUserByPolicyRules(ResisByPolicyRulesFormDTO input);
}

12
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<IcPolicyDao, IcPolicyEn
}
@Override
public List<ResiByPolicyInfoResultDTO> listResiUserByPolicyRules(com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO input) {
public PageData<ResiByPolicyInfoResultDTO> 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<IcPolicyDao, IcPolicyEn
}
}
List<com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO> 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<PageData<com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO>> result = dataAggregatorOpenFeignClient.listByPolicyRules(aggForm);
List<ResiByPolicyInfoResultDTO> 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<ResiByPolicyInfoResultDTO>(list, result.getData().getTotal());
}
}
Loading…
Cancel
Save