Browse Source

Merge branch 'dev_bugfix' into dev

dev_shibei_match
sunyuchao 5 years ago
parent
commit
6d6f4b6c9d
  1. 4
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectLatestOperationResultDTO.java
  2. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java
  3. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java
  4. 43
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java
  5. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java
  6. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java
  7. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java
  8. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java
  9. 22
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  10. 22
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml

4
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectLatestOperationResultDTO.java

@ -17,4 +17,8 @@ public class ProjectLatestOperationResultDTO implements Serializable {
private String projectId;
private String operationName;
private Integer costTime;
private String title;
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java

@ -153,15 +153,4 @@ public interface ProjectProcessDao extends BaseDao<ProjectProcessEntity> {
* @date 2020.09.28 14:45
*/
List<ProjectLatestOperationResultDTO> selectLatestOperation(@Param("list") List<String> list,@Param("customerId") String customerId);
/**
* @Description 查找项目标题
* @param list
* @return java.util.List<com.epmet.dto.project.result.ProjectLatestOperationResultDTO>
* @author wangc
* @date 2020.09.28 14:45
*/
List<ProjectLatestOperationResultDTO> selectProjectTitle(@Param("list") List<String> list,@Param("customerId") String customerId);
}

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java

@ -16,7 +16,6 @@ import com.epmet.dto.issue.IssueDTO;
import com.epmet.dto.party.PartyMemberDTO;
import com.epmet.dto.project.FinishOrgDTO;
import com.epmet.dto.project.ProcessInfoDTO;
import com.epmet.dto.project.ProjectOrgRelationDTO;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import com.epmet.dto.result.WorkDayResultDTO;
import com.epmet.dto.topic.ResiTopicDTO;
@ -42,8 +41,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collector;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
/**
@ -123,6 +124,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
}
//获取项目信息
List<ProjectDTO> projectList = projectService.getProjectInfo(customerId, dateString);
factOriginProjectMainDailyService.deleteByDate(customerId, dateString);
if (!CollectionUtils.isEmpty(projectList)) {
//提取议题ID
List<String> issueIds = projectList.stream().map(ProjectDTO::getOriginId).collect(Collectors.toList());
@ -193,7 +195,6 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
}));
//插入数据
if (!list.isEmpty()) {
factOriginProjectMainDailyService.deleteByDate(customerId, dateString);
factOriginProjectMainDailyService.insertBatch(list);
}
}
@ -368,8 +369,8 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
path =path.substring(NumConstant.ZERO,path.length() - NumConstant.ONE);
}
entity.setPids(path);
}else{
log.warn("【data-statistical】业务数据抽取模块,ProjectExtractServiceImpl.saveOriginProjectDaily:查询出的项目节点发起人所属的orgIdPath不正确,agencyId->{},orgIdPath->{}",process.getAgencyId(),process.getPids());
} else {
log.warn("【data-statistical】业务数据抽取模块,ProjectExtractServiceImpl.saveOriginProjectDaily:查询出的项目节点发起人所属的orgIdPath不正确,agencyId->{},orgIdPath->{}", process.getAgencyId(), process.getPids());
entity.setPid(NumConstant.ZERO_STR);
entity.setPids("");
}
@ -378,8 +379,8 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
return entity;
}).collect(Collectors.toList()));
if (!logList.isEmpty()) {
factOriginProjectLogDailyService.deleteByDate(customerId, dateString);
if (!logList.isEmpty()) {
factOriginProjectLogDailyService.insertBatch(logList);
}

43
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java

@ -5,6 +5,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.org.GridInfoDTO;
import com.epmet.dto.project.result.ProjectLatestOperationResultDTO;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
@ -77,8 +78,7 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
//2.查询出客户下网格的相关信息
List<GridInfoDTO> gridList = customerGridService.queryGridInfoList(param.getCustomerId());
Map<String,GridInfoDTO> gridMap = new HashMap<>();
gridList.forEach(grid -> {gridMap.put(grid.getGridId(),grid);});
Map<String,GridInfoDTO> gridMap = gridList.stream().collect(Collectors.toMap(GridInfoDTO :: getGridId,a -> a,(o, n) -> o));
//3.查询出客户下用户的累计积分(累计值,没有时间概念,否则需要查询积分明细计算出评价周期末的得分)
Map<String,Integer> pointMap = userPointService.getUserPointMap(param.getCustomerId());
@ -99,6 +99,12 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
Map<String, BigDecimal> scoreMap = cpcIndexCalculateService.getCpcScore(param.getCustomerId(),dateId);
//剔除垃圾数据
for(Iterator<ScreenPartyUserRankDataEntity> iter = registeredUsers.iterator();
iter.hasNext();){
if(null == gridMap.get(iter.next().getGridId())) iter.remove();
}
//5.整合数据
if(!CollectionUtils.isEmpty(registeredUsers)){
registeredUsers.forEach(user -> {
@ -154,13 +160,26 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
//查询数据
List<ScreenDifficultyDataEntity> difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(),projectService.getOvertimeProjectByParameter(param.getCustomerId(),existed));
if(CollectionUtils.isEmpty(difficulties)) return;
//剔除垃圾数据
//2.查询出客户下网格的相关信息
List<GridInfoDTO> gridList = customerGridService.queryGridInfoList(param.getCustomerId());
Map<String,GridInfoDTO> gridMap = gridList.stream().collect(Collectors.toMap(GridInfoDTO :: getGridId,a -> a,(o, n) -> o));
List<String> missing = new LinkedList<>();
for(Iterator<ScreenDifficultyDataEntity> iter = difficulties.iterator(); iter.hasNext();){
ScreenDifficultyDataEntity pointer = iter.next();
if(null == gridMap.get(pointer.getOrgId())){
missing.add(pointer.getEventId());
iter.remove();
}
}
List<String> projectIds = difficulties.stream().map(ScreenDifficultyDataEntity :: getEventId).distinct().collect(Collectors.toList());
//最近一次操作
Map<String,String> latestOperationMap = projectProcessService.getLatestOperation(projectIds,param.getCustomerId());
//标题
Map<String,String> titleMap = projectProcessService.getProjectTitle(projectIds,param.getCustomerId());
Map<String, ProjectLatestOperationResultDTO> latestOperationMap = projectProcessService.getLatestOperation(projectIds,param.getCustomerId());
boolean isOperationNull = CollectionUtils.isEmpty(latestOperationMap) ? true : false;
boolean isTitleNull = CollectionUtils.isEmpty(titleMap) ? true : false;
//图片
List<ProjectSourceMapFormDTO> projectSourceMap = factOriginProjectMainDailyService.getNewProject(param.getCustomerId(),projectIds);
@ -178,16 +197,20 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
diff.setEventContent(contentMap.get(diff.getEventId()));
}
if(!isOperationNull){
diff.setLatestOperateDesc(latestOperationMap.get(diff.getEventId()));
ProjectLatestOperationResultDTO oper = latestOperationMap.get(diff.getEventId());
if(null != oper){
diff.setLatestOperateDesc(oper.getOperationName());
diff.setEventTitle(oper.getTitle());
diff.setEventCostTime(oper.getCostTime());
}
if(!isTitleNull){
diff.setEventTitle(titleMap.get(diff.getEventId()));
}
diff.setDataEndTime(DateUtils.getBeforeNDay(NumConstant.ONE));
});
List<ScreenDifficultyImgDataEntity> imgList = new LinkedList<>();
imgMap.values().forEach(list -> {imgList.addAll(list);});
screenDifficultyDataService.dataClean(param.getCustomerId(),difficulties,imgList);
screenDifficultyDataService.dataClean(param.getCustomerId(),difficulties,imgList,missing);
}
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java

@ -49,6 +49,6 @@ public interface ScreenDifficultyDataService extends BaseService<ScreenDifficult
* @author wangc
* @date 2020.09.28 11:04
*/
void dataClean(String customerId,List<ScreenDifficultyDataEntity> difficulties, List<ScreenDifficultyImgDataEntity> imgs);
void dataClean(String customerId,List<ScreenDifficultyDataEntity> difficulties, List<ScreenDifficultyImgDataEntity> imgs,List<String> missing);
}

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

