From 452b6d75f5e5035ba2baf268ddbf46a7f31e3f65 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Thu, 28 Jul 2022 16:37:27 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=9B=BE=E5=B1=82=E3=80=91=E5=8F=AF?= =?UTF-8?q?=E8=A7=86=E5=8C=96-=E5=B7=A6=E4=BE=A7=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0menu=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/CoverageServiceImpl.java | 34 ++++++++----------- 1 file changed, 15 insertions(+), 19 deletions(-) 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<>())); + } } });