Browse Source

Merge remote-tracking branch 'origin/dev_screen_data_2.0' into dev_temp

dev
zxc 5 years ago
parent
commit
f9ac25f70e
  1. 20
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/TopicContentResultDTO.java
  2. 20
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ProjectSourceMapFormDTO.java
  3. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  4. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
  5. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java
  6. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java
  7. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java
  8. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyImgDataEntity.java
  9. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexCollDistrictService.java
  10. 154
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java
  11. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java
  12. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java
  13. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java
  14. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java
  15. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java
  16. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java
  17. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/OrgRankExtractService.java
  18. 60
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java
  19. 167
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java
  20. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java
  21. 48
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java
  22. 39
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java
  23. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java
  24. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java
  25. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java
  26. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java
  27. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java
  28. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java
  29. 54
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java
  30. 12
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  31. 10
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml
  32. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml
  33. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml
  34. 117
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml
  35. 13
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml
  36. 21
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml
  37. 26
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml

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

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

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java

@ -17,6 +17,7 @@ import com.epmet.dao.stats.DimDateDao;
import com.epmet.dao.stats.DimMonthDao; import com.epmet.dao.stats.DimMonthDao;
import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.dto.extract.form.ScreenExtractFormDTO; import com.epmet.dto.extract.form.ScreenExtractFormDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
@ -189,7 +190,7 @@ public class DemoController {
@PostMapping("zxc2") @PostMapping("zxc2")
public Result getZxc2(){ public Result getZxc2(){
indexCalculateCommunityService.calCommunityAll("epmettest", "202008"); indexCalculateCommunityService.calCommunityAll("45687aa479955f9d06204d415238f7cc", "202008");
return new Result(); return new Result();
} }
@ -505,7 +506,7 @@ public class DemoController {
@PostMapping("districtZxc") @PostMapping("districtZxc")
public void getDistrict(){ public void getDistrict(){
String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; String customerId = "45687aa479955f9d06204d415238f7cc";
String monthId = "202008"; String monthId = "202008";
indexCalculateDistrictService.calDistrictAll(customerId,monthId); indexCalculateDistrictService.calDistrictAll(customerId,monthId);
} }
@ -657,7 +658,7 @@ public class DemoController {
private PartyGuideService partyGuideService; private PartyGuideService partyGuideService;
@PostMapping("zxczxc") @PostMapping("zxczxc")
public Result getZxcZxc(@RequestBody ScreenExtractFormDTO formDTO){ public Result getZxcZxc(@RequestBody ExtractScreenFormDTO formDTO){
partyGuideService.partyGuideExtract(formDTO); partyGuideService.partyGuideExtract(formDTO);
return new Result(); return new Result();
} }

4
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.FactOriginProjectMainDailyDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; 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.extract.FactOriginProjectMainDailyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -183,12 +184,11 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
/** /**
* @Description 查询评价周期内新立的项目是为了增量新增难点赌点的图片库 * @Description 查询评价周期内新立的项目是为了增量新增难点赌点的图片库
* @param customerId * @param customerId
* @param dateId
* @return java.util.List<java.lang.String> * @return java.util.List<java.lang.String>
* @author wangc * @author wangc
* @date 2020.09.28 11:15 * @date 2020.09.28 11:15
*/ */
List<String> selectNewProject(@Param("customerId") String customerId, @Param("dateId")String dateId); List<ProjectSourceMapFormDTO > selectNewProject(@Param("customerId") String customerId, @Param("list")List<String> list);
/** /**
* 网格解决项目数 * 网格解决项目数

9
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.DifficultyDataDetailFormDTO;
import com.epmet.dto.screencoll.form.DifficultyDataFormDTO; import com.epmet.dto.screencoll.form.DifficultyDataFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; 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.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -82,4 +83,12 @@ public interface ScreenDifficultyDataDao extends BaseDao<ScreenDifficultyDataEnt
* @date 2020.09.28 13:46 * @date 2020.09.28 13:46
*/ */
int updateTime(@Param("customerId")String customerId,@Param("dateId")String dateId); int updateTime(@Param("customerId")String customerId,@Param("dateId")String dateId);
int deleteBatchDifficulty(@Param("customerId")String customerId,@Param("list")List<String> list);
int deleteBatchDifficultyImg(@Param("list")List<String> list);
int insertBatch(@Param("list") List<ScreenDifficultyDataEntity> list);
int insertBatchImg(@Param("list") List<ScreenDifficultyImgDataEntity> list);
} }

10
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.commons.mybatis.dao.BaseDao;
import com.epmet.dto.project.FinishOrgDTO; import com.epmet.dto.project.FinishOrgDTO;
import com.epmet.dto.project.ProcessInfoDTO; 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.ProjectOrgPeriodResultDTO;
import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO; import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO;
import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectEntity;
@ -113,4 +114,13 @@ public interface ProjectProcessDao extends BaseDao<ProjectProcessEntity> {
* @return java.util.List<com.epmet.dto.project.FinishOrgDTO> * @return java.util.List<com.epmet.dto.project.FinishOrgDTO>
*/ */
List<FinishOrgDTO> selectFinishOrg(@Param("customerId") String customerId, @Param("date") String date); List<FinishOrgDTO> selectFinishOrg(@Param("customerId") String customerId, @Param("date") String date);
/**
* @Description 查找项目最近一次操作说明
* @param list
* @return java.util.List<com.epmet.dto.project.result.ProjectLatestOperationResultDTO>
* @author wangc
* @date 2020.09.28 14:45
*/
List<ProjectLatestOperationResultDTO> selectLatestOperation(@Param("list") List<String> list);
} }

21
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 * @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.topic.ResiTopicDTO;
import com.epmet.dto.extract.result.TopicInfoResultDTO; import com.epmet.dto.extract.result.TopicInfoResultDTO;
import com.epmet.dto.topic.TopicOriginInfoDTO; import com.epmet.dto.topic.TopicOriginInfoDTO;
import com.epmet.dto.topic.result.ResiGroupTopicResultDTO; import com.epmet.dto.topic.result.ResiGroupTopicResultDTO;
import com.epmet.dto.topic.result.ResiTopicOperationResultDTO; 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.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -96,4 +99,22 @@ public interface TopicDao {
* @Date 2020/9/23 17:52 * @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>
* @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>
* @author wangc
* @date 2020.09.28 16:28
*/
List<TopicContentResultDTO> selectTopicContent(@Param("list") List<ProjectSourceMapFormDTO> list);
} }

