Browse Source

Merge remote-tracking branch 'origin/dev_project_approval' into dev_project_approval

dev_shibei_match
sunyuchao 4 years ago
parent
commit
329ea9ba77
  1. 18
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicAttachmentDTO.java
  2. 24
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiTopicAndImgResultDTO.java
  3. 26
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  4. 26
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
  5. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/IssueProjectCategoryDictDao.java
  6. 60
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java
  7. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueProjectCategoryDictService.java
  8. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueProjectCategoryDictServiceImpl.java
  9. 86
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java
  10. 73
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java
  11. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenGrassrootsGovernDataAbsorptionService.java
  12. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java
  13. 204
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java
  14. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java
  15. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java
  16. 18
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  17. 7
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/IssueProjectCategoryDictDao.xml
  18. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml
  19. 37
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml

18
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;
}

24
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<TopicAttachmentDTO> topicImgList;
}

26
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));
}
}

26
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<FactOriginProject
* @date 2020.09.28 10:19
*/
List<ScreenDifficultyDataEntity> selectDifficultyBaseInfo(@Param("customerId")String customerId,@Param("thresholdValue") Integer thresholdValue);
/**
* @Description 查询评价周期内新立的项目是为了增量新增难点赌点的图片库
* @param customerId
@ -318,4 +319,25 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
*/
List<ScreenProjectDataDTO> initNewScreenProjectData(@Param("customerId")String customerId,@Param("dateId") String dateId,@Param("dataEndTime")String dataEndTime);
}
/**
* desc: 获取难点堵点项目数据
*
* @param customerId
* @param dateId
* @return java.util.List<com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity>
* @author LiuJanJun
* @date 2021/4/12 1:35 下午
*/
List<FactOriginProjectMainDailyEntity> getProjectForDiff(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* desc: 获取难点堵点项目数据耗时
*
* @param customerId
* @param dateId
* @return java.util.List<com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity>
* @author LiuJanJun
* @date 2021/4/12 1:35 下午
*/
List<FactOriginProjectOrgPeriodDailyEntity> getProjectPeriodForDiff(@Param("customerId") String customerId, @Param("dateId") String dateId);
}

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/IssueProjectCategoryDictDao.java

@ -37,5 +37,7 @@ public interface IssueProjectCategoryDictDao {
List<IssueProjectCategoryDictEntity> 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<IssueProjectCategoryDictEntity> getAllByCId(@Param("customerId") String customerId);
}

