From ca96a3f34874ff134c2257018150c723598dd9d0 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 13 May 2021 11:18:48 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3=EF=BC=9A?= =?UTF-8?q?=E5=85=9A=E5=91=98=E5=8F=82=E5=8A=A0=E2=80=9C=E4=B8=89=E4=BC=9A?= =?UTF-8?q?=E4=B8=80=E8=AF=BE=E2=80=9D=E4=BA=BA=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/PartyMemberInfoResultDTO.java | 5 +++ .../result/PartyJoinThreeMeetDTO.java | 20 +++++++++ .../dao/stats/DimCustomerPartymemberDao.java | 8 ++++ .../impl/CalGridIndexServiceImpl.java | 41 +++++++++++++++---- .../stats/DimCustomerPartymemberService.java | 8 ++++ .../DimCustomerPartymemberServiceImpl.java | 11 +++++ .../stats/DimCustomerPartymemberDao.xml | 12 ++++++ 7 files changed, 98 insertions(+), 7 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/PartyJoinThreeMeetDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyMemberInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyMemberInfoResultDTO.java index 24e5ec021a..d0f56ff909 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyMemberInfoResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyMemberInfoResultDTO.java @@ -48,4 +48,9 @@ public class PartyMemberInfoResultDTO implements Serializable { * 机关名称 */ private String agencyName; + + /** + * 党员的用户id + */ + private String userId; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/PartyJoinThreeMeetDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/PartyJoinThreeMeetDTO.java new file mode 100644 index 0000000000..b59fd8a969 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/PartyJoinThreeMeetDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.indexcollect.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 网格相关:党员参加“三会一课”人次 用 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/13 10:50 + */ +@Data +public class PartyJoinThreeMeetDTO implements Serializable { + private static final long serialVersionUID = 3027535602832948917L; + private String gridId; + private String userId; + private Integer joinThreeMeetsCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java index 0d614b2e4a..3e69bc2837 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java @@ -100,4 +100,12 @@ public interface DimCustomerPartymemberDao extends BaseDao selectPartyMemberUserIdsByPids(@Param("customerId") String customerId, @Param("pids")String pids); + + /** + * 查询当前客户下所有注册的党员 + * + * @param customerId + * @return 返回网格id、用户id + */ + List selectPartyMemberInfoByCustomerId(@Param("customerId")String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java index ef869f7941..f0c009064f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.service.evaluationindex.extract.dataToIndex.impl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.ExtractConstant; import com.epmet.constant.ProjectEvaluateConstant; @@ -8,7 +9,9 @@ import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.GridIssueCountResultDTO; import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.result.*; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; +import com.epmet.dto.indexcollect.result.PartyJoinThreeMeetDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; import com.epmet.service.evaluationindex.extract.dataToIndex.CalGridIndexService; import com.epmet.service.evaluationindex.extract.todata.*; @@ -19,6 +22,7 @@ import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; import com.epmet.service.group.GroupDataService; import com.epmet.service.heart.ActInfoService; import com.epmet.service.partymember.PartyMemberService; +import com.epmet.service.stats.DimCustomerPartymemberService; import com.epmet.service.stats.FactArticlePublishedGridDailyService; import com.epmet.service.stats.user.FactRegUserGridMonthlyService; import com.epmet.service.user.UserService; @@ -78,6 +82,8 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { private ScreenCustomerGridService gridService; @Autowired private GroupDataService groupDataService; + @Autowired + private DimCustomerPartymemberService dimCustomerPartymemberService; /** * @Description 计算网格指标党建能力 @@ -140,7 +146,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { // 组织“三会一课”次数 前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 Map createThreeMeetsCountMap=getCreateThreeMeetsCountMap(customerId,monthId); // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数 - Map joinThreeMeetsCountMap=getJoinThreeMeetsCountMap(customerId,monthId); + List joinThreeMeetsCountList=getJoinThreeMeetsCountMap(customerId,monthId); String quarterId = DateUtils.getQuarterId(monthId); String yearId = DateUtils.getYearId(monthId); @@ -234,8 +240,14 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { r.setCreateThreeMeetsCount(createThreeMeetsCountMap.get(r.getGridId())); } // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数 - if (joinThreeMeetsCountMap.containsKey(r.getGridId())) { - r.setJoinThreeMeetsCount(joinThreeMeetsCountMap.get(r.getGridId())); + if (!CollectionUtils.isEmpty(joinThreeMeetsCountList)) { + Integer joinThreeMeetsCount = NumConstant.ZERO; + for (PartyJoinThreeMeetDTO dto : joinThreeMeetsCountList) { + if (dto.getGridId().equals(r.getGridId())) { + joinThreeMeetsCount += dto.getJoinThreeMeetsCount(); + } + } + r.setJoinThreeMeetsCount(joinThreeMeetsCount); } }); delPartyAbility(customerId, monthId); @@ -257,13 +269,28 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { return resultMap; } - private Map getJoinThreeMeetsCountMap(String customerId, String monthId) { + private List getJoinThreeMeetsCountMap(String customerId, String monthId) { + List partyJoinThreeMeetDTOList = new ArrayList<>(); // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数 - // todo - return null; + //1、查询出当前客户下注册的党员 + List list = dimCustomerPartymemberService.selectPartyMemberInfoByCustomerId(customerId); + if (!CollectionUtils.isEmpty(list)) { + partyJoinThreeMeetDTOList = ConvertUtils.sourceToTarget(list, PartyJoinThreeMeetDTO.class); + //2、查询出所有用户本月签到次数 + List userList = groupDataService.selectJoinThreeMeetsCount(customerId, monthId); + for (PartyJoinThreeMeetDTO partyJoinThreeMeetDTO : partyJoinThreeMeetDTOList) { + partyJoinThreeMeetDTO.setJoinThreeMeetsCount(NumConstant.ZERO); + for (CpcIndexCommonDTO cpcIndexCommonDTO : userList) { + if (partyJoinThreeMeetDTO.getUserId().equals(cpcIndexCommonDTO.getUserId())) { + partyJoinThreeMeetDTO.setJoinThreeMeetsCount(cpcIndexCommonDTO.getIndexValue()); + break; + } + } + } + } + return partyJoinThreeMeetDTOList; } - /** * @Description 计算网格指标治理能力 * @param customerId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java index d231065d66..d93248f4f5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java @@ -131,4 +131,12 @@ public interface DimCustomerPartymemberService extends BaseService getPartyMemberUserIds(String customerId, String type,String orgId); + + /** + * 查询当前客户下所有注册的党员 + * + * @param customerId + * @return 返回网格id、用户id + */ + List selectPartyMemberInfoByCustomerId(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java index 5aa8fb1d26..cec5da65e6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java @@ -246,4 +246,15 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl selectPartyMemberInfoByCustomerId(String customerId) { + return baseDao.selectPartyMemberInfoByCustomerId(customerId); + } } \ No newline at end of file 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 2d92d5d61b..564aca5628 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 @@ -140,4 +140,16 @@ AND dcp.CUSTOMER_ID =#{customerId} and dcp.PIDS LIKE CONCAT(#{pids},'%') + + + + \ No newline at end of file