Browse Source

Merge remote-tracking branch 'origin/dev_screen_data_2.0' into dev_screen_data_2.0

# Conflicts:
#	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java
#	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectLogDailyService.java
#	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectLogDailyServiceImpl.java
master
wangchao 5 years ago
parent
commit
5b90c2a248
  1. 1
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgStatisticsResultDTO.java
  2. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java
  3. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java
  4. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java
  5. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java
  6. 23
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
  7. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java
  8. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java
  9. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.java
  10. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectLogDailyService.java
  11. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectMainDailyService.java
  12. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicLogDailyService.java
  13. 30
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java
  14. 245
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalCpcIndexServiceImpl.java
  15. 37
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java
  16. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectLogDailyServiceImpl.java
  17. 37
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectMainDailyServiceImpl.java
  18. 32
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicLogDailyServiceImpl.java
  19. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java
  20. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java
  21. 44
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java
  22. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyService.java
  23. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollCommunityService.java
  24. 23
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityOrgMonthlyServiceImpl.java
  25. 47
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollCommunityServiceImpl.java
  26. 34
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollStreetServiceImpl.java
  27. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedAgencyDailyService.java
  28. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java
  29. 23
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml
  30. 16
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml
  31. 42
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml
  32. 21
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml
  33. 31
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  34. 28
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml
  35. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml
  36. 12
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml

1
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgStatisticsResultDTO.java

@ -14,6 +14,7 @@ public class OrgStatisticsResultDTO implements Serializable {
private static final long serialVersionUID = 9221060553279124719L;
private String customerId;
private String agencyId;
private String orgId;
private Integer count;
private Integer sum;
private String ratio;

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java

@ -118,4 +118,22 @@ public interface FactOriginGroupMainDailyDao extends BaseDao<FactOriginGroupMain
* @date 2020.09.20 15:37
**/
int insertBatchMembers(List<ExtractGroupMemberActionRecordResultDTO> list);
/**
* @param customerId
* @param groupOwnerId
* @return java.util.List<java.lang.String>
* @author yinzuomei
* @description 查询当前用户建的所有群id
* @Date 2020/9/20 21:22
**/
List<String> selectGroupIds(@Param("customerId") String customerId, @Param("groupOwnerId") String groupOwnerId);
/**
* @return java.util.List<java.lang.String>
* @param groupIdList
* @author yinzuomei
* @description 查询组成员数去重
* @Date 2020/9/20 21:29
**/
List<String> selectGroupMemberList(@Param("list") List<String> groupIdList);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java

@ -51,4 +51,14 @@ public interface FactOriginIssueLogDailyDao extends BaseDao<FactOriginIssueLogDa
*/
void deleteOldLogRecord(@Param("customerId")String customerId,@Param("dateId")String dateId);
/**
* @return java.lang.Integer
* @param userId 用户id
* @param customerId
* @param monthId
* @author yinzuomei
* @description 查询用户在这个月内表决的总次数
* @Date 2020/9/20 21:52
**/
Integer selectCountUserVote(@Param("userId") String userId, @Param("customerId") String customerId, @Param("monthId")String monthId);
}

19
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java

@ -83,16 +83,6 @@ public interface FactOriginIssueMainDailyDao extends BaseDao<FactOriginIssueMain
**/
List<Map<String, Integer>> selectShiftIssueCount(@Param("customerId") String customerId,@Param("monthId") String monthId);
/**
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>
* @param customerId
* @param monthId
* @author yinzuomei
* @description 党员提出的议题转项目数
* @Date 2020/9/18 14:11
**/
List<Map<String, Integer>> selectShiftProjectCount(@Param("customerId") String customerId,@Param("monthId") String monthId);
/**
* @Description 查询网格 党员/群众 人均提出的议题转项目数
* @param customerId
@ -102,4 +92,13 @@ public interface FactOriginIssueMainDailyDao extends BaseDao<FactOriginIssueMain
* @date 2020/9/19 2:26 下午
*/
List<ShiftProjectCountResultDTO> selectShiftProjectCountPlus(@Param("customerId") String customerId,@Param("monthId") String monthId,@Param("isParty") Integer isParty);
/**
* @return java.lang.Integer
* @param topicIdList
* @author yinzuomei
* @description 查询本周期和上周期内自建群内话题转为议题的数量的总和
* @Date 2020/9/20 22:54
**/
Integer selectIssueTotalTwoMonth(@Param("list") List<String> topicIdList);
}

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java

@ -94,6 +94,18 @@ public interface FactOriginProjectLogDailyDao extends BaseDao<FactOriginProjectL
List<OrgStatisticsResultDTO> selectSatisfaction(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level")String level);
/**
* 区直部门被吹哨次数
* @author zhaoqifeng
* @date 2020/9/18 14:46
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectDepTransferCount(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level")String level);
/**
* @Description 查询各项目经受了多少机关
* @param customerId

23
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java

@ -26,6 +26,7 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 项目主表_日统计
@ -83,4 +84,26 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
* @return void
*/
void deleteByDate(@Param("customerId") String customerId, @Param("date") String date);
void deleteByDate(@Param("date") String date);
/**
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>
* @param customerId
* @param monthId
* @author yinzuomei
* @description 党员提出的议题转项目数
* @Date 2020/9/18 14:11
**/
List<Map<String, Integer>> selectShiftProjectCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @return java.lang.Integer
* @param customerId
* @param monthId
* @param topicIdList
* @author yinzuomei
* @description 9自建群活跃度议题转项目率
* @Date 2020/9/20 22:27
**/
Integer selectCountByPartyUser(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("list")List<String> topicIdList);
}

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java

@ -73,4 +73,24 @@ public interface FactOriginTopicLogDailyDao extends BaseDao<FactOriginTopicLogDa
* @Date 2020/9/18 15:05
**/
List<Map<String, Integer>> selectGroupTopicCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @return java.lang.Integer
* @param userId
* @param customerId
* @param monthId
* @author yinzuomei
* @description 查询当前用户在本月内评论的次数
* @Date 2020/9/20 21:46
**/
Integer selectUserCommentCount(@Param("userId") String userId, @Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @return java.util.List<java.lang.String>
* @param groupIdList
* @author yinzuomei
* @description 组内的所有话题id
* @Date 2020/9/20 22:18
**/
List<String> selectTopicIds(@Param("list") List<String> groupIdList);
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java

@ -77,4 +77,15 @@ public interface FactIndexPartyAblityOrgMonthlyDao extends BaseDao<FactIndexPart
* @date 2020/8/26 10:49 上午
*/
List<Map<String,Object>> selectPublishArticleCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level);
/**
* 根据组织类型删除数据
* @author zhaoqifeng
* @date 2020/9/20 20:52
* @param customerId
* @param monthId
* @param type
* @return java.lang.Integer
*/
Integer deleteByCustomer(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("type") String type);
}

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.java