60
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<ResiGroupTopicResultDTO>
* @Description 将组按照网格Id排序
* @author wangc
* @date 2020.06.22 11:05
**/
List<ResiGroupTopicResultDTO> selectGroupOrderByGrid(@Param("targetDate")Date targetDate, @Param("customerId")String customerId);
**/
List<ResiGroupTopicResultDTO> selectGroupOrderByGrid(@Param("targetDate") Date targetDate, @Param("customerId") String customerId);
/**
* @Description 查询话题的操作记录如果返回结果中没有对应Id的话题说明当日话题没有操作记录
* @param targetDate
* @return List<ResiTopicOperationResultDTO>
* @Description 查询话题的操作记录如果返回结果中没有对应Id的话题说明当日话题没有操作记录
* @author wangc
* @date 2020.06.22 11:07
**/
List<ResiTopicOperationResultDTO> selectTopicOperationRecord(@Param("targetDate")Date targetDate);
**/
List<ResiTopicOperationResultDTO> selectTopicOperationRecord(@Param("targetDate") Date targetDate);
/**
* @Description 将组按照网格Id排序
* @param
* @param customerId
* @return List<ResiGroupTopicResultDTO>
* @Description 将组按照网格Id排序
* @author wangc
* @date 2020.06.22 11:05
**/
List<ResiGroupTopicResultDTO> selectGroupOrderByGridBetweenTimeRange(@Param("startDate")Date startDate, @Param("endDate")Date endDate, @Param("customerId")String customerId);
List<ResiGroupTopicResultDTO> selectGroupOrderByGridBetweenTimeRange(@Param("startDate") Date startDate, @Param("endDate") Date endDate, @Param("customerId") String customerId);
/**
* @Description 查询话题的操作记录如果返回结果中没有对应Id的话题说明当日话题没有操作记录
* @param
* @return List<ResiTopicOperationResultDTO>
* @Description 查询话题的操作记录如果返回结果中没有对应Id的话题说明当日话题没有操作记录
* @author wangc
* @date 2020.06.22 11:07
**/
List<ResiTopicOperationResultDTO> selectTopicOperationRecordBetweenTimeRange(@Param("startDate")Date startDate, @Param("endDate")Date endDate);
List<ResiTopicOperationResultDTO> selectTopicOperationRecordBetweenTimeRange(@Param("startDate") Date startDate, @Param("endDate") Date endDate);
/**
* 根据ids获取话题信息
* @author zhaoqifeng
* @date 2020/9/15 17:33
*
* @param ids
* @return java.util.List<com.epmet.dto.topic.ResiTopicDTO>
* @author zhaoqifeng
* @date 2020/9/15 17:33
*/
List<ResiTopicDTO> selectTopicByIds(@Param("ids") List<String> ids);
/**
* @Description 查询话题创建者信息
* @param topicIds
* @Description 查询话题创建者信息
* @author zxc
* @date 2020/9/15 4:55 下午
*/
List<TopicInfoResultDTO> selectTopicInfo(@Param("topicIds")List<String> topicIds);
List<TopicInfoResultDTO> selectTopicInfo(@Param("topicIds") List<String> topicIds);
/**
* @return java.util.List<com.epmet.dto.topic.TopicOriginInfoDTO>
* @param customerId
* @param dateId yyyyMMdd
* @param dateId yyyyMMdd
* @return java.util.List<com.epmet.dto.topic.TopicOriginInfoDTO>
* @author yinzuomei
* @description 根据日期查询resi_topic_operation返回当前日期这一天内所有话题相关的操作记录
* @description 根据日期查询resi_topic_operation返回当前日期这一天内所有话题相关的操作记录
* @Date 2020/9/15 18:14
**/
List<TopicOriginInfoDTO> selectListTopicOriginInfo(@Param("customerId")String customerId, @Param("dateId")String dateId);
List<TopicOriginInfoDTO> selectListTopicOriginInfo(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @return java.util.List<com.epmet.dto.topic.TopicOriginInfoDTO>
* @param customerId
* @param dateId
* @return java.util.List<com.epmet.dto.topic.TopicOriginInfoDTO>
* @author yinzuomei
* @description 查询在这一天发生变化的话题记录
* @Date 2020/9/23 17:52
**/
List<TopicOriginInfoDTO> queryUpdateTopicOriginInfoList(@Param("customerId")String customerId, @Param("dateId")String dateId);
List<TopicOriginInfoDTO> queryUpdateTopicOriginInfoList(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @Description 查询话题的图片
* @param list
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity>
* @Description 查询话题的图片
* @author wangc
* @date 2020.09.28 15:40
*/
List<ScreenDifficultyImgDataEntity> selectTopicImgs(@Param("list") List<ProjectSourceMapFormDTO> list);
/**
* @Description 得到话题项目内容
* @param list
* @return java.util.Map<java.lang.String,java.lang.String>
* @return java.util.Map<java.lang.String, java.lang.String>
* @Description 得到话题项目内容
* @author wangc
* @date 2020.09.28 16:28
*/
List<TopicContentResultDTO> selectTopicContent(@Param("list") List<ProjectSourceMapFormDTO> list);
/**
* @Description 根据话题Id查询大屏项目的相关信息
* @param list
* @return java.util.List<com.epmet.dto.screen.ScreenProjectDataDTO>
* @Description 根据话题Id查询大屏项目的相关信息
* @author wangc
* @date 2021.03.08 17:13
*/
*/
List<ScreenProjectDataDTO> selectScreenProjectData(@Param("list") List<ScreenProjectDataDTO> list);
/**
* @Description 初始化指定项目的图片
* @param customerId
* @param list
* @return java.util.List<com.epmet.dto.screen.ScreenProjectImgDataDTO>
* @Description 初始化指定项目的图片
* @author wangc
* @date 2021.03.09 14:19
*/
List<ScreenProjectImgDataDTO> initNewScreenProjectImgData(@Param("customerId")String customerId,@Param("list") List<ScreenProjectDataDTO> list);
*/
List<ScreenProjectImgDataDTO> initNewScreenProjectImgData(@Param("customerId") String customerId, @Param("list") List<ScreenProjectDataDTO> list);
ResiTopicAndImgResultDTO getTopicAndImgs(@Param("topicId") String topicId);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueProjectCategoryDictService.java

@ -36,4 +36,6 @@ public interface IssueProjectCategoryDictService{
List<IssueProjectCategoryDictEntity> listByUpdatedTime(Date start, Date end);
IssueProjectCategoryDictEntity getById(String customerId,String id);
List<IssueProjectCategoryDictEntity> getAllByCId(String customerId);
}

6
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<IssueProjectCategoryDictEntity> getAllByCId(String customerId) {
return issueProjectCategoryDictDao.getAllByCId(customerId);
}
}

86
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<FactOriginProjectMainDailyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<FactOriginProjectMainDailyDTO>
* @author generator
* @date 2020-09-16
*/
PageData<FactOriginProjectMainDailyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<FactOriginProjectMainDailyDTO>
* @author generator
* @date 2020-09-16
*/
List<FactOriginProjectMainDailyDTO> list(Map<String, Object> 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<FactOrigi
void computerIfExceed(List<ScreenProjectDataDTO> list,Integer exceedLimit,Integer about2exceedLimit);
}
/**
* desc: 条件获取项目数据
*
* @param param
* @return java.util.List<com.epmet.dto.extract.FactOriginProjectMainDailyEntity>
* @author LiuJanJun
* @date 2021/4/12 11:07 上午
*/
List<FactOriginProjectMainDailyEntity> getProjectForDiff(ScreenCentralZoneDataFormDTO param);
/**
* desc: 根据项目数据 获取相关连的项目耗时
*
* @param param
* @return java.util.List<com.epmet.dto.extract.FactOriginProjectOrgPeriodDailyEntity>
* @author LiuJanJun
* @date 2021/4/12 1:53 下午
*/
List<FactOriginProjectOrgPeriodDailyEntity> getProjectPeriod(ScreenCentralZoneDataFormDTO param);
}

