diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/PingYinConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/PingYinConstant.java new file mode 100644 index 0000000000..8586f6f2af --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/PingYinConstant.java @@ -0,0 +1,18 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2021/5/29 9:04 上午 + * @DESC + */ +public interface PingYinConstant { + + String KONG_CUN_AGENCY_ID = "1234085031077498881"; + String KONG_CUN_CUSTOMER_ID = "2fe0065f70ca0e23ce4c26fca5f1d933"; + + String JIN_SHUI_AGENCY_ID = "1215437824174608386"; + String JIN_SHUI__CUSTOMER_ID = "f5ff0770f409981c73adda6ae35143ef"; + + String YU_SHAN_AGENCY_ID = ""; + String YU_SHAN_CUSTOMER_ID = "a4bbf298d8e427844038cee466f022ef"; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java index 4799b0bc67..e50231be54 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java @@ -98,6 +98,17 @@ public interface CommunityScoreDao extends BaseDao selectSubCommAvgScoreExistSubNotSelf(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode); + + /** + * @Description 街道下级社区平均分 + * @Param monthId + * @Param indexCode + * @Param areaCode + * @Param quarterId + * @Param yearId + * @author zxc + * @date 2021/5/29 9:28 上午 + */ List selectSubCommAvgScoreExistSubNotSelfNew(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode, @Param("quarterId")String quarterId,@Param("yearId")String yearId); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java index e5b5562c7b..ed5d291442 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java @@ -78,7 +78,30 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao> selectCommunityGovernAbilityExistsSub(@Param("monthId")String monthId,@Param("areaCode")String areaCode); List> selectCommunityGovernAbilityExistsSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("level")String level); + + /** + * @Description 【社区】治理能力六个五级指标 + * @Param monthId + * @Param areaCode + * @Param level + * @Param quarterId + * @Param yearId + * @author zxc + * @date 2021/5/29 9:22 上午 + */ List> selectCommunityGovernAbilityExistsSubNotSelfNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("level")String level,@Param("quarterId")String quarterId,@Param("yearId")String yearId); + + /** + * @Description 治理能力的六个五级指标 + * @Param monthId + * @Param areaCode + * @Param level + * @Param quarterId + * @Param yearId + * @author zxc + * @date 2021/5/29 9:18 上午 + */ + List> selectStreetGovernAbilityExistsSubNotSelfNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("level")String level,@Param("quarterId")String quarterId,@Param("yearId")String yearId,@Param("customerId")String customerId); /** * @Description 孔村单独查询 * @Param monthId @@ -87,6 +110,17 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao> selectCommunityGovernAbilityIsKongCun(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("customerId")String customerId); + + /** + * @Description 孔村治理能力六个五级指标查询 + * @Param monthId + * @Param areaCode + * @Param quarterId + * @Param yearId + * @Param customerId + * @author zxc + * @date 2021/5/29 9:26 上午 + */ List> selectCommunityGovernAbilityIsKongCunNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId,@Param("customerId")String customerId); /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java index 557cddc050..767d491679 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java @@ -89,8 +89,29 @@ public interface FactIndexServiceAblityOrgMonthlyDao extends BaseDao> selectActivityCountMapExistsSub(@Param("monthId")String monthId,@Param("areaCode")String areaCode); - List> selectActivityCountMapExistsSubNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId); + + /** + * @Description 街道级 活动组织次数查询 + * @Param monthId + * @Param areaCode + * @Param quarterId + * @Param yearId + * @author zxc + * @date 2021/5/29 9:36 上午 + */ + List> selectActivityCountMapExistsSubNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId,@Param("customerId")String customerId); List> selectActivityCountMapIsKongCun(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("customerId")String customerId); + + /** + * @Description 孔村活动组织次数 + * @Param monthId + * @Param areaCode + * @Param quarterId + * @Param yearId + * @Param customerId + * @author zxc + * @date 2021/5/29 9:37 上午 + */ List> selectActivityCountMapIsKongCunNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId,@Param("customerId")String customerId); List> selectActivityCountMapExistsSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode); List> selectActivityCountMapExistsSubNotSelfNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId); 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 e94c2739f1..ccec3637fd 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 @@ -624,7 +624,9 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ //下属所有社区的党建能力平均值 detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { + // 下属所有社区的党建能力平均值 List dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelfNew(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); + // 数据处理 List subCommPartyAvgScore = disposeSubAvg(dispose, form); if (CollectionUtils.isEmpty(subCommPartyAvgScore)) { log.warn(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL); @@ -647,7 +649,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } } else { // 街道名义发文数量 - List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSubStreet(monthId,form.getCustomerAreaCode()); + List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSubStreetNew(monthId,form.getCustomerAreaCode(),quarterId,yearId); if (CollectionUtils.isEmpty(mapList)) { log.warn(IndexCalConstant.STREET_PUBLISH_ARTICLE_LIST_NULL); } else { @@ -703,7 +705,9 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) { + // 查询areaCode扫出所有社区级别的数据 List dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelfNew(monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); + // 孔村数据处理 List subGridGovernAvg = disposeSubAvg(dispose,form); if (CollectionUtils.isEmpty(subGridGovernAvg)){ log.warn("查询街道下属所有社区治理能力汇总为空"); @@ -781,7 +785,9 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) { + // 街道服务能力平均值 List dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelfNew(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); + // 孔村数据处理 List subCommServiceAvg = disposeSubAvg(dispose,form); if (CollectionUtils.isEmpty(subCommServiceAvg)) { log.warn("查询街道下属社区服务能力得分平均值为空"); @@ -802,6 +808,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ }); } } else { + // 活动组织次数 List> communityActivityCountList = disposeActivityCount(form); if (CollectionUtils.isEmpty(communityActivityCountList)) { log.warn(IndexCalConstant.STREET_SERVICE_ABILITY_NULL); @@ -890,6 +897,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ s.setAgencyId(org.getOrgId()); subAvgScores.add(s); }); + // 把除去孔村镇的数据赋值,孔村在下边单独处理 subAvgScores.forEach(subScore -> { if (!CollectionUtils.isEmpty(avgScore)){ avgScore.forEach(avg -> { @@ -901,16 +909,19 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } }); Map> groupByStatus = avgScore.stream().collect(Collectors.groupingBy(SubCommunityAvgResultDTO::getScoreStatus)); + // 孔村的党总支 数据 List subAvgResultDTOS = groupByStatus.get(false); if (!CollectionUtils.isEmpty(subAvgResultDTOS)){ AtomicReference finalScore = new AtomicReference<>(new BigDecimal(NumConstant.ZERO)); subAvgResultDTOS.forEach(sub -> { + // 党总支的数据相加 finalScore.set(finalScore.get().add(sub.getScore())); }); + // 党总支数据求平均值 BigDecimal divide = finalScore.get().divide(new BigDecimal(subAvgResultDTOS.size()),NumConstant.SIX,BigDecimal.ROUND_HALF_UP); subAvgScores.forEach(s -> { // 孔村单独处理 - if (s.getAgencyId().equals("1234085031077498881")){ + if (s.getAgencyId().equals(PingYinConstant.KONG_CUN_AGENCY_ID)){ s.setScore(divide); } }); @@ -918,15 +929,23 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return subAvgScores; } + /** + * @Description 治理能力的六个五级指标 + * @Param formDTO + * @author zxc + * @date 2021/5/29 9:18 上午 + */ public List> disposeFiveLevel(CalculateCommonFormDTO formDTO){ String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); String yearId = DateUtils.getYearId(formDTO.getMonthId()); List> result = new ArrayList<>(); - List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSubNotSelfNew(formDTO.getMonthId(),formDTO.getCustomerAreaCode(), ScreenConstant.STREET,quarterId,yearId); - List> kongCunGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityIsKongCunNew(formDTO.getMonthId(),formDTO.getCustomerAreaCode(), quarterId,yearId,"2fe0065f70ca0e23ce4c26fca5f1d933"); + // 治理能力的六个五级指标【街道】 + List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectStreetGovernAbilityExistsSubNotSelfNew(formDTO.getMonthId(),formDTO.getCustomerAreaCode(), ScreenConstant.STREET,quarterId,yearId,PingYinConstant.KONG_CUN_CUSTOMER_ID); + // 孔村数据单独查 + List> kongCunGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityIsKongCunNew(formDTO.getMonthId(),formDTO.getCustomerAreaCode(), quarterId,yearId,PingYinConstant.KONG_CUN_CUSTOMER_ID); if (!CollectionUtils.isEmpty(kongCunGovernAbility)){ kongCunGovernAbility.forEach(k -> { - k.put("AGENCY_ID",k.get("PARENT_ID")); + k.put("AGENCY_ID",k.get("AGENCY_ID")); k.put("PARENT_ID",NumConstant.ZERO_STR); }); } @@ -939,15 +958,23 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return result; } + /** + * @Description 活动组织次数【街道】 + * @Param formDTO + * @author zxc + * @date 2021/5/29 9:31 上午 + */ public List> disposeActivityCount(CalculateCommonFormDTO formDTO){ String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); String yearId = DateUtils.getYearId(formDTO.getMonthId()); List> result = new ArrayList<>(); - List> ActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapExistsSub(formDTO.getMonthId(),formDTO.getCustomerAreaCode()); - List> kongCunActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapIsKongCunNew(formDTO.getMonthId(),formDTO.getCustomerAreaCode(),quarterId,yearId,"2fe0065f70ca0e23ce4c26fca5f1d933"); + // 街道级 活动组织次数查询 + List> ActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapExistsSubNew(formDTO.getMonthId(),formDTO.getCustomerAreaCode(),quarterId,yearId,PingYinConstant.KONG_CUN_CUSTOMER_ID); + // 孔村活动组织次数 + List> kongCunActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapIsKongCunNew(formDTO.getMonthId(),formDTO.getCustomerAreaCode(),quarterId,yearId,PingYinConstant.KONG_CUN_CUSTOMER_ID); if (!CollectionUtils.isEmpty(kongCunActivityCountList)){ kongCunActivityCountList.forEach(k -> { - k.put("AGENCY_ID",k.get("PARENT_ID")); + k.put("AGENCY_ID",k.get("AGENCY_ID")); k.put("PARENT_ID",NumConstant.ZERO_STR); }); } 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 96a7ed9557..45af93c437 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 @@ -147,6 +147,7 @@ OR cs.INDEX_CODE = "fuwunengli") + + @@ -281,6 +283,8 @@ AND sca.CUSTOMER_ID = #{customerId} AND gm.PARENT_ID != '0' + + + + + 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 bd138f9025..b43cd76f13 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 @@ -194,6 +194,8 @@ AND sm.month_id = #{monthId} AND sm.PARENT_ID != '0' + + - +