Browse Source

Merge remote-tracking branch 'origin/dev_bugfix_ljj' into dev_bugfix_ljj

dev_shibei_match
jianjun 4 years ago
parent
commit
25d4987a95
  1. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java
  2. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java
  3. 32
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java
  4. 48
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml
  5. 47
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml

3
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<AgencyScoreEntity> {
* @date 2020/8/31 1:51 下午
*/
List<SubAgencyScoreAvgResultDTO> selectAgencyScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("dataType")String dataType);
List<SubAgencyScoreAvgResultDTO> 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<AgencyScoreEntity> {
* @date 2021/1/18 上午9:09
*/
List<SubAgencyScoreAvgResultDTO> selectAgencyScoreAvgExistsSub(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode);
List<SubAgencyScoreAvgResultDTO> selectAgencyScoreAvgExistsSubNew(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId);
List<SubAgencyScoreAvgResultDTO> selectAgencyScoreAvgByOrgIds(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("orgIds")List<String> orgIds);

2
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<DeptScoreEntity> {
* @date 2020/9/4 10:53 上午
*/
List<SubAgencyScoreAvgResultDTO> selectGovernDeptScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode);
List<SubAgencyScoreAvgResultDTO> 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<DeptScoreEntity> {
*/
List<SubAgencyScoreAvgResultDTO> selectGovernDeptScoreAvgExistsSub(@Param("areaCode")String areaCode, @Param("monthId")String monthId, @Param("indexCode")String indexCode);
List<SubAgencyScoreAvgResultDTO> selectGovernDeptScoreAvgExistsSubNotSelf(@Param("areaCode")String areaCode, @Param("monthId")String monthId, @Param("indexCode")String indexCode);
List<SubAgencyScoreAvgResultDTO> selectGovernDeptScoreAvgExistsSubNotSelfNew(@Param("areaCode")String areaCode, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId);
/**
* @return int

32
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<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
//党建能力平均值
indexDetailList.forEach(detail -> {
if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) {
List<SubAgencyScoreAvgResultDTO> subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL);
List<SubAgencyScoreAvgResultDTO> 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<Map<String, Object>> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.DISTRICT_LEVEL);
List<Map<String, Object>> 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<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) {
List<SubAgencyScoreAvgResultDTO> districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL);
List<SubAgencyScoreAvgResultDTO> 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<SubAgencyScoreAvgResultDTO> deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
List<SubAgencyScoreAvgResultDTO> 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<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
detailListByParentCode.forEach(detail -> {
String indexCode = detail.getIndexCode();
if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) {
List<SubAgencyScoreAvgResultDTO> subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL);
List<SubAgencyScoreAvgResultDTO> 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<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
//党建能力平均值
indexDetailList.forEach(detail -> {
if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) {
List<SubAgencyScoreAvgResultDTO> subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode());
List<SubAgencyScoreAvgResultDTO> 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<Map<String, Object>> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSubNotSelf(monthId,form.getCustomerAreaCode());
List<Map<String, Object>> 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<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) {
List<SubAgencyScoreAvgResultDTO> districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode());
List<SubAgencyScoreAvgResultDTO> 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<SubAgencyScoreAvgResultDTO> deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvgExistsSubNotSelf(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode());
List<SubAgencyScoreAvgResultDTO> 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<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
detailListByParentCode.forEach(detail -> {
String indexCode = detail.getIndexCode();
if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) {
List<SubAgencyScoreAvgResultDTO> subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode());
List<SubAgencyScoreAvgResultDTO> 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)){

48
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")
</select>
<select id="selectAgencyScoreAvgNew" resultType="com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO">
SELECT
sca.agency_id,
#{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 screen_customer_agency sca
LEFT JOIN fact_index_agency_score fics ON
(fics.PARENT_AGENCY_ID = sca.AGENCY_ID
AND fics.del_flag = '0'
AND fics.customer_id = #{customerId}
AND fics.month_id = #{monthId}
AND fics.index_code = #{indexCode}
AND fics.DATA_TYPE = #{dataType}
)
WHERE sca.DEL_FLAG = 0
AND sca.level = 'district'
AND sca.customer_id = #{customerId}
GROUP BY sca.AGENCY_ID
</select>
<select id="selectAgencyScoreAvgExistsSubNew" resultType="com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO">
SELECT a2.pid AS parentId,a.monthId,a.quarterId,a.yearId,ROUND(AVG( a.score ),6) AS score,a.customerId,a.parentId AS agencyId FROM
(SELECT
sca.agency_id AS agencyId,
fics.month_id AS monthId,
fics.quarter_id AS quarterId,
fics.year_id AS yearId,
IFNULL(ROUND(AVG( fics.score ),6),0) AS score,
sca.customer_id AS customerId,
(SELECT AGENCY_ID FROM screen_customer_agency WHERE AREA_CODE = #{areaCode} AND DEL_FLAG = 0) AS parentId
FROM screen_customer_agency sca
LEFT JOIN fact_index_agency_score fics ON
(fics.agency_id = sca.agency_id
AND fics.del_flag = '0'
AND fics.month_id = #{monthId}
AND fics.index_code = #{indexCode}
AND fics.agency_id IN (SELECT AGENCY_ID FROM screen_customer_agency WHERE PARENT_AREA_CODE = #{areaCode} AND DEL_FLAG = 0)
)
WHERE sca.DEL_FLAG = '0'
GROUP BY agencyId) a
LEFT JOIN screen_customer_agency a2 ON a2.AGENCY_ID = a.parentId AND a2.DEL_FLAG = 0
GROUP BY a2.AGENCY_ID
</select>
</mapper>

47
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
</select>
<select id="selectGovernDeptScoreAvgNew" resultType="com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO">
SELECT
sca.agency_id,
#{monthId} AS monthId,
#{quarterId} AS quarterId,
#{yearId} AS yearId,
IFNULL(AVG( fidc.score ),0) AS score,
sca.customer_id,
sca.pid AS parentId
FROM screen_customer_agency sca
LEFT JOIN fact_index_dept_score fidc ON
(fidc.AGENCY_ID = sca.AGENCY_ID
AND fidc.del_flag = '0'
AND fidc.IS_TOTAL = '0'
AND fidc.customer_id = #{customerId}
AND fidc.month_id = #{monthId}
AND fidc.index_code = #{indexCode}
)
WHERE sca.DEL_FLAG = '0'
AND sca.level = 'district'
AND sca.customer_id = #{customerId}
GROUP BY sca.agency_id
</select>
<select id="selectGovernDeptScoreAvgExistsSubNotSelfNew" resultType="com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO">
SELECT
sca.agency_id,
fidc.month_id,
fidc.quarter_id,
fidc.year_id,
IFNULL(AVG( fidc.score ),0) AS score,
sca.customer_id,
sca.pid AS parentId
FROM screen_customer_agency sca
LEFT JOIN fact_index_dept_score fidc ON
(sca.AGENCY_ID = fidc.AGENCY_ID
AND fidc.del_flag = '0'
AND fidc.IS_TOTAL = '0'
AND fidc.month_id = #{monthId}
AND fidc.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>

Loading…
Cancel
Save