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 e89f1131cf..974172a7e4 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 @@ -32,9 +32,9 @@ public class ResisByPolicyRulesFormDTO { @AllArgsConstructor public static class RuleList { private String ruleName; - private List resiRule; - private List houseRule; - private List statRule; + private List resiRuleList; + private List houseRuleList; + private List statRuleList; } @Data 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 23b6e5f4ec..1216c2b193 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,10 +2,13 @@ package com.epmet.dataaggre.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.feign.ResultDataResolver; 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.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dataaggre.dto.epmetuser.form.IcUserCategoryFormDTO; @@ -14,7 +17,9 @@ import com.epmet.dataaggre.dto.epmetuser.result.IcUserCategoryResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO; import com.epmet.dataaggre.service.ResiService; import com.epmet.dataaggre.service.epmetuser.EpmetUserService; +import com.epmet.feign.EpmetHeartOpenFeignClient; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -30,7 +35,7 @@ import java.util.Set; @RestController @RequestMapping("icuser") -public class IcUserController { +public class IcUserController implements ResultDataResolver { @Autowired private EpmetUserService epmetUserService; @@ -38,6 +43,9 @@ public class IcUserController { @Autowired private ResiService icResiService; + @Autowired + private EpmetHeartOpenFeignClient heartOpenFeignClient; + /** * 【人员类别分析】-各类别人数 * @@ -59,13 +67,14 @@ public class IcUserController { */ @PostMapping("listByPolicyRules") public Result> listByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input) { + + List resiRule = input.getRuleList().getResiRuleList(); + List houseRule = input.getRuleList().getHouseRuleList(); + List statRule = input.getRuleList().getStatRuleList(); + Integer pageNo = input.getPageNo(); Integer pageSize = input.getPageSize(); - List resiRule = input.getRuleList().getResiRule(); - List houseRule = input.getRuleList().getHouseRule(); - List statRule = input.getRuleList().getStatRule(); - String orgId = input.getOrgId(); String orgType = input.getOrgType(); String neighborHoodId = input.getNeighborHoodId(); @@ -74,12 +83,26 @@ public class IcUserController { String houseId = input.getHouseId(); String idCard = input.getIdCard(); String name = input.getName(); + String ruleId = input.getRuleId(); + + if (StringUtils.isNotBlank(ruleId)) { + // 从heart取,覆盖形参 + com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO.RuleList ruleList = getResultDataOrThrowsException( + heartOpenFeignClient.listPolicyRules4QueryAndExport(ruleId), + ServiceConstant.EPMET_HEART_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), + null, null); + + resiRule = ConvertUtils.sourceToTarget(ruleList.getResiRuleList(), ResisByPolicyRulesFormDTO.ResiRule.class); + houseRule = ConvertUtils.sourceToTarget(ruleList.getHouseRuleList(), ResisByPolicyRulesFormDTO.HouseRule.class); + statRule = ConvertUtils.sourceToTarget(ruleList.getStatRuleList(), ResisByPolicyRulesFormDTO.StatRule.class); + } - // 全都为空,则返回空 + // 全都为空,则返回空ç if (CollectionUtils.isEmpty(resiRule) && CollectionUtils.isEmpty(houseRule) && CollectionUtils.isEmpty(statRule)) { - return new Result().ok(new ArrayList<>()); + return new Result().ok(new PageData<>(new ArrayList<>(), 0)); } PageData page = icResiService.listByPolicyRules(orgId, orgType, neighborHoodId, buildingId, unitId, @@ -97,7 +120,7 @@ public class IcUserController { icResiService.exportResisByPolicy( input.getOrgId(), input.getOrgType(), input.getNeighborHoodId(), input.getBuildingId(), input.getUnitId(), input.getHouseId(), input.getIdCard(), input.getName(), input.getPageNo(), input.getPageSize(), - input.getRuleId(), input.getRuleList().getResiRule(), input.getRuleList().getHouseRule(), input.getRuleList().getStatRule(), response); + input.getRuleId(), input.getRuleList().getResiRuleList(), input.getRuleList().getHouseRuleList(), input.getRuleList().getStatRuleList(), response); } catch (IOException e) { throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "导出Excel文件失败", "导出Excel文件失败"); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java index 5dd78f714c..8705014852 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java @@ -69,6 +69,7 @@ public interface IcResiUserDao extends BaseDao { * @return */ List listByPolicyRules(@Param("customerId") String customerId, + @Param("orgIdPath") String orgIdPath, @Param("orgId") String orgId, @Param("orgType") String orgType, @Param("neighborHoodId") String neighborHoodId, @@ -86,6 +87,7 @@ public interface IcResiUserDao extends BaseDao { * @return */ Integer getTotalByPolicyRules(@Param("customerId") String customerId, + @Param("orgIdPath") String orgIdPath, @Param("orgId") String orgId, @Param("orgType") String orgType, @Param("neighborHoodId") String neighborHoodId, diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java index ca91cd86e7..01b9dae907 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java @@ -201,11 +201,11 @@ public interface EpmetUserService { */ List staffSelectList(List staffIds); - List listByPolicyRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, + List listByPolicyRules(String customerId, String orgIdPath, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, String houseId, String idCard, String name, Integer pageNo, Integer pageSize, List resiRule, List houseIds); - Integer getTotalByPolicyRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, + Integer getTotalByPolicyRules(String customerId, String orgIdPath, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, String houseId, String idCard, String name, List resiRule, List houseIds); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index 267af969ea..000affa6ff 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -45,6 +45,7 @@ import com.epmet.dataaggre.service.opercustomize.CustomerFootBarService; import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.UserBaseInfoDTO; import com.epmet.dto.result.StaffRoleResultDTO; +import com.github.pagehelper.PageHelper; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; @@ -845,15 +846,15 @@ public class EpmetUserServiceImpl implements EpmetUserService { } @Override - public List listByPolicyRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, + public List listByPolicyRules(String customerId, String orgIdPath, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, String houseId, String idCard, String name, Integer pageNo, Integer pageSize, List resiRule, List houseIds) { - - return icResiUserDao.listByPolicyRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId, houseId, idCard, name, resiRule, houseIds); + PageHelper.startPage(pageNo, pageSize); + return icResiUserDao.listByPolicyRules(customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId, houseId, idCard, name, resiRule, houseIds); } @Override - public Integer getTotalByPolicyRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, String houseId, String idCard, String name, List resiRule, List houseIds) { - return icResiUserDao.getTotalByPolicyRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId, houseId, idCard, name, resiRule, houseIds); + public Integer getTotalByPolicyRules(String customerId, String orgIdPath, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, String houseId, String idCard, String name, List resiRule, List houseIds) { + return icResiUserDao.getTotalByPolicyRules(customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId, houseId, idCard, name, resiRule, houseIds); } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java index 237a0cf6f2..c3908fad04 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java @@ -218,7 +218,7 @@ public interface GovOrgService { */ CustomerAgencyEntity getRootAgencyByCustomerId(String customerId); - List listHousesByRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId, + List listHousesByRules(String customerId, String orgIdPath, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, String houseId, List houseRule, List statRule, Integer pageNo, Integer pageSize); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index 945cb2ab59..a57f014463 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -1110,7 +1110,7 @@ public class GovOrgServiceImpl implements GovOrgService { } @Override - public List listHousesByRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId, + public List listHousesByRules(String customerId, String orgIdPath, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, String houseId, List houseRule, List statRule, Integer pageNo, Integer pageSize) { @@ -1120,11 +1120,13 @@ public class GovOrgServiceImpl implements GovOrgService { QueryWrapper query = new QueryWrapper<>(); + // 如果参数里面选了,就用参数选择的来查询,没有选择的话,就查询当前工作人员所属组织的本级及下级 if (StringUtils.isNotBlank(orgId) && StringUtils.isNotBlank(orgType)) { - String orgIdPath = getOrgIdPath(orgId, orgType); - query.likeRight(StringUtils.isNotBlank(orgIdPath), "ORG_ID_PATH", orgIdPath); + orgIdPath = getOrgIdPath(orgId, orgType); } + query.likeRight(StringUtils.isNotBlank(orgIdPath), "ORG_ID_PATH", orgIdPath); + if (StringUtils.isNotBlank(customerId)) { query.eq("CUSTOMER_ID", customerId); } 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 b0de4560f1..428d87ed3e 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 @@ -22,7 +22,10 @@ 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.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.feign.EpmetHeartOpenFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.github.pagehelper.PageInfo; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -48,21 +51,34 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { @Autowired private EpmetHeartOpenFeignClient heartOpenFeignClient; + @Autowired + private EpmetUserOpenFeignClient userOpenFeignClient; + @Override 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, List statRule) { + String userId = EpmetRequestHolder.getLoginUserId(); + String app = EpmetRequestHolder.getLoginUserApp(); + String client = EpmetRequestHolder.getLoginUserClient(); String customerId = EpmetRequestHolder.getLoginUserCustomerId(); + // 查询当前组织及下级id路径 + LoginUserDetailsResultDTO userDetail = getResultDataOrThrowsException(userOpenFeignClient.getLoginUserDetails(new LoginUserDetailsFormDTO(app, client, userId)), + ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); + + String orgIdPath = userDetail.getOrgIdPath(); + // 结果集 List resultResis = new ArrayList<>(); // 1.用户没配置house和stat规则,直接按照居民规则查询 if (CollectionUtils.isEmpty(houseRule) && CollectionUtils.isEmpty(statRule)) { - List resis = epmetUserService.listByPolicyRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId, + List resis = epmetUserService.listByPolicyRules(customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId, houseId, idCard, name, pageNo, pageSize, resiRule, null); + fillResisExtraInfoForPolicy(resis); return new PageData<>(resis, new PageInfo(resis).getTotal()); } @@ -71,7 +87,7 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { int total = 0; do { // 拿到房屋id列表,去查询居民列表 - List houseEntities = govOrgService.listHousesByRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId, + List houseEntities = govOrgService.listHousesByRules(customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId, houseId, houseRule, statRule, housePageNo, 50); List houseIds = houseEntities.stream().map(icHouseEntity -> icHouseEntity.getId()).collect(Collectors.toList()); @@ -83,7 +99,7 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { // 查询居民,满了20个,不再查询数据,只查询数量 if (resultResis.size() < pageSize) { List resis = epmetUserService.listByPolicyRules( - customerId, orgId, orgType, neighborHoodId, buildingId, unitId, + customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId, houseId, idCard, name, pageNo, pageSize, resiRule, houseIds); resultResis.addAll(resis); @@ -91,7 +107,7 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { // 查询数量 Integer count = epmetUserService.getTotalByPolicyRules( - customerId, orgId, orgType, neighborHoodId, buildingId, unitId, + customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId, houseId, idCard, name, resiRule, houseIds); total += count; @@ -167,9 +183,9 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { EpmetErrorCode.SERVER_ERROR.getCode(), null, null); - resiRule = ConvertUtils.sourceToTarget(ruleList.getResiRule(), ResisByPolicyRulesFormDTO.ResiRule.class); - houseRule = ConvertUtils.sourceToTarget(ruleList.getHouseRule(), ResisByPolicyRulesFormDTO.HouseRule.class); - statRule = ConvertUtils.sourceToTarget(ruleList.getStatRule(), ResisByPolicyRulesFormDTO.StatRule.class); + resiRule = ConvertUtils.sourceToTarget(ruleList.getResiRuleList(), ResisByPolicyRulesFormDTO.ResiRule.class); + houseRule = ConvertUtils.sourceToTarget(ruleList.getHouseRuleList(), ResisByPolicyRulesFormDTO.HouseRule.class); + statRule = ConvertUtils.sourceToTarget(ruleList.getStatRuleList(), ResisByPolicyRulesFormDTO.StatRule.class); } ServletOutputStream ostream = response.getOutputStream(); 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 f0c98c7732..ffb7246583 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 @@ -71,7 +71,10 @@ - ic_resi_user.CUSTOMER_ID=#{customerId} + ic_resi_user.status='0' + and ic_resi_user.CUSTOMER_ID=#{customerId} + and ic_resi_user.PIDS LIKE CONCAT(#{orgIdPath},'%') + and ic_resi_user.del_flag='0' @@ -84,23 +87,23 @@ - + and ic_resi_user.VILLAGE_ID=#{neighborHoodId} - + and ic_resi_user.BUILD_ID=#{buildingId} - + and ic_resi_user.UNIT_ID=#{unitId} - + and ic_resi_user.HOME_ID=#{houseId} - - and ic_resi_user.ID_CARD like CONCAT('%'#{idCard}, '%') + + and ic_resi_user.ID_CARD like CONCAT('%',#{idCard}, '%') - - and ic_resi_user.NAME like CONCAT('%'#{name}, '%') + + and ic_resi_user.NAME like CONCAT('%',#{name}, '%') diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyPageFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyPageFormDTO.java index 0db60d639a..01cf09cfbf 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyPageFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyPageFormDTO.java @@ -32,6 +32,7 @@ public class IcPolicyPageFormDTO extends PageFormDTO implements Serializable { * 是否过期;1:已过期;0:未过期 */ private String expiredFlag; + private String agencyId; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java index 79be9a25ff..d9f15f9637 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java @@ -66,5 +66,29 @@ public class IcPolicyRuleDetailDTO { */ @NotBlank(message = "参数值不能为空", groups = {ResiRulerShowGroup.class,HouseRulerShowGroup.class,StatRulerShowGroup.class}) private String colVal; + + /** + * 用于前端展示:基础信息、教育信息、房屋类型..... + */ + private String itemGroupName; + /** + * 用于前端展示:姓名、手机号、...... + */ + private String itemLabel; + + /** + * 用于前端展示:等于、不等于、大于、小于.... + */ + private String queryTypeName; + + /** + * 用于前端展示:参数值显示值eg:男女 + */ + private String colValLabel; + + /** + * 用于前端展示:逻辑:并且、或者 + */ + private String nextLogicalRelName; } 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 11ff13ac65..b02273a16c 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 @@ -28,14 +28,18 @@ public class HeartResisByPolicyRulesFormDTO { private Integer pageSize; @Data + @NoArgsConstructor + @AllArgsConstructor public static class RuleList { private String ruleName; - private List resiRule; - private List houseRule; - private List statRule; + private List resiRuleList; + private List houseRuleList; + private List statRuleList; } @Data + @NoArgsConstructor + @AllArgsConstructor public static class ResiRule { private String ruleDesc; private String nextLogicalRel; @@ -48,6 +52,8 @@ public class HeartResisByPolicyRulesFormDTO { } @Data + @NoArgsConstructor + @AllArgsConstructor public static class HouseRule { private String colTable; private String colKey; @@ -58,6 +64,8 @@ public class HeartResisByPolicyRulesFormDTO { } @Data + @NoArgsConstructor + @AllArgsConstructor public static class StatRule { private String colKey; private String colVal; 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 9522159e12..b65e138cdc 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 @@ -28,9 +28,9 @@ public class ResisByPolicyRulesFormDTO { @NoArgsConstructor @AllArgsConstructor public static class RuleList { - private List resiRule; - private List houseRule; - private List statRule; + private List resiRuleList; + private List houseRuleList; + private List statRuleList; } @Data diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java index 536e292c70..f77d349ccb 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java @@ -5,7 +5,6 @@ import com.epmet.dto.IcServiceScopeV2DTO; import lombok.Data; import java.io.Serializable; -import java.util.Date; import java.util.List; /** @@ -21,6 +20,7 @@ public class ServiceRecordV2DetailResultDTO implements Serializable { private String serviceRecordId; private String serviceName; + private String policyId; /** * 服务组织类型 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 ad21eb16e4..7b73ce9894 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 @@ -1,16 +1,14 @@ package com.epmet.controller; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.IcPolicyDTO; import com.epmet.dto.IcPolicyItemResultDTO; -import com.epmet.dto.form.resi.HeartResisByPolicyRulesFormDTO; import com.epmet.dto.IcPolicyRuleDTO; import com.epmet.dto.form.policy.IcPolicyFormDTO; import com.epmet.dto.form.policy.IcPolicyPageFormDTO; @@ -57,6 +55,7 @@ public class IcPolicyController { * @param input * @return */ + @Deprecated @PostMapping("resiuserlist") public Result listResiUserByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input) { // 调整错位的逻辑符号位置 @@ -145,6 +144,17 @@ public class IcPolicyController { return new Result>().ok(page); } + /** + * Desc: 政策列表下拉选 + * @param tokenDto + * @author zxc + * @date 2022/7/21 09:48 + */ + @PostMapping("policyListSelect") + public Result> policyListSelect(@LoginUser TokenDto tokenDto){ + return new Result>().ok(icPolicyService.policyListSelect(tokenDto.getUserId(),tokenDto.getCustomerId())); + } + /** * 细则列表 * @param customerId @@ -189,7 +199,7 @@ public class IcPolicyController { r.getItemId(), r.getQueryType(), r.getColTable(), r.getColKey(), r.getColVal())) .collect(Collectors.toList()); - data.setResiRule(resiRules); + data.setResiRuleList(resiRules); } // house规则 @@ -200,7 +210,7 @@ public class IcPolicyController { .map((r) -> new ResisByPolicyRulesFormDTO.HouseRule(r.getColTable(), r.getColKey(), r.getColVal(), r.getRuleDesc(), r.getNextLogicalRel(), r.getQueryType())) .collect(Collectors.toList()); - data.setHouseRule(houseRules); + data.setHouseRuleList(houseRules); } // stat规则 @@ -212,7 +222,7 @@ public class IcPolicyController { r.getRuleDesc(), r.getQueryType(), r.getColTable())) .collect(Collectors.toList()); - data.setStatRule(statRules); + data.setStatRuleList(statRules); } return new Result().ok(data); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleDetailEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleDetailEntity.java index 7516f2aca6..9a29c03d1b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleDetailEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleDetailEntity.java @@ -84,4 +84,27 @@ public class IcPolicyRuleDetailEntity extends BaseEpmetEntity { */ private Integer sort; + /** + * 用于前端展示:基础信息、教育信息、房屋类型..... + */ + private String itemGroupName; + /** + * 用于前端展示:姓名、手机号、...... + */ + private String itemLabel; + + /** + * 用于前端展示:等于、不等于、大于、小于.... + */ + private String queryTypeName; + + /** + * 用于前端展示:参数值显示值eg:男女 + */ + private String colValLabel; + + /** + * 用于前端展示:逻辑:并且、或者 + */ + private String nextLogicalRelName; } 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 e9e71b24af..d57a6ca886 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 @@ -45,6 +45,14 @@ public interface IcPolicyService extends BaseService { */ PageData policyList(IcPolicyPageFormDTO formDTO); + /** + * Desc: 政策列表下拉选 + * @param formDTO + * @author zxc + * @date 2022/7/21 09:48 + */ + List policyListSelect(String userId,String customerId); + List ruleList(String customerId,String policyId); IcPolicyDTO policyDetail(String customerId,String policyId); 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 31b7ccb20e..30d6b265ef 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 @@ -246,6 +246,15 @@ public class IcPolicyServiceImpl extends BaseServiceImpl(list, pageInfo.getTotal()); } + @Override + public List policyListSelect(String userId,String customerId) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId); + if (null == staffInfo || StringUtils.isBlank(staffInfo.getAgencyId())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "工作人员缓存信息异常", "工作人员信息异常"); + } + return baseDao.policyList(customerId, staffInfo.getAgencyId(), null,null,null); + } + @Override public List ruleList(String customerId, String policyId) { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); @@ -331,7 +340,7 @@ public class IcPolicyServiceImpl extends BaseServiceImpl new ResisByPolicyRulesFormDTO.HouseRule(r.getColTable(), r.getColKey(), r.getColVal(), r.getRuleDesc(), r.getNextLogicalRel(), r.getQueryType())) .collect(Collectors.toList()); - aggForm.getRuleList().setHouseRule(houseRules); + aggForm.getRuleList().setHouseRuleList(houseRules); } // stat规则 @@ -354,7 +363,7 @@ public class IcPolicyServiceImpl extends BaseServiceImpl page(Map params) { @@ -177,8 +180,16 @@ public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl%s", formDTO.getServiceRecordId())); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "取消服务记录失败,未查询到服务记录"); } - entity.setServiceStatus("cancel"); - baseDao.updateById(entity); + if (!"in_service".equals(entity.getServiceStatus())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("服务状态:%s", entity.getServiceStatus()), "只有服务中的记录可以取消"); + } + //2.删除主表、字表数据【进行中数据不存在反馈记录】 + baseDao.deleteById(entity); + + LambdaQueryWrapper tWrapper = new LambdaQueryWrapper<>(); + tWrapper.eq(IcServiceScopeV2Entity::getServiceRecordId, formDTO.getServiceRecordId()); + icServiceScopeV2Dao.delete(tWrapper); + } @Override diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml index 7c8a86b911..7a7b4f1a68 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml @@ -6,17 +6,17 @@