From 7d22d3d9481e632ae514a0f4b44c183ed900488b Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 28 Sep 2020 17:52:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9A=BE=E7=82=B9=E8=B5=8C=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../group/result/TopicContentResultDTO.java | 20 +++ .../screen/form/ProjectSourceMapFormDTO.java | 20 +++ .../FactOriginProjectMainDailyDao.java | 4 +- .../screen/ScreenDifficultyDataDao.java | 9 ++ .../epmet/dao/project/ProjectProcessDao.java | 10 ++ .../java/com/epmet/dao/topic/TopicDao.java | 21 ++++ .../screen/ScreenDifficultyImgDataEntity.java | 2 + .../FactOriginProjectMainDailyService.java | 4 +- ...FactOriginProjectMainDailyServiceImpl.java | 6 +- ...srootsGovernDataAbsorptionServiceImpl.java | 48 +++++-- .../screen/ScreenDifficultyDataService.java | 3 +- .../impl/ScreenDifficultyDataServiceImpl.java | 15 ++- .../project/ProjectProcessService.java | 11 ++ .../impl/ProjectProcessServiceImpl.java | 21 ++++ .../com/epmet/service/topic/TopicService.java | 21 ++++ .../service/topic/impl/TopicServiceImpl.java | 54 ++++++++ .../extract/FactOriginProjectMainDailyDao.xml | 12 +- .../screen/ScreenDifficultyDataDao.xml | 117 ++++++++++++++++++ .../resources/mapper/group/GroupDataDao.xml | 13 ++ .../mapper/project/ProjectProcessDao.xml | 17 ++- .../main/resources/mapper/topic/TopicDao.xml | 26 ++++ 21 files changed, 430 insertions(+), 24 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/TopicContentResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ProjectSourceMapFormDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/TopicContentResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/TopicContentResultDTO.java new file mode 100644 index 0000000000..28050e24e7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/TopicContentResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName TopicContentResultDTO + * @Auth wangc + * @Date 2020-09-28 16:30 + */ +@Data +public class TopicContentResultDTO implements Serializable { + private static final long serialVersionUID = -1720511234376795113L; + + private String topicId; + + private String content; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ProjectSourceMapFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ProjectSourceMapFormDTO.java new file mode 100644 index 0000000000..3dbbcd7061 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ProjectSourceMapFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.screen.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName ProjectSourceMapFormDTO + * @Auth wangc + * @Date 2020-09-28 15:32 + */ +@Data +public class ProjectSourceMapFormDTO implements Serializable { + private static final long serialVersionUID = 7796386345197572459L; + + private String projectId; + + private String sourceId; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java index 3d90e26dc3..4ed5d1303c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; +import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import org.apache.ibatis.annotations.Mapper; @@ -183,12 +184,11 @@ public interface FactOriginProjectMainDailyDao extends BaseDao * @author wangc * @date 2020.09.28 11:15 */ - List selectNewProject(@Param("customerId") String customerId, @Param("dateId")String dateId); + List selectNewProject(@Param("customerId") String customerId, @Param("list")List list); /** * 网格解决项目数 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java index 2a8bfdac18..2b66e785bb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.screencoll.form.DifficultyDataDetailFormDTO; import com.epmet.dto.screencoll.form.DifficultyDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -82,4 +83,12 @@ public interface ScreenDifficultyDataDao extends BaseDao list); + + int deleteBatchDifficultyImg(@Param("list")List list); + + int insertBatch(@Param("list") List list); + + int insertBatchImg(@Param("list") List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java index 72beea8ca3..f3ac4c2e19 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.project; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.project.FinishOrgDTO; import com.epmet.dto.project.ProcessInfoDTO; +import com.epmet.dto.project.result.ProjectLatestOperationResultDTO; import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO; import com.epmet.entity.project.ProjectEntity; @@ -113,4 +114,13 @@ public interface ProjectProcessDao extends BaseDao { * @return java.util.List */ List selectFinishOrg(@Param("customerId") String customerId, @Param("date") String date); + + /** + * @Description 查找项目最近一次操作说明 + * @param list + * @return java.util.List + * @author wangc + * @date 2020.09.28 14:45 + */ + List selectLatestOperation(@Param("list") List list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java index 30406b6031..1d9a6125bc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java @@ -7,11 +7,14 @@ package com.epmet.dao.topic; * @since v1.0.0 2020-05-11 */ +import com.epmet.dto.group.result.TopicContentResultDTO; +import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.topic.ResiTopicDTO; import com.epmet.dto.extract.result.TopicInfoResultDTO; import com.epmet.dto.topic.TopicOriginInfoDTO; import com.epmet.dto.topic.result.ResiGroupTopicResultDTO; import com.epmet.dto.topic.result.ResiTopicOperationResultDTO; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -96,4 +99,22 @@ public interface TopicDao { * @Date 2020/9/23 17:52 **/ List queryUpdateTopicOriginInfoList(@Param("customerId")String customerId, @Param("dateId")String dateId); + + /** + * @Description 查询话题的图片 + * @param list + * @return java.util.List + * @author wangc + * @date 2020.09.28 15:40 + */ + List selectTopicImgs(@Param("list") List list); + + /** + * @Description 得到话题(项目)内容 + * @param list + * @return java.util.Map + * @author wangc + * @date 2020.09.28 16:28 + */ + List selectTopicContent(@Param("list") List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyImgDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyImgDataEntity.java index 1f6da889b1..469670b67f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyImgDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyImgDataEntity.java @@ -2,6 +2,7 @@ package com.epmet.entity.evaluationindex.screen; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; @@ -15,6 +16,7 @@ import lombok.EqualsAndHashCode; @Data @EqualsAndHashCode(callSuper=false) @TableName("screen_difficulty_img_data") +@AllArgsConstructor public class ScreenDifficultyImgDataEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index 96e40c8a50..ef295cf1bc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import com.mysql.cj.x.protobuf.MysqlxDatatypes; @@ -253,10 +254,9 @@ public interface FactOriginProjectMainDailyService extends BaseService * @author wangc * @date 2020.09.28 14:10 */ - List getNewProjectId(String customerId,String dateId); + List getNewProject(String customerId, List list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index 0945ab10de..c4fe8c7fab 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -30,6 +30,7 @@ import com.epmet.dao.evaluationindex.extract.FactOriginProjectMainDailyDao; import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; @@ -241,13 +242,12 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl * @author wangc * @date 2020.09.28 14:10 */ @Override - public List getNewProjectId(String customerId, String dateId) { - return baseDao.selectNewProject(customerId,dateId); + public List getNewProject(String customerId, List list) { + return baseDao.selectNewProject(customerId,list); } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java index 51b10a31f3..27a651eb3c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java @@ -4,9 +4,11 @@ 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.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.dto.screen.result.DifficultyIfExistedResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import com.epmet.service.evaluationindex.extract.toscreen.ScreenGrassrootsGovernDataAbsorptionService; @@ -15,6 +17,8 @@ import com.epmet.service.evaluationindex.screen.ScreenDifficultyDataService; import com.epmet.service.evaluationindex.screen.ScreenPartyUserRankDataService; import com.epmet.service.org.CustomerGridService; import com.epmet.service.point.UserPointService; +import com.epmet.service.project.ProjectProcessService; +import com.epmet.service.topic.TopicService; import com.epmet.service.user.UserService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -24,8 +28,10 @@ import org.springframework.util.StringUtils; import java.math.BigDecimal; import java.util.HashMap; +import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** @@ -53,6 +59,10 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr private ScreenDifficultyDataService screenDifficultyDataService; @Autowired private FactOriginProjectMainDailyService factOriginProjectMainDailyService; + @Autowired + private ProjectProcessService projectProcessService; + @Autowired + private TopicService topicService; /** * @Description 用户积分、党员分值数据中转站 * @param param @@ -128,14 +138,36 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr DifficultyIfExistedResultDTO existedMap = screenDifficultyDataService.selectExistedInfo(param.getCustomerId()); //查询数据 List difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(),existedMap.getClosedIds()); + if(CollectionUtils.isEmpty(difficulties)) return; + List projectIds = difficulties.stream().map(ScreenDifficultyDataEntity :: getEventId).distinct().collect(Collectors.toList()); + //最近一次操作 + Map latestOperationMap = projectProcessService.selectLatestOperation(projectIds,param.getCustomerId()); + boolean isOperationNull = CollectionUtils.isEmpty(latestOperationMap) ? true : false; + //图片 + List projectSourceMap; + + projectSourceMap = factOriginProjectMainDailyService.getNewProject(param.getCustomerId(),projectIds); + + Map> imgMap = + topicService.getTopicImgs(projectSourceMap); + boolean isImgNull = CollectionUtils.isEmpty(imgMap) ? true : false; + Map contentMap = topicService.getTopicContent(projectSourceMap); + boolean isContentNull = CollectionUtils.isEmpty(contentMap) ? true : false; + difficulties.forEach( diff -> { + if(!isImgNull) { + List figureList = imgMap.get(diff.getEventId()); + diff.setEventImgUrl(CollectionUtils.isEmpty(figureList) ? "" : figureList.get(NumConstant.ZERO).getEventImgUrl()); + } + if(!isContentNull) { + diff.setEventContent(contentMap.get(diff.getEventId())); + } + if(!isOperationNull){ + diff.setLatestOperateDesc(latestOperationMap.get(diff.getEventId())); + } + }); + List imgList = new LinkedList<>(); + imgMap.values().forEach(list -> {imgList.addAll(list);}); - if(existedMap.isIfExisted()){ - //查询全部项目的图片 - - }else{ - //查询增量项目的图片 - List newProjectIds = factOriginProjectMainDailyService.getNewProjectId(param.getCustomerId(),param.getDateId()); - - } + screenDifficultyDataService.dataClean(param.getCustomerId(),difficulties,imgList); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java index eb390bd434..8f9d136d88 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java @@ -44,11 +44,12 @@ public interface ScreenDifficultyDataService extends BaseService difficulties, List imgs); + void dataClean(String customerId,List difficulties, List imgs); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java index 6692edb144..806007d8fc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java @@ -28,8 +28,11 @@ import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity; import com.epmet.service.evaluationindex.screen.ScreenDifficultyDataService; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.util.List; +import java.util.stream.Collectors; /** * 基层治理-难点堵点(耗时最长|设计部门最多|处理次数) @@ -53,7 +56,15 @@ public class ScreenDifficultyDataServiceImpl extends BaseServiceImpl difficulties,List imgs) { - + @Transactional(rollbackFor = Exception.class) + public void dataClean(String customerId,List difficulties,List imgs) { + if(!CollectionUtils.isEmpty(difficulties)){ + baseDao.deleteBatchDifficulty(customerId,difficulties.stream().map(ScreenDifficultyDataEntity :: getEventId).distinct().collect(Collectors.toList())); + baseDao.insertBatch(difficulties); + } + if(!CollectionUtils.isEmpty(imgs)){ + baseDao.deleteBatchDifficultyImg(imgs.stream().map(ScreenDifficultyImgDataEntity::getEventId).distinct().collect(Collectors.toList())); + baseDao.insertBatchImg(imgs); + } } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java index 882263f938..0a4926e22e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java @@ -20,11 +20,13 @@ package com.epmet.service.project; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.project.FinishOrgDTO; import com.epmet.dto.project.ProcessInfoDTO; +import com.epmet.dto.project.result.ProjectLatestOperationResultDTO; import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectProcessEntity; import java.util.List; +import java.util.Map; /** * 项目处理进展表 @@ -102,5 +104,14 @@ public interface ProjectProcessService extends BaseService */ List getFinishOrg(String customerId, String date); + /** + * @Description 获得项目最新操作 + * @param list + * @param customerId + * @return java.util.Map + * @author wangc + * @date 2020.09.28 14:44 + */ + Map selectLatestOperation(List list, String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java index c29bf789a5..8cdf2698e7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java @@ -25,6 +25,7 @@ import com.epmet.dao.project.ProjectProcessDao; import com.epmet.dto.form.CommonStaffIdFormDTO; import com.epmet.dto.project.FinishOrgDTO; import com.epmet.dto.project.ProcessInfoDTO; +import com.epmet.dto.project.result.ProjectLatestOperationResultDTO; import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO; import com.epmet.entity.project.ProjectEntity; @@ -36,6 +37,7 @@ import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.*; +import java.util.stream.Collector; import java.util.stream.Collectors; /** @@ -123,6 +125,25 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl + * @author wangc + * @date 2020.09.28 14:44 + */ + @Override + public Map selectLatestOperation(List list, String customerId) { + List operations = baseDao.selectLatestOperation(list); + if(CollectionUtils.isEmpty(operations)){ + return Collections.EMPTY_MAP; + }else{ + return operations.stream().collect(Collectors.toMap(ProjectLatestOperationResultDTO :: getProjectId,ProjectLatestOperationResultDTO :: getOperationName)); + } + + } + /** * @Description 跨级分组 eg -> transfer ; response response transfer ; return ; response close. * @param dest - Map> 需要填充的数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java index d1f1783d79..8acaa3c3ac 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java @@ -2,14 +2,17 @@ package com.epmet.service.topic; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.result.TopicInfoResultDTO; +import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.stats.DimTopicStatusDTO; import com.epmet.dto.stats.topic.result.TopicStatisticalData; import com.epmet.dto.topic.ResiTopicDTO; import com.epmet.dto.topic.TopicOriginInfoDTO; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity; import com.epmet.util.DimIdGenerator; import java.util.Date; import java.util.List; +import java.util.Map; /** * @Author wangc @@ -62,4 +65,22 @@ public interface TopicService { * @Date 2020/9/23 17:51 **/ List queryUpdateTopicOriginInfoList(String customerId, String updateDateId); + + /** + * @Description 查询话题(项目)的图片 + * @param list + * @return java.util.Map> + * @author wangc + * @date 2020.09.28 15:57 + */ + Map> getTopicImgs(List list); + + /** + * @Description 得到话题(项目)内容 + * @param list + * @return java.util.Map + * @author wangc + * @date 2020.09.28 16:28 + */ + Map getTopicContent(List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index 689317017a..327b44c4b7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -6,6 +6,8 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.dao.topic.TopicDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.result.TopicInfoResultDTO; +import com.epmet.dto.group.result.TopicContentResultDTO; +import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.stats.DimTopicStatusDTO; import com.epmet.dto.stats.topic.*; import com.epmet.dto.stats.topic.result.GroupTopicData; @@ -15,6 +17,7 @@ import com.epmet.dto.topic.TopicOriginInfoDTO; import com.epmet.dto.topic.result.ResiGroupTopicResultDTO; import com.epmet.dto.topic.result.ResiTopicOperationResultDTO; import com.epmet.dto.topic.result.ResiTopicResultDTO; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity; import com.epmet.service.topic.TopicService; import com.epmet.service.user.impl.UserServiceImpl; import com.epmet.util.DimIdGenerator; @@ -24,10 +27,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.text.NumberFormat; import java.util.*; +import java.util.stream.Collector; import java.util.stream.Collectors; /** @@ -126,6 +131,55 @@ public class TopicServiceImpl implements TopicService { return topicDao.queryUpdateTopicOriginInfoList(customerId,updateDateId); } + /** + * @Description 查询话题的图片 + * @param list + * @return java.util.Map> + * @author wangc + * @date 2020.09.28 15:57 + */ + @Override + public Map> getTopicImgs(List list) { + if(CollectionUtils.isEmpty(list)) return Collections.EMPTY_MAP; + List imgs = topicDao.selectTopicImgs(list); + if(CollectionUtils.isEmpty(imgs)) return Collections.EMPTY_MAP; + //key -> topicId | value -> projectId + Map projectTopicMap = list.stream().collect(Collectors.toMap(ProjectSourceMapFormDTO :: getSourceId,ProjectSourceMapFormDTO :: getProjectId)); + //key -> topicId + Map> result + = imgs.stream().collect(Collectors.groupingBy(ScreenDifficultyImgDataEntity :: getEventId)); + Map> projectResult = new HashMap<>(); + projectTopicMap.forEach((topic,project) -> { + result.get(topic).forEach( dest -> { + dest.setEventId(project); + }); + projectResult.put(project,result.get(topic)); + }); + + return projectResult; + } + + /** + * @Description 得到话题(项目)内容 + * @param list + * @return java.util.Map + * @author wangc + * @date 2020.09.28 16:28 + */ + @Override + public Map getTopicContent(List list) { + if(CollectionUtils.isEmpty(list)) return Collections.EMPTY_MAP; + List contents = topicDao.selectTopicContent(list); + if(CollectionUtils.isEmpty(contents)) return Collections.EMPTY_MAP; + Map topicContentMap = contents.stream().collect(Collectors.toMap(TopicContentResultDTO :: getTopicId,TopicContentResultDTO::getContent)); + //key -> topicId | value -> projectId + Map projectTopicMap = list.stream().collect(Collectors.toMap(ProjectSourceMapFormDTO :: getSourceId,ProjectSourceMapFormDTO :: getProjectId)); + Map result = new HashMap<>(); + projectTopicMap.forEach((topic,project) -> { + result.put(project,topicContentMap.get(topic)); + }); + return result; + } /** * @Description 初始化机关-所有下级网格Map diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index 38574e143a..417296bbfe 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -405,14 +405,18 @@ - SELECT - ID + ID as projectId, + TOPIC_ID as gridId FROM fact_origin_project_main_daily WHERE CUSTOMER_ID = #{customerId} - AND - DATE_ID = #{dateId} + + + ID = #{projectId} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml index 101740c18e..d253e2530a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml @@ -98,4 +98,121 @@ AND CUSTOMER_ID = #{customerId} + + + + DELETE + FROM screen_difficulty_data + WHERE + CUSTOMER_ID = #{customerId} + + + EVENT_ID = #{projectId} + + + + + + DELETE + FROM screen_difficulty_img_data + + + EVENT_ID = #{projectId} + + + + + + insert into screen_difficulty_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + EVENT_ID, + EVENT_IMG_URL, + EVENT_SOURCE, + EVENT_CONTENT, + EVENT_COST_TIME, + EVENT_RE_ORG, + EVENT_HANDLED_COUNT, + EVENT_CATEGORY_CODE, + EVENT_CATEGORY_NAME, + EVENT_STATUS_CODE, + EVENT_STATUS_DESC, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + LATEST_OPERATE_DESC, + DATA_END_TIME, + ALL_PARENT_IDS + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.eventId}, + #{item.eventImgUrl}, + #{item.eventSource}, + #{item.eventContent}, + #{item.eventCostTime}, + #{item.eventReOrg}, + #{item.eventHandledCount}, + #{item.eventCategoryCode}, + #{item.eventCategoryName}, + #{item.eventStatusCode}, + #{item.eventStatusDesc}, + 0, + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now(), + #{item.latestOperateDesc}, + #{item.dataEndTime}, + #{item.allParentIds} + ) + + + + + + insert into screen_difficulty_img_data + ( + ID, + EVENT_ID, + EVENT_IMG_URL, + SORT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.eventId}, + #{item.eventImgUrl}, + #{item.sort}, + 0, + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml index 9a644abb96..f47b266eba 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml @@ -211,6 +211,19 @@ ) + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml index ed36efbeed..f82c025709 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml @@ -189,8 +189,21 @@ ) b ON a.PROJECT_ID = b.PROJECT_ID - + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml index debd5efb90..4de5b1c76b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml @@ -215,4 +215,30 @@ where rt.del_flag='0' and DATE_FORMAT( rt.UPDATED_TIME, '%Y%m%d' )=#{dateId} + + + + \ No newline at end of file