2
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.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -15,6 +16,7 @@ import lombok.EqualsAndHashCode;
@Data @Data
@EqualsAndHashCode(callSuper=false) @EqualsAndHashCode(callSuper=false)
@TableName("screen_difficulty_img_data") @TableName("screen_difficulty_img_data")
@AllArgsConstructor
public class ScreenDifficultyImgDataEntity extends BaseEpmetEntity { public class ScreenDifficultyImgDataEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexCollDistrictService.java

@ -7,4 +7,14 @@ package com.epmet.service.evaluationindex.extract.dataToIndex;
* @date 2020/9/18 10:44 * @date 2020/9/18 10:44
*/ */
public interface IndexCollDistrictService { public interface IndexCollDistrictService {
/**
* 区治理能力统计
*
* @author zhaoqifeng
* @date 2020/9/18 13:52
* @param customerId
* @param dateId
* @return void
*/
void saveDistrictAbility(String customerId, String dateId);
} }

154
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java

@ -1,10 +1,35 @@
package com.epmet.service.evaluationindex.extract.dataToIndex.impl; package com.epmet.service.evaluationindex.extract.dataToIndex.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity;
import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollDistrictService; import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollDistrictService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectOrgPeriodDailyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService;
import com.epmet.service.stats.DimAgencyService;
import com.epmet.service.stats.FactArticlePublishedAgencyDailyService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
/** /**
* @author zhaoqifeng * @author zhaoqifeng
@ -15,4 +40,133 @@ import org.springframework.stereotype.Service;
@Slf4j @Slf4j
@DataSource(DataSourceConstant.EVALUATION_INDEX) @DataSource(DataSourceConstant.EVALUATION_INDEX)
public class IndexCollDistrictServiceImpl implements IndexCollDistrictService { public class IndexCollDistrictServiceImpl implements IndexCollDistrictService {
@Autowired
private DimAgencyService dimAgencyService;
@Autowired
private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService;
@Autowired
private FactOriginProjectLogDailyService factOriginProjectLogDailyService;
@Autowired
private FactOriginProjectOrgPeriodDailyService factOriginProjectOrgPeriodDailyService;
@Autowired
private FactArticlePublishedAgencyDailyService factArticlePublishedAgencyDailyService;
@Autowired
private FactIndexPartyAblityOrgMonthlyService factIndexPartyAblityOrgMonthlyService;
@Override
public void saveDistrictAbility(String customerId, String dateId) {
//当前日期前一天
Date date = DateUtils.stringToDate(dateId, DateUtils.DATE_PATTERN_YYYYMM);
//获取日期相关维度
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date);
//获取社区列表
List<DimAgencyDTO>agencyList = dimAgencyService.getAgencyByLevel(customerId, OrgTypeConstant.DISTRICT);
//社区数据初始化
List<FactIndexGovrnAblityOrgMonthlyEntity> list = agencyList.stream().map(agency ->{
FactIndexGovrnAblityOrgMonthlyEntity entity = new FactIndexGovrnAblityOrgMonthlyEntity();
entity.setCustomerId(customerId);
entity.setAgencyId(agency.getId());
entity.setParentId(agency.getPid());
entity.setYearId(dimId.getYearId());
entity.setQuarterId(dimId.getQuarterId());
entity.setMonthId(dimId.getMonthId());
entity.setDataType(OrgTypeConstant.DISTRICT);
entity.setTransferedCount(NumConstant.ZERO);
//办结项目数
entity.setClosedProjectCount(NumConstant.ZERO);
//项目响应度
entity.setRespProjectRatio(new BigDecimal(NumConstant.ZERO));
entity.setOverdueProjectRatio(new BigDecimal(NumConstant.ZERO));
//办结项目率
entity.setClosedProjectRatio(new BigDecimal(NumConstant.ZERO));
entity.setSatisfactionRatio(new BigDecimal(NumConstant.ZERO));
//街道办结项目的处理效率
entity.setHandleProjectRatio(new BigDecimal(NumConstant.ZERO));
return entity;
}).collect(Collectors.toList());
//被吹哨次数统计
List<OrgStatisticsResultDTO> transferCount = factOriginProjectLogDailyService.getAgencyTransferCount(customerId, dimId.getMonthId(),
OrgTypeConstant.DISTRICT);
if (null != transferCount && !transferCount.isEmpty()) {
list.forEach(entity -> transferCount.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(count ->
entity.setTransferedCount(count.getCount())
));
}
//社区项目响应度
List<OrgStatisticsResultDTO> responsiveness = factOriginProjectOrgPeriodDailyService.getResponsiveness(customerId, dimId.getMonthId(),
OrgTypeConstant.DISTRICT, OrgTypeConstant.AGENCY);
if (null != responsiveness && !responsiveness.isEmpty()) {
list.forEach(entity -> responsiveness.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(response -> {
if (response.getCount() != NumConstant.ZERO) {
BigDecimal count = new BigDecimal(response.getCount());
BigDecimal sum = new BigDecimal(response.getSum());
entity.setRespProjectRatio(sum.divide(count, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//社区办结项目满意度
List<OrgStatisticsResultDTO> satisfaction = factOriginProjectLogDailyService.getSatisfaction(customerId, dimId.getMonthId(), OrgTypeConstant.DISTRICT);
if (CollectionUtils.isEmpty(satisfaction)) {
list.forEach(entity -> satisfaction.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(sa -> {
if (sa.getCount() != NumConstant.ZERO) {
BigDecimal count = new BigDecimal(sa.getCount());
BigDecimal sum = new BigDecimal(sa.getSum());
entity.setSatisfactionRatio(sum.divide(count, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//办结数
Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(customerId,dimId.getMonthId(),"month");
Map<String,Integer> agencyParticipatedCount = factOriginProjectLogDailyService.getCountOfProjectsHandledByAgency(customerId,dimId.getMonthId(),"month");
Map<String,BigDecimal> efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month");
list.forEach(entity ->{
entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId()));
BigDecimal element = new BigDecimal(entity.getClosedProjectCount());
//分母,即机关参与过的项目数(去重)
Integer denominator = agencyParticipatedCount.get(entity.getAgencyId());
if (null != denominator && denominator != NumConstant.ZERO) {
//办结率
entity.setClosedProjectRatio(
element.divide(new BigDecimal(denominator), NumConstant.SIX, RoundingMode.HALF_UP)
);
}else{
entity.setClosedProjectRatio(BigDecimal.ZERO);
}
//办结效率
entity.setHandleProjectRatio(Optional.ofNullable(efficiencyMap.get(entity.getAgencyId())).orElse(BigDecimal.ZERO));
});
factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.DISTRICT);
factIndexGovrnAblityOrgMonthlyService.saveList(list);
//2.党建能力
//获取社区发文数量
List<FactArticlePublishedAgencyDailyDTO> articles = factArticlePublishedAgencyDailyService.getArticleCount(customerId, dimId.getMonthId(),
OrgTypeConstant.DISTRICT);
List<FactIndexPartyAblityOrgMonthlyEntity> partyList = agencyList.stream().map(agency ->{
FactIndexPartyAblityOrgMonthlyEntity entity = new FactIndexPartyAblityOrgMonthlyEntity();
entity.setCustomerId(customerId);
entity.setAgencyId(agency.getId());
entity.setParentId(agency.getPid());
entity.setYearId(dimId.getYearId());
entity.setQuarterId(dimId.getQuarterId());
entity.setMonthId(dimId.getMonthId());
entity.setDataType(OrgTypeConstant.DISTRICT);
entity.setPublishArticleCount(NumConstant.ZERO);
return entity;
}).collect(Collectors.toList());
if (null != articles && !articles.isEmpty()) {
partyList.forEach(entity -> articles.stream().filter(article -> entity.getAgencyId().equals(article.getAgencyId())).forEach(dto ->
entity.setPublishArticleCount(dto.getArticleTotalCount())
));
}
factIndexPartyAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.DISTRICT);
factIndexPartyAblityOrgMonthlyService.saveList(partyList);
}
} }

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java

@ -154,7 +154,7 @@ public class IndexCollStreetServiceImpl implements IndexCollStreetService {
entity.setYearId(dimId.getYearId()); entity.setYearId(dimId.getYearId());
entity.setQuarterId(dimId.getQuarterId()); entity.setQuarterId(dimId.getQuarterId());
entity.setMonthId(dimId.getMonthId()); entity.setMonthId(dimId.getMonthId());
entity.setDataType(OrgTypeConstant.COMMUNITY); entity.setDataType(OrgTypeConstant.STREET);
entity.setPublishArticleCount(NumConstant.ZERO); entity.setPublishArticleCount(NumConstant.ZERO);
return entity; return entity;
}).collect(Collectors.toList()); }).collect(Collectors.toList());

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java

@ -42,6 +42,8 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService
private IndexCollStreetService indexCollStreetService; private IndexCollStreetService indexCollStreetService;
@Autowired @Autowired
private IndexCollCommunityService indexCollCommunityService; private IndexCollCommunityService indexCollCommunityService;
@Autowired
private IndexCollDistrictService indexCollDistrictService;
/** /**
* desc从统计库对象抽取指标数据 * desc从统计库对象抽取指标数据
@ -114,6 +116,11 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService
}catch (Exception e){ }catch (Exception e){
log.error("抽取【社区治理能力-社区党建能力】发生异常,参数:" + JSON.toJSONString(param), e); log.error("抽取【社区治理能力-社区党建能力】发生异常,参数:" + JSON.toJSONString(param), e);
} }
try{
indexCollDistrictService.saveDistrictAbility(customerId, monthId);
}catch (Exception e){
log.error("抽取【全区治理能力-全区党建能力】发生异常,参数:" + JSON.toJSONString(param), e);
}
}); });
} }
} }

4
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.FactOriginProjectMainDailyDTO;
import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO; 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.extract.FactOriginProjectMainDailyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import com.mysql.cj.x.protobuf.MysqlxDatatypes; import com.mysql.cj.x.protobuf.MysqlxDatatypes;
@ -253,10 +254,9 @@ public interface FactOriginProjectMainDailyService extends BaseService<FactOrigi
/** /**
* @Description 得到评价周期内新立项的id * @Description 得到评价周期内新立项的id
* @param customerId * @param customerId
* @param dateId
* @return java.util.List<java.lang.String> * @return java.util.List<java.lang.String>
* @author wangc * @author wangc
* @date 2020.09.28 14:10 * @date 2020.09.28 14:10
*/ */
List<String> getNewProjectId(String customerId,String dateId); List<ProjectSourceMapFormDTO> getNewProject(String customerId, List<String> list);
} }

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java

