Browse Source

Merge remote-tracking branch 'origin/dev_pyscreen' into dev

dev_shibei_match
zxc 5 years ago
parent
commit
32b88291ed
  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. 10
      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. 5
      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. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java
  9. 94
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java
  10. 40
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml
  11. 9
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml
  12. 31
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml
  13. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml
  14. 23
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml
  15. 2
      epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/AgencyNodeDTO.java

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;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
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
* @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> selectAgencyScoreInfoExistsSubSelf(@Param("areaCode") String areaCode, @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,@Param("customerId")String customerId);
/**
* @Description 区下级街道得分平均值
@ -91,7 +91,7 @@ public interface AgencyScoreDao extends BaseDao<AgencyScoreEntity> {
* @author zxc
* @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);

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
* @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);
/**
* 根据入参查询 查询社区相关信息

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

@ -75,7 +75,15 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao<FactIndexGovr
* @date 2021/1/15 下午1:27
*/
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,@Param("level")String level);
/**
* @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
*/
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);
/**

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

@ -11,6 +11,7 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.constant.ProjectConstant;
import com.epmet.constant.ScreenConstant;
import com.epmet.dao.evaluationindex.indexcal.CommunityScoreDao;
import com.epmet.dao.evaluationindex.indexcal.CommunitySelfSubScoreDao;
import com.epmet.dao.evaluationindex.indexcal.CommunitySubScoreDao;
@ -702,7 +703,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
}
} else {
// 治理能力的六个五级指标
List<Map<String, Object>> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSubNotSelf(form.getMonthId(),form.getCustomerAreaCode());
List<Map<String, Object>> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSubNotSelf(form.getMonthId(),form.getCustomerAreaCode(), ScreenConstant.COMMUNITY);
if (CollectionUtils.isEmpty(communityGovernAbility)){
log.warn(IndexCalConstant.COMMUNITY_GOVERN_ABILITY_NULL);
}else{
@ -819,7 +820,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
String customerId = form.getCustomerId();
String monthId = form.getMonthId();
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 -> {
factIndexCommunityScoreEntities.forEach(community -> {
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<>();
Map<String, String> pid = new HashMap<>();
List<ScreenProjectOrgDailyDTO> orgInfos = customerAgencyDao.selectAgencyByParentAreaCode(form.getCustomerAreaCode());
log.info("orgInfos:::"+orgInfos.toString());
//党建能力平均值
indexDetailList.forEach(detail -> {
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()));
// 暂时的
subGridPartyAvgScore.forEach(s -> {
s.setParentId(customerAgencyDao.selectParentId(s.getAgencyId()));
});
List<SubAgencyScoreAvgResultDTO> subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode());
log.info("subGridPartyAvgScore:::"+subGridPartyAvgScore.toString());
if (CollectionUtils.isEmpty(subGridPartyAvgScore)) {
log.warn(IndexCalConstant.DISTRICT_PARTY_AVG_NULL);
@ -701,18 +695,10 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
}
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
List<ScreenProjectOrgDailyDTO> orgInfos = customerAgencyDao.selectAgencyByParentAreaCode(form.getCustomerAreaCode());
log.info("orgInfos:::"+orgInfos.toString());
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(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX);
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()));
});
List<SubAgencyScoreAvgResultDTO> districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode());
log.info("districtGovernAvgList:::"+districtGovernAvgList.toString());
log.info(districtGovernAvgList.toString());
for (int i = 0; i < districtGovernAvgList.size(); i++) {
if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){
districtGovernAvgList.remove(districtGovernAvgList.get(i));
@ -795,17 +781,10 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
}
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
List<ScreenProjectOrgDailyDTO> orgInfos = customerAgencyDao.selectAgencyByParentAreaCode(form.getCustomerAreaCode());
log.info("orgInfos"+orgInfos.toString());
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(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX);
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()));
});
List<SubAgencyScoreAvgResultDTO> subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode());
log.info("subStreetAvgList:::"+subStreetAvgList.toString());
for (int i = 0; i < subStreetAvgList.size(); i++) {
if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){
@ -860,7 +839,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
String customerId = form.getCustomerId();
String monthId = form.getMonthId();
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());
detailListByParentCode.forEach(detail -> {
agencyScoreList.forEach(community -> {

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

@ -157,7 +157,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService {
log.error("indexCalculate calStreetAll exception", e);
}
//计算区直属
//计算部门相关
start = System.currentTimeMillis();
try {
flag = deptScoreService.calculateDeptCorreLation(formDTO);

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

@ -8,10 +8,7 @@ import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.constant.ProjectConstant;
import com.epmet.constant.*;
import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao;
import com.epmet.dao.evaluationindex.indexcal.AgencySelfSubScoreDao;
import com.epmet.dao.evaluationindex.indexcal.AgencySubScoreDao;
@ -25,6 +22,7 @@ import com.epmet.dto.indexcal.AgencyCalResultDTO;
import com.epmet.dto.indexcal.AgencyScoreDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.indexcal.SubCommunityAvgResultDTO;
import com.epmet.dto.screen.ScreenProjectOrgDailyDTO;
import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO;
import com.epmet.entity.evaluationindex.indexcal.AgencySelfSubScoreEntity;
import com.epmet.entity.evaluationindex.indexcal.AgencySubScoreEntity;
@ -50,6 +48,7 @@ import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
/**
@ -616,7 +615,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
//下属所有社区的党建能力平均值
detailListByParentCode.forEach(detail -> {
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)) {
log.warn(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL);
} else if (subCommPartyAvgScore.size() > NumConstant.ZERO) {
@ -692,7 +692,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
Map<String, String> pid = new HashMap<>();
detailListByParentCode.forEach(detail -> {
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)){
log.warn("查询街道下属所有社区治理能力汇总为空");
}else if (subGridGovernAvg.size() > NumConstant.ZERO) {
@ -713,7 +714,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
}
} else {
// 治理能力的六个五级指标
List<Map<String, Object>> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSubNotSelf(monthId,form.getCustomerAreaCode());
List<Map<String, Object>> communityGovernAbility = disposeFiveLevel(form);
if (CollectionUtils.isEmpty(communityGovernAbility)){
log.warn(IndexCalConstant.STREET_GOVERN_ABILITY_NULL);
}else{
@ -767,7 +768,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
detailListByParentCode.forEach(detail -> {
String indexCode = detail.getIndexCode();
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)) {
log.warn("查询街道下属社区服务能力得分平均值为空");
} else if (subCommServiceAvg.size() > NumConstant.ZERO) {
@ -787,7 +789,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
});
}
} else {
List<Map<String, Object>> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapExistsSubNotSelf(monthId,form.getCustomerAreaCode());
List<Map<String, Object>> communityActivityCountList = disposeActivityCount(form);
if (CollectionUtils.isEmpty(communityActivityCountList)) {
log.warn(IndexCalConstant.STREET_SERVICE_ABILITY_NULL);
}else{
@ -832,7 +834,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
String customerId = form.getCustomerId();
String monthId = form.getMonthId();
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 -> {
agencyScoreList.forEach(community -> {
if (detail.getIndexCode().equals(community.getIndexCode())) {
@ -866,4 +868,76 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
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(), ScreenConstant.STREET);
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.data_type = #{dataType}
AND fias.IS_TOTAL = "0"
AND fias.customer_id = #{customerId}
AND (fias.INDEX_CODE = "zhilinengli"
OR fias.INDEX_CODE = "dangjiannengli"
OR fias.INDEX_CODE = "fuwunengli")
@ -153,25 +154,25 @@
<!-- 区下级街道得分平均值 存在下级客户 -->
<select id="selectAgencyScoreAvgExistsSub" resultType="com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO">
SELECT
fics.agency_id,
fics.month_id,
fics.quarter_id,
fics.year_id,
ROUND(AVG( fics.score ),6) AS score,
fics.customer_id,
fics.PARENT_AGENCY_ID AS parentId
FROM
fact_index_agency_score fics
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = fics.PARENT_AGENCY_ID
WHERE
fics.del_flag = '0'
AND sca.level = 'district'
AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%')
AND fics.month_id = #{monthId}
AND fics.index_code = #{indexCode}
AND fics.DATA_TYPE = #{dataType}
GROUP BY fics.parent_agency_id
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
fics.agency_id AS agencyId,
fics.month_id AS monthId,
fics.quarter_id AS quarterId,
fics.year_id AS yearId,
ROUND(AVG( fics.score ),6) AS score,
fics.customer_id AS customerId,
(SELECT AGENCY_ID FROM screen_customer_agency WHERE AREA_CODE = #{areaCode}) AS parentId
FROM
fact_index_agency_score fics
WHERE
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})
GROUP BY agencyId) a
LEFT JOIN screen_customer_agency a2 ON a2.AGENCY_ID = a.parentId
GROUP BY a2.AGENCY_ID
</select>
@ -214,6 +215,7 @@
fias.del_flag = 0
AND sca.AREA_CODE = #{areaCode}
AND fias.MONTH_ID = #{monthId}
AND fias.customer_id = #{customerId}
AND fias.IS_TOTAL = "0"
AND (fias.INDEX_CODE = "zhilinengli"
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 cs.MONTH_ID = #{monthId}
AND cs.IS_TOTAL = "0"
AND cs.customer_id = #{customerId}
AND (cs.INDEX_CODE = "dangjiannengli"
OR cs.INDEX_CODE = "zhilinengli"
OR cs.INDEX_CODE = "fuwunengli")
@ -179,14 +180,14 @@
sca.pid AS parentId
FROM
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
fics.del_flag = '0'
AND sca.DEL_FLAG = 0
AND sca.AREA_CODE IN
(SELECT AREA_CODE FROM screen_customer_agency WHERE DEL_FLAG = '0' AND PARENT_AREA_CODE = #{areaCode})
AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%')
AND sca.`LEVEL` = 'community'
AND fics.month_id = #{monthId}
AND fics.index_code = #{indexCode}
GROUP BY fics.parent_agency_id
GROUP BY parentId
</select>
</mapper>

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

@ -193,8 +193,37 @@
WHERE
gm.del_flag = '0'
AND gm.month_id = #{monthId}
AND gm.DATA_TYPE = 'community'
AND gm.DATA_TYPE = #{level}
AND sca.AREA_CODE LIKE CONCAT(#{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>
</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
WHERE
pm.del_flag = '0'
AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%')
AND sca.AREA_CODE != #{areaCode}
AND sca.PARENT_AREA_CODE = #{areaCode}
AND pm.month_id = #{monthId}
</select>
<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
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>
<select id="selectActivityCountMapExistsSubNotSelf" resultType="java.util.Map">
SELECT
@ -149,4 +152,24 @@
AND sca.AREA_CODE != #{areaCode}
AND sm.month_id = #{monthId}
</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>

2
epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/AgencyNodeDTO.java

@ -56,5 +56,5 @@ public class AgencyNodeDTO implements Serializable {
* */
private String areaCode;
private String parentCode;
private String parentAreaCode;
}

Loading…
Cancel
Save