Browse Source

平阴数据

master
zxc 5 years ago
parent
commit
741c6e8eaf
  1. 8
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityAvgResultDTO.java
  2. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java
  3. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java
  4. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java
  5. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java
  6. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java
  7. 29
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java
  8. 89
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java
  9. 40
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml
  10. 9
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml
  11. 31
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml
  12. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml
  13. 23
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml

8
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityAvgResultDTO.java

@ -1,5 +1,6 @@
package com.epmet.dto.indexcal; package com.epmet.dto.indexcal;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
@ -47,5 +48,10 @@ public class SubCommunityAvgResultDTO implements Serializable {
/** /**
* 分数 * 分数
*/ */
private BigDecimal score; private BigDecimal score = NumConstant.ZERO_DECIMAL;
/**
* 赋值状态
*/
private Boolean scoreStatus = false;
} }

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java

@ -70,8 +70,8 @@ public interface AgencyScoreDao extends BaseDao<AgencyScoreEntity> {
* @author zxc * @author zxc
* @date 2021/1/15 下午4:23 * @date 2021/1/15 下午4:23
*/ */
List<AgencyScoreDTO> selectAgencyScoreInfoExistsSub(@Param("areaCode") String areaCode,@Param("areaCodeLength") Integer areaCodeLength, @Param("monthId")String monthId, @Param("dataType")String dataType); List<AgencyScoreDTO> selectAgencyScoreInfoExistsSub(@Param("areaCode") String areaCode, @Param("monthId")String monthId, @Param("dataType")String dataType,@Param("customerId")String customerId);
List<AgencyScoreDTO> selectAgencyScoreInfoExistsSubSelf(@Param("areaCode") String areaCode, @Param("monthId")String monthId, @Param("dataType")String dataType); List<AgencyScoreDTO> selectAgencyScoreInfoExistsSubSelf(@Param("areaCode") String areaCode, @Param("monthId")String monthId, @Param("dataType")String dataType,@Param("customerId")String customerId);
/** /**
* @Description 区下级街道得分平均值 * @Description 区下级街道得分平均值
@ -91,7 +91,7 @@ public interface AgencyScoreDao extends BaseDao<AgencyScoreEntity> {
* @author zxc * @author zxc
* @date 2021/1/18 上午9:09 * @date 2021/1/18 上午9:09
*/ */
List<SubAgencyScoreAvgResultDTO> selectAgencyScoreAvgExistsSub(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("dataType")String dataType,@Param("areaCode")String areaCode,@Param("areaCodeLength")Integer areaCodeLength); List<SubAgencyScoreAvgResultDTO> selectAgencyScoreAvgExistsSub(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode);
List<SubAgencyScoreAvgResultDTO> selectAgencyScoreAvgByOrgIds(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("orgIds")List<String> orgIds); 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/CommunityScoreDao.java

@ -68,7 +68,7 @@ public interface CommunityScoreDao extends BaseDao<FactIndexCommunityScoreEntity
* @author zxc * @author zxc
* @date 2021/1/15 下午2:18 * @date 2021/1/15 下午2:18
*/ */
List<FactIndexCommunityScoreDTO> selectCommunityInfoExistsSub(@Param("areaCode") String areaCode,@Param("monthId")String monthId); List<FactIndexCommunityScoreDTO> selectCommunityInfoExistsSub(@Param("areaCode") String areaCode,@Param("monthId")String monthId,@Param("customerId")String customerId);
/** /**
* 根据入参查询 查询社区相关信息 * 根据入参查询 查询社区相关信息

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java

@ -76,6 +76,14 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao<FactIndexGovr
*/ */
List<Map<String,Object>> selectCommunityGovernAbilityExistsSub(@Param("monthId")String monthId,@Param("areaCode")String areaCode); List<Map<String,Object>> selectCommunityGovernAbilityExistsSub(@Param("monthId")String monthId,@Param("areaCode")String areaCode);
List<Map<String,Object>> selectCommunityGovernAbilityExistsSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode); List<Map<String,Object>> selectCommunityGovernAbilityExistsSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode);
/**
* @Description 孔村单独查询
* @Param monthId
* @Param areaCode
* @author zxc
* @date 2021/3/11 下午5:21
*/
List<Map<String,Object>> selectCommunityGovernAbilityIsKongCun(@Param("monthId")String monthId,@Param("areaCode")String areaCode);
/** /**
* 根据组织类型删除数据 * 根据组织类型删除数据

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

@ -87,6 +87,7 @@ public interface FactIndexServiceAblityOrgMonthlyDao extends BaseDao<FactIndexSe
* @date 2021/1/15 下午1:53 * @date 2021/1/15 下午1:53
*/ */
List<Map<String,Object>> selectActivityCountMapExistsSub(@Param("monthId")String monthId,@Param("areaCode")String areaCode); List<Map<String,Object>> selectActivityCountMapExistsSub(@Param("monthId")String monthId,@Param("areaCode")String areaCode);
List<Map<String,Object>> selectActivityCountMapIsKongCun(@Param("monthId")String monthId,@Param("areaCode")String areaCode);
List<Map<String,Object>> selectActivityCountMapExistsSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode); List<Map<String,Object>> selectActivityCountMapExistsSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode);
/** /**

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

@ -819,7 +819,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
String customerId = form.getCustomerId(); String customerId = form.getCustomerId();
String monthId = form.getMonthId(); String monthId = form.getMonthId();
List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(form.getCustomerId(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(form.getCustomerId(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode());
List<FactIndexCommunityScoreDTO> factIndexCommunityScoreEntities = factIndexCommunityScoreDao.selectCommunityInfoExistsSub(form.getCustomerAreaCode(),form.getMonthId()); List<FactIndexCommunityScoreDTO> factIndexCommunityScoreEntities = factIndexCommunityScoreDao.selectCommunityInfoExistsSub(form.getCustomerAreaCode(),form.getMonthId(),form.getCustomerId());
detailListByParentCode.forEach(detail -> { detailListByParentCode.forEach(detail -> {
factIndexCommunityScoreEntities.forEach(community -> { factIndexCommunityScoreEntities.forEach(community -> {
if (detail.getIndexCode().equals(community.getIndexCode())) { if (detail.getIndexCode().equals(community.getIndexCode())) {

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

@ -611,16 +611,10 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
} }
List<IndexInputVO> indexInputVOS = new ArrayList<>(); List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>(); Map<String, String> pid = new HashMap<>();
List<ScreenProjectOrgDailyDTO> orgInfos = customerAgencyDao.selectAgencyByParentAreaCode(form.getCustomerAreaCode());
log.info("orgInfos:::"+orgInfos.toString());
//党建能力平均值 //党建能力平均值
indexDetailList.forEach(detail -> { indexDetailList.forEach(detail -> {
if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) {
List<SubAgencyScoreAvgResultDTO> subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgByOrgIds(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),orgInfos.stream().map(o -> o.getOrgId()).collect(Collectors.toList())); List<SubAgencyScoreAvgResultDTO> subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode());
// 暂时的
subGridPartyAvgScore.forEach(s -> {
s.setParentId(customerAgencyDao.selectParentId(s.getAgencyId()));
});
log.info("subGridPartyAvgScore:::"+subGridPartyAvgScore.toString()); log.info("subGridPartyAvgScore:::"+subGridPartyAvgScore.toString());
if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { if (CollectionUtils.isEmpty(subGridPartyAvgScore)) {
log.warn(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); log.warn(IndexCalConstant.DISTRICT_PARTY_AVG_NULL);
@ -701,18 +695,10 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
} }
List<IndexInputVO> indexInputVOS = new ArrayList<>(); List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>(); Map<String, String> pid = new HashMap<>();
List<ScreenProjectOrgDailyDTO> orgInfos = customerAgencyDao.selectAgencyByParentAreaCode(form.getCustomerAreaCode());
log.info("orgInfos:::"+orgInfos.toString());
detailListByParentCode.forEach(detail -> { detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) {
// List<SubAgencyScoreAvgResultDTO> districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX); List<SubAgencyScoreAvgResultDTO> districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode());
List<SubAgencyScoreAvgResultDTO> districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgByOrgIds(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),orgInfos.stream().map(m -> m.getOrgId()).collect(Collectors.toList()));
// 暂时的
districtGovernAvgList.forEach(s -> {
s.setParentId(customerAgencyDao.selectParentId(s.getAgencyId()));
});
log.info("districtGovernAvgList:::"+districtGovernAvgList.toString()); log.info("districtGovernAvgList:::"+districtGovernAvgList.toString());
log.info(districtGovernAvgList.toString());
for (int i = 0; i < districtGovernAvgList.size(); i++) { for (int i = 0; i < districtGovernAvgList.size(); i++) {
if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){
districtGovernAvgList.remove(districtGovernAvgList.get(i)); districtGovernAvgList.remove(districtGovernAvgList.get(i));
@ -795,17 +781,10 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
} }
List<IndexInputVO> indexInputVOS = new ArrayList<>(); List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>(); Map<String, String> pid = new HashMap<>();
List<ScreenProjectOrgDailyDTO> orgInfos = customerAgencyDao.selectAgencyByParentAreaCode(form.getCustomerAreaCode());
log.info("orgInfos"+orgInfos.toString());
detailListByParentCode.forEach(detail -> { detailListByParentCode.forEach(detail -> {
String indexCode = detail.getIndexCode(); String indexCode = detail.getIndexCode();
if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) {
// List<SubAgencyScoreAvgResultDTO> subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX); List<SubAgencyScoreAvgResultDTO> subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode());
List<SubAgencyScoreAvgResultDTO> subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgByOrgIds(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),orgInfos.stream().map(m -> m.getOrgId()).collect(Collectors.toList()));
// 暂时的
subStreetAvgList.forEach(s -> {
s.setParentId(customerAgencyDao.selectParentId(s.getAgencyId()));
});
log.info("subStreetAvgList:::"+subStreetAvgList.toString()); log.info("subStreetAvgList:::"+subStreetAvgList.toString());
for (int i = 0; i < subStreetAvgList.size(); i++) { for (int i = 0; i < subStreetAvgList.size(); i++) {
if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){
@ -860,7 +839,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
String customerId = form.getCustomerId(); String customerId = form.getCustomerId();
String monthId = form.getMonthId(); String monthId = form.getMonthId();
List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode());
List<AgencyScoreDTO> agencyScoreList = agencyScoreDao.selectAgencyScoreInfoExistsSubSelf(form.getCustomerAreaCode(),monthId, IndexCalConstant.DISTRICT_LEVEL); List<AgencyScoreDTO> agencyScoreList = agencyScoreDao.selectAgencyScoreInfoExistsSubSelf(form.getCustomerAreaCode(),monthId, IndexCalConstant.DISTRICT_LEVEL,form.getCustomerId());
log.info("agencyScoreList:::"+agencyScoreList.toString()); log.info("agencyScoreList:::"+agencyScoreList.toString());
detailListByParentCode.forEach(detail -> { detailListByParentCode.forEach(detail -> {
agencyScoreList.forEach(community -> { agencyScoreList.forEach(community -> {

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

@ -25,6 +25,7 @@ import com.epmet.dto.indexcal.AgencyCalResultDTO;
import com.epmet.dto.indexcal.AgencyScoreDTO; import com.epmet.dto.indexcal.AgencyScoreDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; import com.epmet.dto.indexcal.SubCommunityAvgResultDTO;
import com.epmet.dto.screen.ScreenProjectOrgDailyDTO;
import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO;
import com.epmet.entity.evaluationindex.indexcal.AgencySelfSubScoreEntity; import com.epmet.entity.evaluationindex.indexcal.AgencySelfSubScoreEntity;
import com.epmet.entity.evaluationindex.indexcal.AgencySubScoreEntity; import com.epmet.entity.evaluationindex.indexcal.AgencySubScoreEntity;
@ -50,6 +51,7 @@ import org.springframework.util.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -616,7 +618,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
//下属所有社区的党建能力平均值 //下属所有社区的党建能力平均值
detailListByParentCode.forEach(detail -> { detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) {
List<SubCommunityAvgResultDTO> subCommPartyAvgScore = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode()); List<SubCommunityAvgResultDTO> dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode());
List<SubCommunityAvgResultDTO> subCommPartyAvgScore = disposeSubAvg(dispose, form);
if (CollectionUtils.isEmpty(subCommPartyAvgScore)) { if (CollectionUtils.isEmpty(subCommPartyAvgScore)) {
log.warn(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL); log.warn(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL);
} else if (subCommPartyAvgScore.size() > NumConstant.ZERO) { } else if (subCommPartyAvgScore.size() > NumConstant.ZERO) {
@ -692,7 +695,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
Map<String, String> pid = new HashMap<>(); Map<String, String> pid = new HashMap<>();
detailListByParentCode.forEach(detail -> { detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) {
List<SubCommunityAvgResultDTO> subGridGovernAvg = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); List<SubCommunityAvgResultDTO> dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode());
List<SubCommunityAvgResultDTO> subGridGovernAvg = disposeSubAvg(dispose,form);
if (CollectionUtils.isEmpty(subGridGovernAvg)){ if (CollectionUtils.isEmpty(subGridGovernAvg)){
log.warn("查询街道下属所有社区治理能力汇总为空"); log.warn("查询街道下属所有社区治理能力汇总为空");
}else if (subGridGovernAvg.size() > NumConstant.ZERO) { }else if (subGridGovernAvg.size() > NumConstant.ZERO) {
@ -713,7 +717,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
} }
} else { } else {
// 治理能力的六个五级指标 // 治理能力的六个五级指标
List<Map<String, Object>> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSubNotSelf(monthId,form.getCustomerAreaCode()); List<Map<String, Object>> communityGovernAbility = disposeFiveLevel(form);
if (CollectionUtils.isEmpty(communityGovernAbility)){ if (CollectionUtils.isEmpty(communityGovernAbility)){
log.warn(IndexCalConstant.STREET_GOVERN_ABILITY_NULL); log.warn(IndexCalConstant.STREET_GOVERN_ABILITY_NULL);
}else{ }else{
@ -767,7 +771,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
detailListByParentCode.forEach(detail -> { detailListByParentCode.forEach(detail -> {
String indexCode = detail.getIndexCode(); String indexCode = detail.getIndexCode();
if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) {
List<SubCommunityAvgResultDTO> subCommServiceAvg = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode()); List<SubCommunityAvgResultDTO> dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode());
List<SubCommunityAvgResultDTO> subCommServiceAvg = disposeSubAvg(dispose,form);
if (CollectionUtils.isEmpty(subCommServiceAvg)) { if (CollectionUtils.isEmpty(subCommServiceAvg)) {
log.warn("查询街道下属社区服务能力得分平均值为空"); log.warn("查询街道下属社区服务能力得分平均值为空");
} else if (subCommServiceAvg.size() > NumConstant.ZERO) { } else if (subCommServiceAvg.size() > NumConstant.ZERO) {
@ -787,7 +792,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
}); });
} }
} else { } else {
List<Map<String, Object>> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapExistsSubNotSelf(monthId,form.getCustomerAreaCode()); List<Map<String, Object>> communityActivityCountList = disposeActivityCount(form);
if (CollectionUtils.isEmpty(communityActivityCountList)) { if (CollectionUtils.isEmpty(communityActivityCountList)) {
log.warn(IndexCalConstant.STREET_SERVICE_ABILITY_NULL); log.warn(IndexCalConstant.STREET_SERVICE_ABILITY_NULL);
}else{ }else{
@ -832,7 +837,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
String customerId = form.getCustomerId(); String customerId = form.getCustomerId();
String monthId = form.getMonthId(); String monthId = form.getMonthId();
List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode());
List<AgencyScoreDTO> agencyScoreList = agencyScoreDao.selectAgencyScoreInfoExistsSub(form.getCustomerAreaCode(), NumConstant.NINE, monthId, IndexCalConstant.STREET_LEVEL); List<AgencyScoreDTO> agencyScoreList = agencyScoreDao.selectAgencyScoreInfoExistsSub(form.getCustomerAreaCode(), monthId, IndexCalConstant.STREET_LEVEL,form.getCustomerId());
detailListByParentCode.forEach(detail -> { detailListByParentCode.forEach(detail -> {
agencyScoreList.forEach(community -> { agencyScoreList.forEach(community -> {
if (detail.getIndexCode().equals(community.getIndexCode())) { if (detail.getIndexCode().equals(community.getIndexCode())) {
@ -866,4 +871,76 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
return true; return true;
} }
public List<SubCommunityAvgResultDTO> disposeSubAvg(List<SubCommunityAvgResultDTO> avgScore, CalculateCommonFormDTO formDTO){
List<ScreenProjectOrgDailyDTO> orgIds = customerAgencyDao.selectAgencyByParentAreaCode(formDTO.getCustomerAreaCode());
List<SubCommunityAvgResultDTO> subAvgScores = new ArrayList<>();
orgIds.forEach(org -> {
SubCommunityAvgResultDTO s = new SubCommunityAvgResultDTO();
s.setAgencyId(org.getOrgId());
subAvgScores.add(s);
});
subAvgScores.forEach(subScore -> {
if (!CollectionUtils.isEmpty(avgScore)){
avgScore.forEach(avg -> {
if (subScore.getAgencyId().equals(avg.getParentId())){
subScore.setScore(avg.getScore());
avg.setScoreStatus(true);
}
});
}
});
Map<Boolean, List<SubCommunityAvgResultDTO>> groupByStatus = avgScore.stream().collect(Collectors.groupingBy(SubCommunityAvgResultDTO::getScoreStatus));
List<SubCommunityAvgResultDTO> subAvgResultDTOS = groupByStatus.get(false);
if (!CollectionUtils.isEmpty(subAvgResultDTOS)){
AtomicReference<BigDecimal> finalScore = new AtomicReference<>(new BigDecimal(NumConstant.ZERO));
subAvgResultDTOS.forEach(sub -> {
finalScore.set(finalScore.get().add(sub.getScore()));
});
BigDecimal divide = finalScore.get().divide(new BigDecimal(subAvgResultDTOS.size()));
subAvgScores.forEach(s -> {
if (s.getAgencyId().equals("1234085031077498881")){
s.setScore(divide);
}
});
}
return subAvgScores;
}
public List<Map<String, Object>> disposeFiveLevel(CalculateCommonFormDTO formDTO){
List<Map<String, Object>> result = new ArrayList<>();
List<Map<String, Object>> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSubNotSelf(formDTO.getMonthId(),formDTO.getCustomerAreaCode());
List<Map<String, Object>> kongCunGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityIsKongCun(formDTO.getMonthId(),formDTO.getCustomerAreaCode());
if (!CollectionUtils.isEmpty(kongCunGovernAbility)){
kongCunGovernAbility.forEach(k -> {
k.put("AGENCY_ID",k.get("PARENT_ID"));
k.put("PARENT_ID",NumConstant.ZERO_STR);
});
}
if (!CollectionUtils.isEmpty(communityGovernAbility)){
result.addAll(communityGovernAbility);
}
if (!CollectionUtils.isEmpty(kongCunGovernAbility)){
result.addAll(kongCunGovernAbility);
}
return result;
}
public List<Map<String, Object>> disposeActivityCount(CalculateCommonFormDTO formDTO){
List<Map<String, Object>> result = new ArrayList<>();
List<Map<String, Object>> ActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapExistsSub(formDTO.getMonthId(),formDTO.getCustomerAreaCode());
List<Map<String, Object>> kongCunActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapIsKongCun(formDTO.getMonthId(),formDTO.getCustomerAreaCode());
if (!CollectionUtils.isEmpty(kongCunActivityCountList)){
kongCunActivityCountList.forEach(k -> {
k.put("AGENCY_ID",k.get("PARENT_ID"));
k.put("PARENT_ID",NumConstant.ZERO_STR);
});
}
if (!CollectionUtils.isEmpty(ActivityCountList)){
result.addAll(ActivityCountList);
}
if (!CollectionUtils.isEmpty(kongCunActivityCountList)){
result.addAll(kongCunActivityCountList);
}
return result;
}
} }

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

@ -146,6 +146,7 @@
AND fias.MONTH_ID = #{monthId} AND fias.MONTH_ID = #{monthId}
AND fias.data_type = #{dataType} AND fias.data_type = #{dataType}
AND fias.IS_TOTAL = "0" AND fias.IS_TOTAL = "0"
AND fias.customer_id = #{customerId}
AND (fias.INDEX_CODE = "zhilinengli" AND (fias.INDEX_CODE = "zhilinengli"
OR fias.INDEX_CODE = "dangjiannengli" OR fias.INDEX_CODE = "dangjiannengli"
OR fias.INDEX_CODE = "fuwunengli") OR fias.INDEX_CODE = "fuwunengli")
@ -153,25 +154,25 @@
<!-- 区下级街道得分平均值 存在下级客户 --> <!-- 区下级街道得分平均值 存在下级客户 -->
<select id="selectAgencyScoreAvgExistsSub" resultType="com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO"> <select id="selectAgencyScoreAvgExistsSub" resultType="com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO">
SELECT 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
fics.agency_id, (SELECT
fics.month_id, fics.agency_id AS agencyId,
fics.quarter_id, fics.month_id AS monthId,
fics.year_id, fics.quarter_id AS quarterId,
ROUND(AVG( fics.score ),6) AS score, fics.year_id AS yearId,
fics.customer_id, ROUND(AVG( fics.score ),6) AS score,
fics.PARENT_AGENCY_ID AS parentId fics.customer_id AS customerId,
FROM (SELECT AGENCY_ID FROM screen_customer_agency WHERE AREA_CODE = #{areaCode}) AS parentId
fact_index_agency_score fics FROM
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = fics.PARENT_AGENCY_ID fact_index_agency_score fics
WHERE WHERE
fics.del_flag = '0' fics.del_flag = '0'
AND sca.level = 'district' AND fics.month_id = #{monthId}
AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') AND fics.index_code = #{indexCode}
AND fics.month_id = #{monthId} AND fics.agency_id IN (SELECT AGENCY_ID FROM screen_customer_agency WHERE PARENT_AREA_CODE = #{areaCode})
AND fics.index_code = #{indexCode} GROUP BY agencyId) a
AND fics.DATA_TYPE = #{dataType} LEFT JOIN screen_customer_agency a2 ON a2.AGENCY_ID = a.parentId
GROUP BY fics.parent_agency_id GROUP BY a2.AGENCY_ID
</select> </select>
@ -214,6 +215,7 @@
fias.del_flag = 0 fias.del_flag = 0
AND sca.AREA_CODE = #{areaCode} AND sca.AREA_CODE = #{areaCode}
AND fias.MONTH_ID = #{monthId} AND fias.MONTH_ID = #{monthId}
AND fias.customer_id = #{customerId}
AND fias.IS_TOTAL = "0" AND fias.IS_TOTAL = "0"
AND (fias.INDEX_CODE = "zhilinengli" AND (fias.INDEX_CODE = "zhilinengli"
OR fias.INDEX_CODE = "dangjiannengli" OR fias.INDEX_CODE = "dangjiannengli"

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

@ -142,6 +142,7 @@
AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%')
AND cs.MONTH_ID = #{monthId} AND cs.MONTH_ID = #{monthId}
AND cs.IS_TOTAL = "0" AND cs.IS_TOTAL = "0"
AND cs.customer_id = #{customerId}
AND (cs.INDEX_CODE = "dangjiannengli" AND (cs.INDEX_CODE = "dangjiannengli"
OR cs.INDEX_CODE = "zhilinengli" OR cs.INDEX_CODE = "zhilinengli"
OR cs.INDEX_CODE = "fuwunengli") OR cs.INDEX_CODE = "fuwunengli")
@ -179,14 +180,14 @@
sca.pid AS parentId sca.pid AS parentId
FROM FROM
fact_index_community_score fics fact_index_community_score fics
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = fics.PARENT_AGENCY_ID LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = fics.AGENCY_ID
WHERE WHERE
fics.del_flag = '0' fics.del_flag = '0'
AND sca.DEL_FLAG = 0 AND sca.DEL_FLAG = 0
AND sca.AREA_CODE IN AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%')
(SELECT AREA_CODE FROM screen_customer_agency WHERE DEL_FLAG = '0' AND PARENT_AREA_CODE = #{areaCode}) AND sca.`LEVEL` = 'community'
AND fics.month_id = #{monthId} AND fics.month_id = #{monthId}
AND fics.index_code = #{indexCode} AND fics.index_code = #{indexCode}
GROUP BY fics.parent_agency_id GROUP BY parentId
</select> </select>
</mapper> </mapper>

31
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml

@ -193,8 +193,37 @@
WHERE WHERE
gm.del_flag = '0' gm.del_flag = '0'
AND gm.month_id = #{monthId} AND gm.month_id = #{monthId}
AND gm.DATA_TYPE = 'community' AND gm.DATA_TYPE = 'street'
AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%')
AND sca.AREA_CODE != #{areaCode} AND sca.AREA_CODE != #{areaCode}
AND gm.PARENT_ID = '0'
</select>
<!-- 孔村单独查询 -->
<select id="selectCommunityGovernAbilityIsKongCun" resultType="java.util.Map">
SELECT
gm.AGENCY_ID,
gm.PARENT_ID,
gm.MONTH_ID,
gm.QUARTER_ID,
gm.YEAR_ID,
ROUND(SUM(gm.TRANSFERED_COUNT),6) AS TRANSFERED_COUNT,
ROUND(SUM(gm.CLOSED_PROJECT_COUNT),6) AS CLOSED_PROJECT_COUNT,
ROUND(AVG(gm.RESP_PROJECT_RATIO),6) AS RESP_PROJECT_RATIO,
ROUND(AVG(gm.OVERDUE_PROJECT_RATIO),6) AS OVERDUE_PROJECT_RATIO,
ROUND(AVG(gm.CLOSED_PROJECT_RATIO),6) AS CLOSED_PROJECT_RATIO,
ROUND(AVG(gm.SATISFACTION_RATIO),6) AS SATISFACTION_RATIO,
ROUND(AVG(gm.HANDLE_PROJECT_RATIO),6) AS HANDLE_PROJECT_RATIO
FROM
fact_index_govrn_ablity_org_monthly gm
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = gm.AGENCY_ID
LEFT JOIN screen_customer_agency a2 ON a2.AGENCY_ID = gm.PARENT_ID
WHERE
gm.del_flag = '0'
AND gm.month_id = #{monthId}
AND gm.DATA_TYPE = 'street'
AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%')
AND sca.AREA_CODE != #{areaCode}
AND gm.PARENT_ID != '0'
</select> </select>
</mapper> </mapper>

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

@ -146,8 +146,7 @@
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = pm.AGENCY_ID LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = pm.AGENCY_ID
WHERE WHERE
pm.del_flag = '0' pm.del_flag = '0'
AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') AND sca.PARENT_AREA_CODE = #{areaCode}
AND sca.AREA_CODE != #{areaCode}
AND pm.month_id = #{monthId} AND pm.month_id = #{monthId}
</select> </select>
<select id="selectPublishArticleCountMapExistSubNotSelf" resultType="java.util.Map"> <select id="selectPublishArticleCountMapExistSubNotSelf" resultType="java.util.Map">

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

@ -127,8 +127,11 @@
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = sm.AGENCY_ID LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = sm.AGENCY_ID
WHERE WHERE
sm.del_flag = '0' sm.del_flag = '0'
AND sm.DATA_TYPE = 'street'
AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%')
AND sca.AREA_CODE != #{areaCode}
AND sm.month_id = #{monthId} AND sm.month_id = #{monthId}
AND sm.PARENT_ID = '0'
</select> </select>
<select id="selectActivityCountMapExistsSubNotSelf" resultType="java.util.Map"> <select id="selectActivityCountMapExistsSubNotSelf" resultType="java.util.Map">
SELECT SELECT
@ -149,4 +152,24 @@
AND sca.AREA_CODE != #{areaCode} AND sca.AREA_CODE != #{areaCode}
AND sm.month_id = #{monthId} AND sm.month_id = #{monthId}
</select> </select>
<select id="selectActivityCountMapIsKongCun" resultType="java.util.Map">
SELECT
sm.AGENCY_ID,
sm.PARENT_ID,
sm.MONTH_ID,
sm.QUARTER_ID,
sm.YEAR_ID,
ROUND(SUM(sm.ACTIVITY_COUNT),6) AS ACTIVITY_COUNT,
sm.CUSTOMER_ID
FROM
fact_index_service_ablity_org_monthly sm
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = sm.AGENCY_ID
WHERE
sm.del_flag = '0'
AND sm.DATA_TYPE = 'street'
AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%')
AND sca.AREA_CODE != #{areaCode}
AND sm.month_id = #{monthId}
AND sm.PARENT_ID != '0'
</select>
</mapper> </mapper>

Loading…
Cancel
Save