@ -22,9 +22,9 @@ public interface ProjectExtractService {
void saveOriginProjectDaily(ExtractOriginFormDTO extractOriginFormDTO); void saveOriginProjectDaily(ExtractOriginFormDTO extractOriginFormDTO);
/** /**
* 抽取项目节点历时逻辑
* @param param * @param param
* @return * @return
* @Description 抽取项目节点历时逻辑
* @author wangc * @author wangc
* @date 2020.09.17 14:05 * @date 2020.09.17 14:05
**/ **/

6
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.FactOriginProjectMainDailyDTO;
import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO; 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.extract.FactOriginProjectMainDailyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService;
@ -241,13 +242,12 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
/** /**
* @Description 得到评价周期内新立项的id * @Description 得到评价周期内新立项的id
* @param customerId * @param customerId
* @param dateId
* @return java.util.List<java.lang.String> * @return java.util.List<java.lang.String>
* @author wangc * @author wangc
* @date 2020.09.28 14:10 * @date 2020.09.28 14:10
*/ */
@Override @Override
public List<String> getNewProjectId(String customerId, String dateId) { public List<ProjectSourceMapFormDTO > getNewProject(String customerId, List<String> list) {
return baseDao.selectNewProject(customerId,dateId); return baseDao.selectNewProject(customerId,list);
} }
} }

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java

@ -38,4 +38,15 @@ public interface GovernRankDataExtractService {
* @date 2020/9/24 15:17 * @date 2020/9/24 15:17
*/ */
void extractStreetData(String customerId, String monthId); void extractStreetData(String customerId, String monthId);
/**
* 全区治理能力
*
* @param customerId
* @param monthId
* @return void
* @author zhaoqifeng
* @date 2020/9/24 15:17
*/
void extractDistrictData(String customerId, String monthId);
} }

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/OrgRankExtractService.java

@ -38,4 +38,15 @@ public interface OrgRankExtractService {
* @date 2020/9/24 15:17 * @date 2020/9/24 15:17
*/ */
void extractStreetData(String customerId, String monthId); void extractStreetData(String customerId, String monthId);
/**
* 全区先进排行
*
* @param customerId
* @param monthId
* @return void
* @author zhaoqifeng
* @date 2020/9/24 15:17
*/
void extractDistrictData(String customerId, String monthId);
} }

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

@ -225,4 +225,64 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
} }
screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list); screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list);
} }
@Override
public void extractDistrictData(String customerId, String monthId) {
List<ScreenGovernRankDataEntity> list = screenGovernRankDataService.initList(customerId, OrgTypeConstant.AGENCY, OrgTypeConstant.DISTRICT);
if (CollectionUtils.isEmpty(list)) {
return;
}
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.DISTRICT);
if (!CollectionUtils.isEmpty(satisfactionList)) {
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//响应率 响应次数/流转到网格的次数
List<OrgStatisticsResultDTO> responseList = factOriginProjectLogDailyService.getOrgResponse(customerId, monthId, OrgTypeConstant.DISTRICT);
if (!CollectionUtils.isEmpty(responseList)) {
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//自制率 自治项目数/办结项目数
List<OrgStatisticsResultDTO> selfList = factOriginProjectMainDailyService.getSelfProject(customerId, monthId, OrgTypeConstant.DISTRICT);
if (!CollectionUtils.isEmpty(selfList)) {
list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//解决率 已解决项目数/办结项目数
List<OrgStatisticsResultDTO> resolveList = factOriginProjectMainDailyService.getResolveProject(customerId, monthId,
OrgTypeConstant.DISTRICT);
if (!CollectionUtils.isEmpty(resolveList)) {
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list);
}
} }

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

