diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/GroupTopicShiftIssueRatioRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/GroupTopicShiftIssueRatioRankFormDTO.java new file mode 100644 index 0000000000..fc1a44996d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/GroupTopicShiftIssueRatioRankFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.evaluationindex.screen.dto.form; + + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + +/** + * 邻里党群-社群人数排名-接口入参 + * @Author sun + */ +@Data +public class GroupTopicShiftIssueRatioRankFormDTO implements Serializable { + private static final long serialVersionUID = -2880432640584616651L; + /** + * 页码,从1开始 + */ + @Min(value = 1, message = "页码必须大于0", groups = { AddUserInternalGroup.class }) + private Integer pageNo; + /** + * 页容量,默认10页 + */ + @Min(value = 1, message = "每页条数必须大于0", groups = { AddUserInternalGroup.class }) + private Integer pageSize; + /** + * 客户Id + */ + private String customerId; + public interface AddUserInternalGroup {} + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/GroupUserCountRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/GroupUserCountRankFormDTO.java new file mode 100644 index 0000000000..4b6c4a80ef --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/GroupUserCountRankFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.evaluationindex.screen.dto.form; + + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + +/** + * 邻里党群-社群人数排名-接口入参 + * @Author sun + */ +@Data +public class GroupUserCountRankFormDTO implements Serializable { + private static final long serialVersionUID = -2880432640584616651L; + /** + * 页码,从1开始 + */ + @Min(value = 1, message = "页码必须大于0", groups = { AddUserInternalGroup.class }) + private Integer pageNo; + /** + * 页容量,默认10页 + */ + @Min(value = 1, message = "每页条数必须大于0", groups = { AddUserInternalGroup.class }) + private Integer pageSize; + /** + * 客户Id + */ + private String customerId; + public interface AddUserInternalGroup {} + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/HeartVolunteerrankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/HeartVolunteerrankFormDTO.java index cca3eb4f1b..e4beb2b1cd 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/HeartVolunteerrankFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/HeartVolunteerrankFormDTO.java @@ -1,11 +1,9 @@ package com.epmet.evaluationindex.screen.dto.form; -import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.Min; -import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -15,6 +13,7 @@ import java.io.Serializable; @Data public class HeartVolunteerrankFormDTO implements Serializable { private static final long serialVersionUID = -2880432640584616651L; + public interface AddUserInternalGroup {} /** * 页码,从1开始 */ @@ -29,5 +28,5 @@ public class HeartVolunteerrankFormDTO implements Serializable { * 客户Id */ private String customerId; - public interface AddUserInternalGroup {} + } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupTopicShiftIssueRatioRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupTopicShiftIssueRatioRankResultDTO.java new file mode 100644 index 0000000000..d1068120bf --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupTopicShiftIssueRatioRankResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 公益互助-个人(志愿者)公益时长排名 + * @Author sun + */ +@Data +public class GroupTopicShiftIssueRatioRankResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 小组id + */ + private String groupId = ""; + /** + * 小组名称 + */ + private String groupName = ""; + /** + * 话题数量 + */ + private Integer topicCount = 0; + /** + * 群主名称 + */ + private String groupLeader = ""; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupUserCountRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupUserCountRankResultDTO.java new file mode 100644 index 0000000000..d183b967c4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupUserCountRankResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 公益互助-个人(志愿者)公益时长排名 + * @Author sun + */ +@Data +public class GroupUserCountRankResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 小组id + */ + private String groupId = ""; + /** + * 小组名称 + */ + private String groupName = ""; + /** + * 群成员数 + */ + private Integer memberCount = 0; + /** + * 群主名称 + */ + private String groupLeader = ""; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java index fd239ba96a..dd23d63b0e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java @@ -6,6 +6,8 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.KcScreenService; import com.epmet.dto.result.issue.IssueGridTotalRankDTO; +import com.epmet.evaluationindex.screen.dto.form.GroupTopicShiftIssueRatioRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.GroupUserCountRankFormDTO; import com.epmet.evaluationindex.screen.dto.form.HeartVolunteerrankFormDTO; import com.epmet.evaluationindex.screen.dto.result.*; import com.epmet.dto.result.issue.KcIssueSummary; @@ -191,5 +193,31 @@ public class KcScreenController { return new Result().ok(kcScreenService.groupGridgroupcountrank(externalAppRequestParam)); } + /** + * @param externalAppRequestParam + * @Description 邻里党群-社群数量排名 + * @author sun + */ + @ExternalAppRequestAuth + @PostMapping("group/usercountrank") + public Result> groupUserCountRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody GroupUserCountRankFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, GroupUserCountRankFormDTO.AddUserInternalGroup.class); + formDTO.setCustomerId(externalAppRequestParam.getCustomerId()); + return new Result>().ok(kcScreenService.groupUserCountRank(formDTO)); + } + + /** + * @param externalAppRequestParam + * @Description 邻里党群-话题数量排名 + * @author sun + */ + @ExternalAppRequestAuth + @PostMapping("group/topicshiftissueratiorank") + public Result> groupTopicShiftIssueRatioRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody GroupTopicShiftIssueRatioRankFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, GroupTopicShiftIssueRatioRankFormDTO.AddUserInternalGroup.class); + formDTO.setCustomerId(externalAppRequestParam.getCustomerId()); + return new Result>().ok(kcScreenService.groupTopicShiftIssueRatioRank(formDTO)); + } + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcGroupDetailGridDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcGroupDetailGridDailyDao.java index 8ab08ef8ce..23e6e5afbd 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcGroupDetailGridDailyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcGroupDetailGridDailyDao.java @@ -17,8 +17,14 @@ package com.epmet.datareport.dao.evaluationindex.screenkc; +import com.epmet.evaluationindex.screen.dto.form.GroupTopicShiftIssueRatioRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.GroupUserCountRankFormDTO; +import com.epmet.evaluationindex.screen.dto.result.GroupTopicShiftIssueRatioRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.GroupUserCountRankResultDTO; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * KC-小组详情(先根据customerId+dateId删除) * @@ -28,4 +34,17 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface ScreenKcGroupDetailGridDailyDao { + /** + * @param formDTO + * @Description 按客户查询最近一天所有网格数据 再按社群总数降序排列 + * @author sun + */ + List selectGroupUserCountRankList(GroupUserCountRankFormDTO formDTO); + + /** + * @param formDTO + * @Description 按客户查询最近一天所有网格数据 再按话题总数降序排列 + * @author sun + */ + List selectGroupTopicShiftIssueRatioRankList(GroupTopicShiftIssueRatioRankFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java index bd2c2d8105..3debd0a626 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java @@ -2,6 +2,8 @@ package com.epmet.datareport.service.evaluationindex.screen; import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.dto.result.issue.*; +import com.epmet.evaluationindex.screen.dto.form.GroupTopicShiftIssueRatioRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.GroupUserCountRankFormDTO; import com.epmet.evaluationindex.screen.dto.form.HeartVolunteerrankFormDTO; import com.epmet.evaluationindex.screen.dto.result.*; @@ -83,4 +85,17 @@ public interface KcScreenService { */ GroupGridgroupcountrankResultDTO groupGridgroupcountrank(ExternalAppRequestParam externalAppRequestParam); + /** + * @param formDTO + * @Description 邻里党群-社群数量排名 + * @author sun + */ + List groupUserCountRank(GroupUserCountRankFormDTO formDTO); + + /** + * @param formDTO + * @Description 邻里党群-话题数量排名 + * @author sun + */ + List groupTopicShiftIssueRatioRank(GroupTopicShiftIssueRatioRankFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java index 4a0da15f41..074221dd24 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java @@ -8,6 +8,8 @@ import com.epmet.datareport.dao.evaluationindex.screenkc.*; import com.epmet.datareport.service.evaluationindex.screen.KcScreenService; import com.epmet.datareport.utils.DateUtils; import com.epmet.dto.result.issue.*; +import com.epmet.evaluationindex.screen.dto.form.GroupTopicShiftIssueRatioRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.GroupUserCountRankFormDTO; import com.epmet.evaluationindex.screen.dto.form.HeartVolunteerrankFormDTO; import com.epmet.evaluationindex.screen.dto.result.*; import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO; @@ -58,6 +60,9 @@ public class KcScreenServiceImpl implements KcScreenService { @Autowired private ScreenKcTopicTrendGridMonthlyDao screenKcTopicTrendGridMonthlyDao; + @Autowired + private ScreenKcGroupDetailGridDailyDao screenKcGroupDetailGridDailyDao; + /** * @param externalAppRequestParam * @Description 首页-平台各类总数 @@ -251,4 +256,32 @@ public class KcScreenServiceImpl implements KcScreenService { return resultDTO; } + /** + * @param formDTO + * @Description 邻里党群-社群数量排名 + * @author sun + */ + @Override + public List groupUserCountRank(GroupUserCountRankFormDTO formDTO) { + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageNo(pageIndex); + //按客户查询最近一天所有网格数据 再按社群总数降序排列 + List list = screenKcGroupDetailGridDailyDao.selectGroupUserCountRankList(formDTO); + return list; + } + + /** + * @param formDTO + * @Description 邻里党群-话题数量排名 + * @author sun + */ + @Override + public List groupTopicShiftIssueRatioRank(GroupTopicShiftIssueRatioRankFormDTO formDTO) { + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageNo(pageIndex); + //按客户查询最近一天所有网格数据 再按话题总数降序排列 + List list = screenKcGroupDetailGridDailyDao.selectGroupTopicShiftIssueRatioRankList(formDTO); + return list; + } + } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcActTrendMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcActTrendMonthlyDao.xml index a7062885ce..47ae608fc3 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcActTrendMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcActTrendMonthlyDao.xml @@ -4,8 +4,7 @@ - SELECT month_id AS "monthId", act_count AS "actCount" diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcGroupDetailGridDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcGroupDetailGridDailyDao.xml index 618e712bff..c0d3133d95 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcGroupDetailGridDailyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcGroupDetailGridDailyDao.xml @@ -3,5 +3,62 @@ + + + diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java index 49057915f6..0cdc0e82ef 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java @@ -15,11 +15,11 @@ public interface IndexCalConstant { /** * 批量删除 一次删除50 */ - Integer DELETE_SIZE=1000; + Integer DELETE_SIZE = 1000; /** * 分批计算,一次计算 10条 */ - Integer PAGE_SIZE = 1000; + Integer PAGE_SIZE = 800; String GRID_ID="GRID_ID"; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java index 0de8be20fc..387c85433b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -84,7 +84,10 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { List list = null; Map preLastCpcScoreTotalMap = new HashMap<>(); - CpcScoreEntity currentLastCpcScore = null; + //当前最后一条记录 + //CpcScoreEntity currentLastCpcScore = null; + //当前第一条记录 + //CpcScoreEntity currentFirstCpcScore = null; do { //获取数据 list = cpcScoreDao.getPartScore(formDTO.getCustomerId(), formDTO.getMonthId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), (pageNo - NumConstant.ONE) * pageSize, pageSize); @@ -93,11 +96,14 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { log.warn("calculateTotalScore cpcScoreDao.getPartScore return empty,customerId:{},monthId:{}", formDTO.getCustomerId(), formDTO.getMonthId()); } else { //获取最后一条 - currentLastCpcScore = list.get(list.size() - 1); - if (preLastCpcScoreTotalMap.containsKey(currentLastCpcScore.getUserId())) { + //currentLastCpcScore = list.get(list.size() - 1); + //获取第一条 + //currentFirstCpcScore = list.get(0); + /*if (preLastCpcScoreTotalMap.containsKey(currentFirstCpcScore.getUserId())) { cpcScoreTotalMap.putAll(preLastCpcScoreTotalMap); + preLastCpcScoreTotalMap.clear(); preLastCpcScoreTotalMap.put(currentLastCpcScore.getUserId(), null); - } + }*/ Map> userGroupMap = list.stream().collect(Collectors.groupingBy(CpcScoreEntity::getUserId)); userGroupMap.forEach((userId, partScoreList) -> { CpcScoreEntity totalEntity = null; @@ -114,12 +120,12 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { totalEntity.setScore(new BigDecimal(NumConstant.ZERO)); totalEntity.setAllParentIndexCode(NumConstant.ZERO_STR); totalEntity.setWeight(new BigDecimal(NumConstant.ONE_NEG)); + cpcScoreTotalMap.put(userId, totalEntity); - if (preLastCpcScoreTotalMap.containsKey(part.getUserId())) { + /* if (preLastCpcScoreTotalMap.containsKey(part.getUserId())) { preLastCpcScoreTotalMap.put(part.getUserId(), part); } else { - cpcScoreTotalMap.put(userId, totalEntity); - } + }*/ } //自建群活跃度——议题转项目率 有阈值 >60%按60%算 BigDecimal total = part.getScore().multiply(indexGroupDetailEntity.getWeight());