From 7aba68f0db4b0fb0328cb1f9d448ec364bd0ae95 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 8 Sep 2020 14:31:07 +0800 Subject: [PATCH 1/8] =?UTF-8?q?AVG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/evaluationindex/indexcal/AgencyScoreDao.xml | 2 +- .../evaluationindex/screen/FactIndexCommunityScoreDao.xml | 2 +- .../mapper/evaluationindex/screen/FactIndexGridScoreDao.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index 211e573c3c..6ba627fd68 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -90,7 +90,7 @@ fics.month_id, fics.quarter_id, fics.year_id, - AVG( fics.score ) AS score, + ROUND(AVG( fics.score ),6) AS score, fics.customer_id, PARENT_AGENCY_ID AS parentId FROM diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml index 7978db5eee..919dec3b2b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml @@ -69,7 +69,7 @@ fics.month_id, fics.quarter_id, fics.year_id, - AVG( fics.score ) AS score, + ROUND(AVG( fics.score ),6) AS score, fics.customer_id, sca.pid AS parentId FROM diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml index 010ac06798..05ae94667e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml @@ -10,7 +10,7 @@ figc.month_id as monthId, figc.quarter_id as quarterId, figc.year_id as yearId, - AVG( figc.score ) AS score, + ROUND(AVG( figc.score ),6) AS score, figc.customer_id as customerId, sca.pid AS parentId FROM From d650ef1997366afc7c24c7f44502511d2b196819 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 8 Sep 2020 15:09:47 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E5=8E=BB=E9=99=A4=20parent=5Fagency=5Fid?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=EF=BC=8CcommunityScore=E5=92=8CagencyScore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IndexCalculateCommunityServiceImpl.java | 45 +++++------------- .../IndexCalculateDistrictServiceImpl.java | 41 +++++------------ .../impl/IndexCalculateStreetServiceImpl.java | 46 +++++-------------- .../indexcal/AgencyScoreDao.xml | 12 ++--- .../screen/FactIndexCommunityScoreDao.xml | 9 +--- 5 files changed, 40 insertions(+), 113 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 f25e27deb6..52cc9d836f 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 @@ -78,7 +78,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); //下属所有网格的党建能力平均值 detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode().equals(detail.getIndexCode())) { @@ -87,8 +86,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni log.error(IndexCalConstant.GRID_PARTY_AVG_NULL); return; }else if (subGridPartyAvgScore.size() == NumConstant.ONE){ - pid.put(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),subGridPartyAvgScore.get(NumConstant.ZERO).getParentId()); - sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); return; }else if (subGridPartyAvgScore.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -97,7 +95,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni subPartyAvgList.forEach( party -> { List index1SampleValues = new ArrayList<>(); party.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -118,8 +115,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); return; }else if (publishArticleCountList.size() == NumConstant.ONE){ - pid.put(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); - sizeOne(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + sizeOne(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); return; }else if (publishArticleCountList.size() > NumConstant.ONE) { List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); @@ -129,7 +125,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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); }); @@ -143,7 +138,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni log.info("communityPartyCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); log.info("communityPartyCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId)); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); return true; } @@ -162,7 +157,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode().equals(detail.getIndexCode())) { List subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); @@ -171,8 +165,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return; } if (subGridGovernAvg.size() == NumConstant.ONE) { - pid.put(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),subGridGovernAvg.get(NumConstant.ZERO).getParentId()); - sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); + sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); return; } else if (subGridGovernAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -180,7 +173,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -196,8 +188,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni log.error(IndexCalConstant.COMMUNITY_GOVERN_ABILITY_NULL); return; }else if (communityGovernAbility.size() == NumConstant.ONE) { - pid.put(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); - sizeOne(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); + sizeOne(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); return; } else if (communityGovernAbility.size() > NumConstant.ONE) { String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); @@ -212,7 +203,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); governAbility.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); }); @@ -226,7 +216,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni log.info("communityGovernAbilityCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); log.info("communityGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId)); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); return true; } @@ -245,14 +235,12 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode().equals(indexCode)) { List subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); if (subGridServiceAvg.size() == NumConstant.ONE) { - pid.put(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId(),subGridServiceAvg.get(NumConstant.ZERO).getParentId()); - sizeOne(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); + sizeOne(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); return; } else if (subGridServiceAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -261,7 +249,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); serviceAvg.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -275,8 +262,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni log.error(IndexCalConstant.COMMUNITY_SERVICE_ABILITY_NULL); return; }else if (communityActivityCountList.size() == NumConstant.ONE) { - pid.put(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); - sizeOne(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); + sizeOne(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); return; } else if (communityActivityCountList.size() > NumConstant.ONE) { String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); @@ -291,7 +277,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); communityActivity.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); }); @@ -305,7 +290,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni log.info("communityServiceAbilityCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); log.info("communityServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId)); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode()); deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); return true; } @@ -340,7 +325,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni score.setIndexCode(IndexCalConstant.COMMUNITY_RELATE); value.forEach(community -> { score.setScore(score.getScore().add(community.getScore())); - score.setParentAgencyId(community.getParentAgencyId()); }); result.add(score); }); @@ -417,7 +401,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni * @author zxc * @date 2020/9/2 2:37 下午 */ - public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode,Map pid) { + public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode) { List result = new ArrayList<>(); scoreCountOfSampleId.forEach((k, v) -> { FactIndexCommunityScoreDTO score = new FactIndexCommunityScoreDTO(); @@ -429,11 +413,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni score.setIsTotal(isTotal); score.setIndexCode(indexCode); score.setScore(v); - pid.forEach((agency,parentAgency) -> { - if (k.equals(agency)){ - score.setParentAgencyId(parentAgency); - } - }); result.add(score); }); return result; @@ -447,10 +426,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni * @author zxc * @date 2020/9/2 2:40 下午 */ - public void sizeOne(String agencyId,String customerId,String monthId,String indexCode,Map pid){ + public void sizeOne(String agencyId,String customerId,String monthId,String indexCode){ HashMap scoreCountOfSampleId = new HashMap<>(); scoreCountOfSampleId.put(agencyId,new BigDecimal(NumConstant.FIFTY)); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, indexCode,pid); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, indexCode); deleteAndInsert(customerId, monthId, indexCode, result); } } 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 9baa63df36..559d79ec1f 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 @@ -99,7 +99,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); //党建能力平均值 indexDetailList.forEach(detail -> { if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { @@ -108,8 +107,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict log.error(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); return; }else if (subGridPartyAvgScore.size() == NumConstant.ONE){ - pid.put(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),subGridPartyAvgScore.get(NumConstant.ZERO).getParentId()); - sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); return; }else if (subGridPartyAvgScore.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -117,7 +115,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict subPartyAvgList.forEach( party -> { List index1SampleValues = new ArrayList<>(); party.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -138,8 +135,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); return; }else if (publishArticleCountList.size() == NumConstant.ONE){ - pid.put(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); - sizeOne(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + sizeOne(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); return; }else if (publishArticleCountList.size() > NumConstant.ONE) { List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); @@ -149,7 +145,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict 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); }); @@ -161,7 +156,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), pid); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); return true; } @@ -180,13 +175,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); if (districtGovernAvgList.size() == NumConstant.ONE) { - pid.put(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(),districtGovernAvgList.get(NumConstant.ZERO).getParentId()); - sizeOne(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); + sizeOne(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); return; } else if (districtGovernAvgList.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(districtGovernAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -194,7 +187,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -206,8 +198,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } else if (IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode().equals(detail.getIndexCode())){ List deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (deptScoreAvgList.size() == NumConstant.ONE) { - pid.put(deptScoreAvgList.get(NumConstant.ZERO).getAgencyId(),deptScoreAvgList.get(NumConstant.ZERO).getParentId()); - sizeOne(deptScoreAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); + sizeOne(deptScoreAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); return; } else if (deptScoreAvgList.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(deptScoreAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -215,7 +206,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -230,7 +220,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), pid); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); return true; } @@ -249,14 +239,12 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); if (subStreetAvgList.size() == NumConstant.ONE) { - pid.put(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(),subStreetAvgList.get(NumConstant.ZERO).getParentId()); - sizeOne(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); + sizeOne(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); return; } else if (subStreetAvgList.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subStreetAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -265,7 +253,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); serviceAvg.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -279,7 +266,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode()); deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); return true; } @@ -315,7 +302,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict score.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); value.forEach(community -> { score.setScore(score.getScore().add(community.getScore())); - score.setParentAgencyId(community.getParentAgencyId()); }); result.add(score); }); @@ -365,7 +351,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict * @author zxc * @date 2020/9/2 2:37 下午 */ - public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode,Map pid) { + public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode) { List result = new ArrayList<>(); scoreCountOfSampleId.forEach((k, v) -> { AgencyScoreDTO score = new AgencyScoreDTO(); @@ -378,11 +364,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict score.setIndexCode(indexCode); score.setScore(v); score.setDataType(IndexCalConstant.DISTRICT_LEVEL); - pid.forEach((agency,parentAgency) -> { - if (k.equals(agency)){ - score.setParentAgencyId(parentAgency); - } - }); result.add(score); }); return result; @@ -396,10 +377,10 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict * @author zxc * @date 2020/9/2 2:40 下午 */ - public void sizeOne(String agencyId,String customerId,String monthId,String indexCode,Map pid){ + public void sizeOne(String agencyId,String customerId,String monthId,String indexCode){ HashMap scoreCountOfSampleId = new HashMap<>(); scoreCountOfSampleId.put(agencyId,new BigDecimal(NumConstant.FIFTY)); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, indexCode,pid); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, indexCode); deleteAndInsert(customerId, monthId, indexCode, result); } } 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 e18de69bb2..64e1f67591 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 @@ -105,7 +105,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); //下属所有社区的党建能力平均值 detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { @@ -114,8 +113,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.error(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL); return; }else if (subCommPartyAvgScore.size() == NumConstant.ONE){ - pid.put(subCommPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),subCommPartyAvgScore.get(NumConstant.ZERO).getParentId()); - sizeOne(subCommPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + sizeOne(subCommPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); return; }else if (subCommPartyAvgScore.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -124,7 +122,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ partition.forEach(publish -> { List index1SampleValues = new ArrayList<>(); publish.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -145,8 +142,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); return; }else if (mapList.size() == NumConstant.ONE){ - pid.put(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),mapList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); - sizeOne(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + sizeOne(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); return; }else if (mapList.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(mapList.stream().map(m -> new BigDecimal(m.get(fieldName).toString())).collect(Collectors.toList())); @@ -155,7 +151,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ 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); }); @@ -167,7 +162,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); return true; } @@ -186,13 +181,11 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) { List subGridGovernAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (subGridGovernAvg.size() == NumConstant.ONE) { - pid.put(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),subGridGovernAvg.get(NumConstant.ZERO).getParentId()); - sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); + sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); return; } else if (subGridGovernAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -200,7 +193,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -216,8 +208,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.error(IndexCalConstant.STREET_GOVERN_ABILITY_NULL); return; }else if (communityGovernAbility.size() == NumConstant.ONE) { - pid.put(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); - sizeOne(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); + sizeOne(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); return; } else if (communityGovernAbility.size() > NumConstant.ONE) { String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); @@ -233,7 +224,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ System.err.println(detail.getCorrelation()); List index1SampleValues = new ArrayList<>(); governAbility.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); }); @@ -245,7 +235,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); return true; } @@ -264,14 +254,12 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) { List subCommServiceAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); if (subCommServiceAvg.size() == NumConstant.ONE) { - pid.put(subCommServiceAvg.get(NumConstant.ZERO).getAgencyId(),subCommServiceAvg.get(NumConstant.ZERO).getParentId()); - sizeOne(subCommServiceAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); + sizeOne(subCommServiceAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); return; } else if (subCommServiceAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -280,7 +268,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); serviceAvg.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -294,8 +281,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.error(IndexCalConstant.STREET_SERVICE_ABILITY_NULL); return; }else if (communityActivityCountList.size() == NumConstant.ONE) { - pid.put(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); - sizeOne(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); + sizeOne(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); return; } else if (communityActivityCountList.size() > NumConstant.ONE) { String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); @@ -310,7 +296,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); communityActivity.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); }); @@ -322,8 +307,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid - ); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode()); deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); return true; } @@ -359,7 +343,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ score.setDataType(IndexCalConstant.STREET_LEVEL); value.forEach(street -> { score.setScore(score.getScore().add(street.getScore())); - score.setParentAgencyId(street.getParentAgencyId()); }); result.add(score); }); @@ -409,7 +392,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ * @author zxc * @date 2020/9/2 2:37 下午 */ - public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode,Map pid) { + public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode) { List result = new ArrayList<>(); scoreCountOfSampleId.forEach((k, v) -> { AgencyScoreDTO score = new AgencyScoreDTO(); @@ -421,11 +404,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ score.setIsTotal(isTotal); score.setIndexCode(indexCode); score.setScore(v); - pid.forEach((agency,parentAgency) -> { - if (k.equals(agency)){ - score.setParentAgencyId(parentAgency); - } - }); result.add(score); }); return result; @@ -439,10 +417,10 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ * @author zxc * @date 2020/9/2 2:40 下午 */ - public void sizeOne(String agencyId,String customerId,String monthId,String indexCode,Map pid){ + public void sizeOne(String agencyId,String customerId,String monthId,String indexCode){ HashMap scoreCountOfSample = new HashMap<>(); scoreCountOfSample.put(agencyId,new BigDecimal(NumConstant.FIFTY)); - List result = getResult(scoreCountOfSample, customerId, monthId, NumConstant.ZERO_STR, indexCode,pid); + List result = getResult(scoreCountOfSample, customerId, monthId, NumConstant.ZERO_STR, indexCode); deleteAndInsert(customerId, monthId, indexCode, result); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index 6ba627fd68..683a939b8a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -5,14 +5,13 @@ - INSERT INTO fact_index_agency_score (ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, IS_TOTAL, SCORE, INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + INSERT INTO fact_index_agency_score (ID, CUSTOMER_ID, AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, IS_TOTAL, SCORE, INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) VALUES ( REPLACE ( UUID(), '-', '' ), #{item.customerId}, #{item.agencyId}, - #{item.parentAgencyId}, #{item.yearId}, #{item.quarterId}, #{item.monthId}, @@ -47,7 +46,6 @@ SELECT CUSTOMER_ID customerId, AGENCY_ID agencyId, - PARENT_AGENCY_ID parentAgencyId, YEAR_ID yearId, MONTH_ID monthId, IS_TOTAL isTotal, @@ -71,8 +69,7 @@ QUARTER_ID, YEAR_ID, SCORE, - INDEX_CODE, - PARENT_AGENCY_ID + INDEX_CODE FROM fact_index_agency_score WHERE @@ -91,8 +88,7 @@ fics.quarter_id, fics.year_id, ROUND(AVG( fics.score ),6) AS score, - fics.customer_id, - PARENT_AGENCY_ID AS parentId + fics.customer_id FROM fact_index_agency_score fics WHERE @@ -111,7 +107,6 @@ CUSTOMER_ID, AGENCY_ID, - PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, @@ -132,7 +127,6 @@ (SELECT REPLACE(UUID(), '-', '') AS id), #{customerId}, #{item.agencyId}, - #{item.parentAgencyId}, #{item.yearId}, #{item.quarterId}, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml index 919dec3b2b..09a2b752d7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml @@ -5,14 +5,13 @@ - INSERT INTO fact_index_community_score ( ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, IS_TOTAL, SCORE, INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + INSERT INTO fact_index_community_score ( ID, CUSTOMER_ID, AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, IS_TOTAL, SCORE, INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) VALUES ( REPLACE(UUID(),'-',''), #{item.customerId}, #{item.agencyId}, - #{item.parentAgencyId}, #{item.yearId}, #{item.quarterId}, #{item.monthId}, @@ -50,8 +49,7 @@ QUARTER_ID, YEAR_ID, SCORE, - INDEX_CODE, - PARENT_AGENCY_ID + INDEX_CODE FROM fact_index_community_score WHERE @@ -88,7 +86,6 @@ SELECT CUSTOMER_ID customerId, AGENCY_ID agencyId, - PARENT_AGENCY_ID parentAgencyId, YEAR_ID yearId, MONTH_ID monthId, IS_TOTAL isTotal, @@ -109,7 +106,6 @@ ID, CUSTOMER_ID, AGENCY_ID, - PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, @@ -128,7 +124,6 @@ (SELECT REPLACE(UUID(), '-', '') AS id), #{customerId}, #{item.agencyId}, - #{item.parentAgencyId}, #{item.yearId}, #{item.quarterId}, From f5585b4d894ad901fae83f42997bceb45f197190 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 8 Sep 2020 15:19:07 +0800 Subject: [PATCH 3/8] =?UTF-8?q?Revert=20"=E5=8E=BB=E9=99=A4=20parent=5Fage?= =?UTF-8?q?ncy=5Fid=E5=AD=97=E6=AE=B5=EF=BC=8CcommunityScore=E5=92=8Cagenc?= =?UTF-8?q?yScore"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d650ef19 --- .../IndexCalculateCommunityServiceImpl.java | 73 ++++++++++++------- .../IndexCalculateDistrictServiceImpl.java | 69 +++++++++++------- .../impl/IndexCalculateStreetServiceImpl.java | 70 ++++++++++++------ .../indexcal/AgencyScoreDao.xml | 12 ++- .../screen/FactIndexCommunityScoreDao.xml | 9 ++- 5 files changed, 153 insertions(+), 80 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 52cc9d836f..50960abf52 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 @@ -78,6 +78,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return false; } List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); //下属所有网格的党建能力平均值 detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode().equals(detail.getIndexCode())) { @@ -85,16 +86,18 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.error(IndexCalConstant.GRID_PARTY_AVG_NULL); return; - }else if (subGridPartyAvgScore.size() == NumConstant.ONE){ - sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + } else if (subGridPartyAvgScore.size() == NumConstant.ONE) { + pid.put(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(), subGridPartyAvgScore.get(NumConstant.ZERO).getParentId()); + sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(), customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), pid); return; - }else if (subGridPartyAvgScore.size() > NumConstant.ONE) { + } else if (subGridPartyAvgScore.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); Integer indexEnd = NumConstant.TEN; List> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, indexEnd); - subPartyAvgList.forEach( party -> { + subPartyAvgList.forEach(party -> { List index1SampleValues = new ArrayList<>(); party.forEach(c -> { + pid.put(c.getAgencyId(), c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -112,19 +115,21 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni } String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { - log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); return; - }else if (publishArticleCountList.size() == NumConstant.ONE){ - sizeOne(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + } else if (publishArticleCountList.size() == NumConstant.ONE) { + pid.put(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(), publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); + sizeOne(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(), customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), pid); return; - }else if (publishArticleCountList.size() > NumConstant.ONE) { + } else if (publishArticleCountList.size() > NumConstant.ONE) { 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 -> { + 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); }); @@ -138,7 +143,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni log.info("communityPartyCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); log.info("communityPartyCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId)); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), pid); deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); return true; } @@ -157,6 +162,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return false; } List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode().equals(detail.getIndexCode())) { List subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); @@ -165,7 +171,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return; } if (subGridGovernAvg.size() == NumConstant.ONE) { - sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + pid.put(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(), subGridGovernAvg.get(NumConstant.ZERO).getParentId()); + sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(), customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), pid); return; } else if (subGridGovernAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -173,6 +180,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { + pid.put(c.getAgencyId(), c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -188,7 +196,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni log.error(IndexCalConstant.COMMUNITY_GOVERN_ABILITY_NULL); return; }else if (communityGovernAbility.size() == NumConstant.ONE) { - sizeOne(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + pid.put(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(), communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); + sizeOne(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(), customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), pid); return; } else if (communityGovernAbility.size() > NumConstant.ONE) { String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); @@ -203,6 +212,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); governAbility.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); }); @@ -216,7 +226,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni log.info("communityGovernAbilityCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); log.info("communityGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId)); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), pid); deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); return true; } @@ -235,12 +245,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return false; } List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode().equals(indexCode)) { List subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); if (subGridServiceAvg.size() == NumConstant.ONE) { - sizeOne(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); + pid.put(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId(), subGridServiceAvg.get(NumConstant.ZERO).getParentId()); + sizeOne(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId(), customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), pid); return; } else if (subGridServiceAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -249,6 +261,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); serviceAvg.forEach(c -> { + pid.put(c.getAgencyId(), c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -262,7 +275,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni log.error(IndexCalConstant.COMMUNITY_SERVICE_ABILITY_NULL); return; }else if (communityActivityCountList.size() == NumConstant.ONE) { - sizeOne(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); + pid.put(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(), communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); + sizeOne(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(), customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), pid); return; } else if (communityActivityCountList.size() > NumConstant.ONE) { String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); @@ -277,6 +291,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); communityActivity.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); }); @@ -290,7 +305,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni log.info("communityServiceAbilityCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); log.info("communityServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId)); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode()); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), pid); deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); return true; } @@ -325,6 +340,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni score.setIndexCode(IndexCalConstant.COMMUNITY_RELATE); value.forEach(community -> { score.setScore(score.getScore().add(community.getScore())); + score.setParentAgencyId(community.getParentAgencyId()); }); result.add(score); }); @@ -392,16 +408,16 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni } /** + * @param scoreCountOfSampleId 指标计算结果 + * @param customerId 客户ID + * @param monthId 月份ID + * @param isTotal 是否 总分【党建+治理+服务】 + * @param indexCode 党建能力:dangjiannengli,治理能力:zhilinengli,服务能力:fuwunengli,xx相关:xx相关 * @Description - * @param scoreCountOfSampleId 指标计算结果 - * @param customerId 客户ID - * @param monthId 月份ID - * @param isTotal 是否 总分【党建+治理+服务】 - * @param indexCode 党建能力:dangjiannengli,治理能力:zhilinengli,服务能力:fuwunengli,xx相关:xx相关 * @author zxc * @date 2020/9/2 2:37 下午 */ - public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode) { + public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode, Map pid) { List result = new ArrayList<>(); scoreCountOfSampleId.forEach((k, v) -> { FactIndexCommunityScoreDTO score = new FactIndexCommunityScoreDTO(); @@ -413,23 +429,28 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni score.setIsTotal(isTotal); score.setIndexCode(indexCode); score.setScore(v); + pid.forEach((agency, parentAgency) -> { + if (k.equals(agency)) { + score.setParentAgencyId(parentAgency); + } + }); result.add(score); }); return result; } /** - * @Description 当查询结果为一条时,调用此方法 * @param agencyId * @param customerId * @param monthId + * @Description 当查询结果为一条时,调用此方法 * @author zxc * @date 2020/9/2 2:40 下午 */ - public void sizeOne(String agencyId,String customerId,String monthId,String indexCode){ + public void sizeOne(String agencyId, String customerId, String monthId, String indexCode, Map pid) { HashMap scoreCountOfSampleId = new HashMap<>(); - scoreCountOfSampleId.put(agencyId,new BigDecimal(NumConstant.FIFTY)); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, indexCode); + scoreCountOfSampleId.put(agencyId, new BigDecimal(NumConstant.FIFTY)); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, indexCode, pid); deleteAndInsert(customerId, monthId, indexCode, result); } } 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 559d79ec1f..dad92d33df 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 @@ -99,6 +99,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return false; } List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); //党建能力平均值 indexDetailList.forEach(detail -> { if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { @@ -106,15 +107,17 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.error(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); return; - }else if (subGridPartyAvgScore.size() == NumConstant.ONE){ - sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + } else if (subGridPartyAvgScore.size() == NumConstant.ONE) { + pid.put(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(), subGridPartyAvgScore.get(NumConstant.ZERO).getParentId()); + sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(), customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), pid); return; - }else if (subGridPartyAvgScore.size() > NumConstant.ONE) { + } else if (subGridPartyAvgScore.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, IndexCalConstant.PAGE_SIZE); - subPartyAvgList.forEach( party -> { + subPartyAvgList.forEach(party -> { List index1SampleValues = new ArrayList<>(); party.forEach(c -> { + pid.put(c.getAgencyId(), c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -132,19 +135,21 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { - log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); return; - }else if (publishArticleCountList.size() == NumConstant.ONE){ - sizeOne(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + } else if (publishArticleCountList.size() == NumConstant.ONE) { + pid.put(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(), publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); + sizeOne(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(), customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), pid); return; - }else if (publishArticleCountList.size() > NumConstant.ONE) { + } else if (publishArticleCountList.size() > NumConstant.ONE) { 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 -> { + 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); }); @@ -156,7 +161,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), pid); deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); return true; } @@ -175,11 +180,13 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return false; } List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); if (districtGovernAvgList.size() == NumConstant.ONE) { - sizeOne(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + pid.put(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(), districtGovernAvgList.get(NumConstant.ZERO).getParentId()); + sizeOne(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(), customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), pid); return; } else if (districtGovernAvgList.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(districtGovernAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -187,6 +194,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { + pid.put(c.getAgencyId(), c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -198,7 +206,8 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } else if (IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode().equals(detail.getIndexCode())){ List deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (deptScoreAvgList.size() == NumConstant.ONE) { - sizeOne(deptScoreAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + pid.put(deptScoreAvgList.get(NumConstant.ZERO).getAgencyId(), deptScoreAvgList.get(NumConstant.ZERO).getParentId()); + sizeOne(deptScoreAvgList.get(NumConstant.ZERO).getAgencyId(), customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), pid); return; } else if (deptScoreAvgList.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(deptScoreAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -206,6 +215,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { + pid.put(c.getAgencyId(), c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -220,7 +230,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), pid); deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); return true; } @@ -239,12 +249,14 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return false; } List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); if (subStreetAvgList.size() == NumConstant.ONE) { - sizeOne(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); + pid.put(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(), subStreetAvgList.get(NumConstant.ZERO).getParentId()); + sizeOne(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(), customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), pid); return; } else if (subStreetAvgList.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subStreetAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -253,6 +265,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); serviceAvg.forEach(c -> { + pid.put(c.getAgencyId(), c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -266,7 +279,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode()); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), pid); deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); return true; } @@ -302,6 +315,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict score.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); value.forEach(community -> { score.setScore(score.getScore().add(community.getScore())); + score.setParentAgencyId(community.getParentAgencyId()); }); result.add(score); }); @@ -342,16 +356,16 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } /** + * @param scoreCountOfSampleId 指标计算结果 + * @param customerId 客户ID + * @param monthId 月份ID + * @param isTotal 是否 总分【党建+治理+服务】 + * @param indexCode 党建能力:dangjiannengli,治理能力:zhilinengli,服务能力:fuwunengli,xx相关:xx相关 * @Description - * @param scoreCountOfSampleId 指标计算结果 - * @param customerId 客户ID - * @param monthId 月份ID - * @param isTotal 是否 总分【党建+治理+服务】 - * @param indexCode 党建能力:dangjiannengli,治理能力:zhilinengli,服务能力:fuwunengli,xx相关:xx相关 * @author zxc * @date 2020/9/2 2:37 下午 */ - public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode) { + public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode, Map pid) { List result = new ArrayList<>(); scoreCountOfSampleId.forEach((k, v) -> { AgencyScoreDTO score = new AgencyScoreDTO(); @@ -364,23 +378,28 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict score.setIndexCode(indexCode); score.setScore(v); score.setDataType(IndexCalConstant.DISTRICT_LEVEL); + pid.forEach((agency, parentAgency) -> { + if (k.equals(agency)) { + score.setParentAgencyId(parentAgency); + } + }); result.add(score); }); return result; } /** - * @Description 当查询结果为一条时,调用此方法 * @param agencyId * @param customerId * @param monthId + * @Description 当查询结果为一条时,调用此方法 * @author zxc * @date 2020/9/2 2:40 下午 */ - public void sizeOne(String agencyId,String customerId,String monthId,String indexCode){ + public void sizeOne(String agencyId, String customerId, String monthId, String indexCode, Map pid) { HashMap scoreCountOfSampleId = new HashMap<>(); - scoreCountOfSampleId.put(agencyId,new BigDecimal(NumConstant.FIFTY)); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, indexCode); + scoreCountOfSampleId.put(agencyId, new BigDecimal(NumConstant.FIFTY)); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, indexCode, pid); deleteAndInsert(customerId, monthId, indexCode, result); } } 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 64e1f67591..099c69c125 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 @@ -105,6 +105,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return false; } List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); //下属所有社区的党建能力平均值 detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { @@ -112,16 +113,18 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ if (CollectionUtils.isEmpty(subCommPartyAvgScore)) { log.error(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL); return; - }else if (subCommPartyAvgScore.size() == NumConstant.ONE){ - sizeOne(subCommPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + } else if (subCommPartyAvgScore.size() == NumConstant.ONE) { + pid.put(subCommPartyAvgScore.get(NumConstant.ZERO).getAgencyId(), subCommPartyAvgScore.get(NumConstant.ZERO).getParentId()); + sizeOne(subCommPartyAvgScore.get(NumConstant.ZERO).getAgencyId(), customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), pid); return; - }else if (subCommPartyAvgScore.size() > NumConstant.ONE) { + } else if (subCommPartyAvgScore.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); Integer indexEnd = NumConstant.TEN; List> partition = ListUtils.partition(subCommPartyAvgScore, indexEnd); partition.forEach(publish -> { List index1SampleValues = new ArrayList<>(); publish.forEach(c -> { + pid.put(c.getAgencyId(), c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -139,18 +142,20 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldName)) { - log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); return; - }else if (mapList.size() == NumConstant.ONE){ - sizeOne(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + } else if (mapList.size() == NumConstant.ONE) { + pid.put(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(), mapList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); + sizeOne(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(), customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), pid); return; - }else if (mapList.size() > NumConstant.ONE) { + } else if (mapList.size() > NumConstant.ONE) { 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); }); @@ -162,7 +167,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), pid); deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); return true; } @@ -181,11 +186,13 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return false; } List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) { List subGridGovernAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (subGridGovernAvg.size() == NumConstant.ONE) { - sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + pid.put(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(), subGridGovernAvg.get(NumConstant.ZERO).getParentId()); + sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(), customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), pid); return; } else if (subGridGovernAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -193,6 +200,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { + pid.put(c.getAgencyId(), c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -208,7 +216,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.error(IndexCalConstant.STREET_GOVERN_ABILITY_NULL); return; }else if (communityGovernAbility.size() == NumConstant.ONE) { - sizeOne(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + pid.put(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(), communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); + sizeOne(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(), customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), pid); return; } else if (communityGovernAbility.size() > NumConstant.ONE) { String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); @@ -224,6 +233,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ System.err.println(detail.getCorrelation()); List index1SampleValues = new ArrayList<>(); governAbility.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); }); @@ -235,7 +245,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), pid); deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); return true; } @@ -254,12 +264,14 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return false; } List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) { List subCommServiceAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); if (subCommServiceAvg.size() == NumConstant.ONE) { - sizeOne(subCommServiceAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); + pid.put(subCommServiceAvg.get(NumConstant.ZERO).getAgencyId(), subCommServiceAvg.get(NumConstant.ZERO).getParentId()); + sizeOne(subCommServiceAvg.get(NumConstant.ZERO).getAgencyId(), customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), pid); return; } else if (subCommServiceAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -268,6 +280,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); serviceAvg.forEach(c -> { + pid.put(c.getAgencyId(), c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -281,7 +294,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.error(IndexCalConstant.STREET_SERVICE_ABILITY_NULL); return; }else if (communityActivityCountList.size() == NumConstant.ONE) { - sizeOne(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); + pid.put(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(), communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); + sizeOne(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(), customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), pid); return; } else if (communityActivityCountList.size() > NumConstant.ONE) { String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); @@ -296,6 +310,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); communityActivity.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); }); @@ -307,7 +322,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode()); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), pid + ); deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); return true; } @@ -343,6 +359,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ score.setDataType(IndexCalConstant.STREET_LEVEL); value.forEach(street -> { score.setScore(score.getScore().add(street.getScore())); + score.setParentAgencyId(street.getParentAgencyId()); }); result.add(score); }); @@ -383,16 +400,16 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } /** + * @param scoreCountOfSampleId 指标计算结果 + * @param customerId 客户ID + * @param monthId 月份ID + * @param isTotal 是否 总分【党建+治理+服务】 + * @param indexCode 党建能力:dangjiannengli,治理能力:zhilinengli,服务能力:fuwunengli,xx相关:xx相关 * @Description - * @param scoreCountOfSampleId 指标计算结果 - * @param customerId 客户ID - * @param monthId 月份ID - * @param isTotal 是否 总分【党建+治理+服务】 - * @param indexCode 党建能力:dangjiannengli,治理能力:zhilinengli,服务能力:fuwunengli,xx相关:xx相关 * @author zxc * @date 2020/9/2 2:37 下午 */ - public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode) { + public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode, Map pid) { List result = new ArrayList<>(); scoreCountOfSampleId.forEach((k, v) -> { AgencyScoreDTO score = new AgencyScoreDTO(); @@ -404,23 +421,28 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ score.setIsTotal(isTotal); score.setIndexCode(indexCode); score.setScore(v); + pid.forEach((agency, parentAgency) -> { + if (k.equals(agency)) { + score.setParentAgencyId(parentAgency); + } + }); result.add(score); }); return result; } /** - * @Description 当查询结果为一条时,调用此方法 * @param agencyId * @param customerId * @param monthId + * @Description 当查询结果为一条时,调用此方法 * @author zxc * @date 2020/9/2 2:40 下午 */ - public void sizeOne(String agencyId,String customerId,String monthId,String indexCode){ + public void sizeOne(String agencyId, String customerId, String monthId, String indexCode, Map pid) { HashMap scoreCountOfSample = new HashMap<>(); - scoreCountOfSample.put(agencyId,new BigDecimal(NumConstant.FIFTY)); - List result = getResult(scoreCountOfSample, customerId, monthId, NumConstant.ZERO_STR, indexCode); + scoreCountOfSample.put(agencyId, new BigDecimal(NumConstant.FIFTY)); + List result = getResult(scoreCountOfSample, customerId, monthId, NumConstant.ZERO_STR, indexCode, pid); deleteAndInsert(customerId, monthId, indexCode, result); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index 683a939b8a..6ba627fd68 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -5,13 +5,14 @@ - INSERT INTO fact_index_agency_score (ID, CUSTOMER_ID, AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, IS_TOTAL, SCORE, INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + INSERT INTO fact_index_agency_score (ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, IS_TOTAL, SCORE, INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) VALUES ( REPLACE ( UUID(), '-', '' ), #{item.customerId}, #{item.agencyId}, + #{item.parentAgencyId}, #{item.yearId}, #{item.quarterId}, #{item.monthId}, @@ -46,6 +47,7 @@ SELECT CUSTOMER_ID customerId, AGENCY_ID agencyId, + PARENT_AGENCY_ID parentAgencyId, YEAR_ID yearId, MONTH_ID monthId, IS_TOTAL isTotal, @@ -69,7 +71,8 @@ QUARTER_ID, YEAR_ID, SCORE, - INDEX_CODE + INDEX_CODE, + PARENT_AGENCY_ID FROM fact_index_agency_score WHERE @@ -88,7 +91,8 @@ fics.quarter_id, fics.year_id, ROUND(AVG( fics.score ),6) AS score, - fics.customer_id + fics.customer_id, + PARENT_AGENCY_ID AS parentId FROM fact_index_agency_score fics WHERE @@ -107,6 +111,7 @@ CUSTOMER_ID, AGENCY_ID, + PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, @@ -127,6 +132,7 @@ (SELECT REPLACE(UUID(), '-', '') AS id), #{customerId}, #{item.agencyId}, + #{item.parentAgencyId}, #{item.yearId}, #{item.quarterId}, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml index 09a2b752d7..919dec3b2b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml @@ -5,13 +5,14 @@ - INSERT INTO fact_index_community_score ( ID, CUSTOMER_ID, AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, IS_TOTAL, SCORE, INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + INSERT INTO fact_index_community_score ( ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, IS_TOTAL, SCORE, INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) VALUES ( REPLACE(UUID(),'-',''), #{item.customerId}, #{item.agencyId}, + #{item.parentAgencyId}, #{item.yearId}, #{item.quarterId}, #{item.monthId}, @@ -49,7 +50,8 @@ QUARTER_ID, YEAR_ID, SCORE, - INDEX_CODE + INDEX_CODE, + PARENT_AGENCY_ID FROM fact_index_community_score WHERE @@ -86,6 +88,7 @@ SELECT CUSTOMER_ID customerId, AGENCY_ID agencyId, + PARENT_AGENCY_ID parentAgencyId, YEAR_ID yearId, MONTH_ID monthId, IS_TOTAL isTotal, @@ -106,6 +109,7 @@ ID, CUSTOMER_ID, AGENCY_ID, + PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, @@ -124,6 +128,7 @@ (SELECT REPLACE(UUID(), '-', '') AS id), #{customerId}, #{item.agencyId}, + #{item.parentAgencyId}, #{item.yearId}, #{item.quarterId}, From b109e1ceaab3eaed7c21cb39af4c7174719de3e9 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Tue, 8 Sep 2020 15:57:11 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E6=8C=87=E6=A0=87=E9=87=87=E9=9B=86?= =?UTF-8?q?=E3=80=81=E5=A4=A7=E5=B1=8F=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86?= =?UTF-8?q?=EF=BC=8C=E6=89=80=E6=9C=89=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=85=A5?= =?UTF-8?q?=E5=8F=82=E4=BF=AE=E6=94=B9=EF=BC=9B=20=E8=A1=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=88=A0=E9=99=A4=EF=BC=8C=E6=96=B9=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/DeptGovrnAbilityDataFormDTO.java | 30 ++ .../form/GridGovrnAbilityDataFormDTO.java | 30 ++ .../form/GridPartyAbilityDataFormDTO.java | 30 ++ .../form/GridPartyMemberDataFormDTO.java | 2 +- .../form/GridServiceAbilityDataFormDTO.java | 28 ++ .../form/OrgGovrnAbilityDataFormDTO.java | 30 ++ .../form/OrgPartyAbilityDataFormDTO.java | 30 ++ .../form/OrgServiceAbilityDataFormDTO.java | 29 ++ .../form/CpcBaseDataListFormDTO.java | 25 ++ .../form/CustomerAgencyListFormDTO.java | 25 ++ .../form/CustomerDeptListFormDTO.java | 24 + .../form/CustomerGridListFormDTO.java | 24 + .../form/DifficultyDataFormDTO.java | 2 +- .../screencoll/form/EventDataListFormDTO.java | 28 ++ .../form/GovernRankDataListFormDTO.java | 29 ++ .../form/IndexDataListMonthlyFormDTO.java | 29 ++ .../form/IndexDataListYearlyFormDTO.java | 29 ++ .../form/OrgRankDataListFormDTO.java | 29 ++ .../form/PartyBranchDataListFormDTO.java | 29 ++ .../form/PartyLinkMassesDataListFormDTO.java | 24 + .../form/PartyUserRankDataListFormDTO.java | 24 + .../form/PioneerDataListFormDTO.java | 25 ++ .../form/PublicPartiTotalDataListFormDTO.java | 25 ++ .../screencoll/form/UserJoinListFormDTO.java | 29 ++ .../form/UserTotalDataListFormDTO.java | 24 + .../FactIndexCollectController.java | 22 +- .../controller/ScreenCollController.java | 32 +- .../FactIndexGovrnAblityDeptMonthlyDao.java | 16 +- .../FactIndexGovrnAblityGridMonthlyDao.java | 11 +- .../FactIndexGovrnAblityOrgMonthlyDao.java | 13 +- .../FactIndexPartyAblityGridMonthlyDao.java | 15 +- .../FactIndexPartyAblityOrgMonthlyDao.java | 13 +- .../FactIndexServiceAblityGridMonthlyDao.java | 17 +- .../FactIndexServiceAblityOrgMonthlyDao.java | 13 +- .../screen/ScreenCpcBaseDataDao.java | 7 +- .../screen/ScreenCustomerAgencyDao.java | 7 +- .../screen/ScreenCustomerDeptDao.java | 7 +- .../screen/ScreenCustomerGridDao.java | 7 +- .../screen/ScreenDifficultyDataDao.java | 2 +- .../screen/ScreenEventDataDao.java | 9 +- .../screen/ScreenGovernRankDataDao.java | 11 +- .../screen/ScreenIndexDataMonthlyDao.java | 11 +- .../screen/ScreenIndexDataYearlyDao.java | 9 +- .../screen/ScreenOrgRankDataDao.java | 11 +- .../screen/ScreenPartyBranchDataDao.java | 11 +- .../screen/ScreenPartyLinkMassesDataDao.java | 7 +- .../screen/ScreenPartyUserRankDataDao.java | 9 +- .../screen/ScreenPioneerDataDao.java | 7 +- .../screen/ScreenPublicPartiTotalDataDao.java | 7 +- .../screen/ScreenUserJoinDao.java | 11 +- .../screen/ScreenUserTotalDataDao.java | 7 +- .../indexcoll/FactIndexCollectService.java | 22 +- .../impl/FactIndexCollectServiceImpl.java | 173 +++----- .../screen/ScreenCollService.java | 64 +-- .../screen/impl/ScreenCollServiceImpl.java | 413 +++++++++--------- .../FactIndexGovrnAblityDeptMonthlyDao.xml | 3 +- .../FactIndexGovrnAblityGridMonthlyDao.xml | 4 +- .../FactIndexGovrnAblityOrgMonthlyDao.xml | 7 +- .../FactIndexPartyAblityGridMonthlyDao.xml | 4 +- .../FactIndexPartyAblityOrgMonthlyDao.xml | 7 +- .../FactIndexServiceAblityGridMonthlyDao.xml | 4 +- .../FactIndexServiceAblityOrgMonthlyDao.xml | 7 +- .../screen/ScreenCpcBaseDataDao.xml | 5 +- .../screen/ScreenCustomerAgencyDao.xml | 5 +- .../screen/ScreenCustomerDeptDao.xml | 5 +- .../screen/ScreenCustomerGridDao.xml | 5 +- .../screen/ScreenEventDataDao.xml | 3 +- .../screen/ScreenGovernRankDataDao.xml | 7 +- .../screen/ScreenIndexDataMonthlyDao.xml | 7 +- .../screen/ScreenIndexDataYearlyDao.xml | 5 +- .../screen/ScreenOrgRankDataDao.xml | 7 +- .../screen/ScreenPartyBranchDataDao.xml | 7 +- .../screen/ScreenPartyLinkMassesDataDao.xml | 5 +- .../screen/ScreenPartyUserRankDataDao.xml | 3 +- .../screen/ScreenPioneerDataDao.xml | 5 +- .../screen/ScreenPublicPartiTotalDataDao.xml | 5 +- .../screen/ScreenUserJoinDao.xml | 7 +- .../screen/ScreenUserTotalDataDao.xml | 5 +- .../epmet/feign/EpmetUserOpenFeignClient.java | 4 +- 79 files changed, 1097 insertions(+), 626 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityDataFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityDataFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityDataFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityDataFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityDataFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityDataFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityDataFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CpcBaseDataListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListMonthlyFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListYearlyFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyBranchDataListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyLinkMassesDataListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PublicPartiTotalDataListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataListFormDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityDataFormDTO.java new file mode 100644 index 0000000000..fec0ca391a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityDataFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 8、治理能力-部门相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class DeptGovrnAbilityDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityDataFormDTO.java new file mode 100644 index 0000000000..0e845a808f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityDataFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 6、治理能力-网格相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class GridGovrnAbilityDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityDataFormDTO.java new file mode 100644 index 0000000000..d6f2e68d5c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityDataFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 2、党建能力-网格相关指标上报(按照月份) 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class GridPartyAbilityDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java index 5a0a9fb3c8..6e6eccd2e4 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java @@ -29,5 +29,5 @@ public class GridPartyMemberDataFormDTO implements Serializable { */ private String monthId; - private List partyMemberDataList; + private List dataList; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityDataFormDTO.java new file mode 100644 index 0000000000..1931275dd1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityDataFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 4、服务能力-网格相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class GridServiceAbilityDataFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityDataFormDTO.java new file mode 100644 index 0000000000..59e03a058c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityDataFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 7、治理能力-街道及社区相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class OrgGovrnAbilityDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityDataFormDTO.java new file mode 100644 index 0000000000..2d018cf394 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityDataFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 3、党建能力-街道及社区相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class OrgPartyAbilityDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityDataFormDTO.java new file mode 100644 index 0000000000..e29c218a20 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityDataFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 5、服务能力-组织(街道|社区|全区)相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class OrgServiceAbilityDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CpcBaseDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CpcBaseDataListFormDTO.java new file mode 100644 index 0000000000..1eb4f41225 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CpcBaseDataListFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 2、党员基本情况 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class CpcBaseDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyListFormDTO.java new file mode 100644 index 0000000000..bd9d9feaaa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyListFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 14、组织层级 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class CustomerAgencyListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptListFormDTO.java new file mode 100644 index 0000000000..3a10027b55 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptListFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 16、部门信息上传 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class CustomerDeptListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridListFormDTO.java new file mode 100644 index 0000000000..ea7ec06874 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridListFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 15、网格信息上传 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class CustomerGridListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java index a0de181acb..edac6a656e 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java @@ -21,6 +21,6 @@ public class DifficultyDataFormDTO implements Serializable { /** * 难点堵点数据 */ - private List diffcultyDataList; + private List dataList; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataListFormDTO.java new file mode 100644 index 0000000000..a84a217b60 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataListFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.screencoll.form; + +import com.epmet.dto.indexcollect.form.GridPartyAbilityFormDTO; +import com.epmet.dto.screencoll.ImgDataListDTO; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 4、事件数据(中央区-事件数据) 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class EventDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + private List dataList; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataListFormDTO.java new file mode 100644 index 0000000000..8372ba293e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataListFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 5、基层治理-治理能力数据 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class GovernRankDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListMonthlyFormDTO.java new file mode 100644 index 0000000000..f9a4ad6f48 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListMonthlyFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 1、指数_按月统计 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class IndexDataListMonthlyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListYearlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListYearlyFormDTO.java new file mode 100644 index 0000000000..186f5eb007 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListYearlyFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 17、指数_按年统计 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class IndexDataListYearlyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyy + */ + private String yearId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataListFormDTO.java new file mode 100644 index 0000000000..0d3238ae2a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataListFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 6、党建引领-组织排行 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class OrgRankDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyBranchDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyBranchDataListFormDTO.java new file mode 100644 index 0000000000..8c6a92e7b6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyBranchDataListFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 7、基层党建-建设情况数据(支部、联建、志愿) 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class PartyBranchDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyLinkMassesDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyLinkMassesDataListFormDTO.java new file mode 100644 index 0000000000..da0630fad1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyLinkMassesDataListFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 8、党建引领-党员联系群众数据 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class PartyLinkMassesDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataListFormDTO.java new file mode 100644 index 0000000000..c1784728ae --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataListFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 9、党建引领|基层治理-居民(党员)积分排行榜 入参 + * @Auther: zhangyong + * @Date: 2020-08-21 09:59 + */ +@Data +public class PartyUserRankDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataListFormDTO.java new file mode 100644 index 0000000000..b8a6086721 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataListFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 10、党建引领-先锋模范数据 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class PioneerDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PublicPartiTotalDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PublicPartiTotalDataListFormDTO.java new file mode 100644 index 0000000000..4e2bcaca51 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PublicPartiTotalDataListFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 18、公众参与各类总数 入参 + * 公众参与-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class PublicPartiTotalDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinListFormDTO.java new file mode 100644 index 0000000000..3550be21ad --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinListFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 11、基层治理-公众参与 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class UserJoinListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataListFormDTO.java new file mode 100644 index 0000000000..ebdcc2822a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataListFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 12、中央区各类总数 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class UserTotalDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java index 138ab5cbb7..0a8740c63b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java @@ -4,12 +4,12 @@ import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.indexcollect.form.*; -import com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO; import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; /** * 指标采集相关api @@ -51,7 +51,7 @@ public class FactIndexCollectController { **/ @ExternalAppRequestAuth @PostMapping("gridpartyability") - public Result gridPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result gridPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridPartyAbilityDataFormDTO formDTO) { factIndexCollectService.insertGridPartyAbility(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -67,7 +67,7 @@ public class FactIndexCollectController { **/ @ExternalAppRequestAuth @PostMapping("orgpartyability") - public Result orgPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result orgPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgPartyAbilityDataFormDTO formDTO) { factIndexCollectService.insertOrgPartyAbility(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -83,7 +83,7 @@ public class FactIndexCollectController { **/ @ExternalAppRequestAuth @PostMapping("gridserviceability") - public Result gridServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result gridServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridServiceAbilityDataFormDTO formDTO) { factIndexCollectService.insertGridServiceAbility(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -99,7 +99,7 @@ public class FactIndexCollectController { **/ @ExternalAppRequestAuth @PostMapping("orgserviceability") - public Result orgServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result orgServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgServiceAbilityDataFormDTO formDTO) { factIndexCollectService.insertOrgServiceAbility(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -115,7 +115,7 @@ public class FactIndexCollectController { **/ @ExternalAppRequestAuth @PostMapping("gridgovrnability") - public Result gridGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result gridGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridGovrnAbilityDataFormDTO formDTO) { factIndexCollectService.insertGridGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -131,7 +131,7 @@ public class FactIndexCollectController { **/ @ExternalAppRequestAuth @PostMapping("orggovrnability") - public Result orgGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result orgGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgGovrnAbilityDataFormDTO formDTO) { factIndexCollectService.insertOrgGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -147,7 +147,7 @@ public class FactIndexCollectController { **/ @ExternalAppRequestAuth @PostMapping("deptgovrnability") - public Result deptGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result deptGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody DeptGovrnAbilityDataFormDTO formDTO) { factIndexCollectService.insertDeptGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java index d83f8df3c5..55e91e89d4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java @@ -37,7 +37,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("partyuserrankdata") - public Result partyUserRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result partyUserRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyUserRankDataListFormDTO formDTO) { screenCollService.insertPartyUserRankData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -53,7 +53,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("partylinkmassesdata") - public Result partyLinkMassesData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result partyLinkMassesData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyLinkMassesDataListFormDTO formDTO) { screenCollService.insertPartyLinkMassesData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -69,7 +69,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("meetdata") - public Result meetData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result meetData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyBranchDataListFormDTO formDTO) { screenCollService.insertPartyBranchData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -85,7 +85,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("orgrankdata") - public Result orgRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result orgRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgRankDataListFormDTO formDTO) { screenCollService.insertOrgRankData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -101,7 +101,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("governrankdata") - public Result governRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result governRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody GovernRankDataListFormDTO formDTO) { screenCollService.insertGovernRankData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -117,7 +117,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("eventdata") - public Result eventData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result eventData(ExternalAppRequestParam externalAppRequestParam, @RequestBody EventDataListFormDTO formDTO) { screenCollService.insertEventData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -149,7 +149,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("cpcbasedata") - public Result cpcbaseData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result cpcbaseData(ExternalAppRequestParam externalAppRequestParam, @RequestBody CpcBaseDataListFormDTO formDTO) { screenCollService.insertCpcbaseData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -165,7 +165,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("indexdatamonthly") - public Result indexDataMonthly(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result indexDataMonthly(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexDataListMonthlyFormDTO formDTO) { screenCollService.insertIndexDataMonthly(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -183,7 +183,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("indexdatayearly") - public Result indexDataYearly(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result indexDataYearly(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexDataListYearlyFormDTO formDTO) { screenCollService.insertIndexDataYearly(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -199,7 +199,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("customerdept") - public Result customerDept(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result customerDept(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerDeptListFormDTO formDTO) { screenCollService.insertCustomerDept(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -215,7 +215,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("customergrid") - public Result customerGrid(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result customerGrid(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerGridListFormDTO formDTO) { screenCollService.insertCustomerGrid(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -231,7 +231,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("customeragency") - public Result customerAgency(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result customerAgency(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerAgencyListFormDTO formDTO) { screenCollService.insertCustomerAgency(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -247,7 +247,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("usertotaldata") - public Result userTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result userTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody UserTotalDataListFormDTO formDTO) { screenCollService.insertUserTotalData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -263,7 +263,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("userjoin") - public Result userJoin(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result userJoin(ExternalAppRequestParam externalAppRequestParam, @RequestBody UserJoinListFormDTO formDTO) { screenCollService.insertUserJoin(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -279,7 +279,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("pioneerdata") - public Result pioneerData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result pioneerData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PioneerDataListFormDTO formDTO) { screenCollService.insertPioneerData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -296,7 +296,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("publicpartitotaldata") - public Result publicPartiTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result publicPartiTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PublicPartiTotalDataListFormDTO formDTO) { screenCollService.insertPublicPartiTotalData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java index 5a9350a63e..b4f79644d0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java @@ -37,24 +37,16 @@ import java.util.Map; public interface FactIndexGovrnAblityDeptMonthlyDao extends BaseDao { /** * 8、治理能力-部门相关指标 - * 据CUSTOMER_ID、AGENCY_ID、DEPT_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param agencyId - * @param deptId - * @param yearId * @param monthId - * @param quarterId - * @param customerId + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void deleteFactIndexGovrnAblityDeptMonthly(@Param("customerId") String customerId, - @Param("agencyId") String agencyId, - @Param("deptId") String deptId, - @Param("yearId") String yearId, - @Param("monthId") String monthId, - @Param("quarterId") String quarterId); + Integer deleteFactIndexGovrnAblityDeptMonthly(@Param("customerId") String customerId, + @Param("monthId") String monthId); /** * 8、治理能力-部门相关指标 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java index 55d0e5730b..5e0c308c5f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java @@ -47,15 +47,12 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao { /** * 7、治理能力-街道及社区相关指标 - * 据CUSTOMER_ID、AGENCY_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param yearId * @param monthId - * @param quarterId - * @param agencyIds + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void deleteFactIndexGovrnAblityOrgMonthly(@Param("customerId") String customerId, - @Param("yearId") String yearId, - @Param("monthId") String monthId, - @Param("quarterId") String quarterId, - @Param("agencyIds") String[] agencyIds); + Integer deleteFactIndexGovrnAblityOrgMonthly(@Param("customerId") String customerId, + @Param("monthId") String monthId); /** * 7、治理能力-街道及社区相关指标 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java index aeaf65e6b5..6e2dbcaee5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java @@ -39,23 +39,16 @@ public interface FactIndexPartyAblityGridMonthlyDao extends BaseDao { /** * 4、服务能力-网格相关指标 - * 根据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param agencyId - * @param gridId - * @param yearId * @param monthId - * @param quarterId + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void deleteFactIndexServiceAblityGridMonthly(@Param("customerId") String customerId, - @Param("agencyId") String agencyId, - @Param("gridId") String gridId, - @Param("yearId") String yearId, - @Param("monthId") String monthId, - @Param("quarterId") String quarterId); + Integer deleteFactIndexServiceAblityGridMonthly(@Param("customerId") String customerId, + @Param("monthId") String monthId); /** * 4、服务能力-网格相关指标 @@ -91,7 +84,7 @@ public interface FactIndexServiceAblityGridMonthlyDao extends BaseDao { /** * 2、党员基本情况 - * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param orgIds 组织Id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteCpcBaseData(@Param("customerId") String customerId, - @Param("orgIds") String[] orgIds); + Integer deleteCpcBaseData(@Param("customerId") String customerId); /** * 2、党员基本情况 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index 4912171860..c2dc598bfa 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -35,15 +35,14 @@ import java.util.List; public interface ScreenCustomerAgencyDao extends BaseDao { /** *14、组织层级 - * 1) 根据CUSTOMER_ID、AGENCY_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID 进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param agencyIds 组织id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteCustomerAgency(@Param("customerId") String customerId, - @Param("agencyIds") String[] agencyIds); + Integer deleteCustomerAgency(@Param("customerId") String customerId); /** * 14、组织层级 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java index 53a5fcf042..cbe11d059c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java @@ -36,15 +36,14 @@ public interface ScreenCustomerDeptDao extends BaseDao /** *16、部门信息上传 - * 1) 根据CUSTOMER_ID、DEPT_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID 进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param deptIds 部门Id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteCustomerDept(@Param("customerId") String customerId, - @Param("deptIds") String[] deptIds); + Integer deleteCustomerDept(@Param("customerId") String customerId); /** * 16、部门信息上传 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java index 005f69289b..c6aac179af 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java @@ -37,15 +37,14 @@ import java.util.List; public interface ScreenCustomerGridDao extends BaseDao { /** *15、网格信息上传 - * 1) 根据CUSTOMER_ID、GRID_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID 进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param gridIds 网格Id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteCustomerGrid(@Param("customerId") String customerId, - @Param("gridIds") String[] gridIds); + Integer deleteCustomerGrid(@Param("customerId") String customerId); /** * 15、网格信息上传 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 412ab70225..d6dfeac5f8 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 @@ -36,7 +36,7 @@ import java.util.List; public interface ScreenDifficultyDataDao extends BaseDao { /** * 3、难点赌点 - * 1) 根据CUSTOMER_ID、EVENT_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除 * @param customerId 一 * @Author zhangyong diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventDataDao.java index 14c0153f62..71c0f203e1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventDataDao.java @@ -35,17 +35,14 @@ import java.util.List; public interface ScreenEventDataDao extends BaseDao { /** * 4、事件数据 - * 1) 根据CUSTOMER_ID、EVENT_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId 一 - * @param eventId 多 - * @param orgId 多 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteEventData(@Param("customerId")String customerId, - @Param("eventId")String eventId, - @Param("orgId")String orgId); + Integer deleteEventData(@Param("customerId")String customerId); /** * 4、事件数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java index 3dca5cc281..24e3d65a09 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java @@ -35,19 +35,16 @@ import java.util.List; public interface ScreenGovernRankDataDao extends BaseDao { /** * 5、基层治理-治理能力数据 - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param yearId * @param monthId - * @param orgIds 组织Id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteGovernRankData(@Param("customerId") String customerId, - @Param("yearId") String yearId, - @Param("monthId") String monthId, - @Param("orgIds") String[] orgIds); + Integer deleteGovernRankData(@Param("customerId") String customerId, + @Param("monthId") String monthId); /** * 5、基层治理-治理能力数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java index 4ebfc825e4..760e7abc5f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java @@ -36,19 +36,16 @@ public interface ScreenIndexDataMonthlyDao extends BaseDao { /** * 6、党建引领-组织排行 - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param yearId * @param monthId - * @param orgIds 组织Id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteOrgRankData(@Param("customerId") String customerId, - @Param("yearId") String yearId, - @Param("monthId") String monthId, - @Param("orgIds") String[] orgIds); + Integer deleteOrgRankData(@Param("customerId") String customerId, + @Param("monthId") String monthId); /** * 6、党建引领-组织排行 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java index 3f2de14703..385f27d2f9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java @@ -35,19 +35,16 @@ import java.util.List; public interface ScreenPartyBranchDataDao extends BaseDao { /** * 7、基层党建-建设情况数据(支部、联建、志愿) - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param yearId * @param monthId - * @param orgIds 组织Id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deletePartyBranchData(@Param("customerId") String customerId, - @Param("yearId") String yearId, - @Param("monthId") String monthId, - @Param("orgIds") String[] orgIds); + Integer deletePartyBranchData(@Param("customerId") String customerId, + @Param("monthId") String monthId); /** * 7、基层党建-建设情况数据(支部、联建、志愿) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java index 931c05c6bf..857958ad1c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java @@ -36,15 +36,14 @@ public interface ScreenPartyLinkMassesDataDao extends BaseDao { /** * 10、党建引领-先锋模范数据 - * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param orgIds 组织Id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deletePioneerData(@Param("customerId") String customerId, - @Param("orgIds") String[] orgIds); + Integer deletePioneerData(@Param("customerId") String customerId); /** * 10、党建引领-先锋模范数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java index 5bc9ea4130..fd2fdac941 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java @@ -37,15 +37,14 @@ public interface ScreenPublicPartiTotalDataDao extends BaseDao { /** * 11、基层治理-公众参与 - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param yearId * @param monthId - * @param orgIds 组织Id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteUserJoin(@Param("customerId") String customerId, - @Param("yearId") String yearId, - @Param("monthId") String monthId, - @Param("orgIds") String[] orgIds); + Integer deleteUserJoin(@Param("customerId") String customerId, + @Param("monthId") String monthId); /** * 11、基层治理-公众参与 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java index 5595259af6..f09189dce0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java @@ -36,15 +36,14 @@ public interface ScreenUserTotalDataDao extends BaseDao formDTO, String customerId); + void insertGridPartyAbility(GridPartyAbilityDataFormDTO formDTO, String customerId); /** * 3、党建能力-街道及社区相关指标 - * 根据CUSTOMER_ID、AGENCY_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param formDTO * @param customerId @@ -46,11 +46,11 @@ public interface FactIndexCollectService { * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void insertOrgPartyAbility(List formDTO, String customerId); + void insertOrgPartyAbility(OrgPartyAbilityDataFormDTO formDTO, String customerId); /** * 4、服务能力-网格相关指标 - * 据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param formDTO * @param customerId @@ -58,11 +58,11 @@ public interface FactIndexCollectService { * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void insertGridServiceAbility(List formDTO, String customerId); + void insertGridServiceAbility(GridServiceAbilityDataFormDTO formDTO, String customerId); /** * 5、服务能力-组织(街道|社区|全区)相关指标 - * 据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param formDTO * @param customerId @@ -70,7 +70,7 @@ public interface FactIndexCollectService { * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void insertOrgServiceAbility(List formDTO, String customerId); + void insertOrgServiceAbility(OrgServiceAbilityDataFormDTO formDTO, String customerId); /** * 6、治理能力-网格相关指标 @@ -82,7 +82,7 @@ public interface FactIndexCollectService { * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void insertGridGovrnAbility(List formDTO, String customerId); + void insertGridGovrnAbility(GridGovrnAbilityDataFormDTO formDTO, String customerId); /** * 7、治理能力-街道及社区相关指标 @@ -94,7 +94,7 @@ public interface FactIndexCollectService { * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void insertOrgGovrnAbility(List formDTO, String customerId); + void insertOrgGovrnAbility(OrgGovrnAbilityDataFormDTO formDTO, String customerId); /** * 8、治理能力-部门相关指标 @@ -106,7 +106,7 @@ public interface FactIndexCollectService { * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void insertDeptGovrnAbility(List formDTO, String customerId); + void insertDeptGovrnAbility(DeptGovrnAbilityDataFormDTO formDTO, String customerId); /** * 将网格、社区、区直部门、区/街道分支记录表中的数据,抽取到 指数-指数数据(每月数值) 指数-指数数据(按年统计) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java index 2d6a2c48ed..02cd42be2a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java @@ -1,7 +1,6 @@ package com.epmet.service.evaluationindex.indexcoll.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; @@ -27,8 +26,6 @@ import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; import com.epmet.eum.IndexCodeEnum; import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; import lombok.extern.slf4j.Slf4j; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -48,7 +45,6 @@ import java.util.stream.Collectors; @Service @DataSource(DataSourceConstant.EVALUATION_INDEX) public class FactIndexCollectServiceImpl implements FactIndexCollectService { - private static final Logger log = LoggerFactory.getLogger(FactIndexCollectServiceImpl.class); @Autowired private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; @@ -96,118 +92,113 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { deleteNum = factIndexPartyAblityCpcMonthlyDao.deleteFactIndexPartyAblityCpcMonthly(customerId, formDTO.getMonthId()); } while (deleteNum != NumConstant.ZERO); } - if (null != formDTO && !CollectionUtils.isEmpty(formDTO.getPartyMemberDataList())) { - factIndexPartyAblityCpcMonthlyDao.batchInsertFactIndexPartyAblityCpcMonthly(formDTO.getPartyMemberDataList(), customerId); + if (null != formDTO && !CollectionUtils.isEmpty(formDTO.getDataList())) { + factIndexPartyAblityCpcMonthlyDao.batchInsertFactIndexPartyAblityCpcMonthly(formDTO.getDataList(), customerId); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertGridPartyAbility(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - factIndexPartyAblityGridMonthlyDao.deleteFactIndexPartyAblityGridMonthly(customerId, - formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getYearId(), - formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); - } - factIndexPartyAblityGridMonthlyDao.batchInsertFactIndexPartyAblityGridMonthly(formDTO, customerId); + public void insertGridPartyAbility(GridPartyAbilityDataFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = factIndexPartyAblityGridMonthlyDao.deleteFactIndexPartyAblityGridMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if ( !CollectionUtils.isEmpty(formDTO.getDataList())) { + factIndexPartyAblityGridMonthlyDao.batchInsertFactIndexPartyAblityGridMonthly(formDTO.getDataList(), customerId); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertOrgPartyAbility(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] agencyIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - agencyIds[i] = formDTO.get(i).getAgencyId(); - } - factIndexPartyAblityOrgMonthlyDao.deleteFactIndexPartyAblityOrgMonthly(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - formDTO.get(NumConstant.ZERO).getMonthId(), - formDTO.get(NumConstant.ZERO).getQuarterId(), - agencyIds); - factIndexPartyAblityOrgMonthlyDao.batchInsertFactIndexPartyAblityOrgMonthly(formDTO, customerId); + public void insertOrgPartyAbility(OrgPartyAbilityDataFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = factIndexPartyAblityOrgMonthlyDao.deleteFactIndexPartyAblityOrgMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + factIndexPartyAblityOrgMonthlyDao.batchInsertFactIndexPartyAblityOrgMonthly(formDTO.getDataList(), customerId); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertGridServiceAbility(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - factIndexServiceAblityGridMonthlyDao.deleteFactIndexServiceAblityGridMonthly(customerId, - formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getYearId(), - formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); - } - factIndexServiceAblityGridMonthlyDao.batchInsertFactIndexServiceAblityGridMonthly(formDTO, customerId); + public void insertGridServiceAbility(GridServiceAbilityDataFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = factIndexServiceAblityGridMonthlyDao.deleteFactIndexServiceAblityGridMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + factIndexServiceAblityGridMonthlyDao.batchInsertFactIndexServiceAblityGridMonthly(formDTO.getDataList(), customerId); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertOrgServiceAbility(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] agencyIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - agencyIds[i] = formDTO.get(i).getAgencyId(); - } - factIndexServiceAblityOrgMonthlyDao.deleteFactIndexServiceAblityOrgMonthly(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - formDTO.get(NumConstant.ZERO).getMonthId(), - formDTO.get(NumConstant.ZERO).getQuarterId(), - agencyIds); - factIndexServiceAblityOrgMonthlyDao.batchInsertFactIndexServiceAblityOrgMonthly(formDTO, customerId); + public void insertOrgServiceAbility(OrgServiceAbilityDataFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = factIndexServiceAblityOrgMonthlyDao.deleteFactIndexServiceAblityOrgMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + factIndexServiceAblityOrgMonthlyDao.batchInsertFactIndexServiceAblityOrgMonthly(formDTO.getDataList(), customerId); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertGridGovrnAbility(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - factIndexGovrnAblityGridMonthlyDao.deleteFactIndexGovrnAblityGridMonthly(customerId, - formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getYearId(), - formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); - } - factIndexGovrnAblityGridMonthlyDao.batchInsertFactIndexGovrnAblityGridMonthly(formDTO, customerId); + public void insertGridGovrnAbility(GridGovrnAbilityDataFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = factIndexGovrnAblityGridMonthlyDao.deleteFactIndexGovrnAblityGridMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + factIndexGovrnAblityGridMonthlyDao.batchInsertFactIndexGovrnAblityGridMonthly(formDTO.getDataList(), customerId); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertOrgGovrnAbility(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] agencyIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - agencyIds[i] = formDTO.get(i).getAgencyId(); - } - factIndexGovrnAblityOrgMonthlyDao.deleteFactIndexGovrnAblityOrgMonthly(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - formDTO.get(NumConstant.ZERO).getMonthId(), - formDTO.get(NumConstant.ZERO).getQuarterId(), - agencyIds); - factIndexGovrnAblityOrgMonthlyDao.batchInsertFactIndexGovrnAblityOrgMonthly(formDTO, customerId); + public void insertOrgGovrnAbility(OrgGovrnAbilityDataFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = factIndexGovrnAblityOrgMonthlyDao.deleteFactIndexGovrnAblityOrgMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + factIndexGovrnAblityOrgMonthlyDao.batchInsertFactIndexGovrnAblityOrgMonthly(formDTO.getDataList(), customerId); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertDeptGovrnAbility(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - factIndexGovrnAblityDeptMonthlyDao.deleteFactIndexGovrnAblityDeptMonthly(customerId, - formDTO.get(i).getAgencyId(), formDTO.get(i).getDeptId(), formDTO.get(i).getYearId(), - formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); - } - factIndexGovrnAblityDeptMonthlyDao.batchInsertFactIndexGovrnAblityDeptMonthly(formDTO, customerId); + public void insertDeptGovrnAbility(DeptGovrnAbilityDataFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = factIndexGovrnAblityDeptMonthlyDao.deleteFactIndexGovrnAblityDeptMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + factIndexGovrnAblityDeptMonthlyDao.batchInsertFactIndexGovrnAblityDeptMonthly(formDTO.getDataList(), customerId); } } @@ -283,13 +274,9 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { Map> collect = gridScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexGridScoreDTO::getGridId)); // 查询网格的 上级组织id 和 组织名称 List parentGridList = screenCustomerGridDao.selectListGridInfo(customerId); - String[] orgIds = new String[collect.size()]; - int j = 0; for(Map.Entry> gridScore : collect.entrySet()){ IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); - // 网格id - orgIds[j] = gridScore.getKey(); - j++; + // 给4个指数 赋默认值 monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); for ( int i = 0; i < gridScore.getValue().size(); i++){ @@ -324,7 +311,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); + screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, monthId); screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); } } @@ -382,13 +369,8 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { Map> collect = communityScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexCommunityScoreDTO::getAgencyId)); // 根据客户id,查询区/街道 组织名称、id List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId); - String[] orgIds = new String[collect.size()]; - int j = 0; for(Map.Entry> communityScore : collect.entrySet()){ IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); - // 组织id - orgIds[j] = communityScore.getKey(); - j++; // 给4个指数 赋默认值 monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); for ( int i = 0; i < communityScore.getValue().size(); i++){ @@ -425,7 +407,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); + screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, monthId); screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); } } @@ -478,13 +460,8 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 根据部门id 进行分组,最后组装一条数据 一个部门id 对应 4条数据 Map> collect = deptScoreDTOS.stream().collect(Collectors.groupingBy(DeptScoreDTO::getDeptId)); List parentDeptList = screenCustomerDeptDao.selectListDeptInfo(customerId); - String[] orgIds = new String[collect.size()]; - int j = 0; for(Map.Entry> deptScore : collect.entrySet()){ IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); - // 部门id - orgIds[j] = deptScore.getKey(); - j++; // 给4个指数 赋默认值 monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); for ( int i = 0; i < deptScore.getValue().size(); i++){ @@ -513,7 +490,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); + screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, monthId); screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); } } @@ -564,13 +541,9 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 根据组织id(eg:社区或者街道id) 进行分组,最后组装一条数据 一个组织id 对应 4条数据 Map> collect = agencyScoreDTOS.stream().collect(Collectors.groupingBy(AgencyScoreDTO::getAgencyId)); List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId); - String[] orgIds = new String[collect.size()]; int j = 0; for(Map.Entry> agencyScore : collect.entrySet()){ IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); - // 组织id(eg:社区或者街道id) - orgIds[j] = agencyScore.getKey(); - j++; // 给4个指数 赋默认值 monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); for ( int i = 0; i < agencyScore.getValue().size(); i++){ @@ -602,7 +575,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); + screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, monthId); screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); } } @@ -872,12 +845,8 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { **/ private void insertIndexDataYear(String monthId, String customerId){ List monthlyFormList = screenIndexDataMonthlyDao.selectListIndexDataMonthlyByYear(customerId, getYearStr(monthId), getMonthStr(monthId)); - String[] orgIds = new String[monthlyFormList.size()]; - for (int i = NumConstant.ZERO; i < monthlyFormList.size(); i++){ - orgIds[i] = monthlyFormList.get(i).getOrgId(); - } if (monthlyFormList.size() > NumConstant.ZERO){ - screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, getYearStr(monthId), orgIds); + screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, getYearStr(monthId)); List entity = ConvertUtils.sourceToTarget(monthlyFormList, IndexDataYearlyFormDTO.class); screenIndexDataYearlyDao.batchInsertIndexDataYearly(entity, customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCollService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCollService.java index 1e6dca0080..29be14a3d2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCollService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCollService.java @@ -13,7 +13,7 @@ public interface ScreenCollService { /** * 9、党建引领|基层治理-居民(党员)积分排行榜 - * 1) 根据CUSTOMER_ID、GRID_ID、USER_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -22,11 +22,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertPartyUserRankData(List formDTO, String customerId); + void insertPartyUserRankData(PartyUserRankDataListFormDTO formDTO, String customerId); /** * 8、党建引领-党员联系群众数据 - * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -35,11 +35,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertPartyLinkMassesData(List formDTO, String customerId); + void insertPartyLinkMassesData(PartyLinkMassesDataListFormDTO formDTO, String customerId); /** * 7、基层党建-建设情况数据(支部、联建、志愿) - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -48,11 +48,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertPartyBranchData(List formDTO, String customerId); + void insertPartyBranchData(PartyBranchDataListFormDTO formDTO, String customerId); /** * 6、党建引领-组织排行 - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -61,11 +61,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertOrgRankData(List formDTO, String customerId); + void insertOrgRankData(OrgRankDataListFormDTO formDTO, String customerId); /** * 5、基层治理-治理能力数据 - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -74,11 +74,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertGovernRankData(List formDTO, String customerId); + void insertGovernRankData(GovernRankDataListFormDTO formDTO, String customerId); /** * 4、事件数据 - * 1) 根据CUSTOMER_ID、EVENT_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -87,11 +87,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertEventData(List formDTO, String customerId); + void insertEventData(EventDataListFormDTO formDTO, String customerId); /** * 3、难点赌点 - * 1) 根据CUSTOMER_ID、EVENT_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除 * 2) 在新增 * * @param formDTO @@ -104,7 +104,7 @@ public interface ScreenCollService { /** * 2、党员基本情况 - * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -113,11 +113,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertCpcbaseData(List formDTO, String customerId); + void insertCpcbaseData(CpcBaseDataListFormDTO formDTO, String customerId); /** * 1、指数_按月统计 - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -126,11 +126,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertIndexDataMonthly(List formDTO, String customerId); + void insertIndexDataMonthly(IndexDataListMonthlyFormDTO formDTO, String customerId); /** * 17、指数_按年统计 - * 1) 根据CUSTOMER_ID、YEAR_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、YEAR_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -139,11 +139,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertIndexDataYearly(List formDTO, String customerId); + void insertIndexDataYearly(IndexDataListYearlyFormDTO formDTO, String customerId); /** * 16、部门信息上传 - * 1) 根据CUSTOMER_ID、DEPT_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID 进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -152,11 +152,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertCustomerDept(List formDTO, String customerId); + void insertCustomerDept(CustomerDeptListFormDTO formDTO, String customerId); /** * 15、网格信息上传 - * 1) 根据CUSTOMER_ID、GRID_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID 进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -165,11 +165,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertCustomerGrid(List formDTO, String customerId); + void insertCustomerGrid(CustomerGridListFormDTO formDTO, String customerId); /** * 14、组织层级 - * 1) 根据CUSTOMER_ID、AGENCY_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID 进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -178,7 +178,7 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertCustomerAgency(List formDTO, String customerId); + void insertCustomerAgency(CustomerAgencyListFormDTO formDTO, String customerId); /** * 12、中央区各类总数 @@ -191,11 +191,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertUserTotalData(List formDTO, String customerId); + void insertUserTotalData(UserTotalDataListFormDTO formDTO, String customerId); /** * 11、基层治理-公众参与 - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -204,11 +204,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertUserJoin(List formDTO, String customerId); + void insertUserJoin(UserJoinListFormDTO formDTO, String customerId); /** * 10、党建引领-先锋模范数据 - * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -217,12 +217,12 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertPioneerData(List formDTO, String customerId); + void insertPioneerData(PioneerDataListFormDTO formDTO, String customerId); /** * 18、公众参与各类总数 * 公众参与-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数 - * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * @param formDTO * @param formDTO @@ -230,5 +230,5 @@ public interface ScreenCollService { * @Author zhangyong * @Date 09:44 2020-08-25 **/ - void insertPublicPartiTotalData(List formDTO, String customerId); + void insertPublicPartiTotalData(PublicPartiTotalDataListFormDTO formDTO, String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java index 6018622deb..7afe8df0b0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java @@ -87,110 +87,104 @@ public class ScreenCollServiceImpl implements ScreenCollService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertPartyUserRankData(List formDTO,String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - screenPartyUserRankDataDao.deletePartyUserRankData(customerId, - formDTO.get(NumConstant.ZERO).getGridId(), - formDTO.get(NumConstant.ZERO).getUserId()); - } - - screenPartyUserRankDataDao.batchInsertPartyUserRankData(formDTO,customerId); + public void insertPartyUserRankData(PartyUserRankDataListFormDTO formDTO,String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenPartyUserRankDataDao.deletePartyUserRankData(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenPartyUserRankDataDao.batchInsertPartyUserRankData(formDTO.getDataList(), customerId); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertPartyLinkMassesData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenPartyLinkMassesDataDao.deletePartyLinkMassesData(customerId, orgIds); - - screenPartyLinkMassesDataDao.batchInsertPartyLinkMassesData(formDTO, customerId); + public void insertPartyLinkMassesData(PartyLinkMassesDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenPartyLinkMassesDataDao.deletePartyLinkMassesData(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenPartyLinkMassesDataDao.batchInsertPartyLinkMassesData(formDTO.getDataList(), customerId); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertPartyBranchData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenPartyBranchDataDao.deletePartyBranchData(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - formDTO.get(NumConstant.ZERO).getMonthId(), - orgIds); - - screenPartyBranchDataDao.batchInsertPartyBranchData(formDTO, customerId); + public void insertPartyBranchData(PartyBranchDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenPartyBranchDataDao.deletePartyBranchData(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenPartyBranchDataDao.batchInsertPartyBranchData(formDTO.getDataList(), customerId); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertOrgRankData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenOrgRankDataDao.deleteOrgRankData(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - formDTO.get(NumConstant.ZERO).getMonthId(), - orgIds); - - screenOrgRankDataDao.batchInsertOrgRankData(formDTO, customerId); + public void insertOrgRankData(OrgRankDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenOrgRankDataDao.deleteOrgRankData(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenOrgRankDataDao.batchInsertOrgRankData(formDTO.getDataList(), customerId); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertGovernRankData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenGovernRankDataDao.deleteGovernRankData(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - formDTO.get(NumConstant.ZERO).getMonthId(), - orgIds); - - screenGovernRankDataDao.batchInsertGovernRankData(formDTO, customerId); + public void insertGovernRankData(GovernRankDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenGovernRankDataDao.deleteGovernRankData(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenGovernRankDataDao.batchInsertGovernRankData(formDTO.getDataList(), customerId); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertEventData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - screenEventDataDao.deleteEventData(customerId, formDTO.get(i).getEventId(), formDTO.get(i).getOrgId()); - } - - screenEventDataDao.batchInsertEventData(formDTO, customerId); + public void insertEventData(EventDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenEventDataDao.deleteEventData(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenEventDataDao.batchInsertEventData(formDTO.getDataList(), customerId); + } - for (int i = NumConstant.ZERO; i < formDTO.size(); i++) { - if (null != formDTO.get(i).getImgDataList() && formDTO.get(i).getImgDataList().size() > NumConstant.ZERO) { - // 根据原始事件ID,物理删除 - 事件数据图片数据 - screenEventImgDataDao.delEventImgDataByEventId(formDTO.get(i).getEventId()); - for (int j = NumConstant.ZERO; j < formDTO.get(i).getImgDataList().size(); j++){ - // 新增 中央区-事件数据图片数据 表 - ScreenEventImgDataEntity imgDataEntity = new ScreenEventImgDataEntity(); - imgDataEntity.setEventId(formDTO.get(i).getImgDataList().get(j).getEventId()); - imgDataEntity.setEventImgUrl(formDTO.get(i).getImgDataList().get(j).getImgUrl()); - imgDataEntity.setSort(formDTO.get(i).getImgDataList().get(j).getSort()); - screenEventImgDataDao.insert(imgDataEntity); - } + // 处理图片 + for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++) { + if (null != formDTO.getDataList().get(i).getImgDataList() && formDTO.getDataList().get(i).getImgDataList().size() > NumConstant.ZERO) { + // 根据原始事件ID,物理删除 - 事件数据图片数据 + screenEventImgDataDao.delEventImgDataByEventId(formDTO.getDataList().get(i).getEventId()); + for (int j = NumConstant.ZERO; j < formDTO.getDataList().get(i).getImgDataList().size(); j++){ + // 新增 中央区-事件数据图片数据 表 + ScreenEventImgDataEntity imgDataEntity = new ScreenEventImgDataEntity(); + imgDataEntity.setEventId(formDTO.getDataList().get(i).getImgDataList().get(j).getEventId()); + imgDataEntity.setEventImgUrl(formDTO.getDataList().get(i).getImgDataList().get(j).getImgUrl()); + imgDataEntity.setSort(formDTO.getDataList().get(i).getImgDataList().get(j).getSort()); + screenEventImgDataDao.insert(imgDataEntity); } } } @@ -204,178 +198,177 @@ public class ScreenCollServiceImpl implements ScreenCollService { //直接删除当前客户下所有的数据 screenDifficultyDataDao.deleteDifficultyData(customerId); } - if (null != formDTO && !CollectionUtils.isEmpty(formDTO.getDiffcultyDataList())){ - screenDifficultyDataDao.batchInsertDifficultyData(formDTO.getDiffcultyDataList(), customerId); + if (null != formDTO && !CollectionUtils.isEmpty(formDTO.getDataList())){ + screenDifficultyDataDao.batchInsertDifficultyData(formDTO.getDataList(), customerId); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertCpcbaseData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenCpcBaseDataDao.deleteCpcBaseData(customerId, orgIds); - - screenCpcBaseDataDao.batchInsertCpcBaseData(formDTO, customerId); + public void insertCpcbaseData(CpcBaseDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenCpcBaseDataDao.deleteCpcBaseData(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenCpcBaseDataDao.batchInsertCpcBaseData(formDTO.getDataList(), customerId); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertIndexDataMonthly(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - formDTO.get(NumConstant.ZERO).getMonthId(), - orgIds); - - screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(formDTO, customerId); + public void insertIndexDataMonthly(IndexDataListMonthlyFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(formDTO.getDataList(), customerId); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertIndexDataYearly(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - orgIds); - - screenIndexDataYearlyDao.batchInsertIndexDataYearly(formDTO, customerId); + public void insertIndexDataYearly(IndexDataListYearlyFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, formDTO.getYearId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenIndexDataYearlyDao.batchInsertIndexDataYearly(formDTO.getDataList(), customerId); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertCustomerDept(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] deptIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - deptIds[i] = formDTO.get(i).getDeptId(); - } - screenCustomerDeptDao.deleteCustomerDept(customerId, deptIds); - - screenCustomerDeptDao.batchInsertCustomerDept(formDTO, customerId); + public void insertCustomerDept(CustomerDeptListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenCustomerDeptDao.deleteCustomerDept(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenCustomerDeptDao.batchInsertCustomerDept(formDTO.getDataList(), customerId); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertCustomerGrid(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] gridIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - gridIds[i] = formDTO.get(i).getGridId(); - } - screenCustomerGridDao.deleteCustomerGrid(customerId, gridIds); - - screenCustomerGridDao.batchInsertCustomerGrid(formDTO, customerId); + public void insertCustomerGrid(CustomerGridListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenCustomerGridDao.deleteCustomerGrid(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenCustomerGridDao.batchInsertCustomerGrid(formDTO.getDataList(), customerId); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertCustomerAgency(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] agencyIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - agencyIds[i] = formDTO.get(i).getAgencyId(); - } - screenCustomerAgencyDao.deleteCustomerAgency(customerId, agencyIds); - - screenCustomerAgencyDao.batchInsertCustomerAgency(formDTO, customerId); + public void insertCustomerAgency(CustomerAgencyListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenCustomerAgencyDao.deleteCustomerAgency(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenCustomerAgencyDao.batchInsertCustomerAgency(formDTO.getDataList(), customerId); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertUserTotalData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenUserTotalDataDao.deleteUserTotalData(customerId, orgIds); - - screenUserTotalDataDao.batchInsertUserTotalData(formDTO, customerId); + public void insertUserTotalData(UserTotalDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenUserTotalDataDao.deleteUserTotalData(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenUserTotalDataDao.batchInsertUserTotalData(formDTO.getDataList(), customerId); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertUserJoin(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenUserJoinDao.deleteUserJoin(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - formDTO.get(NumConstant.ZERO).getMonthId(), - orgIds); - - String[] lastMonth = this.lastMonthDate(); - // 获取上个月的基本数据 - String moneth = lastMonth[NumConstant.ZERO] + lastMonth[NumConstant.ONE]; - List lastMonthJoinList = screenUserJoinDao.selectLastMonthScreenUserJoinList(customerId, - lastMonth[NumConstant.ZERO], - moneth, - orgIds); + public void insertUserJoin(UserJoinListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenUserJoinDao.deleteUserJoin(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + if (formDTO.getDataList().size() > NumConstant.ZERO){ + String[] orgIds = new String[formDTO.getDataList().size()]; + for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++){ + orgIds[i] = formDTO.getDataList().get(i).getOrgId(); + } - // 定义本月待添加数据的集合 - List curMonthJoinEntityList = new ArrayList<>(); - // 增加率计算 - if (null != lastMonthJoinList && lastMonthJoinList.size() > NumConstant.ZERO){ - // 存在上个月的数据 (本月-上月)/上月 *100 - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - for (int j = NumConstant.ZERO; j < lastMonthJoinList.size(); j++){ - if (formDTO.get(i).getOrgId().equals(lastMonthJoinList.get(j).getOrgId())){ - ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(formDTO.get(i), ScreenUserJoinEntity.class); - entity.setJoinTotalUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getJoinTotal(), formDTO.get(j).getJoinTotal())); - entity.setJoinTotalUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getJoinTotal(), formDTO.get(j).getJoinTotal())); - entity.setAvgIssueUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getAvgIssue(), formDTO.get(j).getAvgIssue())); - entity.setAvgIssueUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getAvgIssue(), formDTO.get(j).getAvgIssue())); - entity.setAgvgJoinUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getAvgJoin(), formDTO.get(j).getAvgJoin())); - entity.setAgvgJoinUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getAvgJoin(), formDTO.get(j).getAvgJoin())); - curMonthJoinEntityList.add(entity); + String[] lastMonth = this.lastMonthDate(); + // 获取上个月的基本数据 + String moneth = lastMonth[NumConstant.ZERO] + lastMonth[NumConstant.ONE]; + List lastMonthJoinList = screenUserJoinDao.selectLastMonthScreenUserJoinList(customerId, + lastMonth[NumConstant.ZERO], + moneth, + orgIds); + + // 定义本月待添加数据的集合 + List curMonthJoinEntityList = new ArrayList<>(); + // 增加率计算 + if (null != lastMonthJoinList && lastMonthJoinList.size() > NumConstant.ZERO){ + // 存在上个月的数据 (本月-上月)/上月 *100 + for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++){ + for (int j = NumConstant.ZERO; j < lastMonthJoinList.size(); j++){ + if (formDTO.getDataList().get(i).getOrgId().equals(lastMonthJoinList.get(j).getOrgId())){ + ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(formDTO.getDataList().get(i), ScreenUserJoinEntity.class); + entity.setJoinTotalUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getJoinTotal(), formDTO.getDataList().get(j).getJoinTotal())); + entity.setJoinTotalUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getJoinTotal(), formDTO.getDataList().get(j).getJoinTotal())); + entity.setAvgIssueUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getAvgIssue(), formDTO.getDataList().get(j).getAvgIssue())); + entity.setAvgIssueUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getAvgIssue(), formDTO.getDataList().get(j).getAvgIssue())); + entity.setAgvgJoinUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getAvgJoin(), formDTO.getDataList().get(j).getAvgJoin())); + entity.setAgvgJoinUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getAvgJoin(), formDTO.getDataList().get(j).getAvgJoin())); + curMonthJoinEntityList.add(entity); + } } } + } else { + // 计算增长率后的 待新增数据 + BigDecimal zero = new BigDecimal(NumConstant.ZERO); + // 不存在上个月的数据 + for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++){ + ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(formDTO.getDataList().get(i), ScreenUserJoinEntity.class); + entity.setJoinTotalUpRate(zero); + entity.setJoinTotalUpFlag(""); + entity.setAvgIssueUpRate(zero); + entity.setAvgIssueUpFlag(""); + entity.setAgvgJoinUpRate(zero); + entity.setAgvgJoinUpFlag(""); + curMonthJoinEntityList.add(entity); + } } - } else { - // 计算增长率后的 待新增数据 - BigDecimal zero = new BigDecimal(NumConstant.ZERO); - // 不存在上个月的数据 - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(formDTO.get(i), ScreenUserJoinEntity.class); - entity.setJoinTotalUpRate(zero); - entity.setJoinTotalUpFlag(""); - entity.setAvgIssueUpRate(zero); - entity.setAvgIssueUpFlag(""); - entity.setAgvgJoinUpRate(zero); - entity.setAgvgJoinUpFlag(""); - curMonthJoinEntityList.add(entity); - } + screenUserJoinDao.batchInsertUserJoin(curMonthJoinEntityList, customerId); } - screenUserJoinDao.batchInsertUserJoin(curMonthJoinEntityList, customerId); } } @@ -441,30 +434,30 @@ public class ScreenCollServiceImpl implements ScreenCollService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertPioneerData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenPioneerDataDao.deletePioneerData(customerId, orgIds); - - screenPioneerDataDao.batchInsertPioneerData(formDTO, customerId); + public void insertPioneerData(PioneerDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenPioneerDataDao.deletePioneerData(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenPioneerDataDao.batchInsertPioneerData(formDTO.getDataList(), customerId); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertPublicPartiTotalData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenPublicPartiTotalDataDao.deletePublicPartiTotalData(customerId, orgIds); - - screenPublicPartiTotalDataDao.batchInsertPublicPartiTotalData(formDTO, customerId); + public void insertPublicPartiTotalData(PublicPartiTotalDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenPublicPartiTotalDataDao.deletePublicPartiTotalData(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenPublicPartiTotalDataDao.batchInsertPublicPartiTotalData(formDTO.getDataList(), customerId); } } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml index 67165f1bf7..c65c890f46 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml @@ -27,8 +27,7 @@ delete from fact_index_govrn_ablity_dept_monthly - where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND DEPT_ID = #{deptId} - AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml index 870e2596ec..a84dff6a5c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml @@ -29,8 +29,8 @@ delete from fact_index_govrn_ablity_grid_monthly - where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} - AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml index a703174aee..eb9a582759 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml @@ -30,11 +30,8 @@ delete from fact_index_govrn_ablity_org_monthly where CUSTOMER_ID = #{customerId} - AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} - AND AGENCY_ID IN - - #{item} - + AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml index 2d8b199022..5f94b54fba 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml @@ -34,8 +34,8 @@ delete from fact_index_party_ablity_grid_monthly - where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} - AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml index df7e750147..4aacf64da8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml @@ -24,11 +24,8 @@ delete from fact_index_party_ablity_org_monthly where CUSTOMER_ID = #{customerId} - AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} - AND AGENCY_ID IN - - #{item} - + AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml index 467bba7667..f3ec6462f2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml @@ -24,8 +24,8 @@ delete from fact_index_service_ablity_grid_monthly - where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} - AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml index 03bc8a2b10..e87e17874f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml @@ -24,11 +24,8 @@ delete from fact_index_service_ablity_org_monthly where CUSTOMER_ID = #{customerId} - AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} - AND AGENCY_ID IN - - #{item} - + AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml index 1059fe5518..03270712ee 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml @@ -6,10 +6,7 @@ delete from screen_cpc_base_data where CUSTOMER_ID = #{customerId} - AND ORG_ID IN - - #{item} - + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml index 36ac049262..21d0a572c1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml @@ -6,10 +6,7 @@ delete from screen_customer_agency where CUSTOMER_ID = #{customerId} - AND AGENCY_ID IN - - #{item} - + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml index 31717d6dd2..1533203d14 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml @@ -6,10 +6,7 @@ delete from screen_customer_dept where CUSTOMER_ID = #{customerId} - AND DEPT_ID IN - - #{item} - + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml index c85dc0af60..92486a3f10 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml @@ -6,10 +6,7 @@ delete from screen_customer_grid where CUSTOMER_ID = #{customerId} - AND GRID_ID IN - - #{item} - + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventDataDao.xml index fa22c8ad79..f395b4bdce 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventDataDao.xml @@ -5,7 +5,8 @@ delete from screen_event_data - where CUSTOMER_ID = #{customerId} AND EVENT_ID = #{eventId} AND ORG_ID = #{orgId} + where CUSTOMER_ID = #{customerId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml index 9a8da4e40e..f569cb89a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml @@ -5,11 +5,8 @@ delete from screen_govern_rank_data - where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} - AND ORG_ID IN - - #{item} - + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml index 4c8369dd0a..11a990aa9c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml @@ -5,11 +5,8 @@ delete from screen_index_data_monthly - where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} - AND ORG_ID IN - - #{item} - + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataYearlyDao.xml index 75eb13d280..aed08ebfed 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataYearlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataYearlyDao.xml @@ -6,10 +6,7 @@ delete from screen_index_data_yearly where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} - AND ORG_ID IN - - #{item} - + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenOrgRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenOrgRankDataDao.xml index 64c79965e9..2cf5f7dc33 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenOrgRankDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenOrgRankDataDao.xml @@ -5,11 +5,8 @@ delete from screen_org_rank_data - where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} - AND ORG_ID IN - - #{item} - + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml index 12bc3a4755..a7058e4a08 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml @@ -5,11 +5,8 @@ delete from screen_party_branch_data - where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} - AND ORG_ID IN - - #{item} - + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml index c9e4e65e5f..f6760538d1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml @@ -6,10 +6,7 @@ delete from screen_party_link_masses_data where CUSTOMER_ID = #{customerId} - AND ORG_ID IN - - #{item} - + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml index fe88da6d76..d4089fcc30 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml @@ -5,7 +5,8 @@ delete from screen_party_user_rank_data - where CUSTOMER_ID = #{customerId} AND GRID_ID = #{gridId} AND USER_ID = #{userId} + where CUSTOMER_ID = #{customerId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml index ceff6812fb..91d8537c19 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml @@ -6,10 +6,7 @@ delete from screen_pioneer_data where CUSTOMER_ID = #{customerId} - AND ORG_ID IN - - #{item} - + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPublicPartiTotalDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPublicPartiTotalDataDao.xml index 69701d3f17..0c2bfa9c51 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPublicPartiTotalDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPublicPartiTotalDataDao.xml @@ -27,10 +27,7 @@ delete from screen_public_parti_total_data where CUSTOMER_ID = #{customerId} - AND ORG_ID IN - - #{item} - + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml index 678b2b960c..e4e5b7ac0f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml @@ -22,11 +22,8 @@ delete from screen_user_join - where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} - AND ORG_ID IN - - #{item} - + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml index 032739c71c..ecf0039810 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml @@ -6,10 +6,7 @@ delete from screen_user_total_data where CUSTOMER_ID = #{customerId} - AND ORG_ID IN - - #{item} - + limit 1000; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 4e3da40627..962b8917e4 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -50,7 +50,7 @@ public interface EpmetUserOpenFeignClient { * @date 2020/6/2 16:11 */ @PostMapping("/epmetuser/staffrole/staffroles/{staffId}") - Result> getStaffRoles(@PathVariable String staffId); + Result> getStaffRoles(@PathVariable("staffId") String staffId); /** * @param staffId @@ -300,7 +300,7 @@ public interface EpmetUserOpenFeignClient { /** * 更改角色所属组织 * @author zhaoqifeng - * @date 2020/8/31 10:36 + * @date 2020/8/31 10:36 * @param formDTO * @return com.epmet.commons.tools.utils.Result */ From c1e8b0f102d3968849ce970785dc948e5b57acc2 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Tue, 8 Sep 2020 16:05:18 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=8F=90=E4=BA=A4(?= =?UTF-8?q?=E6=81=A2=E5=A4=8D=20feignClient=E6=96=87=E4=BB=B6=E5=86=85?= =?UTF-8?q?=E5=AE=B9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml | 1 + .../src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml index c65c890f46..b4475c72cd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml @@ -28,6 +28,7 @@ delete from fact_index_govrn_ablity_dept_monthly where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 962b8917e4..a1902d95c5 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -50,7 +50,7 @@ public interface EpmetUserOpenFeignClient { * @date 2020/6/2 16:11 */ @PostMapping("/epmetuser/staffrole/staffroles/{staffId}") - Result> getStaffRoles(@PathVariable("staffId") String staffId); + Result> getStaffRoles(@PathVariable String staffId); /** * @param staffId From 2a1674c13b577c1ee9af2b6a91e121f785c3583f Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 8 Sep 2020 17:38:18 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E6=8C=87=E6=A0=87=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/ScreenCustomerAgencyDao.java | 8 ++++ .../IndexCalculateDistrictServiceImpl.java | 44 +++++++++---------- .../impl/IndexCalculateStreetServiceImpl.java | 29 ++++++------ .../indexcal/AgencyScoreDao.xml | 2 +- .../screen/FactIndexCommunityScoreDao.xml | 6 +-- .../screen/ScreenCustomerAgencyDao.xml | 11 +++++ 6 files changed, 56 insertions(+), 44 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index c2dc598bfa..0d1acd8cf6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -74,4 +74,12 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectListAgencyInfo(@Param("customerId")String customerId); + + /** + * @Description 根据agencyId查询上级组织Id + * @param agencyId + * @author zxc + * @date 2020/9/8 3:36 下午 + */ + String selectPid(@Param("agencyId")String agencyId); } 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 dad92d33df..3720a6cc4e 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 @@ -10,6 +10,7 @@ import com.epmet.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.dto.indexcal.AgencyScoreDTO; import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; @@ -55,6 +56,8 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict private AgencyScoreDao agencyScoreDao; @Autowired private DeptScoreDao deptScoreDao; + @Autowired + private ScreenCustomerAgencyDao customerAgencyDao; /** * @Description 计算全区相关总分 @@ -107,18 +110,14 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.error(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); return; - } else if (subGridPartyAvgScore.size() == NumConstant.ONE) { - pid.put(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(), subGridPartyAvgScore.get(NumConstant.ZERO).getParentId()); - sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(), customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), pid); - return; - } else if (subGridPartyAvgScore.size() > NumConstant.ONE) { + } else if (subGridPartyAvgScore.size() > NumConstant.ZERO) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, IndexCalConstant.PAGE_SIZE); subPartyAvgList.forEach(party -> { List index1SampleValues = new ArrayList<>(); party.forEach(c -> { - pid.put(c.getAgencyId(), c.getParentId()); - SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + pid.put(c.getParentId(),customerAgencyDao.selectPid(c.getParentId())); + SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); }); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); @@ -184,18 +183,17 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); - if (districtGovernAvgList.size() == NumConstant.ONE) { - pid.put(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(), districtGovernAvgList.get(NumConstant.ZERO).getParentId()); - sizeOne(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(), customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), pid); + if (CollectionUtils.isEmpty(districtGovernAvgList)) { + log.error("查询所有街道治理能力平均值集合为空"); return; - } else if (districtGovernAvgList.size() > NumConstant.ONE) { + } else if (districtGovernAvgList.size() > NumConstant.ZERO) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(districtGovernAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> governAvg = ListUtils.partition(districtGovernAvgList, IndexCalConstant.PAGE_SIZE); governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { - pid.put(c.getAgencyId(), c.getParentId()); - SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + pid.put(c.getParentId(),customerAgencyDao.selectPid(c.getParentId())); + SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); }); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); @@ -205,17 +203,16 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } } else if (IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode().equals(detail.getIndexCode())){ List deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - if (deptScoreAvgList.size() == NumConstant.ONE) { - pid.put(deptScoreAvgList.get(NumConstant.ZERO).getAgencyId(), deptScoreAvgList.get(NumConstant.ZERO).getParentId()); - sizeOne(deptScoreAvgList.get(NumConstant.ZERO).getAgencyId(), customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), pid); + if (CollectionUtils.isEmpty(deptScoreAvgList)) { + log.error("查询所有直属部门治理能力平均值集合为空"); return; - } else if (deptScoreAvgList.size() > NumConstant.ONE) { + } else if (deptScoreAvgList.size() > NumConstant.ZERO) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(deptScoreAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> governAvg = ListUtils.partition(deptScoreAvgList, IndexCalConstant.PAGE_SIZE); governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { - pid.put(c.getAgencyId(), c.getParentId()); + pid.put(c.getParentId(),customerAgencyDao.selectPid(c.getParentId())); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -254,19 +251,18 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict String indexCode = detail.getIndexCode(); if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); - if (subStreetAvgList.size() == NumConstant.ONE) { - pid.put(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(), subStreetAvgList.get(NumConstant.ZERO).getParentId()); - sizeOne(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(), customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), pid); + if (CollectionUtils.isEmpty(subStreetAvgList)) { + log.error("查询区下属街道服务能力汇总平均值集合为空"); return; - } else if (subStreetAvgList.size() > NumConstant.ONE) { + } else if (subStreetAvgList.size() > NumConstant.ZERO) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subStreetAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> serviceAvgList = ListUtils.partition(subStreetAvgList, IndexCalConstant.PAGE_SIZE); serviceAvgList.forEach(serviceAvg -> { BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); serviceAvg.forEach(c -> { - pid.put(c.getAgencyId(), c.getParentId()); - SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); }); IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); 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 099c69c125..978473be33 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 @@ -12,6 +12,7 @@ import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityOrgMonthlyDao; import com.epmet.dao.evaluationindex.screen.FactIndexCommunityScoreDao; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.dto.indexcal.AgencyScoreDTO; import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; @@ -61,6 +62,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ private FactIndexCommunityScoreDao communityScoreDao; @Autowired private AgencyScoreDao agencyScoreDao; + @Autowired + private ScreenCustomerAgencyDao customerAgencyDao; /** * @Description 计算街道相关总分 @@ -113,18 +116,14 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ if (CollectionUtils.isEmpty(subCommPartyAvgScore)) { log.error(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL); return; - } else if (subCommPartyAvgScore.size() == NumConstant.ONE) { - pid.put(subCommPartyAvgScore.get(NumConstant.ZERO).getAgencyId(), subCommPartyAvgScore.get(NumConstant.ZERO).getParentId()); - sizeOne(subCommPartyAvgScore.get(NumConstant.ZERO).getAgencyId(), customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), pid); - return; - } else if (subCommPartyAvgScore.size() > NumConstant.ONE) { + } else if (subCommPartyAvgScore.size() > NumConstant.ZERO) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); Integer indexEnd = NumConstant.TEN; List> partition = ListUtils.partition(subCommPartyAvgScore, indexEnd); partition.forEach(publish -> { List index1SampleValues = new ArrayList<>(); publish.forEach(c -> { - pid.put(c.getAgencyId(), c.getParentId()); + pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -190,17 +189,16 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) { List subGridGovernAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - if (subGridGovernAvg.size() == NumConstant.ONE) { - pid.put(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(), subGridGovernAvg.get(NumConstant.ZERO).getParentId()); - sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(), customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), pid); + if (CollectionUtils.isEmpty(subGridGovernAvg)){ + log.error("查询街道下属所有社区治理能力汇总为空"); return; - } else if (subGridGovernAvg.size() > NumConstant.ONE) { + }else if (subGridGovernAvg.size() > NumConstant.ZERO) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE); governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { - pid.put(c.getAgencyId(), c.getParentId()); + pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -269,18 +267,17 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ String indexCode = detail.getIndexCode(); if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) { List subCommServiceAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); - if (subCommServiceAvg.size() == NumConstant.ONE) { - pid.put(subCommServiceAvg.get(NumConstant.ZERO).getAgencyId(), subCommServiceAvg.get(NumConstant.ZERO).getParentId()); - sizeOne(subCommServiceAvg.get(NumConstant.ZERO).getAgencyId(), customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), pid); + if (CollectionUtils.isEmpty(subCommServiceAvg)) { + log.error("查询街道下属社区服务能力得分平均值为空"); return; - } else if (subCommServiceAvg.size() > NumConstant.ONE) { + } else if (subCommServiceAvg.size() > NumConstant.ZERO) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> serviceAvgList = ListUtils.partition(subCommServiceAvg, IndexCalConstant.PAGE_SIZE); serviceAvgList.forEach(serviceAvg -> { BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); serviceAvg.forEach(c -> { - pid.put(c.getAgencyId(), c.getParentId()); + pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index 6ba627fd68..61f3db1f65 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -101,7 +101,7 @@ AND fics.month_id = #{monthId} AND fics.index_code = #{indexCode} AND fics.DATA_TYPE = #{dataType} - GROUP BY fics.agency_id + GROUP BY fics.parent_agency_id diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml index 919dec3b2b..e00f0b2c12 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml @@ -65,7 +65,7 @@ + + + From 1c77abf70329c491666262676bdb9d135f15d071 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 8 Sep 2020 17:51:07 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcal/impl/IndexCalculateStreetServiceImpl.java | 1 - 1 file changed, 1 deletion(-) 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 978473be33..3c024c3ec4 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 @@ -228,7 +228,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ List>> governAbilityList = ListUtils.partition(communityGovernAbility, IndexCalConstant.PAGE_SIZE); governAbilityList.forEach(governAbility -> { ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); - System.err.println(detail.getCorrelation()); List index1SampleValues = new ArrayList<>(); governAbility.forEach(c -> { pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); From 7ff481c5b2a1f8cb8de476b366b8aa7bcaa82aaf Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 8 Sep 2020 18:20:43 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E6=8C=87=E6=A0=87=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=98=8E=E7=BB=86=E5=88=86=E6=95=B0=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../batch/BatchScoreCalculator.java | 48 ++++++++++++++++++- .../normalizing/batch/CalculateResult.java | 25 ++++++++++ .../stats/test/normalizing/DemoScoreCal.java | 12 +++-- 3 files changed, 79 insertions(+), 6 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/CalculateResult.java 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 1ede9a4aae..d13eb8337a 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 @@ -4,6 +4,7 @@ import com.epmet.support.normalizing.ScoreCalculator; import java.math.BigDecimal; import java.math.RoundingMode; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.stream.Collectors; @@ -12,6 +13,7 @@ public class BatchScoreCalculator { /** * 执行计算,每个指标中每个样本的得分明细 + * * @return 每一条都是一个指标的,所有样本对应的,得分值 */ public List getScoreDetailOfIndexId(List indexInputVOS) { @@ -26,7 +28,7 @@ public class BatchScoreCalculator { // 循环同一个指标内的多个样本值的SampleValue列表 List scores4OneIndex = indexValueVOs.stream().map(vo -> { - BigDecimal score = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold), weight).setScale(6, RoundingMode.HALF_UP);; + BigDecimal score = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold), weight).setScale(6, RoundingMode.HALF_UP); return new SampleScore(vo.getSampleId(), score); }).collect(Collectors.toList()); @@ -34,8 +36,49 @@ public class BatchScoreCalculator { }).collect(Collectors.toList()); } + /** + * 执行计算,以样本的所有指标总得分及明细分数值 + * + * @param indexInputVOS + * @return + */ + public HashMap getScoreTotalOfSampleId(List indexInputVOS) { + + // 每个样本的总得分 + HashMap scoreCountOfSamples = new HashMap<>(); + //遍历指标 + for (IndexInputVO idx : indexInputVOS) { + // 每个指标循环一次 + List indexValueVOs = idx.getIndexValueVOs(); + BigDecimal weight = idx.getWeight(); + ScoreCalculator scoreCalculator = idx.getScoreCalculator(); + BigDecimal threshold = idx.getThreshold(); + //遍历该指标下的每个数据 + for (SampleValue vo : indexValueVOs) { + String sampleId = vo.getSampleId(); + BigDecimal score = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold), weight).setScale(6, RoundingMode.HALF_UP); + CalculateResult result = scoreCountOfSamples.get(sampleId); + + if (result == null) { + score.setScale(6, RoundingMode.HALF_UP); + result = new CalculateResult(); + result.setSampleId(sampleId); + result.setTotalScore(new BigDecimal(0)); + result.setDetails(new ArrayList<>()); + scoreCountOfSamples.put(sampleId, result); + } + SampleScore sampleScore = new SampleScore(idx.getIndexId(), score); + result.getDetails().add(sampleScore); + result.setTotalScore(result.getTotalScore().add(score).setScale(6, RoundingMode.HALF_UP)); + } + } + + return scoreCountOfSamples; + } + /** * 执行计算,以样本的所有指标总得分 + * * @param indexInputVOS * @return */ @@ -69,6 +112,7 @@ public class BatchScoreCalculator { /** * 获取最终样本值 + * * @param realValue * @param threshold * @return @@ -81,6 +125,6 @@ public class BatchScoreCalculator { } return (bdRealValue.compareTo(threshold) < 0) || (bdRealValue.equals(threshold)) ? bdRealValue - : threshold ; + : threshold; } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/CalculateResult.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/CalculateResult.java new file mode 100644 index 0000000000..8430149681 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/CalculateResult.java @@ -0,0 +1,25 @@ +package com.epmet.support.normalizing.batch; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +@Data +public class CalculateResult implements Serializable { + private static final long serialVersionUID = -7966247924916816940L; + + /** + * 样本Id 对应inputVO中的sampleId + */ + private String sampleId; + /** + * 总得分 + */ + private BigDecimal totalScore; + /** + * 每项具体的分支 + */ + private List details; +} 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 d573765b6b..3b41f1ff2f 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 @@ -1,10 +1,7 @@ package com.epmet.stats.test.normalizing; import com.epmet.support.normalizing.*; -import com.epmet.support.normalizing.batch.BatchScoreCalculator; -import com.epmet.support.normalizing.batch.IndexInputVO; -import com.epmet.support.normalizing.batch.IndexOutputVO; -import com.epmet.support.normalizing.batch.SampleValue; +import com.epmet.support.normalizing.batch.*; import org.junit.Test; import java.math.BigDecimal; @@ -237,12 +234,19 @@ public class DemoScoreCal { BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap result = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + HashMap result2 = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); System.err.println("----------------1----------------"); result.forEach((key, value) -> { System.out.println(key.concat("的得分为:").concat(value.toString())); }); System.err.println("-----------------2---------------"); + + System.err.println("----------------11111111----------------"); + result2.forEach((key, value) -> { + System.out.println(key.concat("的得分为:").concat(value.toString())); + }); + System.err.println("-----------------2222222222---------------"); }