@ -67,37 +67,37 @@ public class OrgRankExtractServiceImpl implements OrgRankExtractService {
//党员数 //党员数
List<FactRegUserGridMonthlyDTO> partyMemberList = factRegUserGridMonthlyService.getGridUserCountByCustomer(customerId, monthId); List<FactRegUserGridMonthlyDTO> partyMemberList = factRegUserGridMonthlyService.getGridUserCountByCustomer(customerId, monthId);
if (!CollectionUtils.isEmpty(partyMemberList)) { if (!CollectionUtils.isEmpty(partyMemberList)) {
list.forEach(entity -> partyMemberList.stream().filter(item -> item.getGridId().equals(entity.getOrgId())).forEach(dto -> { list.forEach(entity -> partyMemberList.stream().filter(item -> item.getGridId().equals(entity.getOrgId())).forEach(dto ->
entity.setPartyTotal(dto.getPartymemberTotal()); entity.setPartyTotal(dto.getPartymemberTotal())
})); ));
} }
//小组数 //小组数
List<OrgStatisticsResultDTO> groupList = factOriginGroupMainDailyService.getGridGroupCount(customerId, monthId); List<OrgStatisticsResultDTO> groupList = factOriginGroupMainDailyService.getGridGroupCount(customerId, monthId);
if (!CollectionUtils.isEmpty(groupList)) { if (!CollectionUtils.isEmpty(groupList)) {
list.forEach(entity -> groupList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { list.forEach(entity -> groupList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto ->
entity.setGroupTotal(dto.getCount()); entity.setGroupTotal(dto.getCount())
})); ));
} }
//话题数 //话题数
List<OrgStatisticsResultDTO> topicList = factOriginTopicMainDailyService.getGridTopicCount(customerId, monthId); List<OrgStatisticsResultDTO> topicList = factOriginTopicMainDailyService.getGridTopicCount(customerId, monthId);
if (!CollectionUtils.isEmpty(topicList)) { if (!CollectionUtils.isEmpty(topicList)) {
list.forEach(entity -> topicList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { list.forEach(entity -> topicList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto ->
entity.setTopicTotal(dto.getCount()); entity.setTopicTotal(dto.getCount())
})); ));
} }
//议题数 //议题数
List<OrgStatisticsResultDTO> issueList = factOriginIssueMainDailyService.getGridIssueCount(customerId, monthId); List<OrgStatisticsResultDTO> issueList = factOriginIssueMainDailyService.getGridIssueCount(customerId, monthId);
if (!CollectionUtils.isEmpty(issueList)) { if (!CollectionUtils.isEmpty(issueList)) {
list.forEach(entity -> issueList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { list.forEach(entity -> issueList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto ->
entity.setIssueTotal(dto.getCount()); entity.setIssueTotal(dto.getCount())
})); ));
} }
//项目数 //项目数
List<OrgStatisticsResultDTO> projectList = factOriginProjectMainDailyService.getGridProjectCount(customerId, monthId); List<OrgStatisticsResultDTO> projectList = factOriginProjectMainDailyService.getGridProjectCount(customerId, monthId);
if (!CollectionUtils.isEmpty(projectList)) { if (!CollectionUtils.isEmpty(projectList)) {
list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto ->
entity.setProjectTotal(dto.getCount()); entity.setProjectTotal(dto.getCount())
})); ));
} }
//结案率 结案数/项目数 //结案率 结案数/项目数
List<FactIndexGovrnAblityGridMonthlyEntity> abilityList = factIndexGovrnAblityGridMonthlyService.getGridByCustomer(customerId, monthId); List<FactIndexGovrnAblityGridMonthlyEntity> abilityList = factIndexGovrnAblityGridMonthlyService.getGridByCustomer(customerId, monthId);
@ -139,44 +139,44 @@ public class OrgRankExtractServiceImpl implements OrgRankExtractService {
List<FactRegUserAgencyMonthlyDTO> partyMemberList = factRegUserAgencyMonthlyService.getOrgUserCountByCustomer(customerId, monthId, List<FactRegUserAgencyMonthlyDTO> partyMemberList = factRegUserAgencyMonthlyService.getOrgUserCountByCustomer(customerId, monthId,
OrgTypeConstant.COMMUNITY); OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(partyMemberList)) { if (!CollectionUtils.isEmpty(partyMemberList)) {
list.forEach(entity -> partyMemberList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { list.forEach(entity -> partyMemberList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setPartyTotal(dto.getPartymemberTotal()); entity.setPartyTotal(dto.getPartymemberTotal())
})); ));
} }
//小组数 //小组数
List<OrgStatisticsResultDTO> groupList = factOriginGroupMainDailyService.getOrgGroupCount(customerId, monthId, OrgTypeConstant.COMMUNITY); List<OrgStatisticsResultDTO> groupList = factOriginGroupMainDailyService.getOrgGroupCount(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(groupList)) { if (!CollectionUtils.isEmpty(groupList)) {
list.forEach(entity -> groupList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { list.forEach(entity -> groupList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setGroupTotal(dto.getCount()); entity.setGroupTotal(dto.getCount())
})); ));
} }
//话题数 //话题数
List<OrgStatisticsResultDTO> topicList = factOriginTopicMainDailyService.getOrgTopicCount(customerId, monthId, OrgTypeConstant.COMMUNITY); List<OrgStatisticsResultDTO> topicList = factOriginTopicMainDailyService.getOrgTopicCount(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(topicList)) { if (!CollectionUtils.isEmpty(topicList)) {
list.forEach(entity -> topicList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { list.forEach(entity -> topicList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setTopicTotal(dto.getCount()); entity.setTopicTotal(dto.getCount())
})); ));
} }
//议题数 //议题数
List<OrgStatisticsResultDTO> issueList = factOriginIssueMainDailyService.getOrgIssueCount(customerId, monthId, OrgTypeConstant.COMMUNITY); List<OrgStatisticsResultDTO> issueList = factOriginIssueMainDailyService.getOrgIssueCount(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(issueList)) { if (!CollectionUtils.isEmpty(issueList)) {
list.forEach(entity -> issueList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { list.forEach(entity -> issueList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setIssueTotal(dto.getCount()); entity.setIssueTotal(dto.getCount())
})); ));
} }
//项目数 //项目数
List<OrgStatisticsResultDTO> projectList = factOriginProjectMainDailyService.getOrgProjectCount(customerId, monthId, OrgTypeConstant.COMMUNITY); List<OrgStatisticsResultDTO> projectList = factOriginProjectMainDailyService.getOrgProjectCount(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(projectList)) { if (!CollectionUtils.isEmpty(projectList)) {
list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto ->
entity.setProjectTotal(dto.getCount()); entity.setProjectTotal(dto.getCount())
})); ));
} }
//结案率 结案数/项目数 //结案率 结案数/项目数
List<FactIndexGovrnAblityOrgMonthlyEntity> abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.COMMUNITY); List<FactIndexGovrnAblityOrgMonthlyEntity> abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(abilityList)) { if (!CollectionUtils.isEmpty(abilityList)) {
list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setCloseProjectRatio(dto.getClosedProjectRatio()); entity.setCloseProjectRatio(dto.getClosedProjectRatio())
})); ));
} }
//满意率 满意和非常满意占比 //满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.COMMUNITY); List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.COMMUNITY);
@ -206,45 +206,112 @@ public class OrgRankExtractServiceImpl implements OrgRankExtractService {
List<FactRegUserAgencyMonthlyDTO> partyMemberList = factRegUserAgencyMonthlyService.getOrgUserCountByCustomer(customerId, monthId, List<FactRegUserAgencyMonthlyDTO> partyMemberList = factRegUserAgencyMonthlyService.getOrgUserCountByCustomer(customerId, monthId,
OrgTypeConstant.COMMUNITY); OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(partyMemberList)) { if (!CollectionUtils.isEmpty(partyMemberList)) {
list.forEach(entity -> partyMemberList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { list.forEach(entity -> partyMemberList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setPartyTotal(dto.getPartymemberTotal()); entity.setPartyTotal(dto.getPartymemberTotal())
})); ));
} }
//小组数 //小组数
List<OrgStatisticsResultDTO> groupList = factOriginGroupMainDailyService.getOrgGroupCount(customerId, monthId, OrgTypeConstant.STREET); List<OrgStatisticsResultDTO> groupList = factOriginGroupMainDailyService.getOrgGroupCount(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(groupList)) { if (!CollectionUtils.isEmpty(groupList)) {
list.forEach(entity -> groupList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { list.forEach(entity -> groupList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setGroupTotal(dto.getCount()); entity.setGroupTotal(dto.getCount())
})); ));
} }
//话题数 //话题数
List<OrgStatisticsResultDTO> topicList = factOriginTopicMainDailyService.getOrgTopicCount(customerId, monthId, OrgTypeConstant.STREET); List<OrgStatisticsResultDTO> topicList = factOriginTopicMainDailyService.getOrgTopicCount(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(topicList)) { if (!CollectionUtils.isEmpty(topicList)) {
list.forEach(entity -> topicList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { list.forEach(entity -> topicList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setTopicTotal(dto.getCount()); entity.setTopicTotal(dto.getCount())
})); ));
} }
//议题数 //议题数
List<OrgStatisticsResultDTO> issueList = factOriginIssueMainDailyService.getOrgIssueCount(customerId, monthId, OrgTypeConstant.STREET); List<OrgStatisticsResultDTO> issueList = factOriginIssueMainDailyService.getOrgIssueCount(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(issueList)) { if (!CollectionUtils.isEmpty(issueList)) {
list.forEach(entity -> issueList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { list.forEach(entity -> issueList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setIssueTotal(dto.getCount()); entity.setIssueTotal(dto.getCount())
})); ));
} }
//项目数 //项目数
List<OrgStatisticsResultDTO> projectList = factOriginProjectMainDailyService.getOrgProjectCount(customerId, monthId, OrgTypeConstant.STREET); List<OrgStatisticsResultDTO> projectList = factOriginProjectMainDailyService.getOrgProjectCount(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(projectList)) { if (!CollectionUtils.isEmpty(projectList)) {
list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto ->
entity.setProjectTotal(dto.getCount()); entity.setProjectTotal(dto.getCount())
})); ));
} }
//结案率 结案数/项目数 //结案率 结案数/项目数
List<FactIndexGovrnAblityOrgMonthlyEntity> abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.STREET); List<FactIndexGovrnAblityOrgMonthlyEntity> abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(abilityList)) { if (!CollectionUtils.isEmpty(abilityList)) {
list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setCloseProjectRatio(dto.getClosedProjectRatio()); entity.setCloseProjectRatio(dto.getClosedProjectRatio())
));
}
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(satisfactionList)) {
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
})); }));
} }
}
@Override
public void extractDistrictData(String customerId, String monthId) {
List<ScreenOrgRankDataEntity> list = screenOrgRankDataService.initList(customerId, OrgTypeConstant.AGENCY, OrgTypeConstant.DISTRICT);
if (CollectionUtils.isEmpty(list)) {
return;
}
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
//党员数
List<FactRegUserAgencyMonthlyDTO> partyMemberList = factRegUserAgencyMonthlyService.getOrgUserCountByCustomer(customerId, monthId,
OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(partyMemberList)) {
list.forEach(entity -> partyMemberList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setPartyTotal(dto.getPartymemberTotal())
));
}
//小组数
List<OrgStatisticsResultDTO> groupList = factOriginGroupMainDailyService.getOrgGroupCount(customerId, monthId, OrgTypeConstant.DISTRICT);
if (!CollectionUtils.isEmpty(groupList)) {
list.forEach(entity -> groupList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setGroupTotal(dto.getCount())
));
}
//话题数
List<OrgStatisticsResultDTO> topicList = factOriginTopicMainDailyService.getOrgTopicCount(customerId, monthId, OrgTypeConstant.DISTRICT);
if (!CollectionUtils.isEmpty(topicList)) {
list.forEach(entity -> topicList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setTopicTotal(dto.getCount())
));
}
//议题数
List<OrgStatisticsResultDTO> issueList = factOriginIssueMainDailyService.getOrgIssueCount(customerId, monthId, OrgTypeConstant.DISTRICT);
if (!CollectionUtils.isEmpty(issueList)) {
list.forEach(entity -> issueList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setIssueTotal(dto.getCount())
));
}
//项目数
List<OrgStatisticsResultDTO> projectList = factOriginProjectMainDailyService.getOrgProjectCount(customerId, monthId, OrgTypeConstant.DISTRICT);
if (!CollectionUtils.isEmpty(projectList)) {
list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto ->
entity.setProjectTotal(dto.getCount())
));
}
//结案率 结案数/项目数
List<FactIndexGovrnAblityOrgMonthlyEntity> abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.DISTRICT);
if (!CollectionUtils.isEmpty(abilityList)) {
list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setCloseProjectRatio(dto.getClosedProjectRatio())
));
}
//满意率 满意和非常满意占比 //满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.STREET); List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(satisfactionList)) { if (!CollectionUtils.isEmpty(satisfactionList)) {

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

