diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java index 4f9216b5d4..d916e9cb13 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java @@ -83,21 +83,6 @@ public class CoverageServiceImpl implements CoverageService { @Autowired private IcResiCategoryWarnService icResiCategoryWarnService; - /** - * 场所类型常量 - */ - public static final String PLACE_TYPE_RESI = "resi"; - public static final String PLACE_TYPE_SPECIAL_RESI = "special_resi"; - public static final String PLACE_TYPE_EVENT= "event"; - public static final String PLACE_TYPE_CITY_MANAGEMENT= "city_management"; - public static final String PLACE_TYPE_COMUNITY_ORG= "community_org"; - public static final String PLACE_TYPE_DANGEROUS_CHEMICALS= "dangerous_chemicals"; - public static final String PLACE_TYPE_ENTERPRISE_PARTROL= "enterprise_patrol"; - public static final String PLACE_TYPE_GROUP_RENT= "group_rent"; - public static final String PLACE_TYPE_PUBLIC_SERVICE= "public_service"; - public static final String PLACE_TYPE_SUPERIOR_RESOURCE= "superior_resource"; - public static final String PLACE_TYPE_PARTY_UNIT= "party_unit"; - // 1:出租 0:自住 2:闲置 3:未售出 public static final Integer HOUSE_RENT_FLAG_RENT = 1; @@ -736,6 +721,13 @@ public class CoverageServiceImpl implements CoverageService { @Override public List listGovernedTargetCategories() { + List menuUrls = new ArrayList<>(128); + + List menus = govCustomerMenuRedis.getCustomerMenuList(EpmetRequestHolder.getLoginUserCustomerId(), 0, "gov_menu"); + if (CollectionUtils.isNotEmpty(menus)) { + menus.stream().forEach(m -> menuUrls.add(m.getUrl())); + } + // 1.从表中取数据出来 List targetCategories = govOrgCoverageService.listGovernedTargetCategoryEntities(); @@ -750,8 +742,10 @@ public class CoverageServiceImpl implements CoverageService { String placeTypeInAnalysis = rc.getPlaceTypeInAnalysis(); if (StringUtils.isEmpty(placeTypeInAnalysis)) { // 只有一层,没有子级 - results.add(new AnalysisGovernedTargetsResult(rc.getCategoryKey(), rc.getCategoryName(), rc.getCoverageType(), - rc.getPlaceType(), CoveragePlaceTypeEnum.getEnum(rc.getPlaceType()).getName(), rc.getQuantity(), new ArrayList<>())); + if (menuUrls.contains(rc.getMenuUrl()) || "all".equals(rc.getMenuUrl())) { + results.add(new AnalysisGovernedTargetsResult(rc.getCategoryKey(), rc.getCategoryName(), rc.getCoverageType(), + rc.getPlaceType(), CoveragePlaceTypeEnum.getEnum(rc.getPlaceType()).getName(), rc.getQuantity(), new ArrayList<>())); + } } else { // 有子级,需要使用placeTypeInAnalysis分组 List targets = placeTypeMap.get(placeTypeInAnalysis); @@ -759,8 +753,10 @@ public class CoverageServiceImpl implements CoverageService { targets = new ArrayList<>(); placeTypeMap.put(placeTypeInAnalysis, targets); } - targets.add(new AnalysisGovernedTargetsResult(rc.getCategoryKey(), rc.getCategoryName(), rc.getCoverageType(), - rc.getPlaceType(), CoveragePlaceTypeEnum.getEnum(rc.getPlaceType()).getName(), rc.getQuantity(), new ArrayList<>())); + if (menuUrls.contains(rc.getMenuUrl()) || "all".equals(rc.getMenuUrl())) { + targets.add(new AnalysisGovernedTargetsResult(rc.getCategoryKey(), rc.getCategoryName(), rc.getCoverageType(), + rc.getPlaceType(), CoveragePlaceTypeEnum.getEnum(rc.getPlaceType()).getName(), rc.getQuantity(), new ArrayList<>())); + } } });