From 539a76a45c1031405ca573a5ac2b9ecc21dbe898 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 28 Sep 2020 15:33:27 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E5=85=9A=E5=BB=BA=E5=BC=95=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/DemoController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index ad2c65e67d..f4f237b306 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -17,6 +17,7 @@ import com.epmet.dao.stats.DimDateDao; import com.epmet.dao.stats.DimMonthDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.form.ExtractOriginFormDTO; +import com.epmet.dto.extract.form.ExtractScreenFormDTO; import com.epmet.dto.extract.form.ScreenExtractFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; @@ -657,7 +658,7 @@ public class DemoController { private PartyGuideService partyGuideService; @PostMapping("zxczxc") - public Result getZxcZxc(@RequestBody ScreenExtractFormDTO formDTO){ + public Result getZxcZxc(@RequestBody ExtractScreenFormDTO formDTO){ partyGuideService.partyGuideExtract(formDTO); return new Result(); } From bc6659d84aadc478886d76ba03b66cf886cd4033 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 28 Sep 2020 16:38:51 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/project/ProjectProcessDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml index ed36efbeed..0307d76d45 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml @@ -59,7 +59,7 @@ - SELECT - ID + ID as projectId, + TOPIC_ID as gridId FROM fact_origin_project_main_daily WHERE CUSTOMER_ID = #{customerId} - AND - DATE_ID = #{dateId} + + + ID = #{projectId} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml index 101740c18e..d253e2530a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml @@ -98,4 +98,121 @@ AND CUSTOMER_ID = #{customerId} + + + + DELETE + FROM screen_difficulty_data + WHERE + CUSTOMER_ID = #{customerId} + + + EVENT_ID = #{projectId} + + + + + + DELETE + FROM screen_difficulty_img_data + + + EVENT_ID = #{projectId} + + + + + + insert into screen_difficulty_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + EVENT_ID, + EVENT_IMG_URL, + EVENT_SOURCE, + EVENT_CONTENT, + EVENT_COST_TIME, + EVENT_RE_ORG, + EVENT_HANDLED_COUNT, + EVENT_CATEGORY_CODE, + EVENT_CATEGORY_NAME, + EVENT_STATUS_CODE, + EVENT_STATUS_DESC, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + LATEST_OPERATE_DESC, + DATA_END_TIME, + ALL_PARENT_IDS + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.eventId}, + #{item.eventImgUrl}, + #{item.eventSource}, + #{item.eventContent}, + #{item.eventCostTime}, + #{item.eventReOrg}, + #{item.eventHandledCount}, + #{item.eventCategoryCode}, + #{item.eventCategoryName}, + #{item.eventStatusCode}, + #{item.eventStatusDesc}, + 0, + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now(), + #{item.latestOperateDesc}, + #{item.dataEndTime}, + #{item.allParentIds} + ) + + + + + + insert into screen_difficulty_img_data + ( + ID, + EVENT_ID, + EVENT_IMG_URL, + SORT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.eventId}, + #{item.eventImgUrl}, + #{item.sort}, + 0, + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml index 9a644abb96..f47b266eba 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml @@ -211,6 +211,19 @@ ) + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml index ed36efbeed..f82c025709 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml @@ -189,8 +189,21 @@ ) b ON a.PROJECT_ID = b.PROJECT_ID - + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml index debd5efb90..4de5b1c76b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml @@ -215,4 +215,30 @@ where rt.del_flag='0' and DATE_FORMAT( rt.UPDATED_TIME, '%Y%m%d' )=#{dateId} + + + + \ No newline at end of file From d007fdf389755c4fe1a5961ecf604f5b6480bf95 Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 28 Sep 2020 18:02:23 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E9=9A=BE=E7=82=B9=E8=B5=8C=E7=82=B9?= =?UTF-8?q?=E5=85=A8=E9=87=8F=E6=9B=B4=E6=96=B0DATA=5FEND=5FTIME?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/impl/ScreenDifficultyDataServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java index 806007d8fc..022f4484be 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java @@ -21,6 +21,7 @@ package com.epmet.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.screen.ScreenDifficultyDataDao; import com.epmet.dto.screen.result.DifficultyIfExistedResultDTO; @@ -66,5 +67,7 @@ public class ScreenDifficultyDataServiceImpl extends BaseServiceImpl Date: Mon, 28 Sep 2020 18:07:08 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E5=85=9A=E5=BB=BA=E5=BC=95=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/DemoController.java | 4 ++-- .../mapper/evaluationindex/indexcal/AgencyScoreDao.xml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index f4f237b306..4e275c8a12 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -190,7 +190,7 @@ public class DemoController { @PostMapping("zxc2") public Result getZxc2(){ - indexCalculateCommunityService.calCommunityAll("epmettest", "202008"); + indexCalculateCommunityService.calCommunityAll("45687aa479955f9d06204d415238f7cc", "202008"); return new Result(); } @@ -506,7 +506,7 @@ public class DemoController { @PostMapping("districtZxc") public void getDistrict(){ - String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + String customerId = "45687aa479955f9d06204d415238f7cc"; String monthId = "202008"; indexCalculateDistrictService.calDistrictAll(customerId,monthId); } 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 65922677e5..8e37cf3359 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 @@ -103,6 +103,7 @@ fact_index_agency_score fics WHERE fics.del_flag = '0' + AND fics.AGENCY_ID != '0' AND fics.customer_id = #{customerId} AND fics.month_id = #{monthId} AND fics.index_code = #{indexCode} From 31aa4f29318ac9e4bcfea69365517af2231e7970 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 28 Sep 2020 20:38:19 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IndexCalculateDistrictServiceImpl.java | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) 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 4f522f80e7..8d7cbdaf26 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 @@ -209,7 +209,9 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict subPartyAvgList.forEach(party -> { List index1SampleValues = new ArrayList<>(); party.forEach(c -> { - pid.put(c.getParentId(),customerAgencyDao.selectPid(c.getParentId())); + if (c.getParentId()!=NumConstant.ZERO_STR) { + pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + } SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); }); @@ -275,6 +277,11 @@ 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); + for (int i = 0; i < districtGovernAvgList.size(); i++) { + if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ + districtGovernAvgList.remove(districtGovernAvgList.get(i)); + } + } if (CollectionUtils.isEmpty(districtGovernAvgList)) { log.error("查询所有街道治理能力平均值集合为空"); } else{ @@ -283,7 +290,9 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { - pid.put(c.getParentId(),customerAgencyDao.selectPid(c.getParentId())); + if (c.getParentId()!=NumConstant.ZERO_STR) { + pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + } SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); }); @@ -294,6 +303,11 @@ 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()); + for (int i = 0; i < deptScoreAvgList.size(); i++) { + if (deptScoreAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ + deptScoreAvgList.remove(deptScoreAvgList.get(i)); + } + } if (CollectionUtils.isEmpty(deptScoreAvgList)) { log.error("查询所有直属部门治理能力平均值集合为空"); } else{ @@ -343,6 +357,11 @@ 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); + for (int i = 0; i < subStreetAvgList.size(); i++) { + if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ + subStreetAvgList.remove(subStreetAvgList.get(i)); + } + } if (CollectionUtils.isEmpty(subStreetAvgList)) { log.error("查询区下属街道服务能力汇总平均值集合为空"); } else{ @@ -352,7 +371,9 @@ 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.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + if (c.getParentId()!=NumConstant.ZERO_STR) { + pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + } SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); }); From 377fe2800c24458f96418661259b0e4b34a4dda7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 29 Sep 2020 09:13:37 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IndexCalculateDistrictServiceImpl.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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 8d7cbdaf26..dd06662313 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 @@ -209,11 +209,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict subPartyAvgList.forEach(party -> { List index1SampleValues = new ArrayList<>(); party.forEach(c -> { - if (c.getParentId()!=NumConstant.ZERO_STR) { + if (!c.getParentId().equals(NumConstant.ZERO_STR)) { pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + SampleValue s = new SampleValue(c.getParentId(), c.getScore()); + index1SampleValues.add(s); } - SampleValue s = new SampleValue(c.getParentId(), c.getScore()); - index1SampleValues.add(s); }); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); @@ -290,11 +290,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { - if (c.getParentId()!=NumConstant.ZERO_STR) { + if (!c.getParentId().equals(NumConstant.ZERO_STR)) { pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + SampleValue s = new SampleValue(c.getParentId(), c.getScore()); + index1SampleValues.add(s); } - SampleValue s = new SampleValue(c.getParentId(), c.getScore()); - index1SampleValues.add(s); }); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); @@ -371,11 +371,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); serviceAvg.forEach(c -> { - if (c.getParentId()!=NumConstant.ZERO_STR) { + if (!c.getParentId().equals(NumConstant.ZERO_STR)) { pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + SampleValue s = new SampleValue(c.getParentId(), c.getScore()); + index1SampleValues.add(s); } - SampleValue s = new SampleValue(c.getParentId(), c.getScore()); - index1SampleValues.add(s); }); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); indexInputVOS.add(index1VO); From 3699093e1ea58a456c165194a9030daa32dcf1b0 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 29 Sep 2020 10:00:37 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E5=85=A8=E5=8C=BA=E6=B2=BB=E7=90=86?= =?UTF-8?q?=E8=83=BD=E5=8A=9B=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataToIndex/IndexCollDistrictService.java | 10 ++ .../impl/IndexCollDistrictServiceImpl.java | 154 ++++++++++++++++ .../impl/IndexCollStreetServiceImpl.java | 2 +- .../impl/IndexOriginExtractServiceImpl.java | 7 + .../extract/todata/ProjectExtractService.java | 2 +- .../GovernRankDataExtractService.java | 11 ++ .../toscreen/OrgRankExtractService.java | 11 ++ .../GovernRankDataExtractServiceImpl.java | 60 +++++++ .../impl/OrgRankExtractServiceImpl.java | 167 ++++++++++++------ .../impl/ScreenExtractServiceImpl.java | 3 +- 10 files changed, 374 insertions(+), 53 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexCollDistrictService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexCollDistrictService.java index 3b313257a1..bf6957c097 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexCollDistrictService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexCollDistrictService.java @@ -7,4 +7,14 @@ package com.epmet.service.evaluationindex.extract.dataToIndex; * @date 2020/9/18 10:44 */ public interface IndexCollDistrictService { + /** + * 区治理能力统计 + * + * @author zhaoqifeng + * @date 2020/9/18 13:52 + * @param customerId + * @param dateId + * @return void + */ + void saveDistrictAbility(String customerId, String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java index 45c19b9bf5..2768399b04 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java @@ -1,10 +1,35 @@ package com.epmet.service.evaluationindex.extract.dataToIndex.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity; import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollDistrictService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectOrgPeriodDailyService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService; +import com.epmet.service.stats.DimAgencyService; +import com.epmet.service.stats.FactArticlePublishedAgencyDailyService; +import com.epmet.util.DimIdGenerator; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; /** * @author zhaoqifeng @@ -15,4 +40,133 @@ import org.springframework.stereotype.Service; @Slf4j @DataSource(DataSourceConstant.EVALUATION_INDEX) public class IndexCollDistrictServiceImpl implements IndexCollDistrictService { + + @Autowired + private DimAgencyService dimAgencyService; + @Autowired + private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService; + @Autowired + private FactOriginProjectLogDailyService factOriginProjectLogDailyService; + @Autowired + private FactOriginProjectOrgPeriodDailyService factOriginProjectOrgPeriodDailyService; + @Autowired + private FactArticlePublishedAgencyDailyService factArticlePublishedAgencyDailyService; + @Autowired + private FactIndexPartyAblityOrgMonthlyService factIndexPartyAblityOrgMonthlyService; + + @Override + public void saveDistrictAbility(String customerId, String dateId) { + + //当前日期前一天 + Date date = DateUtils.stringToDate(dateId, DateUtils.DATE_PATTERN_YYYYMM); + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //获取社区列表 + ListagencyList = dimAgencyService.getAgencyByLevel(customerId, OrgTypeConstant.DISTRICT); + //社区数据初始化 + List list = agencyList.stream().map(agency ->{ + FactIndexGovrnAblityOrgMonthlyEntity entity = new FactIndexGovrnAblityOrgMonthlyEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(agency.getId()); + entity.setParentId(agency.getPid()); + entity.setYearId(dimId.getYearId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setMonthId(dimId.getMonthId()); + entity.setDataType(OrgTypeConstant.DISTRICT); + entity.setTransferedCount(NumConstant.ZERO); + //办结项目数 + entity.setClosedProjectCount(NumConstant.ZERO); + //项目响应度 + entity.setRespProjectRatio(new BigDecimal(NumConstant.ZERO)); + entity.setOverdueProjectRatio(new BigDecimal(NumConstant.ZERO)); + //办结项目率 + entity.setClosedProjectRatio(new BigDecimal(NumConstant.ZERO)); + entity.setSatisfactionRatio(new BigDecimal(NumConstant.ZERO)); + //街道办结项目的处理效率 + entity.setHandleProjectRatio(new BigDecimal(NumConstant.ZERO)); + return entity; + }).collect(Collectors.toList()); + + //被吹哨次数统计 + List transferCount = factOriginProjectLogDailyService.getAgencyTransferCount(customerId, dimId.getMonthId(), + OrgTypeConstant.DISTRICT); + if (null != transferCount && !transferCount.isEmpty()) { + list.forEach(entity -> transferCount.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(count -> + entity.setTransferedCount(count.getCount()) + )); + } + + //社区项目响应度 + List responsiveness = factOriginProjectOrgPeriodDailyService.getResponsiveness(customerId, dimId.getMonthId(), + OrgTypeConstant.DISTRICT, OrgTypeConstant.AGENCY); + if (null != responsiveness && !responsiveness.isEmpty()) { + list.forEach(entity -> responsiveness.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(response -> { + if (response.getCount() != NumConstant.ZERO) { + BigDecimal count = new BigDecimal(response.getCount()); + BigDecimal sum = new BigDecimal(response.getSum()); + entity.setRespProjectRatio(sum.divide(count, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //社区办结项目满意度 + List satisfaction = factOriginProjectLogDailyService.getSatisfaction(customerId, dimId.getMonthId(), OrgTypeConstant.DISTRICT); + if (CollectionUtils.isEmpty(satisfaction)) { + list.forEach(entity -> satisfaction.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(sa -> { + if (sa.getCount() != NumConstant.ZERO) { + BigDecimal count = new BigDecimal(sa.getCount()); + BigDecimal sum = new BigDecimal(sa.getSum()); + entity.setSatisfactionRatio(sum.divide(count, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //办结数 + Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(customerId,dimId.getMonthId(),"month"); + Map agencyParticipatedCount = factOriginProjectLogDailyService.getCountOfProjectsHandledByAgency(customerId,dimId.getMonthId(),"month"); + Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month"); + list.forEach(entity ->{ + entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId())); + BigDecimal element = new BigDecimal(entity.getClosedProjectCount()); + //分母,即机关参与过的项目数(去重) + Integer denominator = agencyParticipatedCount.get(entity.getAgencyId()); + if (null != denominator && denominator != NumConstant.ZERO) { + //办结率 + entity.setClosedProjectRatio( + element.divide(new BigDecimal(denominator), NumConstant.SIX, RoundingMode.HALF_UP) + ); + }else{ + entity.setClosedProjectRatio(BigDecimal.ZERO); + } + //办结效率 + entity.setHandleProjectRatio(Optional.ofNullable(efficiencyMap.get(entity.getAgencyId())).orElse(BigDecimal.ZERO)); + }); + + factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.DISTRICT); + factIndexGovrnAblityOrgMonthlyService.saveList(list); + + + //2.党建能力 + //获取社区发文数量 + List articles = factArticlePublishedAgencyDailyService.getArticleCount(customerId, dimId.getMonthId(), + OrgTypeConstant.DISTRICT); + List partyList = agencyList.stream().map(agency ->{ + FactIndexPartyAblityOrgMonthlyEntity entity = new FactIndexPartyAblityOrgMonthlyEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(agency.getId()); + entity.setParentId(agency.getPid()); + entity.setYearId(dimId.getYearId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setMonthId(dimId.getMonthId()); + entity.setDataType(OrgTypeConstant.DISTRICT); + entity.setPublishArticleCount(NumConstant.ZERO); + return entity; + }).collect(Collectors.toList()); + if (null != articles && !articles.isEmpty()) { + partyList.forEach(entity -> articles.stream().filter(article -> entity.getAgencyId().equals(article.getAgencyId())).forEach(dto -> + entity.setPublishArticleCount(dto.getArticleTotalCount()) + )); + } + factIndexPartyAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.DISTRICT); + factIndexPartyAblityOrgMonthlyService.saveList(partyList); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java index 256ac5b76f..27275d1e12 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java @@ -154,7 +154,7 @@ public class IndexCollStreetServiceImpl implements IndexCollStreetService { entity.setYearId(dimId.getYearId()); entity.setQuarterId(dimId.getQuarterId()); entity.setMonthId(dimId.getMonthId()); - entity.setDataType(OrgTypeConstant.COMMUNITY); + entity.setDataType(OrgTypeConstant.STREET); entity.setPublishArticleCount(NumConstant.ZERO); return entity; }).collect(Collectors.toList()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java index 60d592a1b6..9c0f977223 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java @@ -42,6 +42,8 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService private IndexCollStreetService indexCollStreetService; @Autowired private IndexCollCommunityService indexCollCommunityService; + @Autowired + private IndexCollDistrictService indexCollDistrictService; /** * desc:从统计库对象抽取指标数据 @@ -114,6 +116,11 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService }catch (Exception e){ log.error("抽取【社区治理能力-社区党建能力】发生异常,参数:" + JSON.toJSONString(param), e); } + try{ + indexCollDistrictService.saveDistrictAbility(customerId, monthId); + }catch (Exception e){ + log.error("抽取【全区治理能力-全区党建能力】发生异常,参数:" + JSON.toJSONString(param), e); + } }); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java index f21e8b3976..1011df61f6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java @@ -22,9 +22,9 @@ public interface ProjectExtractService { void saveOriginProjectDaily(ExtractOriginFormDTO extractOriginFormDTO); /** + * 抽取项目节点历时逻辑 * @param param * @return - * @Description 抽取项目节点历时逻辑 * @author wangc * @date 2020.09.17 14:05 **/ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java index 0d44c2143e..ef55ca765a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java @@ -38,4 +38,15 @@ public interface GovernRankDataExtractService { * @date 2020/9/24 15:17 */ void extractStreetData(String customerId, String monthId); + + /** + * 全区治理能力 + * + * @param customerId + * @param monthId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + void extractDistrictData(String customerId, String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/OrgRankExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/OrgRankExtractService.java index 9afc2593e4..9a2e1dd7e2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/OrgRankExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/OrgRankExtractService.java @@ -38,4 +38,15 @@ public interface OrgRankExtractService { * @date 2020/9/24 15:17 */ void extractStreetData(String customerId, String monthId); + + /** + * 全区先进排行 + * + * @param customerId + * @param monthId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + void extractDistrictData(String customerId, String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java index 502a20a32f..d2f422fbc7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java @@ -225,4 +225,64 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe } screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list); } + + @Override + public void extractDistrictData(String customerId, String monthId) { + List list = screenGovernRankDataService.initList(customerId, OrgTypeConstant.AGENCY, OrgTypeConstant.DISTRICT); + if (CollectionUtils.isEmpty(list)) { + return; + } + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + list.forEach(entity -> { + entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(monthId); + }); + //满意率 满意和非常满意占比 + List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.DISTRICT); + if (!CollectionUtils.isEmpty(satisfactionList)) { + list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //响应率 响应次数/流转到网格的次数 + List responseList = factOriginProjectLogDailyService.getOrgResponse(customerId, monthId, OrgTypeConstant.DISTRICT); + if (!CollectionUtils.isEmpty(responseList)) { + list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //自制率 自治项目数/办结项目数 + List selfList = factOriginProjectMainDailyService.getSelfProject(customerId, monthId, OrgTypeConstant.DISTRICT); + if (!CollectionUtils.isEmpty(selfList)) { + list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //解决率 已解决项目数/办结项目数 + List resolveList = factOriginProjectMainDailyService.getResolveProject(customerId, monthId, + OrgTypeConstant.DISTRICT); + if (!CollectionUtils.isEmpty(resolveList)) { + list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java index 904ee9d57a..cc61d54242 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java @@ -67,37 +67,37 @@ public class OrgRankExtractServiceImpl implements OrgRankExtractService { //党员数 List partyMemberList = factRegUserGridMonthlyService.getGridUserCountByCustomer(customerId, monthId); if (!CollectionUtils.isEmpty(partyMemberList)) { - list.forEach(entity -> partyMemberList.stream().filter(item -> item.getGridId().equals(entity.getOrgId())).forEach(dto -> { - entity.setPartyTotal(dto.getPartymemberTotal()); - })); + list.forEach(entity -> partyMemberList.stream().filter(item -> item.getGridId().equals(entity.getOrgId())).forEach(dto -> + entity.setPartyTotal(dto.getPartymemberTotal()) + )); } //小组数 List groupList = factOriginGroupMainDailyService.getGridGroupCount(customerId, monthId); if (!CollectionUtils.isEmpty(groupList)) { - list.forEach(entity -> groupList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { - entity.setGroupTotal(dto.getCount()); - })); + list.forEach(entity -> groupList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> + entity.setGroupTotal(dto.getCount()) + )); } //话题数 List topicList = factOriginTopicMainDailyService.getGridTopicCount(customerId, monthId); if (!CollectionUtils.isEmpty(topicList)) { - list.forEach(entity -> topicList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { - entity.setTopicTotal(dto.getCount()); - })); + list.forEach(entity -> topicList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> + entity.setTopicTotal(dto.getCount()) + )); } //议题数 List issueList = factOriginIssueMainDailyService.getGridIssueCount(customerId, monthId); if (!CollectionUtils.isEmpty(issueList)) { - list.forEach(entity -> issueList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { - entity.setIssueTotal(dto.getCount()); - })); + list.forEach(entity -> issueList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> + entity.setIssueTotal(dto.getCount()) + )); } //项目数 List projectList = factOriginProjectMainDailyService.getGridProjectCount(customerId, monthId); if (!CollectionUtils.isEmpty(projectList)) { - list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { - entity.setProjectTotal(dto.getCount()); - })); + list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> + entity.setProjectTotal(dto.getCount()) + )); } //结案率 结案数/项目数 List abilityList = factIndexGovrnAblityGridMonthlyService.getGridByCustomer(customerId, monthId); @@ -139,44 +139,44 @@ public class OrgRankExtractServiceImpl implements OrgRankExtractService { List partyMemberList = factRegUserAgencyMonthlyService.getOrgUserCountByCustomer(customerId, monthId, OrgTypeConstant.COMMUNITY); if (!CollectionUtils.isEmpty(partyMemberList)) { - list.forEach(entity -> partyMemberList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { - entity.setPartyTotal(dto.getPartymemberTotal()); - })); + list.forEach(entity -> partyMemberList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setPartyTotal(dto.getPartymemberTotal()) + )); } //小组数 List groupList = factOriginGroupMainDailyService.getOrgGroupCount(customerId, monthId, OrgTypeConstant.COMMUNITY); if (!CollectionUtils.isEmpty(groupList)) { - list.forEach(entity -> groupList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { - entity.setGroupTotal(dto.getCount()); - })); + list.forEach(entity -> groupList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setGroupTotal(dto.getCount()) + )); } //话题数 List topicList = factOriginTopicMainDailyService.getOrgTopicCount(customerId, monthId, OrgTypeConstant.COMMUNITY); if (!CollectionUtils.isEmpty(topicList)) { - list.forEach(entity -> topicList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { - entity.setTopicTotal(dto.getCount()); - })); + list.forEach(entity -> topicList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setTopicTotal(dto.getCount()) + )); } //议题数 List issueList = factOriginIssueMainDailyService.getOrgIssueCount(customerId, monthId, OrgTypeConstant.COMMUNITY); if (!CollectionUtils.isEmpty(issueList)) { - list.forEach(entity -> issueList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { - entity.setIssueTotal(dto.getCount()); - })); + list.forEach(entity -> issueList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setIssueTotal(dto.getCount()) + )); } //项目数 List projectList = factOriginProjectMainDailyService.getOrgProjectCount(customerId, monthId, OrgTypeConstant.COMMUNITY); if (!CollectionUtils.isEmpty(projectList)) { - list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { - entity.setProjectTotal(dto.getCount()); - })); + list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> + entity.setProjectTotal(dto.getCount()) + )); } //结案率 结案数/项目数 List abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.COMMUNITY); if (!CollectionUtils.isEmpty(abilityList)) { - list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { - entity.setCloseProjectRatio(dto.getClosedProjectRatio()); - })); + list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setCloseProjectRatio(dto.getClosedProjectRatio()) + )); } //满意率 满意和非常满意占比 List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.COMMUNITY); @@ -206,45 +206,112 @@ public class OrgRankExtractServiceImpl implements OrgRankExtractService { List partyMemberList = factRegUserAgencyMonthlyService.getOrgUserCountByCustomer(customerId, monthId, OrgTypeConstant.COMMUNITY); if (!CollectionUtils.isEmpty(partyMemberList)) { - list.forEach(entity -> partyMemberList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { - entity.setPartyTotal(dto.getPartymemberTotal()); - })); + list.forEach(entity -> partyMemberList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setPartyTotal(dto.getPartymemberTotal()) + )); } //小组数 List groupList = factOriginGroupMainDailyService.getOrgGroupCount(customerId, monthId, OrgTypeConstant.STREET); if (!CollectionUtils.isEmpty(groupList)) { - list.forEach(entity -> groupList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { - entity.setGroupTotal(dto.getCount()); - })); + list.forEach(entity -> groupList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setGroupTotal(dto.getCount()) + )); } //话题数 List topicList = factOriginTopicMainDailyService.getOrgTopicCount(customerId, monthId, OrgTypeConstant.STREET); if (!CollectionUtils.isEmpty(topicList)) { - list.forEach(entity -> topicList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { - entity.setTopicTotal(dto.getCount()); - })); + list.forEach(entity -> topicList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setTopicTotal(dto.getCount()) + )); } //议题数 List issueList = factOriginIssueMainDailyService.getOrgIssueCount(customerId, monthId, OrgTypeConstant.STREET); if (!CollectionUtils.isEmpty(issueList)) { - list.forEach(entity -> issueList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { - entity.setIssueTotal(dto.getCount()); - })); + list.forEach(entity -> issueList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setIssueTotal(dto.getCount()) + )); } //项目数 List projectList = factOriginProjectMainDailyService.getOrgProjectCount(customerId, monthId, OrgTypeConstant.STREET); if (!CollectionUtils.isEmpty(projectList)) { - list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { - entity.setProjectTotal(dto.getCount()); - })); + list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> + entity.setProjectTotal(dto.getCount()) + )); } //结案率 结案数/项目数 List abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.STREET); if (!CollectionUtils.isEmpty(abilityList)) { - list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { - entity.setCloseProjectRatio(dto.getClosedProjectRatio()); + list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setCloseProjectRatio(dto.getClosedProjectRatio()) + )); + } + //满意率 满意和非常满意占比 + List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.STREET); + if (!CollectionUtils.isEmpty(satisfactionList)) { + list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } })); } + } + + @Override + public void extractDistrictData(String customerId, String monthId) { + List list = screenOrgRankDataService.initList(customerId, OrgTypeConstant.AGENCY, OrgTypeConstant.DISTRICT); + if (CollectionUtils.isEmpty(list)) { + return; + } + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + list.forEach(entity -> { + entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(monthId); + }); + //党员数 + List partyMemberList = factRegUserAgencyMonthlyService.getOrgUserCountByCustomer(customerId, monthId, + OrgTypeConstant.COMMUNITY); + if (!CollectionUtils.isEmpty(partyMemberList)) { + list.forEach(entity -> partyMemberList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setPartyTotal(dto.getPartymemberTotal()) + )); + } + //小组数 + List groupList = factOriginGroupMainDailyService.getOrgGroupCount(customerId, monthId, OrgTypeConstant.DISTRICT); + if (!CollectionUtils.isEmpty(groupList)) { + list.forEach(entity -> groupList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setGroupTotal(dto.getCount()) + )); + } + //话题数 + List topicList = factOriginTopicMainDailyService.getOrgTopicCount(customerId, monthId, OrgTypeConstant.DISTRICT); + if (!CollectionUtils.isEmpty(topicList)) { + list.forEach(entity -> topicList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setTopicTotal(dto.getCount()) + )); + } + //议题数 + List issueList = factOriginIssueMainDailyService.getOrgIssueCount(customerId, monthId, OrgTypeConstant.DISTRICT); + if (!CollectionUtils.isEmpty(issueList)) { + list.forEach(entity -> issueList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setIssueTotal(dto.getCount()) + )); + } + //项目数 + List projectList = factOriginProjectMainDailyService.getOrgProjectCount(customerId, monthId, OrgTypeConstant.DISTRICT); + if (!CollectionUtils.isEmpty(projectList)) { + list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> + entity.setProjectTotal(dto.getCount()) + )); + } + //结案率 结案数/项目数 + List abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.DISTRICT); + if (!CollectionUtils.isEmpty(abilityList)) { + list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> + entity.setCloseProjectRatio(dto.getClosedProjectRatio()) + )); + } //满意率 满意和非常满意占比 List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.STREET); if (!CollectionUtils.isEmpty(satisfactionList)) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index 946c965fde..ca37775756 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -138,11 +138,12 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { governRankDataExtractService.extractGridData(customerId, monthId); governRankDataExtractService.extractCommunityData(customerId, monthId); governRankDataExtractService.extractStreetData(customerId, monthId); + governRankDataExtractService.extractDistrictData(customerId, monthId); //先进排行 screen_org_rank_data orgRankExtractService.extractGridData(customerId, monthId); orgRankExtractService.extractCommunityData(customerId, monthId); orgRankExtractService.extractStreetData(customerId, monthId); - + orgRankExtractService.extractDistrictData(customerId, monthId); // 党建引领 screen_party_branch_data,screen_party_link_masses_data partyGuideService.partyGuideExtract(formDTO); } From 7f04edff212cb7d2f85367a9a22811dea3aa7032 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 29 Sep 2020 10:22:59 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E6=8C=89=E6=9C=88=E6=8A=BD=E5=8F=96=20?= =?UTF-8?q?=E6=9C=88=E4=BB=BD=E5=8F=82=E6=95=B0=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/toscreen/impl/ScreenExtractServiceImpl.java | 2 +- .../indexcoll/impl/FactIndexCollectServiceImpl.java | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index ca37775756..e1594766df 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -96,7 +96,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { } else if (StringUtils.isNotBlank(formDTO.getMonthId())) { extractMonthly(customerId, formDTO.getMonthId()); } else { - String dateId = LocalDate.now().minusDays(NumConstant.ONE).toString().replace("-", ""); + String dateId = LocalDate.now().minusMonths(NumConstant.ONE).toString().replace("-", ""); extractMonthly(customerId, dateId); } }); 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 ade95f1c5d..0732ac80c5 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 @@ -641,11 +641,15 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId); int j = 0; for(Map.Entry> agencyScore : collect.entrySet()){ + if (NumConstant.ZERO_STR.equals(agencyScore.getKey())) { + log.warn("insertIndexDataMonthlyByAgencyScore agencyyId is 0"); + continue; + } IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); // 给4个指数 赋默认值 monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); - for ( int i = 0; i < agencyScore.getValue().size(); i++){ - if (NumConstant.ONE_STR.equals(agencyScore.getValue().get(i).getIsTotal())){ + for (int i = 0; i < agencyScore.getValue().size(); i++) { + if (NumConstant.ONE_STR.equals(agencyScore.getValue().get(i).getIsTotal())) { // 是总分 总指数 = IS_TOTAL = 1 monthlyFormDTO.setIndexTotal(agencyScore.getValue().get(i).getScore()); } else { From bb6a1030059915dd1561c0b6e9c0112eb53e722f Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 29 Sep 2020 10:23:20 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/indexcal/AgencyScoreDao.xml | 11 ++++++----- .../evaluationindex/indexcal/CommunityScoreDao.xml | 1 + .../mapper/evaluationindex/indexcal/GridScoreDao.xml | 3 ++- 3 files changed, 9 insertions(+), 6 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 8e37cf3359..9de83a3a9a 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,14 +101,15 @@ PARENT_AGENCY_ID AS parentId FROM fact_index_agency_score fics + LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = fics.PARENT_AGENCY_ID WHERE fics.del_flag = '0' - AND fics.AGENCY_ID != '0' - AND fics.customer_id = #{customerId} - AND fics.month_id = #{monthId} - AND fics.index_code = #{indexCode} + AND sca.level = 'district' + AND fics.customer_id = #{customerId} + AND fics.month_id = #{monthId} + AND fics.index_code = #{indexCode} AND fics.DATA_TYPE = #{dataType} - GROUP BY fics.parent_agency_id + GROUP BY fics.parent_agency_id diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml index aca5ce3669..8be2f83314 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml @@ -83,6 +83,7 @@ WHERE fics.del_flag = '0' AND sca.DEL_FLAG = 0 + AND sca.level = 'street' AND fics.customer_id = #{customerId} AND fics.month_id = #{monthId} AND fics.index_code = #{indexCode} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml index aab983a94f..7f3912fa6f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml @@ -135,10 +135,11 @@ sca.pid AS parentId FROM fact_index_grid_score figc - LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = figc.AGENCY_ID + LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = figc.AGENCY_ID WHERE figc.del_flag = '0' AND sca.DEL_FLAG = 0 + AND sca.level = 'community' AND figc.customer_id = #{customerId} AND figc.month_id = #{monthId} AND figc.index_code = #{indexCode}