From e4d8e69ab214ca66744069c8c0a4e3bf074cbb54 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 31 May 2021 14:59:51 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E9=83=A8=E9=97=A8=E6=80=BB=E5=88=86?= =?UTF-8?q?=E5=92=8C=E4=B8=8B=E7=BA=A7=20=E8=AE=A1=E7=AE=97=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/indexcal/impl/DeptScoreServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 dd4219e170..32e073cea3 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 @@ -153,7 +153,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl insertMap = new HashMap<>(); subScore.forEach(score -> { - String key = score.getAgencyId().concat(index.getIndexCode()); + String key = score.getDeptId().concat(index.getIndexCode()); DeptSelfSubScoreEntity scoreEntity = insertMap.get(key); if (scoreEntity == null) { scoreEntity = ConvertUtils.sourceToTarget(score, DeptSelfSubScoreEntity.class); @@ -465,4 +465,4 @@ public class DeptScoreServiceImpl extends BaseServiceImpl Date: Mon, 31 May 2021 15:13:46 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcal/impl/IndexCalculateServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java index 01d7f5d581..5694fbaef0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java @@ -135,7 +135,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { start = System.currentTimeMillis(); try { flag = gridCorreLationService.calculateGridCorreLation(formDTO); - log.info("客户Id:{}【网格相关】计算完毕,总耗时:{}秒,result:{},result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); + log.info("客户Id:{}【网格相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); } catch (Exception e) { log.error("indexCalculate calculateGridCorreLation exception", e); } @@ -143,7 +143,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { start = System.currentTimeMillis(); try { flag = indexCalculateCommunityService.calCommunityAll(formDTO); - log.info("客户Id:{}【社区相关】计算完毕,总耗时:{}秒,result:{},result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); + log.info("客户Id:{}【社区相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); } catch (Exception e) { log.error("indexCalculate calCommunityAll exception", e); } From 7d5ebc0421ade15a576c022de49a8049ae8a6bf1 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 31 May 2021 17:08:53 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=AD=A3=E8=B4=9F=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=B8=80=E7=9B=B4=E6=B2=A1=E8=B5=B7=E4=BD=9C=E7=94=A8=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../normalizing/batch/BatchScoreCalculator.java | 14 ++++++++++---- .../epmet/stats/test/normalizing/MathUtilTest.java | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java index 47be178b7a..754e2cf7bc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java @@ -80,13 +80,19 @@ public class BatchScoreCalculator { .multiply( (maxScoreValue.subtract(minScoreValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP))) .add(minScoreValue).setScale(6, RoundingMode.HALF_UP); - // - if (scoreCalculator.getCorrelation().getCode().equals(Correlation.NEGATIVE)) { - normalizeValue = maxScoreValue.subtract(normalizeValue); - } + + } else { normalizeValue = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold)); } + //如果是负相关 则用100-归一后的值为最大值减 + if (Correlation.NEGATIVE.getCode().equals(scoreCalculator.getCorrelation().getCode())) { + normalizeValue = maxScoreValue.subtract(normalizeValue); + } + } + //如果归一后的值小于0 则置为0 + if (normalizeValue.compareTo(NumConstant.ZERO_DECIMAL)<=-1){ + normalizeValue = NumConstant.ZERO_DECIMAL; } BigDecimal score = normalizeValue.multiply(weight).setScale(6, RoundingMode.HALF_UP); CalculateResult result = scoreCountOfSamples.get(sampleId); diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/MathUtilTest.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/MathUtilTest.java index 408f837691..9d0178385a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/MathUtilTest.java +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/MathUtilTest.java @@ -5,7 +5,7 @@ import java.math.RoundingMode; public class MathUtilTest { public static void main(String[] args) { - //值 域:(-π/2,π/2) ->(60,100) + //值 域:[-π/2,π/2] ->[60,100] double tan = Math.atan(4); double tan2 = Math.atan(1); double tan3 = Math.atan(8); From a74b652378880cde8017c29b802b92155b7db231 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 31 May 2021 17:23:01 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/indexcal/impl/DeptScoreServiceImpl.java | 3 +-- .../indexcal/impl/GridCorreLationServiceImpl.java | 2 +- .../indexcal/impl/IndexCalculateCommunityServiceImpl.java | 2 +- .../indexcal/impl/IndexCalculateDistrictServiceImpl.java | 2 +- .../indexcal/impl/IndexCalculateStreetServiceImpl.java | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) 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 32e073cea3..71b6af63d1 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 @@ -116,7 +116,6 @@ public class DeptScoreServiceImpl extends BaseServiceImpl indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.QU_ZHI_BU_MEN.getCode()); if (CollectionUtils.isEmpty(indexList)) { @@ -143,7 +142,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl weightMap = new HashMap<>(); selfSubIndexList.forEach(o -> { //找出自身 和下级的指标 - if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + if (o.getAllIndexCodePath().contains(ProjectConstant.XIA_JI)) { selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); weightMap.put(ProjectConstant.XIA_JI, weightMap.getOrDefault(ProjectConstant.XIA_JI, new BigDecimal(0)).add(o.getWeight())); } else { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java index 86da0df973..e99f35a569 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java @@ -132,7 +132,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { Map weightMap = new HashMap<>(); selfSubIndexList.forEach(o -> { //找出自身 和下级的指标 - if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + if (o.getAllIndexCodePath().contains(ProjectConstant.XIA_JI)) { selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); weightMap.put(ProjectConstant.XIA_JI, weightMap.getOrDefault(ProjectConstant.XIA_JI, new BigDecimal(0)).add(o.getWeight())); } else { 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 1f279c4076..82fe83bb3c 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 @@ -165,7 +165,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni Map weightMap = new HashMap<>(); selfSubIndexList.forEach(o -> { //找出自身 和下级的指标 - if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + if (o.getAllIndexCodePath().contains(ProjectConstant.XIA_JI)) { selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); weightMap.put(ProjectConstant.XIA_JI, weightMap.getOrDefault(ProjectConstant.XIA_JI, new BigDecimal(0)).add(o.getWeight())); } else { 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 dcec17a0c8..988fc7e118 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 @@ -163,7 +163,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict Map weightMap = new HashMap<>(); selfSubIndexList.forEach(o -> { //找出自身 和下级的指标 - if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + if (o.getAllIndexCodePath().contains(ProjectConstant.XIA_JI)) { selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); weightMap.put(ProjectConstant.XIA_JI, weightMap.getOrDefault(ProjectConstant.XIA_JI, new BigDecimal(0)).add(o.getWeight())); } else { 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 011694dbb8..bf251be59f 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 @@ -168,7 +168,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ Map weightMap = new HashMap<>(); selfSubIndexList.forEach(o -> { //找出自身 和下级的指标 - if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + if (o.getAllIndexCodePath().contains(ProjectConstant.XIA_JI)) { selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); weightMap.put(ProjectConstant.XIA_JI, weightMap.getOrDefault(ProjectConstant.XIA_JI, new BigDecimal(0)).add(o.getWeight())); } else { From dc82133696e4919a22e8bbf400168d2f8eda74c1 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 31 May 2021 17:35:24 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E7=A9=BA=E6=8C=87=E9=92=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/toscreen/impl/PublicPartExtractServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java index 3b2baa00dd..a6a916602d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java @@ -200,6 +200,10 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { String agencyId = issue.getAgencyId(); agencyIdSet.add(agencyId); ScreenUserJoinEntity entity = insertMap.get(agencyId); + //todo 这里为什么会没有 + if (entity == null){ + return; + } entity.setJoinTotal(issue.getIssueIncr()); GridUserCountResultDTO user = userCountMap.get(agencyId); //百人人均议题:统计周期内总的议题数/(注册用户数/100) From 94df654ce7eaa1cc8970ff57ee7742fbbc462bdb Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 31 May 2021 17:36:58 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E7=A9=BA=E6=8C=87=E9=92=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/indexcal/impl/DeptScoreServiceImpl.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/DeptScoreServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java index 71b6af63d1..c121361eea 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 @@ -181,7 +181,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl insertMap) { int effectRow = 0; do { - deptSelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode); + effectRow = deptSelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode); } while (effectRow > 0); deptSelfSubScoreDao.insertBatch(new ArrayList<>(insertMap.values())); From 714375e75fcbf3a33d85207bff52838c08f06f93 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 1 Jun 2021 10:26:48 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E4=B8=ADuser=E7=9A=84showname=E5=92=8C=E7=BB=84=E5=91=98member?= =?UTF-8?q?=E4=B8=ADusershowname=E6=B2=A1=E5=80=BC=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/CustomerGridDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index 15c14dbd93..2036e76fa6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -338,7 +338,7 @@ LEFT JOIN customer_agency ca ON ca.id = cg.pid WHERE cg.id = #{gridId} - AND cg.del_flag = 0 +