@ -18,10 +18,13 @@
package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO;
import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 文章发布数量机关日统计表
*
@ -38,4 +41,16 @@ public interface FactArticlePublishedAgencyDailyDao extends BaseDao<FactArticleP
* @return
*/
int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* 获取组织文章数量
* @author zhaoqifeng
* @date 2020/9/20 22:46
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO>
*/
List<FactArticlePublishedAgencyDailyDTO> selectArticleCount(@Param("customerId")String customerId, @Param("monthId")String monthId,
@Param("level")String level);
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectLogDailyService.java

@ -157,6 +157,17 @@ public interface FactOriginProjectLogDailyService extends BaseService<FactOrigin
*/
List<OrgStatisticsResultDTO> getSatisfaction(String customerId, String monthId, String level);
/**
* 机关被吹哨次数
* @author zhaoqifeng
* @date 2020/9/18 14:53
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getDepTransferCount(String customerId, String monthId, String level);
/**
* @Description 查询各机关办结了多少项目
* @param customerId

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectMainDailyService.java

@ -142,4 +142,26 @@ public interface FactOriginProjectMainDailyService extends BaseService<FactOrigi
* @return void
*/
void deleteByDate(String customerId, String date);
void deleteByDate(String date);
/**
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>
* @param customerId
* @param monthId
* @author yinzuomei
* @description 党员提出的议题转项目数
* @Date 2020/9/18 14:11
**/
List<Map<String, Integer>> selectShiftProjectCount(String customerId, String monthId);
/**
* @return java.lang.Integer
* @param customerId
* @param monthId
* @param topicIdList
* @author yinzuomei
* @description 9自建群活跃度议题转项目率
* @Date 2020/9/20 22:25
**/
Integer selectCountByPartyUser(String customerId, String monthId, List<String> topicIdList);
}

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicLogDailyService.java

@ -51,4 +51,24 @@ public interface FactOriginTopicLogDailyService extends BaseService<FactOriginTo
* @Date 2020/9/18 14:33
**/
List<Map<String, Integer>> selectGroupTopicCount(String customerId, String monthId);
/**
* @return int
* @param userId
* @param customerId
* @param monthId
* @author yinzuomei
* @description
* @Date 2020/9/20 21:43
**/
Integer selectUserCommentCount(String userId,String customerId, String monthId );
/**
* @return java.util.List<java.lang.String>
* @param groupIdList
* @author yinzuomei
* @description 组内的所有话题id
* @Date 2020/9/20 22:17
**/
List<String> selectTopicIds(List<String> groupIdList);
}

30
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java

@ -61,16 +61,6 @@ public interface IssueExtractService {
**/
List<Map<String, Integer>> selectShiftIssueCount(String customerId, String monthId);
/**
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>
* @param customerId
* @param monthId
* @author yinzuomei
* @description 党员提出的议题转项目数
* @Date 2020/9/18 14:11
**/
List<Map<String, Integer>> selectShiftProjectCount(String customerId, String monthId);
/**
* @Description 查询网格 党员/群众 人均提出的议题转项目数
* @param customerId
@ -80,4 +70,24 @@ public interface IssueExtractService {
* @date 2020/9/19 2:26 下午
*/
List<ShiftProjectCountResultDTO> selectShiftProjectCountPlus(String customerId, String monthId,Integer isParty);
/**
* @return java.lang.Integer
* @param userId 用户id
* @param customerId
* @param monthId
* @author yinzuomei
* @description 查询用户在这个月内表决的总次数
* @Date 2020/9/20 21:50
**/
Integer selectCountUserVote(String userId, String customerId, String monthId);
/**
* @return java.lang.Integer
* @param topicIdList
* @author yinzuomei
* @description
* @Date 2020/9/20 22:50
**/
Integer selectIssueTotalTwoMonth(List<String> topicIdList);
}

245
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalCpcIndexServiceImpl.java

@ -4,18 +4,20 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyDao;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity;
import com.epmet.service.evaluationindex.extract.CalCpcIndexService;
import com.epmet.service.evaluationindex.extract.FactOriginTopicLogDailyService;
import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService;
import com.epmet.service.evaluationindex.extract.IssueExtractService;
import com.epmet.service.evaluationindex.extract.*;
import com.epmet.service.stats.DimCustomerPartymemberService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -39,6 +41,10 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
private FactOriginTopicLogDailyService factOriginTopicLogDailyService;
@Autowired
private IssueExtractService issueExtractService;
@Autowired
private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
@Autowired
private FactOriginGroupMainDailyDao factOriginGroupMainDailyDao;
/**
* @param customerId 客户id
@ -52,20 +58,35 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
public void calCpcPartyAbility(String customerId, String monthId) {
//1、构造初始值
List<FactIndexPartyAblityCpcMonthlyEntity> indexPartyAblityCpcList = dimCustomerPartymemberService.selectPartyMemberList(customerId);
if (CollectionUtils.isEmpty(indexPartyAblityCpcList)) {
log.info("dim_customer_partymember do not any records");
return;
}
//2、删除之前统计过的
deleteFactIndexPartyAblityCpcMonthly(customerId, monthId);
//1、党员提出话题数
Map<String, Integer> createTopicCountMap = calCreateTopicCount(customerId, monthId);
//2、党员参与话题数(支持、反对、评论、浏览)---目前只统计 党员评论话题次数之和
Map<String,Integer> joinTopicCountMap=calJoinTopicCount(customerId,monthId);
Map<String, Integer> joinTopicCountMap = calJoinTopicCount(customerId, monthId);
//3、党员提出的话题转议题数
Map<String,Integer> shiftIssueCountMap=calShiftIssueCount(customerId,monthId);
Map<String, Integer> shiftIssueCountMap = calShiftIssueCount(customerId, monthId);
//4、党员提出的议题转项目数
Map<String,Integer> shiftProjectCountMap=calShiftProjectCount(customerId,monthId);
//6、党员自建群群众人数
Map<String,Integer> groupUserCountMap=calgroupUserCount(customerId,monthId);
//8、党员自建群活跃度——话题数
Map<String,Integer> groupTopicCountMap=calGroupTopicCountMap(customerId,monthId);
Map<String, Integer> shiftProjectCountMap = calShiftProjectCount(customerId, monthId);
//5、参加“三会一课”次数 默认0
//可以先查询出每个党员的 自建群
Map<String, List<String>> userCreatedGroups = queryUserCreatedGroups(customerId, indexPartyAblityCpcList);
//6、党员自建群群众人数 (todo 和monthId无关??)
Map<String, Integer> groupUserCountMap = calgroupUserCount(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups);
//7、党员自建群活跃群众人数
Map<String, Integer> groupActiveUserCountMap = calGroupActiveUserCount(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups);
//8、党员自建群活跃度——话题数 (todo 校验sql正确性)
Map<String, Integer> groupTopicCountMap = calGroupTopicCount(customerId, monthId);
//9、自建群活跃度——议题转项目率
Map<String, BigDecimal> topicToIssueRatioMap = caltopicToIssueRatio(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups);
//3、计算实际值,更新
for (FactIndexPartyAblityCpcMonthlyEntity indexPartyAblityCpcEntity : indexPartyAblityCpcList) {
//1、党员提出话题数
@ -73,32 +94,36 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
indexPartyAblityCpcEntity.setCreateTopicCount(createTopicCountMap.get(indexPartyAblityCpcEntity.getUserId()));
}
//2、党员参与话题数(支持、反对、评论、浏览)---目前只统计 党员评论话题次数之和
if(joinTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())){
if (joinTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) {
indexPartyAblityCpcEntity.setJoinTopicCount(joinTopicCountMap.get(indexPartyAblityCpcEntity.getUserId()));
}
//3、党员提出的话题转议题数
if(shiftIssueCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())){
if (shiftIssueCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) {
indexPartyAblityCpcEntity.setShiftIssueCount(shiftIssueCountMap.get(indexPartyAblityCpcEntity.getUserId()));
}
//4、党员提出的议题转项目数
if(shiftProjectCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())){
if (shiftProjectCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) {
indexPartyAblityCpcEntity.setShiftProjectCount(shiftProjectCountMap.get(indexPartyAblityCpcEntity.getUserId()));
}
//5、参加“三会一课”次数 目前没有此业务,默认0
//6、党员自建群群众人数 TODO
if(groupUserCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())){
//6、党员自建群群众人数
if (groupUserCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) {
indexPartyAblityCpcEntity.setGroupUserCount(groupUserCountMap.get(indexPartyAblityCpcEntity.getUserId()));
}
//7、党员自建群活跃群众人数 TODO
//7、党员自建群活跃群众人数
if (groupActiveUserCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) {
indexPartyAblityCpcEntity.setGroupActiveUserCount(groupActiveUserCountMap.get(indexPartyAblityCpcEntity.getUserId()));
}
//8、党员自建群活跃度——话题数
if(groupTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())){
if (groupTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) {
indexPartyAblityCpcEntity.setGroupTopicCount(groupTopicCountMap.get(indexPartyAblityCpcEntity.getUserId()));
}
//9、自建群活跃度——议题转项目率 TODO
//9、自建群活跃度——议题转项目率
if (topicToIssueRatioMap.containsKey(indexPartyAblityCpcEntity.getUserId())) {
indexPartyAblityCpcEntity.setTopicToIssueRatio(topicToIssueRatioMap.get(indexPartyAblityCpcEntity.getUserId()));
}
}
//4、分批插入
//批量插入
//4、分批插入批量插入
List<List<FactIndexPartyAblityCpcMonthlyEntity>> partition = ListUtils.partition(indexPartyAblityCpcList, IndexCalConstant.INSERT_SIZE);
partition.forEach(list -> {
this.FactIndexPartyAblityCpcMonthlyEntity(list);
@ -106,6 +131,30 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
}
/**
* @param customerId
* @param partyMemberList
* @return java.util.Map<java.lang.String, java.util.List < java.lang.String>>
* @author yinzuomei
* @description 查询每个党员的自建群
* @Date 2020/9/20 22:07
**/
private Map<String, List<String>> queryUserCreatedGroups(String customerId, List<FactIndexPartyAblityCpcMonthlyEntity> partyMemberList) {
Map<String, List<String>> map = new HashMap<>();
for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) {
//查询当前党员建了多少个组
List<String> groupIdList = factOriginGroupMainDailyDao.selectGroupIds(customerId, partyMember.getUserId());
if (CollectionUtils.isEmpty(groupIdList)) {
map.put(partyMember.getUserId(), new ArrayList<>());
continue;
} else {
map.put(partyMember.getUserId(), groupIdList);
}
}
return map;
}
/**
* @param customerId
* @param monthId
@ -126,9 +175,9 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
}
/**
* @return java.util.Map<java.lang.String,java.lang.Integer>
* @param customerId
* @param monthId
* @return java.util.Map<java.lang.String, java.lang.Integer>
* @author yinzuomei
* @description 2查询客户下这个月内每个党员评论话题的次数
* @Date 2020/9/18 13:33
@ -146,9 +195,9 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
/**
* @return java.util.Map<java.lang.String,java.lang.Integer>
* @param customerId
* @param monthId
* @return java.util.Map<java.lang.String, java.lang.Integer>
* @author yinzuomei
* @description 3党员提出的话题转议题数
* @Date 2020/9/18 13:53
@ -165,15 +214,16 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
}
/**
* @return java.util.Map<java.lang.String,java.lang.Integer>
* @param customerId
* @param monthId
* @return java.util.Map<java.lang.String, java.lang.Integer>
* @author yinzuomei
* @description 4党员提出的议题转项目数
* @Date 2020/9/18 14:10
**/
private Map<String, Integer> calShiftProjectCount(String customerId, String monthId) {
List<Map<String, Integer>> mapList = issueExtractService.selectShiftProjectCount(customerId, monthId);
//查询fact_origin_project_main_daily 表 中议题的议题的状态为 shift_
List<Map<String, Integer>> mapList = factOriginProjectMainDailyService.selectShiftProjectCount(customerId, monthId);
Map<String, Integer> resultMap = new HashMap<>();
for (Map<String, Integer> map : mapList) {
for (Map.Entry<String, Integer> m : map.entrySet()) {
@ -184,18 +234,99 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
}
/**
* @return java.util.Map<java.lang.String,java.lang.Integer>
* @param customerId
* @param monthId
* @return java.util.Map<java.lang.String, java.lang.Integer>
* @author yinzuomei
* @description 6党员自建群群众人数
* @Date 2020/9/18 15:38
**/
private Map<String, Integer> calgroupUserCount(String customerId, String monthId) {
// TODO
return null;
private Map<String, Integer> calgroupUserCount(String customerId, String monthId,
List<FactIndexPartyAblityCpcMonthlyEntity> partyMemberList,
Map<String, List<String>> userCreatedGroups) {
/*含义评价周期内党员自建群中群众成员数
数据来源用户社群关系表
计算方法对党员i的所有j个自建群从用户社群关系表中统计属于每个自建群的群众用户总人数并对j个群众用户总数进行不重复累加
对评价结果的影响正向*/
Map<String, Integer> map = new HashMap<>();
for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) {
//查询当前党员建了多少个组
List<String> groupIdList = userCreatedGroups.get(partyMember.getUserId());
if (CollectionUtils.isEmpty(groupIdList)) {
map.put(partyMember.getUserId(), NumConstant.ZERO);
continue;
}
//去重组里面的成员
List<String> memberIdList = factOriginGroupMainDailyDao.selectGroupMemberList(groupIdList);
if (CollectionUtils.isEmpty(memberIdList)) {
map.put(partyMember.getUserId(), NumConstant.ZERO);
continue;
} else {
map.put(partyMember.getUserId(), memberIdList.size());
}
}
return map;
}
/**
* @param customerId
* @param monthId
* @param partyMemberList
* @return java.util.Map<java.lang.String, java.lang.Integer>
* @author yinzuomei
* @description 7党员自建群活跃群众人数
* @Date 2020/9/20 21:36
**/
private Map<String, Integer> calGroupActiveUserCount(String customerId, String monthId,
List<FactIndexPartyAblityCpcMonthlyEntity> partyMemberList,
Map<String, List<String>> userCreatedGroups) {
/*含义评价周期内党员自建群中活跃群众成员数所谓活跃群成员即评价周期内参与话题事件评论点赞点踩总次数大于给定阈值的群众用户
数据来源话题用户阅读表话题评论用户表态表话题评论表事件点赞点踩表事件评论点赞点踩表事件评论表用户信息表
计算方法
a)判断群中的群众成员是否活跃
for each 群众成员 i
统计i的话题阅读次数话题评论次数话题评论表态次数事件点赞点踩次数事件评论点赞点踩次数事件评论总次数
If 总次数>阈值
成员i为活跃群众成员
b)不重复累加活跃群众成员数
对评价结果的影响正向*/
//结合目前产品,数据来源:话题评论、议题表决
Map<String, Integer> map = new HashMap<>();
for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) {
int groupActiveUserCount = 0;
//1、查询当前党员建了多少个组
List<String> groupIdList = userCreatedGroups.get(partyMember.getUserId());
if (CollectionUtils.isEmpty(groupIdList)) {
map.put(partyMember.getUserId(), NumConstant.ZERO);
continue;
}
//2、去重组里面的成员
List<String> memberIdList = factOriginGroupMainDailyDao.selectGroupMemberList(groupIdList);
if (CollectionUtils.isEmpty(memberIdList)) {
map.put(partyMember.getUserId(), NumConstant.ZERO);
continue;
}
//3、判断每个成员是否 “活跃”
for (String memberId : memberIdList) {
//1、判断成员在本月内是否评论过
Integer topicCommentCount = factOriginTopicLogDailyService.selectUserCommentCount(memberId, customerId, monthId);
if (topicCommentCount > 0) {
groupActiveUserCount++;
continue;
}
//2、判断成员在本月内是否表决过(支持or反对)议题
Integer voteCount = issueExtractService.selectCountUserVote(memberId, customerId, monthId);
if (voteCount > 0) {
groupActiveUserCount++;
}
}
//赋值每个党员的 -- 党员自建群活跃群众人数
map.put(partyMember.getUserId(), groupActiveUserCount);
}
return map;
}
/**
* @param customerId
* @param monthId
@ -204,7 +335,11 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
* @description 8党员自建群活跃度话题数
* @Date 2020/9/18 14:31
**/
private Map<String, Integer> calGroupTopicCountMap(String customerId, String monthId) {
private Map<String, Integer> calGroupTopicCount(String customerId, String monthId) {
/*含义评价周期内党员自建群中话题发布数
数据来源话题表
计算方法从话题表中统计党员自建群i的话题总数对所有自建群话题数累加
对评价结果的影响正向*/
List<Map<String, Integer>> mapList = factOriginTopicLogDailyService.selectGroupTopicCount(customerId, monthId);
Map<String, Integer> resultMap = new HashMap<>();
for (Map<String, Integer> map : mapList) {
@ -215,6 +350,54 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
return resultMap;
}
/**
* @param userCreatedGroups 党员自建群
* @return java.util.Map<java.lang.String, java.math.BigDecimal>
* @author yinzuomei
* @description 9自建群活跃度议题转项目率
* @Date 2020/9/20 22:11
**/
private Map<String, BigDecimal> caltopicToIssueRatio(String customerId,
String monthId,
List<FactIndexPartyAblityCpcMonthlyEntity> partyMemberList,
Map<String, List<String>> userCreatedGroups) {
Map<String, BigDecimal> map = new HashMap<>();
for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) {
//如果党员自建群为空,直接赋值0
if (CollectionUtils.isEmpty(userCreatedGroups.get(partyMember.getUserId()))) {
map.put(partyMember.getUserId(), BigDecimal.ZERO);
continue;
}
//自建群出来的话题
List<String> groupIdList = userCreatedGroups.get(partyMember.getUserId());
List<String> topicIdList = factOriginTopicLogDailyService.selectTopicIds(groupIdList);
if (CollectionUtils.isEmpty(topicIdList)) {
map.put(partyMember.getUserId(), BigDecimal.ZERO);
continue;
}
//分子
//本月内新增的项目(and 源于自建群中的话题)
Integer projectTotal = factOriginProjectMainDailyService.selectCountByPartyUser(customerId, monthId, topicIdList);
if (null == projectTotal || projectTotal == NumConstant.ZERO) {
map.put(partyMember.getUserId(), BigDecimal.ZERO);
continue;
}
//分母
//本评价周期+上一个评价周期内自建群中的议题数
Integer issueTotal = issueExtractService.selectIssueTotalTwoMonth(topicIdList);
if (null == issueTotal || issueTotal == NumConstant.ZERO) {
map.put(partyMember.getUserId(), BigDecimal.ZERO);
continue;
}
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(6);
String topicToIssueRatioStr = numberFormat.format((float) projectTotal / issueTotal);
BigDecimal topicToIssueRatio = new BigDecimal(topicToIssueRatioStr);
map.put(partyMember.getUserId(), topicToIssueRatio);
}
return map;
}
/**
* @param customerId
* @param monthId

37
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java

@ -6,7 +6,6 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.ExtractConstant;
import com.epmet.constant.ProjectEvaluateConstant;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDao;
import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO;
import com.epmet.dto.extract.form.GridIssueCountResultDTO;
import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO;
@ -200,7 +199,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
autoSelf.set(false);
}
});
if (autoSelf.get() == true){
if (autoSelf.get()) {
count.getAndSet(count.get() + NumConstant.ONE);
}
});
@ -231,7 +230,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
Map<String, List<ProjectEvaluateResultDTO>> groupByProject = projectEvaluateInfoList.stream().collect(Collectors.groupingBy(ProjectEvaluateResultDTO::getProjectId));
groupByProject.forEach((projectId,projectList) -> {
projectList.forEach(project -> {
switch (project.getActionCode()){
switch (project.getActionCode()) {
case ExtractConstant.EVALUATE_BAD:
project.setScore(ProjectEvaluateConstant.BAD);
break;
@ -241,9 +240,11 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
case ExtractConstant.EVALUATE_PERFECT:
project.setScore(ProjectEvaluateConstant.PERFECT);
break;
default:
log.warn("calGridIndexGovernAbility orther projectEvaluate,actionCode:{}", project.getActionCode());
}
});
Integer projectAllScore = projectList.stream().collect(Collectors.summingInt(ProjectEvaluateResultDTO::getScore));
Integer projectAllScore = projectList.stream().mapToInt(ProjectEvaluateResultDTO::getScore).sum();
scoreMap.put(projectId,projectAllScore/projectList.size());
});
AtomicReference<Integer> allScore = new AtomicReference<>(0);
@ -285,29 +286,25 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
});
}
// 4. 网格吹哨部门准确率
if (!CollectionUtils.isEmpty(notReturnProjectList)){
if (!CollectionUtils.isEmpty(notReturnProjectList)) {
notReturnProjectList.forEach(not -> {
if (r.getGridId().equals(not.getGridId())){
if (r.getGridId().equals(not.getGridId())) {
r.setTransferRightRatio(not.getTransferRightRatio());
}
});
}
// 5. 网格内解决的项目的满意度
if (null != resultSatisfactionScore){
resultSatisfactionScore.forEach((k,v) -> {
if (r.getGridId().equals(k)){
r.setSatisfactionRatio(v);
}
});
}
resultSatisfactionScore.forEach((k, v) -> {
if (r.getGridId().equals(k)) {
r.setSatisfactionRatio(v);
}
});
// 6. 网格自治项目数
if (null != autoMap){
autoMap.forEach((k,v) -> {
if (r.getGridId().equals(k)){
r.setSelfSolveProjectCount(v);
}
});
}
autoMap.forEach((k, v) -> {
if (r.getGridId().equals(k)) {
r.setSelfSolveProjectCount(v);
}
});
});
delAndInsertGovernAbility(result,customerId,monthId);
return true;

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectLogDailyServiceImpl.java

@ -156,6 +156,11 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr
return baseDao.selectSatisfaction(customerId, monthId, level);
}
@Override
public List<OrgStatisticsResultDTO> getDepTransferCount(String customerId, String monthId, String level) {
return baseDao.selectDepTransferCount(customerId, monthId, level);
}
/**
* @Description 查询各项目经受了多少机关
* @param customerId

37
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectMainDailyServiceImpl.java

@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectMainDailyDao;
@ -32,7 +33,9 @@ import com.epmet.service.evaluationindex.extract.FactOriginProjectMainDailyServi
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -131,4 +134,38 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
baseDao.deleteByDate(customerId, date);
}
/**
* @param customerId
* @param monthId
* @return java.util.List<java.util.Map < java.lang.String, java.lang.Integer>>
* @author yinzuomei
* @description 党员提出的议题转项目数
* @Date 2020/9/18 14:11
**/
@Override
public List<Map<String, Integer>> selectShiftProjectCount(String customerId, String monthId) {
//查询项目主表fact_origin_project_main_daily,这个月内新增的项目,按话题发布人分组
/*含义评价周期内党员提出的议题转数目数
数据来源项目表
计算方法从项目表中按照用户ID和党员标识统计
对评价结果的影响正向*/
return baseDao.selectShiftProjectCount(customerId,monthId);
}
/**
* @param customerId
* @param monthId
* @param topicIdList
* @return java.lang.Integer
* @author yinzuomei
* @description 9自建群活跃度议题转项目率
* @Date 2020/9/20 22:25
**/
@Override
public Integer selectCountByPartyUser(String customerId, String monthId, List<String> topicIdList) {
if(CollectionUtils.isEmpty(topicIdList)){
return NumConstant.ZERO;
}
return baseDao.selectCountByPartyUser(customerId,monthId,topicIdList);
}
}

32
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicLogDailyServiceImpl.java

@ -24,7 +24,9 @@ import com.epmet.dao.evaluationindex.extract.FactOriginTopicLogDailyDao;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity;
import com.epmet.service.evaluationindex.extract.FactOriginTopicLogDailyService;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -49,6 +51,7 @@ public class FactOriginTopicLogDailyServiceImpl extends BaseServiceImpl<FactOrig
**/
@Override
public List<Map<String, Integer>> selectJoinTopicCount(String customerId, String monthId) {
//这个月内新增的话题评论,按人分组,不限制评论时的身份,以当前用户最新身份为准
return baseDao.selectJoinTopicCount(customerId,monthId);
}
@ -64,4 +67,33 @@ public class FactOriginTopicLogDailyServiceImpl extends BaseServiceImpl<FactOrig
public List<Map<String, Integer>> selectGroupTopicCount(String customerId, String monthId) {
return baseDao.selectGroupTopicCount(customerId,monthId);
}
/**
* @return java.lang.Integer
* @param userId
* @param customerId
* @param monthId
* @author yinzuomei
* @description 查询当前用户在本月内评论的次数
* @Date 2020/9/20 21:45
**/
@Override
public Integer selectUserCommentCount(String userId,String customerId, String monthId) {
return baseDao.selectUserCommentCount(userId,customerId,monthId);
}
/**
* @param groupIdList
* @return java.util.List<java.lang.String>
* @author yinzuomei
* @description 组内的所有话题id
* @Date 2020/9/20 22:17
**/
@Override
public List<String> selectTopicIds(List<String> groupIdList) {
if(CollectionUtils.isEmpty(groupIdList)){
return new ArrayList<>();
}
return baseDao.selectTopicIds(groupIdList);
}
}

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java