@ -96,7 +96,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
} else if (StringUtils.isNotBlank(formDTO.getMonthId())) { } else if (StringUtils.isNotBlank(formDTO.getMonthId())) {
extractMonthly(customerId, formDTO.getMonthId()); extractMonthly(customerId, formDTO.getMonthId());
} else { } else {
String dateId = LocalDate.now().minusDays(NumConstant.ONE).toString().replace("-", ""); String dateId = LocalDate.now().minusMonths(NumConstant.ONE).toString().replace("-", "");
extractMonthly(customerId, dateId); extractMonthly(customerId, dateId);
} }
}); });
@ -138,11 +138,12 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
governRankDataExtractService.extractGridData(customerId, monthId); governRankDataExtractService.extractGridData(customerId, monthId);
governRankDataExtractService.extractCommunityData(customerId, monthId); governRankDataExtractService.extractCommunityData(customerId, monthId);
governRankDataExtractService.extractStreetData(customerId, monthId); governRankDataExtractService.extractStreetData(customerId, monthId);
governRankDataExtractService.extractDistrictData(customerId, monthId);
//先进排行 screen_org_rank_data //先进排行 screen_org_rank_data
orgRankExtractService.extractGridData(customerId, monthId); orgRankExtractService.extractGridData(customerId, monthId);
orgRankExtractService.extractCommunityData(customerId, monthId); orgRankExtractService.extractCommunityData(customerId, monthId);
orgRankExtractService.extractStreetData(customerId, monthId); orgRankExtractService.extractStreetData(customerId, monthId);
orgRankExtractService.extractDistrictData(customerId, monthId);
// 党建引领 screen_party_branch_data,screen_party_link_masses_data // 党建引领 screen_party_branch_data,screen_party_link_masses_data
partyGuideService.partyGuideExtract(formDTO); partyGuideService.partyGuideExtract(formDTO);
} }

