diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AdvanceBranchRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AdvanceBranchRankResultDTO.java index 60545c7fc4..216214d05c 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AdvanceBranchRankResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AdvanceBranchRankResultDTO.java @@ -50,4 +50,9 @@ public class AdvanceBranchRankResultDTO implements Serializable { * */ private Integer projectNum; + /** + * 当前name的上级组织名称 2021-01-11新增 + */ + private String parentAgencyName; + } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/OrgRankDataResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/OrgRankDataResultDTO.java index 9aff92593f..a52b035475 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/OrgRankDataResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/OrgRankDataResultDTO.java @@ -51,4 +51,9 @@ public class OrgRankDataResultDTO implements Serializable { * */ private Integer projectNum; + /** + * 当前name的上级组织名称 2021-01-11新增 + */ + private String parentAgencyName; + } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiRankResultDTO.java index 6d4eba5f4b..53209c640a 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiRankResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiRankResultDTO.java @@ -25,4 +25,6 @@ public class PublicPartiRankResultDTO implements Serializable { private Integer issueNum; private Integer projectNum; + + private String parentAgencyName; } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml index 573c7501fa..06e501b713 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml @@ -10,7 +10,8 @@ SUM( AGE_LEVEL_3 ) + SUM( AGE_LEVEL_4 ) AS between31And50Count, SUM( AGE_LEVEL_5 ) AS between51And60Count, SUM( AGE_LEVEL_6 ) AS above61Count, - SUM( PARTY_MEMBER_COUNT) AS partyTotal + SUM( PARTY_MEMBER_COUNT) AS partyMemberCount, + SUM( AGE_LEVEL_1 ) + SUM( AGE_LEVEL_2 )+SUM( AGE_LEVEL_3 ) + SUM( AGE_LEVEL_4 )+SUM( AGE_LEVEL_5 )+SUM( AGE_LEVEL_6 ) as partyTotal FROM screen_cpc_base_data WHERE diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml index 310320029e..bc1fa8f0aa 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml @@ -6,28 +6,31 @@ diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml index 7a59c7f16d..4997380f98 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml @@ -15,5 +15,8 @@ WHERE md.del_flag = '0' AND md.parent_id = #{agencyId} + + AND ORG_TYPE = + CASE WHEN sca.LEVEL = 'community' THEN 'grid' ELSE 'agency' END \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml index 1a94210725..277e6c17dc 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml @@ -6,24 +6,29 @@ \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java index 12e6151f3f..911d8b7993 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java @@ -18,13 +18,11 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; -import com.epmet.dto.extract.result.OrgStatisticsResultDTO; -import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.extract.form.GridHeartedFormDTO; import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.GridGroupUserCountResultDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO; import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; @@ -164,12 +162,11 @@ public interface FactOriginGroupMainDailyDao extends BaseDao selectPartyCreateGroupInfo(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("gridIds") List gridIds); + List selectPartyCreateGroupInfo(@Param("customerId") String customerId, @Param("gridIds") List gridIds); /** * desc: 获取所有网格的组中成员人数 去重 @@ -202,4 +199,4 @@ public interface FactOriginGroupMainDailyDao extends BaseDao selectOrgGroupCount(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("level") String level); -} \ No newline at end of file +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java index c9a74e31b8..730acde2c8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java @@ -68,12 +68,11 @@ public interface FactOriginGroupMainDailyService extends BaseService selectPartyCreateGroupInfo(String customerId, String monthId, List gridIds); + List selectPartyCreateGroupInfo(String customerId, List gridIds); /** * desc: 获取客户下每个网格小组内的 去重人数 @@ -106,4 +105,4 @@ public interface FactOriginGroupMainDailyService extends BaseService */ List getOrgGroupCount(String customerId, String monthId, String level); -} \ No newline at end of file +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java index ab3efce8b4..83195d9902 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java @@ -21,8 +21,8 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; -import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.GridGroupUserCountResultDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService; @@ -106,16 +106,15 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl selectPartyCreateGroupInfo(String customerId, String monthId, List gridIds) { + public List selectPartyCreateGroupInfo(String customerId, List gridIds) { if (!CollectionUtils.isEmpty(gridIds)) { - return baseDao.selectPartyCreateGroupInfo(customerId, monthId, gridIds); + return baseDao.selectPartyCreateGroupInfo(customerId, gridIds); } return new ArrayList<>(); } @@ -135,4 +134,4 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl { if (r.getAgencyId().equals(pid.getAgencyId())){ r.setPid(pid.getPid()); - r.setPids(pid.getPids().concat(":").concat(r.getAgencyId())); + if (StringUtils.isNotBlank(pid.getPids())) { + r.setPids(pid.getPids().concat(":").concat(r.getAgencyId())); + } else { + r.setPids(r.getAgencyId()); + } } }); }); @@ -231,7 +236,11 @@ public class IssueExtractServiceImpl implements IssueExtractService { agencyInfoList.forEach(agency -> { if (r.getAgencyId().equals(agency.getAgencyId())){ r.setPid(agency.getPid()); - r.setPids(agency.getPids().concat(":").concat(r.getAgencyId())); + if(StringUtils.isNotBlank(agency.getPids())){ + r.setPids(agency.getPids().concat(":").concat(r.getAgencyId())); + }else{ + r.setPids(r.getAgencyId()); + } } }); }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java index 74f7b84d27..2e31f8ae4a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java @@ -1,11 +1,9 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl; -import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.ScreenConstant; import com.epmet.dto.extract.form.ExtractScreenFormDTO; -import com.epmet.dto.extract.form.ScreenExtractFormDTO; import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.*; @@ -185,22 +183,22 @@ public class PartyGuideServiceImpl implements PartyGuideService { // 判断当前级别agency是否为空 if (!CollectionUtils.isEmpty(agencyIdList)){ // 获取agencyIds - List orgIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); - if (isGrid == true){ + List orgIds = agencyIdList.stream().map(CustomerAgencyInfoResultDTO::getAgencyId).collect(Collectors.toList()); + if (isGrid) { agencyIdList.forEach(agency -> { // 计算社区级别的下级(实际就是网格) - GridPartyGuideDTO gridPartyGuideDTO = communityLevelSubGrid(customerId, monthId, agency); + GridPartyGuideDTO gridPartyGuideDTO = communityLevelSubGrid(customerId, agency); orgIds.addAll(gridPartyGuideDTO.getOrgIds()); result.addAll(gridPartyGuideDTO.getResult()); }); // 根据agencyId分组,计算各个社区的 Map> groupByAgency = result.stream().collect(Collectors.groupingBy(ScreenPartyLinkMassesDataFormDTO::getParentId)); - groupByAgency.forEach((agencyId,gridList) -> { + groupByAgency.forEach((agencyId, gridList) -> { ScreenPartyLinkMassesDataFormDTO form = new ScreenPartyLinkMassesDataFormDTO(); List orgNameAgencyList = agencyService.selectOrgNameAgency(orgIds); if (!CollectionUtils.isEmpty(orgNameAgencyList)){ orgNameAgencyList.forEach(name -> { - if (agencyId.equals(name.getAgencyId())){ + if (agencyId.equals(name.getAgencyId())) { form.setOrgName(name.getAgencyName()); form.setParentId(name.getParentId()); } @@ -210,8 +208,8 @@ public class PartyGuideServiceImpl implements PartyGuideService { form.setCustomerId(customerId); form.setDataEndTime(monthId); form.setOrgType(ScreenConstant.AGENCY); - form.setCreateGroupTotal(gridList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getCreateGroupTotal))); - form.setGroupUserTotal(gridList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getGroupUserTotal))); + form.setCreateGroupTotal(gridList.stream().mapToInt(ScreenPartyLinkMassesDataFormDTO::getCreateGroupTotal).sum()); + form.setGroupUserTotal(gridList.stream().mapToInt(ScreenPartyLinkMassesDataFormDTO::getGroupUserTotal).sum()); result.add(form); }); delAndInsertLink(result,customerId,monthId,orgIds); @@ -227,15 +225,15 @@ public class PartyGuideServiceImpl implements PartyGuideService { } }); // 不为空 存在直属网格 - if (!CollectionUtils.isEmpty(disGridIds)){ + if (!CollectionUtils.isEmpty(disGridIds)) { List gridResult = new ArrayList<>(); // 查询党员创建组,组内成员数 - List partyLinkMassesDataList = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, disGridIds); - List orgNameList = agencyService.selectOrgNameGrid(partyLinkMassesDataList.stream().map(m -> m.getOrgId()).collect(Collectors.toList())); - if (!CollectionUtils.isEmpty(partyLinkMassesDataList)){ + List partyLinkMassesDataList = groupMainService.selectPartyCreateGroupInfo(customerId, disGridIds); + List orgNameList = agencyService.selectOrgNameGrid(partyLinkMassesDataList.stream().map(ScreenPartyLinkMassesDataFormDTO::getOrgId).collect(Collectors.toList())); + if (!CollectionUtils.isEmpty(partyLinkMassesDataList)) { partyLinkMassesDataList.forEach(party -> { orgNameList.forEach(org -> { - if (party.getOrgId().equals(org.getGridId())){ + if (party.getOrgId().equals(org.getGridId())) { party.setOrgName(org.getGridName()); } }); @@ -246,10 +244,10 @@ public class PartyGuideServiceImpl implements PartyGuideService { delAndInsertLink(gridResult,customerId,monthId,disGridIds); } // 查询直属网格的信息 + 下级机关的信息 = agency的机关信息 - List screenPartyLinkMassesDataGrid = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, disGridIds); + List screenPartyLinkMassesDataGrid = groupMainService.selectPartyCreateGroupInfo(customerId, disGridIds); List screenPartyLinkMassesDataList = linkMassesDataService.selectPartyLinkMassesInfo(customerId, monthId, agencyId); screenPartyLinkMassesDataList.addAll(screenPartyLinkMassesDataGrid); - if (!CollectionUtils.isEmpty(screenPartyLinkMassesDataList)){ + if (!CollectionUtils.isEmpty(screenPartyLinkMassesDataList)) { ScreenPartyLinkMassesDataFormDTO form = new ScreenPartyLinkMassesDataFormDTO(); form.setOrgId(agencyId); form.setOrgType(ScreenConstant.AGENCY); @@ -257,8 +255,8 @@ public class PartyGuideServiceImpl implements PartyGuideService { form.setCustomerId(customerId); form.setDataEndTime(monthId); form.setParentId(screenPartyLinkMassesDataList.get(NumConstant.ZERO).getParentId()); - form.setGroupUserTotal(screenPartyLinkMassesDataList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getGroupUserTotal))); - form.setCreateGroupTotal(screenPartyLinkMassesDataList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getCreateGroupTotal))); + form.setGroupUserTotal(screenPartyLinkMassesDataList.stream().mapToInt(ScreenPartyLinkMassesDataFormDTO::getGroupUserTotal).sum()); + form.setCreateGroupTotal(screenPartyLinkMassesDataList.stream().mapToInt(ScreenPartyLinkMassesDataFormDTO::getCreateGroupTotal).sum()); result.add(form); } }); @@ -431,24 +429,23 @@ public class PartyGuideServiceImpl implements PartyGuideService { } /** - * @Description 社区级别的处理 + * @Description 社区级别的处理 * @Param customerId - * @Param monthId * @Param agency * @author zxc * @date 2020/9/25 10:06 上午 */ - public GridPartyGuideDTO communityLevelSubGrid(String customerId, String monthId, CustomerAgencyInfoResultDTO agency){ + public GridPartyGuideDTO communityLevelSubGrid(String customerId, CustomerAgencyInfoResultDTO agency) { String agencyId = agency.getAgencyId(); // 获取下级所有agencyId【根据agencyMap中的level判断下级orgId是否是gridId】(此处直接作为gridId) Map agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId); List gridIds = (List) agencyMap.get(agencyId); - List partyLinkMassesDataList = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, gridIds); + List partyLinkMassesDataList = groupMainService.selectPartyCreateGroupInfo(customerId, gridIds); List orgIds = partyLinkMassesDataList.stream().map(m -> m.getOrgId()).collect(Collectors.toList()); List orgNameList = agencyService.selectOrgNameGrid(orgIds); partyLinkMassesDataList.forEach(party -> { orgNameList.forEach(orgName -> { - if (party.getOrgId().equals(orgName.getGridId())){ + if (party.getOrgId().equals(orgName.getGridId())) { party.setOrgName(orgName.getGridName()); } }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml index 2717a8cb5e..3c7008dc0b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml @@ -97,7 +97,7 @@ - + DELETE FROM fact_origin_group_main_daily @@ -287,7 +287,6 @@ WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} - AND MONTH_ID = #{monthId} AND GROUP_STATE = 'approved' AND ( @@ -338,4 +337,4 @@ AND f.GROUP_STATE = 'approved' GROUP BY f.AGENCY_ID - \ No newline at end of file +