diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java index bf35e1fe88..8d4fb6f16a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java @@ -6,7 +6,7 @@ import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; import com.epmet.dto.group.form.GridGroupTotalFormDTO; import com.epmet.dto.group.form.GroupIncrFormDTO; import com.epmet.dto.group.result.*; -import com.epmet.entity.group.ResiGroupEntity; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -92,4 +92,12 @@ public interface GroupDataDao { **/ List groupExtracting(@Param("customerId")String customerId,@Param("dateId") String dateId); + /** + * 查询小组活动签到表,计算用户在本月内签到的活动次数 + * + * @param customerId + * @param monthId + * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO + */ + List selectUserSignedCount(@Param("customerId")String customerId, @Param("monthId")String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java index 6c7fad11c7..5a30c84911 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java @@ -7,6 +7,7 @@ import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthly import com.epmet.service.evaluationindex.extract.dataToIndex.CalCpcIndexService; import com.epmet.service.evaluationindex.extract.todata.*; import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyService; +import com.epmet.service.group.GroupDataService; import com.epmet.service.stats.DimCustomerPartymemberService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; @@ -43,6 +44,8 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { private FactIndexPartyAblityCpcMonthlyService factIndexPartyAblityCpcMonthlyService; @Autowired private FactOriginGroupMainDailyService factOriginGroupMainDailyService; + @Autowired + private GroupDataService groupDataService; /** * @param customerId 客户id @@ -54,7 +57,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { **/ @Override public void calCpcPartyAbility(String customerId, String monthId) { - //1、构造初始值 + //1、构造初始值 当前客户下所有的党员 List indexPartyAblityCpcList = dimCustomerPartymemberService.selectPartyMemberList(customerId); if (CollectionUtils.isEmpty(indexPartyAblityCpcList)) { log.info("dim_customer_partymember do not any records customerId="+customerId); @@ -71,7 +74,8 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { Map shiftIssueCountMap = calShiftIssueCount(customerId, monthId); //4、党员提出的议题转项目数 Map shiftProjectCountMap = calShiftProjectCount(customerId, monthId); - //5、参加“三会一课”次数 默认0 + //5、参加“三会一课”次数 默认0 :当前用户在本月内活动签到次数 + Map joinThreeMeetsCountMap=calJoinThreeMeetsCount(customerId,monthId); //可以先查询出每个党员的 自建群 Map> userCreatedGroups = queryUserCreatedGroups(customerId, indexPartyAblityCpcList); @@ -105,7 +109,10 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { if (shiftProjectCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { indexPartyAblityCpcEntity.setShiftProjectCount(shiftProjectCountMap.get(indexPartyAblityCpcEntity.getUserId())); } - //5、参加“三会一课”次数 目前没有此业务,默认0 + //5、参加“三会一课”次数 目前没有此业务,默认0 : 当前用户在本月内活动签到次数 + if(joinThreeMeetsCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())){ + indexPartyAblityCpcEntity.setJoinThreeMeetsCount(joinThreeMeetsCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } //6、党员自建群群众人数 if (groupUserCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { indexPartyAblityCpcEntity.setGroupUserCount(groupUserCountMap.get(indexPartyAblityCpcEntity.getUserId())); @@ -220,6 +227,24 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { return resultMap; } + /** + * @return java.util.Map + * @param customerId + * @param monthId + * @author yinzuomei + * @description 5:参加“三会一课”次数 : 当前用户在本月内活动签到次数 + * @Date 2021/5/12 13:38 + **/ + private Map calJoinThreeMeetsCount(String customerId, String monthId) { + //查询小组活动签到表,计算用户在本月内签到的活动次数 + List list=groupDataService.selectJoinThreeMeetsCount(customerId,monthId); + Map resultMap = new HashMap<>(); + for (CpcIndexCommonDTO cpcIndexCommonDTO : list) { + resultMap.put(cpcIndexCommonDTO.getUserId(), cpcIndexCommonDTO.getIndexValue()); + } + return resultMap; + } + /** * @param customerId * @param monthId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java index 76865ba242..6be5b22324 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java @@ -2,7 +2,7 @@ package com.epmet.service.group; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.group.result.*; -import com.epmet.entity.group.ResiGroupEntity; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.util.DimIdGenerator; import org.apache.ibatis.annotations.Param; @@ -67,4 +67,12 @@ public interface GroupDataService { **/ List extractGroupData(Boolean isFirst,String customerId,String dateId); + /** + * 查询小组活动签到表,计算用户在本月内签到的活动次数 + * + * @param customerId + * @param monthId + * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO + */ + List selectJoinThreeMeetsCount(String customerId, String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java index 93d6b4a7db..20927df80a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java @@ -10,16 +10,12 @@ import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; import com.epmet.dto.group.form.GridGroupTotalFormDTO; import com.epmet.dto.group.form.GroupIncrFormDTO; import com.epmet.dto.group.result.*; -import com.epmet.entity.group.ResiGroupEntity; -import com.epmet.entity.stats.DimGridEntity; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.service.group.GroupDataService; import com.epmet.util.DimIdGenerator; -import org.apache.commons.lang3.StringUtils; -import org.apache.poi.util.StringUtil; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; import java.util.*; import java.util.stream.Collectors; @@ -139,6 +135,7 @@ public class GroupDataServiceImpl implements GroupDataService { * @param * @author zxc */ + @Override public List getAgencyGroupTotalCount(String customerId,String dateId){ /*if (allGrid.size() == NumConstant.ZERO){ return new ArrayList<>(); @@ -164,6 +161,7 @@ public class GroupDataServiceImpl implements GroupDataService { * @param * @author zxc */ + @Override public List selectAgencyEveryGroupPeopleCount(String customerId,String dateId){ /*if (allGrid.size() == NumConstant.ZERO){ return new ArrayList<>(); @@ -177,6 +175,7 @@ public class GroupDataServiceImpl implements GroupDataService { * @param dateId * @author zxc */ + @Override public List selectAgencyGroupIncr(String customerId,String dateId){ /*if (allGrid.size() == NumConstant.ZERO){ return new ArrayList<>(); @@ -211,4 +210,17 @@ public class GroupDataServiceImpl implements GroupDataService { return groupDataDao.groupExtracting(customerId,isFirst?null:dateId); } + /** + * 查询小组活动签到表,计算用户在本月内签到的活动次数 + * + * @param customerId + * @param monthId + * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO + */ + @Override + public List selectJoinThreeMeetsCount(String customerId, String monthId) { + return groupDataDao.selectUserSignedCount(customerId,monthId); + } + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml index a1b2b223ab..08b32f97fe 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml @@ -214,18 +214,18 @@ - - SELECT - - ATTACHMENT_URL AS eventImgUrl, - SORT - - FROM - resi_topic_attachment - WHERE - DEL_FLAG = '0' - + m.SIGN_USER_ID AS userId, + count( DISTINCT m.GROUP_ACT_ID ) AS indexValue + FROM + act_sign_in_record m + WHERE + m.DEL_FLAG = '0' + AND m.CUSTOMER_ID = #{customerId} + AND DATE_FORMAT( m.CREATED_TIME, '%Y%m')= #{monthId} + GROUP BY + m.SIGN_USER_ID - \ No newline at end of file