48
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.constant.StrConstant;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.org.GridInfoDTO; 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.form.ScreenCentralZoneDataFormDTO;
import com.epmet.dto.screen.result.DifficultyIfExistedResultDTO; import com.epmet.dto.screen.result.DifficultyIfExistedResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; 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.evaluationindex.screen.ScreenPartyUserRankDataEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.ScreenGrassrootsGovernDataAbsorptionService; 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.evaluationindex.screen.ScreenPartyUserRankDataService;
import com.epmet.service.org.CustomerGridService; import com.epmet.service.org.CustomerGridService;
import com.epmet.service.point.UserPointService; 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 com.epmet.service.user.UserService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -24,8 +28,10 @@ import org.springframework.util.StringUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
@ -53,6 +59,10 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
private ScreenDifficultyDataService screenDifficultyDataService; private ScreenDifficultyDataService screenDifficultyDataService;
@Autowired @Autowired
private FactOriginProjectMainDailyService factOriginProjectMainDailyService; private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
@Autowired
private ProjectProcessService projectProcessService;
@Autowired
private TopicService topicService;
/** /**
* @Description 用户积分党员分值数据中转站 * @Description 用户积分党员分值数据中转站
* @param param * @param param
@ -128,14 +138,36 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
DifficultyIfExistedResultDTO existedMap = screenDifficultyDataService.selectExistedInfo(param.getCustomerId()); DifficultyIfExistedResultDTO existedMap = screenDifficultyDataService.selectExistedInfo(param.getCustomerId());
//查询数据 //查询数据
List<ScreenDifficultyDataEntity> difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(),existedMap.getClosedIds()); List<ScreenDifficultyDataEntity> difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(),existedMap.getClosedIds());
if(CollectionUtils.isEmpty(difficulties)) return;
List<String> projectIds = difficulties.stream().map(ScreenDifficultyDataEntity :: getEventId).distinct().collect(Collectors.toList());
//最近一次操作
Map<String,String> latestOperationMap = projectProcessService.selectLatestOperation(projectIds,param.getCustomerId());
boolean isOperationNull = CollectionUtils.isEmpty(latestOperationMap) ? true : false;
//图片
List<ProjectSourceMapFormDTO> projectSourceMap;
projectSourceMap = factOriginProjectMainDailyService.getNewProject(param.getCustomerId(),projectIds);
Map<String,List<ScreenDifficultyImgDataEntity>> imgMap =
topicService.getTopicImgs(projectSourceMap);
boolean isImgNull = CollectionUtils.isEmpty(imgMap) ? true : false;
Map<String,String> contentMap = topicService.getTopicContent(projectSourceMap);
boolean isContentNull = CollectionUtils.isEmpty(contentMap) ? true : false;
difficulties.forEach( diff -> {
if(!isImgNull) {
List<ScreenDifficultyImgDataEntity> 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<ScreenDifficultyImgDataEntity> imgList = new LinkedList<>();
imgMap.values().forEach(list -> {imgList.addAll(list);});
if(existedMap.isIfExisted()){ screenDifficultyDataService.dataClean(param.getCustomerId(),difficulties,imgList);
//查询全部项目的图片
}else{
//查询增量项目的图片
List<String> newProjectIds = factOriginProjectMainDailyService.getNewProjectId(param.getCustomerId(),param.getDateId());
}
} }
} }

39
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java

@ -209,9 +209,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
subPartyAvgList.forEach(party -> { subPartyAvgList.forEach(party -> {
List<SampleValue> index1SampleValues = new ArrayList<>(); List<SampleValue> index1SampleValues = new ArrayList<>();
party.forEach(c -> { party.forEach(c -> {
pid.put(c.getParentId(),customerAgencyDao.selectPid(c.getParentId())); if (!c.getParentId().equals(NumConstant.ZERO_STR)) {
SampleValue s = new SampleValue(c.getParentId(), c.getScore()); pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId()));
index1SampleValues.add(s); SampleValue s = new SampleValue(c.getParentId(), c.getScore());
index1SampleValues.add(s);
}
}); });
BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc);
@ -275,6 +277,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
detailListByParentCode.forEach(detail -> { detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) {
List<SubAgencyScoreAvgResultDTO> districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); List<SubAgencyScoreAvgResultDTO> districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL);
for (int i = 0; i < districtGovernAvgList.size(); i++) {
if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){
districtGovernAvgList.remove(districtGovernAvgList.get(i));
}
}
if (CollectionUtils.isEmpty(districtGovernAvgList)) { if (CollectionUtils.isEmpty(districtGovernAvgList)) {
log.error("查询所有街道治理能力平均值集合为空"); log.error("查询所有街道治理能力平均值集合为空");
} else{ } else{
@ -283,9 +290,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
governAvg.forEach(avg -> { governAvg.forEach(avg -> {
List<SampleValue> index1SampleValues = new ArrayList<>(); List<SampleValue> index1SampleValues = new ArrayList<>();
avg.forEach(c -> { avg.forEach(c -> {
pid.put(c.getParentId(),customerAgencyDao.selectPid(c.getParentId())); if (!c.getParentId().equals(NumConstant.ZERO_STR)) {
SampleValue s = new SampleValue(c.getParentId(), c.getScore()); pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId()));
index1SampleValues.add(s); SampleValue s = new SampleValue(c.getParentId(), c.getScore());
index1SampleValues.add(s);
}
}); });
BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc);
@ -294,6 +303,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
} }
} else if (IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode().equals(detail.getIndexCode())){ } else if (IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode().equals(detail.getIndexCode())){
List<SubAgencyScoreAvgResultDTO> deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); List<SubAgencyScoreAvgResultDTO> deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
for (int i = 0; i < deptScoreAvgList.size(); i++) {
if (deptScoreAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){
deptScoreAvgList.remove(deptScoreAvgList.get(i));
}
}
if (CollectionUtils.isEmpty(deptScoreAvgList)) { if (CollectionUtils.isEmpty(deptScoreAvgList)) {
log.error("查询所有直属部门治理能力平均值集合为空"); log.error("查询所有直属部门治理能力平均值集合为空");
} else{ } else{
@ -343,6 +357,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
String indexCode = detail.getIndexCode(); String indexCode = detail.getIndexCode();
if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) {
List<SubAgencyScoreAvgResultDTO> subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); List<SubAgencyScoreAvgResultDTO> subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL);
for (int i = 0; i < subStreetAvgList.size(); i++) {
if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){
subStreetAvgList.remove(subStreetAvgList.get(i));
}
}
if (CollectionUtils.isEmpty(subStreetAvgList)) { if (CollectionUtils.isEmpty(subStreetAvgList)) {
log.error("查询区下属街道服务能力汇总平均值集合为空"); log.error("查询区下属街道服务能力汇总平均值集合为空");
} else{ } else{
@ -352,9 +371,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
List<SampleValue> index1SampleValues = new ArrayList<>(); List<SampleValue> index1SampleValues = new ArrayList<>();
serviceAvg.forEach(c -> { serviceAvg.forEach(c -> {
pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); if (!c.getParentId().equals(NumConstant.ZERO_STR)) {
SampleValue s = new SampleValue(c.getParentId(), c.getScore()); pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId()));
index1SampleValues.add(s); SampleValue s = new SampleValue(c.getParentId(), c.getScore());
index1SampleValues.add(s);
}
}); });
IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1);
indexInputVOS.add(index1VO); indexInputVOS.add(index1VO);

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java

@ -641,11 +641,15 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService {
List<ScreenCustomerAgencyEntity> parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId); List<ScreenCustomerAgencyEntity> parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId);
int j = 0; int j = 0;
for(Map.Entry<String,List<AgencyScoreDTO>> agencyScore : collect.entrySet()){ for(Map.Entry<String,List<AgencyScoreDTO>> agencyScore : collect.entrySet()){
if (NumConstant.ZERO_STR.equals(agencyScore.getKey())) {
log.warn("insertIndexDataMonthlyByAgencyScore agencyyId is 0");
continue;
}
IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO();
// 给4个指数 赋默认值 // 给4个指数 赋默认值
monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO);
for ( int i = 0; i < agencyScore.getValue().size(); i++){ for (int i = 0; i < agencyScore.getValue().size(); i++) {
if (NumConstant.ONE_STR.equals(agencyScore.getValue().get(i).getIsTotal())){ if (NumConstant.ONE_STR.equals(agencyScore.getValue().get(i).getIsTotal())) {
// 是总分 总指数 = IS_TOTAL = 1 // 是总分 总指数 = IS_TOTAL = 1
monthlyFormDTO.setIndexTotal(agencyScore.getValue().get(i).getScore()); monthlyFormDTO.setIndexTotal(agencyScore.getValue().get(i).getScore());
} else { } else {

3
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<ScreenDifficult
/** /**
* @Description 数据清洗 * @Description 数据清洗
* @param customerId
* @param difficulties * @param difficulties
* @return void * @return void
* @author wangc * @author wangc
* @date 2020.09.28 11:04 * @date 2020.09.28 11:04
*/ */
void dataClean(List<ScreenDifficultyDataEntity> difficulties, List<ScreenDifficultyImgDataEntity> imgs); void dataClean(String customerId,List<ScreenDifficultyDataEntity> difficulties, List<ScreenDifficultyImgDataEntity> imgs);
} }

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

@ -21,6 +21,7 @@ package com.epmet.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.screen.ScreenDifficultyDataDao; import com.epmet.dao.evaluationindex.screen.ScreenDifficultyDataDao;
import com.epmet.dto.screen.result.DifficultyIfExistedResultDTO; import com.epmet.dto.screen.result.DifficultyIfExistedResultDTO;
@ -28,8 +29,11 @@ import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenDifficultyDataService; import com.epmet.service.evaluationindex.screen.ScreenDifficultyDataService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* 基层治理-难点堵点(耗时最长|设计部门最多|处理次数) * 基层治理-难点堵点(耗时最长|设计部门最多|处理次数)
@ -53,7 +57,17 @@ public class ScreenDifficultyDataServiceImpl extends BaseServiceImpl<ScreenDiffi
} }
@Override @Override
public void dataClean(List<ScreenDifficultyDataEntity> difficulties,List<ScreenDifficultyImgDataEntity> imgs) { @Transactional(rollbackFor = Exception.class)
public void dataClean(String customerId,List<ScreenDifficultyDataEntity> difficulties,List<ScreenDifficultyImgDataEntity> 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);
}
baseDao.updateTime(customerId, DateUtils.getBeforeNDay(NumConstant.ONE));
} }
} }

