diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java index e3ebbf82e4..e46b85f91d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java @@ -309,23 +309,23 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl> groupByLevel = agencyIdList.stream().collect(Collectors.groupingBy(CustomerAgencyInfoResultDTO::getLevel)); if (groupByLevel.containsKey(ScreenConstant.COMMUNITY)){ // 社区级别 - disposeMoreCustomerSub(ScreenConstant.COMMUNITY,true,customerId,dateId,relationInfo); + disposeMoreCustomerSub(ScreenConstant.COMMUNITY,true,customerId,dateId,relationInfo,agencyIdList); } if (groupByLevel.containsKey(ScreenConstant.STREET)){ // 街道级别 - disposeMoreCustomerSub(ScreenConstant.STREET,false,customerId,dateId,relationInfo); + disposeMoreCustomerSub(ScreenConstant.STREET,false,customerId,dateId,relationInfo,agencyIdList); } if (groupByLevel.containsKey(ScreenConstant.DISTRICT)){ // 区级 - disposeMoreCustomerSub(ScreenConstant.DISTRICT,false,customerId,dateId,relationInfo); + disposeMoreCustomerSub(ScreenConstant.DISTRICT,false,customerId,dateId,relationInfo,agencyIdList); } if (groupByLevel.containsKey(ScreenConstant.CITY)){ // 市级 - disposeMoreCustomerSub(ScreenConstant.CITY,false,customerId,dateId,relationInfo); + disposeMoreCustomerSub(ScreenConstant.CITY,false,customerId,dateId,relationInfo,agencyIdList); } if (groupByLevel.containsKey(ScreenConstant.PROVINCE)){ // 省级 - disposeMoreCustomerSub(ScreenConstant.PROVINCE,false,customerId,dateId,relationInfo); + disposeMoreCustomerSub(ScreenConstant.PROVINCE,false,customerId,dateId,relationInfo,agencyIdList); } } } @@ -340,7 +340,7 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl relationInfo){ + private void disposeMoreCustomerSub(String level,Boolean isGrid,String customerId, String dateId, List relationInfo,List agencyIdList){ List result = new ArrayList<>(); if (isGrid){ // community级别走这 @@ -399,6 +399,41 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl> groupByLevel = agencyIdList.stream().collect(Collectors.groupingBy(CustomerAgencyInfoResultDTO::getLevel)); + List levelAgencyInfo = groupByLevel.get(level); + if (!CollectionUtils.isEmpty(levelAgencyInfo)) { + List orgIds = levelAgencyInfo.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); + List screenProjectCategory = factOriginProjectCategoryDailyService.selectListProjectCategoryByOrg(orgIds, customerId); + if (!CollectionUtils.isEmpty(result)) { + if (!CollectionUtils.isEmpty(screenProjectCategory)) { + result.forEach(r -> { + screenProjectCategory.forEach(pc -> { + if (r.getOrgId().equals(pc.getOrgId()) && r.getCategoryCode().equals(pc.getCategoryCode())) { + pc.setStatus(true); + r.setProjectTotal(r.getProjectTotal() + pc.getProjectTotal()); + } + }); + }); + Map> groupByStatus = screenProjectCategory.stream().collect(Collectors.groupingBy(ScreenProjectCategoryGridDailyDTO::getStatus)); + List screenProjectCategoryNoCal = groupByStatus.get(false); + if (!CollectionUtils.isEmpty(screenProjectCategoryNoCal)) { + List noCalCategory = ConvertUtils.sourceToTarget(screenProjectCategoryNoCal, ScreenProjectCategoryOrgDailyEntity.class); + result.addAll(noCalCategory); + } + } + } else { + if (!CollectionUtils.isEmpty(screenProjectCategory)) { + result = ConvertUtils.sourceToTarget(screenProjectCategory, ScreenProjectCategoryOrgDailyEntity.class); + } + } + if (!CollectionUtils.isEmpty(result)) { + result.forEach(r -> { + r.setOrgType(level); + r.setDateId(dateId); + }); + } + } deleteAndInsert(customerId,dateId,result); }