@ -238,6 +238,7 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
**/
@Override
public List<Map<String, Integer>> selectPartyCreateTopicCount(String customerId, String monthId) {
//这个月内新增的话题,按人分组,不限制发话题人的身份,也就是说以用户最新的身份为准
return baseDao.selectPartyCreateTopicCount(customerId,monthId);
}

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java

@ -1,23 +1,20 @@
package com.epmet.service.evaluationindex.extract.impl;
import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao;
import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO;
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO;
import com.epmet.dto.stats.result.GridAttributesResultDTO;
import com.epmet.service.evaluationindex.extract.GroupExtractService;
import com.epmet.service.group.GroupDataService;
import com.epmet.service.stats.DimAgencyService;
import com.epmet.service.stats.DimGridService;
import com.epmet.service.user.UserService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -31,8 +28,6 @@ import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.List;
/**
* @Description 业务数据抽取 - 组相关
* @ClassName GroupExtractServiceImpl
@ -78,14 +73,14 @@ public class GroupExtractServiceImpl implements GroupExtractService {
int count = factOriginGroupMainDailyDao.selectIfExist(param.getCustomerId());
if(StringUtils.isBlank(param.getDateId())){
Date yesterday = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24);
Date yesterday = DateUtils.addDateDays(new Date(), -1);
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
param.setDateId(format.format(yesterday));
}
//原生数据,如果是首次,则为全部组,如果非首次,则只有新创建以及新进人的组
//但是每个组每天都要更新一次组长的身份信息
List<FactOriginGroupMainDailyDTO> originGroupData = groupDataService.extractGroupData(
count <= NumConstant.ZERO ? true : false,
count <= NumConstant.ZERO,
param.getCustomerId(), param.getDateId());
List<ExtractGroupMemberActionRecordResultDTO> memberList = new LinkedList<>();
@ -137,7 +132,6 @@ public class GroupExtractServiceImpl implements GroupExtractService {
factOriginGroupMainDailyDao.deleteBatchByGroupId(param.getCustomerId(),originGroupData.stream().map(FactOriginGroupMainDailyDTO :: getId).distinct().collect(Collectors.toList()));
factOriginGroupMainDailyDao.insertBatchMembers(memberList);
}
}

44
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java

@ -278,22 +278,14 @@ public class IssueExtractServiceImpl implements IssueExtractService {
@DataSource(DataSourceConstant.STATS)
@Override
public List<Map<String, Integer>> selectShiftIssueCount(String customerId, String monthId) {
//查询fact_origin_issue_main_daily 表,转议题的时间在评价周期内的,按发布话题的人分组
/*含义评价周期内党员提出的话题转为议题的数目
数据来源议题表
计算方法从议题表中按照用户ID和党员标识统计
对评价结果的影响正向*/
return issueMainDailyDao.selectShiftIssueCount(customerId,monthId);
}
/**
* @param customerId
* @param monthId
* @return java.util.List<java.util.Map < java.lang.String, java.lang.Integer>>
* @author yinzuomei
* @description 党员提出的议题转项目数
* @Date 2020/9/18 14:11
**/
@Override
public List<Map<String, Integer>> selectShiftProjectCount(String customerId, String monthId) {
return issueMainDailyDao.selectShiftProjectCount(customerId,monthId);
}
/**
* @Description 查询网格 党员/群众 人均提出的议题转项目数
* @param customerId
@ -306,4 +298,30 @@ public class IssueExtractServiceImpl implements IssueExtractService {
public List<ShiftProjectCountResultDTO> selectShiftProjectCountPlus(String customerId, String monthId, Integer isParty) {
return issueMainDailyDao.selectShiftProjectCountPlus(customerId, monthId, isParty);
}
/**
* @param userId 用户id
* @param customerId
* @param monthId
* @return java.lang.Integer
* @author yinzuomei
* @description 查询用户在这个月内表决的总次数
* @Date 2020/9/20 21:50
**/
@Override
public Integer selectCountUserVote(String userId, String customerId, String monthId) {
return issueLogDailyDao.selectCountUserVote(userId,customerId,monthId);
}
/**
* @param topicIdList
* @return java.lang.Integer
* @author yinzuomei
* @description 查询本周期和上周期内自建群内话题转为议题的数量的总和
* @Date 2020/9/20 22:48
**/
@Override
public Integer selectIssueTotalTwoMonth(List<String> topicIdList) {
return issueMainDailyDao.selectIssueTotalTwoMonth(topicIdList);
}
}

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyService.java