11
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.commons.mybatis.service.BaseService;
import com.epmet.dto.project.FinishOrgDTO; import com.epmet.dto.project.FinishOrgDTO;
import com.epmet.dto.project.ProcessInfoDTO; 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.ProjectOrgPeriodResultDTO;
import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectEntity;
import com.epmet.entity.project.ProjectProcessEntity; import com.epmet.entity.project.ProjectProcessEntity;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 项目处理进展表 * 项目处理进展表
@ -102,5 +104,14 @@ public interface ProjectProcessService extends BaseService<ProjectProcessEntity>
*/ */
List<FinishOrgDTO> getFinishOrg(String customerId, String date); List<FinishOrgDTO> getFinishOrg(String customerId, String date);
/**
* @Description 获得项目最新操作
* @param list
* @param customerId
* @return java.util.Map<java.lang.String,java.lang.String>
* @author wangc
* @date 2020.09.28 14:44
*/
Map<String,String> selectLatestOperation(List<String> list, String customerId);
} }

21
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.form.CommonStaffIdFormDTO;
import com.epmet.dto.project.FinishOrgDTO; import com.epmet.dto.project.FinishOrgDTO;
import com.epmet.dto.project.ProcessInfoDTO; 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.ProjectOrgPeriodResultDTO;
import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO; import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO;
import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectEntity;
@ -36,6 +37,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.util.*; import java.util.*;
import java.util.stream.Collector;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -123,6 +125,25 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl<ProjectProcessDao
return baseDao.selectFinishOrg(customerId, date); return baseDao.selectFinishOrg(customerId, date);
} }
/**
* @Description 获得项目最新操作
* @param list
* @param customerId
* @return java.util.Map<java.lang.String,java.lang.String>
* @author wangc
* @date 2020.09.28 14:44
*/
@Override
public Map<String, String> selectLatestOperation(List<String> list, String customerId) {
List<ProjectLatestOperationResultDTO> 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. * @Description 跨级分组 eg -> transfer ; response response transfer ; return ; response close.
* @param dest - Map<String,List<ProjectOrgPeriodResultDTO>> 需要填充的数据 * @param dest - Map<String,List<ProjectOrgPeriodResultDTO>> 需要填充的数据

21
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.AgencySubTreeDto;
import com.epmet.dto.extract.result.TopicInfoResultDTO; 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.DimTopicStatusDTO;
import com.epmet.dto.stats.topic.result.TopicStatisticalData; import com.epmet.dto.stats.topic.result.TopicStatisticalData;
import com.epmet.dto.topic.ResiTopicDTO; import com.epmet.dto.topic.ResiTopicDTO;
import com.epmet.dto.topic.TopicOriginInfoDTO; import com.epmet.dto.topic.TopicOriginInfoDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity;
import com.epmet.util.DimIdGenerator; import com.epmet.util.DimIdGenerator;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @Author wangc * @Author wangc
@ -62,4 +65,22 @@ public interface TopicService {
* @Date 2020/9/23 17:51 * @Date 2020/9/23 17:51
**/ **/
List<TopicOriginInfoDTO> queryUpdateTopicOriginInfoList(String customerId, String updateDateId); List<TopicOriginInfoDTO> queryUpdateTopicOriginInfoList(String customerId, String updateDateId);
/**
* @Description 查询话题项目的图片
* @param list
* @return java.util.Map<java.lang.String,java.util.List<com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity>>
* @author wangc
* @date 2020.09.28 15:57
*/
Map<String,List<ScreenDifficultyImgDataEntity>> getTopicImgs(List<ProjectSourceMapFormDTO> list);
/**
* @Description 得到话题项目内容
* @param list
* @return java.util.Map<java.lang.String,java.lang.String>
* @author wangc
* @date 2020.09.28 16:28
*/
Map<String,String> getTopicContent(List<ProjectSourceMapFormDTO> list);
} }

