diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridGroupUserCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridGroupUserCountResultDTO.java new file mode 100644 index 0000000000..72723e1987 --- /dev/null +++ b/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; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteStatisticalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteStatisticalResultDTO.java new file mode 100644 index 0000000000..01531e3bb1 --- /dev/null +++ b/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; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteUserCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteUserCountResultDTO.java new file mode 100644 index 0000000000..405ab7b3a8 --- /dev/null +++ b/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; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java index 66a156557d..5107262311 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java +++ b/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 { /** - * @Description 查询建群党员数 * @param customerId * @param monthId + * @Description 查询建群党员数 * @author zxc * @date 2020/9/19 3:49 下午 */ - List selectPartyCreateGroupCount(@Param("customerId") String customerId,@Param("monthId") String monthId); + List 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 list); + **/ + void deleteBatchByGroupId(@Param("customerId") String customerId, @Param("list") List list); /** - * @Description 更新群主的党员信息 * @param list * @return + * @Description 更新群主的党员信息 * @author wangc * @date 2020.09.20 12:44 - **/ - int updatePartyFlag(@Param("list") List list,@Param("customerId")String customerId); + **/ + int updatePartyFlag(@Param("list") List list, @Param("customerId") String customerId); /** - * @Description 更新群主的热心居民信息 * @param list * @return + * @Description 更新群主的热心居民信息 * @author wangc * @date 2020.09.20 12:44 - **/ - int updateHeartedFlag(@Param("list") List list,@Param("customerId")String customerId); + **/ + int updateHeartedFlag(@Param("list") List list, @Param("customerId") String customerId); /** - * @Description 批量插入组主表 * @param list * @return + * @Description 批量插入组主表 * @author wangc * @date 2020.09.20 15:37 - **/ + **/ int insertBatchMain(@Param("list") List list); /** - * @Description 批量插入组员表 * @param list * @return + * @Description 批量插入组员表 * @author wangc * @date 2020.09.20 15:37 - **/ + **/ int insertBatchMembers(List list); + /** * @param customerId * @param groupOwnerId @@ -131,8 +132,8 @@ public interface FactOriginGroupMainDailyDao extends BaseDao selectGroupIds(@Param("customerId") String customerId, @Param("groupOwnerId") String groupOwnerId); /** - * @return java.util.List * @param groupIdList + * @return java.util.List * @author yinzuomei * @description 查询组成员数(去重) * @Date 2020/9/20 21:29 @@ -140,11 +141,21 @@ public interface FactOriginGroupMainDailyDao extends BaseDao selectGroupMemberList(@Param("list") List groupIdList); /** - * @Description 查询党员建组信息 * @param customerId * @param monthId + * @Description 查询党员建组信息 * @author zxc * @date 2020/9/25 9:46 上午 */ - List selectPartyCreateGroupInfo(@Param("customerId") String customerId, @Param("monthId") String monthId,@Param("gridIds") List gridIds); + List selectPartyCreateGroupInfo(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("gridIds") List gridIds); + + /** + * desc: 获取所有网格的组中成员人数 去重 + * + * @param customerId + * @return java.util.List + * @author LiuJanJun + * @date 2020/9/27 2:31 下午 + */ + List selectDistinctGroupMemberCount(@Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java index 9b89222731..793926e513 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java +++ b/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 { /** - * @Description 议题记录附表插入 * @param issueLogList + * @Description 议题记录附表插入 * @author zxc * @date 2020/9/14 5:53 下午 */ - void insertIssueLogList(@Param("issueLogList")List issueLogList); + void insertIssueLogList(@Param("issueLogList") List 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 selectPartyActiveIssueVote(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("isParty") Integer isParty); + List 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 @@ -91,14 +92,25 @@ public interface FactOriginIssueLogDailyDao extends BaseDao + * @author LiuJanJun + * @date 2020/9/27 1:58 下午 + */ + List getVoteCount(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java index ca7a25d340..190353059f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java +++ b/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 { */ List 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 - */ + /** + * 获取当前日期组织下议题增量 + * + * @param customerId + * @param date + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/18 9:55 + */ List 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 + /** + * 已关闭议题统计 + * + * @param customerId + * @param date + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/18 14:41 */ List 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 + /** + * 已关闭议题增量 + * + * @param customerId + * @param date + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/18 14:41 */ List selectAgencyClosedIssueInc(@Param("customerId") String customerId, @Param("date") String date); @@ -66,6 +70,7 @@ public interface StatsIssueDao extends BaseDao { * @Description 根据客户Id查询议题库已转项目的网格项目关系数据 **/ List selectGridProjectList(IssueEntity issueEntity); + /** * 获取当前日期网格下议题统计结果 * @@ -77,87 +82,103 @@ public interface StatsIssueDao extends BaseDao { */ List 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 - */ - List 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 - */ - List 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 - */ - List selectGridClosedIssueInc(@Param("customerId") String customerId, @Param("date") String date); - - /** - * 查询客户下议题和项目关系 - * @author zhaoqifeng - * @date 2020/6/19 17:34 - * @param customerId - * @return java.util.List + /** + * 获取当前日期网格下议题增量 + * + * @param customerId + * @param date + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/18 9:55 + */ + List selectGridIssueInc(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 网格已关闭议题统计 + * + * @param customerId + * @param date + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/18 14:41 + */ + List selectGridClosedIssueTotal(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 网格已关闭议题增量 + * + * @param customerId + * @param date + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/18 14:41 + */ + List selectGridClosedIssueInc(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 查询客户下议题和项目关系 + * + * @param customerId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/19 17:34 */ List selectIssueProjectList(@Param("customerId") String customerId); - /** - * 根据ID获取议题信息 - * @author zhaoqifeng - * @date 2020/9/15 16:56 - * @param ids - * @return java.util.List - */ - List selectIssueInfoByIds(@Param("ids") List ids); - - /** - * @Description 查询议题信息 - * @param customerId - * @param dateId - * @author zxc - * @date 2020/9/15 2:28 下午 - */ - List selectIssueInfo(@Param("customerId")String customerId, @Param("dateId")String dateId); - - /** - * @Description 查询议题process信息 - * @param customerId - * @param dateId - * @author zxc - * @date 2020/9/16 1:48 下午 - */ - List selectIssueProcessInfo(@Param("customerId")String customerId, @Param("dateId")String dateId); - - /** - * @Description 查询议题满意度评价信息 - * @param customerId - * @param dateId - * @author zxc - * @date 2020/9/16 1:48 下午 - */ - List selectIssueSatisfactionInfo(@Param("customerId")String customerId, @Param("dateId")String dateId); - - /** - * @Description 查询议题支持反对信息 - * @param customerId - * @param dateId - * @author zxc - * @date 2020/9/16 1:48 下午 - */ - List selectIssueVoteInfo(@Param("customerId")String customerId, @Param("dateId")String dateId); + /** + * 根据ID获取议题信息 + * + * @param ids + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/15 16:56 + */ + List selectIssueInfoByIds(@Param("ids") List ids); + + /** + * @param customerId + * @param dateId + * @Description 查询议题信息 + * @author zxc + * @date 2020/9/15 2:28 下午 + */ + List selectIssueInfo(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @param customerId + * @param dateId + * @Description 查询议题process信息 + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + List selectIssueProcessInfo(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @param customerId + * @param dateId + * @Description 查询议题满意度评价信息 + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + List selectIssueSatisfactionInfo(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @param customerId + * @param dateId + * @Description 查询议题支持反对信息 + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + List selectIssueVoteInfo(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * desc: 根据客户id 获取当前议题的情况 + * + * @param customerId + * @param dateId + * @return java.util.List + * @author LiuJanJun + * @date 2020/9/27 1:22 下午 + */ + List selectIssueVoteStatis(@Param("customerId") String customerId, @Param("dateId") String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java index c7ea8e56bb..239ad2d8b1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java +++ b/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 selectIssueSatisfactionInfo(String customerId,String dateId); - - /** - * @Description 查询议题支持反对信息 - * @param customerId - * @param dateId - * @author zxc - * @date 2020/9/16 1:48 下午 - */ - List selectIssueVoteInfo(String customerId,String dateId); + List selectIssueSatisfactionInfo(String customerId, String dateId); + + /** + * @param customerId + * @param dateId + * @Description 查询议题支持反对信息 + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + List selectIssueVoteInfo(String customerId, String dateId); + + /** + * desc: 【月】查询议题支持反对及应表决人数 + * 数据由两部分组成 1:本月内已经关闭的话题的支持和反对数据 来自issue,issue_vote_statistical + * + * @param customerId + * @param monthId + * @return java.util.List + * @author LiuJanJun + * @date 2020/9/27 11:20 上午 + */ + List selectIssueVoteStatis(String customerId, String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java index 981082f743..e134358618 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java +++ b/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 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 selectIssueVoteInfo(String customerId, String dateId) { + return statsIssueDao.selectIssueVoteInfo(customerId, dateId); + } + + @Override + public List selectIssueVoteStatis(String customerId, String dateId) { + return statsIssueDao.selectIssueVoteStatis(customerId, dateId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java index fdaac9d36e..c14364b799 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java +++ b/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 originGroupData,List memberList); + boolean insertExtractedData(boolean isFirst, String customerId, String dateId, List originGroupData, List memberList); /** - * @Description 查询党员建组信息 * @param customerId * @param monthId + * @Description 查询党员建组信息 * @author zxc * @date 2020/9/25 9:46 上午 */ - List selectPartyCreateGroupInfo(String customerId,String monthId,List gridIds); + List selectPartyCreateGroupInfo(String customerId, String monthId, List gridIds); + + /** + * desc: 获取客户下每个网格小组内的 去重人数 + * + * @param customerId + * @return java.util.List + * @author LiuJanJun + * @date 2020/9/27 2:24 下午 + */ + List selectDistinctGroupMemberCount(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java index a6376e27dc..a5de0ab804 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java +++ b/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,12 +32,12 @@ import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity; public interface FactOriginIssueLogDailyService extends BaseService { /** - * @return int * @param customerId * @param gridId * @param communityId * @param agencyPath * @param isParty + * @return int * @author yinzuomei * @description 党员参与议事:支持或者反对的次数 * @Date 2020/9/26 17:57 @@ -42,12 +45,23 @@ public interface FactOriginIssueLogDailyService extends BaseService + * @author LiuJanJun + * @date 2020/9/27 1:58 下午 + */ + List getVoteCount(String customerId, String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java index 4cc0ebb248..f0b5cd53f0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java +++ b/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 selectPartyCreateGroupInfo(String customerId, String monthId,List gridIds) { - if (!CollectionUtils.isEmpty(gridIds)){ + public List selectPartyCreateGroupInfo(String customerId, String monthId, List gridIds) { + if (!CollectionUtils.isEmpty(gridIds)) { return baseDao.selectPartyCreateGroupInfo(customerId, monthId, gridIds); } return new ArrayList<>(); } + @Override + public List selectDistinctGroupMemberCount(String customerId) { + return baseDao.selectDistinctGroupMemberCount(customerId); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java index 66df6ec87c..e86a41a309 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java @@ -23,6 +23,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.constant.DataSourceConstant; 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; @@ -31,8 +32,10 @@ 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 @@ -86,4 +89,8 @@ public class FactOriginIssueLogDailyServiceImpl extends BaseServiceImpl getVoteCount(String customerId, String monthId) { + return baseDao.getVoteCount(customerId, monthId); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java index bb94830ba1..2f2d5f1e4a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java +++ b/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 { * target:screen_user_join * 总参与:统计周期内议题表决(虽然可以评价 但是只有表决的人可以评价 所以按表决人数算)的人数 * 百人人均议题:统计周期内总的议题数/(注册用户数/100) - * 百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与数/应参与数)的和)/被表决的议题数 + * 百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与数/应参与数)的和)/被表决的议题数 来源 获取issue_vote_statistical_daily中 monthId的数据 + *

+ *

+ *

* 不考虑市北:人均议题:统计周期内议题总数/发过议题的人数 参与度:各个行为(表决)的总数/发生行为的人数 * * @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 voteCountList = factOriginIssueLogDailyService.getVoteCount(formDTO.getCustomerId(), formDTO.getMonthId()); + Map gridMemberCount = new HashMap<>(); + if (!CollectionUtils.isEmpty(issueTotal)) { + //获取每个网格的应表决人数 + List memberCountList = factOriginGroupMainDailyService.selectDistinctGroupMemberCount(formDTO.getCustomerId()); + if (CollectionUtils.isEmpty(memberCountList)) { + log.error("抽取【公众参与-人均议题】,获取应表决人数为空"); + return; + } + gridMemberCount = memberCountList.stream().collect(Collectors.toMap(GridGroupUserCountResultDTO::getGridId, o -> o.getMemberCount())); + } + //百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与数/应参与数)的和)/被表决的议题数 + //遍历实际参与人数 + Map> voteMap = voteCountList.stream().collect(Collectors.groupingBy(IssueVoteUserCountResultDTO::getGridId)); + for (Map.Entry> entry : voteMap.entrySet()) { + String gridId = entry.getKey(); + ScreenUserJoinEntity entity = insertMap.get(gridId); + List 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) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml index a6c9b62bee..2680ca1605 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml @@ -264,4 +264,19 @@ ) GROUP BY GRID_ID + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml index 85c927d5c3..1d549be8cc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml @@ -138,4 +138,20 @@ and m.PIDS LIKE CONCAT(#{pids},'%') + + \ No newline at end of file