|
|
@ -521,6 +521,126 @@ public class GovProjectServiceImpl implements GovProjectService { |
|
|
|
resultDTO.setList(result.getList()); |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
/** |
|
|
|
* @Description 赋能平台【项目处理分析】分类下项目列表--市北接口 |
|
|
|
* 【市北的分类有三类四类,跟我们只有一类二类不一样,单独给开一个接口使用】 |
|
|
|
* @author sun |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public CategoryProjectResultDTO categoryProjectListSb(CategoryProjectFormDTO formDTO) { |
|
|
|
CategoryProjectResultDTO resultDTO = new CategoryProjectResultDTO(); |
|
|
|
//所选日期后一天的dateId值
|
|
|
|
formDTO.setToDateId(DateUtils.dateOrmonthId(formDTO.getDateId(), "date", 1)); |
|
|
|
//1.查询客户下分类信息
|
|
|
|
List<IssueProjectCategoryDictDTO> categoryList = govIssueService.categoryList(formDTO.getCustomerId(), null, null); |
|
|
|
/*List<String> categoreCodeList = categoryList.stream().filter(ca -> ca.getParentCategoryCode().equals(formDTO.getCategoryCode())).map(m -> m.getCategoryCode()).collect(Collectors.toList()); |
|
|
|
formDTO.setCategoreCodeList(categoreCodeList);*/ |
|
|
|
|
|
|
|
//2.查询组织及下级截止某一天的某个一级分类下的项目列表
|
|
|
|
PageInfo<CategoryProjectResultDTO.Project> result = |
|
|
|
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> projectDao.categoryProjectList(formDTO)); |
|
|
|
if (org.springframework.util.CollectionUtils.isEmpty(result.getList())) { |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
resultDTO.setTotal((int) result.getTotal()); |
|
|
|
|
|
|
|
//3.查询已有项目列表涉及的所有分类信息【一个项目存在多个一级分类下的二级分类】
|
|
|
|
List<String> projectIds = result.getList().stream().map(CategoryProjectResultDTO.Project::getProjectId).collect(Collectors.toList()); |
|
|
|
List<CategoryProjectResultDTO.Project> list = projectDao.getCategoryList(projectIds); |
|
|
|
|
|
|
|
//4.查询来源事件的项目上报的组织信息
|
|
|
|
List<String> eventIds = result.getList().stream().filter(re -> "resi_event".equals(re.getOrigin())).map(m -> m.getOriginId()).collect(Collectors.toList()); |
|
|
|
List<ResiEventReportOrgDTO> eventOrgList = projectDao.getEventOrgList(eventIds); |
|
|
|
Map<String, ResiEventReportOrgDTO> eventMap = eventOrgList.stream().collect(Collectors.toMap(ResiEventReportOrgDTO::getResiEventId, Function.identity())); |
|
|
|
|
|
|
|
//5.查询来源议题、事件的项目居民端创建人userId
|
|
|
|
List<ResiEventDTO> eventUser = projectDao.getEventList(projectIds); |
|
|
|
List<ProjectRelatedPersonnelDTO> topicUser = projectDao.getTopicUser(projectIds); |
|
|
|
|
|
|
|
//5.封装数据
|
|
|
|
//组织或网格id->组织或网格名称
|
|
|
|
Map<String, String> map = new HashMap<>(); |
|
|
|
result.getList().forEach(re -> { |
|
|
|
//所属组织
|
|
|
|
if ("issue".equals(re.getOrigin())) { |
|
|
|
if (map.containsKey(re.getGridId())) { |
|
|
|
re.setOrgName(map.get(re.getGridId())); |
|
|
|
} else { |
|
|
|
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(re.getGridId()); |
|
|
|
if (gridInfo != null) { |
|
|
|
re.setOrgName(gridInfo.getGridName()); |
|
|
|
map.put(re.getGridId(), gridInfo.getGridName()); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if ("agency".equals(re.getOrigin())) { |
|
|
|
if (map.containsKey(re.getAgencyId())) { |
|
|
|
re.setOrgName(map.get(re.getAgencyId())); |
|
|
|
} else { |
|
|
|
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(re.getAgencyId()); |
|
|
|
if (agencyInfo != null) { |
|
|
|
re.setOrgName(agencyInfo.getOrganizationName()); |
|
|
|
map.put(re.getAgencyId(), agencyInfo.getOrganizationName()); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} else if ("resi_event".equals(re.getOrigin())) { |
|
|
|
if (eventMap.containsKey(re.getOriginId())) { |
|
|
|
if ("grid".equals(eventMap.get(re.getOriginId()).getOrgType())) { |
|
|
|
if (map.containsKey(re.getGridId())) { |
|
|
|
re.setOrgName(map.get(re.getGridId())); |
|
|
|
} else { |
|
|
|
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(re.getGridId()); |
|
|
|
if (gridInfo != null) { |
|
|
|
re.setOrgName(gridInfo.getGridName()); |
|
|
|
map.put(re.getGridId(), gridInfo.getGridName()); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (map.containsKey(re.getAgencyId())) { |
|
|
|
re.setOrgName(map.get(re.getAgencyId())); |
|
|
|
} else { |
|
|
|
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(re.getAgencyId()); |
|
|
|
if (agencyInfo != null) { |
|
|
|
re.setOrgName(agencyInfo.getOrganizationName()); |
|
|
|
map.put(re.getAgencyId(), agencyInfo.getOrganizationName()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//项目涉及分类信息【一个项目涉及多个一级分类】
|
|
|
|
//一级分类Id
|
|
|
|
List<String> caId = new ArrayList<>(); |
|
|
|
list.forEach(ca -> { |
|
|
|
if (ca.getProjectId().equals(re.getProjectId())) { |
|
|
|
caId.add(ca.getCategoryPids()); |
|
|
|
} |
|
|
|
}); |
|
|
|
//一级分类名称、code集合
|
|
|
|
List<String> caName = new ArrayList<>(); |
|
|
|
List<String> caCode = new ArrayList<>(); |
|
|
|
categoryList.forEach(ca -> caId.stream().filter(li -> ca.getId().equals(li)).forEach(s -> { |
|
|
|
caName.add(ca.getCategoryName()); |
|
|
|
caCode.add(ca.getCategoryCode()); |
|
|
|
})); |
|
|
|
re.setCategoryNames(caName); |
|
|
|
re.setCategoryCodes(caCode); |
|
|
|
//项目来源话题、事件的创建人信息
|
|
|
|
eventUser.forEach(ev -> { |
|
|
|
if (re.getProjectId().equals(ev.getProjectId())) { |
|
|
|
re.setUserId(ev.getReportUserId()); |
|
|
|
} |
|
|
|
}); |
|
|
|
topicUser.forEach(to -> { |
|
|
|
if (re.getProjectId().equals(to.getProjectId())) { |
|
|
|
re.setUserId(to.getUserId()); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
resultDTO.setList(result.getList()); |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 赋能平台【项目处理分析】研判分析 |
|
|
|