Browse Source

Merge branch 'dev'

dev
sunyuchao 4 years ago
parent
commit
27dbc62c6e
  1. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectDao.java
  2. 12
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java
  3. 15
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml

1
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectDao.java

@ -113,6 +113,7 @@ public interface ProjectDao extends BaseDao<ProjectEntity> {
* @author sun
*/
List<ProjectCategoryResultDTO> getProjectCategoryList(@Param("customerId") String customerId,
@Param("categoryCodeList") List<String> categoryCodeList,
@Param("secondCodeList") List<String> secondCodeList,
@Param("userIds") List<String> userIds,
@Param("origin") String origin);

12
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java

@ -1,6 +1,7 @@
package com.epmet.dataaggre.service.govproject.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.CustomerIdConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
@ -559,10 +560,10 @@ public class GovProjectServiceImpl implements GovProjectService {
})).collect(Collectors.toList());
//4.根据userId集合和二级分类Code集合查询来源楼院小组的项目
List<ProjectCategoryResultDTO> groupList = projectDao.getProjectCategoryList(formDTO.getCustomerId(), secondCodeList, userIds, "issue");
List<ProjectCategoryResultDTO> groupList = projectDao.getProjectCategoryList(formDTO.getCustomerId(), formDTO.getCategoryCodeList(), (CustomerIdConstant.SHI_BEI_CUSTOMER_ID.equals(formDTO.getCustomerId()) ? null : secondCodeList), userIds, "issue");
//5.根据userId集合和二级分类Code集合查询来源事件上报的项目
List<ProjectCategoryResultDTO> eventList = projectDao.getProjectCategoryList(formDTO.getCustomerId(), secondCodeList, userIds, "resiEvent");
List<ProjectCategoryResultDTO> eventList = projectDao.getProjectCategoryList(formDTO.getCustomerId(), formDTO.getCategoryCodeList(), secondCodeList, userIds, "resiEvent");
//6.封装数据
//楼院小组下分类项目列表
@ -591,9 +592,14 @@ public class GovProjectServiceImpl implements GovProjectService {
});
//当前分类下来源楼院小组的项目
groupList.forEach(gr -> {
if (secondCodeMap.containsKey(gr.getCategoryCode()) && !formDTO.getProjectId().equals(gr.getProjectId())) {
if (CustomerIdConstant.SHI_BEI_CUSTOMER_ID.equals(formDTO.getCustomerId()) && !formDTO.getProjectId().equals(gr.getProjectId())) {
ProjectAnalysisResultDTO.Project project = ConvertUtils.sourceToTarget(gr, ProjectAnalysisResultDTO.Project.class);
groupPrList.add(project);
} else {
if (secondCodeMap.containsKey(gr.getCategoryCode()) && !formDTO.getProjectId().equals(gr.getProjectId())) {
ProjectAnalysisResultDTO.Project project = ConvertUtils.sourceToTarget(gr, ProjectAnalysisResultDTO.Project.class);
groupPrList.add(project);
}
}
});
groupCa.setProjectList(groupPrList);

15
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml

@ -363,9 +363,18 @@
p.del_flag = '0'
AND p.customer_id = #{customerId}
AND p.origin = #{origin}
<foreach collection="secondCodeList" item="code" open="AND pc.category_code IN (" separator="," close=")">
#{code}
</foreach>
<choose>
<when test="null != secondCodeList and secondCodeList.size > 0">
<foreach collection="secondCodeList" item="code" open="AND pc.category_code IN (" separator="," close=")">
#{code}
</foreach>
</when>
<otherwise>
<foreach collection="categoryCodeList" item="code" open="AND (" separator=" OR " close=" )" >
pc.category_code LIKE CONCAT(#{code}, '%')
</foreach>
</otherwise>
</choose>
<if test="origin != null and origin != '' and origin == 'issue'">
<foreach collection="userIds" item="userId" open="AND prp.user_id IN (" separator="," close=")">
#{userId}

Loading…
Cancel
Save