54
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.dao.topic.TopicDao;
import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.extract.result.TopicInfoResultDTO; 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.DimTopicStatusDTO;
import com.epmet.dto.stats.topic.*; import com.epmet.dto.stats.topic.*;
import com.epmet.dto.stats.topic.result.GroupTopicData; 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.ResiGroupTopicResultDTO;
import com.epmet.dto.topic.result.ResiTopicOperationResultDTO; import com.epmet.dto.topic.result.ResiTopicOperationResultDTO;
import com.epmet.dto.topic.result.ResiTopicResultDTO; import com.epmet.dto.topic.result.ResiTopicResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity;
import com.epmet.service.topic.TopicService; import com.epmet.service.topic.TopicService;
import com.epmet.service.user.impl.UserServiceImpl; import com.epmet.service.user.impl.UserServiceImpl;
import com.epmet.util.DimIdGenerator; import com.epmet.util.DimIdGenerator;
@ -24,10 +27,12 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.NumberFormat; import java.text.NumberFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collector;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -126,6 +131,55 @@ public class TopicServiceImpl implements TopicService {
return topicDao.queryUpdateTopicOriginInfoList(customerId,updateDateId); return topicDao.queryUpdateTopicOriginInfoList(customerId,updateDateId);
} }
/**
* @Description 查询话题的图片
* @param list
* @return java.util.Map<java.lang.String,java.util.List<com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity>>
* @author wangc
* @date 2020.09.28 15:57
*/
@Override
public Map<String,List<ScreenDifficultyImgDataEntity>> getTopicImgs(List<ProjectSourceMapFormDTO> list) {
if(CollectionUtils.isEmpty(list)) return Collections.EMPTY_MAP;
List<ScreenDifficultyImgDataEntity> imgs = topicDao.selectTopicImgs(list);
if(CollectionUtils.isEmpty(imgs)) return Collections.EMPTY_MAP;
//key -> topicId | value -> projectId
Map<String,String> projectTopicMap = list.stream().collect(Collectors.toMap(ProjectSourceMapFormDTO :: getSourceId,ProjectSourceMapFormDTO :: getProjectId));
//key -> topicId
Map<String,List<ScreenDifficultyImgDataEntity>> result
= imgs.stream().collect(Collectors.groupingBy(ScreenDifficultyImgDataEntity :: getEventId));
Map<String,List<ScreenDifficultyImgDataEntity>> 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<java.lang.String,java.lang.String>
* @author wangc
* @date 2020.09.28 16:28
*/
@Override
public Map<String, String> getTopicContent(List<ProjectSourceMapFormDTO> list) {
if(CollectionUtils.isEmpty(list)) return Collections.EMPTY_MAP;
List<TopicContentResultDTO> contents = topicDao.selectTopicContent(list);
if(CollectionUtils.isEmpty(contents)) return Collections.EMPTY_MAP;
Map<String,String> topicContentMap = contents.stream().collect(Collectors.toMap(TopicContentResultDTO :: getTopicId,TopicContentResultDTO::getContent));
//key -> topicId | value -> projectId
Map<String,String> projectTopicMap = list.stream().collect(Collectors.toMap(ProjectSourceMapFormDTO :: getSourceId,ProjectSourceMapFormDTO :: getProjectId));
Map<String,String> result = new HashMap<>();
projectTopicMap.forEach((topic,project) -> {
result.put(project,topicContentMap.get(topic));
});
return result;
}
/** /**
* @Description 初始化机关-所有下级网格Map * @Description 初始化机关-所有下级网格Map

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

@ -405,14 +405,18 @@
</select> </select>
<!-- 查询当天新立的项目,是为了增量新增难点赌点的图片库 --> <!-- 查询当天新立的项目,是为了增量新增难点赌点的图片库 -->
<select id="selectNewProject" resultType="string"> <select id="selectNewProject" resultType="com.epmet.dto.screen.form.ProjectSourceMapFormDTO">
SELECT SELECT
ID ID as projectId,
TOPIC_ID as gridId
FROM FROM
fact_origin_project_main_daily fact_origin_project_main_daily
WHERE WHERE
CUSTOMER_ID = #{customerId} CUSTOMER_ID = #{customerId}
AND <if test='null != list and "" != list.size() > 0'>
DATE_ID = #{dateId} <foreach collection="list" item="projectId" open="AND ( " separator=" OR " close=" )">
ID = #{projectId}
</foreach>
</if>
</select> </select>
</mapper> </mapper>

10
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml

@ -101,13 +101,15 @@
PARENT_AGENCY_ID AS parentId PARENT_AGENCY_ID AS parentId
FROM FROM
fact_index_agency_score fics fact_index_agency_score fics
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = fics.PARENT_AGENCY_ID
WHERE WHERE
fics.del_flag = '0' fics.del_flag = '0'
AND fics.customer_id = #{customerId} AND sca.level = 'district'
AND fics.month_id = #{monthId} AND fics.customer_id = #{customerId}
AND fics.index_code = #{indexCode} AND fics.month_id = #{monthId}
AND fics.index_code = #{indexCode}
AND fics.DATA_TYPE = #{dataType} AND fics.DATA_TYPE = #{dataType}
GROUP BY fics.parent_agency_id GROUP BY fics.parent_agency_id
</select> </select>

1
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml

@ -83,6 +83,7 @@
WHERE WHERE
fics.del_flag = '0' fics.del_flag = '0'
AND sca.DEL_FLAG = 0 AND sca.DEL_FLAG = 0
AND sca.level = 'street'
AND fics.customer_id = #{customerId} AND fics.customer_id = #{customerId}
AND fics.month_id = #{monthId} AND fics.month_id = #{monthId}
AND fics.index_code = #{indexCode} AND fics.index_code = #{indexCode}

3
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml

@ -135,10 +135,11 @@
sca.pid AS parentId sca.pid AS parentId
FROM FROM
fact_index_grid_score figc fact_index_grid_score figc
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = figc.AGENCY_ID LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = figc.AGENCY_ID
WHERE WHERE
figc.del_flag = '0' figc.del_flag = '0'
AND sca.DEL_FLAG = 0 AND sca.DEL_FLAG = 0
AND sca.level = 'community'
AND figc.customer_id = #{customerId} AND figc.customer_id = #{customerId}
AND figc.month_id = #{monthId} AND figc.month_id = #{monthId}
AND figc.index_code = #{indexCode} AND figc.index_code = #{indexCode}

117
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml

@ -98,4 +98,121 @@
AND AND
CUSTOMER_ID = #{customerId} CUSTOMER_ID = #{customerId}
</update> </update>
<delete id="deleteBatchDifficulty" parameterType="java.util.List">
DELETE
FROM screen_difficulty_data
WHERE
CUSTOMER_ID = #{customerId}
<if test="null != list and list.size() > 0">
<foreach collection="list" item="projectId" open="AND( " separator=" OR " close=")">
EVENT_ID = #{projectId}
</foreach>
</if>
</delete>
<delete id="deleteBatchDifficultyImg" parameterType="java.util.List">
DELETE
FROM screen_difficulty_img_data
<where>
<foreach collection="list" item="projectId" separator=" OR ">
EVENT_ID = #{projectId}
</foreach>
</where>
</delete>
<insert id="insertBatch" parameterType="list">
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
<foreach collection="list" item="item" index="index" separator=",">
(
(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}
)
</foreach>
</insert>
<insert id="insertBatchImg" parameterType="list">
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
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{item.eventId},
#{item.eventImgUrl},
#{item.sort},
0,
0,
'CRAWLER_ROBOT',
now(),
'CRAWLER_ROBOT',
now()
)
</foreach>
</insert>
</mapper> </mapper>

13
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml

@ -213,4 +213,17 @@
</select> </select>
<select id="selectTopicAttachments" resultType="com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity">
SELECT
ATTACHMENT_URL AS eventImgUrl,
SORT
FROM
resi_topic_attachment
WHERE
DEL_FLAG = '0'
</select>
</mapper> </mapper>

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

@ -59,7 +59,7 @@
</if> </if>
</select> </select>
<select id="selectSatisfactionRecordByCustomer" resultType="com.epmet.dto.project.ProcessInfoDTO"> <select id="selectSatisfactionRecordByCustomer" resultType="com.epmet.dto.project.ProcessInfoDTO">
SELECT SELECT DISTINCT
p.AGENCY_ID, p.AGENCY_ID,
psd.PROJECT_ID, psd.PROJECT_ID,
psd.SATISFACTION AS "operation", psd.SATISFACTION AS "operation",
@ -69,7 +69,7 @@
FROM project_satisfaction_detail psd FROM project_satisfaction_detail psd
INNER JOIN project p ON psd.PROJECT_ID = p.ID INNER JOIN project p ON psd.PROJECT_ID = p.ID
LEFT JOIN project_related_personnel resiuser ON psd.PROJECT_ID = resiuser.PROJECT_ID LEFT JOIN project_related_personnel resiuser ON psd.PROJECT_ID = resiuser.PROJECT_ID
AND resiuser.APP = 'resi' AND resiuser.USER_ID = psd.CREATED_BY AND resiuser.APP = 'resi'
WHERE p.CUSTOMER_ID = #{customerId} WHERE p.CUSTOMER_ID = #{customerId}
<if test="date != null and date.trim() != ''"> <if test="date != null and date.trim() != ''">
AND DATE_FORMAT(psd.CREATED_TIME, '%Y%m%d') = #{date} AND DATE_FORMAT(psd.CREATED_TIME, '%Y%m%d') = #{date}
@ -189,8 +189,21 @@
) b ON a.PROJECT_ID = b.PROJECT_ID ) b ON a.PROJECT_ID = b.PROJECT_ID
</select> </select>
<!-- 查找项目最近一次操作说明 -->
<select id="selectLatestOperation" resultType="com.epmet.dto.project.result.ProjectLatestOperationResultDTO"> <select id="selectLatestOperation" resultType="com.epmet.dto.project.result.ProjectLatestOperationResultDTO">
SELECT
process.PROJECT_ID,
process.OPERATION_NAME
FROM
project_process process
WHERE
process.DEL_FLAG = '0'
<if test="null != list and list.size() > 0">
<foreach collection="list" item="projectId" open="AND (" separator=" OR " close=" )">
process.PROJECT_ID = #{projectId}
</foreach>
</if>
GROUP BY process.PROJECT_ID
ORDER BY process.CREATED_TIME DESC
</select> </select>
</mapper> </mapper>

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

@ -215,4 +215,30 @@
where rt.del_flag='0' where rt.del_flag='0'
and DATE_FORMAT( rt.UPDATED_TIME, '%Y%m%d' )=#{dateId} and DATE_FORMAT( rt.UPDATED_TIME, '%Y%m%d' )=#{dateId}
</select> </select>
<select id="selectTopicImgs" resultType="com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity">
SELECT
TOPIC_ID AS eventId
ATTACHMENT_URL AS eventImgUrl,
SORT
FROM
resi_topic_attachment
WHERE
DEL_FLAG = '0'
<foreach collection="list" item="item" open="AND (" separator=" OR " close=")">
TOPIC_ID = {item.topicId}
</foreach>
ORDER BY TOPIC_ID , SORT ASC
</select>
<select id="selectTopicContent" resultType="com.epmet.dto.group.result.TopicContentResultDTO">
SELECT
TOPIC_ID,
TOPIC_CONTENT AS content
FROM RESI_TOPIC
WHERE DEL_FLAG = '0'
<foreach collection="list" item="item" open="AND (" separator=" OR " close=")">
TOPIC_ID = {item.topicId}
</foreach>
</select>
</mapper> </mapper>
Loading…
Cancel
Save