|
|
@ -244,17 +244,33 @@ public class CoverageServiceImpl implements CoverageService { |
|
|
|
PageInfo<UserInfoResultDTO> allIcUserPageInfo = getIcUserPageInfo(formDTO); |
|
|
|
result.setUserInfos(allIcUserPageInfo.getList()); |
|
|
|
result.setUserInfosTotal(allIcUserPageInfo.getTotal()); |
|
|
|
}else if (formDTO.getSearchType().equals(OrgConstant.SEARCH_TYPE_EVENT)){ |
|
|
|
}else if (formDTO.getSearchType().equals(OrgConstant.SEARCH_TYPE_RESOURCE)){ |
|
|
|
Integer total = NumConstant.ZERO; |
|
|
|
Integer start = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); |
|
|
|
Integer end = start + formDTO.getPageSize(); |
|
|
|
Integer flag; |
|
|
|
for (String resource : resources) { |
|
|
|
if (MenusEnums.IC_EVENT.getUrl().equals(resource)){ |
|
|
|
PageInfo<EventInfoResultDTO> eventPageInfo = getEventInfo(formDTO); |
|
|
|
result.setEventInfos(eventPageInfo.getList()); |
|
|
|
result.setEventInfoTotal(eventPageInfo.getTotal()); |
|
|
|
break; |
|
|
|
if (MenusEnums.IC_SUPERIOR_RESOURCE.getUrl().equals(resource)){ |
|
|
|
Integer superiorResourceInfosCount = govOrgService.getSuperiorResourceInfosCount(formDTO); |
|
|
|
total = total + superiorResourceInfosCount; |
|
|
|
if (superiorResourceInfosCount > start){ |
|
|
|
|
|
|
|
} |
|
|
|
}else if (MenusEnums.IC_CITY_MANAGEMENT.getUrl().equals(resource)){ |
|
|
|
Integer cityManageInfosCount = govOrgService.getCityManageInfosCount(formDTO); |
|
|
|
total = total + cityManageInfosCount; |
|
|
|
|
|
|
|
}else if (MenusEnums.IC_COMMUNITY_SELF_ORGANIZATION.getUrl().equals(resource)){ |
|
|
|
Integer communitySelOrgInfosCount = heartService.getCommunitySelOrgInfosCount(formDTO); |
|
|
|
total = total + communitySelOrgInfosCount; |
|
|
|
}else if (MenusEnums.IC_DANGEROUS_CHEMICALS.getUrl().equals(resource)){ |
|
|
|
|
|
|
|
}else if (MenusEnums.IC_ENTERPRISE.getUrl().equals(resource)){ |
|
|
|
|
|
|
|
}else if (MenusEnums.IC_PUBLIC_SERVICE.getUrl().equals(resource)){ |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}else if (formDTO.getSearchType().equals(OrgConstant.SEARCH_TYPE_RESOURCE)){ |
|
|
|
|
|
|
|
} |
|
|
|
}else { |
|
|
|
// 查询居民
|
|
|
@ -263,63 +279,173 @@ public class CoverageServiceImpl implements CoverageService { |
|
|
|
result.setUserInfosTotal(allIcUserPageInfo.getTotal()); |
|
|
|
List<ResourceInfoResultDTO> reInfos = new ArrayList<>(); |
|
|
|
for (String table : tables) { |
|
|
|
if (formDTO.getIsPage() && reInfos.size() == formDTO.getPageSize()){ |
|
|
|
break; |
|
|
|
} |
|
|
|
Integer flag = formDTO.getPageSize() - reInfos.size(); |
|
|
|
switch (table){ |
|
|
|
case TableConstant.IC_SUPERIOR_RESOURCE: |
|
|
|
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() -> govOrgService.getSuperiorResourceInfos(formDTO)); |
|
|
|
List<ResourceInfoResultDTO> superiorResourceInfos = govOrgService.getSuperiorResourceInfos(formDTO); |
|
|
|
if (!superiorResourceInfos.isEmpty()){ |
|
|
|
if (formDTO.getIsPage() && superiorResourceInfos.size() > flag){ |
|
|
|
reInfos.addAll(superiorResourceInfos.subList(NumConstant.ZERO, flag)); |
|
|
|
}else { |
|
|
|
reInfos.addAll(superiorResourceInfos); |
|
|
|
} |
|
|
|
break; |
|
|
|
case TableConstant.IC_CITY_MANAGEMENT: |
|
|
|
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() -> govOrgService.getCityManageInfos(formDTO)); |
|
|
|
List<ResourceInfoResultDTO> cityManageInfos = govOrgService.getCityManageInfos(formDTO); |
|
|
|
if (!cityManageInfos.isEmpty()){ |
|
|
|
if (formDTO.getIsPage() && cityManageInfos.size() > flag){ |
|
|
|
reInfos.addAll(cityManageInfos.subList(NumConstant.ZERO,flag)); |
|
|
|
}else { |
|
|
|
reInfos.addAll(cityManageInfos); |
|
|
|
} |
|
|
|
break; |
|
|
|
case TableConstant.IC_COMMUNITY_SELF_ORGANIZATION: |
|
|
|
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() -> heartService.getCommunitySelOrgInfos(formDTO)); |
|
|
|
List<ResourceInfoResultDTO> communitySelOrgInfos = heartService.getCommunitySelOrgInfos(formDTO); |
|
|
|
if (!communitySelOrgInfos.isEmpty()){ |
|
|
|
if (formDTO.getIsPage() && communitySelOrgInfos.size() > flag){ |
|
|
|
reInfos.addAll(communitySelOrgInfos.subList(NumConstant.ZERO,flag)); |
|
|
|
}else { |
|
|
|
reInfos.addAll(communitySelOrgInfos); |
|
|
|
} |
|
|
|
break; |
|
|
|
case TableConstant.IC_DANGEROUS_CHEMICALS: |
|
|
|
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() -> govOrgService.getDangerousChemicalsInfos(formDTO)); |
|
|
|
List<ResourceInfoResultDTO> dangerousChemicalsInfos = govOrgService.getDangerousChemicalsInfos(formDTO); |
|
|
|
if (!dangerousChemicalsInfos.isEmpty()){ |
|
|
|
if (formDTO.getIsPage() && dangerousChemicalsInfos.size() > flag){ |
|
|
|
reInfos.addAll(dangerousChemicalsInfos.subList(NumConstant.ZERO,flag)); |
|
|
|
}else { |
|
|
|
reInfos.addAll(dangerousChemicalsInfos); |
|
|
|
} |
|
|
|
break; |
|
|
|
case TableConstant.IC_ENTERPRISE: |
|
|
|
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() -> govOrgService.getEnterpriseInfos(formDTO)); |
|
|
|
List<ResourceInfoResultDTO> enterpriseInfos = govOrgService.getEnterpriseInfos(formDTO); |
|
|
|
if (!enterpriseInfos.isEmpty()){ |
|
|
|
if (formDTO.getIsPage() && enterpriseInfos.size() > flag){ |
|
|
|
reInfos.addAll(enterpriseInfos.subList(NumConstant.ZERO,flag)); |
|
|
|
}else { |
|
|
|
reInfos.addAll(enterpriseInfos); |
|
|
|
} |
|
|
|
break; |
|
|
|
case TableConstant.IC_PUBLIC_SERVICE: |
|
|
|
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() -> govOrgService.getPublicServiceInfos(formDTO)); |
|
|
|
List<ResourceInfoResultDTO> publicServiceInfos = govOrgService.getPublicServiceInfos(formDTO); |
|
|
|
if (!publicServiceInfos.isEmpty()){ |
|
|
|
if (formDTO.getIsPage() && publicServiceInfos.size() > flag){ |
|
|
|
reInfos.addAll(publicServiceInfos.subList(NumConstant.ZERO,flag)); |
|
|
|
}else { |
|
|
|
reInfos.addAll(publicServiceInfos); |
|
|
|
} |
|
|
|
break; |
|
|
|
case TableConstant.IC_EVENT: |
|
|
|
PageInfo<EventInfoResultDTO> eventPageInfo = getEventInfo(formDTO); |
|
|
|
result.setEventInfos(eventPageInfo.getList()); |
|
|
|
result.setEventInfoTotal(eventPageInfo.getTotal()); |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
result.setResourceInfos(reInfos); |
|
|
|
result.setResourceInfoTotal(Long.valueOf(String.valueOf(reInfos.size()))); |
|
|
|
} |
|
|
|
for (String resource : resources) { |
|
|
|
if (MenusEnums.IC_EVENT.getUrl().equals(resource)){ |
|
|
|
PageInfo<EventInfoResultDTO> eventPageInfo = getEventInfo(formDTO); |
|
|
|
result.setEventInfos(eventPageInfo.getList()); |
|
|
|
result.setEventInfoTotal(eventPageInfo.getTotal()); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Desc: 【资源】优势资源查询 |
|
|
|
* @param formDTO |
|
|
|
* @author zxc |
|
|
|
* @date 2022/7/29 08:37 |
|
|
|
*/ |
|
|
|
public PageInfo<ResourceInfoResultDTO> getSuperiorResourcePageInfo (CoverageHomeSearchFormDTO formDTO){ |
|
|
|
PageInfo<ResourceInfoResultDTO> result = new PageInfo<>(); |
|
|
|
if (formDTO.getIsPage()){ |
|
|
|
result = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> govOrgService.getSuperiorResourceInfos(formDTO)); |
|
|
|
}else { |
|
|
|
List<ResourceInfoResultDTO> superiorResourceInfos = govOrgService.getSuperiorResourceInfos(formDTO); |
|
|
|
result.setTotal(Long.valueOf(String.valueOf(superiorResourceInfos.size()))); |
|
|
|
result.setList(superiorResourceInfos); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Desc: 【资源】城市管理查询 |
|
|
|
* @param formDTO |
|
|
|
* @author zxc |
|
|
|
* @date 2022/7/29 08:37 |
|
|
|
*/ |
|
|
|
public PageInfo<ResourceInfoResultDTO> getCityManagePageInfo (CoverageHomeSearchFormDTO formDTO){ |
|
|
|
PageInfo<ResourceInfoResultDTO> result = new PageInfo<>(); |
|
|
|
if (formDTO.getIsPage()){ |
|
|
|
result = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> govOrgService.getCityManageInfos(formDTO)); |
|
|
|
}else { |
|
|
|
List<ResourceInfoResultDTO> cityManageInfos = govOrgService.getCityManageInfos(formDTO); |
|
|
|
result.setTotal(Long.valueOf(String.valueOf(cityManageInfos.size()))); |
|
|
|
result.setList(cityManageInfos); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Desc: 【资源】公共服务查询 |
|
|
|
* @param formDTO |
|
|
|
* @author zxc |
|
|
|
* @date 2022/7/29 08:37 |
|
|
|
*/ |
|
|
|
public PageInfo<ResourceInfoResultDTO> getPublicServicePageInfo (CoverageHomeSearchFormDTO formDTO){ |
|
|
|
PageInfo<ResourceInfoResultDTO> result = new PageInfo<>(); |
|
|
|
if (formDTO.getIsPage()){ |
|
|
|
result = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> govOrgService.getPublicServiceInfos(formDTO)); |
|
|
|
}else { |
|
|
|
List<ResourceInfoResultDTO> publicServiceInfos = govOrgService.getPublicServiceInfos(formDTO); |
|
|
|
result.setTotal(Long.valueOf(String.valueOf(publicServiceInfos.size()))); |
|
|
|
result.setList(publicServiceInfos); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Desc: 【资源】重点危化品企业查询 |
|
|
|
* @param formDTO |
|
|
|
* @author zxc |
|
|
|
* @date 2022/7/29 08:37 |
|
|
|
*/ |
|
|
|
public PageInfo<ResourceInfoResultDTO> getDangerousChemicalsPageInfo (CoverageHomeSearchFormDTO formDTO){ |
|
|
|
PageInfo<ResourceInfoResultDTO> result = new PageInfo<>(); |
|
|
|
if (formDTO.getIsPage()){ |
|
|
|
result = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> govOrgService.getDangerousChemicalsInfos(formDTO)); |
|
|
|
}else { |
|
|
|
List<ResourceInfoResultDTO> dangerousChemicalsInfos = govOrgService.getDangerousChemicalsInfos(formDTO); |
|
|
|
result.setTotal(Long.valueOf(String.valueOf(dangerousChemicalsInfos.size()))); |
|
|
|
result.setList(dangerousChemicalsInfos); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Desc: 【资源】企事业单位查询 |
|
|
|
* @param formDTO |
|
|
|
* @author zxc |
|
|
|
* @date 2022/7/29 08:37 |
|
|
|
*/ |
|
|
|
public PageInfo<ResourceInfoResultDTO> getEnterpriseInfosPageInfo (CoverageHomeSearchFormDTO formDTO){ |
|
|
|
PageInfo<ResourceInfoResultDTO> result = new PageInfo<>(); |
|
|
|
if (formDTO.getIsPage()){ |
|
|
|
result = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> govOrgService.getEnterpriseInfos(formDTO)); |
|
|
|
}else { |
|
|
|
List<ResourceInfoResultDTO> enterpriseInfos = govOrgService.getEnterpriseInfos(formDTO); |
|
|
|
result.setTotal(Long.valueOf(String.valueOf(enterpriseInfos.size()))); |
|
|
|
result.setList(enterpriseInfos); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Desc: 居民信息查询 |
|
|
|
* @param formDTO |
|
|
|
* @author zxc |
|
|
|
* @date 2022/7/29 08:34 |
|
|
|
*/ |
|
|
|
public PageInfo<UserInfoResultDTO> getIcUserPageInfo (CoverageHomeSearchFormDTO formDTO){ |
|
|
|
PageInfo<UserInfoResultDTO> result = new PageInfo<>(); |
|
|
|
if (formDTO.getIsPage()){ |
|
|
@ -655,6 +781,14 @@ public class CoverageServiceImpl implements CoverageService { |
|
|
|
@Override |
|
|
|
public List<AnalysisResourceCategoriesResult> listAnalysisResourceCategories() { |
|
|
|
|
|
|
|
// 获取所有菜单的url
|
|
|
|
List<String> menuUrls = new ArrayList<>(128); |
|
|
|
|
|
|
|
List<GovMenuDTO> menus = govCustomerMenuRedis.getCustomerMenuList(EpmetRequestHolder.getLoginUserCustomerId(), 0, "gov_menu"); |
|
|
|
if (CollectionUtils.isNotEmpty(menus)) { |
|
|
|
menus.stream().forEach(m -> menuUrls.add(m.getUrl())); |
|
|
|
} |
|
|
|
|
|
|
|
//结果集
|
|
|
|
ArrayList<AnalysisResourceCategoriesResult> results = new ArrayList<>(); |
|
|
|
|
|
|
@ -674,29 +808,31 @@ public class CoverageServiceImpl implements CoverageService { |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
// 2.根据menuUrl过滤 todo
|
|
|
|
|
|
|
|
// 2.计算各类数量 todo
|
|
|
|
|
|
|
|
// 3.对上一步得到的数据进行分组,使用PLACE_TYPE_IN_ANALYSIS分组,然后放入placeType,这一列为空的说明不分组,直接属于coverage
|
|
|
|
categoryDictEntities.forEach(c -> { |
|
|
|
if (StringUtils.isBlank(c.getPlaceTypeInAnalysis())) { |
|
|
|
categoryDictEntities.forEach(category -> { |
|
|
|
if (StringUtils.isBlank(category.getPlaceTypeInAnalysis())) { |
|
|
|
// 没有placetype的
|
|
|
|
categoriesOfThisCoverage.getCategories() |
|
|
|
.add(new AnalysisResourceCategoriesResult.Category(c.getCategoryKey(), c.getCategoryName(), |
|
|
|
c.getCoverageType(), c.getPlaceType(), c.getQuantity())); |
|
|
|
if ("all".equals(category.getMenuUrl()) || menuUrls.contains(category.getMenuUrl())) { |
|
|
|
categoriesOfThisCoverage.getCategories() |
|
|
|
.add(new AnalysisResourceCategoriesResult.Category(category.getCategoryKey(), category.getCategoryName(), |
|
|
|
category.getCoverageType(), category.getPlaceType(), category.getQuantity())); |
|
|
|
} |
|
|
|
} else { |
|
|
|
// 有placetype的
|
|
|
|
AnalysisResourceCategoriesResult.PlaceType placeType = placeTypeMap.get(c.getPlaceTypeInAnalysis()); |
|
|
|
if (placeType == null) { |
|
|
|
placeType = new AnalysisResourceCategoriesResult.PlaceType( |
|
|
|
c.getPlaceTypeInAnalysis(), CoveragePlaceTypeEnum.getEnum(c.getPlaceTypeInAnalysis()).getName(), c.getQuantity(), new ArrayList<>()); |
|
|
|
placeTypeMap.put(c.getPlaceTypeInAnalysis(), placeType); |
|
|
|
AnalysisResourceCategoriesResult.PlaceType placeType = placeTypeMap.get(category.getPlaceTypeInAnalysis()); |
|
|
|
if ("all".equals(category.getMenuUrl()) || menuUrls.contains(category.getMenuUrl())) { |
|
|
|
|
|
|
|
if (placeType == null) { |
|
|
|
placeType = new AnalysisResourceCategoriesResult.PlaceType( |
|
|
|
category.getPlaceTypeInAnalysis(), CoveragePlaceTypeEnum.getEnum(category.getPlaceTypeInAnalysis()).getName(), category.getQuantity(), new ArrayList<>()); |
|
|
|
placeTypeMap.put(category.getPlaceTypeInAnalysis(), placeType); |
|
|
|
} |
|
|
|
|
|
|
|
placeType.getCategories().add(new AnalysisResourceCategoriesResult.Category(category.getCategoryKey(), |
|
|
|
category.getCategoryName(), category.getCoverageType(), category.getPlaceType(), category.getQuantity())); |
|
|
|
placeType.setQuantity(placeType.getQuantity() + category.getQuantity()); // todo 0改为category的count
|
|
|
|
} |
|
|
|
placeType.getCategories().add(new AnalysisResourceCategoriesResult.Category(c.getCategoryKey(), |
|
|
|
c.getCategoryName(), c.getCoverageType(), c.getPlaceType(), c.getQuantity())); |
|
|
|
|
|
|
|
placeType.setQuantity(placeType.getQuantity() + c.getQuantity()); // todo 0改为category的count
|
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
@ -718,6 +854,7 @@ public class CoverageServiceImpl implements CoverageService { |
|
|
|
@Override |
|
|
|
public List<AnalysisGovernedTargetsResult> listGovernedTargetCategories() { |
|
|
|
|
|
|
|
// 获取所有菜单的url
|
|
|
|
List<String> menuUrls = new ArrayList<>(128); |
|
|
|
|
|
|
|
List<GovMenuDTO> menus = govCustomerMenuRedis.getCustomerMenuList(EpmetRequestHolder.getLoginUserCustomerId(), 0, "gov_menu"); |
|
|
@ -732,11 +869,22 @@ public class CoverageServiceImpl implements CoverageService { |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
|
|
|
|
//2.从oper_customize.ic_resi_category_warn_config表中取18大类居民中需要预警的类出来
|
|
|
|
List<IcResiCategoryWarnConfigEntity> categoriesNeed2Warn = icResiCategoryWarnService.listResiCategoriesNeed2Warn(EpmetRequestHolder.getLoginUserCustomerId()); |
|
|
|
List<String> resiCategories2Show = categoriesNeed2Warn.stream().map(wc -> wc.getColumnName()).collect(Collectors.toList()); |
|
|
|
|
|
|
|
List<AnalysisGovernedTargetsResult> results = new ArrayList<>(); |
|
|
|
HashMap<String, List<AnalysisGovernedTargetsResult>> placeTypeMap = new HashMap<>(); |
|
|
|
HashMap<String, List<AnalysisGovernedTargetsResult>> placeTypeTargetMap = new HashMap<>(); |
|
|
|
HashMap<String, Integer> placeTypeQuantityMap = new HashMap<>(); |
|
|
|
|
|
|
|
targetCategories.forEach(rc -> { |
|
|
|
String placeTypeInAnalysis = rc.getPlaceTypeInAnalysis(); |
|
|
|
if (CoveragePlaceTypeEnum.RESI.getCode().equals(placeTypeInAnalysis) && !resiCategories2Show.contains(rc.getCategoryKey())) { |
|
|
|
// 因为公共服务-人群,是需要跟oper_customize.ic_resi_category_warn_config表对应,只显示warn=1的,
|
|
|
|
// 所以如果是被管理对象中的公共服务人群,如果不开启预警,就跳过;其他情况都放进去
|
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.isEmpty(placeTypeInAnalysis)) { |
|
|
|
// 只有一层,没有子级
|
|
|
|
if (menuUrls.contains(rc.getMenuUrl()) || "all".equals(rc.getMenuUrl())) { |
|
|
@ -745,41 +893,33 @@ public class CoverageServiceImpl implements CoverageService { |
|
|
|
} |
|
|
|
} else { |
|
|
|
// 有子级,需要使用placeTypeInAnalysis分组
|
|
|
|
List<AnalysisGovernedTargetsResult> targets = placeTypeMap.get(placeTypeInAnalysis); |
|
|
|
if (CollectionUtils.isEmpty(targets)) { |
|
|
|
targets = new ArrayList<>(); |
|
|
|
placeTypeMap.put(placeTypeInAnalysis, targets); |
|
|
|
} |
|
|
|
if (menuUrls.contains(rc.getMenuUrl()) || "all".equals(rc.getMenuUrl())) { |
|
|
|
List<AnalysisGovernedTargetsResult> targets = placeTypeTargetMap.get(placeTypeInAnalysis); |
|
|
|
if (CollectionUtils.isEmpty(targets)) { |
|
|
|
targets = new ArrayList<>(); |
|
|
|
placeTypeTargetMap.put(placeTypeInAnalysis, targets); |
|
|
|
placeTypeQuantityMap.put(placeTypeInAnalysis, 0); |
|
|
|
} |
|
|
|
targets.add(new AnalysisGovernedTargetsResult(rc.getCategoryKey(), rc.getCategoryName(), rc.getCoverageType(), |
|
|
|
rc.getPlaceType(), CoveragePlaceTypeEnum.getEnum(rc.getPlaceType()).getName(), rc.getQuantity(), new ArrayList<>())); |
|
|
|
|
|
|
|
placeTypeQuantityMap.put(placeTypeInAnalysis, placeTypeQuantityMap.get(placeTypeInAnalysis) + rc.getQuantity()); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
if (placeTypeMap.size() > 0) { |
|
|
|
placeTypeMap.forEach((placeTypeInAnalysis, targetObjects) -> { |
|
|
|
// 最后,把需要分组的"公共服务人群","综合治理人群"放到最后的结果列表中
|
|
|
|
if (placeTypeTargetMap.size() > 0) { |
|
|
|
placeTypeTargetMap.forEach((placeTypeInAnalysis, targetObjects) -> { |
|
|
|
AnalysisGovernedTargetsResult tr = new AnalysisGovernedTargetsResult(); |
|
|
|
tr.setPlaceType(placeTypeInAnalysis); |
|
|
|
tr.setQuantity(placeTypeQuantityMap.get(placeTypeInAnalysis)); |
|
|
|
tr.setPlaceTypeName(CoveragePlaceTypeEnum.getEnum(placeTypeInAnalysis).getName()); |
|
|
|
tr.setChildren(targetObjects); |
|
|
|
results.add(tr); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
//2.从oper_customize.ic_resi_category_warn_config表中取18大类居民中需要预警的类出来
|
|
|
|
List<IcResiCategoryWarnConfigEntity> categoriesNeed2Warn = icResiCategoryWarnService.listResiCategoriesNeed2Warn(EpmetRequestHolder.getLoginUserCustomerId()); |
|
|
|
List<AnalysisGovernedTargetsResult> ggfwrqCategories = categoriesNeed2Warn.stream().map(wc -> |
|
|
|
new AnalysisGovernedTargetsResult(wc.getColumnName(), wc.getTableName(), |
|
|
|
CoverageEnums.GGFW.getKey(), CoveragePlaceTypeEnum.RESI.getCode(), CoveragePlaceTypeEnum.RESI.getName(), |
|
|
|
0, new ArrayList<>())).collect(Collectors.toList()); |
|
|
|
|
|
|
|
AnalysisGovernedTargetsResult ggfwRq = new AnalysisGovernedTargetsResult(); |
|
|
|
ggfwRq.setPlaceType(CoveragePlaceTypeEnum.RESI.getCode()); |
|
|
|
ggfwRq.setPlaceTypeName(CoveragePlaceTypeEnum.RESI.getName()); |
|
|
|
ggfwRq.setChildren(ggfwrqCategories); |
|
|
|
|
|
|
|
results.add(ggfwRq); |
|
|
|
return results; |
|
|
|
} |
|
|
|
|
|
|
|