73
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<FactO
private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient;
@Autowired
private FactOriginProjectOrgPeriodDailyDao periodDao;
@Override
public PageData<FactOriginProjectMainDailyDTO> page(Map<String, Object> params) {
IPage<FactOriginProjectMainDailyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, FactOriginProjectMainDailyDTO.class);
}
@Override
public List<FactOriginProjectMainDailyDTO> list(Map<String, Object> params) {
List<FactOriginProjectMainDailyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, FactOriginProjectMainDailyDTO.class);
}
private QueryWrapper<FactOriginProjectMainDailyEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<FactOriginProjectMainDailyEntity> 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<FactOriginProjectMainDailyDTO> getProjectByCustomer(String customerId) {
@ -466,6 +414,15 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
}
}
@Override
public List<FactOriginProjectMainDailyEntity> getProjectForDiff(ScreenCentralZoneDataFormDTO param) {
return baseDao.getProjectForDiff(param.getCustomerId(),param.getDateId());
}
@Override
public List<FactOriginProjectOrgPeriodDailyEntity> getProjectPeriod(ScreenCentralZoneDataFormDTO param) {
return baseDao.getProjectPeriodForDiff(param.getCustomerId(),param.getDateId());
}
}

10
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);
}

6
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);

204
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<ScreenDifficultyDataEntity> difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(),projectService.getOvertimeProjectByParameter(param.getCustomerId()));
if(CollectionUtils.isEmpty(difficulties)) return;
if(CollectionUtils.isEmpty(difficulties)) {
return;
}
//2.查询出客户下网格的相关信息
List<GridInfoDTO> gridList = customerGridService.queryGridInfoList(param.getCustomerId());
@ -157,7 +173,10 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
Map<String, ProjectLatestOperationResultDTO> latestOperationMap = projectProcessService.getLatestOperation(projectIds,param.getCustomerId());
//图片
List<ProjectSourceMapFormDTO> 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<FactOriginProjectMainDailyEntity> difficultyBaseList = factOriginProjectMainDailyService.getProjectForDiff(param);
if (CollectionUtils.isEmpty(difficultyBaseList)){
log.warn("difficultyDataExtract customerId:{} have any project",param.getCustomerId());
return false;
}
//获取业务库项目标题
List<ProjectDTO> bizProjectInfoList = projectService.getProjectInfo(param.getCustomerId(), null);
if (CollectionUtils.isEmpty(bizProjectInfoList)){
log.warn("difficultyDataExtract customerId:{} have any project",param.getCustomerId());
return false;
}
Map<String, ProjectDTO> bizProjectInfoMap = bizProjectInfoList.stream().collect(Collectors.toMap(ProjectDTO::getId, o -> o, (o1, o2) -> o1));
//获取agency维度
List<DimAgencyEntity> agencyList = dimAgencyService.getAgencyListByCustomerId(param.getCustomerId());
Map<String, DimAgencyEntity> agencyMap = agencyList.stream().collect(Collectors.toMap(DimAgencyEntity::getId, o -> o, (o1, o2) -> o1));
//获取grid维度
List<GridInfoDTO> gridList = customerGridService.queryGridInfoList(param.getCustomerId());
Map<String, GridInfoDTO> gridMap = gridList.stream().collect(Collectors.toMap(GridInfoDTO::getGridId, o -> o, (o1, o2) -> o1));
//获取客户下所有项目分类
List<IssueProjectCategoryDictEntity> categoryList = issueProjectCategoryDictService.getAllByCId(param.getCustomerId());
//项目分类数据 todo 暂时查询所有
List<ProjectCategoryDTO> projectCategoryData = projectService.getProjectCategoryData(param.getCustomerId(), null);
//key projectId:categoryCode Set
Map<String, Set<String>> projectCategoryMap = projectCategoryData.stream()
.collect(Collectors.groupingBy(ProjectCategoryDTO::getProjectId, Collectors.mapping(ProjectCategoryDTO::getCategoryCode, Collectors.toSet())));
//2.获取项目的所有节点耗时数据
List<FactOriginProjectOrgPeriodDailyEntity> projectPeriodList = factOriginProjectMainDailyService.getProjectPeriod(param);
Map<String,Integer> orgCountMap = new HashMap<>();
Map<String,Integer> 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<ScreenDifficultyDataEntity> 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<IssueProjectCategoryDictEntity> categoryList, Map<String, Set<String>> projectCategoryMap) {
Set<String> categorySet = projectCategoryMap.get(projectId);
if (CollectionUtils.isEmpty(categorySet)){
return;
}
projectCategoryMap.forEach((k,v) ->{
List<IssueProjectCategoryDictEntity> 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<String, DimAgencyEntity> agencyMap,
Map<String, GridInfoDTO> gridMap, Map<String, ProjectDTO> 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<IssueProjectCategoryDictEntity> childCategory, List<IssueProjectCategoryDictEntity> 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);
});
}
}