@ -0,0 +1,22 @@
package com.epmet.service.evaluationindex.indexcoll;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/20 23:00
*/
public interface FactIndexPartyAblityOrgMonthlyService extends BaseService<FactIndexPartyAblityOrgMonthlyEntity> {
/**
* 根据客户清空数据
* @author zhaoqifeng
* @date 2020/9/20 20:33
* @param customerId
* @param monthId
* @param type
* @return void
*/
void deleteByCustomer(String customerId, String monthId, String type);
}

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollCommunityService.java

@ -8,7 +8,7 @@ package com.epmet.service.evaluationindex.indexcoll;
*/
public interface IndexCollCommunityService {
/**
* 社区治理能力统计
* 社区能力统计
*
* @author zhaoqifeng
* @date 2020/9/18 13:52
@ -18,14 +18,4 @@ public interface IndexCollCommunityService {
*/
void saveCommunityAbility(String customerId, String dateId);
/**
* 社区党建能力统计
*
* @author zhaoqifeng
* @date 2020/9/18 13:52
* @param customerId
* @param dateId
* @return void
*/
void saveCommunityPartyAbility(String customerId, String dateId);
}

23
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityOrgMonthlyServiceImpl.java

@ -0,0 +1,23 @@
package com.epmet.service.evaluationindex.indexcoll.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity;
import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService;
import org.springframework.stereotype.Service;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/20 23:01
*/
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class FactIndexPartyAblityOrgMonthlyServiceImpl extends BaseServiceImpl<FactIndexPartyAblityOrgMonthlyDao, FactIndexPartyAblityOrgMonthlyEntity> implements FactIndexPartyAblityOrgMonthlyService {
@Override
public void deleteByCustomer(String customerId, String monthId, String type) {
baseDao.deleteByCustomer(customerId, monthId, type);
}
}

