diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java index cd31f554bb..e47c97f841 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java @@ -120,4 +120,6 @@ public class ScreenProjectCategoryGridDailyDTO implements Serializable { */ private Boolean status = false; + private Integer closedProjectTotal = 0; + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectCategoryDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectCategoryDailyDao.java index 58ba1f5bc9..298860ce34 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectCategoryDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectCategoryDailyDao.java @@ -42,7 +42,7 @@ public interface FactOriginProjectCategoryDailyDao extends BaseDao selectListProjectCategoryGridDailyDTO(@Param("customerId") String customerId,@Param("subCount")Integer subCount); + List selectListProjectCategoryGridDailyDTO(@Param("customerId") String customerId,@Param("subCount")Integer subCount,@Param("projectType")String projectType); /** * @Description 查询客户下,组织直接立项的,各项目分类下的项目数量【筛选组织创建的项目,fact_origin_project_main_daily表gridId为空】 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java index 82b03555ac..2a5881cbf4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java @@ -74,4 +74,9 @@ public class ScreenProjectCategoryGridDailyEntity extends BaseEpmetEntity { * 分类等级1、2.... */ private Integer level; + + /** + * 分类下所有结案的项目 + */ + private Integer closedProjectTotal; } 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 083fe26a85..e1131e02c6 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 @@ -138,7 +138,11 @@ public class FactOriginProjectCategoryDailyServiceImpl extends BaseServiceImpl selectListProjectCategoryGridDailyDTO(String customerId) { - List list=baseDao.selectListProjectCategoryGridDailyDTO(customerId,getSubCount(customerId)); + List list=baseDao.selectListProjectCategoryGridDailyDTO(customerId,getSubCount(customerId),"all"); + List closedList = baseDao.selectListProjectCategoryGridDailyDTO(customerId,getSubCount(customerId),"closed"); + if (!CollectionUtils.isEmpty(closedList)){ + list.forEach(l -> closedList.stream().filter(c -> l.getGridId().equals(c.getGridId()) && l.getCategoryCode().equals(c.getCategoryCode())).forEach(c -> l.setClosedProjectTotal(c.getClosedProjectTotal()))); + } return list; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.25__add_closedProjectTotal.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.25__add_closedProjectTotal.sql new file mode 100644 index 0000000000..70f26d026d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.25__add_closedProjectTotal.sql @@ -0,0 +1,2 @@ +alter table screen_project_category_grid_daily add COLUMN CLOSED_PROJECT_TOTAL int(11) NOT NULL DEFAULT 0 comment '该分类下所有结案的项目数' AFTER PROJECT_TOTAL; +alter table screen_project_category_org_daily add COLUMN CLOSED_PROJECT_TOTAL int(11) NOT NULL DEFAULT 0 comment '该分类下所有结案的项目数' AFTER PROJECT_TOTAL; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml index cd1ced9860..9cfc1717b5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml @@ -36,13 +36,21 @@ p.GRID_ID, p.AGENCY_ID AS PID, P.PIDS, - count(1)as projectTotal + + count(1) AS closedProjectTotal + + + count(1)as projectTotal + FROM fact_origin_project_category_daily c LEFT JOIN fact_origin_project_main_daily p ON ( c.PROJECT_Id = p.id and p.del_flag='0' AND p.GRID_ID != '') WHERE c.DEL_FLAG = '0' AND c.CUSTOMER_ID = #{customerId} + + AND p.PROJECT_STATUS = 'closed' + AND c.`LEVEL` = '2' AND p.GRID_ID != '' GROUP BY @@ -60,13 +68,21 @@ p.GRID_ID, p.AGENCY_ID AS PID, P.PIDS, - count(distinct c.project_id)as projectTotal + + count(distinct c.project_id) AS closedProjectTotal + + + count(distinct c.project_id)as projectTotal + FROM fact_origin_project_category_daily c LEFT JOIN fact_origin_project_main_daily p ON ( c.PROJECT_Id = p.id and p.del_flag='0' AND p.GRID_ID != '') WHERE c.DEL_FLAG = '0' AND p.GRID_ID != '' + + AND p.PROJECT_STATUS = 'closed' + AND c.CUSTOMER_ID = #{customerId} GROUP BY c.CUSTOMER_ID,