Browse Source

党员相关:参加三一会一课次数joinThreeMeetsCount字段赋值

dev_shibei_match
yinzuomei 4 years ago
parent
commit
9108b5ef31
  1. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java
  2. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java
  3. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java
  4. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java
  5. 24
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml

10
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<FactOriginGroupMainDailyDTO> groupExtracting(@Param("customerId")String customerId,@Param("dateId") String dateId);
/**
* 查询小组活动签到表计算用户在本月内签到的活动次数
*
* @param customerId
* @param monthId
* @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO
*/
List<CpcIndexCommonDTO> selectUserSignedCount(@Param("customerId")String customerId, @Param("monthId")String monthId);
}

31
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<FactIndexPartyAblityCpcMonthlyEntity> 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<String, Integer> shiftIssueCountMap = calShiftIssueCount(customerId, monthId);
//4、党员提出的议题转项目数
Map<String, Integer> shiftProjectCountMap = calShiftProjectCount(customerId, monthId);
//5、参加“三会一课”次数 默认0
//5、参加“三会一课”次数 默认0 :当前用户在本月内活动签到次数
Map<String,Integer> joinThreeMeetsCountMap=calJoinThreeMeetsCount(customerId,monthId);
//可以先查询出每个党员的 自建群
Map<String, List<String>> 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<java.lang.String,java.lang.Integer>
* @param customerId
* @param monthId
* @author yinzuomei
* @description 5:参加三会一课次数 : 当前用户在本月内活动签到次数
* @Date 2021/5/12 13:38
**/
private Map<String, Integer> calJoinThreeMeetsCount(String customerId, String monthId) {
//查询小组活动签到表,计算用户在本月内签到的活动次数
List<CpcIndexCommonDTO> list=groupDataService.selectJoinThreeMeetsCount(customerId,monthId);
Map<String, Integer> resultMap = new HashMap<>();
for (CpcIndexCommonDTO cpcIndexCommonDTO : list) {
resultMap.put(cpcIndexCommonDTO.getUserId(), cpcIndexCommonDTO.getIndexValue());
}
return resultMap;
}
/**
* @param customerId
* @param monthId

10
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<FactOriginGroupMainDailyDTO> extractGroupData(Boolean isFirst,String customerId,String dateId);
/**
* 查询小组活动签到表计算用户在本月内签到的活动次数
*
* @param customerId
* @param monthId
* @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO
*/
List<CpcIndexCommonDTO> selectJoinThreeMeetsCount(String customerId, String monthId);
}

22
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<AgencyGroupTotalCountResultDTO> 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<AgencyGridGroupPeopleResultDTO> 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<AgencyGroupIncrResultDTO> 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<CpcIndexCommonDTO> selectJoinThreeMeetsCount(String customerId, String monthId) {
return groupDataDao.selectUserSignedCount(customerId,monthId);
}
}

24
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml

@ -214,18 +214,18 @@
</if>
</select>
<select id="selectTopicAttachments" resultType="com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity">
<!-- 查询小组活动签到表,计算用户在本月内签到的活动次数 -->
<select id="selectUserSignedCount" parameterType="map" resultType="com.epmet.dto.indexcollect.result.CpcIndexCommonDTO">
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
</select>
</mapper>
Loading…
Cancel
Save