47
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollCommunityServiceImpl.java

@ -6,15 +6,18 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity;
import com.epmet.service.evaluationindex.extract.FactOriginProjectLogDailyService;
import com.epmet.service.evaluationindex.extract.FactOriginProjectMainDailyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.IndexCollCommunityService;
import com.epmet.service.stats.DimAgencyService;
import com.epmet.service.stats.FactArticlePublishedAgencyDailyService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -45,6 +48,10 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService
private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao;
@Autowired
private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
@Autowired
private FactArticlePublishedAgencyDailyService factArticlePublishedAgencyDailyService;
@Autowired
private FactIndexPartyAblityOrgMonthlyService factIndexPartyAblityOrgMonthlyService;
@Override
public void saveCommunityAbility(String customerId, String dateId) {
@ -65,15 +72,15 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService
entity.setMonthId(dimId.getMonthId());
entity.setDataType(OrgTypeConstant.COMMUNITY);
entity.setTransferedCount(NumConstant.ZERO);
entity.setClosedProjectCount(NumConstant.ZERO);
entity.setRespProjectRatio(new BigDecimal(NumConstant.ZERO));
entity.setOverdueProjectRatio(new BigDecimal(NumConstant.ZERO));
entity.setClosedProjectRatio(new BigDecimal(NumConstant.ZERO));
entity.setSatisfactionRatio(new BigDecimal(NumConstant.ZERO));
entity.setClosedProjectCount(NumConstant.ZERO);
entity.setHandleProjectRatio(new BigDecimal(NumConstant.ZERO));
return entity;
}).collect(Collectors.toList());
//1.治理能力
//被吹哨次数统计
List<OrgStatisticsResultDTO> transferCount = factOriginProjectLogDailyService.getAgencyTransferCount(customerId, dimId.getMonthId(),
OrgTypeConstant.COMMUNITY);
@ -119,18 +126,34 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService
}
}));
}
factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY);
factIndexGovrnAblityOrgMonthlyService.insertBatch(list);
}
@Override
public void saveCommunityPartyAbility(String customerId, String dateId) {
//当前日期前一天
Date date = DateUtils.getBeforeDay(DateUtils.stringToDate(dateId, DateUtils.DATE_PATTERN_YYYYMMDD));
//获取日期相关维度
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date);
//获取社区列表
List<DimAgencyDTO>agencyList = dimAgencyService.getAgencyByLevel(customerId, OrgTypeConstant.COMMUNITY);
//2.党建能力
//获取社区发文数量
List<FactArticlePublishedAgencyDailyDTO> articles = factArticlePublishedAgencyDailyService.getArticleCount(customerId, dimId.getMonthId(),
OrgTypeConstant.COMMUNITY);
List<FactIndexPartyAblityOrgMonthlyEntity> partyList = agencyList.stream().map(agency ->{
FactIndexPartyAblityOrgMonthlyEntity entity = new FactIndexPartyAblityOrgMonthlyEntity();
entity.setCustomerId(customerId);
entity.setAgencyId(agency.getId());
entity.setParentId(agency.getPid());
entity.setYearId(dimId.getYearId());
entity.setQuarterId(dimId.getQuarterId());
entity.setMonthId(dimId.getMonthId());
entity.setDataType(OrgTypeConstant.COMMUNITY);
entity.setPublishArticleCount(NumConstant.ZERO);
return entity;
}).collect(Collectors.toList());
if (null != articles && !articles.isEmpty()) {
partyList.forEach(entity -> articles.stream().filter(article -> entity.getAgencyId().equals(article.getAgencyId())).forEach(dto -> {
entity.setPublishArticleCount(dto.getArticleTotalCount());
}));
}
factIndexPartyAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY);
factIndexPartyAblityOrgMonthlyService.insertBatch(partyList);
}
}

