From bdabd15c343ec1fc83d2875ca246c0cac1e3c9bd Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 27 May 2021 10:33:02 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E3=80=81=E5=8C=BA=E7=9B=B4=E9=83=A8=E9=97=A8=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=EF=BC=8C=E6=8C=87=E6=A0=87=E8=AE=A1=E7=AE=97=EF=BC=8C=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E4=BB=A5screen=5Fcustomer=5Fgrid=E3=80=81screen=5Fcus?= =?UTF-8?q?tomer=5Fdept=E4=B8=BA=E4=B8=BB=E8=A1=A8=E3=80=82=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E9=83=A8=E9=97=A8=E6=88=96=E7=BD=91=E6=A0=BC=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=8E=9F=E5=A7=8B=E6=8C=87=E6=A0=87=E5=80=BC=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E8=B5=8B=E5=80=BC=E4=B8=BA0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/GridCorreLationServiceImpl.java | 8 +- .../FactIndexGovrnAblityDeptMonthlyDao.xml | 82 ++++----- .../FactIndexGovrnAblityGridMonthlyDao.xml | 105 +++++------- .../FactIndexPartyAblityGridMonthlyDao.xml | 156 ++++++++---------- .../FactIndexServiceAblityGridMonthlyDao.xml | 80 ++++----- 5 files changed, 196 insertions(+), 235 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java index b785d78b4a..86da0df973 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java @@ -192,9 +192,11 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { log.error("calculateGridDangJian customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); throw new RenException("客户【网格相关:党建能力】指标权重信息不存在"); } - //查询总记录数 + //查询总记录数:如果网格内没有产生业务数据,fact_index_party_ablity_grid_monthly为空,改为以screen_customer_grid为主表 + //举例:有10个网格,只有2个网格在指标表里面有记录,实际total应该还是为10. 并且那8个指标值赋值为0 int total = factIndexPartyAblityGridMonthlyDao.selectCount(formDTO); if (NumConstant.ZERO == total) { + log.warn(String.format("customerId=%s,monthId=%s,没有找到screen_customer_grid记录", formDTO.getCustomerId(), formDTO.getMonthId())); log.warn(String.format("customerId=%s,monthId=%s,没有上传网格相关-党建能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); return; } @@ -214,6 +216,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { for (int pageNo = 1; pageNo <= totalPage; pageNo++) { int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; //前10条 + //这块逻辑也要改为以screen_customer_grid表为主表,没有五级指标值的网格,赋值为0 List> recordList = queryListPartyAblityGrid(new PageQueryGridFormDTO(formDTO.getCustomerId(), formDTO.getMonthId(), pageIndex, @@ -603,7 +606,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { log.error("calculateGridZhiLi customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); throw new RenException("客户【网格相关:治理能力】指标权重信息不存在"); } - //查询总记录数 + //查询总记录数:如果网格内没有产生业务数据,fact_index_govrn_ablity_grid_monthly为空,改为以screen_customer_grid为主表 + //举例:有10个网格,只有2个网格在指标表里面有记录,实际total应该还是为10. 并且那8个指标值赋值为0 int total = factIndexGovrnAblityGridMonthlyDao.selectCount(formDTO); if (NumConstant.ZERO == total) { log.warn(String.format("customerId%s,monthId%s,没有上传网格相关-治理能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); 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 f782210785..8b50b7c989 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 @@ -98,24 +98,16 @@ SELECT - m.CUSTOMER_ID, - m.DEPT_ID, - m.MONTH_ID, - MIN(m.TRANSFERED_COUNT) as TRANSFERED_COUNT_MIN, - MAX(m.TRANSFERED_COUNT) as TRANSFERED_COUNT_MAX, - MIN(m.CLOSED_PROJECT_COUNT) as CLOSED_PROJECT_COUNT_MIN, - MAX(m.CLOSED_PROJECT_COUNT) as CLOSED_PROJECT_COUNT_MAX, - MIN(m.RESP_PROJECT_RATIO) as RESP_PROJECT_RATIO_MIN, - MAX(m.RESP_PROJECT_RATIO) as RESP_PROJECT_RATIO_MAX, - MIN(m.HANDLE_PROJECT_RATIO) as HANDLE_PROJECT_RATIO_MIN, - MAX(m.HANDLE_PROJECT_RATIO) as HANDLE_PROJECT_RATIO_MAX, - MIN(M.CLOSED_PROJECT_RATIO) as CLOSED_PROJECT_RATIO_MIN, - MAX(M.CLOSED_PROJECT_RATIO) as CLOSED_PROJECT_RATIO_MAX, - MIN(M.SATISFACTION_RATIO) as SATISFACTION_RATIO_MIN, - MAX(M.SATISFACTION_RATIO) as SATISFACTION_RATIO_MAX + IFNULL(MIN(m.TRANSFERED_COUNT),0) as TRANSFERED_COUNT_MIN, + IFNULL(MAX(m.TRANSFERED_COUNT),0) as TRANSFERED_COUNT_MAX, + IFNULL(MIN(m.CLOSED_PROJECT_COUNT),0) as CLOSED_PROJECT_COUNT_MIN, + IFNULL(MAX(m.CLOSED_PROJECT_COUNT),0) as CLOSED_PROJECT_COUNT_MAX, + IFNULL(MIN(m.RESP_PROJECT_RATIO),0) as RESP_PROJECT_RATIO_MIN, + IFNULL(MAX(m.RESP_PROJECT_RATIO),0) as RESP_PROJECT_RATIO_MAX, + IFNULL(MIN(m.HANDLE_PROJECT_RATIO),0) as HANDLE_PROJECT_RATIO_MIN, + IFNULL(MAX(m.HANDLE_PROJECT_RATIO),0) as HANDLE_PROJECT_RATIO_MAX, + IFNULL(MIN(M.CLOSED_PROJECT_RATIO),0) as CLOSED_PROJECT_RATIO_MIN, + IFNULL(MAX(M.CLOSED_PROJECT_RATIO),0) as CLOSED_PROJECT_RATIO_MAX, + IFNULL(MIN(M.SATISFACTION_RATIO),0) as SATISFACTION_RATIO_MIN, + IFNULL(MAX(M.SATISFACTION_RATIO),0) as SATISFACTION_RATIO_MAX FROM fact_index_govrn_ablity_dept_monthly m inner join screen_customer_dept scd @@ -155,7 +144,6 @@ and scd.AREA_CODE LIKE concat( #{customerAreaCode}, '%') - AND m.CUSTOMER_ID =#{customerId} and scd.CUSTOMER_ID=#{customerId} @@ -164,38 +152,36 @@ 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 755e3aab60..3298ce153b 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 @@ -100,80 +100,73 @@ SELECT - count( 1 ) AS total + count( scg.GRID_ID ) AS total FROM - fact_index_govrn_ablity_grid_monthly m - inner join screen_customer_grid scg - on( - m.GRID_ID=scg.GRID_ID - and scg.DEL_FLAG='0' + screen_customer_grid scg + WHERE scg.DEL_FLAG='0' and scg.UP_TO_CAL='yes' - ) - WHERE - m.DEL_FLAG = '0' - AND m.MONTH_ID=#{monthId} and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') - AND m.CUSTOMER_ID =#{customerId} and scg.CUSTOMER_ID=#{customerId} 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 a1d0e85e45..c34190359f 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 @@ -105,98 +105,92 @@ + - SELECT - count(1) as total + SELECT + count(scg.GRID_ID) as total FROM - fact_index_party_ablity_grid_monthly m - inner join screen_customer_grid scg - on( - m.GRID_ID=scg.GRID_ID - and scg.DEL_FLAG='0' - and scg.UP_TO_CAL='yes' - ) - WHERE - m.DEL_FLAG = '0' - AND m.MONTH_ID =#{monthId} - - - and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') - - - AND m.CUSTOMER_ID =#{customerId} - and scg.CUSTOMER_ID=#{customerId} - - + screen_customer_grid scg + WHERE scg.DEL_FLAG='0' + and scg.UP_TO_CAL='yes' + + + and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + and scg.CUSTOMER_ID=#{customerId} + + 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 fa6f11e4a3..ab55e72e48 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 @@ -81,51 +81,59 @@ SELECT - count(1) as total + count(scg.GRID_ID) as total FROM - fact_index_service_ablity_grid_monthly m - inner join screen_customer_grid scg - on( - m.GRID_ID=scg.GRID_ID - and scg.DEL_FLAG='0' + screen_customer_grid scg + WHERE scg.DEL_FLAG='0' and scg.UP_TO_CAL='yes' - ) - WHERE - m.DEL_FLAG = '0' - AND m.MONTH_ID =#{monthId} and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') - AND m.CUSTOMER_ID =#{customerId} and scg.CUSTOMER_ID=#{customerId} From 7fd907f0932114f97138a572169eaf20126a5754 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 27 May 2021 11:07:23 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=B0=91=E4=B8=80=E4=B8=AA=E7=BD=91?= =?UTF-8?q?=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcoll/FactIndexPartyAblityGridMonthlyDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 c34190359f..5b2920b8eb 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 @@ -114,7 +114,7 @@ #{monthId} as MONTH_ID, IFNULL(m.USER_COUNT,0) AS USER_COUNT, IFNULL(m.PARTY_COUNT,0) AS PARTY_COUNT, - IFNULL(m.ACTIVE_USER_COUNT,0) AS ACTIVE_USER_COUNT + IFNULL(m.ACTIVE_USER_COUNT,0) AS ACTIVE_USER_COUNT, IFNULL(m.ACTIVE_PARTY_COUNT,0) AS ACTIVE_PARTY_COUNT, IFNULL(m.PARTY_AVG_TOPIC_COUNT,0) AS PARTY_AVG_TOPIC_COUNT, IFNULL(m.USER_AVG_TOPIC_COUNT,0) AS USER_AVG_TOPIC_COUNT, From 1045eedcedb288fa8df7ae747c913b62c92e5b70 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 27 May 2021 14:20:32 +0800 Subject: [PATCH 3/5] =?UTF-8?q?street=E7=BA=A7=E5=88=AB=20=E8=83=BD?= =?UTF-8?q?=E5=8A=9B=E6=8C=87=E6=95=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcal/CommunityScoreDao.java | 7 +- .../FactIndexGovrnAblityOrgMonthlyDao.java | 4 + .../FactIndexPartyAblityOrgMonthlyDao.java | 4 + .../FactIndexServiceAblityOrgMonthlyDao.java | 4 + .../impl/IndexCalculateStreetServiceImpl.java | 44 ++++++--- .../indexcal/CommunityScoreDao.xml | 90 +++++++------------ .../FactIndexGovrnAblityOrgMonthlyDao.xml | 82 +++++++++++++++++ .../FactIndexPartyAblityOrgMonthlyDao.xml | 63 +++++++++++++ .../FactIndexServiceAblityOrgMonthlyDao.xml | 67 ++++++++++++++ 9 files changed, 292 insertions(+), 73 deletions(-) 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 104f53bb42..bf5ef19a18 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 @@ -86,7 +86,8 @@ public interface CommunityScoreDao extends BaseDao selectSubCommAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + List selectSubCommAvgScoreNew(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode, + @Param("quarterId")String quarterId,@Param("yearId")String yearId); /** * @Description 街道下级所有社区得分平均值 存在下级客户 @@ -96,8 +97,8 @@ public interface CommunityScoreDao extends BaseDao selectSubCommAvgScoreExistSub(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode); - List selectSubCommAvgScoreExistSubNotSelf(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode); + List selectSubCommAvgScoreExistSubNotSelfNew(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode, + @Param("quarterId")String quarterId,@Param("yearId")String yearId); /** * 根据入参查询 查询社区id 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 24f48eef4f..e3501f40ff 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 @@ -66,6 +66,8 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao> selectCommunityGovernAbility(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); + List> selectCommunityGovernAbilityNew(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level, + @Param("quarterId")String quarterId,@Param("yearId")String yearId); /** * @Description 社区治理能力各个参数查询【被吹哨次数、办结项目数、项目响应度、超期项目率、【街道办结项目的处理效率,level为street时存在】、办结项目率、办结项目满意度】存在下级客户时 @@ -76,6 +78,7 @@ 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); + 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 @@ -84,6 +87,7 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao> selectCommunityGovernAbilityIsKongCun(@Param("monthId")String monthId,@Param("areaCode")String areaCode); + List> selectCommunityGovernAbilityIsKongCunNew(@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/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java index dd3774be45..8a879f0ea4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java @@ -77,6 +77,8 @@ public interface FactIndexPartyAblityOrgMonthlyDao extends BaseDao> selectPublishArticleCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); + List> selectPublishArticleCountMapNew(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level, + @Param("quarterId")String quarterId,@Param("yearId")String yearId); /** * @Description 查询社区下的发文数 Map 存在下级客户 @@ -86,7 +88,9 @@ public interface FactIndexPartyAblityOrgMonthlyDao extends BaseDao> selectPublishArticleCountMapExistSubStreet(@Param("monthId")String monthId,@Param("areaCode")String areaCode); + List> selectPublishArticleCountMapExistSubStreetNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId); List> selectPublishArticleCountMapExistSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode); + List> selectPublishArticleCountMapExistSubNotSelfNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId); /** * @Description 查询社区下的发文数 Map【根据areaCode】 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 28917bf72b..60f0018c20 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 @@ -78,6 +78,8 @@ public interface FactIndexServiceAblityOrgMonthlyDao extends BaseDao> selectActivityCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); + List> selectActivityCountMapNew(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level, + @Param("quarterId")String quarterId,@Param("yearId")String yearId); /** * @Description 社区活动组织次数 存在下级客户 @@ -87,7 +89,9 @@ 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); List> selectActivityCountMapIsKongCun(@Param("monthId")String monthId,@Param("areaCode")String areaCode); + List> selectActivityCountMapIsKongCunNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId); List> selectActivityCountMapExistsSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode); /** 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 8c0bcf7484..663690925c 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 @@ -225,12 +225,14 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return true; } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); //下属所有社区的党建能力平均值 detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { - List subCommPartyAvgScore = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + List subCommPartyAvgScore = communityScoreDao.selectSubCommAvgScoreNew(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),quarterId,yearId); if (CollectionUtils.isEmpty(subCommPartyAvgScore)) { log.warn(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL); } else if (subCommPartyAvgScore.size() > NumConstant.ZERO) { @@ -251,7 +253,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } } else { // 街道名义发文数量 - List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId, IndexCalConstant.STREET_LEVEL); + List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapNew(customerId, monthId, IndexCalConstant.STREET_LEVEL,quarterId,yearId); if (CollectionUtils.isEmpty(mapList)) { log.warn(IndexCalConstant.STREET_PUBLISH_ARTICLE_LIST_NULL); } else { @@ -300,11 +302,13 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return true; } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); 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()); + List subGridGovernAvg = communityScoreDao.selectSubCommAvgScoreNew(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),quarterId,yearId); if (CollectionUtils.isEmpty(subGridGovernAvg)){ log.warn("查询街道下属所有社区治理能力汇总为空"); }else if (subGridGovernAvg.size() > NumConstant.ZERO) { @@ -324,7 +328,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } } else { // 治理能力的六个五级指标 - List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId,IndexCalConstant.STREET_LEVEL); + List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityNew(customerId, monthId,IndexCalConstant.STREET_LEVEL,quarterId,yearId); if (CollectionUtils.isEmpty(communityGovernAbility)){ log.warn(IndexCalConstant.STREET_GOVERN_ABILITY_NULL); }else{ @@ -372,12 +376,14 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return true; } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); 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()); + List subCommServiceAvg = communityScoreDao.selectSubCommAvgScoreNew(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),quarterId,yearId); if (CollectionUtils.isEmpty(subCommServiceAvg)) { log.warn("查询街道下属社区服务能力得分平均值为空"); } else if (subCommServiceAvg.size() > NumConstant.ZERO) { @@ -396,7 +402,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ }); } } else { - List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMap(customerId, monthId,IndexCalConstant.STREET_LEVEL); + List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapNew(customerId, monthId,IndexCalConstant.STREET_LEVEL,quarterId,yearId); if (CollectionUtils.isEmpty(communityActivityCountList)) { log.warn(IndexCalConstant.STREET_SERVICE_ABILITY_NULL); }else{ @@ -610,12 +616,14 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return true; } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); //下属所有社区的党建能力平均值 detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { - List dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode()); + 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); @@ -638,7 +646,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 { @@ -688,11 +696,13 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return true; } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) { - List dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); + 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("查询街道下属所有社区治理能力汇总为空"); @@ -763,12 +773,14 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return true; } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); 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 dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode()); + 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("查询街道下属社区服务能力得分平均值为空"); @@ -905,9 +917,11 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } public List> disposeFiveLevel(CalculateCommonFormDTO formDTO){ + String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); + String yearId = DateUtils.getYearId(formDTO.getMonthId()); List> result = new ArrayList<>(); - List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSubNotSelf(formDTO.getMonthId(),formDTO.getCustomerAreaCode(), ScreenConstant.STREET); - List> kongCunGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityIsKongCun(formDTO.getMonthId(),formDTO.getCustomerAreaCode()); + List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSubNotSelfNew(formDTO.getMonthId(),formDTO.getCustomerAreaCode(), ScreenConstant.STREET,quarterId,yearId); + List> kongCunGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityIsKongCunNew(formDTO.getMonthId(),formDTO.getCustomerAreaCode(),quarterId,yearId); if (!CollectionUtils.isEmpty(kongCunGovernAbility)){ kongCunGovernAbility.forEach(k -> { k.put("AGENCY_ID",k.get("PARENT_ID")); @@ -924,9 +938,11 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } 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.selectActivityCountMapIsKongCun(formDTO.getMonthId(),formDTO.getCustomerAreaCode()); + List> ActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapExistsSubNew(formDTO.getMonthId(),formDTO.getCustomerAreaCode(),quarterId,yearId); + List> kongCunActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapIsKongCunNew(formDTO.getMonthId(),formDTO.getCustomerAreaCode(),quarterId,yearId); if (!CollectionUtils.isEmpty(kongCunActivityCountList)){ kongCunActivityCountList.forEach(k -> { k.put("AGENCY_ID",k.get("PARENT_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 28eda4f99c..a5ed6aab07 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 @@ -67,27 +67,26 @@ OR INDEX_CODE = "fuwunengli") - - SELECT - fics.PARENT_AGENCY_ID AS agencyId, - fics.month_id, - fics.quarter_id, - fics.year_id, - ROUND(AVG( fics.score ),6) AS score, - fics.customer_id, + sca.AGENCY_ID AS agencyId, + #{monthId} AS monthId, + #{quarterId} AS quarterId, + #{yearId} AS yearId, + IFNULL(ROUND(AVG( fics.score ),6),0) AS score, + sca.customer_id, sca.pid AS parentId - FROM - fact_index_community_score fics - LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = fics.PARENT_AGENCY_ID - 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} - GROUP BY fics.parent_agency_id + FROM screen_customer_agency sca + LEFT JOIN fact_index_community_score fics + ON (fics.PARENT_AGENCY_ID = sca.AGENCY_ID + AND fics.del_flag = '0' + AND fics.month_id = #{monthId} + AND fics.index_code = #{indexCode} + ) + WHERE sca.DEL_FLAG = 0 + AND sca.level = 'street' + AND sca.customer_id = #{customerId} + GROUP BY sca.AGENCY_ID - - SELECT - fics.PARENT_AGENCY_ID AS agencyId, - fics.month_id, - fics.quarter_id, - fics.year_id, - ROUND(AVG( fics.score ),6) AS score, - fics.customer_id, + sca.AGENCY_ID AS agencyId, + #{monthId} AS monthId, + #{quarterId} AS quarterId, + #{yearId} AS yearId, + IFNULL(ROUND(AVG( fics.score ),6),0) AS score, + sca.customer_id, sca.pid AS parentId - FROM - fact_index_community_score fics - LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = fics.PARENT_AGENCY_ID - WHERE - fics.del_flag = '0' - AND sca.DEL_FLAG = 0 - AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') - AND fics.month_id = #{monthId} - AND fics.index_code = #{indexCode} - GROUP BY fics.parent_agency_id - - 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 3dbe2956ed..4d731cb5c7 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 @@ -135,6 +135,35 @@ AND customer_id = #{customerId} AND month_id = #{monthId} + + + + + + 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 eeddf7a408..5749931e9b 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 @@ -112,6 +112,29 @@ AND month_id = #{monthId} + + + + + + + + + + + + + + From d8c32d1824bc7655793a3ac9b4c651f6c5f362fa Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 27 May 2021 15:25:06 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=85=A8=E5=8C=BA=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E6=8C=87=E6=95=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcal/AgencyScoreDao.java | 3 ++ .../indexcal/DeptScoreDao.java | 2 + .../IndexCalculateDistrictServiceImpl.java | 32 +++++++++---- .../indexcal/AgencyScoreDao.xml | 48 +++++++++++++++++++ .../evaluationindex/indexcal/DeptScoreDao.xml | 47 ++++++++++++++++++ 5 files changed, 122 insertions(+), 10 deletions(-) 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 2593996a1b..d0f1ab08df 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 @@ -81,6 +81,8 @@ public interface AgencyScoreDao extends BaseDao { * @date 2020/8/31 1:51 下午 */ List selectAgencyScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("dataType")String dataType); + List selectAgencyScoreAvgNew(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("dataType")String dataType, + @Param("quarterId")String quarterId,@Param("yearId")String yearId); /** * @Description 区下级街道得分平均值 存在下级客户 @@ -92,6 +94,7 @@ public interface AgencyScoreDao extends BaseDao { * @date 2021/1/18 上午9:09 */ List selectAgencyScoreAvgExistsSub(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode); + List selectAgencyScoreAvgExistsSubNew(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId); 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 cc35dbb875..f4070ce8df 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 @@ -67,6 +67,7 @@ public interface DeptScoreDao extends BaseDao { * @date 2020/9/4 10:53 上午 */ List selectGovernDeptScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + List selectGovernDeptScoreAvgNew(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId); /** * @Description 所有直属部门治理能力平均值 存在下级客户 @@ -78,6 +79,7 @@ public interface DeptScoreDao extends BaseDao { */ 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); + List selectGovernDeptScoreAvgExistsSubNotSelfNew(@Param("areaCode")String areaCode, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId); /** * @return int 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 9c3328f6ca..82fac91f04 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 @@ -220,12 +220,14 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return true; } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); //党建能力平均值 indexDetailList.forEach(detail -> { if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { - List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); + List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgNew(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,quarterId,yearId); log.info("subGridPartyAvgScore:::"+subGridPartyAvgScore.toString()); if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.warn(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); @@ -248,7 +250,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } } else { // 区名义发文数量 - List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.DISTRICT_LEVEL); + List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapNew(customerId, monthId,IndexCalConstant.DISTRICT_LEVEL,quarterId,yearId); log.info("publishArticleCountList:::"+publishArticleCountList.toString()); if (CollectionUtils.isEmpty(publishArticleCountList)) { log.warn(IndexCalConstant.DISTRICT_PUBLISH_ARTICLE_LIST_NULL); @@ -299,11 +301,13 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return true; } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); 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); + List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgNew(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,quarterId,yearId); log.info("districtGovernAvgList:::"+districtGovernAvgList.toString()); for (int i = 0; i < districtGovernAvgList.size(); i++) { if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ @@ -330,7 +334,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()); + List deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvgNew(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),quarterId,yearId); log.info("deptScoreAvgList:::"+deptScoreAvgList.toString()); for (int i = 0; i < deptScoreAvgList.size(); i++) { if (deptScoreAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ @@ -380,12 +384,14 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return true; } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); 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); + List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgNew(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,quarterId,yearId); log.info("subStreetAvgList:::"+subStreetAvgList.toString()); for (int i = 0; i < subStreetAvgList.size(); i++) { if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ @@ -609,12 +615,14 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return true; } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); //党建能力平均值 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(),form.getCustomerAreaCode()); + List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgExistsSubNew(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); log.info("subGridPartyAvgScore:::"+subGridPartyAvgScore.toString()); if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.warn(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); @@ -641,7 +649,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } } else { // 区名义发文数量 - List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSubNotSelf(monthId,form.getCustomerAreaCode()); + List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSubNotSelfNew(monthId,form.getCustomerAreaCode(),quarterId,yearId); log.info("publishArticleCountList:::"+publishArticleCountList.toString()); if (CollectionUtils.isEmpty(publishArticleCountList)) { log.warn(IndexCalConstant.DISTRICT_PUBLISH_ARTICLE_LIST_NULL); @@ -693,11 +701,13 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return true; } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); 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.selectAgencyScoreAvgExistsSub(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); + List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSubNew(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); log.info("districtGovernAvgList:::"+districtGovernAvgList.toString()); for (int i = 0; i < districtGovernAvgList.size(); i++) { if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ @@ -728,7 +738,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict }); } } else if (IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode().equals(detail.getIndexCode())){ - List deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvgExistsSubNotSelf(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); + List deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvgExistsSubNotSelfNew(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); log.info("deptScoreAvgList:::"+deptScoreAvgList.toString()); for (int i = 0; i < deptScoreAvgList.size(); i++) { if (deptScoreAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ @@ -779,12 +789,14 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return true; } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); 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.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode()); + List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSubNew(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); log.info("subStreetAvgList:::"+subStreetAvgList.toString()); for (int i = 0; i < subStreetAvgList.size(); i++) { if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ 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 62c6226e07..9502b38251 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 @@ -221,4 +221,52 @@ OR fias.INDEX_CODE = "dangjiannengli" OR fias.INDEX_CODE = "fuwunengli") + + + + 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 7f3545b825..b6f59818c8 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 @@ -194,4 +194,51 @@ AND fidc.index_code = #{indexCode} GROUP BY fidc.agency_id + + + + From c5e626218772dfb670523a6cd2e2558e9520f4ea Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 27 May 2021 15:25:44 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=9C=AC=E7=BA=A7=E5=92=8C=E4=B8=8B?= =?UTF-8?q?=E7=BA=A7=E5=88=86=E6=95=B0=20=E4=BF=9D=E7=95=99=E4=B8=80?= =?UTF-8?q?=E4=BD=8D=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/fact/FactIndexAgencyScoreDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml index 3fce81dc73..68f17dd26c 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml @@ -28,10 +28,10 @@ ROUND(fact.score,1) AS "indexTotalOriginScore", fact.WEIGHT AS "indexTotalSupWeight", ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore", - self.self_score AS selfOriginScore, + ROUND(self.self_score,1) AS selfOriginScore, self.SELF_WEIGHT AS agencyWeight, ROUND(self.sub_score*fact.WEIGHT, 1) AS "subAgencyScore", - self.sub_score AS subOriginScore, + ROUND(self.sub_score,1) AS subOriginScore, self.SUB_WEIGHT AS subAgencyWeight FROM fact_index_agency_score fact