From 81ac10db52e1b84fee2bd132addefcba70cf2b1e Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 15 Sep 2020 19:32:21 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CpcIndexCalculateServiceImpl.java | 50 ++++++++----------- 1 file changed, 20 insertions(+), 30 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java index 149cc45bd7..3189c554dc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -41,6 +41,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; @Slf4j @@ -82,28 +83,18 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { int pageSize = IndexCalConstant.PAGE_SIZE; List list = null; - Map preLastCpcScoreTotalMap = new HashMap<>(); - //当前最后一条记录 - //CpcScoreEntity currentLastCpcScore = null; - //当前第一条记录 - //CpcScoreEntity currentFirstCpcScore = null; + Map cpcScoreTotalMap = new HashMap<>(); + Map userTotalCount = new HashMap<>(); + //删除总分 然后插入 + cpcScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCalConstant.DELETE_SIZE, NumConstant.ONE_STR); do { - Map cpcScoreTotalMap = new HashMap<>(); + List result = new ArrayList<>(); //获取数据 list = cpcScoreDao.getPartScore(formDTO.getCustomerId(), formDTO.getMonthId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), (pageNo - NumConstant.ONE) * pageSize, pageSize); pageNo++; if (CollectionUtils.isEmpty(list)) { log.warn("calculateTotalScore cpcScoreDao.getPartScore return empty,customerId:{},monthId:{}", formDTO.getCustomerId(), formDTO.getMonthId()); } else { - //获取最后一条 - //currentLastCpcScore = list.get(list.size() - 1); - //获取第一条 - //currentFirstCpcScore = list.get(0); - /*if (preLastCpcScoreTotalMap.containsKey(currentFirstCpcScore.getUserId())) { - cpcScoreTotalMap.putAll(preLastCpcScoreTotalMap); - preLastCpcScoreTotalMap.clear(); - preLastCpcScoreTotalMap.put(currentLastCpcScore.getUserId(), null); - }*/ Map> userGroupMap = list.stream().collect(Collectors.groupingBy(CpcScoreEntity::getUserId)); userGroupMap.forEach((userId, partScoreList) -> { CpcScoreEntity totalEntity = null; @@ -121,27 +112,26 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { totalEntity.setAllParentIndexCode(NumConstant.ZERO_STR); totalEntity.setWeight(new BigDecimal(NumConstant.ONE_NEG)); cpcScoreTotalMap.put(userId, totalEntity); - - /* if (preLastCpcScoreTotalMap.containsKey(part.getUserId())) { - preLastCpcScoreTotalMap.put(part.getUserId(), part); - } else { - }*/ } //自建群活跃度——议题转项目率 有阈值 >60%按60%算 BigDecimal total = part.getScore().multiply(indexGroupDetailEntity.getWeight()); + AtomicInteger atomicInteger = userTotalCount.get(part.getUserId()); + + if (atomicInteger == null) { + atomicInteger = new AtomicInteger(0); + userTotalCount.put(part.getUserId(), atomicInteger); + } + int totalCount = atomicInteger.addAndGet(1); + //todo 次代码限制了 党员的 4级指标的个数 看看是否还有更好的方式 + if (totalCount == 3) { + result.add(totalEntity); + } log.info("userId:{},分数:{},权重:{},total:{}", userId, part.getScore(), indexGroupDetailEntity.getWeight(), total); totalEntity.setScore(totalEntity.getScore().add(total)); } }); } - - //没查询到数据 就把上次的放进去 - if (list == null || list.size() < pageSize || !CollectionUtils.isEmpty(preLastCpcScoreTotalMap)) { - cpcScoreTotalMap.putAll(preLastCpcScoreTotalMap); - } - //删除总分 然后插入 - cpcScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCalConstant.DELETE_SIZE, NumConstant.ONE_STR); - insertCpcScoreBatch(formDTO, cpcScoreTotalMap.values().stream().collect(Collectors.toList()), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); + insertCpcScoreBatch(formDTO, result, IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); } while (!CollectionUtils.isEmpty(list)); } @@ -180,7 +170,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { */ public void insertCpcScoreBatch(CalculateCommonFormDTO formDTO, List values, String indexCode) { if (CollectionUtils.isEmpty(values)) { - log.error("insertCpcScoreBatch要插入的数据为空,param:{},indexCode:{}", JSON.toJSONString(formDTO), indexCode); + log.warn("insertCpcScoreBatch要插入的数据为空,param:{},indexCode:{}", JSON.toJSONString(formDTO), indexCode); return; } List> partition = ListUtils.partition(values, IndexCalConstant.INSERT_SIZE); @@ -338,7 +328,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { */ public void insertCpcSubScoreBatch(CalculateCommonFormDTO formDTO, List subList, String parentIndexCode) { if (CollectionUtils.isEmpty(subList)) { - log.error("insertCpcScoreBatch要插入的数据为空,param:{},indexCode:{}", JSON.toJSONString(formDTO), parentIndexCode); + log.warn("insertCpcScoreBatch要插入的数据为空,param:{},indexCode:{}", JSON.toJSONString(formDTO), parentIndexCode); return; } List> partition = ListUtils.partition(subList, IndexCalConstant.INSERT_SIZE); From 098c4d0e2e1beabc72f66c947a3c53deefb6e2ab Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 15 Sep 2020 20:58:45 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=80=BB=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcal/impl/CpcIndexCalculateServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java index 3189c554dc..9410e15d83 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -132,7 +132,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { }); } insertCpcScoreBatch(formDTO, result, IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); - } while (!CollectionUtils.isEmpty(list)); + } while (!CollectionUtils.isEmpty(list) && list.size() == pageSize); } From 3cb4d7e6e065b8c66f25475b3d4abe38c1cd6d08 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 16 Sep 2020 09:21:33 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E5=AD=94=E6=9D=91=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=87=AA=E6=B5=8B=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/bootstrap.yml | 1 + .../ScreenKcTopicTrendGridMonthlyDao.xml | 2 +- .../ScreenKcVolunteerSummaryDailyDao.xml | 32 ++++++++++++------- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index de94f499a2..323b2a7fca 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -442,6 +442,7 @@ epmet: urlWhiteList: - /data/report/test/test - /data/report/screen/** + - /data/report/screenkc/** - /epmetuser/customerstaff/customerlist swaggerUrls: diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcTopicTrendGridMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcTopicTrendGridMonthlyDao.xml index 5fed5bda9c..60f288f628 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcTopicTrendGridMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcTopicTrendGridMonthlyDao.xml @@ -16,7 +16,7 @@ del_flag = '0' and customer_id = #{customerId} and month_id = monthId - ) + ) "topicCount" FROM screen_kc_topic_trend_grid_monthly WHERE diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcVolunteerSummaryDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcVolunteerSummaryDailyDao.xml index 62f94e5d1f..d6a88821a2 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcVolunteerSummaryDailyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcVolunteerSummaryDailyDao.xml @@ -5,21 +5,31 @@ From 823c3570f03f4d3d58ebdab74a8f8e957f49ec6b Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 16 Sep 2020 10:42:56 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E4=B8=8B=E7=BA=A7=E7=BB=84=E7=BB=87/?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E6=8C=87=E6=95=B0=E6=8E=92=E8=A1=8C=20?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=20=20=20=E9=83=A8=E9=97=A8=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/datareport/controller/screen/IndexController.java | 2 +- .../dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java | 2 +- .../service/evaluationindex/screen/IndexService.java | 2 +- .../service/evaluationindex/screen/impl/IndexServiceImpl.java | 2 +- .../main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml | 3 ++- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java index fd3564c53b..6da1ba9359 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java @@ -67,8 +67,8 @@ public class IndexController { } /** - * @Description 4、下级部门指数排行 * @param subAgencyIndexRankFormDTO + * @Description 4、下级组织/部门指数排行 (不包含部门的数据) * @author zxc * @date 2020/8/20 10:02 上午 */ diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java index 3128862ece..cc6c9e9e2b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java @@ -54,8 +54,8 @@ public interface ScreenIndexDataMonthlyDao{ List selectMonthBarchart(@Param("agencyId")String agencyId); /** - * @Description 4、下级部门指数排行 * @param subAgencyIndexRankFormDTO + * @Description 4、下级组织/部门指数排行 (不包含部门的数据) * @author zxc * @date 2020/8/20 10:04 上午 */ diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java index 761d369b7a..4ff9cf0fd4 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java @@ -38,8 +38,8 @@ public interface IndexService { MonthBarchartResultDTO monthBarchart(MonthBarchartFormDTO monthBarchartFormDTO); /** - * @Description 4、下级部门指数排行 * @param subAgencyIndexRankFormDTO + * @Description 4、下级组织/部门指数排行 (不包含部门的数据) * @author zxc * @date 2020/8/20 10:04 上午 */ diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java index b0c9715031..651fa7484f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java @@ -179,8 +179,8 @@ public class IndexServiceImpl implements IndexService { } /** - * @Description 4、下级部门指数排行 * @param subAgencyIndexRankFormDTO + * @Description 4、下级组织/部门指数排行 (不包含部门的数据) * @author zxc * @date 2020/8/20 10:04 上午 */ diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 0a040c2ccb..57c70a403c 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -43,7 +43,7 @@ LIMIT 12 - + From c42e3b2377365e1cb881080de794503b49d0ee18 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 16 Sep 2020 11:02:40 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E5=B0=8F=E6=95=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/screen/impl/IndexServiceImpl.java | 8 ++++---- .../resources/mapper/screen/ScreenIndexDataMonthlyDao.xml | 7 ++----- .../resources/mapper/screen/ScreenIndexDataYearlyDao.xml | 8 +++----- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java index 651fa7484f..d090a4c00f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java @@ -57,7 +57,7 @@ public class IndexServiceImpl implements IndexService { yearAverageIndexResultDTO.setPartyDevAbility(getRound(yearAverageIndexResultDTO.getPartyDevAbility())); yearAverageIndexResultDTO.setGovernAbility(getRound(yearAverageIndexResultDTO.getGovernAbility())); yearAverageIndexResultDTO.setServiceAbility(getRound(yearAverageIndexResultDTO.getServiceAbility())); - yearAverageIndexResultDTO.setYearAverageIndex(getRound(yearAverageIndexResultDTO.getYearAverageIndex())); + yearAverageIndexResultDTO.setYearAverageIndex(yearAverageIndexResultDTO.getPartyDevAbility() + yearAverageIndexResultDTO.getGovernAbility() + yearAverageIndexResultDTO.getServiceAbility()); return yearAverageIndexResultDTO; } @@ -126,7 +126,7 @@ public class IndexServiceImpl implements IndexService { barchart.setPartyDevAbility(getRound(barchart.getPartyDevAbility())); barchart.setGovernAbility(getRound(barchart.getGovernAbility())); barchart.setServiceAbility(getRound(barchart.getServiceAbility())); - barchart.setIndexTotal(getRound(barchart.getIndexTotal())); + barchart.setIndexTotal(barchart.getPartyDevAbility() + barchart.getGovernAbility() + barchart.getServiceAbility()); }); List collect = monthBarchartResults.stream().sorted(Comparator.comparing(MonthBarchartResult::getMonthId)).collect(Collectors.toList()); //升序 当前月份在队尾 @@ -199,7 +199,7 @@ public class IndexServiceImpl implements IndexService { indexRank.setPartyDevAbility(getRound(indexRank.getPartyDevAbility())); indexRank.setGovernAbility(getRound(indexRank.getGovernAbility())); indexRank.setServiceAbility(getRound(indexRank.getServiceAbility())); - indexRank.setTotalIndex(getRound(indexRank.getTotalIndex())); + indexRank.setTotalIndex(indexRank.getPartyDevAbility() + indexRank.getGovernAbility() + indexRank.getServiceAbility()); }); return subAgencyIndexRankResultDTOS; } @@ -218,7 +218,7 @@ public class IndexServiceImpl implements IndexService { rank.setPartyDevAbility(getRound(rank.getPartyDevAbility())); rank.setGovernAbility(getRound(rank.getGovernAbility())); rank.setServiceAbility(getRound(rank.getServiceAbility())); - rank.setTotalIndex(getRound(rank.getTotalIndex())); + rank.setTotalIndex(rank.getPartyDevAbility() + rank.getGovernAbility() + rank.getServiceAbility()); }); } return subAgencyIndexRankResultDTOS; diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 57c70a403c..7766b5eadb 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -32,8 +32,7 @@ month_id AS monthId, service_ablity * SERVICE_ABLITY_WEIGHT AS serviceAbility, party_dev_ablity * PARTY_DEV_WEIGHT AS partyDevAbility, - govern_ablity * GOVERN_ABLITY_WEIGHT AS governAbility, - (service_ablity * SERVICE_ABLITY_WEIGHT + party_dev_ablity * PARTY_DEV_WEIGHT + govern_ablity * GOVERN_ABLITY_WEIGHT) AS indexTotal + govern_ablity * GOVERN_ABLITY_WEIGHT AS governAbility FROM screen_index_data_monthly WHERE @@ -47,7 +46,6 @@ SELECT - index_total AS yearAverageIndex, service_ablity AS serviceAbility, party_dev_ablity AS partyDevAbility, govern_ablity AS governAbility @@ -24,10 +23,9 @@ resultType="com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO"> SELECT org_name AS `NAME`, - ROUND(index_total, 1) AS totalIndex, - ROUND(govern_ablity, 1) AS governAbility, - ROUND(party_dev_ablity, 1) AS partyDevAbility, - ROUND(service_ablity, 1) AS serviceAbility, + govern_ablity AS governAbility, + party_dev_ablity AS partyDevAbility, + service_ablity AS serviceAbility, ORG_ID orgId FROM screen_index_data_yearly From cd217f203016f0941a993cf40670342c70fea20a Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 16 Sep 2020 13:01:16 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E5=B9=B3=E5=9D=87=E5=80=BC=E7=9A=84=20?= =?UTF-8?q?=E4=B8=8D=E9=9C=80=E8=A6=81=20=E5=86=8D=E6=AC=A1=E5=BD=92?= =?UTF-8?q?=E4=B8=80=E8=AE=A1=E7=AE=97=E4=BA=86=20=E5=8F=AA=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E4=B9=98=E4=BB=A5=E6=9D=83=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/eum/IndexCodeEnum.java | 77 ++++++++++++------- .../impl/CpcIndexCalculateServiceImpl.java | 3 +- .../indexcal/impl/DeptScoreServiceImpl.java | 1 + .../impl/GridCorreLationServiceImpl.java | 1 + .../IndexCalculateCommunityServiceImpl.java | 12 +-- .../IndexCalculateDistrictServiceImpl.java | 10 +-- .../impl/IndexCalculateStreetServiceImpl.java | 12 +-- .../batch/BatchScoreCalculator.java | 8 +- .../normalizing/batch/IndexInputVO.java | 5 ++ .../stats/test/normalizing/DemoScoreCal.java | 28 +++---- 10 files changed, 98 insertions(+), 59 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java index a49d1a1e13..04db895412 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java @@ -1,7 +1,5 @@ package com.epmet.eum; -import com.epmet.dto.indexcal.CalculateCommonFormDTO; - /** * 需要计算指标code枚举类 * @@ -9,43 +7,58 @@ import com.epmet.dto.indexcal.CalculateCommonFormDTO; * @date 2020-08-26 11:14 **/ public enum IndexCodeEnum { - DANG_YUAN_XIANG_GUAN("dangyuanxiangguan", "党员相关", 1), - WANG_GE_XIANG_GUAN("wanggexiangguan", "网格相关", 1), - SHE_QU_XIANG_GUAN("shequxiangguan", "社区相关", 1), - JIE_DAO_XIANG_GUAN("jiedaoxiangguan", "街道相关", 1), - QU_ZHI_BU_MEN("quzhibumen", "区直部门", 1), - QUAN_QU_XIANG_GUAN("quanquxiangguan", "全区相关", 1), + DANG_YUAN_XIANG_GUAN("dangyuanxiangguan", "党员相关", 1, false), + WANG_GE_XIANG_GUAN("wanggexiangguan", "网格相关", 1, false), + SHE_QU_XIANG_GUAN("shequxiangguan", "社区相关", 1, false), + JIE_DAO_XIANG_GUAN("jiedaoxiangguan", "街道相关", 1, false), + QU_ZHI_BU_MEN("quzhibumen", "区直部门", 1, false), + QUAN_QU_XIANG_GUAN("quanquxiangguan", "全区相关", 1, false), + + DANG_JIAN_NENG_LI("dangjiannengli", "党建能力", 2, false), + ZHI_LI_NENG_LI("zhilinengli", "治理能力", 2, false), + FU_WU_NENG_LI("fuwunengli", "服务能力", 2, false), - DANG_JIAN_NENG_LI("dangjiannengli", "党建能力", 2), - ZHI_LI_NENG_LI("zhilinengli", "治理能力", 2), - FU_WU_NENG_LI("fuwunengli", "服务能力", 2), + CAN_YU_YI_SHI("canyuyishi", "参与议事", 4, false), + DANG_WU_HUO_DONG("dangwuhuodong", "党务活动", 4, false), + LIAN_XI_QUN_ZHONG("lianxiqunzhong", "联系群众", 4, false), - CAN_YU_YI_SHI("canyuyishi", "参与议事", 4), - DANG_WU_HUO_DONG("dangwuhuodong", "党务活动", 4), - LIAN_XI_QUN_ZHONG("lianxiqunzhong", "联系群众", 4), - ZUZHINEIDANGYDLXQZNLKPFPJZ("zuzhineidangydlxqznlkpfpjz","组织内党员的联系群众能力考评分(平均值)",5), - ZUZHINEIDANGYDSYYSNLKPFPJZ("zuzhineidangydcyysnlkpfpjz","组织内党员的参与议事能力考评分(平均值)",5), - XIA_SHU_SUO_YOU_WGDDJNLPJZ("xiashusuoyouwgddjnlpjz","下属所有网格的党建能力(平均值)",5), - SHE_QU_XIA_SHU_SYWGZLNLHZPJZ("shequxiashusywgzlnlhzpjz","社区下属所有网格治理能力汇总(平均值)",5), - SHE_QU_XIA_JI_SYWGFWNLDFPJZ("shequxiajisywgfwnldfpjz","社区下级所有网格服务能力得分(平均值) ",5), - JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ("jiedaoxiashusysqdjnlhzpjz","街道下属所有社区党建能力汇总(平均值)",5), - JIE_DAO_XIA_SHU_SYSQZLNLHZ("jiedaoxiashusysqzlnlhz","街道下属所有社区治理能力汇总 (平均值) ",5), - JIE_DAO_XIA_SHU_SQFWNLDFPYZ("jiedaoxiashusqfwnldfpjz","街道下属社区服务能力得分 (平均值) ",5), - QU_XIA_SHU_JIE_DFWNLHZPJZ("quxiashujiedfwnlhzpjz","区下属街道服务能力汇总(平均值)",5), - QU_XIA_JI_JIE_DDJNLHZPJZ("quxiajijieddjnlhzpjz","区下级街道党建能力汇总(平均值)",5), - SUO_YOU_JIE_DAO_ZLNLPJZ("suoyoujiedaozlnlpjz","所有街道治理能力(平均值)",5), - SUO_YOU_ZHI_SHU_BMZLNLPJZ("suoyouzhishubmzlnlpjz","所有直属部门治理能力(平均值)",5), + ZUZHINEIDANGYDLXQZNLKPFPJZ("zuzhineidangydlxqznlkpfpjz", "组织内党员的联系群众能力考评分(平均值)", 5, true), + ZUZHINEIDANGYDSYYSNLKPFPJZ("zuzhineidangydcyysnlkpfpjz", "组织内党员的参与议事能力考评分(平均值)", 5, true), + XIA_SHU_SUO_YOU_WGDDJNLPJZ("xiashusuoyouwgddjnlpjz", "下属所有网格的党建能力(平均值)", 5, true), + SHE_QU_XIA_SHU_SYWGZLNLHZPJZ("shequxiashusywgzlnlhzpjz", "社区下属所有网格治理能力汇总(平均值)", 5, true), + SHE_QU_XIA_JI_SYWGFWNLDFPJZ("shequxiajisywgfwnldfpjz", "社区下级所有网格服务能力得分(平均值) ", 5, true), + JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ("jiedaoxiashusysqdjnlhzpjz", "街道下属所有社区党建能力汇总(平均值)", 5, true), + JIE_DAO_XIA_SHU_SYSQZLNLHZ("jiedaoxiashusysqzlnlhz", "街道下属所有社区治理能力汇总 (平均值) ", 5, true), + JIE_DAO_XIA_SHU_SQFWNLDFPYZ("jiedaoxiashusqfwnldfpjz", "街道下属社区服务能力得分 (平均值) ", 5, true), + QU_XIA_SHU_JIE_DFWNLHZPJZ("quxiashujiedfwnlhzpjz", "区下属街道服务能力汇总(平均值)", 5, true), + QU_XIA_JI_JIE_DDJNLHZPJZ("quxiajijieddjnlhzpjz", "区下级街道党建能力汇总(平均值)", 5, true), + SUO_YOU_JIE_DAO_ZLNLPJZ("suoyoujiedaozlnlpjz", "所有街道治理能力(平均值)", 5, true), + SUO_YOU_ZHI_SHU_BMZLNLPJZ("suoyouzhishubmzlnlpjz", "所有直属部门治理能力(平均值)", 5, true), ; + /** + * code + */ private String code; + /** + * name + */ private String name; + /** + * 等级 + */ private Integer level; + /** + * 是否是平均值 + */ + private Boolean isAvgIndex; - IndexCodeEnum(String code, String name, Integer level) { + IndexCodeEnum(String code, String name, Integer level, Boolean isAvgIndex) { this.code = code; this.name = name; this.level = level; + this.isAvgIndex = isAvgIndex; } public static IndexCodeEnum getEnum(String code) { @@ -58,6 +71,16 @@ public enum IndexCodeEnum { return null; } + public static boolean isAvgIndex(String code) { + IndexCodeEnum[] values = IndexCodeEnum.values(); + for (IndexCodeEnum value : values) { + if (code != null && value.getCode().equals(code)) { + return value.isAvgIndex; + } + } + return false; + } + public String getCode() { return code; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java index 9410e15d83..a10b4c9c65 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -375,7 +375,8 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { ScoreConstants.MAX_SCORE, Correlation.getCorrelation(index.getCorrelation()) ); - IndexInputVO indexInputVO = new IndexInputVO(index.getIndexCode(), index.getAllParentIndexCode(), new ArrayList<>(), index.getThreshold(), index.getWeight(), scoreCalculator); + + IndexInputVO indexInputVO = new IndexInputVO(index.getIndexCode(), index.getAllParentIndexCode(), new ArrayList<>(), index.getThreshold(), index.getWeight(), IndexCodeEnum.isAvgIndex(index.getIndexCode()), scoreCalculator); map.put(index.getIndexCode(), indexInputVO); } return map; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java index 9355c6f79e..6266d20651 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java @@ -375,6 +375,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl implements Serializable { */ private BigDecimal weight; + /** + * 是否是分数 如果是分数 直接不用计算 乘以权重即可 + */ + private boolean isScore; + private ScoreCalculator scoreCalculator; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java index 16549e9b47..05a9360b47 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java @@ -76,8 +76,8 @@ public class DemoScoreCal { List> index2SampleValues = Arrays.asList(new SampleValue<>("id1", 1), new SampleValue<>("id2", 8), new SampleValue<>("id3", 3)); // 每个指标的信息,包括样本列表,权重,指标标记 - IndexInputVO index1VO = new IndexInputVO<>("aaa", "a:bbb2", index1SampleValues, new BigDecimal(10), new BigDecimal(1), sc1); - IndexInputVO index2VO = new IndexInputVO<>("bbb", "a:bbb2", index2SampleValues, new BigDecimal(10), new BigDecimal(1), sc2); + IndexInputVO index1VO = new IndexInputVO<>("aaa", "a:bbb2", index1SampleValues, new BigDecimal(10), new BigDecimal(1), false, sc1); + IndexInputVO index2VO = new IndexInputVO<>("bbb", "a:bbb2", index2SampleValues, new BigDecimal(10), new BigDecimal(1), false, sc2); List indexInputVOS = Arrays.asList(index1VO, index2VO); @@ -102,8 +102,8 @@ public class DemoScoreCal { List index2SampleValues = Arrays.asList(new SampleValue<>("id1", new BigDecimal(1)), new SampleValue<>("id2", new BigDecimal(8)), new SampleValue<>("id3", new BigDecimal(3))); // 每个指标的信息,包括样本列表,权重,指标标记 - IndexInputVO index1VO = new IndexInputVO("aaa", "a:aaa", index1SampleValues, new BigDecimal(6), new BigDecimal(1), sc1); - IndexInputVO index2VO = new IndexInputVO("bbb", "b:bbb", index2SampleValues, new BigDecimal(6), new BigDecimal(1), sc2); + IndexInputVO index1VO = new IndexInputVO("aaa", "a:aaa", index1SampleValues, new BigDecimal(6), new BigDecimal(1), false, sc1); + IndexInputVO index2VO = new IndexInputVO("bbb", "b:bbb", index2SampleValues, new BigDecimal(6), new BigDecimal(1), false, sc2); List indexInputVOS = Arrays.asList(index1VO, index2VO); @@ -161,10 +161,10 @@ public class DemoScoreCal { // 每个指标的信息,包括样本列表,权重,指标标记 - IndexInputVO index1VO = new IndexInputVO("aaa1", "a:bbb2", index1SampleValues, new BigDecimal(-1), new BigDecimal(0.2), sc1); - IndexInputVO index2VO = new IndexInputVO("aaa2", "a:bbb2", index1SampleValues2, new BigDecimal(-1), new BigDecimal(0.15), sc2); - IndexInputVO index3VO = new IndexInputVO("aaa3", "a:bbb2", index1SampleValues3, new BigDecimal(-1), new BigDecimal(0.15), sc3); - IndexInputVO index4VO = new IndexInputVO("aaa4", "a:bbb2", index1SampleValues4, new BigDecimal(-1), new BigDecimal(0.5), sc4); + IndexInputVO index1VO = new IndexInputVO("aaa1", "a:bbb2", index1SampleValues, new BigDecimal(-1), new BigDecimal(0.2), false, sc1); + IndexInputVO index2VO = new IndexInputVO("aaa2", "a:bbb2", index1SampleValues2, new BigDecimal(-1), new BigDecimal(0.15), false, sc2); + IndexInputVO index3VO = new IndexInputVO("aaa3", "a:bbb2", index1SampleValues3, new BigDecimal(-1), new BigDecimal(0.15), false, sc3); + IndexInputVO index4VO = new IndexInputVO("aaa4", "a:bbb2", index1SampleValues4, new BigDecimal(-1), new BigDecimal(0.5), false, sc4); List indexInputVOS = Arrays.asList(index1VO, index2VO, index3VO, index4VO); @@ -234,10 +234,10 @@ public class DemoScoreCal { // 每个指标的信息,包括样本列表,权重,指标标记 - IndexInputVO index1VO = new IndexInputVO("aaa1", "a:bbb2", index1SampleValues, new BigDecimal(-1), new BigDecimal(0.3), sc1); - IndexInputVO index2VO = new IndexInputVO("aaa2", "a:bbb2", index1SampleValues2, new BigDecimal(-1), new BigDecimal(0.2), sc2); - IndexInputVO index3VO = new IndexInputVO("aaa3", "a:bbb2", index1SampleValues3, new BigDecimal(-1), new BigDecimal(0.2), sc3); - IndexInputVO index4VO = new IndexInputVO("aaa4", "a:bbb2", index1SampleValues4, new BigDecimal(0.6), new BigDecimal(0.3), sc4); + IndexInputVO index1VO = new IndexInputVO("aaa1", "a:bbb1", index1SampleValues, new BigDecimal(-1), new BigDecimal("0.3"), false, sc1); + IndexInputVO index2VO = new IndexInputVO("aaa2", "a:bbb2", index1SampleValues2, new BigDecimal(-1), new BigDecimal("0.2"), false, sc2); + IndexInputVO index3VO = new IndexInputVO("aaa3", "a:bbb3", index1SampleValues3, new BigDecimal(-1), new BigDecimal("0.2"), false, sc3); + IndexInputVO index4VO = new IndexInputVO("aaa4", "a:bbb4", index1SampleValues4, new BigDecimal(0.6), new BigDecimal("0.3"), false, sc4); List indexInputVOS = Arrays.asList(index1VO, index2VO, index3VO, index4VO); @@ -250,7 +250,9 @@ public class DemoScoreCal { System.err.println("----------------11111111----------------"); result2.forEach((key, value) -> { - System.out.println(key.concat("的得分为:").concat(value.toString())); + System.out.println(key.concat("的总得分为:") + value.getTotalScore()); + //System.out.println(JSON.toJSONString(indexInputVOS)); + value.getDetails().forEach(o -> System.out.println(JSON.toJSONString(o))); }); System.err.println("-----------------2222222222---------------"); } From b4f7add54c5683ec239da87f0d20e08aefdee832 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 16 Sep 2020 13:42:36 +0800 Subject: [PATCH 7/9] =?UTF-8?q?sql=E8=A1=A5=E6=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 7766b5eadb..a70ad180e5 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -67,7 +67,7 @@ org_name AS `NAME`, service_ablity * SERVICE_ABLITY_WEIGHT AS serviceAbility, party_dev_ablity * PARTY_DEV_WEIGHT AS partyDevAbility, - govern_ablity * GOVERN_ABLITY_WEIGHT AS governAbility + govern_ablity * GOVERN_ABLITY_WEIGHT AS governAbility, ORG_ID orgId FROM screen_index_data_monthly From 8df31454450c7837fa5a66537a28b2854624da96 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 16 Sep 2020 14:49:14 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E4=B8=89=E5=A4=A7=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E6=B1=82=E5=92=8C=E5=9B=9B=E8=88=8D=E4=BA=94=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/screen/impl/IndexServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java index d090a4c00f..fe91800ffc 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java @@ -57,7 +57,7 @@ public class IndexServiceImpl implements IndexService { yearAverageIndexResultDTO.setPartyDevAbility(getRound(yearAverageIndexResultDTO.getPartyDevAbility())); yearAverageIndexResultDTO.setGovernAbility(getRound(yearAverageIndexResultDTO.getGovernAbility())); yearAverageIndexResultDTO.setServiceAbility(getRound(yearAverageIndexResultDTO.getServiceAbility())); - yearAverageIndexResultDTO.setYearAverageIndex(yearAverageIndexResultDTO.getPartyDevAbility() + yearAverageIndexResultDTO.getGovernAbility() + yearAverageIndexResultDTO.getServiceAbility()); + yearAverageIndexResultDTO.setYearAverageIndex(getRound(yearAverageIndexResultDTO.getPartyDevAbility() + yearAverageIndexResultDTO.getGovernAbility() + yearAverageIndexResultDTO.getServiceAbility())); return yearAverageIndexResultDTO; } @@ -126,7 +126,7 @@ public class IndexServiceImpl implements IndexService { barchart.setPartyDevAbility(getRound(barchart.getPartyDevAbility())); barchart.setGovernAbility(getRound(barchart.getGovernAbility())); barchart.setServiceAbility(getRound(barchart.getServiceAbility())); - barchart.setIndexTotal(barchart.getPartyDevAbility() + barchart.getGovernAbility() + barchart.getServiceAbility()); + barchart.setIndexTotal(getRound(barchart.getPartyDevAbility() + barchart.getGovernAbility() + barchart.getServiceAbility())); }); List collect = monthBarchartResults.stream().sorted(Comparator.comparing(MonthBarchartResult::getMonthId)).collect(Collectors.toList()); //升序 当前月份在队尾 @@ -199,7 +199,7 @@ public class IndexServiceImpl implements IndexService { indexRank.setPartyDevAbility(getRound(indexRank.getPartyDevAbility())); indexRank.setGovernAbility(getRound(indexRank.getGovernAbility())); indexRank.setServiceAbility(getRound(indexRank.getServiceAbility())); - indexRank.setTotalIndex(indexRank.getPartyDevAbility() + indexRank.getGovernAbility() + indexRank.getServiceAbility()); + indexRank.setTotalIndex(getRound(indexRank.getPartyDevAbility() + indexRank.getGovernAbility() + indexRank.getServiceAbility())); }); return subAgencyIndexRankResultDTOS; } @@ -218,7 +218,7 @@ public class IndexServiceImpl implements IndexService { rank.setPartyDevAbility(getRound(rank.getPartyDevAbility())); rank.setGovernAbility(getRound(rank.getGovernAbility())); rank.setServiceAbility(getRound(rank.getServiceAbility())); - rank.setTotalIndex(rank.getPartyDevAbility() + rank.getGovernAbility() + rank.getServiceAbility()); + rank.setTotalIndex(getRound(rank.getPartyDevAbility() + rank.getGovernAbility() + rank.getServiceAbility())); }); } return subAgencyIndexRankResultDTOS; From a84eed60c402d9a236c937b527896a43d493ba6a Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 16 Sep 2020 15:15:55 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E9=83=A8=E7=BD=B2report=EF=BC=8Cstits?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/MonthPieChartResultDTO.java | 5 +++++ .../screen/impl/IndexServiceImpl.java | 20 +++++++++---------- .../screen/ScreenIndexDataMonthlyDao.xml | 3 ++- .../impl/CpcIndexCalculateServiceImpl.java | 5 ++++- .../externalapp/ExtAppJwtTokenUtils.java | 6 +++--- 5 files changed, 24 insertions(+), 15 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthPieChartResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthPieChartResultDTO.java index 89ca2fd383..de0b16022b 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthPieChartResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthPieChartResultDTO.java @@ -27,4 +27,9 @@ public class MonthPieChartResultDTO implements Serializable { * 治理能力 */ private Double governAbility = 0.0; + + /** + * 月份Id + */ + private String monthId; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java index d090a4c00f..f6df6ad0d0 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java @@ -71,22 +71,22 @@ public class IndexServiceImpl implements IndexService { @Override public MonthPieChartResultDTO monthPieChart(MonthPieChartFormDTO monthPieChartFormDTO) { - MonthPieChartResultDTO pieChartDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(),null); - if (null == pieChartDTO){ + MonthPieChartResultDTO pieChartDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(), null); + String monthId = dateUtils.getCurrentMonthId(); + int time = NumConstant.TWELVE; + //保证获取月度指数数据的最大可能性 + while ((null == pieChartDTO || StringUtils.isBlank(pieChartDTO.getMonthId())) && time > NumConstant.ONE) { + time--; + monthId = dateUtils.getPreviousMonthIdByDest(null, monthId); + pieChartDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(), monthId); + } + if (null == pieChartDTO) { return new MonthPieChartResultDTO(); } // 处理小数四舍五入 pieChartDTO.setPartyDevAbility(getRound(pieChartDTO.getPartyDevAbility())); pieChartDTO.setGovernAbility(getRound(pieChartDTO.getGovernAbility())); pieChartDTO.setServiceAbility(getRound(pieChartDTO.getServiceAbility())); - String monthId = dateUtils.getCurrentMonthId(); - int time = NumConstant.TWELVE; - //保证获取月度指数数据的最大可能性 - while(null == pieChartDTO && time > NumConstant.ONE){ - time--; - monthId = dateUtils.getPreviousMonthIdByDest(null,monthId); - pieChartDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(),monthId); - } return pieChartDTO; } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 7766b5eadb..ec371de783 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -8,7 +8,8 @@ SELECT service_ablity * SERVICE_ABLITY_WEIGHT AS serviceAbility, party_dev_ablity * PARTY_DEV_WEIGHT AS partyDevAbility, - govern_ablity * GOVERN_ABLITY_WEIGHT AS governAbility + govern_ablity * GOVERN_ABLITY_WEIGHT AS governAbility, + MONTH_ID FROM screen_index_data_monthly WHERE diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java index a10b4c9c65..9d9cfe5739 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -86,7 +86,10 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { Map cpcScoreTotalMap = new HashMap<>(); Map userTotalCount = new HashMap<>(); //删除总分 然后插入 - cpcScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCalConstant.DELETE_SIZE, NumConstant.ONE_STR); + int effectRow; + do { + effectRow = cpcScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCalConstant.DELETE_SIZE, NumConstant.ONE_STR); + } while (effectRow > NumConstant.ZERO); do { List result = new ArrayList<>(); //获取数据 diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java index 2e49c80102..de4de9ed21 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java @@ -75,13 +75,13 @@ public class ExtAppJwtTokenUtils { public static void genToken() { HashMap claim = new HashMap<>(); - claim.put("appId", "2c448b7da527055fbeebb628f8d3dcb0"); - claim.put("customerId", "c1"); + claim.put("appId", "acc4ad66c82a7b46e741364b4c62dce2"); + claim.put("customerId", "b09527201c4409e19d1dbc5e3c3429a1"); long ts = System.currentTimeMillis() - 1000 * 60 * 4; System.out.println("时间戳:" + ts); claim.put("ts", ts); - String abc = new ExtAppJwtTokenUtils().createToken(claim, "d4b73db4cf8e46ef99fa1f95149c2791ef2396fded114dd09e406cbce83fc88a"); + String abc = new ExtAppJwtTokenUtils().createToken(claim, "612d304095c50369c3ef06e490f05779eeb8f19ff16566c73aeafafc5fa01970"); System.out.println(abc); }