34
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollStreetServiceImpl.java

@ -8,12 +8,16 @@ import com.epmet.constant.OrgTypeConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity;
import com.epmet.service.evaluationindex.extract.FactOriginProjectLogDailyService;
import com.epmet.service.evaluationindex.extract.FactOriginProjectMainDailyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.IndexCollStreetService;
import com.epmet.service.stats.DimAgencyService;
import com.epmet.service.stats.FactArticlePublishedAgencyDailyService;
import com.epmet.util.DimIdGenerator;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
@ -46,6 +50,11 @@ public class IndexCollStreetServiceImpl implements IndexCollStreetService {
private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao;
@Autowired
private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
@Autowired
private FactArticlePublishedAgencyDailyService factArticlePublishedAgencyDailyService;
@Autowired
private FactIndexPartyAblityOrgMonthlyService factIndexPartyAblityOrgMonthlyService;
@Override
public void saveStreetAbility(String customerId, String dateId) {
//当前日期前一天
@ -126,5 +135,30 @@ public class IndexCollStreetServiceImpl implements IndexCollStreetService {
factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.STREET);
factIndexGovrnAblityOrgMonthlyService.insertBatch(list);
//2.党建能力
//获取社区发文数量
List<FactArticlePublishedAgencyDailyDTO> articles = factArticlePublishedAgencyDailyService.getArticleCount(customerId, dimId.getMonthId(),
OrgTypeConstant.STREET);
List<FactIndexPartyAblityOrgMonthlyEntity> partyList = agencyList.stream().map(agency ->{
FactIndexPartyAblityOrgMonthlyEntity entity = new FactIndexPartyAblityOrgMonthlyEntity();
entity.setCustomerId(customerId);
entity.setAgencyId(agency.getId());
entity.setParentId(agency.getPid());
entity.setYearId(dimId.getYearId());
entity.setQuarterId(dimId.getQuarterId());
entity.setMonthId(dimId.getMonthId());
entity.setDataType(OrgTypeConstant.COMMUNITY);
entity.setPublishArticleCount(NumConstant.ZERO);
return entity;
}).collect(Collectors.toList());
if (null != articles && !articles.isEmpty()) {
partyList.forEach(entity -> articles.stream().filter(article -> entity.getAgencyId().equals(article.getAgencyId())).forEach(dto -> {
entity.setPublishArticleCount(dto.getArticleTotalCount());
}));
}
factIndexPartyAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.STREET);
factIndexPartyAblityOrgMonthlyService.insertBatch(partyList);
}
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedAgencyDailyService.java

@ -18,9 +18,11 @@
package com.epmet.service.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO;
import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity;
import java.util.Collection;
import java.util.List;
/**
* 文章发布数量机关日统计表
@ -42,4 +44,15 @@ public interface FactArticlePublishedAgencyDailyService extends BaseService<Fact
*/
boolean deleteAndInsertBatch(String customerId, String dateId, Collection<FactArticlePublishedAgencyDailyEntity> values);
/**
* 获取组织文章数量
* @author zhaoqifeng
* @date 2020/9/20 22:49
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO>
*/
List<FactArticlePublishedAgencyDailyDTO> getArticleCount(String customerId, String monthId, String level);
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java

