diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicAttachmentDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicAttachmentDTO.java new file mode 100644 index 0000000000..1fa32a8f37 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicAttachmentDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.topic; + +import lombok.Data; + +/** + * desc: + * + * @author: LiuJanJun + * @date: 2021/4/13 5:33 下午 + * @version: 1.0 + */ +@Data +public class TopicAttachmentDTO { + + private Integer sort; + private String attachmentUrl; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiTopicAndImgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiTopicAndImgResultDTO.java new file mode 100644 index 0000000000..a4ec445d98 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiTopicAndImgResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.topic.result; + +import com.epmet.dto.topic.TopicAttachmentDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author liujianjun + * @Description 组-话题对象 + * @ClassName ResiGroupTopicResultDTO + * @Auth wangc + * @Date 2020-06-20 17:23 + */ +@Data +public class ResiTopicAndImgResultDTO implements Serializable { + + private String topicId; + private String topicContent; + + private List topicImgList; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 84d24df675..b47d3cc8ef 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -722,10 +722,10 @@ public class DemoController { /** * @return com.epmet.commons.tools.utils.Result - * @param + * @param * @author yinzuomei * @description screen_index_data_monthly 赋值ALL_PARENT_IDS - * @Date 2020/10/10 17:59 + * @Date 2020/10/10 17:59 **/ @DataSource(DataSourceConstant.EVALUATION_INDEX) @PostMapping("updateDeptIndexMonthly") @@ -810,15 +810,6 @@ public class DemoController { return new Result(); } - /*@Autowired - private ScreenGrassrootsGovernDataAbsorptionService ndddYhjfService; - - @PostMapping("diff") - public Result diff(@RequestBody ScreenCentralZoneDataFormDTO param){ - ndddYhjfService.difficultyDataHub(param); - return new Result(); - }*/ - @PostMapping("project-test") public Result project(@RequestBody ScreenCentralZoneDataFormDTO param){ screenProjectSettleService.extractScreenData(param); @@ -866,4 +857,17 @@ public class DemoController { return new Result(); } + @Autowired + private ScreenGrassrootsGovernDataAbsorptionService ndddYhjfService; + + @PostMapping("diffOld") + public Result diff(@RequestBody ScreenCentralZoneDataFormDTO param){ + ndddYhjfService.difficultyDataHub(param); + return new Result(); + } + @PostMapping("testDiffNew") + public Result testDiff(@RequestBody ScreenCentralZoneDataFormDTO param){ + return new Result().ok(ndddYhjfService.difficultyDataExtract(param)); + } + } 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 8db5ef9bae..badbd6197c 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 @@ -27,6 +27,7 @@ import com.epmet.dto.pingyin.result.*; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -188,7 +189,7 @@ public interface FactOriginProjectMainDailyDao extends BaseDao selectDifficultyBaseInfo(@Param("customerId")String customerId,@Param("thresholdValue") Integer thresholdValue); - + /** * @Description 查询评价周期内新立的项目,是为了增量新增难点赌点的图片库 * @param customerId @@ -318,4 +319,25 @@ public interface FactOriginProjectMainDailyDao extends BaseDao initNewScreenProjectData(@Param("customerId")String customerId,@Param("dateId") String dateId,@Param("dataEndTime")String dataEndTime); -} \ No newline at end of file + /** + * desc: 获取难点堵点项目数据 + * + * @param customerId + * @param dateId + * @return java.util.List + * @author LiuJanJun + * @date 2021/4/12 1:35 下午 + */ + List getProjectForDiff(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * desc: 获取难点堵点项目数据耗时 + * + * @param customerId + * @param dateId + * @return java.util.List + * @author LiuJanJun + * @date 2021/4/12 1:35 下午 + */ + List getProjectPeriodForDiff(@Param("customerId") String customerId, @Param("dateId") String dateId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/IssueProjectCategoryDictDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/IssueProjectCategoryDictDao.java index 371cda3cf2..95d91fb9d4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/IssueProjectCategoryDictDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/IssueProjectCategoryDictDao.java @@ -37,5 +37,7 @@ public interface IssueProjectCategoryDictDao { List listByUpdatedTime(@Param("start") Date start, @Param("end") Date end); - IssueProjectCategoryDictEntity getById(@Param("customerId")String customerId, @Param("id")String id);; + IssueProjectCategoryDictEntity getById(@Param("customerId") String customerId, @Param("id") String id); + + List getAllByCId(@Param("customerId") String customerId); } 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 16a76f30ee..d9b11ddc6a 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 @@ -15,6 +15,7 @@ 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.ResiTopicAndImgResultDTO; import com.epmet.dto.topic.result.ResiTopicOperationResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity; import org.apache.ibatis.annotations.Mapper; @@ -27,115 +28,118 @@ import java.util.List; public interface TopicDao { /** - * @Description 将组按照网格Id排序 * @param targetDate * @param customerId * @return List + * @Description 将组按照网格Id排序 * @author wangc * @date 2020.06.22 11:05 - **/ - List selectGroupOrderByGrid(@Param("targetDate")Date targetDate, @Param("customerId")String customerId); + **/ + List selectGroupOrderByGrid(@Param("targetDate") Date targetDate, @Param("customerId") String customerId); /** - * @Description 查询话题的操作记录,如果返回结果中没有对应Id的话题说明当日话题没有操作记录 * @param targetDate * @return List + * @Description 查询话题的操作记录,如果返回结果中没有对应Id的话题说明当日话题没有操作记录 * @author wangc * @date 2020.06.22 11:07 - **/ - List selectTopicOperationRecord(@Param("targetDate")Date targetDate); + **/ + List selectTopicOperationRecord(@Param("targetDate") Date targetDate); /** - * @Description 将组按照网格Id排序 * @param * @param customerId * @return List + * @Description 将组按照网格Id排序 * @author wangc * @date 2020.06.22 11:05 **/ - List selectGroupOrderByGridBetweenTimeRange(@Param("startDate")Date startDate, @Param("endDate")Date endDate, @Param("customerId")String customerId); + List selectGroupOrderByGridBetweenTimeRange(@Param("startDate") Date startDate, @Param("endDate") Date endDate, @Param("customerId") String customerId); /** - * @Description 查询话题的操作记录,如果返回结果中没有对应Id的话题说明当日话题没有操作记录 * @param * @return List + * @Description 查询话题的操作记录,如果返回结果中没有对应Id的话题说明当日话题没有操作记录 * @author wangc * @date 2020.06.22 11:07 **/ - List selectTopicOperationRecordBetweenTimeRange(@Param("startDate")Date startDate, @Param("endDate")Date endDate); + List selectTopicOperationRecordBetweenTimeRange(@Param("startDate") Date startDate, @Param("endDate") Date endDate); /** * 根据ids获取话题信息 - * @author zhaoqifeng - * @date 2020/9/15 17:33 + * * @param ids * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/15 17:33 */ List selectTopicByIds(@Param("ids") List ids); /** - * @Description 查询话题创建者信息 * @param topicIds + * @Description 查询话题创建者信息 * @author zxc * @date 2020/9/15 4:55 下午 */ - List selectTopicInfo(@Param("topicIds")List topicIds); + List selectTopicInfo(@Param("topicIds") List topicIds); /** - * @return java.util.List * @param customerId - * @param dateId yyyyMMdd + * @param dateId yyyyMMdd + * @return java.util.List * @author yinzuomei - * @description 根据日期查询resi_topic_operation,返回当前日期这一天内所有话题相关的操作记录 + * @description 根据日期查询resi_topic_operation,返回当前日期这一天内所有话题相关的操作记录 * @Date 2020/9/15 18:14 **/ - List selectListTopicOriginInfo(@Param("customerId")String customerId, @Param("dateId")String dateId); + List selectListTopicOriginInfo(@Param("customerId") String customerId, @Param("dateId") String dateId); /** - * @return java.util.List * @param customerId * @param dateId + * @return java.util.List * @author yinzuomei * @description 查询在这一天发生变化的话题记录 * @Date 2020/9/23 17:52 **/ - List queryUpdateTopicOriginInfoList(@Param("customerId")String customerId, @Param("dateId")String dateId); + List queryUpdateTopicOriginInfoList(@Param("customerId") String customerId, @Param("dateId") String dateId); /** - * @Description 查询话题的图片 * @param list * @return java.util.List + * @Description 查询话题的图片 * @author wangc * @date 2020.09.28 15:40 */ List selectTopicImgs(@Param("list") List list); /** - * @Description 得到话题(项目)内容 * @param list - * @return java.util.Map + * @return java.util.Map + * @Description 得到话题(项目)内容 * @author wangc * @date 2020.09.28 16:28 */ List selectTopicContent(@Param("list") List list); /** - * @Description 根据话题Id查询大屏项目的相关信息 * @param list * @return java.util.List + * @Description 根据话题Id查询大屏项目的相关信息 * @author wangc * @date 2021.03.08 17:13 - */ + */ List selectScreenProjectData(@Param("list") List list); /** - * @Description 初始化指定项目的图片 * @param customerId * @param list * @return java.util.List + * @Description 初始化指定项目的图片 * @author wangc * @date 2021.03.09 14:19 - */ - List initNewScreenProjectImgData(@Param("customerId")String customerId,@Param("list") List list); + */ + List initNewScreenProjectImgData(@Param("customerId") String customerId, @Param("list") List list); + + ResiTopicAndImgResultDTO getTopicAndImgs(@Param("topicId") String topicId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueProjectCategoryDictService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueProjectCategoryDictService.java index 4d2a96f7be..ad3e0f4f2f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueProjectCategoryDictService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueProjectCategoryDictService.java @@ -36,4 +36,6 @@ public interface IssueProjectCategoryDictService{ List listByUpdatedTime(Date start, Date end); IssueProjectCategoryDictEntity getById(String customerId,String id); + + List getAllByCId(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueProjectCategoryDictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueProjectCategoryDictServiceImpl.java index 982030799f..38ae06e0e7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueProjectCategoryDictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueProjectCategoryDictServiceImpl.java @@ -5,7 +5,6 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.dao.issue.IssueProjectCategoryDictDao; import com.epmet.entity.issue.IssueProjectCategoryDictEntity; import com.epmet.service.Issue.IssueProjectCategoryDictService; -import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -39,4 +38,9 @@ public class IssueProjectCategoryDictServiceImpl implements IssueProjectCategory return issueProjectCategoryDictDao.getById(customerId,id); } + @Override + public List getAllByCId(String customerId) { + return issueProjectCategoryDictDao.getAllByCId(customerId); + } + } 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 e9bca2843f..7b3a3b8d61 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 @@ -18,7 +18,6 @@ package com.epmet.service.evaluationindex.extract.todata; import com.epmet.commons.mybatis.service.BaseService; -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; @@ -27,11 +26,12 @@ import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.dto.pingyin.result.*; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; +import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import java.util.List; -import java.util.Map; /** * 项目主表_日统计 @@ -41,66 +41,6 @@ import java.util.Map; */ public interface FactOriginProjectMainDailyService extends BaseService { - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2020-09-16 - */ - PageData page(Map params); - - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2020-09-16 - */ - List list(Map params); - - /** - * 单条查询 - * - * @param id - * @return FactOriginProjectMainDailyDTO - * @author generator - * @date 2020-09-16 - */ - FactOriginProjectMainDailyDTO get(String id); - - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2020-09-16 - */ - void save(FactOriginProjectMainDailyDTO dto); - - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2020-09-16 - */ - void update(FactOriginProjectMainDailyDTO dto); - - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2020-09-16 - */ - void delete(String[] ids); - /** * 获取客户下项目 * @author zhaoqifeng @@ -369,4 +309,24 @@ public interface FactOriginProjectMainDailyService extends BaseService list,Integer exceedLimit,Integer about2exceedLimit); -} \ No newline at end of file + /** + * desc: 条件获取项目数据 + * + * @param param + * @return java.util.List + * @author LiuJanJun + * @date 2021/4/12 11:07 上午 + */ + List getProjectForDiff(ScreenCentralZoneDataFormDTO param); + + /** + * desc: 根据项目数据 获取相关连的项目耗时 + * + * @param param + * @return java.util.List + * @author LiuJanJun + * @date 2021/4/12 1:53 下午 + */ + List getProjectPeriod(ScreenCentralZoneDataFormDTO param); + +} 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 95dffc461a..643ddba8d4 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 @@ -17,14 +17,9 @@ package com.epmet.service.evaluationindex.extract.todata.impl; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; @@ -39,17 +34,21 @@ import com.epmet.dto.pingyin.result.*; import com.epmet.dto.result.CostDayResultDTO; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; +import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; -import java.util.*; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -66,57 +65,6 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, FactOriginProjectMainDailyDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, FactOriginProjectMainDailyDTO.class); - } - - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - - return wrapper; - } - - @Override - public FactOriginProjectMainDailyDTO get(String id) { - FactOriginProjectMainDailyEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, FactOriginProjectMainDailyDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(FactOriginProjectMainDailyDTO dto) { - FactOriginProjectMainDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactOriginProjectMainDailyEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(FactOriginProjectMainDailyDTO dto) { - FactOriginProjectMainDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactOriginProjectMainDailyEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } @Override public List getProjectByCustomer(String customerId) { @@ -466,6 +414,15 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl getProjectForDiff(ScreenCentralZoneDataFormDTO param) { + return baseDao.getProjectForDiff(param.getCustomerId(),param.getDateId()); + } + + @Override + public List getProjectPeriod(ScreenCentralZoneDataFormDTO param) { + return baseDao.getProjectPeriodForDiff(param.getCustomerId(),param.getDateId()); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenGrassrootsGovernDataAbsorptionService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenGrassrootsGovernDataAbsorptionService.java index 56c73b2de5..817d714096 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenGrassrootsGovernDataAbsorptionService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenGrassrootsGovernDataAbsorptionService.java @@ -26,4 +26,14 @@ public interface ScreenGrassrootsGovernDataAbsorptionService { * @date 2020.09.25 10:00 **/ void difficultyDataHub(ScreenCentralZoneDataFormDTO param); + + /** + * desc: 新的难点堵点抽取 + * + * @param param + * @return boolean + * @author LiuJanJun + * @date 2021/4/9 6:05 下午 + */ + boolean difficultyDataExtract(ScreenCentralZoneDataFormDTO param); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index 9cdd394e67..23442bedbd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -171,7 +171,8 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { } ScreenCentralZoneDataFormDTO param = new ScreenCentralZoneDataFormDTO(); - param.setCustomerId(customerId);param.setDateId(dateId); + param.setCustomerId(customerId); + param.setDateId(dateId); //中央区 screen_user_total_data try { screenCentralZoneDataAbsorptionService.centralZoneDataHub(param); @@ -182,6 +183,9 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { try { log.info("【难点赌点数据上报开始------】 当前客户Id{}",param.getCustomerId()); screenGrassrootsGovernDataAbsorptionService.difficultyDataHub(param); + + //todo 初始化全量 param.setDateId(null); + //screenGrassrootsGovernDataAbsorptionService.difficultyDataExtract(param); log.info("【难点赌点数据上报结束------】 当前客户Id{}",param.getCustomerId()); }catch (Exception e){ log.error("基层治理-难点赌点抽取到大屏失败,customerId为:"+customerId+"dateId为:"+dateId, e); 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 39501e53b4..4461d75dc4 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,13 +4,22 @@ import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.ProjectConstant; +import com.epmet.dto.ProjectCategoryDTO; +import com.epmet.dto.ProjectDTO; 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.dto.topic.result.ResiTopicAndImgResultDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; +import com.epmet.entity.issue.IssueProjectCategoryDictEntity; +import com.epmet.entity.stats.DimAgencyEntity; +import com.epmet.service.Issue.IssueProjectCategoryDictService; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import com.epmet.service.evaluationindex.extract.toscreen.ScreenGrassrootsGovernDataAbsorptionService; import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService; @@ -20,6 +29,7 @@ import com.epmet.service.org.CustomerGridService; import com.epmet.service.point.UserPointService; import com.epmet.service.project.ProjectProcessService; import com.epmet.service.project.ProjectService; +import com.epmet.service.stats.DimAgencyService; import com.epmet.service.topic.TopicService; import com.epmet.service.user.UserService; import lombok.extern.slf4j.Slf4j; @@ -49,6 +59,8 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr @Autowired private CustomerGridService customerGridService; @Autowired + private DimAgencyService dimAgencyService; + @Autowired private UserPointService userPointService; @Autowired private CpcIndexCalculateService cpcIndexCalculateService; @@ -64,6 +76,8 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr private TopicService topicService; @Autowired private ProjectService projectService; + @Autowired + private IssueProjectCategoryDictService issueProjectCategoryDictService; /** * @Description 用户积分、党员分值数据中转站 * @param param @@ -137,7 +151,9 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr public void difficultyDataHub(ScreenCentralZoneDataFormDTO param) { //查询数据 List difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(),projectService.getOvertimeProjectByParameter(param.getCustomerId())); - if(CollectionUtils.isEmpty(difficulties)) return; + if(CollectionUtils.isEmpty(difficulties)) { + return; + } //2.查询出客户下网格的相关信息 List gridList = customerGridService.queryGridInfoList(param.getCustomerId()); @@ -157,7 +173,10 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr Map latestOperationMap = projectProcessService.getLatestOperation(projectIds,param.getCustomerId()); //图片 List projectSourceMap = difficulties.stream().map(diff->{ - ProjectSourceMapFormDTO map = new ProjectSourceMapFormDTO();map.setProjectId(diff.getEventId());map.setSourceId(diff.getEventImgUrl());return map; + ProjectSourceMapFormDTO map = new ProjectSourceMapFormDTO(); + map.setProjectId(diff.getEventId()); + map.setSourceId(diff.getEventImgUrl()); + return map; }).collect(Collectors.toList()); //factOriginProjectMainDailyService.getNewProject(param.getCustomerId(),projectIds); @@ -194,4 +213,185 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr screenDifficultyDataService.dataClean(param.getCustomerId(),difficulties,imgList); log.info("【大屏数据抽取-难点赌点执行完毕】 客户Id{} 难点赌点数据{}",param.getCustomerId(),JSON.toJSONString(difficulties)); } + + @Override + public boolean difficultyDataExtract(ScreenCentralZoneDataFormDTO param) { + //TODO + //1.根据客户Id 获取所有项目数据 + List difficultyBaseList = factOriginProjectMainDailyService.getProjectForDiff(param); + if (CollectionUtils.isEmpty(difficultyBaseList)){ + log.warn("difficultyDataExtract customerId:{} have any project",param.getCustomerId()); + return false; + } + //获取业务库项目标题 + List bizProjectInfoList = projectService.getProjectInfo(param.getCustomerId(), null); + if (CollectionUtils.isEmpty(bizProjectInfoList)){ + log.warn("difficultyDataExtract customerId:{} have any project",param.getCustomerId()); + return false; + } + Map bizProjectInfoMap = bizProjectInfoList.stream().collect(Collectors.toMap(ProjectDTO::getId, o -> o, (o1, o2) -> o1)); + //获取agency维度 + List agencyList = dimAgencyService.getAgencyListByCustomerId(param.getCustomerId()); + Map agencyMap = agencyList.stream().collect(Collectors.toMap(DimAgencyEntity::getId, o -> o, (o1, o2) -> o1)); + //获取grid维度 + List gridList = customerGridService.queryGridInfoList(param.getCustomerId()); + Map gridMap = gridList.stream().collect(Collectors.toMap(GridInfoDTO::getGridId, o -> o, (o1, o2) -> o1)); + + //获取客户下所有项目分类 + List categoryList = issueProjectCategoryDictService.getAllByCId(param.getCustomerId()); + + //项目分类数据 todo 暂时查询所有 + List projectCategoryData = projectService.getProjectCategoryData(param.getCustomerId(), null); + //key projectId:categoryCode Set + Map> projectCategoryMap = projectCategoryData.stream() + .collect(Collectors.groupingBy(ProjectCategoryDTO::getProjectId, Collectors.mapping(ProjectCategoryDTO::getCategoryCode, Collectors.toSet()))); + + //2.获取项目的所有节点耗时数据 + List projectPeriodList = factOriginProjectMainDailyService.getProjectPeriod(param); + Map orgCountMap = new HashMap<>(); + Map handleCountMap = new HashMap<>(); + projectPeriodList.forEach(period->{ + Integer orgCount = orgCountMap.get(period.getProjectId()); + if (orgCount == null){ + orgCount = 0; + }else{ + ++orgCount; + } + orgCountMap.put(period.getProjectId(),orgCount); + Integer handleCount = handleCountMap.get(period.getProjectId()); + if (handleCount == null){ + handleCount = 0; + }else{ + ++handleCount; + } + handleCountMap.put(period.getProjectId(),handleCount); + }); + List diffList = new ArrayList<>(); + for (FactOriginProjectMainDailyEntity project : difficultyBaseList) { + if (agencyMap.get(project.getAgencyId()) == null || bizProjectInfoMap.get(project.getId()) == null) { + log.error("未获取到相关的项目信息或者项目的所属组织信息"); + continue; + } + + ScreenDifficultyDataEntity diffEntity = buildBaseDiffEntity(project, agencyMap, gridMap, bizProjectInfoMap); + Integer regCount = orgCountMap.get(project.getId()); + if (regCount != null){ + diffEntity.setEventReOrg(regCount); + } + Integer handleOrgCount = handleCountMap.get(project.getId()); + if (handleOrgCount != null){ + diffEntity.setEventHandledCount(handleOrgCount); + } + + + diffEntity.setDataEndTime(param.getDateId()); + setCategoryInfo(diffEntity, project.getId(),categoryList,projectCategoryMap); + + + if (StringUtils.isNotBlank(project.getTopicId())){ + //获取图片及话题内容 + ResiTopicAndImgResultDTO topicInfo = topicService.getTopicAndImgs(project.getTopicId(),"image"); + if (topicInfo != null){ + diffEntity.setEventImgUrl(topicInfo.getTopicImgList().get(NumConstant.ZERO).getAttachmentUrl()); + diffEntity.setEventContent(topicInfo.getTopicContent()); + } + } + diffList.add(diffEntity); + log.info("========:"+JSON.toJSONString(diffList)); + } + + + + //3.获取项目的最后操作记录 + return false; + } + + private void setCategoryInfo(ScreenDifficultyDataEntity diffEntity, String projectId, List categoryList, Map> projectCategoryMap) { + Set categorySet = projectCategoryMap.get(projectId); + if (CollectionUtils.isEmpty(categorySet)){ + return; + } + projectCategoryMap.forEach((k,v) ->{ + List childCategory = new ArrayList<>(); + v.forEach(categoryCode-> getParentNode(childCategory,categoryList,categoryCode)); + String categoryCodes = childCategory.stream().map(IssueProjectCategoryDictEntity::getCategoryCode).sorted(Comparator.reverseOrder()).collect(Collectors.joining(StrConstant.COMMA)); + String categoryNames = childCategory.stream().map(IssueProjectCategoryDictEntity::getCategoryName).sorted(Comparator.reverseOrder()).collect(Collectors.joining(StrConstant.COMMA)); + diffEntity.setEventCategoryCode(categoryCodes); + diffEntity.setEventCategoryName(categoryNames); + }); + + } + + private ScreenDifficultyDataEntity buildBaseDiffEntity(FactOriginProjectMainDailyEntity project, Map agencyMap, + Map gridMap, Map bizProjectInfoMap) { + ProjectDTO projectDTO = bizProjectInfoMap.get(project.getId()); + ScreenDifficultyDataEntity diff = new ScreenDifficultyDataEntity(); + diff.setCustomerId(project.getCustomerId()); + //大屏的是逗号隔开的 + String allPIds = project.getPids().replaceAll(StrConstant.COLON,StrConstant.COMMA); + DimAgencyEntity agencyInfoDTO = agencyMap.get(project.getAgencyId()); + if (StringUtils.isBlank(project.getGridId())){ + diff.setOrgType("agency"); + diff.setOrgId(project.getAgencyId()); + diff.setParentId(project.getPid()); + diff.setAllParentIds(allPIds.replace(StrConstant.COMMA+project.getAgencyId(),StrConstant.EPMETY_STR)); + diff.setOrgName(agencyInfoDTO.getAgencyName()); + + if (StringUtils.isNotBlank(agencyInfoDTO.getAllParentName())){ + diff.setEventSource(agencyInfoDTO.getAllParentName().concat(StrConstant.HYPHEN.concat(diff.getOrgName()))); + }else{ + diff.setEventSource(agencyInfoDTO.getAgencyName()); + } + //如果是组织的则 设置背景为内容 + diff.setEventContent(projectDTO.getBackGround()); + }else{ + diff.setOrgType("grid"); + diff.setOrgId(project.getGridId()); + diff.setParentId(project.getAgencyId()); + //所有上级id 即包含agencyId在内的所有pids + diff.setAllParentIds(allPIds); + GridInfoDTO gridInfoDTO = gridMap.get(project.getGridId()); + diff.setOrgName(gridInfoDTO.getGridName()); + String agencyAndGridName = agencyInfoDTO.getAgencyName().concat(StrConstant.HYPHEN.concat(diff.getOrgName())); + //todo 市北区的 allParentname 为什么为空 + //if (!project.getPid().equals(NumConstant.ZERO_STR)){ + if (StringUtils.isNotBlank(agencyInfoDTO.getAllParentName())){ + diff.setEventSource(agencyInfoDTO.getAllParentName().concat(StrConstant.HYPHEN).concat(agencyAndGridName)); + }else{ + diff.setEventSource(agencyAndGridName); + } + } + + diff.setEventId(project.getId()); + String projectStatus = project.getProjectStatus(); + diff.setEventStatusCode(projectStatus); + if (ProjectConstant.PENDING.equals(projectStatus)){ + diff.setEventStatusDesc("处理中"); + //项目耗时 当前时间-项目创建时间 + diff.setEventCostTime((int) ((System.currentTimeMillis()-projectDTO.getCreatedTime().getTime())/1000/60)); + }else{ + diff.setEventStatusDesc("已结案"); + //项目耗时 更新时间-项目创建时间 + diff.setEventCostTime((int) ((projectDTO.getUpdatedTime().getTime() - projectDTO.getCreatedTime().getTime())/1000/60)); + } + //暂时不放内容 用不到 + diff.setLatestOperateDesc(""); + + return diff; + } + + /** + * 递归查询父节点 + * @param childCategory + * @param categoryList + * @param categoryCode + */ + private void getParentNode(List childCategory, List categoryList, String categoryCode) { + categoryList.stream() + .filter(item -> Objects.nonNull(categoryCode) && Objects.equals(categoryCode, item.getCategoryCode())) + .forEach(menu -> { + getParentNode(childCategory, categoryList, menu.getParentCategoryCode()); + childCategory.add(menu); + }); + } } 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 5dc7b17392..475fb886c7 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 @@ -9,6 +9,7 @@ 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.dto.topic.result.ResiTopicAndImgResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity; import com.epmet.util.DimIdGenerator; @@ -104,4 +105,15 @@ public interface TopicService { * @date 2021.03.09 13:59 */ List buildNewScreenProjectImgData(List list); + + /** + * desc: 根据话题ID获取 话题内容及附件列表 + * + * @param topicId + * @param attachmentType + * @return com.epmet.dto.topic.result.ResiTopicAndImgResultDTO + * @author LiuJanJun + * @date 2021/4/13 5:39 下午 + */ + ResiTopicAndImgResultDTO getTopicAndImgs(String topicId,String attachmentType); } 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 c832202e70..0b74adba49 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 @@ -18,6 +18,7 @@ import com.epmet.dto.stats.topic.result.TopicStatisticalData; import com.epmet.dto.topic.ResiTopicDTO; import com.epmet.dto.topic.TopicOriginInfoDTO; import com.epmet.dto.topic.result.ResiGroupTopicResultDTO; +import com.epmet.dto.topic.result.ResiTopicAndImgResultDTO; import com.epmet.dto.topic.result.ResiTopicOperationResultDTO; import com.epmet.dto.topic.result.ResiTopicResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity; @@ -35,7 +36,6 @@ 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; /** @@ -232,6 +232,11 @@ public class TopicServiceImpl implements TopicService { )).collect(Collectors.toList()); } + @Override + public ResiTopicAndImgResultDTO getTopicAndImgs(String topicId,String attachmentType) { + return topicDao.getTopicAndImgs(topicId); + } + /** * @Description 初始化机关-所有下级网格Map * @param pid - 固定一个机关Id 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 9d10a564f6..9935094e55 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 @@ -588,6 +588,24 @@ + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml index 790c464b60..58dd19a9e5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml @@ -81,6 +81,8 @@ AGENCY_ID, ORIGIN, ORIGIN_ID, + TITLE, + BACK_GROUND, STATUS, CLOSED_STATUS, ORG_ID_PATH, 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 f272c6f692..8dfb2aae2e 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 @@ -15,6 +15,15 @@ + + + + + + + + + - \ No newline at end of file + + +