Browse Source

Merge branch 'dev'

dev_shibei_match
wxz 4 years ago
parent
commit
4f3072c463
  1. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java
  2. 27
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java
  3. 30
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java
  4. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml
  5. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml
  6. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml

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

@ -646,9 +646,13 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
//下属所有网格的党建能力平均值
Map<String, Integer> gridPartyScoreSampleCountMap = new HashMap<>();
detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode().equals(detail.getIndexCode())) {
List<SubGridAvgResultDTO> subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridAvgScoreByAreaCodeNew(form.getMonthId(),IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId);
subGridPartyAvgScore.stream().forEach(s -> {
gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode()), s.getSampleCount());
});
if (CollectionUtils.isEmpty(subGridPartyAvgScore)) {
log.warn(IndexCalConstant.GRID_PARTY_AVG_NULL);
} else {
@ -702,7 +706,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, form.getCustomerId(), form.getMonthId(), NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid);
deleteOldRecord(form.getCustomerId(),form.getMonthId());
result.getFiveLevel().forEach(s->{
s.setSampleCount(0);
Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode()));
s.setSampleCount(sampleCount == null ? 0 : sampleCount);
});
deleteAndInsert(result);
return true;
@ -724,10 +729,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
String yearId = DateUtils.getYearId(form.getMonthId());
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
Map<String, Integer> gridPartyScoreSampleCountMap = new HashMap<>();
detailListByParentCode.forEach(detail -> {
// 社区下属所有网格治理能力汇总(平均值)
if (IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode().equals(detail.getIndexCode())) {
List<SubGridAvgResultDTO> subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScoreByAreaCodeNew(form.getMonthId(),IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId);
subGridGovernAvg.forEach(s -> {
gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode()), s.getSampleCount());
});
if (CollectionUtils.isEmpty(subGridGovernAvg)){
log.warn("社区下级治理能力平均分集合为空");
}else{
@ -779,7 +788,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
log.info("communityGovernAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId));
CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, form.getCustomerId(), form.getMonthId(), NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid);
result.getFiveLevel().forEach(s->{
s.setSampleCount(0);
Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode()));
s.setSampleCount(sampleCount == null ? 0 : sampleCount);
});
deleteAndInsert(result);
return true;
@ -802,10 +812,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
String yearId = DateUtils.getYearId(form.getMonthId());
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
Map<String, Integer> gridPartyScoreSampleCountMap = new HashMap<>();
detailListByParentCode.forEach(detail -> {
String indexCode = detail.getIndexCode();
if (IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode().equals(indexCode)) {
List<SubGridAvgResultDTO> subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScoreByAreaCodeNew(form.getMonthId(),IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId);
subGridServiceAvg.forEach(s -> {
gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode()), s.getSampleCount());
});
if (CollectionUtils.isEmpty(subGridServiceAvg)) {
log.warn("查询社区下级所有网格服务能力得分平均值集合为空");
} else {
@ -857,7 +871,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
log.info("communityServiceAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId));
CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, form.getCustomerId(), form.getMonthId(), NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid);
result.getFiveLevel().forEach(s->{
s.setSampleCount(0);
Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode()));
s.setSampleCount(sampleCount == null ? 0 : sampleCount);
});
deleteAndInsert(result);
return true;

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

@ -645,10 +645,15 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
Map<String, String> pid = new HashMap<>();
Map<String, String> agencyMap = agencyMap(customerId);
//党建能力平均值
// key:agencyId,value:sampleCount样本量
Map<String, Integer> gridPartyScoreSampleCountMap = new HashMap<>();
indexDetailList.forEach(detail -> {
if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) {
List<SubAgencyScoreAvgResultDTO> subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgExistsSubNew(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId);
log.info("subGridPartyAvgScore:::"+subGridPartyAvgScore.toString());
subGridPartyAvgScore.forEach(s -> {
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);
} else if (subGridPartyAvgScore.size() > NumConstant.ZERO) {
@ -709,6 +714,10 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
log.info("districtPartyAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId));
AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid);
deleteOldRecord(customerId,monthId,IndexCalConstant.DISTRICT_LEVEL);
result.getFiveLevel().forEach(s -> {
Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode()));
s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount);
});
insertDetail(result);
return true;
}
@ -732,11 +741,15 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
Map<String, String> agencyMap = agencyMap(customerId);
Map<String, Integer> gridPartyScoreSampleCountMap = new HashMap<>();
detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) {
// 治理能力平均值
List<SubAgencyScoreAvgResultDTO> districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSubNew(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId);
log.info("districtGovernAvgList:::"+districtGovernAvgList.toString());
districtGovernAvgList.forEach(s -> {
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)){
districtGovernAvgList.remove(districtGovernAvgList.get(i));
@ -800,6 +813,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
log.info("districtGovernAbilityCalculateExistsSub getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS));
log.info("districtGovernAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId));
AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid);
// 赋值样本量
result.getFiveLevel().forEach(s -> {
Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode()));
s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount);
});
insertDetail(result);
return true;
}
@ -823,11 +841,15 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
Map<String, String> agencyMap = agencyMap(customerId);
Map<String, Integer> gridPartyScoreSampleCountMap = new HashMap<>();
detailListByParentCode.forEach(detail -> {
String indexCode = detail.getIndexCode();
if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) {
List<SubAgencyScoreAvgResultDTO> subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSubNew(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId);
log.info("subStreetAvgList:::"+subStreetAvgList.toString());
subStreetAvgList.forEach(s -> {
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)){
subStreetAvgList.remove(subStreetAvgList.get(i));
@ -867,6 +889,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
log.info("districtServiceAbilityCalculateExistsSub getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS));
log.info("districtServiceAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId));
AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid);
// 赋值样本量
result.getFiveLevel().forEach(s -> {
Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode()));
s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount);
});
insertDetail(result);
}
return true;

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

