Browse Source

Merge branch 'dev_screen_data_2.0' into dev_temp

master
sunyuchao 5 years ago
parent
commit
a0ce239d42
  1. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java
  2. 30
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridGroupUserCountResultDTO.java
  3. 68
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteStatisticalResultDTO.java
  4. 26
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteUserCountResultDTO.java
  5. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  6. 69
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java
  7. 46
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java
  8. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java
  9. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java
  10. 229
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java
  11. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPublicPartiTotalDataEntity.java
  12. 37
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java
  13. 30
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java
  14. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java
  15. 28
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java
  16. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java
  17. 53
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java
  18. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java
  19. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PublicPartiTotalDataExtractService.java
  20. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java
  21. 49
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java
  22. 68
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartiTotalDataExtractServiceImpl.java
  23. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPublicPartiTotalDataService.java
  24. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserTotalDataService.java
  25. 34
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPublicPartiTotalDataServiceImpl.java
  26. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserTotalDataServiceImpl.java
  27. 15
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml
  28. 35
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml
  29. 47
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPublicPartiTotalDataDao.xml
  30. 8
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml

3
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java

@ -270,6 +270,9 @@ public class IndexServiceImpl implements IndexService {
//screen_index_data_monthly 根据组织id和月份获取月度指标得分
//1.根据组织或网格Id以及月份Id查询各项月度指数得分
IndexScoreResultDTO resultDTO = screenIndexDataMonthlyDao.selectMonthData(formDTO);
if (null == resultDTO) {
return resultDTO;
}
//2.将数据改成正确格式 四舍五入保留一位小数 权重转成百分比
NumberFormat nf = NumberFormat.getPercentInstance();

30
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridGroupUserCountResultDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* desc: 网格级别小组内的组成员数
*
* @author LiuJanJun
* @date 2020/9/27 2:27 下午
*/
@Data
public class GridGroupUserCountResultDTO implements Serializable {
private static final long serialVersionUID = -4729061928990808187L;
/**
* 客户ID
*/
private String customerId;
private String gridId;
private Integer memberCount;
/**
* 网格的pids
*/
private String pids;
}

68
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteStatisticalResultDTO.java

@ -0,0 +1,68 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* desc: 议题投票统计结果DTO
*
* @author LiuJanJun
* @date 2020/9/27 11:22 上午
*/
@Data
public class IssueVoteStatisticalResultDTO implements Serializable {
private static final long serialVersionUID = 2631108929053690349L;
/**
* 主键ID
*/
private String id;
/**
* 议题ID
*/
private String issueId;
/**
* 统计日期 yyyy-MM-dd
*/
private Date statisticalDate;
/**
* 到该日的总赞成数
*/
private Integer supportCount;
/**
* 到该日的总反对数
*/
private Integer oppositionCount;
/**
* 到该日的总票数
*/
private Integer totalCount;
/**
* 该日增量
*/
private Integer todayIncrement;
/**
* 该日赞成增量
*/
private Integer supportIncrement;
/**
* 该日反对增量
*/
private Integer oppositionIncrement;
/**
* 到该日的应表决数
*/
private Integer votableCount;
}

26
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteUserCountResultDTO.java

@ -0,0 +1,26 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* desc: 议题投票人数
*
* @author LiuJanJun
* @date 2020/9/27 2:27 下午
*/
@Data
public class IssueVoteUserCountResultDTO implements Serializable {
private static final long serialVersionUID = -4729061928990808187L;
private String gridId;
private String issueId;
private Integer voteCount;
private Integer issueCount;
/**
* 网格的pids
*/
private String pids;
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java

@ -673,7 +673,8 @@ public class DemoController {
@Autowired
private PioneerDataExtractService pioneerDataExtractService;
@Autowired
private PublicPartiTotalDataExtractService publicPartiTotalDataExtractService;
@PostMapping("insertScreenPioneerData")
public Result insertScreenPioneerData(@RequestParam("customerId") String customerId, @RequestParam("dateId") String dateId) {
if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) {
@ -692,6 +693,11 @@ public class DemoController {
return new Result();
}
@PostMapping("extractPublicPartiTotalData")
public Result extractPublicPartiTotalData(@RequestParam("customerId") String customerId, @RequestParam("dateId") String dateId){
publicPartiTotalDataExtractService.extractPublicPartiTotalData(customerId,dateId);
return new Result();
}
}

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

@ -18,16 +18,16 @@
package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.GridGroupUserCountResultDTO;
import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO;
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
@ -40,86 +40,87 @@ import java.util.List;
public interface FactOriginGroupMainDailyDao extends BaseDao<FactOriginGroupMainDailyEntity> {
/**
* @Description 查询建群党员数
* @param customerId
* @param monthId
* @Description 查询建群党员数
* @author zxc
* @date 2020/9/19 3:49 下午
*/
List<PartyCreateGroupCountResultDTO> selectPartyCreateGroupCount(@Param("customerId") String customerId,@Param("monthId") String monthId);
List<PartyCreateGroupCountResultDTO> selectPartyCreateGroupCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @Description 查询是否存在该客户下的数据
* @param customerId
* @return
* @Description 查询是否存在该客户下的数据
* @author wangc
* @date 2020.09.18 23:30
**/
int selectIfExist(@Param("customerId")String customerId);
**/
int selectIfExist(@Param("customerId") String customerId);
/**
* @Description 按照客户Id清除组数据
* @param customerId
* @return
* @Description 按照客户Id清除组数据
* @author wangc
* @date 2020.09.20 09:58
**/
void deleteBatchByCustomerId(@Param("customerId")String customerId);
**/
void deleteBatchByCustomerId(@Param("customerId") String customerId);
/**
* @Description 按照客户Id清除组员数据
* @param customerId
* @return
* @Description 按照客户Id清除组员数据
* @author wangc
* @date 2020.09.20 09:58
**/
void deleteBatchMemberByCustomerId(@Param("customerId")String customerId,@Param("dimId") String dimId,@Param("dateType") String dateType);
void deleteBatchMemberByCustomerId(@Param("customerId") String customerId, @Param("dimId") String dimId, @Param("dateType") String dateType);
/**
* @Description 按照组Id清除组和组员数据
* @param customerId
* @return
* @Description 按照组Id清除组和组员数据
* @author wangc
* @date 2020.09.20 12:16
**/
void deleteBatchByGroupId(@Param("customerId")String customerId,@Param("list") List<String> list);
**/
void deleteBatchByGroupId(@Param("customerId") String customerId, @Param("list") List<String> list);
/**
* @Description 更新群主的党员信息
* @param list
* @return
* @Description 更新群主的党员信息
* @author wangc
* @date 2020.09.20 12:44
**/
int updatePartyFlag(@Param("list") List<String> list,@Param("customerId")String customerId);
**/
int updatePartyFlag(@Param("list") List<String> list, @Param("customerId") String customerId);
/**
* @Description 更新群主的热心居民信息
* @param list
* @return
* @Description 更新群主的热心居民信息
* @author wangc
* @date 2020.09.20 12:44
**/
int updateHeartedFlag(@Param("list") List<GridHeartedFormDTO> list,@Param("customerId")String customerId);
**/
int updateHeartedFlag(@Param("list") List<GridHeartedFormDTO> list, @Param("customerId") String customerId);
/**
* @Description 批量插入组主表
* @param list
* @return
* @Description 批量插入组主表
* @author wangc
* @date 2020.09.20 15:37
**/
**/
int insertBatchMain(@Param("list") List<FactOriginGroupMainDailyDTO> list);
/**
* @Description 批量插入组员表
* @param list
* @return
* @Description 批量插入组员表
* @author wangc
* @date 2020.09.20 15:37
**/
**/
int insertBatchMembers(List<ExtractGroupMemberActionRecordResultDTO> list);
/**
* @param customerId
* @param groupOwnerId
@ -131,8 +132,8 @@ public interface FactOriginGroupMainDailyDao extends BaseDao<FactOriginGroupMain
List<String> selectGroupIds(@Param("customerId") String customerId, @Param("groupOwnerId") String groupOwnerId);
/**
* @return java.util.List<java.lang.String>
* @param groupIdList
* @return java.util.List<java.lang.String>
* @author yinzuomei
* @description 查询组成员数去重
* @Date 2020/9/20 21:29
@ -140,11 +141,21 @@ public interface FactOriginGroupMainDailyDao extends BaseDao<FactOriginGroupMain
List<String> selectGroupMemberList(@Param("list") List<String> groupIdList);
/**
* @Description 查询党员建组信息
* @param customerId
* @param monthId
* @Description 查询党员建组信息
* @author zxc
* @date 2020/9/25 9:46 上午
*/
List<ScreenPartyLinkMassesDataFormDTO> selectPartyCreateGroupInfo(@Param("customerId") String customerId, @Param("monthId") String monthId,@Param("gridIds") List<String> gridIds);
List<ScreenPartyLinkMassesDataFormDTO> selectPartyCreateGroupInfo(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("gridIds") List<String> gridIds);
/**
* desc: 获取所有网格的组中成员人数 去重
*
* @param customerId
* @return java.util.List<com.epmet.dto.extract.result.GridGroupUserCountResultDTO>
* @author LiuJanJun
* @date 2020/9/27 2:31 下午
*/
List<GridGroupUserCountResultDTO> selectDistinctGroupMemberCount(@Param("customerId") String customerId);
}

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

@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.IssueLogDailyFormDTO;
import com.epmet.dto.extract.result.IssueVoteUserCountResultDTO;
import com.epmet.dto.extract.result.PartyActiveResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity;
import org.apache.ibatis.annotations.Mapper;
@ -27,7 +28,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 议题记录附表
* 议题记录附表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-14
@ -36,50 +37,50 @@ import java.util.List;
public interface FactOriginIssueLogDailyDao extends BaseDao<FactOriginIssueLogDailyEntity> {
/**
* @Description 议题记录附表插入
* @param issueLogList
* @Description 议题记录附表插入
* @author zxc
* @date 2020/9/14 5:53 下午
*/
void insertIssueLogList(@Param("issueLogList")List<IssueLogDailyFormDTO> issueLogList);
void insertIssueLogList(@Param("issueLogList") List<IssueLogDailyFormDTO> issueLogList);
/**
* @Description 删除旧的记录
* @param customerId
* @param dateId
* @Description 删除旧的记录
* @author zxc
* @date 2020/9/16 9:33 上午
*/
void deleteOldLogRecord(@Param("customerId")String customerId,@Param("dateId")String dateId);
void deleteOldLogRecord(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @return java.lang.Integer
* @param userId 用户id
* @param userId 用户id
* @param customerId
* @param monthId
* @return java.lang.Integer
* @author yinzuomei
* @description 查询用户在这个月内表决的总次数
* @Date 2020/9/20 21:52
**/
Integer selectCountUserVote(@Param("userId") String userId, @Param("customerId") String customerId, @Param("monthId")String monthId);
Integer selectCountUserVote(@Param("userId") String userId, @Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @Description 查询 议题表决党员/群众
* @param customerId
* @param monthId
* @param isParty
* @Description 查询 议题表决党员/群众
* @author zxc
* @date 2020/9/21 9:37 上午
*/
List<PartyActiveResultDTO> selectPartyActiveIssueVote(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("isParty") Integer isParty);
List<PartyActiveResultDTO> selectPartyActiveIssueVote(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("isParty") Integer isParty);
/**
* @return int
* @param customerId
* @param gridId
* @param communityId
* @param agencyPath
* @param isParty
* @return int
* @author yinzuomei
* @description 党员参与议事支持或者反对的次数
* @Date 2020/9/26 18:05
@ -89,4 +90,27 @@ public interface FactOriginIssueLogDailyDao extends BaseDao<FactOriginIssueLogDa
@Param("communityId")String communityId,
@Param("agencyPath")String agencyPath,
@Param("isParty")String isParty);
/**
* @param gridId 网格id
* @param pids 网格的pids
* @return int
* @author yinzuomei
* @description 参与人数: 议题的表决行为的用户数去重的累计值
* @Date 2020/9/27 14:19
**/
int selectCountJoinUserTotal(@Param("customerId") String customerId,
@Param("gridId") String gridId,
@Param("pids") String pids);
/**
* desc: 获取每个议题的表决人数
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.IssueVoteUserCountResultDTO>
* @author LiuJanJun
* @date 2020/9/27 1:58 下午
*/
List<IssueVoteUserCountResultDTO> getVoteCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java

@ -56,4 +56,13 @@ public interface ScreenPublicPartiTotalDataDao extends BaseDao<ScreenPublicParti
* @Date 10:52 2020-08-25
**/
void batchInsertPublicPartiTotalData(@Param("list") List<PublicPartiTotalDataFormDTO> list, @Param("customerId")String customerId);
/**
* @return void
* @param list
* @author yinzuomei
* @description 批量插入entity
* @Date 2020/9/27 14:00
**/
void insertBatchEntity(@Param("list") List<ScreenPublicPartiTotalDataEntity> list);
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java

@ -57,4 +57,13 @@ public interface ScreenUserTotalDataDao extends BaseDao<ScreenUserTotalDataEntit
void batchInsertUserTotalData(@Param("list") List<UserTotalDataFormDTO> list, @Param("customerId")String customerId);
void insertBatch(@Param("list") List<ScreenUserTotalDataEntity> list);
/**
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity>
* @param customerId
* @author yinzuomei
* @description 根据条件查询screen_user_total_data表
* @Date 2020/9/27 11:22
**/
List<ScreenUserTotalDataEntity> selectList(@Param("customerId") String customerId);
}

229
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java

@ -1,13 +1,14 @@
package com.epmet.dao.issue;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.SatisfactionInfoResultDTO;
import com.epmet.dto.extract.result.IssueInfoResultDTO;
import com.epmet.dto.extract.result.IssueProcessInfoResultDTO;
import com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO;
import com.epmet.dto.extract.result.SatisfactionInfoResultDTO;
import com.epmet.dto.issue.IssueAgencyDTO;
import com.epmet.dto.issue.IssueDTO;
import com.epmet.dto.issue.IssueGridDTO;
import com.epmet.dto.issue.IssueProjectDTO;
import com.epmet.dto.extract.result.IssueInfoResultDTO;
import com.epmet.entity.issue.IssueEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -29,33 +30,36 @@ public interface StatsIssueDao extends BaseDao<IssueEntity> {
*/
List<IssueAgencyDTO> selectAgencyIssueTotal(@Param("customerId") String customerId, @Param("date") String date);
/**
* 获取当前日期组织下议题增量
* @author zhaoqifeng
* @date 2020/6/18 9:55
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueAgencyDTO>
*/
/**
* 获取当前日期组织下议题增量
*
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueAgencyDTO>
* @author zhaoqifeng
* @date 2020/6/18 9:55
*/
List<IssueAgencyDTO> selectAgencyIssueInc(@Param("customerId") String customerId, @Param("date") String date);
/**
* 已关闭议题统计
* @author zhaoqifeng
* @date 2020/6/18 14:41
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueAgencyDTO>
/**
* 已关闭议题统计
*
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueAgencyDTO>
* @author zhaoqifeng
* @date 2020/6/18 14:41
*/
List<IssueAgencyDTO> selectAgencyClosedIssueTotal(@Param("customerId") String customerId, @Param("date") String date);
/**
* 已关闭议题增量
* @author zhaoqifeng
* @date 2020/6/18 14:41
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueAgencyDTO>
/**
* 已关闭议题增量
*
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueAgencyDTO>
* @author zhaoqifeng
* @date 2020/6/18 14:41
*/
List<IssueAgencyDTO> selectAgencyClosedIssueInc(@Param("customerId") String customerId, @Param("date") String date);
@ -66,6 +70,7 @@ public interface StatsIssueDao extends BaseDao<IssueEntity> {
* @Description 根据客户Id查询议题库已转项目的网格项目关系数据
**/
List<IssueEntity> selectGridProjectList(IssueEntity issueEntity);
/**
* 获取当前日期网格下议题统计结果
*
@ -77,87 +82,103 @@ public interface StatsIssueDao extends BaseDao<IssueEntity> {
*/
List<IssueGridDTO> selectGridIssueTotal(@Param("customerId") String customerId, @Param("date") String date);
/**
* 获取当前日期网格下议题增量
* @author zhaoqifeng
* @date 2020/6/18 9:55
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueGridDTO>
*/
List<IssueGridDTO> selectGridIssueInc(@Param("customerId") String customerId, @Param("date") String date);
/**
* 网格已关闭议题统计
* @author zhaoqifeng
* @date 2020/6/18 14:41
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueGridDTO>
*/
List<IssueGridDTO> selectGridClosedIssueTotal(@Param("customerId") String customerId, @Param("date") String date);
/**
* 网格已关闭议题增量
* @author zhaoqifeng
* @date 2020/6/18 14:41
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueGridDTO>
*/
List<IssueGridDTO> selectGridClosedIssueInc(@Param("customerId") String customerId, @Param("date") String date);
/**
* 查询客户下议题和项目关系
* @author zhaoqifeng
* @date 2020/6/19 17:34
* @param customerId
* @return java.util.List<com.epmet.dto.issue.IssueProjectDTO>
/**
* 获取当前日期网格下议题增量
*
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueGridDTO>
* @author zhaoqifeng
* @date 2020/6/18 9:55
*/
List<IssueGridDTO> selectGridIssueInc(@Param("customerId") String customerId, @Param("date") String date);
/**
* 网格已关闭议题统计
*
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueGridDTO>
* @author zhaoqifeng
* @date 2020/6/18 14:41
*/
List<IssueGridDTO> selectGridClosedIssueTotal(@Param("customerId") String customerId, @Param("date") String date);
/**
* 网格已关闭议题增量
*
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueGridDTO>
* @author zhaoqifeng
* @date 2020/6/18 14:41
*/
List<IssueGridDTO> selectGridClosedIssueInc(@Param("customerId") String customerId, @Param("date") String date);
/**
* 查询客户下议题和项目关系
*
* @param customerId
* @return java.util.List<com.epmet.dto.issue.IssueProjectDTO>
* @author zhaoqifeng
* @date 2020/6/19 17:34
*/
List<IssueProjectDTO> selectIssueProjectList(@Param("customerId") String customerId);
/**
* 根据ID获取议题信息
* @author zhaoqifeng
* @date 2020/9/15 16:56
* @param ids
* @return java.util.List<com.epmet.dto.issue.IssueDTO>
*/
List<IssueDTO> selectIssueInfoByIds(@Param("ids") List<String> ids);
/**
* @Description 查询议题信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/15 2:28 下午
*/
List<IssueInfoResultDTO> selectIssueInfo(@Param("customerId")String customerId, @Param("dateId")String dateId);
/**
* @Description 查询议题process信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<IssueProcessInfoResultDTO> selectIssueProcessInfo(@Param("customerId")String customerId, @Param("dateId")String dateId);
/**
* @Description 查询议题满意度评价信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<SatisfactionInfoResultDTO> selectIssueSatisfactionInfo(@Param("customerId")String customerId, @Param("dateId")String dateId);
/**
* @Description 查询议题支持反对信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<SatisfactionInfoResultDTO> selectIssueVoteInfo(@Param("customerId")String customerId, @Param("dateId")String dateId);
/**
* 根据ID获取议题信息
*
* @param ids
* @return java.util.List<com.epmet.dto.issue.IssueDTO>
* @author zhaoqifeng
* @date 2020/9/15 16:56
*/
List<IssueDTO> selectIssueInfoByIds(@Param("ids") List<String> ids);
/**
* @param customerId
* @param dateId
* @Description 查询议题信息
* @author zxc
* @date 2020/9/15 2:28 下午
*/
List<IssueInfoResultDTO> selectIssueInfo(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @param customerId
* @param dateId
* @Description 查询议题process信息
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<IssueProcessInfoResultDTO> selectIssueProcessInfo(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @param customerId
* @param dateId
* @Description 查询议题满意度评价信息
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<SatisfactionInfoResultDTO> selectIssueSatisfactionInfo(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @param customerId
* @param dateId
* @Description 查询议题支持反对信息
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<SatisfactionInfoResultDTO> selectIssueVoteInfo(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* desc: 根据客户id 获取当前议题的情况
*
* @param customerId
* @param dateId
* @return java.util.List<com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO>
* @author LiuJanJun
* @date 2020/9/27 1:22 下午
*/
List<IssueVoteStatisticalResultDTO> selectIssueVoteStatis(@Param("customerId") String customerId, @Param("dateId") String dateId);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPublicPartiTotalDataEntity.java

@ -86,7 +86,7 @@ public class ScreenPublicPartiTotalDataEntity extends BaseEpmetEntity {
private Integer regUserTotal;
/**
* 参与人数
* 参与人数参与人数: 议题的表决行为的用户数去重的累计值
*/
private Integer joinUserTotal;

37
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java

@ -1,12 +1,13 @@
package com.epmet.service.Issue;
import com.epmet.dto.extract.result.SatisfactionInfoResultDTO;
import com.epmet.dto.extract.result.IssueInfoResultDTO;
import com.epmet.dto.extract.result.IssueProcessInfoResultDTO;
import com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO;
import com.epmet.dto.extract.result.SatisfactionInfoResultDTO;
import com.epmet.dto.issue.IssueAgencyDTO;
import com.epmet.dto.issue.IssueDTO;
import com.epmet.dto.issue.IssueGridDTO;
import com.epmet.dto.issue.IssueProjectDTO;
import com.epmet.dto.extract.result.IssueInfoResultDTO;
import com.epmet.entity.issue.IssueEntity;
import java.util.List;
@ -149,14 +150,26 @@ public interface IssueService {
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<SatisfactionInfoResultDTO> selectIssueSatisfactionInfo(String customerId,String dateId);
/**
* @Description 查询议题支持反对信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<SatisfactionInfoResultDTO> selectIssueVoteInfo(String customerId,String dateId);
List<SatisfactionInfoResultDTO> selectIssueSatisfactionInfo(String customerId, String dateId);
/**
* @param customerId
* @param dateId
* @Description 查询议题支持反对信息
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<SatisfactionInfoResultDTO> selectIssueVoteInfo(String customerId, String dateId);
/**
* desc: 查询议题支持反对及应表决人数
* 数据由两部分组成 1本月内已经关闭的话题的支持和反对数据 来自issueissue_vote_statistical
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO>
* @author LiuJanJun
* @date 2020/9/27 11:20 上午
*/
List<IssueVoteStatisticalResultDTO> selectIssueVoteStatis(String customerId, String monthId);
}

30
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java

@ -3,13 +3,14 @@ package com.epmet.service.Issue.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.issue.StatsIssueDao;
import com.epmet.dto.extract.result.SatisfactionInfoResultDTO;
import com.epmet.dto.extract.result.IssueInfoResultDTO;
import com.epmet.dto.extract.result.IssueProcessInfoResultDTO;
import com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO;
import com.epmet.dto.extract.result.SatisfactionInfoResultDTO;
import com.epmet.dto.issue.IssueAgencyDTO;
import com.epmet.dto.issue.IssueDTO;
import com.epmet.dto.issue.IssueGridDTO;
import com.epmet.dto.issue.IssueProjectDTO;
import com.epmet.dto.extract.result.IssueInfoResultDTO;
import com.epmet.entity.issue.IssueEntity;
import com.epmet.service.Issue.IssueService;
import org.springframework.beans.factory.annotation.Autowired;
@ -127,14 +128,19 @@ public class IssueServiceImpl implements IssueService {
}
/**
* @Description 查询议题支持反对信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 1:48 下午
*/
@Override
public List<SatisfactionInfoResultDTO> selectIssueVoteInfo(String customerId, String dateId) {
return statsIssueDao.selectIssueVoteInfo(customerId, dateId);
}
* @Description 查询议题支持反对信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 1:48 下午
*/
@Override
public List<SatisfactionInfoResultDTO> selectIssueVoteInfo(String customerId, String dateId) {
return statsIssueDao.selectIssueVoteInfo(customerId, dateId);
}
@Override
public List<IssueVoteStatisticalResultDTO> selectIssueVoteStatis(String customerId, String dateId) {
return statsIssueDao.selectIssueVoteStatis(customerId, dateId);
}
}

17
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java

@ -20,6 +20,7 @@ package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.GridGroupUserCountResultDTO;
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity;
@ -62,14 +63,24 @@ public interface FactOriginGroupMainDailyService extends BaseService<FactOriginG
* @author wangc
* @date 2020.09.23 16:30
**/
boolean insertExtractedData(boolean isFirst,String customerId,String dateId,List<FactOriginGroupMainDailyDTO> originGroupData,List<ExtractGroupMemberActionRecordResultDTO> memberList);
boolean insertExtractedData(boolean isFirst, String customerId, String dateId, List<FactOriginGroupMainDailyDTO> originGroupData, List<ExtractGroupMemberActionRecordResultDTO> memberList);
/**
* @Description 查询党员建组信息
* @param customerId
* @param monthId
* @Description 查询党员建组信息
* @author zxc
* @date 2020/9/25 9:46 上午
*/
List<ScreenPartyLinkMassesDataFormDTO> selectPartyCreateGroupInfo(String customerId,String monthId,List<String> gridIds);
List<ScreenPartyLinkMassesDataFormDTO> selectPartyCreateGroupInfo(String customerId, String monthId, List<String> gridIds);
/**
* desc: 获取客户下每个网格小组内的 去重人数
*
* @param customerId
* @return java.util.List<com.epmet.entity.evaluationindex.extract.GridGroupUserCountResultDTO>
* @author LiuJanJun
* @date 2020/9/27 2:24 下午
*/
List<GridGroupUserCountResultDTO> selectDistinctGroupMemberCount(String customerId);
}

28
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java

@ -18,10 +18,13 @@
package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.result.IssueVoteUserCountResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity;
import java.util.List;
/**
* 议题记录附表
* 议题记录附表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-23
@ -29,15 +32,36 @@ import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity;
public interface FactOriginIssueLogDailyService extends BaseService<FactOriginIssueLogDailyEntity> {
/**
* @return int
* @param customerId
* @param gridId
* @param communityId
* @param agencyPath
* @param isParty
* @return int
* @author yinzuomei
* @description 党员参与议事支持或者反对的次数
* @Date 2020/9/26 17:57
**/
int calPartyPartiIssueTotal(String customerId, String gridId, String communityId, String agencyPath, String isParty);
/**
* @param orgType 组织类别 agency组织网格grid部门department
* @param orgId 组织Id 可以为网格id
* @return int
* @author yinzuomei
* @description 参与人数参与人数: 议题的表决行为的用户数去重的累计值
* @Date 2020/9/27 14:06
**/
int queryJoinUserTotal(String customerId, String orgType, String orgId);
/**
* desc: 获取每个议题的表决人数
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.FactOriginIssueLogDailyEntity>
* @author LiuJanJun
* @date 2020/9/27 1:58 下午
*/
List<IssueVoteUserCountResultDTO> getVoteCount(String customerId, String monthId);
}

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

@ -18,10 +18,10 @@
package com.epmet.service.evaluationindex.extract.todata.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.GridGroupUserCountResultDTO;
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService;
@ -108,11 +108,16 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl<FactOri
* @date 2020/9/25 9:46 上午
*/
@Override
public List<ScreenPartyLinkMassesDataFormDTO> selectPartyCreateGroupInfo(String customerId, String monthId,List<String> gridIds) {
if (!CollectionUtils.isEmpty(gridIds)){
public List<ScreenPartyLinkMassesDataFormDTO> selectPartyCreateGroupInfo(String customerId, String monthId, List<String> gridIds) {
if (!CollectionUtils.isEmpty(gridIds)) {
return baseDao.selectPartyCreateGroupInfo(customerId, monthId, gridIds);
}
return new ArrayList<>();
}
@Override
public List<GridGroupUserCountResultDTO> selectDistinctGroupMemberCount(String customerId) {
return baseDao.selectDistinctGroupMemberCount(customerId);
}
}

53
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java

@ -19,22 +19,34 @@ package com.epmet.service.evaluationindex.extract.todata.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginIssueLogDailyDao;
import com.epmet.dto.extract.result.IssueVoteUserCountResultDTO;
import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService;
import com.epmet.service.stats.DimAgencyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 议题记录附表
* 议题记录附表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-23
*/
@Slf4j
@DataSource(DataSourceConstant.STATS)
@Service
public class FactOriginIssueLogDailyServiceImpl extends BaseServiceImpl<FactOriginIssueLogDailyDao, FactOriginIssueLogDailyEntity> implements FactOriginIssueLogDailyService {
@Autowired
private DimAgencyService dimAgencyService;
/**
* @param customerId
@ -51,4 +63,41 @@ public class FactOriginIssueLogDailyServiceImpl extends BaseServiceImpl<FactOrig
public int calPartyPartiIssueTotal(String customerId, String gridId, String communityId, String agencyPath, String isParty) {
return baseDao.calPartyPartiIssueTotal(customerId,gridId,communityId,agencyPath,isParty);
}
/**
* @param orgType 组织类别 agency组织网格grid部门department
* @param orgId 组织Id 可以为网格id
* @return int
* @author yinzuomei
* @description 参与人数: 议题的表决行为的用户数去重的累计值
* @Date 2020/9/27 14:06
**/
@Override
public int queryJoinUserTotal(String customerId, String orgType, String orgId) {
if (OrgTypeConstant.GRID.equals(orgType)) {
return baseDao.selectCountJoinUserTotal(customerId, orgId, null);
} else {
//拼接pids,
DimAgencyDTO dimAgencyDTO = dimAgencyService.get(orgId);
if (null == dimAgencyDTO) {
log.error(String.format("根据agencyId=%s,查询dim_agency 返回null", orgId));
} else {
String pids;
if(NumConstant.ZERO_STR.equals(dimAgencyDTO.getPid())){
//如果是根基组织,不需要拼接:
pids=dimAgencyDTO.getId();
}else{
pids = dimAgencyDTO.getPids().concat(StrConstant.COLON).concat(dimAgencyDTO.getId());
}
return baseDao.selectCountJoinUserTotal(customerId, null, pids);
}
}
return NumConstant.ZERO;
}
@Override
public List<IssueVoteUserCountResultDTO> getVoteCount(String customerId, String monthId) {
return baseDao.getVoteCount(customerId, monthId);
}
}

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

@ -128,7 +128,7 @@ public class IssueExtractServiceImpl implements IssueExtractService {
agencyInfoList.forEach(pid -> {
if (r.getAgencyId().equals(pid.getAgencyId())){
r.setPid(pid.getPid());
r.setPids(pid.getPids().concat(":").concat(pid.getPid()));
r.setPids(pid.getPids().concat(":").concat(r.getAgencyId()));
}
});
});
@ -227,7 +227,7 @@ public class IssueExtractServiceImpl implements IssueExtractService {
agencyInfoList.forEach(agency -> {
if (r.getAgencyId().equals(agency.getAgencyId())){
r.setPid(agency.getPid());
r.setPids(agency.getPids());
r.setPids(agency.getPids().concat(":").concat(r.getAgencyId()));
}
});
});

19
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PublicPartiTotalDataExtractService.java

@ -0,0 +1,19 @@
package com.epmet.service.evaluationindex.extract.toscreen;
/**
* screen_public_parti_total_data
* 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数 按天统计
* @author yinzuomei@elink-cn.com
* @date 2020/9/27 11:09
*/
public interface PublicPartiTotalDataExtractService {
/**
* 按天统计
*
* @param customerId 客户id
* @param dateId yyyyMMdd 这一列存储到 screen_public_parti_total_data表中的数据更新至: yyyy|yyyyMM|yyyyMMdd
* @return
*/
void extractPublicPartiTotalData(String customerId,String dateId);
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java

@ -3,6 +3,7 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService;
@ -53,7 +54,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
@Override
public void extractGridPioneerData(String customerId, String dateId) {
//查询客户下所有的网格,初始数据值为0
List<ScreenPioneerDataEntity> gridList = screenPioneerDataService.initPioneerDataList(customerId, "grid");
List<ScreenPioneerDataEntity> gridList = screenPioneerDataService.initPioneerDataList(customerId, OrgTypeConstant.GRID);
if (CollectionUtils.isEmpty(gridList)) {
return;
}
@ -140,7 +141,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
@Override
public void extractCommunityPioneerData(String customerId, String dateId) {
//查询客户下所有的社区,初始数据值为0
List<ScreenPioneerDataEntity> communityList = screenPioneerDataService.initPioneerDataList(customerId, "community");
List<ScreenPioneerDataEntity> communityList = screenPioneerDataService.initPioneerDataList(customerId, OrgTypeConstant.COMMUNITY);
if (CollectionUtils.isEmpty(communityList)) {
return;
}
@ -209,7 +210,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
@Override
public void extractExceptCommunityPioneerData(String customerId, String dateId) {
//查询客户下所有的组织(社区除外),初始数据值为0
List<ScreenPioneerDataEntity> agencyList = screenPioneerDataService.initPioneerDataList(customerId, "agency");
List<ScreenPioneerDataEntity> agencyList = screenPioneerDataService.initPioneerDataList(customerId, OrgTypeConstant.AGENCY);
if (CollectionUtils.isEmpty(agencyList)) {
return;
}

49
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java

@ -7,11 +7,15 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.dto.extract.result.GridGroupUserCountResultDTO;
import com.epmet.dto.extract.result.GridUserCountResultDTO;
import com.epmet.dto.extract.result.IssueVoteUserCountResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity;
import com.epmet.entity.stats.DimAgencyEntity;
import com.epmet.entity.stats.DimGridEntity;
import com.epmet.entity.stats.FactIssueGridMonthlyEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.PublicPartExtractService;
import com.epmet.service.stats.DimAgencyService;
import com.epmet.service.stats.DimGridService;
@ -48,6 +52,10 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
private FactIssueGridMonthlyService factIssueGridMonthlyService;
@Autowired
private FactRegUserGridMonthlyService factRegUserGridMonthlyService;
@Autowired
private FactOriginIssueLogDailyService factOriginIssueLogDailyService;
@Autowired
private FactOriginGroupMainDailyService factOriginGroupMainDailyService;
/**
@ -55,7 +63,10 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
* targetscreen_user_join
* 总参与统计周期内议题表决(虽然可以评价 但是只有表决的人可以评价 所以按表决人数算)的人数
* 百人人均议题统计周期内总的议题数/注册用户数/100
* 百人平均参与度每个议题的实际参与数/应参与数 的平均值每个议题的实际参与数/应参与数的和/被表决的议题数
* 百人平均参与度每个议题的实际参与数/应参与数 的平均值每个议题的实际参与数/应参与数的和/被表决的议题数 来源 获取issue_vote_statistical_daily中 monthId的数据
* <p>
* <p>
* <p>
* 不考虑市北人均议题统计周期内议题总数/发过议题的人数 参与度各个行为(表决)的总数/发生行为的人数
*
* @return java.lang.Boolean
@ -101,16 +112,42 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
GridUserCountResultDTO user = userCountMap.get(gridId);
//百人人均议题:统计周期内总的议题数/(注册用户数/100)
BigDecimal avgIssueCount = new BigDecimal(issue.getIssueIncr()).divide(new BigDecimal(user.getUserCount()).divide(new BigDecimal(NumConstant.ONE_HUNDRED)));
// 需要修改字段类型
entity.setAvgIssue(avgIssueCount);
//百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与数/应参与数)的和)/被表决的议题数
});
entity.setAvgJoin(new BigDecimal(0));
});
//获取该月 表决的人数
List<IssueVoteUserCountResultDTO> voteCountList = factOriginIssueLogDailyService.getVoteCount(formDTO.getCustomerId(), formDTO.getMonthId());
Map<String, Integer> gridMemberCount = new HashMap<>();
if (!CollectionUtils.isEmpty(issueTotal)) {
//获取每个网格的应表决人数
List<GridGroupUserCountResultDTO> memberCountList = factOriginGroupMainDailyService.selectDistinctGroupMemberCount(formDTO.getCustomerId());
if (CollectionUtils.isEmpty(memberCountList)) {
log.error("抽取【公众参与-人均议题】,获取应表决人数为空");
return;
}
gridMemberCount = memberCountList.stream().collect(Collectors.toMap(GridGroupUserCountResultDTO::getGridId, o -> o.getMemberCount()));
}
//百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与数/应参与数)的和)/被表决的议题数
//遍历实际参与人数
Map<String, List<IssueVoteUserCountResultDTO>> voteMap = voteCountList.stream().collect(Collectors.groupingBy(IssueVoteUserCountResultDTO::getGridId));
for (Map.Entry<String, List<IssueVoteUserCountResultDTO>> entry : voteMap.entrySet()) {
String gridId = entry.getKey();
ScreenUserJoinEntity entity = insertMap.get(gridId);
List<IssueVoteUserCountResultDTO> issueList = entry.getValue();
BigDecimal bigDecimal = new BigDecimal(0);
BigDecimal votedByIssueCount = new BigDecimal(issueList.get(0).getIssueCount());
for (IssueVoteUserCountResultDTO vote : issueList) {
Integer memberCount = gridMemberCount.get(gridId);
if (memberCount == null) {
memberCount = 0;
}
bigDecimal = bigDecimal.add(new BigDecimal(vote.getVoteCount() / memberCount));
}
entity.setAvgJoin(bigDecimal.divide(votedByIssueCount).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)));
}
}
private void extractAgencyUserJoin(ExtractScreenFormDTO formDTO) {

68
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartiTotalDataExtractServiceImpl.java

@ -0,0 +1,68 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.entity.evaluationindex.screen.ScreenPublicPartiTotalDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.PublicPartiTotalDataExtractService;
import com.epmet.service.evaluationindex.screen.ScreenPublicPartiTotalDataService;
import com.epmet.service.evaluationindex.screen.ScreenUserTotalDataService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* screen_public_parti_total_data
* 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数 按天统计
* @author yinzuomei@elink-cn.com
* @date 2020/9/27 11:09
*/
@Slf4j
@Service
public class PublicPartiTotalDataExtractServiceImpl implements PublicPartiTotalDataExtractService {
@Autowired
private ScreenUserTotalDataService screenUserTotalDataService;
@Autowired
private ScreenPublicPartiTotalDataService screenPublicPartiTotalDataService;
@Autowired
private FactOriginIssueLogDailyService factOriginIssueLogDailyService;
/**
* 按天统计
*
* @param customerId 客户id
* @param dateId yyyyMMdd 这一列存储到 screen_public_parti_total_data表中的数据更新至: yyyy|yyyyMM|yyyyMMdd
* @return
*/
@Override
public void extractPublicPartiTotalData(String customerId, String dateId) {
List<ScreenUserTotalDataEntity> userTotalDataEntityList = screenUserTotalDataService.selectList(customerId);
if (CollectionUtils.isEmpty(userTotalDataEntityList)) {
log.warn("screen_user_total_data dosen't have any record ");
return;
}
List<ScreenPublicPartiTotalDataEntity> list = new ArrayList<>();
for (ScreenUserTotalDataEntity totalData : userTotalDataEntityList) {
ScreenPublicPartiTotalDataEntity entity = new ScreenPublicPartiTotalDataEntity();
entity.setCustomerId(customerId);
entity.setOrgType(totalData.getOrgType());
entity.setOrgId(totalData.getOrgId());
entity.setParentId(totalData.getParentId());
entity.setOrgName(totalData.getOrgName());
entity.setDataEndTime(dateId);
entity.setTopicTotal(totalData.getTopicTotal());
entity.setIssueTotal(totalData.getIssueTotal());
entity.setProjectTotal(totalData.getProjectTotal());
entity.setRegUserTotal(totalData.getUserTotal());
//参与人数参与人数: 议题的表决行为的用户数去重的累计值
int joinUserTotal=factOriginIssueLogDailyService.queryJoinUserTotal(customerId,totalData.getOrgType(),totalData.getOrgId());
entity.setJoinUserTotal(joinUserTotal);
list.add(entity);
}
//先删除,后插入
screenPublicPartiTotalDataService.delAndInsertBatch(customerId, list);
}
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPublicPartiTotalDataService.java

@ -21,6 +21,8 @@ package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.evaluationindex.screen.ScreenPublicPartiTotalDataEntity;
import java.util.List;
/**
* 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数
*
@ -28,4 +30,13 @@ import com.epmet.entity.evaluationindex.screen.ScreenPublicPartiTotalDataEntity;
* @since v1.0.0 2020-09-22
*/
public interface ScreenPublicPartiTotalDataService extends BaseService<ScreenPublicPartiTotalDataEntity> {
/**
* @return void
* @param customerId
* @param list screen_public_parti_total_data 记录
* @author yinzuomei
* @description 先删除后插入
* @Date 2020/9/27 13:51
**/
void delAndInsertBatch(String customerId, List<ScreenPublicPartiTotalDataEntity> list);
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserTotalDataService.java

@ -40,4 +40,13 @@ public interface ScreenUserTotalDataService extends BaseService<ScreenUserTotalD
* @date 2020.09.24 17:59
**/
void dataClean(List<ScreenUserTotalDataEntity> list,String customerId);
/**
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity>
* @param customerId
* @author yinzuomei
* @description 根据条件查询screen_user_total_data表
* @Date 2020/9/27 11:18
**/
List<ScreenUserTotalDataEntity> selectList(String customerId);
}

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

@ -18,11 +18,20 @@
package com.epmet.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.dao.evaluationindex.screen.ScreenPublicPartiTotalDataDao;
import com.epmet.entity.evaluationindex.screen.ScreenPublicPartiTotalDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenPublicPartiTotalDataService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数
@ -34,4 +43,29 @@ import org.springframework.stereotype.Service;
public class ScreenPublicPartiTotalDataServiceImpl extends BaseServiceImpl<ScreenPublicPartiTotalDataDao, ScreenPublicPartiTotalDataEntity> implements ScreenPublicPartiTotalDataService {
/**
* @param customerId
* @param entityList screen_public_parti_total_data 记录
* @return void
* @author yinzuomei
* @description 先删除后插入
* @Date 2020/9/27 13:51
**/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX)
@Transactional(rollbackFor = Exception.class)
@Override
public void delAndInsertBatch(String customerId, List<ScreenPublicPartiTotalDataEntity> entityList) {
if(CollectionUtils.isEmpty(entityList)){
return;
}
int deleteNum=0;
do{
//沿用原来项目采集的删除方法,一次删除1000
deleteNum=baseDao.deletePublicPartiTotalData(customerId);
}while (deleteNum!= NumConstant.ZERO);
List<List<ScreenPublicPartiTotalDataEntity>> partionList= ListUtils.partition(entityList, IndexCalConstant.INSERT_SIZE);
partionList.forEach(list->{
baseDao.insertBatchEntity(list);
});
}
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserTotalDataServiceImpl.java

@ -25,7 +25,6 @@ import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.screen.ScreenUserTotalDataDao;
import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenUserTotalDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
@ -61,4 +60,16 @@ public class ScreenUserTotalDataServiceImpl extends BaseServiceImpl<ScreenUserTo
baseDao.insertBatch(list);
}
}
/**
* @param customerId
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity>
* @author yinzuomei
* @description 根据条件查询screen_user_total_data表
* @Date 2020/9/27 11:18
**/
@Override
public List<ScreenUserTotalDataEntity> selectList(String customerId) {
return baseDao.selectList(customerId);
}
}

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

@ -264,4 +264,19 @@
)
GROUP BY GRID_ID
</select>
<select id="selectDistinctGroupMemberCount" resultType="com.epmet.dto.extract.result.GridGroupUserCountResultDTO">
SELECT
COUNT(DISTINCT MEMBER_ID) AS memberCount,
GRID_ID,
CUSTOMER_ID,
PIDS,
AGENCY_ID
FROM
fact_origin_group_member_daily
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
GROUP by GRID_ID
</select>
</mapper>

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

@ -119,4 +119,39 @@
and M.IS_PARTY=#{isParty}
</if>
</select>
<!-- 参与人数: 议题的表决行为的用户数去重的累计值 -->
<select id="selectCountJoinUserTotal" parameterType="map" resultType="int">
SELECT
count( DISTINCT m.OPERATION_USER_ID ) as total
FROM
fact_origin_issue_log_daily m
WHERE
m.DEL_FLAG = '0'
and m.ACTION_CODE like'vote_%'
and m.CUSTOMER_ID=#{customerId}
<if test='null != gridId and "" != gridId'>
and m.GRID_ID=#{gridId}
</if>
<if test='null != pids and "" != pids'>
and m.PIDS LIKE CONCAT(#{pids},'%')
</if>
</select>
<select id="getVoteCount" resultType="com.epmet.dto.extract.result.IssueVoteUserCountResultDTO">
SELECT
GRID_ID,
ISSUE_ID,
COUNT(1) AS voteCount,
COUNT( DISTINCT ISSUE_ID) issueCount
FROM
fact_origin_issue_log_daily
WHERE
DEL_FLAG = '0'
and CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
and MONTH_ID = #{monthId,jdbcType=VARCHAR}
AND ACTION_CODE LIKE 'vote_%'
group by GRID_ID
</select>
</mapper>

47
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPublicPartiTotalDataDao.xml

@ -77,5 +77,50 @@
</foreach>
</insert>
<!-- 批量插入entity -->
<insert id="insertBatchEntity" parameterType="map">
insert into screen_public_parti_total_data
(
ID,
CUSTOMER_ID,
ORG_TYPE,
ORG_ID,
PARENT_ID,
ORG_NAME,
DATA_END_TIME,
TOPIC_TOTAL,
ISSUE_TOTAL,
PROJECT_TOTAL,
REG_USER_TOTAL,
JOIN_USER_TOTAL,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{item.customerId},
#{item.orgType},
#{item.orgId},
#{item.parentId},
#{item.orgName},
#{item.dataEndTime},
#{item.topicTotal},
#{item.issueTotal},
#{item.projectTotal},
#{item.regUserTotal},
#{item.joinUserTotal},
0,
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
</mapper>

8
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml

@ -105,4 +105,12 @@
</foreach>
</insert>
<!-- 根据条件查询screen_user_total_data表 -->
<select id="selectList" parameterType="map" resultType="com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity">
select * from screen_user_total_data m
where m.DEL_FLAG='0'
<if test='null!=customerId and ""!=customerId'>
and m.CUSTOMER_ID=#{customerId}
</if>
</select>
</mapper>

Loading…
Cancel
Save