12
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<ScreenProjectImgDataDTO> buildNewScreenProjectImgData(List<ScreenProjectDataDTO> 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);
}

7
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

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

@ -588,6 +588,24 @@
</otherwise>
</choose>
</select>
<!--获取难点堵点项目数据-->
<select id="getProjectForDiff" resultType="com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity">
SELECT
id, date_id, customer_id, issue_id, topic_id, grid_id, pid, pids, agency_id, project_status, is_resolved,
topic_creator_id, is_party, is_overdue, finish_org_ids
FROM fact_origin_project_main_daily
WHERE
CUSTOMER_ID = #{customerId}
<if test="dateId != null and dateId != ''">
AND DATE_ID = #{dateId,jdbcType=VARCHAR}
</if>
</select>
<select id="getProjectPeriodForDiff" resultType="com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity">
SELECT
t.ID, t.CUSTOMER_ID, t.PROJECT_ID, t.ORG_ID, t.ORG_TYPE, t.PID,t. PIDS, t.INFORMED_DATE, t.HANDLED_DATE, t.TOTAL_PERIOD, t.PERIOD_TILL_REPLY_FIRSTLY, t.OPERATION
FROM fact_origin_project_org_period_daily t
WHERE CUSTOMER_ID = #{customerId}
</select>
<!-- 组织查询项目总数 -->
<select id="selectProjectTotalByOrg" resultType="com.epmet.dto.pingyin.result.ProjectTotalResultDTO">