@ -659,12 +659,17 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
//下属所有社区的党建能力平均值
// key:agencyId,value:sampleCount样本量
Map<String, Integer> gridPartyScoreSampleCountMap = new HashMap<>();
detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) {
// 下属所有社区的党建能力平均值
List<SubCommunityAvgResultDTO> dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelfNew(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId);
// 数据处理
List<SubCommunityAvgResultDTO> subCommPartyAvgScore = disposeSubAvg(dispose, form);
dispose.forEach(s -> {
gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode()), s.getSampleCount());
});
if (CollectionUtils.isEmpty(subCommPartyAvgScore)) {
log.warn(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL);
} else if (subCommPartyAvgScore.size() > NumConstant.ZERO) {
@ -718,6 +723,11 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
log.info("streetPartyAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId));
AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), pid);
deleteOldRecord(customerId, monthId, IndexCalConstant.STREET_LEVEL);
// 赋值样本量
result.getFiveLevel().forEach(s -> {
Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode()));
s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount);
});
insertDetail(result);
return true;
}
@ -739,6 +749,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
String quarterId = DateUtils.getQuarterId(monthId);
String yearId = DateUtils.getYearId(monthId);
List<IndexInputVO> indexInputVOS = new ArrayList<>();
// key:agencyId,value:sampleCount样本量
Map<String, Integer> gridPartyScoreSampleCountMap = new HashMap<>();
Map<String, String> pid = new HashMap<>();
detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) {
@ -746,6 +758,9 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<SubCommunityAvgResultDTO> dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelfNew(monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId);
// 孔村数据处理
List<SubCommunityAvgResultDTO> subGridGovernAvg = disposeSubAvg(dispose,form);
subGridGovernAvg.forEach(s -> {
gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode()), s.getSampleCount());
});
if (CollectionUtils.isEmpty(subGridGovernAvg)){
log.warn("查询街道下属所有社区治理能力汇总为空");
}else if (subGridGovernAvg.size() > NumConstant.ZERO) {
@ -797,6 +812,11 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
log.info("streetGovernAbilityCalculateExistsSub getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS));
log.info("streetGovernAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId));
AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), pid);
// 赋值样本量
result.getFiveLevel().forEach(s -> {
Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode()));
s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount);
});
insertDetail(result);
return true;
}
@ -819,6 +839,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
String yearId = DateUtils.getYearId(monthId);
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
// key:agencyId,value:sampleCount样本量
Map<String, Integer> gridPartyScoreSampleCountMap = new HashMap<>();
detailListByParentCode.forEach(detail -> {
String indexCode = detail.getIndexCode();
if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) {
@ -826,6 +848,9 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<SubCommunityAvgResultDTO> dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelfNew(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId);
// 孔村数据处理
List<SubCommunityAvgResultDTO> subCommServiceAvg = disposeSubAvg(dispose,form);
subCommServiceAvg.forEach(s -> {
gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode()), s.getSampleCount());
});
if (CollectionUtils.isEmpty(subCommServiceAvg)) {
log.warn("查询街道下属社区服务能力得分平均值为空");
} else if (subCommServiceAvg.size() > NumConstant.ZERO) {
@ -877,6 +902,11 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
log.info("streetServiceAbilityCalculateExistsSub getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS));
log.info("streetServiceAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId));
AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), pid);
// 赋值样本量
result.getFiveLevel().forEach(s -> {
Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode()));
s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount);
});
insertDetail(result);
return true;
}

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

@ -255,6 +255,7 @@
#{quarterId} AS quarterId,
#{yearId} AS yearId,
IFNULL(ROUND(AVG( fics.score ),6),0) AS score,
COUNT(1) AS sample_count,
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

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

@ -156,6 +156,7 @@
#{quarterId} AS quarterId,
#{yearId} AS yearId,
IFNULL(ROUND(AVG( fics.score ),6),0) AS score,
COUNT(1) AS sampleCount,
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

@ -235,6 +235,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