Browse Source

community级别 能力指数修改

dev_shibei_match
zxc 4 years ago
parent
commit
e14725ea65
  1. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java
  2. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java
  3. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java
  4. 36
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java
  5. 44
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml
  6. 23
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml
  7. 21
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java

@ -77,6 +77,7 @@ public interface GridScoreDao extends BaseDao<GridScoreEntity> {
* @date 2020/8/28 3:20 下午
*/
List<SubGridAvgResultDTO> selectSubGridAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode);
List<SubGridAvgResultDTO> selectSubGridAvgScoreNew(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId);
/**
* @Description 所有网格的平均值
@ -87,6 +88,7 @@ public interface GridScoreDao extends BaseDao<GridScoreEntity> {
* @date 2021/1/15 上午9:24
*/
List<SubGridAvgResultDTO> selectSubGridAvgScoreByAreaCode(@Param("monthId")String monthId, @Param("indexCode")String indexCode, @Param("areaCode")String areaCode);
List<SubGridAvgResultDTO> selectSubGridAvgScoreByAreaCodeNew(@Param("monthId")String monthId, @Param("indexCode")String indexCode, @Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId);
/**
* 根据入参查询 网格相关分值记录

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java

@ -102,6 +102,7 @@ public interface FactIndexPartyAblityOrgMonthlyDao extends BaseDao<FactIndexPart
*/
List<Map<String,Object>> selectPublishArticleCountMapbyAreaCode(@Param("monthId")String monthId,@Param("areaCode")String areaCode);
List<Map<String,Object>> selectPublishArticleCountMapbyAreaCodeNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode);
List<Map<String,Object>> selectPublishArticleCountMapbyAreaCodeNotSelfNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId);
/**
* 根据组织类型删除数据

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java

@ -93,6 +93,7 @@ public interface FactIndexServiceAblityOrgMonthlyDao extends BaseDao<FactIndexSe
List<Map<String,Object>> selectActivityCountMapIsKongCun(@Param("monthId")String monthId,@Param("areaCode")String areaCode);
List<Map<String,Object>> selectActivityCountMapIsKongCunNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId);
List<Map<String,Object>> selectActivityCountMapExistsSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode);
List<Map<String,Object>> selectActivityCountMapExistsSubNotSelfNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId);
/**
* 根据组织类型删除数据

36
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java

@ -223,12 +223,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL);
return true;
}
String quarterId = DateUtils.getQuarterId(monthId);
String yearId = DateUtils.getYearId(monthId);
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
//下属所有网格的党建能力平均值
detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode().equals(detail.getIndexCode())) {
List<SubGridAvgResultDTO> subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode());
List<SubGridAvgResultDTO> subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridAvgScoreNew(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),quarterId,yearId);
if (CollectionUtils.isEmpty(subGridPartyAvgScore)) {
log.warn(IndexCalConstant.GRID_PARTY_AVG_NULL);
} else {
@ -248,7 +250,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
}
} else {
// 社区名义发文数量
List<Map<String, Object>> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL);
List<Map<String, Object>> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapNew(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL,quarterId,yearId);
if (CollectionUtils.isEmpty(publishArticleCountList)) {
log.warn(IndexCalConstant.COMMUNITY_PUBLISH_ARTICLE_LIST_NULL);
} else {
@ -298,11 +300,13 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL);
return true;
}
String quarterId = DateUtils.getQuarterId(monthId);
String yearId = DateUtils.getYearId(monthId);
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode().equals(detail.getIndexCode())) {
List<SubGridAvgResultDTO> subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
List<SubGridAvgResultDTO> subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScoreNew(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),quarterId,yearId);
if (CollectionUtils.isEmpty(subGridGovernAvg)){
log.warn("社区下级治理能力平均分集合为空");
}else{
@ -322,7 +326,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
}
} else {
// 治理能力的六个五级指标
List<Map<String, Object>> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL);
List<Map<String, Object>> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityNew(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL,quarterId,yearId);
if (CollectionUtils.isEmpty(communityGovernAbility)){
log.warn(IndexCalConstant.COMMUNITY_GOVERN_ABILITY_NULL);
}else{
@ -370,12 +374,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL);
return true;
}
String quarterId = DateUtils.getQuarterId(monthId);
String yearId = DateUtils.getYearId(monthId);
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
detailListByParentCode.forEach(detail -> {
String indexCode = detail.getIndexCode();
if (IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode().equals(indexCode)) {
List<SubGridAvgResultDTO> subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode());
List<SubGridAvgResultDTO> subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScoreNew(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),quarterId,yearId);
if (CollectionUtils.isEmpty(subGridServiceAvg)) {
log.warn("查询社区下级所有网格服务能力得分平均值集合为空");
} else {
@ -394,7 +400,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
});
}
} else {
List<Map<String, Object>> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL);
List<Map<String, Object>> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapNew(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL,quarterId,yearId);
if (CollectionUtils.isEmpty(communityActivityCountList)) {
log.warn(IndexCalConstant.COMMUNITY_SERVICE_ABILITY_NULL);
}else{
@ -604,12 +610,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL);
return true;
}
String quarterId = DateUtils.getQuarterId(form.getMonthId());
String yearId = DateUtils.getYearId(form.getMonthId());
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
//下属所有网格的党建能力平均值
detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode().equals(detail.getIndexCode())) {
List<SubGridAvgResultDTO> subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridAvgScoreByAreaCode(form.getMonthId(),IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode());
List<SubGridAvgResultDTO> subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridAvgScoreByAreaCodeNew(form.getMonthId(),IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId);
if (CollectionUtils.isEmpty(subGridPartyAvgScore)) {
log.warn(IndexCalConstant.GRID_PARTY_AVG_NULL);
} else {
@ -629,7 +637,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
}
} else {
// 社区名义发文数量
List<Map<String, Object>> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapbyAreaCodeNotSelf( form.getMonthId(),form.getCustomerAreaCode());
List<Map<String, Object>> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapbyAreaCodeNotSelfNew( form.getMonthId(),form.getCustomerAreaCode(),quarterId,yearId);
if (CollectionUtils.isEmpty(publishArticleCountList)) {
log.warn(IndexCalConstant.COMMUNITY_PUBLISH_ARTICLE_LIST_NULL);
} else {
@ -678,12 +686,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL);
return true;
}
String quarterId = DateUtils.getQuarterId(form.getMonthId());
String yearId = DateUtils.getYearId(form.getMonthId());
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
detailListByParentCode.forEach(detail -> {
// 社区下属所有网格治理能力汇总(平均值)
if (IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode().equals(detail.getIndexCode())) {
List<SubGridAvgResultDTO> subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScoreByAreaCode(form.getMonthId(),IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode());
List<SubGridAvgResultDTO> subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScoreByAreaCodeNew(form.getMonthId(),IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId);
if (CollectionUtils.isEmpty(subGridGovernAvg)){
log.warn("社区下级治理能力平均分集合为空");
}else{
@ -703,7 +713,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
}
} else {
// 治理能力的六个五级指标
List<Map<String, Object>> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSubNotSelf(form.getMonthId(),form.getCustomerAreaCode(), ScreenConstant.COMMUNITY);
List<Map<String, Object>> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSubNotSelfNew(form.getMonthId(),form.getCustomerAreaCode(), ScreenConstant.COMMUNITY,quarterId,yearId);
if (CollectionUtils.isEmpty(communityGovernAbility)){
log.warn(IndexCalConstant.COMMUNITY_GOVERN_ABILITY_NULL);
}else{
@ -751,12 +761,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL);
return true;
}
String quarterId = DateUtils.getQuarterId(form.getMonthId());
String yearId = DateUtils.getYearId(form.getMonthId());
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
detailListByParentCode.forEach(detail -> {
String indexCode = detail.getIndexCode();
if (IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode().equals(indexCode)) {
List<SubGridAvgResultDTO> subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScoreByAreaCode(form.getMonthId(),IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode());
List<SubGridAvgResultDTO> subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScoreByAreaCodeNew(form.getMonthId(),IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId);
if (CollectionUtils.isEmpty(subGridServiceAvg)) {
log.warn("查询社区下级所有网格服务能力得分平均值集合为空");
} else {
@ -775,7 +787,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
});
}
} else {
List<Map<String, Object>> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapExistsSubNotSelf(form.getMonthId(),form.getCustomerAreaCode());
List<Map<String, Object>> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapExistsSubNotSelfNew(form.getMonthId(),form.getCustomerAreaCode(),quarterId,yearId);
if (CollectionUtils.isEmpty(communityActivityCountList)) {
log.warn(IndexCalConstant.COMMUNITY_SERVICE_ABILITY_NULL);
}else{

44
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml

@ -201,5 +201,49 @@
AND sca.AREA_CODE != #{areaCode}
GROUP BY figc.agency_id
</select>
<select id="selectSubGridAvgScoreNew" resultType="com.epmet.dto.screen.result.SubGridAvgResultDTO">
SELECT
sca.agency_id AS agencyId,
#{monthId} as monthId,
#{quarterId} as quarterId,
#{yearId} as yearId,
IFNULL(ROUND(AVG( figc.score ),6),0) AS score,
sca.customer_id as customerId,
sca.pid AS parentId
FROM screen_customer_agency sca
LEFT JOIN fact_index_grid_score figc ON
(figc.AGENCY_ID = sca.AGENCY_ID
AND figc.del_flag = '0'
AND figc.customer_id = #{customerId}
AND figc.month_id = #{monthId}
AND figc.index_code = #{indexCode}
)
WHERE sca.DEL_FLAG = '0'
AND sca.level = 'community'
AND sca.customer_id = #{customerId}
GROUP BY figc.agency_id
</select>
<select id="selectSubGridAvgScoreByAreaCodeNew" resultType="com.epmet.dto.screen.result.SubGridAvgResultDTO">
SELECT
sca.agency_id AS agencyId,
#{monthId} as monthId,
#{quarterId} as quarterId,
#{yearId} as yearId,
IFNULL(ROUND(AVG( figc.score ),6),0) AS score,
sca.customer_id as customerId,
sca.pid AS parentId
FROM screen_customer_agency sca
LEFT JOIN fact_index_grid_score figc ON
(sca.AGENCY_ID = figc.AGENCY_ID
AND figc.del_flag = '0'
AND figc.month_id = #{monthId}
AND figc.index_code = #{indexCode}
)
WHERE sca.DEL_FLAG = 0
AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%')
AND sca.AREA_CODE != #{areaCode}
GROUP BY sca.agency_id
</select>
</mapper>

23
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml

@ -249,4 +249,27 @@
AND sca.AREA_CODE != #{areaCode}
</select>
<select id="selectPublishArticleCountMapbyAreaCodeNotSelfNew" resultType="java.util.Map">
SELECT
sca.AGENCY_ID,
sca.pid AS PARENT_ID,
#{monthId} AS MONTH_ID,
#{quarterId} AS QUARTER_ID,
#{yearId} AS YEAR_ID,
IFNULL(fm.PUBLISH_ARTICLE_COUNT,0) AS PUBLISH_ARTICLE_COUNT,
sca.CUSTOMER_ID
FROM screen_customer_agency sca
LEFT JOIN fact_index_party_ablity_org_monthly fm ON
(sca.AGENCY_ID = fm.AGENCY_ID
AND fm.del_flag = '0'
AND fm.month_id = #{monthId}
AND fm.DATA_TYPE = 'community'
)
WHERE sca.DEL_FLAG = '0'
AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%')
AND sca.AREA_CODE != #{areaCode}
AND sca.`LEVEL` = 'community'
AND sca.UP_TO_CAL = 'yes'
</select>
</mapper>

21
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml

@ -239,4 +239,25 @@
AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%')
AND sca.AREA_CODE != #{areaCode}
</select>
<select id="selectActivityCountMapExistsSubNotSelfNew" resultType="java.util.Map">
SELECT
sca.AGENCY_ID,
sca.PID AS PARENT_ID,
#{monthId} AS MONTH_ID,
#{quarterId} AS QUARTER_ID,
#{yearId} AS YEAR_ID,
IFNULL(sm.ACTIVITY_COUNT,0) AS ACTIVITY_COUNT,
sca.CUSTOMER_ID
FROM screen_customer_agency sca
LEFT JOIN fact_index_service_ablity_org_monthly sm ON
(sca.AGENCY_ID = sm.AGENCY_ID
AND sm.del_flag = '0'
AND sm.DATA_TYPE = 'community'
AND sm.month_id = #{monthId}
)
WHERE sca.DEL_FLAG = '0'
AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%')
AND sca.AREA_CODE != #{areaCode}
</select>
</mapper>

Loading…
Cancel
Save