@ -22,6 +22,7 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.stats.FactArticlePublishedAgencyDailyDao;
import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO;
import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity;
import com.epmet.service.stats.FactArticlePublishedAgencyDailyService;
import lombok.extern.slf4j.Slf4j;
@ -30,6 +31,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.Collection;
import java.util.List;
/**
* 文章发布数量机关日统计表
@ -55,4 +57,11 @@ public class FactArticlePublishedAgencyDailyServiceImpl extends BaseServiceImpl<
this.insertBatch(values, 100);
return true;
}
@Override
public List<FactArticlePublishedAgencyDailyDTO> getArticleCount(String customerId, String monthId, String level) {
return baseDao.selectArticleCount(customerId, monthId, level);
}
}

23
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml

@ -17,6 +17,16 @@
GROUP BY GRID_ID
</select>
<!-- 查询当前用户建的所有群id -->
<select id="selectGroupIds" parameterType="map" resultType="java.lang.String">
SELECT
t1.id AS groupId
FROM
fact_origin_group_main_daily t1
WHERE t1.DEL_FLAG='0'
and t1.CUSTOMER_ID = #{customerId}
AND t1.GROUP_OWNER_ID = #{groupOwnerId}
</select>
<select id="selectIfExist" resultType="int">
SELECT COUNT(*)
@ -199,4 +209,17 @@
)
</foreach>
</insert>
<!-- 查询组成员数(去重) -->
<select id="selectGroupMemberList" parameterType="map" resultType="java.lang.String">
SELECT DISTINCT
MEMBER_ID AS userId
FROM
fact_origin_group_member_daily m
WHERE
m.DEL_FLAG = '0'
AND
<foreach collection="list" item="groupId" separator="or" open="(" close=")">
m.GROUP_ID =#{groupId}
</foreach>
</select>
</mapper>

16
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml

@ -62,4 +62,20 @@
CUSTOMER_ID = #{customerId}
AND DATE_ID = #{dateId}
</delete>
<!-- 查询用户在这个月内表决的总次数 -->
<select id="selectCountUserVote" parameterType="map" resultType="java.lang.Integer">
SELECT
COUNT( 1 ) AS TOTAL
FROM
fact_origin_issue_log_daily T1
WHERE
T1.DEL_FLAG = '0'
AND T1.CUSTOMER_ID = #{customerId}
AND T1.MONTH_ID = #{monthId}
AND T1.OPERATION_USER_ID = #{userId}
AND (
T1.ACTION_CODE = 'vote_support'
OR T1.ACTION_CODE = 'vote_opposition')
</select>
</mapper>

42
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml

@ -111,27 +111,12 @@
-- AND t1.TOPIC_USER_IS_PARTY = '1'
AND t1.CUSTOMER_ID = #{customerId}
AND t1.MONTH_ID = #{monthId}
AND ISNULL(T1.CREATE_TOPIC_USER_ID)=0
AND LENGTH(trim(T1.CREATE_TOPIC_USER_ID))>0
GROUP BY
T1.CREATE_TOPIC_USER_ID
</select>
<!-- 党员提出的议题转项目数 -->
<select id="selectShiftProjectCount" parameterType="map" resultType="java.util.Map">
SELECT
t1.CREATE_TOPIC_USER_ID AS USER_ID,
COUNT( 1 ) AS SHIFT_PROJECT_COUNT
FROM
fact_origin_issue_main_daily t1
WHERE
t1.DEL_FLAG = '0'
-- AND t1.TOPIC_USER_IS_PARTY = '1'
AND T1.ISSUE_STATUS='shift_project'
AND t1.CUSTOMER_ID = #{customerId}
AND t1.MONTH_ID = #{monthId}
GROUP BY
T1.CREATE_TOPIC_USER_ID
</select>
<!-- 查询网格 党员/群众 人均提出的议题转项目数 -->
<select id="selectShiftProjectCountPlus" resultType="com.epmet.dto.extract.result.ShiftProjectCountResultDTO">
SELECT
@ -145,4 +130,27 @@
AND IS_PARTY = #{isParty}
GROUP BY GRID_ID
</select>
<!-- 查询本周期和上周期内,自建群内话题转为议题的数量的总和 -->
<select id="selectIssueTotalTwoMonth" parameterType="map" resultType="java.lang.Integer">
select sum(t.total) as totalIssue
from (
SELECT
t1.MONTH_ID,
count( 1 ) as total
FROM
fact_origin_issue_main_daily t1
WHERE
t1.DEL_FLAG = '0'
AND
<foreach collection="list" item="topicId" separator="or" open="(" close=")">
t1.TOPIC_ID =#{topicId}
</foreach>
GROUP BY
MONTH_ID
ORDER BY
t1.MONTH_ID DESC
LIMIT 2
)t
</select>
</mapper>

21
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml

@ -115,6 +115,27 @@
) b ON a.ID = b.PROJECT_ID
GROUP BY AGENCY_ID
</select>
<select id="selectDepTransferCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
fopld.CUSTOMER_ID,
fopld.AGENCY_ID,
fopld.ORG_ID,
COUNT( fopld.ID ) AS "count"
FROM
fact_origin_project_log_daily fopld
INNER JOIN dim_agency da ON fopld.AGENCY_ID = da.ID
AND da.`LEVEL` = #{level}
WHERE
fopld.IS_ACTIVE = 0
AND fopld.ACTION_CODE = 'transfer'
AND fopld.MONTH_ID = #{monthId}
AND fopld.CUSTOMER_ID = #{customerId}
AND fopld.ORG_TYPE = "department"
GROUP BY
fopld.CUSTOMER_ID,
fopld.AGENCY_ID,
fopld.ORG_ID
</select>
<select id="selectProjectParticipatedAgency" resultType="com.epmet.dto.extract.result.ProjectParticipatedAgencyResultDTO">

31
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml

@ -112,4 +112,35 @@
</if>
</delete>
<!-- 党员提出的议题转项目数 -->
<select id="selectShiftProjectCount" parameterType="map" resultType="java.util.Map">
SELECT
t1.TOPIC_CREATOR_ID AS USER_ID,
COUNT( 1 ) AS SHIFT_PROJECT_COUNT
FROM
fact_origin_project_main_daily t1
WHERE
t1.DEL_FLAG = '0'
AND t1.CUSTOMER_ID = #{customerId}
AND t1.MONTH_ID = #{monthId}
AND ISNULL(T1.TOPIC_CREATOR_ID)=0
AND LENGTH(trim(T1.TOPIC_CREATOR_ID))>0
GROUP BY
T1.TOPIC_CREATOR_ID
</select>
<select id="selectCountByPartyUser" parameterType="map" resultType="java.lang.Integer">
SELECT
COUNT( 1 ) AS TOTAL
FROM
fact_origin_project_main_daily T1
WHERE
T1.DEL_FLAG = '0'
AND T1.CUSTOMER_ID = #{customerId}
AND T1.MONTH_ID = #{monthId}
AND
<foreach collection="list" item="topicId" separator="or" open="(" close=")">
T1.TOPIC_ID =#{topicId}
</foreach>
</select>
</mapper>

28
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml

@ -100,4 +100,32 @@
and t1.MONTH_ID=#{monthId}
group by t2.USER_ID
</select>
<!-- 查询当前用户在本月内评论的次数 -->
<select id="selectUserCommentCount" parameterType="map" resultType="java.lang.Integer">
SELECT
COUNT( 1 ) AS TOTAL
FROM
fact_origin_topic_main_daily T1
WHERE
T1.DEL_FLAG = '0'
AND T1.CUSTOMER_ID = #{customerId}
AND T1.MONTH_ID = #{monthId}
AND T1.OPERATE_USER_ID = #{userId}
</select>
<!-- 组内的所有话题id -->
<select id="selectTopicIds" parameterType="map" resultType="java.lang.String">
SELECT
T1.TOPIC_ID
FROM
fact_origin_topic_log_daily T1
WHERE
T1.DEL_FLAG = '0'
AND
<foreach collection="list" item="groupId" separator="or" open="(" close=")">
T1.GROUP_ID =#{groupId}
</foreach>
</select>
</mapper>

6
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml

@ -27,6 +27,12 @@
AND MONTH_ID = #{monthId}
limit 1000;
</delete>
<delete id="deleteByCustomer">
delete from fact_index_party_ablity_org_monthly
where CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
AND DATA_TYPE = #{type}
</delete>
<insert id="batchInsertFactIndexPartyAblityOrgMonthly" parameterType="map">
insert into fact_index_party_ablity_org_monthly

12
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml

@ -25,6 +25,18 @@
<delete id="deleteByDateId">
DELETE FROM fact_article_published_agency_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR}
</delete>
<select id="selectArticleCount" resultType="com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO">
SELECT
f.AGENCY_ID,
MAX(f.ARTICLE_TOTAL_COUNT) AS "articleTotalCount"
FROM
fact_article_published_agency_daily f
INNER JOIN dim_agency da ON da.CUSTOMER_ID = #{customerId}
AND da.`LEVEL` = #{level}
WHERE
f.MONTH_ID = #{monthId}
GROUP BY f.AGENCY_ID
</select>
</mapper>
Loading…
Cancel
Save