diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridInfoResultDTO.java new file mode 100644 index 0000000000..9555ea578c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridInfoResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/24 2:59 下午 + */ +@Data +public class GridInfoResultDTO implements Serializable { + + private static final long serialVersionUID = -8146474744340303247L; + + private String agencyId; + + private String gridId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyDTO.java new file mode 100644 index 0000000000..910ea4759a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.extract.result; + +import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/9/24 2:45 下午 + */ +@Data +@AllArgsConstructor +public class GridPartyDTO implements Serializable { + + private static final long serialVersionUID = -6699064424253966688L; + + private List orgIds; + + private List result; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgNameResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgNameResultDTO.java new file mode 100644 index 0000000000..66764c2674 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgNameResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/24 1:23 下午 + */ +@Data +public class OrgNameResultDTO implements Serializable { + + private static final long serialVersionUID = -4815327768546033428L; + + private String gridId; + + private String agencyId; + + private String gridName; + + private String agencyName; + + private String parentId; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java index c27f8b8857..716d9b2cfb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java @@ -85,4 +85,12 @@ public interface ScreenCpcBaseDataDao extends BaseDao { * @date 2020/9/23 2:01 下午 */ List selectPartyInfo(@Param("customerId") String customerId,@Param("dateId") String dateId, String agencyId); + + /** + * @Description 查询党员信息【直属网格的】 + * @param gridIds + * @author zxc + * @date 2020/9/24 3:23 下午 + */ + List selectDirectGridPartyInfo(@Param("gridIds") List gridIds,@Param("customerId") String customerId,@Param("dateId") String dateId); } 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 65f2faf3b1..bf64ec0495 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 @@ -20,6 +20,7 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; +import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.dto.screen.result.TreeResultDTO; import com.epmet.dto.screencoll.form.CustomerAgencyFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; @@ -152,4 +153,12 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectAllAgencyIdToParty(@Param("customerId")String customerId,@Param("dateId")String dateId); + + /** + * @Description 查询org名称【机关】 + * @param agencyIds + * @author zxc + * @date 2020/9/24 1:27 下午 + */ + List selectOrgNameAgency(@Param("agencyIds") List agencyIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java index 28338f0da7..7d6c8b7280 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java @@ -20,6 +20,8 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.result.GridInfoResultDTO; +import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.dto.indexcal.PageQueryGridFormDTO; import com.epmet.dto.screencoll.form.CustomerGridFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; @@ -138,4 +140,20 @@ public interface ScreenCustomerGridDao extends BaseDao * @date 2020/9/23 3:10 下午 */ List selectAllGridIdToParty(String customerId, String dateId); + + /** + * @Description 查询org名称 + * @param gridIds + * @author zxc + * @date 2020/9/24 1:27 下午 + */ + List selectOrgName(@Param("gridIds") List gridIds); + + /** + * @Description 查询机关的直属网格 + * @param agencyIds + * @author zxc + * @date 2020/9/24 2:33 下午 + */ + List selectDirectGrid(@Param("agencyIds") List agencyIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java index f3c758df72..6dcfe74f8c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java @@ -2,10 +2,7 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; -import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; -import com.epmet.dto.extract.result.PartyInfoResultDTO; -import com.epmet.dto.extract.result.PartyMemberInfoResultDTO; -import com.epmet.dto.extract.result.UserCountResultDTO; +import com.epmet.dto.extract.result.*; import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService; import com.epmet.service.evaluationindex.screen.ScreenCpcBaseDataService; import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; @@ -109,56 +106,27 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { // 是 community 级别,子级为gridId List userCountList = userGridDailyService.selectUserCount(customerId, dateId); agencyIdList.forEach(agency -> { - // 1. 处理社区下的所有网格中的党员信息 - String agencyId = agency.getAgencyId(); - // 获取下级所有agencyId【根据agencyMap中的level判断下级orgId是否是gridId】(此处直接作为gridId) - Map agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId); - List gridIds = (List) agencyMap.get(agencyId); - orgIds.addAll(gridIds); - List partyMemberInfoList = partyMemberService.selectPartyMemberInfo(customerId, gridIds); - if (!CollectionUtils.isEmpty(partyMemberInfoList)){ - // 为每个人赋值年龄 - partyMemberInfoList.forEach(party -> { - party.setAge(getAge(party.getBirthday())); - }); - Map> groupByGridId = partyMemberInfoList.stream().collect(Collectors.groupingBy(PartyMemberInfoResultDTO::getGridId)); - groupByGridId.forEach((gridId,partyInfos) -> { - PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO(); - form.setOrgType(ScreenConstant.GRID); - form.setOrgId(gridId); - form.setOrgName(partyInfos.get(NumConstant.ZERO).getGridName()); - form.setAgeLevel1(disposeAge(partyInfos,NumConstant.TWENTY,false)); - form.setAgeLevel2(disposeAgeArea(partyInfos,NumConstant.TWENTY,NumConstant.THIRTY)); - form.setAgeLevel3(disposeAgeArea(partyInfos,NumConstant.THIRTY_ONE,NumConstant.FORTY)); - form.setAgeLevel4(disposeAgeArea(partyInfos,NumConstant.FORTY_ONE,NumConstant.FIFTY)); - form.setAgeLevel5(disposeAgeArea(partyInfos,NumConstant.FIFTY_ONE,NumConstant.SIXTY)); - form.setAgeLevel6(disposeAge(partyInfos,NumConstant.SIXTY,true)); - form.setCustomerId(customerId); - form.setDataEndTime(dateId); - form.setParentId(partyInfos.get(NumConstant.ZERO).getAgencyId()); - if (!CollectionUtils.isEmpty(userCountList)){ - userCountList.forEach(user -> { - if (gridId.equals(user.getOrgId())){ - form.setResiTotal(user.getResiTotal()); - form.setRegisterUserCount(user.getRegisterUserCount()); - form.setPartyMemberCount(user.getPartyMemberCount()); - } - }); - } - result.add(form); - }); - } + GridPartyDTO gridPartyDTO = gridParty(customerId, dateId, agency); + result.addAll(gridPartyDTO.getResult()); + orgIds.addAll(gridPartyDTO.getOrgIds()); }); // 2. 处理社区级别的党员信息(因为网格级别的已算出,社区级别直接累加) Map> groupByAgency = result.stream().collect(Collectors.groupingBy(PartyBaseInfoFormDTO::getParentId)); + List orgNameAgencyList = agencyService.selectOrgNameAgency(result.stream().map(m -> m.getParentId()).distinct().collect(Collectors.toList())); groupByAgency.forEach((commAgencyId,party) -> { PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO(); - form.setOrgName(party.get(NumConstant.ZERO).getOrgName()); + if (!CollectionUtils.isEmpty(orgNameAgencyList)){ + orgNameAgencyList.forEach(name -> { + if (commAgencyId.equals(name.getAgencyId())){ + form.setOrgName(name.getAgencyName()); + form.setParentId(name.getParentId()); + } + }); + } form.setOrgId(commAgencyId); form.setCustomerId(customerId); form.setDataEndTime(dateId); form.setOrgType(ScreenConstant.AGENCY); - form.setParentId(party.get(NumConstant.ZERO).getParentId()); form.setAgeLevel1(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel1))); form.setAgeLevel2(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel2))); form.setAgeLevel3(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel3))); @@ -173,10 +141,66 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { delAndInsert(result,customerId,dateId,orgIds); }else { // 级别为 street,district,city,province + List agencyIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); + List directGridIds = gridService.selectDirectGrid(agencyIds); + List userCountList = userGridDailyService.selectUserCount(customerId, dateId); agencyIdList.forEach(agency -> { String agencyId = agency.getAgencyId(); - // 查询下级机关的党员信息,直接累加 + List dGridId = new ArrayList<>(); + directGridIds.forEach(grid -> { + if (agencyId.equals(grid.getAgencyId())){ + dGridId.add(grid.getGridId()); + } + }); + // 不为空 存在直属网格 + if (!CollectionUtils.isEmpty(dGridId)){ + List disGrid = new ArrayList<>(); + List partyMemberInfoList = partyMemberService.selectPartyMemberInfo(customerId, dGridId); + List orgNameList = agencyService.selectOrgNameGrid(partyMemberInfoList.stream().map(m -> m.getGridId()).collect(Collectors.toList())); + if (!CollectionUtils.isEmpty(partyMemberInfoList)){ + // 为每个人赋值年龄 + partyMemberInfoList.forEach(party -> { + party.setAge(getAge(party.getBirthday())); + orgNameList.forEach(orgName -> { + if (party.getGridId().equals(orgName.getGridId())){ + party.setGridName(orgName.getGridName()); + party.setAgencyName(orgName.getAgencyName()); + } + }); + }); + Map> groupByGridId = partyMemberInfoList.stream().collect(Collectors.groupingBy(PartyMemberInfoResultDTO::getGridId)); + groupByGridId.forEach((gridId,partyInfos) -> { + PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO(); + form.setOrgType(ScreenConstant.GRID); + form.setOrgId(gridId); + form.setOrgName(partyInfos.get(NumConstant.ZERO).getGridName()); + form.setAgeLevel1(disposeAge(partyInfos,NumConstant.TWENTY,false)); + form.setAgeLevel2(disposeAgeArea(partyInfos,NumConstant.TWENTY,NumConstant.THIRTY)); + form.setAgeLevel3(disposeAgeArea(partyInfos,NumConstant.THIRTY_ONE,NumConstant.FORTY)); + form.setAgeLevel4(disposeAgeArea(partyInfos,NumConstant.FORTY_ONE,NumConstant.FIFTY)); + form.setAgeLevel5(disposeAgeArea(partyInfos,NumConstant.FIFTY_ONE,NumConstant.SIXTY)); + form.setAgeLevel6(disposeAge(partyInfos,NumConstant.SIXTY,true)); + form.setCustomerId(customerId); + form.setDataEndTime(dateId); + form.setParentId(partyInfos.get(NumConstant.ZERO).getAgencyId()); + if (!CollectionUtils.isEmpty(userCountList)){ + userCountList.forEach(user -> { + if (gridId.equals(user.getOrgId())){ + form.setResiTotal(user.getResiTotal()); + form.setRegisterUserCount(user.getRegisterUserCount()); + form.setPartyMemberCount(user.getPartyMemberCount()); + } + }); + } + disGrid.add(form); + }); + } + delAndInsert(disGrid,customerId,dateId,dGridId); + } + // 查询下级机关的党员信息,直接累加 【包括直属网格】 + List directGridList = cpcBaseDataService.selectDirectGridPartyInfo(dGridId, customerId, dateId); List partyInfoList = cpcBaseDataService.selectPartyInfo(customerId, dateId, agencyId); + partyInfoList.addAll(directGridList); if (!CollectionUtils.isEmpty(partyInfoList)){ PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO(); form.setOrgName(partyInfoList.get(NumConstant.ZERO).getOrgName()); @@ -307,4 +331,57 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { cpcBaseDataService.insertPartyBaseInfo(p); }); } + + public GridPartyDTO gridParty(String customerId,String dateId,CustomerAgencyInfoResultDTO agency){ + List result = new ArrayList<>(); + List orgIds = new ArrayList<>(); + List userCountList = userGridDailyService.selectUserCount(customerId, dateId); + // 1. 处理社区下的所有网格中的党员信息 + String agencyId = agency.getAgencyId(); + // 获取下级所有agencyId【根据agencyMap中的level判断下级orgId是否是gridId】(此处直接作为gridId) + Map agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId); + List gridIds = (List) agencyMap.get(agencyId); + orgIds.addAll(gridIds); + List partyMemberInfoList = partyMemberService.selectPartyMemberInfo(customerId, gridIds); + List orgNameList = agencyService.selectOrgNameGrid(partyMemberInfoList.stream().map(m -> m.getGridId()).collect(Collectors.toList())); + if (!CollectionUtils.isEmpty(partyMemberInfoList)){ + // 为每个人赋值年龄 + partyMemberInfoList.forEach(party -> { + party.setAge(getAge(party.getBirthday())); + orgNameList.forEach(orgName -> { + if (party.getGridId().equals(orgName.getGridId())){ + party.setGridName(orgName.getGridName()); + party.setAgencyName(orgName.getAgencyName()); + } + }); + }); + Map> groupByGridId = partyMemberInfoList.stream().collect(Collectors.groupingBy(PartyMemberInfoResultDTO::getGridId)); + groupByGridId.forEach((gridId,partyInfos) -> { + PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO(); + form.setOrgType(ScreenConstant.GRID); + form.setOrgId(gridId); + form.setOrgName(partyInfos.get(NumConstant.ZERO).getGridName()); + form.setAgeLevel1(disposeAge(partyInfos,NumConstant.TWENTY,false)); + form.setAgeLevel2(disposeAgeArea(partyInfos,NumConstant.TWENTY,NumConstant.THIRTY)); + form.setAgeLevel3(disposeAgeArea(partyInfos,NumConstant.THIRTY_ONE,NumConstant.FORTY)); + form.setAgeLevel4(disposeAgeArea(partyInfos,NumConstant.FORTY_ONE,NumConstant.FIFTY)); + form.setAgeLevel5(disposeAgeArea(partyInfos,NumConstant.FIFTY_ONE,NumConstant.SIXTY)); + form.setAgeLevel6(disposeAge(partyInfos,NumConstant.SIXTY,true)); + form.setCustomerId(customerId); + form.setDataEndTime(dateId); + form.setParentId(partyInfos.get(NumConstant.ZERO).getAgencyId()); + if (!CollectionUtils.isEmpty(userCountList)){ + userCountList.forEach(user -> { + if (gridId.equals(user.getOrgId())){ + form.setResiTotal(user.getResiTotal()); + form.setRegisterUserCount(user.getRegisterUserCount()); + form.setPartyMemberCount(user.getPartyMemberCount()); + } + }); + } + result.add(form); + }); + } + return new GridPartyDTO(orgIds, result); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java index d6fc5828cc..314bd3181a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java @@ -60,4 +60,12 @@ public interface ScreenCpcBaseDataService extends BaseService selectPartyInfo(String customerId, String dateId,String agencyId); + /** + * @Description 查询党员信息【直属网格的】 + * @param gridIds + * @author zxc + * @date 2020/9/24 3:23 下午 + */ + List selectDirectGridPartyInfo(List gridIds,String customerId,String dateId); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java index 6d955563f7..9d74cc81e7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java @@ -21,6 +21,8 @@ import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; import java.util.List; + +import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; import com.epmet.entity.org.CustomerAgencyEntity; @@ -75,4 +77,20 @@ public interface ScreenCustomerAgencyService{ * @date 2020/9/23 3:10 下午 */ List selectAllAgencyIdToParty(String customerId,String dateId); + + /** + * @Description 查询org名称【网格】 + * @param gridIds + * @author zxc + * @date 2020/9/24 1:27 下午 + */ + List selectOrgNameGrid(List gridIds); + + /** + * @Description 查询org名称【机关】 + * @param agencyIds + * @author zxc + * @date 2020/9/24 1:27 下午 + */ + List selectOrgNameAgency(List agencyIds); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java index 504af8521d..2819d07347 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java @@ -20,6 +20,7 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; @@ -46,4 +47,12 @@ public interface ScreenCustomerGridService extends BaseService selectAllGridIdToParty(String customerId, String dateId); + + /** + * @Description 查询机关的直属网格 + * @param agencyIds + * @author zxc + * @date 2020/9/24 2:33 下午 + */ + List selectDirectGrid(List agencyIds); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCpcBaseDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCpcBaseDataServiceImpl.java index ab1e25f294..7505476087 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCpcBaseDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCpcBaseDataServiceImpl.java @@ -26,7 +26,9 @@ import com.epmet.dto.extract.result.PartyInfoResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenCpcBaseDataEntity; import com.epmet.service.evaluationindex.screen.ScreenCpcBaseDataService; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.List; @@ -71,4 +73,18 @@ public class ScreenCpcBaseDataServiceImpl extends BaseServiceImpl selectPartyInfo(String customerId, String dateId, String agencyId) { return baseDao.selectPartyInfo(customerId, dateId, agencyId); } + + /** + * @Description 查询党员信息【直属网格的】 + * @param gridIds + * @author zxc + * @date 2020/9/24 3:23 下午 + */ + @Override + public List selectDirectGridPartyInfo(List gridIds,String customerId,String dateId) { + if (!CollectionUtils.isEmpty(gridIds)){ + return baseDao.selectDirectGridPartyInfo(gridIds, customerId, dateId); + } + return new ArrayList<>(); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java index cf159bae2f..13d056ced5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java @@ -17,13 +17,16 @@ package com.epmet.service.evaluationindex.screen.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; import com.epmet.constant.OrgSourceTypeConstant; import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; +import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.dto.screen.result.TreeResultDTO; import com.epmet.constant.ScreenConstant; import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; @@ -50,6 +53,7 @@ import java.util.stream.Collectors; */ @Service @Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyService { @Autowired @@ -159,6 +163,34 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ return screenCustomerAgencyDao.selectAllAgencyIdToParty(customerId,dateId); } + /** + * @Description 查询org名称 + * @param gridIds + * @author zxc + * @date 2020/9/24 1:27 下午 + */ + @Override + public List selectOrgNameGrid(List gridIds) { + if (!CollectionUtils.isEmpty(gridIds)){ + return screenCustomerGridDao.selectOrgName(gridIds); + } + return new ArrayList<>(); + } + + /** + * @Description 查询org名称【机关】 + * @param agencyIds + * @author zxc + * @date 2020/9/24 1:27 下午 + */ + @Override + public List selectOrgNameAgency(List agencyIds) { + if (!CollectionUtils.isEmpty(agencyIds)){ + return screenCustomerAgencyDao.selectOrgNameAgency(agencyIds); + } + return new ArrayList<>(); + } + private void updateAgency(ScreenCustomerAgencyEntity exists) { screenCustomerAgencyDao.updateById(exists); } @@ -193,4 +225,6 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ public List selectAllAgencyId(String customerId) { return screenCustomerAgencyDao.selectAllAgencyId(customerId); } + + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java index 2d25673a50..a0e280aa3a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java @@ -25,13 +25,16 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.constant.OrgSourceTypeConstant; import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -102,4 +105,18 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl selectAllGridIdToParty(String customerId, String dateId) { return screenCustomerGridDao.selectAllGridIdToParty(customerId, dateId); } + + /** + * @Description 查询机关的直属网格 + * @param agencyIds + * @author zxc + * @date 2020/9/24 2:33 下午 + */ + @Override + public List selectDirectGrid(List agencyIds) { + if (!CollectionUtils.isEmpty(agencyIds)){ + return screenCustomerGridDao.selectDirectGrid(agencyIds); + } + return new ArrayList<>(); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml index 7700490255..343deb4dd1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml @@ -38,6 +38,40 @@ AND PARENT_ID = #{agencyId} + + + insert into screen_cpc_base_data ( 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 1a66ff709b..e5d5305639 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 @@ -286,4 +286,22 @@ del_flag = '0' AND CUSTOMER_ID = #{customerId} + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml index 419674a89d..bbf5e68d1f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml @@ -233,4 +233,41 @@ del_flag = '0' AND CUSTOMER_ID = #{customerId} + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml index ba50d19701..2d92d5d61b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml @@ -96,16 +96,10 @@ dcp.GRID_ID, dcp.AGENCY_ID, dcp.PARENT_ID, - dcp.BIRTHDAY, - scg.GRID_NAME, - sca.AGENCY_NAME + dcp.BIRTHDAY FROM dim_customer_partymember dcp - LEFT JOIN screen_customer_grid scg ON scg.GRID_ID = dcp.GRID_ID - LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = dcp.AGENCY_ID WHERE dcp.DEL_FLAG = '0' - AND scg.DEL_FLAG = 0 - AND sca.DEL_FLAG = 0 AND dcp.CUSTOMER_ID = #{customerId} AND (