@ -53,7 +53,11 @@ public class ScreenDifficultyDataServiceImpl extends BaseServiceImpl<ScreenDiffi
@Override
@Transactional(rollbackFor = Exception.class)
public void dataClean(String customerId, List<ScreenDifficultyDataEntity> difficulties, List<ScreenDifficultyImgDataEntity> imgs) {
public void dataClean(String customerId, List<ScreenDifficultyDataEntity> difficulties, List<ScreenDifficultyImgDataEntity> imgs,List<String> missing) {
if(!CollectionUtils.isEmpty(missing)){
baseDao.deleteBatchDifficulty(customerId, missing);
baseDao.deleteBatchDifficultyImg(missing);
}
if (!CollectionUtils.isEmpty(difficulties)) {
baseDao.deleteBatchDifficulty(customerId, difficulties.stream().map(ScreenDifficultyDataEntity::getEventId).distinct().collect(Collectors.toList()));
baseDao.insertBatch(difficulties);
@ -62,7 +66,6 @@ public class ScreenDifficultyDataServiceImpl extends BaseServiceImpl<ScreenDiffi
baseDao.deleteBatchDifficultyImg(imgs.stream().map(ScreenDifficultyImgDataEntity::getEventId).distinct().collect(Collectors.toList()));
baseDao.insertBatchImg(imgs);
}
baseDao.updateTime(customerId, DateUtils.getBeforeNDay(NumConstant.ONE));
}
}

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java