7
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/IssueProjectCategoryDictDao.xml

@ -48,4 +48,11 @@
and customer_id = #{customerId}
and id = #{id}
</select>
<select id="getAllByCId" resultType="com.epmet.entity.issue.IssueProjectCategoryDictEntity">
SELECT
ID, CUSTOMER_ID, PID, PIDS, PARENT_CATEGORY_CODE, CATEGORY_CODE, CATEGORY_NAME
FROM issue_project_category_dict
where del_flag = '0'
and customer_id = #{customerId}
</select>
</mapper>

2
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,

37
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml

@ -15,6 +15,15 @@
<id property="incrFlag" column="incrFlag" />
</collection>
</resultMap>
<!--获取话题内容及图片信息-->
<resultMap id="topicImgResultMap" type="com.epmet.dto.topic.result.ResiTopicAndImgResultDTO">
<id property="topicId" column="ID" />
<result property="topicContent" column="TOPIC_CONTENT" />
<collection property="topicImgList" ofType="com.epmet.dto.topic.TopicAttachmentDTO">
<id property="sort" column="SORT"/>
<id property="attachmentUrl" column="ATTACHMENT_URL" />
</collection>
</resultMap>
<!-- 将组按照网格Id排序,并取出组Id、话题Id等相关信息,incrFlag代表是否是在当日创建 -->
<select id="selectGroupOrderByGrid" resultMap="groupTopic">
@ -272,4 +281,30 @@
TOPIC_ID = #{project.topicId}
</foreach>
</select>
</mapper>
<select id="getTopicAttachment" resultType="com.epmet.dto.topic.TopicAttachmentDTO">
SELECT
ATTACHMENT_URL AS eventImgUrl,
SORT
FROM
`resi_topic_attachment`
WHERE
del_flag = '0'
<!-- AND ATTACHMENT_TYPE = #{attachmentType}-->
AND ATTACHMENT_TYPE = 'image'
and TOPIC_ID = #{topicId}
</select>
<select id="getTopicAndImgs" resultMap="topicImgResultMap">
SELECT
t.ID,
t.TOPIC_CONTENT,
a.ATTACHMENT_URL,
a.SORT
from resi_topic t
LEFT JOIN resi_topic_attachment a ON t.ID = a.TOPIC_ID
WHERE
t.del_flag = '0'
AND ATTACHMENT_TYPE = 'image'
and TOPIC_ID = #{topicId}
</select>
</mapper>

Loading…
Cancel
Save