diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java index a0f70a5591..814caa647e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java @@ -139,6 +139,7 @@ public interface ProjectDao extends BaseDao { List getProjectCategoryData(@Param("customerId") String customerId, @Param("dateId") String dateId); + List selectProjectCategoryData(@Param("customerId") String customerId, @Param("dateId") String dateId); /** * 获取项目满意度 * diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectCategoryDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectCategoryDailyServiceImpl.java index bb05d1b16f..d1c8e145dc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectCategoryDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectCategoryDailyServiceImpl.java @@ -74,7 +74,9 @@ public class FactOriginProjectCategoryDailyServiceImpl extends BaseServiceImpl projectCategoryData = projectService.getProjectCategoryData(customerId, dateString); + // 原来一个项目有多个分类,现在几个分类可能会对上同一个省里的编码,所以去重一下,插入到fact_origin_project_category表 + // List projectCategoryData = projectService.getProjectCategoryData(customerId, dateString); + List projectCategoryData = projectService.queryProjectCategoryData(customerId, dateString); HashSet projectIdSet=new HashSet<>(); if (!CollectionUtils.isEmpty(projectCategoryData)){ projectCategoryData.forEach(data->{ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java index 3a7e3a2470..af049cb788 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java @@ -249,8 +249,8 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr //项目分类数据 todo 暂时查询所有 List projectCategoryData = projectService.getProjectCategoryData(param.getCustomerId(), null); //key projectId:categoryCode Set - Map> projectCategoryMap = projectCategoryData.stream() - .collect(Collectors.groupingBy(ProjectCategoryDTO::getProjectId, Collectors.mapping(ProjectCategoryDTO::getCategoryCode, Collectors.toList()))); + Map> projectCategoryMap = projectCategoryData.stream() + .collect(Collectors.groupingBy(ProjectCategoryDTO::getProjectId, Collectors.mapping(ProjectCategoryDTO::getCategoryCode, Collectors.toSet()))); //2.获取项目的所有节点耗时数据 List projectPeriodList = factOriginProjectMainDailyService.getProjectPeriod(param); @@ -370,15 +370,15 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr * @param categoryList * @param projectCategoryMap */ - private void setCategoryInfo(ScreenDifficultyDataEntity diffEntity, String projectId, List categoryList, Map> projectCategoryMap) { - List categorySet = projectCategoryMap.get(projectId); + private void setCategoryInfo(ScreenDifficultyDataEntity diffEntity, String projectId, List categoryList, Map> projectCategoryMap) { + Set categorySet = projectCategoryMap.get(projectId); if (CollectionUtils.isEmpty(categorySet)) { return; } - projectCategoryMap.forEach((k, v) -> { - StringBuilder code = new StringBuilder(); - StringBuilder name = new StringBuilder(); - v.forEach(categoryCode -> { + StringBuilder code = new StringBuilder(); + StringBuilder name = new StringBuilder(); + //projectCategoryMap.forEach((k, v) -> { + categorySet.forEach(categoryCode -> { List childCategory = new ArrayList<>(); getParentNode(childCategory, categoryList, categoryCode); String categoryCodes = childCategory.stream().map(IssueProjectCategoryDictEntity::getCategoryCode).collect(Collectors.joining(StrConstant.HYPHEN)); @@ -389,12 +389,11 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr }); code.deleteCharAt(code.length() - NumConstant.ONE); name.deleteCharAt(name.length() - NumConstant.ONE); - diffEntity.setEventCategoryCode(code.toString()); - diffEntity.setEventCategoryName(name.toString()); log.debug("code:{}",code.toString()); log.debug("name:{}",name.toString()); - }); - + //}); + diffEntity.setEventCategoryCode(code.toString()); + diffEntity.setEventCategoryName(name.toString()); } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java index f4283979b0..ced07132f7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java @@ -155,6 +155,7 @@ public interface ProjectService extends BaseService { */ List getProjectCategoryData(String customerId, String dateId); + List queryProjectCategoryData(String customerId, String dateId); /** * 获取项目满意度 * @author zhaoqifeng diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java index 095a0ec901..5084e99852 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -161,6 +161,10 @@ public class ProjectServiceImpl extends BaseServiceImpl queryProjectCategoryData(String customerId, String dateId) { + return baseDao.selectProjectCategoryData(customerId,dateId); + } /** * 获取项目满意度 * diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml index 476ae619c8..85e8316cd3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml @@ -146,6 +146,24 @@ AND DATE_FORMAT(CREATED_TIME,'%Y%m%d')=#{dateId} + + + +