Browse Source

Merge remote-tracking branch 'origin/dev_add_closedCount_category' into dev

dev_shibei_match
zxc 4 years ago
parent
commit
37b9fc1892
  1. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java
  2. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryGridAndOrgDailyServiceImpl.java
  3. 18
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java

@ -80,7 +80,7 @@ public interface ScreenProjectDataDao extends BaseDao<ScreenProjectDataEntity> {
* @author zxc
* @date 2021/11/10 3:12 下午
*/
List<GridAndOrgCategoryCountResultDTO> selectGridCategoryProjectCount(@Param("customerIds") List<String> customerIds,@Param("dateId") String dateId,
List<GridAndOrgCategoryCountResultDTO> selectGridCategoryProjectCount(@Param("dateId") String dateId,@Param("parentCustomerId") String parentCustomerId,
@Param("status")String status,@Param("customerId") String customerId,
@Param("subCount")Integer subCount);

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryGridAndOrgDailyServiceImpl.java

@ -74,14 +74,20 @@ public class ScreenProjectCategoryGridAndOrgDailyServiceImpl implements ScreenPr
List<GridAndOrgCategoryCountResultDTO> closedList = new ArrayList<>();
if (CollectionUtils.isEmpty(relationInfo)){
// 单客户
allList = screenProjectDataDao.selectGridCategoryProjectCount(customerIds, dateId, ProjectConstant.PROJECT_STATUS_ALL,customerId, NumConstant.FOUR);
closedList = screenProjectDataDao.selectGridCategoryProjectCount(customerIds, dateId, ProjectConstant.PROJECT_STATUS_CLOSED,customerId, NumConstant.FOUR);
allList = screenProjectDataDao.selectGridCategoryProjectCount(dateId, customerId, ProjectConstant.PROJECT_STATUS_ALL,customerId, NumConstant.FOUR);
closedList = screenProjectDataDao.selectGridCategoryProjectCount(dateId, customerId, ProjectConstant.PROJECT_STATUS_CLOSED,customerId, NumConstant.FOUR);
}else {
// 多客户
List<String> subCustomerIds = relationInfo.stream().map(CustomerRelationEntity::getCustomerId).collect(Collectors.toList());
customerIds.addAll(subCustomerIds);
allList = screenProjectDataDao.selectGridCategoryProjectCount(customerIds, dateId, ProjectConstant.PROJECT_STATUS_ALL,customerId, NumConstant.TWO);
closedList = screenProjectDataDao.selectGridCategoryProjectCount(customerIds, dateId, ProjectConstant.PROJECT_STATUS_CLOSED,customerId, NumConstant.TWO);
List<GridAndOrgCategoryCountResultDTO> finalAllList = allList;
List<GridAndOrgCategoryCountResultDTO> finalClosedList1 = closedList;
customerIds.forEach(c -> {
List<GridAndOrgCategoryCountResultDTO> all = screenProjectDataDao.selectGridCategoryProjectCount(dateId, customerId, ProjectConstant.PROJECT_STATUS_ALL, c, NumConstant.TWO);
finalAllList.addAll(all);
List<GridAndOrgCategoryCountResultDTO> closed = screenProjectDataDao.selectGridCategoryProjectCount(dateId, customerId, ProjectConstant.PROJECT_STATUS_CLOSED, c, NumConstant.TWO);
finalClosedList1.addAll(closed);
});
}
log.info("网格-所有项目分类{}",allList);
log.info("网格-所有已关闭项目分类{}",closedList);

18
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml

@ -274,7 +274,7 @@
<select id="selectGridCategoryProjectCount" resultType="com.epmet.dto.screen.result.GridAndOrgCategoryCountResultDTO">
SELECT
#{dateId} AS dateId,
#{customerId} AS customerId,
#{parentCustomerId} AS customerId,
pc.CATEGORY_CODE,
pd.ORG_ID AS gridId,
pd.PARENT_ID AS pid,
@ -287,12 +287,9 @@
COUNT(DISTINCT pc.PROJECT_ID) AS projectTotal
</if>
FROM screen_project_data pd
LEFT JOIN screen_project_category pc ON (pc.PROJECT_ID = pd.PROJECT_ID AND pc.DEL_FLAG = '0')
inner JOIN screen_project_category pc ON (pc.PROJECT_ID = pd.PROJECT_ID AND pc.DEL_FLAG = '0')
WHERE pd.DEL_FLAG = '0'
AND pd.CUSTOMER_ID IN
<foreach collection="customerIds" item="c" separator="," open="(" close=")">
#{c}
</foreach>
AND pd.CUSTOMER_ID =#{customerId}
AND DATE_FORMAT(pd.PROJECT_CREATE_TIME,'%Y%m%d') <![CDATA[ <= ]]> #{dateId}
AND pd.ORG_TYPE = 'grid'
AND pc.level = 2
@ -303,7 +300,7 @@
UNION ALL
SELECT
#{dateId} AS dateId,
#{customerId} AS customerId,
#{parentCustomerId} AS customerId,
left(pc.CATEGORY_CODE, #{subCount}) AS categoryCode,
pd.ORG_ID AS gridId,
pd.PARENT_ID AS pid,
@ -318,10 +315,7 @@
FROM screen_project_data pd
INNER JOIN screen_project_category pc ON (pc.PROJECT_ID = pd.PROJECT_ID AND pc.DEL_FLAG = '0')
WHERE pd.DEL_FLAG = '0'
AND pd.CUSTOMER_ID IN
<foreach collection="customerIds" item="c" separator="," open="(" close=")">
#{c}
</foreach>
AND pd.CUSTOMER_ID = #{customerId}
AND DATE_FORMAT(pd.PROJECT_CREATE_TIME,'%Y%m%d') <![CDATA[ <= ]]> #{dateId}
AND pd.ORG_TYPE = 'grid'
<if test=' status == "closed" '>
@ -350,7 +344,7 @@
COUNT(DISTINCT pc.PROJECT_ID) AS projectTotal
</if>
FROM screen_project_data pd
LEFT JOIN screen_project_category pc ON (pc.PROJECT_ID = pd.PROJECT_ID AND pc.DEL_FLAG = '0')
inner JOIN screen_project_category pc ON (pc.PROJECT_ID = pd.PROJECT_ID AND pc.DEL_FLAG = '0')
WHERE pd.DEL_FLAG = '0'
AND pc.level = 2
AND DATE_FORMAT(pd.PROJECT_CREATE_TIME,'%Y%m%d') <![CDATA[ <= ]]> #{dateId}

Loading…
Cancel
Save