Browse Source

修复:平均值计算,没有生成sample_count的bug

dev_shibei_match
wxz 4 years ago
parent
commit
2783dab148
  1. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java
  2. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml
  3. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml

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

@ -230,7 +230,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
List<SubAgencyScoreAvgResultDTO> subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgNew(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,quarterId,yearId);
log.info("subGridPartyAvgScore:::"+subGridPartyAvgScore.toString());
subGridPartyAvgScore.forEach(s -> {
gridPartyScoreSampleCountMap.put(s.getParentId().concat(":").concat(IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode()), s.getSampleCount());
gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode()), s.getSampleCount());
});
if (CollectionUtils.isEmpty(subGridPartyAvgScore)) {
log.warn(IndexCalConstant.DISTRICT_PARTY_AVG_NULL);
@ -319,7 +319,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
List<SubAgencyScoreAvgResultDTO> districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgNew(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,quarterId,yearId);
log.info("districtGovernAvgList:::"+districtGovernAvgList.toString());
districtGovernAvgList.forEach(s -> {
gridPartyScoreSampleCountMap.put(s.getParentId().concat(":").concat(IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode()), s.getSampleCount());
gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode()), s.getSampleCount());
});
for (int i = 0; i < districtGovernAvgList.size(); i++) {
if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){
@ -412,7 +412,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
List<SubAgencyScoreAvgResultDTO> subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgNew(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,quarterId,yearId);
log.info("subStreetAvgList:::"+subStreetAvgList.toString());
subStreetAvgList.forEach(s -> {
gridPartyScoreSampleCountMap.put(s.getParentId().concat(":").concat(IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode()), s.getSampleCount());
gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode()), s.getSampleCount());
});
for (int i = 0; i < subStreetAvgList.size(); i++) {
if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){

1
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml

@ -230,6 +230,7 @@
#{quarterId} AS quarterId,
#{yearId} AS yearId,
IFNULL(ROUND(AVG( fics.score ),6),0) AS score,
COUNT(1) AS sample_count,
sca.customer_id,
sca.pid AS parentId
FROM screen_customer_agency sca

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

@ -211,6 +211,7 @@
#{quarterId} as quarterId,
#{yearId} as yearId,
IFNULL(ROUND(AVG( figc.score ),6),0) AS score,
COUNT(1) AS sample_count,
sca.customer_id as customerId,
sca.pid AS parentId
FROM screen_customer_agency sca

Loading…
Cancel
Save