Browse Source

网格添加结案数

master
zxc 4 years ago
parent
commit
2c4a4a5897
  1. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java
  2. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectCategoryDailyDao.java
  3. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java
  4. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectCategoryDailyServiceImpl.java
  5. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.25__add_closedProjectTotal.sql
  6. 20
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml

2
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;
}

2
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<FactOriginPro
* @description 计算当前客户下各个网格内各项目分类下项目数量
* @Date 2021/3/23 9:58
**/
List<ScreenProjectCategoryGridDailyDTO> selectListProjectCategoryGridDailyDTO(@Param("customerId") String customerId,@Param("subCount")Integer subCount);
List<ScreenProjectCategoryGridDailyDTO> selectListProjectCategoryGridDailyDTO(@Param("customerId") String customerId,@Param("subCount")Integer subCount,@Param("projectType")String projectType);
/**
* @Description 查询客户下组织直接立项的各项目分类下的项目数量筛选组织创建的项目fact_origin_project_main_daily表gridId为空

5
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 {
* 分类等级12....
*/
private Integer level;
/**
* 分类下所有结案的项目
*/
private Integer closedProjectTotal;
}

6
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<F
**/
@Override
public List<ScreenProjectCategoryGridDailyDTO> selectListProjectCategoryGridDailyDTO(String customerId) {
List<ScreenProjectCategoryGridDailyDTO> list=baseDao.selectListProjectCategoryGridDailyDTO(customerId,getSubCount(customerId));
List<ScreenProjectCategoryGridDailyDTO> list=baseDao.selectListProjectCategoryGridDailyDTO(customerId,getSubCount(customerId),"all");
List<ScreenProjectCategoryGridDailyDTO> 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;
}

2
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;

20
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
<if test='projectType == "closed" '>
count(1) AS closedProjectTotal
</if>
<if test='projectType == "all" '>
count(1)as projectTotal
</if>
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}
<if test='projectType == "closed" '>
AND p.PROJECT_STATUS = 'closed'
</if>
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
<if test='projectType == "closed" '>
count(distinct c.project_id) AS closedProjectTotal
</if>
<if test='projectType == "all" '>
count(distinct c.project_id)as projectTotal
</if>
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 != ''
<if test='projectType == "closed" '>
AND p.PROJECT_STATUS = 'closed'
</if>
AND c.CUSTOMER_ID = #{customerId}
GROUP BY
c.CUSTOMER_ID,

Loading…
Cancel
Save