diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyAndParentResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyAndParentResultDTO.java new file mode 100644 index 0000000000..02efab6132 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyAndParentResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/5/26 1:47 下午 + * @DESC + */ +@Data +public class AgencyAndParentResultDTO implements Serializable { + + private static final long serialVersionUID = -7300464262794241276L; + + /** + * 组织ID + */ + private String agencyId; + + /** + * parentId + */ + private String pid; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index 40118c9253..67cbe37e23 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -24,6 +24,7 @@ import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.AgencyMonthCountResultDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; import com.epmet.dto.extract.result.OrgNameResultDTO; +import com.epmet.dto.indexcal.AgencyAndParentResultDTO; import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO; import com.epmet.dto.screen.ScreenProjectOrgDailyDTO; import com.epmet.dto.screen.result.TreeResultDTO; @@ -106,7 +107,7 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectAgencyIdAndParentId(@Param("customerId") String customerId); + List selectAgencyIdAndParentId(@Param("customerId") String customerId); /** * 返回当前客户下,未匹配到的 【乡(镇、街道)级、区县级】 组织信息 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java index df8515ad11..3bc97544d0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -19,10 +19,7 @@ import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao; import com.epmet.dao.evaluationindex.screen.IndexGroupDetailDao; import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; -import com.epmet.dto.indexcal.AgencyCalResultDTO; -import com.epmet.dto.indexcal.AgencyScoreDTO; -import com.epmet.dto.indexcal.CalculateCommonFormDTO; -import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; +import com.epmet.dto.indexcal.*; import com.epmet.dto.screen.ScreenProjectOrgDailyDTO; import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; import com.epmet.entity.evaluationindex.indexcal.AgencySelfSubScoreEntity; @@ -222,7 +219,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); - Map agencyMap = customerAgencyDao.selectAgencyIdAndParentId(customerId); + Map agencyMap = agencyMap(customerId); // key:agencyId,value:sampleCount样本量 Map gridPartyScoreSampleCountMap = new HashMap<>(); //党建能力平均值 @@ -315,7 +312,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict Map pid = new HashMap<>(); // key:agencyId,value:sampleCount样本量 Map gridPartyScoreSampleCountMap = new HashMap<>(); - Map agencyMap = customerAgencyDao.selectAgencyIdAndParentId(customerId); + Map agencyMap = agencyMap(customerId); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); @@ -408,7 +405,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict Map pid = new HashMap<>(); // key:agencyId,value:sampleCount样本量 Map gridPartyScoreSampleCountMap = new HashMap<>(); - Map agencyMap = customerAgencyDao.selectAgencyIdAndParentId(customerId); + Map agencyMap = agencyMap(customerId); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { @@ -648,7 +645,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); - Map agencyMap = customerAgencyDao.selectAgencyIdAndParentId(customerId); + Map agencyMap = agencyMap(customerId); //党建能力平均值 indexDetailList.forEach(detail -> { if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { @@ -734,7 +731,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); - Map agencyMap = customerAgencyDao.selectAgencyIdAndParentId(customerId); + Map agencyMap = agencyMap(customerId); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); @@ -822,7 +819,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); - Map agencyMap = customerAgencyDao.selectAgencyIdAndParentId(customerId); + Map agencyMap = agencyMap(customerId); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { @@ -918,5 +915,19 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return true; } + /** + * @Description 查询客户下的所有组织parentId + * @Param customerId + * @author zxc + * @date 2021/5/26 1:44 下午 + */ + public Map agencyMap(String customerId){ + Map result = new HashMap<>(16); + List dtos = customerAgencyDao.selectAgencyIdAndParentId(customerId); + dtos.forEach(d -> { + result.put(d.getAgencyId(),d.getPid()); + }); + return result; + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml index 8d5a681938..d71a8a36f8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml @@ -428,7 +428,7 @@ - SELECT AGENCY_ID, PID