@ -120,20 +120,9 @@ public interface ProjectProcessService extends BaseService<ProjectProcessEntity>
* @Description 获得项目最新操作
* @param list
* @param customerId
* @return java.util.Map<java.lang.String,java.lang.String>
* @return
* @author wangc
* @date 2020.09.28 14:44
*/
Map<String,String> getLatestOperation(List<String> list, String customerId);
/**
* @Description 获取项目标题
* @param list
* @param customerId
* @return java.util.Map<java.lang.String,java.lang.String>
* @author wangc
* @date 2020.10.27 14:34
*/
Map<String,String> getProjectTitle(List<String>list ,String customerId);
Map<String,ProjectLatestOperationResultDTO> getLatestOperation(List<String> list, String customerId);
}

25
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java

@ -117,36 +117,17 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl<ProjectProcessDao
* @Description 获得项目最新操作
* @param list
* @param customerId
* @return java.util.Map<java.lang.String,java.lang.String>
* @return
* @author wangc
* @date 2020.09.28 14:44
*/
@Override
public Map<String, String> getLatestOperation(List<String> list, String customerId) {
public Map<String, ProjectLatestOperationResultDTO> getLatestOperation(List<String> list, String customerId) {
List<ProjectLatestOperationResultDTO> operations = baseDao.selectLatestOperation(list,customerId);
if(CollectionUtils.isEmpty(operations)){
return Collections.EMPTY_MAP;
}else{
return operations.stream().collect(Collectors.toMap(ProjectLatestOperationResultDTO :: getProjectId,ProjectLatestOperationResultDTO :: getOperationName));
return operations.stream().collect(Collectors.toMap(ProjectLatestOperationResultDTO :: getProjectId,o->o,(a,n)-> a));
}
}
/**
* @Description 获取项目标题
* @param list
* @param customerId
* @return java.util.Map<java.lang.String,java.lang.String>
* @author wangc
* @date 2020.10.27 14:34
*/
@Override
public Map<String, String> getProjectTitle(List<String> list, String customerId) {
List<ProjectLatestOperationResultDTO> titles = baseDao.selectProjectTitle(list,customerId);
if(CollectionUtils.isEmpty(titles)){
return Collections.EMPTY_MAP;
}else{
return titles.stream().collect(Collectors.toMap(ProjectLatestOperationResultDTO :: getProjectId,ProjectLatestOperationResultDTO :: getOperationName));
}
}
}

22
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml

@ -331,7 +331,7 @@
( project.PROJECT_STATUS = 'pending', '处理中', '已结案' ) AS eventStatusDesc,
IFNULL(relation.reOrg,0) AS eventReOrg,
IFNULL(handleCount.HandledCount,0) AS eventHandledCount,
IFNULL(costTime.costTime,0) AS eventCostTime ,
gridInfo.allParentIds
FROM
fact_origin_project_main_daily project
@ -382,26 +382,6 @@
GROUP BY
PROJECT_ID
) handleCount ON project.ID = handleCount.PROJECT_ID
LEFT JOIN (
SELECT
main.ID AS PROJECT_ID,
TIMESTAMPDIFF(
MINUTE,
str_to_date( main.DATE_ID, '%Y%m%d' ),
IF
( main.IS_RESOLVED = 'resolved', time.HANDLED_DATE, NOW( ) )
) AS costTime
FROM
fact_origin_project_main_daily main
LEFT JOIN fact_origin_project_org_period_daily time ON main.ID = time.PROJECT_ID
AND time.DEL_FLAG = '0'
AND time.OPERATION = 'close'
WHERE
main.DEL_FLAG = '0'
AND main.CUSTOMER_ID = #{customerId}
GROUP BY
main.ID
) costTime ON project.ID = costTime.PROJECT_ID
WHERE
project.DEL_FLAG = '0'
AND project.CUSTOMER_ID = #{customerId}

22
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml

@ -268,9 +268,11 @@
<select id="selectLatestOperation" resultType="com.epmet.dto.project.result.ProjectLatestOperationResultDTO">
SELECT
process.PROJECT_ID,
process.OPERATION_NAME
process.OPERATION_NAME,
project.TITLE,
CASE WHEN project.status = 'pending' THEN TIMESTAMPDIFF(MINUTE,project.created_time,NOW()) ELSE TIMESTAMPDIFF(MINUTE,project.created_time,project.UPDATED_TIME) END AS costTime
FROM
project_process process
project_process process LEFT JOIN project ON process.PROJECT_ID = project.ID AND project.DEL_FLAG = '0'
WHERE
process.DEL_FLAG = '0'
AND process.CUSTOMER_ID = #{customerId}
@ -307,20 +309,4 @@
</if>
</select>
<!-- 查找项目标题 -->
<select id="selectProjectTitle" resultType="com.epmet.dto.project.result.ProjectLatestOperationResultDTO">
SELECT
ID AS projectId,
TITLE AS operationName
FROM
project
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
<if test="null != list and list.size() > 0">
<foreach collection="list" item="projectId" open="AND (" separator=" OR " close=" )">
ID = #{projectId}
</foreach>
</if>
</select>
</mapper>
Loading…
Cancel
Save