From 141a414a2b4da759a0b43fb5cf70163bbb1012d5 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 28 Sep 2020 14:01:42 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=9C=80=E5=A4=A7=E5=80=BC=E6=9C=80?= =?UTF-8?q?=E5=B0=8F=E5=80=BC=E5=8A=A0=E4=B8=8A=E4=BA=86=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/result/MaxAndMinBigDecimalResultDTO.java | 5 +++++ .../impl/IndexCalculateCommunityServiceImpl.java | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinBigDecimalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinBigDecimalResultDTO.java index aa9f471405..d5ca95dab8 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinBigDecimalResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinBigDecimalResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.screen.result; +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import java.io.Serializable; @@ -18,4 +19,8 @@ public class MaxAndMinBigDecimalResultDTO implements Serializable { private BigDecimal max; + public MaxAndMinBigDecimalResultDTO() { + this.min = new BigDecimal(NumConstant.ZERO); + this.max = new BigDecimal(NumConstant.ZERO); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java index 5d9523550c..dfc2426e33 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java @@ -451,11 +451,13 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni * @date 2020/8/27 1:30 下午 */ public MaxAndMinBigDecimalResultDTO getMaxAndMinBigDecimal(List list) { - BigDecimal max = Collections.max(list); - BigDecimal min = Collections.min(list); MaxAndMinBigDecimalResultDTO result = new MaxAndMinBigDecimalResultDTO(); - result.setMax(max); - result.setMin(min); + if(!CollectionUtils.isEmpty(list)) { + BigDecimal max = Collections.max(list); + BigDecimal min = Collections.min(list); + result.setMax(max); + result.setMin(min); + } return result; } From a15f3bbcd4d4bfac2232277732b3336787d0b67e Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 28 Sep 2020 14:07:21 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IndexCalculateCommunityServiceImpl.java | 39 +++++++++--------- .../IndexCalculateDistrictServiceImpl.java | 41 ++++++++++--------- .../impl/IndexCalculateStreetServiceImpl.java | 39 +++++++++--------- 3 files changed, 61 insertions(+), 58 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java index dfc2426e33..e327b30fab 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java @@ -224,27 +224,28 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni // 社区名义发文数量 List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); if (CollectionUtils.isEmpty(publishArticleCountList)) { - log.error(IndexCalConstant.COMMUNITY_PUBLISH_ARTICLE_LIST_NULL); - } - String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); - if (StringUtils.isEmpty(fieldNameByIndexCode)) { - log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); - return; + log.warn(IndexCalConstant.COMMUNITY_PUBLISH_ARTICLE_LIST_NULL); } else { - List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); - MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); - List>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE); - publishArticleList.forEach(publish -> { - ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); - List index1SampleValues = new ArrayList<>(); - publish.forEach(c -> { - pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); - SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); - index1SampleValues.add(s); + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); + return; + } else { + List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE); + publishArticleList.forEach(publish -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); - indexInputVOS.add(index1VO); - }); + } } } }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java index 80163e8646..4f522f80e7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -222,27 +222,28 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict // 区名义发文数量 List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.DISTRICT_LEVEL); if (CollectionUtils.isEmpty(publishArticleCountList)) { - log.error(IndexCalConstant.DISTRICT_PUBLISH_ARTICLE_LIST_NULL); - } - String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); - if (StringUtils.isEmpty(fieldNameByIndexCode)) { - log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); - return; - } else{ - List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); - MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); - List>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE); - publishArticleList.forEach(publish -> { - ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); - List index1SampleValues = new ArrayList<>(); - publish.forEach(c -> { - pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); - SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); - index1SampleValues.add(s); + log.warn(IndexCalConstant.DISTRICT_PUBLISH_ARTICLE_LIST_NULL); + } else { + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); + return; + } else { + List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE); + publishArticleList.forEach(publish -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); - indexInputVOS.add(index1VO); - }); + } } } }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java index 88d329ca6b..b33ef6f2c3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java @@ -226,26 +226,27 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ // 街道名义发文数量 List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId, IndexCalConstant.STREET_LEVEL); if (CollectionUtils.isEmpty(mapList)) { - log.error(IndexCalConstant.STREET_PUBLISH_ARTICLE_LIST_NULL); - } - String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); - if (StringUtils.isEmpty(fieldName)) { - log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); - return; - }else{ - MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(mapList.stream().map(m -> new BigDecimal(m.get(fieldName).toString())).collect(Collectors.toList())); - List>> publishArticleList = ListUtils.partition(mapList, IndexCalConstant.PAGE_SIZE); - publishArticleList.forEach(publish -> { - ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); - List index1SampleValues = new ArrayList<>(); - publish.forEach(c -> { - pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); - SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldName)))); - index1SampleValues.add(s); + log.warn(IndexCalConstant.STREET_PUBLISH_ARTICLE_LIST_NULL); + } else { + String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldName)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); + return; + } else { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(mapList.stream().map(m -> new BigDecimal(m.get(fieldName).toString())).collect(Collectors.toList())); + List>> publishArticleList = ListUtils.partition(mapList, IndexCalConstant.PAGE_SIZE); + publishArticleList.forEach(publish -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldName)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); - indexInputVOS.add(index1VO); - }); + } } } }); From e503d740f9b3d2f2feb9878463b5c47b3a653398 Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 28 Sep 2020 14:14:26 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=8A=BD=E5=8F=96=E5=B0=8F=E7=BB=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AEduplicateKey=E9=97=AE=E9=A2=98=E8=A7=A3?= =?UTF-8?q?=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/DifficultyIfExistedResultDTO.java | 27 ++++++++++++++++++ .../FactOriginProjectMainDailyDao.java | 11 +++++++- .../screen/ScreenDifficultyDataDao.java | 28 +++++++++++++++++++ .../screen/ScreenDifficultyImgDataEntity.java | 27 ++++++++++++++++++ .../FactOriginProjectMainDailyService.java | 11 ++++++++ .../FactOriginGroupMainDailyServiceImpl.java | 5 ++-- ...FactOriginProjectMainDailyServiceImpl.java | 15 +++++++++- ...srootsGovernDataAbsorptionServiceImpl.java | 19 ++++++++++++- .../screen/ScreenDifficultyDataService.java | 23 +++++++++++++++ .../impl/ScreenDifficultyDataServiceImpl.java | 22 +++++++++++++++ .../extract/FactOriginProjectMainDailyDao.xml | 12 ++++++++ .../screen/ScreenDifficultyDataDao.xml | 28 +++++++++++++++++++ 12 files changed, 222 insertions(+), 6 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/DifficultyIfExistedResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyImgDataEntity.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/DifficultyIfExistedResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/DifficultyIfExistedResultDTO.java new file mode 100644 index 0000000000..fe9004f8bf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/DifficultyIfExistedResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 判断难点赌点是否有数据的返回DTO + * @ClassName DifficultyIfExistedResultDTO + * @Auth wangc + * @Date 2020-09-28 10:45 + */ +@Data +public class DifficultyIfExistedResultDTO implements Serializable { + private static final long serialVersionUID = -2278401165059196896L; + + /** + * 是否有数据 true false + */ + private boolean ifExisted = false; + + /** + * 已经结案的项目Id集合 + */ + private List closedIds; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java index b557db6d13..3d90e26dc3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java @@ -179,7 +179,16 @@ public interface FactOriginProjectMainDailyDao extends BaseDao selectDifficultyBaseInfo(@Param("customerId")String customerId,@Param("list")List list); - + + /** + * @Description 查询评价周期内新立的项目,是为了增量新增难点赌点的图片库 + * @param customerId + * @param dateId + * @return java.util.List + * @author wangc + * @date 2020.09.28 11:15 + */ + List selectNewProject(@Param("customerId") String customerId, @Param("dateId")String dateId); /** * 网格解决项目数 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java index d6dfeac5f8..2a8bfdac18 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java @@ -54,4 +54,32 @@ public interface ScreenDifficultyDataDao extends BaseDao list, @Param("customerId")String customerId); + + + /** + * @Description 根据customerId查询是否有难点赌点的数据 + * @param customerId + * @return int + * @author wangc + * @date 2020.09.28 13:29 + */ + int selectCountByCustomerId(@Param("customerId")String customerId); + + /** + * @Description 查找库中已经存在的结案项目Id + * @param customerId + * @return java.util.List + * @author wangc + * @date 2020.09.28 13:44 + */ + List selectClosedProjectId(@Param("customerId")String customerId); + + /** + * @Description 全量更新DATA_END_TIME + * @param customerId + * @return int + * @author wangc + * @date 2020.09.28 13:46 + */ + int updateTime(@Param("customerId")String customerId,@Param("dateId")String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyImgDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyImgDataEntity.java new file mode 100644 index 0000000000..1f6da889b1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyImgDataEntity.java @@ -0,0 +1,27 @@ +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + + +/** + * @Description 难点赌点 图片列表 + * @ClassName ScreenDifficultyImgDataEntity + * @Auth wangc + * @Date 2020-09-28 10:57 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_difficulty_img_data") +public class ScreenDifficultyImgDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + private String eventId; + + private String eventImgUrl; + + private Integer sort; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index ad8d1dd256..96e40c8a50 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -24,6 +24,7 @@ import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; +import com.mysql.cj.x.protobuf.MysqlxDatatypes; import java.util.List; import java.util.Map; @@ -248,4 +249,14 @@ public interface FactOriginProjectMainDailyService extends BaseService getDifficultyBaseInfo(String customerId , List list); + + /** + * @Description 得到评价周期内新立项的id + * @param customerId + * @param dateId + * @return java.util.List + * @author wangc + * @date 2020.09.28 14:10 + */ + List getNewProjectId(String customerId,String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java index 4c5afda59a..093905835b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java @@ -89,13 +89,12 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl getDifficultyBaseInfo(String customerId, List list) { - return null; + return baseDao.selectDifficultyBaseInfo(customerId,list); + } + + /** + * @Description 得到评价周期内新立项的id + * @param customerId + * @param dateId + * @return java.util.List + * @author wangc + * @date 2020.09.28 14:10 + */ + @Override + public List getNewProjectId(String customerId, String dateId) { + return baseDao.selectNewProject(customerId,dateId); } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java index 317c953f55..3377539339 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java @@ -5,10 +5,13 @@ import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dto.org.GridInfoDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; +import com.epmet.dto.screen.result.DifficultyIfExistedResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import com.epmet.service.evaluationindex.extract.toscreen.ScreenGrassrootsGovernDataAbsorptionService; import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService; +import com.epmet.service.evaluationindex.screen.ScreenDifficultyDataService; import com.epmet.service.evaluationindex.screen.ScreenPartyUserRankDataService; import com.epmet.service.org.CustomerGridService; import com.epmet.service.point.UserPointService; @@ -46,6 +49,10 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr private CpcIndexCalculateService cpcIndexCalculateService; @Autowired private ScreenPartyUserRankDataService screenPartyUserRankDataService; + @Autowired + private ScreenDifficultyDataService screenDifficultyDataService; + @Autowired + private FactOriginProjectMainDailyService factOriginProjectMainDailyService; /** * @Description 用户积分、党员分值数据中转站 * @param param @@ -117,6 +124,16 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr **/ @Override public void difficultyDataHub(ScreenCentralZoneDataFormDTO param) { - ScreenDifficultyDataEntity entity = new ScreenDifficultyDataEntity(); + //验证是否存在 + DifficultyIfExistedResultDTO existedMap = screenDifficultyDataService.selectExistedInfo(param.getCustomerId()); + //查询数据 + List difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(),existedMap.getClosedIds()); + if(existedMap.isIfExisted()){ + //查询全部项目的图片 + + }else{ + //查询增量项目的图片 + List newProjectIds = factOriginProjectMainDailyService.getNewProjectId(param.getCustomerId(),param.getDateId()); + } } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java index 7bdabd1d3a..f2779698f1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java @@ -18,7 +18,11 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.screen.result.DifficultyIfExistedResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity; + +import java.util.List; /** * 基层治理-难点堵点(耗时最长|设计部门最多|处理次数) @@ -28,4 +32,23 @@ import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; */ public interface ScreenDifficultyDataService extends BaseService { + /** + * @Description 查询数据库中是否有该客户下的难点赌点信息 + * @param customerId + * @return com.epmet.dto.screen.result.DifficultyIfExistedResultDTO + * @author wangc + * @date 2020.09.28 10:53 + */ + DifficultyIfExistedResultDTO selectExistedInfo(String customerId); + + + /** + * @Description 数据清洗 + * @param difficulty + * @return void + * @author wangc + * @date 2020.09.28 11:04 + */ + void dataClean(List difficulty, List img); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java index a79cf72d10..fd34a6376c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java @@ -18,12 +18,19 @@ package com.epmet.service.evaluationindex.screen.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.screen.ScreenDifficultyDataDao; +import com.epmet.dto.screen.result.DifficultyIfExistedResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity; import com.epmet.service.evaluationindex.screen.ScreenDifficultyDataService; import org.springframework.stereotype.Service; +import java.util.List; + /** * 基层治理-难点堵点(耗时最长|设计部门最多|处理次数) * @@ -31,7 +38,22 @@ import org.springframework.stereotype.Service; * @since v1.0.0 2020-09-22 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class ScreenDifficultyDataServiceImpl extends BaseServiceImpl implements ScreenDifficultyDataService { + @Override + public DifficultyIfExistedResultDTO selectExistedInfo(String customerId) { + int count = baseDao.selectCountByCustomerId(customerId); + DifficultyIfExistedResultDTO existedMap = new DifficultyIfExistedResultDTO(); + if(count <= NumConstant.ZERO) {existedMap.setIfExisted(true);} + else{existedMap.setClosedIds(baseDao.selectClosedProjectId(customerId));} + + return existedMap; + } + + @Override + public void dataClean(List difficulty,List img) { + + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index 8b870a8d14..38574e143a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -403,4 +403,16 @@ + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml index 051f14cbcf..101740c18e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml @@ -70,4 +70,32 @@ + + + + + + + + UPDATE + screen_difficulty_data + SET + DATA_END_TIME = #{dateId} + WHERE + DEL_FLAG = '0' + AND + CUSTOMER_ID = #{customerId} +