diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java index 5e0d0585be..bc00d9e97b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java @@ -71,6 +71,7 @@ public interface AgencyScoreDao extends BaseDao { * @date 2021/1/15 下午4:23 */ List selectAgencyScoreInfoExistsSub(@Param("areaCode") String areaCode,@Param("areaCodeLength") Integer areaCodeLength, @Param("monthId")String monthId, @Param("dataType")String dataType); + List selectAgencyScoreInfoExistsSubSelf(@Param("areaCode") String areaCode, @Param("monthId")String monthId, @Param("dataType")String dataType); /** * @Description 区下级街道得分平均值 @@ -91,6 +92,7 @@ public interface AgencyScoreDao extends BaseDao { * @date 2021/1/18 上午9:09 */ List selectAgencyScoreAvgExistsSub(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("dataType")String dataType,@Param("areaCode")String areaCode,@Param("areaCodeLength")Integer areaCodeLength); + List selectAgencyScoreAvgByOrgIds(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("orgIds")List orgIds); /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java index a22317c371..cc35dbb875 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java @@ -77,6 +77,7 @@ public interface DeptScoreDao extends BaseDao { * @date 2021/1/18 上午9:31 */ List selectGovernDeptScoreAvgExistsSub(@Param("areaCode")String areaCode, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + List selectGovernDeptScoreAvgExistsSubNotSelf(@Param("areaCode")String areaCode, @Param("monthId")String monthId, @Param("indexCode")String indexCode); /** * @return int 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 f61e21f2ad..44eeb11fa6 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 @@ -194,4 +194,12 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectAgencyByCustomer(@Param("customerId")String customerId); List selectAgencyByAreaCode(String areaCode); + + /** + * @Description 根据areaCode查询下级组织 + * @Param areaCode + * @author zxc + * @date 2021/3/9 上午9:41 + */ + List selectAgencyByParentAreaCode(@Param("areaCode") String areaCode); } 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 592c114fd4..5ea39f0d4c 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 @@ -23,6 +23,7 @@ import com.epmet.dto.indexcal.AgencyCalResultDTO; import com.epmet.dto.indexcal.AgencyScoreDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; +import com.epmet.dto.screen.ScreenProjectOrgDailyDTO; import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; import com.epmet.entity.evaluationindex.indexcal.AgencySelfSubScoreEntity; import com.epmet.entity.evaluationindex.indexcal.AgencySubScoreEntity; @@ -604,10 +605,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + List orgInfos = customerAgencyDao.selectAgencyByParentAreaCode(form.getCustomerAreaCode()); //党建能力平均值 indexDetailList.forEach(detail -> { if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { - List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX); + List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgByOrgIds(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),orgInfos.stream().map(o -> o.getOrgId()).collect(Collectors.toList())); if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.warn(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); } else if (subGridPartyAvgScore.size() > NumConstant.ZERO) { @@ -629,7 +631,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } } else { // 区名义发文数量 - List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSub(monthId,form.getCustomerAreaCode(),NumConstant.SIX); + List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSubNotSelf(monthId,form.getCustomerAreaCode(),NumConstant.SIX); if (CollectionUtils.isEmpty(publishArticleCountList)) { log.warn(IndexCalConstant.DISTRICT_PUBLISH_ARTICLE_LIST_NULL); } else { @@ -682,9 +684,12 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + List orgInfos = customerAgencyDao.selectAgencyByParentAreaCode(form.getCustomerAreaCode()); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { - List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX); +// List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX); + List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgByOrgIds(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),orgInfos.stream().map(m -> m.getOrgId()).collect(Collectors.toList())); + log.info(districtGovernAvgList.toString()); for (int i = 0; i < districtGovernAvgList.size(); i++) { if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ districtGovernAvgList.remove(districtGovernAvgList.get(i)); @@ -710,7 +715,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict }); } } else if (IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode().equals(detail.getIndexCode())){ - List deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvgExistsSub(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); + List deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvgExistsSubNotSelf(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); for (int i = 0; i < deptScoreAvgList.size(); i++) { if (deptScoreAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ deptScoreAvgList.remove(deptScoreAvgList.get(i)); @@ -762,10 +767,12 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + List orgInfos = customerAgencyDao.selectAgencyByParentAreaCode(form.getCustomerAreaCode()); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { - List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX); +// List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX); + List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgByOrgIds(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),orgInfos.stream().map(m -> m.getOrgId()).collect(Collectors.toList())); for (int i = 0; i < subStreetAvgList.size(); i++) { if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ subStreetAvgList.remove(subStreetAvgList.get(i)); @@ -815,7 +822,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict String customerId = form.getCustomerId(); String monthId = form.getMonthId(); List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); - List agencyScoreList = agencyScoreDao.selectAgencyScoreInfoExistsSub(form.getCustomerAreaCode(),NumConstant.SIX,monthId, IndexCalConstant.DISTRICT_LEVEL); + List agencyScoreList = agencyScoreDao.selectAgencyScoreInfoExistsSubSelf(form.getCustomerAreaCode(),monthId, IndexCalConstant.DISTRICT_LEVEL); detailListByParentCode.forEach(detail -> { agencyScoreList.forEach(community -> { if (detail.getIndexCode().equals(community.getIndexCode())) { 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 6ba1ac05cf..c082758802 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 @@ -142,6 +142,7 @@ WHERE fias.del_flag = 0 AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') + AND sca.AREA_CODE != #{areaCode} AND fias.MONTH_ID = #{monthId} AND fias.data_type = #{dataType} AND fias.IS_TOTAL = "0" @@ -159,7 +160,7 @@ fics.year_id, ROUND(AVG( fics.score ),6) AS score, fics.customer_id, - PARENT_AGENCY_ID AS parentId + fics.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 @@ -172,4 +173,51 @@ AND fics.DATA_TYPE = #{dataType} GROUP BY fics.parent_agency_id + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml index d5f2e9b8a0..f0dc795c8e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml @@ -172,4 +172,25 @@ AND fidc.index_code = #{indexCode} GROUP BY fidc.agency_id + 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 9ce69d1128..c0f9e6e261 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 @@ -163,8 +163,7 @@ LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = pm.AGENCY_ID WHERE pm.del_flag = '0' - AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') - AND sca.AREA_CODE != #{areaCode} + AND sca.AREA_CODE = #{areaCode} AND pm.month_id = #{monthId} + + +