From 64787e6ef80844009551a6acb30b157b3ce3936b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 2 Mar 2022 10:02:27 +0800 Subject: [PATCH 01/14] =?UTF-8?q?calCpcPartyAbilityV2=E8=AF=95=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/extract/UserGroupIdDTO.java | 13 + .../com/epmet/controller/DemoController.java | 24 +- .../extract/FactOriginGroupMainDailyDao.java | 3 + .../dataToIndex/CalCpcIndexService.java | 5 +- .../impl/CalCpcIndexServiceImpl.java | 256 +++++++++++++++++- .../FactOriginGroupMainDailyService.java | 7 + .../FactOriginGroupMainDailyServiceImpl.java | 13 +- .../extract/FactOriginGroupMainDailyDao.xml | 18 ++ 8 files changed, 323 insertions(+), 16 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/UserGroupIdDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/UserGroupIdDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/UserGroupIdDTO.java new file mode 100644 index 0000000000..854a000fde --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/UserGroupIdDTO.java @@ -0,0 +1,13 @@ +package com.epmet.dto.extract; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +@Data +public class UserGroupIdDTO implements Serializable { + private String userId; + private List groupIdList; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index a0abb1b2e2..84cb0c6964 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -54,7 +54,6 @@ import com.epmet.service.stats.DimAgencyService; import com.epmet.service.stats.DimCustomerPartymemberService; import com.epmet.service.stats.DimCustomerService; import com.epmet.util.DimIdGenerator; -import com.google.common.util.concurrent.ThreadFactoryBuilder; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -65,7 +64,9 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.*; -import java.util.concurrent.*; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Future; @RequestMapping("demo") @RestController @@ -620,20 +621,23 @@ public class DemoController { private CalCpcIndexService calCpcIndexService; @PostMapping("calCpcPartyAbility") - public Result calCpcPartyAbility(@RequestParam("customerId") String customerId, @RequestParam("monthId")String monthId) { + public Result calCpcPartyAbility(@RequestParam("customerId") String customerId, @RequestParam("monthId") String monthId) { + long startCpc = System.currentTimeMillis(); if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(monthId)) { - calCpcIndexService.calCpcPartyAbility(customerId,monthId); - }else{ + calCpcIndexService.calCpcPartyAbilityV2(customerId, monthId); + // calCpcIndexService.calCpcPartyAbility(customerId, monthId); + } else { QueryWrapper customerEntityQueryWrapper = new QueryWrapper<>(); - List customerEntityList=dimCustomerDao.selectList(customerEntityQueryWrapper); + List customerEntityList = dimCustomerDao.selectList(customerEntityQueryWrapper); QueryWrapper wrapper = new QueryWrapper<>(); - List dimMonthEntityList= dimMonthDao.selectList(wrapper); - for(DimCustomerEntity customerEntity:customerEntityList){ - for(DimMonthEntity monthEntity:dimMonthEntityList) { - calCpcIndexService.calCpcPartyAbility(customerEntity.getId(),monthEntity.getId()); + List dimMonthEntityList = dimMonthDao.selectList(wrapper); + for (DimCustomerEntity customerEntity : customerEntityList) { + for (DimMonthEntity monthEntity : dimMonthEntityList) { + calCpcIndexService.calCpcPartyAbilityV2(customerEntity.getId(), monthEntity.getId()); } } } + log.error("手动调用党员相关-党建能力执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId); return new Result(); } 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 1533d70143..c4f3f8f231 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 @@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; +import com.epmet.dto.extract.UserGroupIdDTO; import com.epmet.dto.extract.form.GridHeartedFormDTO; import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.GridGroupUserCountResultDTO; @@ -225,4 +226,6 @@ public interface FactOriginGroupMainDailyDao extends BaseDao */ List selectPartyMemberGroupStaticByGrid(@Param("customerId") String customerId, @Param("dateId") String dateId); + + List selectGroupAndLeader(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/CalCpcIndexService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/CalCpcIndexService.java index cb9552dd4d..48cf376478 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/CalCpcIndexService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/CalCpcIndexService.java @@ -1,7 +1,5 @@ package com.epmet.service.evaluationindex.extract.dataToIndex; -import java.util.Map; - /** * 党员相关 * @@ -18,4 +16,7 @@ public interface CalCpcIndexService { * @Date 2020/9/17 14:08 **/ void calCpcPartyAbility(String customerId, String monthId); + + + void calCpcPartyAbilityV2(String customerId, String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java index b78ebc1588..817c412a3a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java @@ -1,7 +1,10 @@ package com.epmet.service.evaluationindex.extract.dataToIndex.impl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dto.extract.UserGroupIdDTO; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import com.epmet.service.evaluationindex.extract.dataToIndex.CalCpcIndexService; @@ -9,8 +12,10 @@ import com.epmet.service.evaluationindex.extract.todata.*; import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyService; import com.epmet.service.group.GroupDataService; import com.epmet.service.stats.DimCustomerPartymemberService; +import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -20,6 +25,8 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.CompletableFuture; +import java.util.stream.Collectors; /** * 党员相关 @@ -78,6 +85,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { Map joinThreeMeetsCountMap=calJoinThreeMeetsCount(customerId,monthId); //可以先查询出每个党员的 自建群 + //todo Map> userCreatedGroups = queryUserCreatedGroups(customerId, indexPartyAblityCpcList); //6、党员自建群群众人数 :和评价周期无关 Map groupUserCountMap = calgroupUserCount(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups); @@ -134,6 +142,237 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { factIndexPartyAblityCpcMonthlyService.delAndSavePartyAblityCpcMonthly(customerId,monthId,indexPartyAblityCpcList); } + @Override + public void calCpcPartyAbilityV2(String customerId, String monthId) { + //1、构造初始值 当前客户下所有的党员 + List indexPartyAblityCpcList = dimCustomerPartymemberService.selectPartyMemberList(customerId); + if (CollectionUtils.isEmpty(indexPartyAblityCpcList)) { + log.info("dim_customer_partymember do not any records customerId=" + customerId); + return; + } + + //可以先查询出每个党员的 自建群 + Map> userCreatedGroups = queryUserCreatedGroups(customerId, indexPartyAblityCpcList); + + CompletableFuture> createTopicCountFuture = CompletableFuture.supplyAsync(() -> { + return calCreateTopicCount(customerId, monthId); + }); + + CompletableFuture> joinTopicCountFuture = CompletableFuture.supplyAsync(() -> { + return calJoinTopicCount(customerId, monthId); + }); + + CompletableFuture> shiftIssueCountFuture = CompletableFuture.supplyAsync(() -> { + return calShiftIssueCount(customerId, monthId); + }); + + CompletableFuture> shiftProjectCountFuture = CompletableFuture.supplyAsync(() -> { + return calShiftProjectCount(customerId, monthId); + }); + + CompletableFuture> joinThreeMeetsCountFuture = CompletableFuture.supplyAsync(() -> { + return calJoinThreeMeetsCount(customerId, monthId); + }); + + + CompletableFuture> groupUserCountFuture = CompletableFuture.supplyAsync(() -> { + return calgroupUserCount(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups); + }); + + + CompletableFuture> groupActiveUserCountFuture = CompletableFuture.supplyAsync(() -> { + return calGroupActiveUserCount(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups); + }); + + + CompletableFuture> groupTopicCountFuture = CompletableFuture.supplyAsync(() -> { + return calGroupTopicCount(customerId, monthId); + }); + + + CompletableFuture> topicToIssueRatioFuture = CompletableFuture.supplyAsync(() -> { + return caltopicToIssueRatio(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups); + }); + + Map createTopicCountMap = new HashMap<>(); + Map joinTopicCountMap = new HashMap<>(); + Map shiftIssueCountMap = new HashMap<>(); + Map shiftProjectCountMap = new HashMap<>(); + Map joinThreeMeetsCountMap = new HashMap<>(); + Map groupUserCountMap = new HashMap<>(); + Map groupActiveUserCountMap = new HashMap<>(); + Map groupTopicCountMap = new HashMap<>(); + Map topicToIssueRatioMap = new HashMap<>(); + try { + //1、党员提出话题数 + createTopicCountMap = createTopicCountFuture.get(); + } catch (Exception e) { + log.error("党员相关-党建能力原始指标值【党员提出话题数】计算异常:{}", ExceptionUtils.getErrorStackTrace(e)); + } + + try{ + //2、党员参与话题数(支持、反对、评论、浏览)---目前只统计 党员评论话题次数之和 + joinTopicCountMap = joinTopicCountFuture.get(); + } catch (Exception e) { + log.error("党员相关-党建能力原始指标值【党员参与话题数】计算异常:{}", ExceptionUtils.getErrorStackTrace(e)); + } + try{ + //3、党员提出的话题转议题数 + shiftIssueCountMap = shiftIssueCountFuture.get(); + + } catch (Exception e) { + log.error("党员相关-党建能力原始指标值【党员提出的话题转议题数】计算异常:{}", ExceptionUtils.getErrorStackTrace(e)); + } + try{ + //4、党员提出的议题转项目数 + shiftProjectCountMap = shiftProjectCountFuture.get(); + } catch (Exception e) { + log.error("党员相关-党建能力原始指标值【党员提出的议题转项目数】计算异常:{}", ExceptionUtils.getErrorStackTrace(e)); + } + try{ + //5、参加“三会一课”次数 默认0 :当前用户在本月内活动签到次数 限制活动分类编码100001 三会一课 + joinThreeMeetsCountMap = joinThreeMeetsCountFuture.get(); + } catch (Exception e) { + log.error("党员相关-党建能力原始指标值【参加“三会一课”次数】计算异常:{}", ExceptionUtils.getErrorStackTrace(e)); + } + try{ + //6、党员自建群群众人数 :和评价周期无关 + groupUserCountMap = groupUserCountFuture.get(); + } catch (Exception e) { + log.error("党员相关-党建能力原始指标值【党员自建群群众人数】计算异常:{}", ExceptionUtils.getErrorStackTrace(e)); + } + try{ + //7、党员自建群活跃群众人数 + groupActiveUserCountMap = groupActiveUserCountFuture.get(); + } catch (Exception e) { + log.error("党员相关-党建能力原始指标值【党员自建群活跃群众人数】计算异常:{}", ExceptionUtils.getErrorStackTrace(e)); + } + try{ + //8、党员自建群活跃度——话题数:从话题表中统计党员自建群i的话题总数;对所有自建群话题数累加。 + groupTopicCountMap = groupTopicCountFuture.get(); + } catch (Exception e) { + log.error("党员相关-党建能力原始指标值【党员自建群活跃度】计算异常:{}", ExceptionUtils.getErrorStackTrace(e)); + } + + try{ + //9、自建群活跃度——议题转项目率 + topicToIssueRatioMap = topicToIssueRatioFuture.get(); + } catch (Exception e) { + log.error("党员相关-党建能力原始指标值【自建群活跃度】计算异常:{}", ExceptionUtils.getErrorStackTrace(e)); + } + + List list = new ArrayList<>(); + List> partionList = Lists.partition(indexPartyAblityCpcList, 200); + List>> entityFutures = new ArrayList<>(); + //2、计算实际值,更新 + for (List partList : partionList) { + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); + Map finalCreateTopicCountMap = createTopicCountMap; + Map finalJoinTopicCountMap = joinTopicCountMap; + Map finalShiftIssueCountMap = shiftIssueCountMap; + Map finalShiftProjectCountMap = shiftProjectCountMap; + Map finalJoinThreeMeetsCountMap = joinThreeMeetsCountMap; + Map finalGroupUserCountMap = groupUserCountMap; + Map finalGroupActiveUserCountMap = groupActiveUserCountMap; + Map finalGroupTopicCountMap = groupTopicCountMap; + Map finalTopicToIssueRatioMap = topicToIssueRatioMap; + //目前平阴2100多个党员,200个一组,开一个线程 + CompletableFuture> future = CompletableFuture.supplyAsync(() -> { + return constructEntity(monthId, + quarterId, + yearId, + partList, + finalCreateTopicCountMap, + finalJoinTopicCountMap, + finalShiftIssueCountMap, + finalShiftProjectCountMap, + finalJoinThreeMeetsCountMap, + finalGroupUserCountMap, + finalGroupActiveUserCountMap, + finalGroupTopicCountMap, + finalTopicToIssueRatioMap); + }); + + entityFutures.add(future); + } + + for (CompletableFuture> entityFuture : entityFutures) { + try { + List partList = entityFuture.get(); + list.addAll(partList); + } catch (InterruptedException e) { + log.error("党员相关-党建能力原始指标构造异常:{}", ExceptionUtils.getErrorStackTrace(e)); + } catch (Exception e) { + log.error("党员相关-党建能力原始指标构造异常:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } + //3、删除之前统计过的、批插入批量插入 + factIndexPartyAblityCpcMonthlyService.delAndSavePartyAblityCpcMonthly(customerId, monthId, list); + } + + + private List constructEntity(String monthId, + String quarterId, + String yearId, + List partList, + Map createTopicCountMap, + Map joinTopicCountMap, + Map shiftIssueCountMap, + Map shiftProjectCountMap, + Map joinThreeMeetsCountMap, + Map groupUserCountMap, + Map groupActiveUserCountMap, + Map groupTopicCountMap, + Map topicToIssueRatioMap) { + List resultList = new ArrayList<>(); + for (FactIndexPartyAblityCpcMonthlyEntity temp : partList) { + FactIndexPartyAblityCpcMonthlyEntity indexPartyAblityCpcEntity = ConvertUtils.sourceToTarget(temp, FactIndexPartyAblityCpcMonthlyEntity.class); + indexPartyAblityCpcEntity.setMonthId(monthId); + indexPartyAblityCpcEntity.setQuarterId(quarterId); + indexPartyAblityCpcEntity.setYearId(yearId); + //1、党员提出话题数 + if (MapUtils.isNotEmpty(createTopicCountMap) && createTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setCreateTopicCount(createTopicCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } + //2、党员参与话题数(支持、反对、评论、浏览)---目前只统计 党员评论话题次数之和 + if (MapUtils.isNotEmpty(joinTopicCountMap) && joinTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setJoinTopicCount(joinTopicCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } + //3、党员提出的话题转议题数 + if (MapUtils.isNotEmpty(shiftIssueCountMap) && shiftIssueCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setShiftIssueCount(shiftIssueCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } + //4、党员提出的议题转项目数 + if (MapUtils.isNotEmpty(shiftProjectCountMap) && shiftProjectCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setShiftProjectCount(shiftProjectCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } + //5、参加“三会一课”次数 目前没有此业务,默认0 : 当前用户在本月内活动签到次数 限制活动分类编码100001 三会一课 + if (MapUtils.isNotEmpty(joinThreeMeetsCountMap) && joinThreeMeetsCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setJoinThreeMeetsCount(joinThreeMeetsCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } + //6、党员自建群群众人数 + if (MapUtils.isNotEmpty(groupUserCountMap) && groupUserCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setGroupUserCount(groupUserCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } + //7、党员自建群活跃群众人数 + if (MapUtils.isNotEmpty(groupActiveUserCountMap) && groupActiveUserCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setGroupActiveUserCount(groupActiveUserCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } + //8、党员自建群活跃度——话题数 + if (MapUtils.isNotEmpty(groupTopicCountMap) && groupTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setGroupTopicCount(groupTopicCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } + //9、自建群活跃度——议题转项目率 + if (MapUtils.isNotEmpty(topicToIssueRatioMap) && topicToIssueRatioMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setTopicToIssueRatio(topicToIssueRatioMap.get(indexPartyAblityCpcEntity.getUserId())); + } + resultList.add(indexPartyAblityCpcEntity); + } + return resultList; + } + + /** * @param customerId * @param partyMemberList @@ -144,7 +383,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { **/ private Map> queryUserCreatedGroups(String customerId, List partyMemberList) { Map> map = new HashMap<>(); - for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) { + /*for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) { //查询当前党员建了多少个组 List groupIdList=factOriginGroupMainDailyService.selectGroupIds(customerId,partyMember.getUserId()); if (CollectionUtils.isEmpty(groupIdList)) { @@ -153,6 +392,17 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { } else { map.put(partyMember.getUserId(), groupIdList); } + }*/ + //查询出所有的小组,按照组长 + List list = factOriginGroupMainDailyService.selectGroupAndLeader(customerId); + Map> userGroupIdMap = list.stream().collect(Collectors.toMap(UserGroupIdDTO::getUserId, UserGroupIdDTO::getGroupIdList)); + for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) { + if (MapUtils.isEmpty(userGroupIdMap) || !userGroupIdMap.containsKey(partyMember.getUserId())) { + map.put(partyMember.getUserId(), new ArrayList<>()); + continue; + } else { + map.put(partyMember.getUserId(), userGroupIdMap.get(partyMember.getUserId())); + } } return map; } @@ -265,7 +515,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { //查询当前党员建了多少个组 List groupIdList = userCreatedGroups.get(partyMember.getUserId()); if (CollectionUtils.isEmpty(groupIdList)) { - log.info("当前党员userId="+partyMember.getUserId()+"没有创建过小组, 【党员相关-党员自建群群众人数】赋值0"); + // log.info("当前党员userId="+partyMember.getUserId()+"没有创建过小组, 【党员相关-党员自建群群众人数】赋值0"); map.put(partyMember.getUserId(), NumConstant.ZERO); continue; } @@ -311,7 +561,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { //1、查询当前党员建了多少个组 List groupIdList = userCreatedGroups.get(partyMember.getUserId()); if (CollectionUtils.isEmpty(groupIdList)) { - log.warn("当前党员userId="+partyMember.getUserId()+"没有创建过小组, 【党员相关-党员自建群活跃群众人数】赋值0"); + // log.warn("当前党员userId="+partyMember.getUserId()+"没有创建过小组, 【党员相关-党员自建群活跃群众人数】赋值0"); map.put(partyMember.getUserId(), NumConstant.ZERO); continue; } 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 89beadf503..6b88a66d94 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 @@ -19,6 +19,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.UserGroupIdDTO; import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.GridGroupUserCountResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; @@ -125,4 +126,10 @@ public interface FactOriginGroupMainDailyService extends BaseService getPartyMemberGroupStatic(String customerId, String dateId, String type); + /** + * 查询出小组id ,组长userId + * @param customerId + * @return + */ + List selectGroupAndLeader(String customerId); } 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 164b0b76dc..05c0720986 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 @@ -22,8 +22,8 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; -import com.epmet.dao.evaluationindex.extract.FactOriginGroupMemberDailyDao; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; +import com.epmet.dto.extract.UserGroupIdDTO; import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.GridGroupUserCountResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; @@ -198,4 +198,15 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl selectGroupAndLeader(String customerId) { + return baseDao.selectGroupAndLeader(customerId); + } + } 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 c8c672e57f..4b4e709722 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 @@ -382,4 +382,22 @@ GRID_ID + + + + + + + + + + From d5bca533c53c903a40ba5141594a924fd0afb615 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 2 Mar 2022 10:04:37 +0800 Subject: [PATCH 02/14] =?UTF-8?q?calCpcPartyAbilityV2=E8=AF=95=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/dataToIndex/impl/CalCpcIndexServiceImpl.java | 1 - 1 file changed, 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java index 817c412a3a..7694f0cb87 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java @@ -85,7 +85,6 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { Map joinThreeMeetsCountMap=calJoinThreeMeetsCount(customerId,monthId); //可以先查询出每个党员的 自建群 - //todo Map> userCreatedGroups = queryUserCreatedGroups(customerId, indexPartyAblityCpcList); //6、党员自建群群众人数 :和评价周期无关 Map groupUserCountMap = calgroupUserCount(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups); From 861d46638ecb76959a21f37e34d977668df56081 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 2 Mar 2022 10:42:04 +0800 Subject: [PATCH 03/14] 500 --- .../impl/CalCpcIndexServiceImpl.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java index 7694f0cb87..cb5620eb0a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java @@ -261,7 +261,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { } List list = new ArrayList<>(); - List> partionList = Lists.partition(indexPartyAblityCpcList, 200); + List> partionList = Lists.partition(indexPartyAblityCpcList, 500); List>> entityFutures = new ArrayList<>(); //2、计算实际值,更新 for (List partList : partionList) { @@ -415,11 +415,13 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { * @Date 2020/9/18 10:59 **/ private Map calCreateTopicCount(String customerId, String monthId) { + long startCpc = System.currentTimeMillis(); List list = factOriginTopicMainDailyService.selectPartyCreateTopicCount(customerId, monthId); Map resultMap = new HashMap<>(); for (CpcIndexCommonDTO cpcIndexCommonDTO: list) { resultMap.put(cpcIndexCommonDTO.getUserId(), cpcIndexCommonDTO.getIndexValue()); } + log.warn("1、党员相关-党建能力【党员提出话题数】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId); return resultMap; } @@ -432,11 +434,13 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { * @Date 2020/9/18 13:33 **/ private Map calJoinTopicCount(String customerId, String monthId) { + long startCpc = System.currentTimeMillis(); List list = factOriginTopicLogDailyService.selectJoinTopicCount(customerId, monthId); Map resultMap = new HashMap<>(); for (CpcIndexCommonDTO cpcIndexCommonDTO : list) { resultMap.put(cpcIndexCommonDTO.getUserId(), cpcIndexCommonDTO.getIndexValue()); } + log.warn("2、党员相关-党建能力【党员参与话题数】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId); return resultMap; } @@ -450,11 +454,13 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { * @Date 2020/9/18 13:53 **/ private Map calShiftIssueCount(String customerId, String monthId) { + long startCpc = System.currentTimeMillis(); List list = issueExtractService.selectShiftIssueCount(customerId, monthId); Map resultMap = new HashMap<>(); for (CpcIndexCommonDTO cpcIndexCommonDTO : list) { resultMap.put(cpcIndexCommonDTO.getUserId(), cpcIndexCommonDTO.getIndexValue()); } + log.warn("3、党员相关-党建能力【党员提出的话题转议题数】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId); return resultMap; } @@ -467,12 +473,14 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { * @Date 2020/9/18 14:10 **/ private Map calShiftProjectCount(String customerId, String monthId) { + long startCpc = System.currentTimeMillis(); //查询fact_origin_project_main_daily 表 中议题的议题的状态为 shift_ List list = factOriginProjectMainDailyService.selectShiftProjectCount(customerId, monthId); Map resultMap = new HashMap<>(); for (CpcIndexCommonDTO cpcIndexCommonDTO : list) { resultMap.put(cpcIndexCommonDTO.getUserId(), cpcIndexCommonDTO.getIndexValue()); } + log.warn("4、党员相关-党建能力【党员提出的议题转项目数】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId); return resultMap; } @@ -485,12 +493,14 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { * @Date 2021/5/12 13:38 **/ private Map calJoinThreeMeetsCount(String customerId, String monthId) { + long startCpc = System.currentTimeMillis(); //查询小组活动签到表,计算用户在本月内签到的活动次数 List list=groupDataService.selectJoinThreeMeetsCount(customerId,monthId); Map resultMap = new HashMap<>(); for (CpcIndexCommonDTO cpcIndexCommonDTO : list) { resultMap.put(cpcIndexCommonDTO.getUserId(), cpcIndexCommonDTO.getIndexValue()); } + log.warn("5、党员相关-党建能力【参加“三会一课”次数】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId); return resultMap; } @@ -505,6 +515,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { private Map calgroupUserCount(String customerId, String monthId, List partyMemberList, Map> userCreatedGroups) { + long startCpc = System.currentTimeMillis(); /*含义:评价周期内,党员自建群中群众成员数。 数据来源:用户社群关系表。 计算方法:对党员i的所有j个自建群,从用户社群关系表中统计属于每个自建群的群众用户总人数,并对j个群众用户总数进行不重复累加。 @@ -528,6 +539,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { map.put(partyMember.getUserId(), memberIdList.size()); } } + log.warn("6、党员相关-党建能力【党员自建群群众人数】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId); return map; } @@ -543,6 +555,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { private Map calGroupActiveUserCount(String customerId, String monthId, List partyMemberList, Map> userCreatedGroups) { + long startCpc = System.currentTimeMillis(); /*含义:评价周期内,党员自建群中活跃群众成员数。所谓活跃群成员,即评价周期内参与话题、事件评论、点赞、点踩总次数大于给定阈值的群众用户。 数据来源:话题用户阅读表、话题评论用户表态表、话题评论表、事件点赞点踩表、事件评论点赞点踩表、事件评论表、用户信息表。 计算方法: @@ -570,6 +583,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { map.put(partyMember.getUserId(), NumConstant.ZERO); continue; } + //todo 可以先把本月内评论的用户+本月内表决过的用户 集合查询出来。避免循环查询 //3、判断每个成员是否 “活跃” for (String memberId : memberIdList) { //1、判断成员在本月内是否评论过 @@ -587,6 +601,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { //赋值每个党员的 -- 党员自建群活跃群众人数 map.put(partyMember.getUserId(), groupActiveUserCount); } + log.warn("7、党员相关-党建能力【党员自建群活跃群众人数】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId); return map; } @@ -600,6 +615,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { * @Date 2020/9/18 14:31 **/ private Map calGroupTopicCount(String customerId, String monthId) { + long startCpc = System.currentTimeMillis(); /*含义:评价周期内,党员自建群中话题发布数。 数据来源:话题表。 计算方法:从话题表中统计党员自建群i的话题总数;对所有自建群话题数累加。 @@ -609,6 +625,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { for (CpcIndexCommonDTO dto : list) { resultMap.put(dto.getUserId(), dto.getIndexValue()); } + log.warn("8、党员相关-党建能力【党员自建群活跃度——话题数】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId); return resultMap; } @@ -623,6 +640,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { String monthId, List partyMemberList, Map> userCreatedGroups) { + long startCpc = System.currentTimeMillis(); Map map = new HashMap<>(); for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) { //如果党员自建群为空,直接赋值0 @@ -657,6 +675,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { BigDecimal topicToIssueRatio = new BigDecimal(topicToIssueRatioStr).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); map.put(partyMember.getUserId(), topicToIssueRatio); } + log.warn("9、党员相关-党建能力【自建群活跃度——议题转项目率】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId); return map; } From 51025f50580cf0bee40a80acd64b91d2fe282b0d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 2 Mar 2022 13:43:58 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E5=85=9A=E5=91=98=E8=87=AA=E5=BB=BA?= =?UTF-8?q?=E7=BE=A4=E6=B4=BB=E8=B7=83=E7=BE=A4=E4=BC=97=E4=BA=BA=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactOriginIssueLogDailyDao.java | 8 +++++++ .../extract/FactOriginTopicLogDailyDao.java | 8 +++++++ .../impl/CalCpcIndexServiceImpl.java | 18 +++++++++++---- .../FactOriginTopicLogDailyService.java | 8 +++++++ .../extract/todata/IssueExtractService.java | 8 +++++++ .../FactOriginTopicLogDailyServiceImpl.java | 12 ++++++++++ .../todata/impl/IssueExtractServiceImpl.java | 13 +++++++++++ .../extract/FactOriginIssueLogDailyDao.xml | 22 ++++++++++++++++++ .../extract/FactOriginTopicLogDailyDao.xml | 23 +++++++++++++++++++ 9 files changed, 116 insertions(+), 4 deletions(-) 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 5e9177adf7..aa77da7fc6 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 @@ -170,4 +170,12 @@ public interface FactOriginIssueLogDailyDao extends BaseDao */ List getClosedIssueIncr(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 查询出本月内做过议题表决的用户id + * @param customerId + * @param monthId + * @return + */ + List queryVoteUserIds(@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/evaluationindex/extract/FactOriginTopicLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java index ef3ab5e833..0e8b939582 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java @@ -103,4 +103,12 @@ public interface FactOriginTopicLogDailyDao extends BaseDao selectPartyActiveTopic(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("isParty") Integer isParty); + + /** + * 查询出本月内,评论过话题的用户id + * @param customerId + * @param monthId + * @return + */ + List queryCommentTopicUserIds(@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/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java index cb5620eb0a..90f39088ea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java @@ -583,19 +583,29 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { map.put(partyMember.getUserId(), NumConstant.ZERO); continue; } - //todo 可以先把本月内评论的用户+本月内表决过的用户 集合查询出来。避免循环查询 + //可以先把本月内评论的用户+本月内表决过的用户 集合查询出来。避免循环查询 + List commentTopicUserIds=factOriginTopicLogDailyService.queryCommentTopicUserIds(customerId,monthId); + List voteUserIds=issueExtractService.queryVoteUserIds(customerId,monthId); //3、判断每个成员是否 “活跃” for (String memberId : memberIdList) { + //注释2022.03.02 //1、判断成员在本月内是否评论过 - Integer topicCommentCount = factOriginTopicLogDailyService.selectUserCommentCount(memberId, customerId, monthId); + /*Integer topicCommentCount = factOriginTopicLogDailyService.selectUserCommentCount(memberId, customerId, monthId); if (topicCommentCount > 0) { groupActiveUserCount++; continue; - } + }*/ //2、判断成员在本月内是否表决过(支持or反对)议题 - Integer voteCount = issueExtractService.selectCountUserVote(memberId, customerId, monthId); + /*Integer voteCount = issueExtractService.selectCountUserVote(memberId, customerId, monthId); if (voteCount > 0) { groupActiveUserCount++; + }*/ + if (CollectionUtils.isNotEmpty(commentTopicUserIds) && commentTopicUserIds.contains(memberId)) { + groupActiveUserCount++; + continue; + } + if (CollectionUtils.isNotEmpty(voteUserIds) && voteUserIds.contains(memberId)) { + groupActiveUserCount++; } } //赋值每个党员的 -- 党员自建群活跃群众人数 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicLogDailyService.java index 7c43394dea..6820edb992 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicLogDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicLogDailyService.java @@ -79,4 +79,12 @@ public interface FactOriginTopicLogDailyService extends BaseService selectPartyActiveTopic(String customerId, String monthId,Integer isParty); + + /** + * 查询出本月内,评论过话题的用户id + * @param customerId + * @param monthId + * @return + */ + List queryCommentTopicUserIds(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/IssueExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java index 85caea8cc5..010791542e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java @@ -107,4 +107,12 @@ public interface IssueExtractService { * @date 2020/9/21 9:37 上午 */ List selectPartyActiveIssueVote(String customerId, String monthId, Integer isParty); + + /** + * 查询出本月内做过议题表决的用户id + * @param customerId + * @param monthId + * @return + */ + List queryVoteUserIds(String customerId, String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicLogDailyServiceImpl.java index 70ecc1807f..46da054bd8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicLogDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicLogDailyServiceImpl.java @@ -108,4 +108,16 @@ public class FactOriginTopicLogDailyServiceImpl extends BaseServiceImpl selectPartyActiveTopic(String customerId, String monthId, Integer isParty) { return baseDao.selectPartyActiveTopic(customerId, monthId, isParty); } + + /** + * 查询出本月内,评论过话题的用户id + * + * @param customerId + * @param monthId + * @return + */ + @Override + public List queryCommentTopicUserIds(String customerId, String monthId) { + return baseDao.queryCommentTopicUserIds(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/todata/impl/IssueExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java index 4cdd1368e6..d55cfdcc71 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java @@ -374,4 +374,17 @@ public class IssueExtractServiceImpl implements IssueExtractService { public List selectPartyActiveIssueVote(String customerId, String monthId, Integer isParty) { return issueLogDailyDao.selectPartyActiveIssueVote(customerId, monthId, isParty); } + + /** + * 查询出本月内做过议题表决的用户id + * + * @param customerId + * @param monthId + * @return + */ + @Override + public List queryVoteUserIds(String customerId, String monthId) { + return issueLogDailyDao.queryVoteUserIds(customerId,monthId); + } + } 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 995c6cebad..6c8aa06b96 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 @@ -237,4 +237,26 @@ GRID_ID, OPERATION_USER_ID + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml index 1d7bc88cab..8e6f652f07 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml @@ -143,4 +143,27 @@ AND CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + + + \ No newline at end of file From 936932d060d7e31ce7378cfec8b6f4b4d38bb60c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 2 Mar 2022 14:53:50 +0800 Subject: [PATCH 05/14] calCpcPartyAbilityV2 --- .../dataToIndex/impl/IndexOriginExtractServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java index b07c82ceb9..1548abed61 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java @@ -101,7 +101,8 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService executorService.submit(() -> { try { long startCpc = System.currentTimeMillis(); - calCpcIndexService.calCpcPartyAbility(customerId, monthId); + // calCpcIndexService.calCpcPartyAbility(customerId, monthId); + calCpcIndexService.calCpcPartyAbilityV2(customerId, monthId); log.info("党员相关-党建能力执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, param.getCustomerId()); } catch (Exception e) { log.error("抽取【党员相关数据】发生异常,参数:" + JSON.toJSONString(param), e); From 19f1d22d1d44aebabea7e29b0397b40f2c5cad44 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 2 Mar 2022 15:39:26 +0800 Subject: [PATCH 06/14] add index sql --- .../db/migration/V0.0.29__addindex_forcpcability.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.29__addindex_forcpcability.sql diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.29__addindex_forcpcability.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.29__addindex_forcpcability.sql new file mode 100644 index 0000000000..48f8576eb6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.29__addindex_forcpcability.sql @@ -0,0 +1,5 @@ +-- stat库执行 +alter table fact_origin_topic_main_daily add index `IDX_TOPIC_MAIN_GROUP_ID` (`GROUP_ID`); +alter table fact_origin_project_main_daily add index `IDX_P_MAIN_TOPIC_ID` (`TOPIC_ID`); +alter table fact_origin_issue_main_daily add index `IDX_ISSUE_MAIN_TOPIC_ID` (`TOPIC_ID`); +alter table fact_origin_group_member_daily add index `IDX_GM_GROUP_ID` (`GROUP_ID`); \ No newline at end of file From 99ded4a8ea6c3aa2620dd5861cadebde52b7763b Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 2 Mar 2022 16:35:01 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=98=B2=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/ArticleController.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index d81affca3a..4c7457f4c3 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -19,6 +19,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.RequirePermission; +import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.security.dto.TokenDto; @@ -218,6 +219,7 @@ public class ArticleController { * @param formDTO * @throws Exception */ + @NoRepeatSubmit @PostMapping("publish") @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) public Result publishArticle(@LoginUser TokenDto tokenDto, @RequestBody PublishArticleFormDTO formDTO) throws Exception { @@ -234,6 +236,7 @@ public class ArticleController { * @param formDTO * @throws Exception */ + @NoRepeatSubmit @PostMapping("manualpublish") @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) public Result manualPublish(@LoginUser TokenDto tokenDto, @RequestBody PublishArticleFormDTO formDTO) throws Exception { From a195f893230c2f08ae6dbfbc743c6029e3fd6f19 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 3 Mar 2022 09:52:53 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=AF=BC=E5=87=BA=E6=96=87=E4=BB=B6=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E4=B8=8D=E5=AF=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datareport/controller/screen/ScreenProjectController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java index 5b9e5c314d..28cf89d084 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java @@ -204,6 +204,7 @@ public class ScreenProjectController { //tokenDto.setUserId("36bc0fb38565ecdebf8ab9b476b44548"); //tokenDto.setCustomerId("45687aa479955f9d06204d415238f7cc"); ValidatorUtils.validateEntity(formDTO, ProjectCategoryFormDTO.CategoryProjectExportForm.class); + String openTime = formDTO.getStartTime(); List data = screenProjectService.selectProjectCategory(formDTO, tokenDto); String templatePath = "excel/project_category_temp.xlsx"; @@ -216,7 +217,7 @@ public class ScreenProjectController { Map mapData = new HashMap<>(); mapData.put("list",resultDTOList); mapData.put("orgName", formDTO.getOrgName()); - mapData.put("exportDate",getExportDateStr(formDTO.getStartTime(),formDTO.getEndTime())); + mapData.put("exportDate", getExportDateStr(openTime, formDTO.getEndTime())); Workbook workbook = ExcelExportUtil.exportExcel(new TemplateExportParams(templatePath), mapData); response.setHeader("content-Type", "application/vnd.ms-excel"); response.addHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode("项目分类统计.xls", "UTF-8")); From b07057b14ca5539f187a2cc33abde23ec3f337e5 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 3 Mar 2022 10:29:49 +0800 Subject: [PATCH 09/14] NullPointerException --- .../main/java/com/epmet/service/impl/IcResiUserServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index f912200041..1e22b13b33 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -641,7 +641,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl nameList=new ArrayList<>(); for(String codePath:demandCodePath){ - if(codePath.contains(StrConstant.COMMA)){ + if (StringUtils.isNotBlank(codePath) && codePath.contains(StrConstant.COMMA)) { String[] codeAtt=codePath.split(StrConstant.COMMA); String code=codeAtt[codeAtt.length-1]; if(StringUtils.isNotBlank(code)&&demandDictMap.containsKey(code)){ From c265a18ffb7109ce8225034fce5da1860df04dfa Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 3 Mar 2022 12:06:58 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactOriginProjectOrgPeriodDailyDao.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml index 9515803a6b..c346dda21a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml @@ -40,12 +40,12 @@ WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} - AND (DATE_FORMAT(INFORMED_DATE,"%Y%m%d") >= #{dateId} OR DATE_FORMAT(HANDLED_DATE,"%Y%m%d") >= #{dateId} OR DATE_FORMAT(PERIOD_TILL_REPLY_FIRSTLY,"%Y%m%d") >= #{dateId}) PROJECT_ID = #{item} + AND (DATE_FORMAT(INFORMED_DATE,"%Y%m%d") >= #{dateId} OR DATE_FORMAT(HANDLED_DATE,"%Y%m%d") >= #{dateId} OR DATE_FORMAT(PERIOD_TILL_REPLY_FIRSTLY,"%Y%m%d") >= #{dateId}) SELECT @@ -141,8 +141,8 @@ GROUP BY fp.ORG_ID - - + + - \ No newline at end of file + From 1593bf6362a47331fbc44c1345075777b267869a Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 3 Mar 2022 14:57:44 +0800 Subject: [PATCH 11/14] =?UTF-8?q?=E7=AC=AC=E4=B8=80=E7=89=88=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=BB=9F=E8=AE=A1=EF=BC=8C=E5=B9=B3=E9=98=B4=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=BB=9F=E8=AE=A1=E6=97=B6=E5=8F=AA=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=BA=86=E4=BA=94=E4=B8=AA=E8=A1=97=E9=81=93=E7=9A=84=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E4=B8=89=E4=B8=AA=E6=98=AF=E4=B8=8A=E6=8A=A5=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E7=8E=B0=E5=9C=A8=E8=BF=99=E4=B8=89=E4=B8=AA=E8=A1=97?= =?UTF-8?q?=E9=81=93=E5=9C=A8=E5=B0=8F=E7=A8=8B=E5=BA=8F=E4=B9=9F=E4=BA=A7?= =?UTF-8?q?=E7=94=9F=E4=BA=86=E6=95=B0=E6=8D=AE=E9=9C=80=E8=A6=81=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E4=B8=8A=EF=BC=8C=E5=9B=A0=E6=AD=A4=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=BB=84=E7=BB=87=E7=BD=91=E6=A0=BC=E7=BB=B4?= =?UTF-8?q?=E5=BA=A6=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/org/CustomerGridDao.java | 7 ++++ .../service/impl/StatsProjectServiceImpl.java | 35 ++++++++++++++++--- .../service/org/CustomerGridService.java | 8 +++++ .../org/impl/CustomerGridServiceImpl.java | 10 ++++++ .../resources/mapper/org/CustomerGridDao.xml | 13 +++++++ 5 files changed, 68 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java index fc651f6c37..c4f683ca2b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java @@ -25,6 +25,7 @@ import com.epmet.dto.org.CustomerStaffGridDTO; import com.epmet.dto.org.GridInfoDTO; import com.epmet.dto.org.form.GridBaseInfoFormDTO; import com.epmet.dto.org.result.CustomerGridDTO; +import com.epmet.dto.stats.DimGridDTO; import com.epmet.dto.user.form.StaffBaseInfoFormDTO; import com.epmet.dto.user.result.GridUserInfoDTO; import com.epmet.entity.org.CustomerGridEntity; @@ -118,4 +119,10 @@ public interface CustomerGridDao extends BaseDao { * @Description 查询工作人员所属网格信息 **/ List getStaffGrid(StaffBaseInfoFormDTO formDTO); + + /** + * @Author sun + * @Description 查询客户下有效网格列表 + **/ + List gridListByCustomerId(@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/service/impl/StatsProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java index eb849391a9..852fb8c47d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java @@ -1,17 +1,23 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.PingYinConstant; import com.epmet.constant.ProjectConstant; +import com.epmet.dto.ProjectDTO; import com.epmet.dto.StatsFormDTO; import com.epmet.dto.project.form.MonthProjectListFormDTO; import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.dto.stats.DimGridDTO; import com.epmet.entity.issue.IssueEntity; +import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectProcessEntity; import com.epmet.entity.stats.*; import com.epmet.service.Issue.IssueService; import com.epmet.service.StatsProjectService; +import com.epmet.service.org.CustomerAgencyService; import com.epmet.service.org.CustomerGridService; import com.epmet.service.project.ProjectProcessService; import com.epmet.service.project.ProjectService; @@ -63,6 +69,8 @@ public class StatsProjectServiceImpl implements StatsProjectService { private FactGridProjectMonthlyService factGridProjectMonthlyService; @Autowired private CustomerGridService customerGridService; + @Autowired + private CustomerAgencyService customerAgencyService; /** * @Author sun @@ -108,10 +116,18 @@ public class StatsProjectServiceImpl implements StatsProjectService { DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); //2:根据客户Id查询机关维度表数据 - DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); - dimAgencyDTO.setCustomerId(customerId); - List dimAgencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); - + //2022.3.3 平阴数据统计时只统计了五个街道的 其他三个街道是上报的,现在这三个街道在小程序也产生了项目(例行工作)数据, + //但是dim维度表不能有这三个街道的组织,因此改查业务库组织列表数据 start sun + List dimAgencyList = new ArrayList<>(); + if (customerId.equals(PingYinConstant.PROD_PING_YIN_CUSTOMER_ID)) { + List agencyList = customerAgencyService.queryAgencyListByCustomerId(customerId); + dimAgencyList = ConvertUtils.sourceToTarget(agencyList, DimAgencyDTO.class); + } else { + DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); + dimAgencyDTO.setCustomerId(customerId); + dimAgencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); + } + //2022.3.3 end sun /* //2022.1.12 客户数据量大 调整计算逻辑,一千条已查询,封装数据,将这部分业务数据查询拿到子方法分页查询处理 sun //3:根据客户Id查询项目业务表已结案数据(查询传入日期及之前的数据) @@ -650,7 +666,16 @@ public class StatsProjectServiceImpl implements StatsProjectService { DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); //2:根据客户Id查询网格维度表数据 - List dimGridList = dimGridService.getGridListByCustomerId(customerId); + //2022.3.3 平阴数据统计时只统计了五个街道的 其他三个街道是上报的,现在这三个街道在小程序也产生了项目(例行工作)数据, + //但是dim维度表不能有这三个街道的组织,因此改查业务库网格列表数据 start sun + List dimGridList = new ArrayList<>(); + if (customerId.equals(PingYinConstant.PROD_PING_YIN_CUSTOMER_ID)) { + List gridList = customerGridService.gridListByCustomerId(customerId); + dimGridList = ConvertUtils.sourceToTarget(gridList, DimGridEntity.class); + } else { + dimGridList = dimGridService.getGridListByCustomerId(customerId); + } + //2022.3.3 end sun //3:根据客户Id查询项目业务表已结案数据(查询传入日期及之前的数据) ProjectEntity projectEntity = new ProjectEntity(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java index 5894fafa1b..0dd3fd62a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java @@ -8,9 +8,11 @@ import com.epmet.dto.org.CustomerStaffGridDTO; import com.epmet.dto.org.GridInfoDTO; import com.epmet.dto.org.form.GridBaseInfoFormDTO; import com.epmet.dto.org.result.CustomerGridDTO; +import com.epmet.dto.stats.DimGridDTO; import com.epmet.dto.user.form.StaffBaseInfoFormDTO; import com.epmet.dto.user.result.GridUserInfoDTO; import com.epmet.entity.org.CustomerGridEntity; +import com.epmet.entity.stats.DimGridEntity; import java.util.Date; import java.util.List; @@ -99,4 +101,10 @@ public interface CustomerGridService extends BaseService { * @Description 查询工作人员所属网格信息 **/ List getStaffGrid(StaffBaseInfoFormDTO formDTO); + + /** + * @Author sun + * @Description 查询客户下有效网格列表 + **/ + List gridListByCustomerId(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java index c9ad658627..10bfbc4fd5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java @@ -12,6 +12,7 @@ import com.epmet.dto.org.CustomerStaffGridDTO; import com.epmet.dto.org.GridInfoDTO; import com.epmet.dto.org.form.GridBaseInfoFormDTO; import com.epmet.dto.org.result.CustomerGridDTO; +import com.epmet.dto.stats.DimGridDTO; import com.epmet.dto.user.form.StaffBaseInfoFormDTO; import com.epmet.dto.user.result.GridUserInfoDTO; import com.epmet.entity.org.CustomerGridEntity; @@ -147,4 +148,13 @@ public class CustomerGridServiceImpl extends BaseServiceImpl gridListByCustomerId(String customerId) { + return customerGridDao.gridListByCustomerId(customerId); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml index 053c6004b0..adcaf8e50d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml @@ -185,4 +185,17 @@ + + \ No newline at end of file From a5602afed217e1b1d199272e898cc6617a429014 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 3 Mar 2022 15:53:47 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E7=AC=AC=E4=B8=80=E7=89=88=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=BB=9F=E8=AE=A1=EF=BC=8C=E5=B9=B3=E9=98=B4=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=BB=9F=E8=AE=A1=E6=97=B6=E5=8F=AA=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=BA=86=E4=BA=94=E4=B8=AA=E8=A1=97=E9=81=93=E7=9A=84=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E4=B8=89=E4=B8=AA=E6=98=AF=E4=B8=8A=E6=8A=A5=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E7=8E=B0=E5=9C=A8=E8=BF=99=E4=B8=89=E4=B8=AA=E8=A1=97?= =?UTF-8?q?=E9=81=93=E5=9C=A8=E5=B0=8F=E7=A8=8B=E5=BA=8F=E4=B9=9F=E4=BA=A7?= =?UTF-8?q?=E7=94=9F=E4=BA=86=E6=95=B0=E6=8D=AE=E9=9C=80=E8=A6=81=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E4=B8=8A=EF=BC=8C=E5=9B=A0=E6=AD=A4=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=BB=84=E7=BB=87=E7=BD=91=E6=A0=BC=E7=BB=B4?= =?UTF-8?q?=E5=BA=A6=E7=9A=84=E9=80=BB=E8=BE=91=20=20=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E5=B9=B3=E9=98=B4=E7=9A=84=E5=90=8C?= =?UTF-8?q?=E4=B8=80=E5=A4=A9=E7=BB=9F=E4=B8=80=E7=BB=84=E7=BB=87=E5=B0=B1?= =?UTF-8?q?=E4=BC=9A=E5=AD=98=E5=9C=A8=E4=B8=A4=E6=9D=A1=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=BA=86=20=E5=B0=B1=E9=9C=80=E8=A6=81sum=E5=92=8C=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/datastats/DatsStatsDao.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index be3c501bf3..2ada01f382 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -1004,7 +1004,8 @@ FROM ( SELECT DISTINCT - date_id dateId, project_total projectCount, closed_total closedProjectCount + + date_id dateId, SUM(project_total) projectCount, SUM(closed_total) closedProjectCount , agency_id orgId @@ -1028,6 +1029,7 @@ AND date_id #{endTime} + GROUP BY date_id, agency_id ORDER BY date_id ASC @@ -1035,6 +1037,7 @@ AND date_id =]]> #{startTime} AND date_id #{endTime} + GROUP BY date_id, agency_id ORDER BY date_id DESC From 7af68bb9f8082044072ffc72bf95306201653e39 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 3 Mar 2022 16:57:48 +0800 Subject: [PATCH 13/14] =?UTF-8?q?=E5=B9=B3=E9=98=B4=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E9=A1=B9=E7=9B=AE=E7=BB=9F=E8=AE=A1=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E5=BC=95=E8=B5=B7=E7=9A=84=E6=9F=A5=E8=AF=A2=E8=B0=83?= =?UTF-8?q?=E6=95=B4=EF=BC=8C=E4=B8=89=E4=B8=AA=E8=A1=97=E9=81=93=E7=9A=84?= =?UTF-8?q?=E5=90=8C=E4=B8=80=E7=BB=84=E7=BB=87=E6=88=96=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E4=B8=80=E5=A4=A9=E4=BC=9A=E5=AD=98=E5=9C=A8=E4=B8=A4=E6=9D=A1?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=95=B0=E6=8D=AE=20=E5=8F=AA=E6=98=AF?= =?UTF-8?q?=E5=AE=A2=E6=88=B7Id=E4=B8=8D=E5=90=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/datastats/DatsStatsDao.xml | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index 2ada01f382..26f74c4124 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -331,17 +331,19 @@ @@ -349,17 +351,19 @@ From dda659cd3eb53ec5f4a899aefc52cf96ddaacc47 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 4 Mar 2022 10:01:51 +0800 Subject: [PATCH 14/14] =?UTF-8?q?=E6=A6=86=E5=B1=B1=E5=8F=91=E7=A7=AF?= =?UTF-8?q?=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constant/SpecialCustomerOrgConstant.java | 23 +++++++++++-------- .../tools/utils/YuShanSysApiService.java | 12 +++++++++- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/SpecialCustomerOrgConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/SpecialCustomerOrgConstant.java index 05058b1211..e65434f0bd 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/SpecialCustomerOrgConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/SpecialCustomerOrgConstant.java @@ -18,14 +18,19 @@ public interface SpecialCustomerOrgConstant { */ String test="6e511da6816e53af4cda952365a26eb9"; - // /** - // * 榆山生产客户id - // */ - // String YUSHAN_PROD_CUSTOMER_ID = "46c55cb862d6d5e6d05d2ab61a1cc07e"; - // - // /** - // * 榆山测试客户id - // */ - // String YUSHAN_TEST_CUSTOMER_ID = "a4bbf298d8e427844038cee466f022ef"; + /** + * 榆山生产客户id + */ + String YUSHAN_PROD_CUSTOMER_ID = "46c55cb862d6d5e6d05d2ab61a1cc07e"; + + /** + * 榆山测试客户id + */ + String YUSHAN_TEST_CUSTOMER_ID = "a4bbf298d8e427844038cee466f022ef"; + + /** + * 生产平阴客户id + */ + String PING_YIN_CUSTOMER_ID="6f203e30de1a65aab7e69c058826cd80"; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YuShanSysApiService.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YuShanSysApiService.java index 9779c6d990..1a714fdffd 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YuShanSysApiService.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YuShanSysApiService.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.SpecialCustomerOrgConstant; import com.epmet.commons.tools.dto.form.UpdateUserPointsFormDTO; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.enums.ExternalApiEnum; import com.epmet.commons.tools.enums.ExternalServerEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; @@ -39,7 +40,16 @@ public class YuShanSysApiService { if (StringUtils.isBlank(customerId) || CollectionUtils.isEmpty(paramList)) { throw new RenException("参数错误"); } - String serverUrl = ExternalServerEnum.getUrl(customerId); + if (!SpecialCustomerOrgConstant.PING_YIN_CUSTOMER_ID.equals(customerId)) { + return; + } + String serverUrl = null; + EnvEnum currentEnv = EnvEnum.getCurrentEnv(); + if (EnvEnum.PROD.getCode().equals(currentEnv.getCode())) { + serverUrl = ExternalServerEnum.getUrl(SpecialCustomerOrgConstant.YUSHAN_PROD_CUSTOMER_ID); + } else if (EnvEnum.TEST.getCode().equals(currentEnv.getCode()) || EnvEnum.LOCAL.getCode().equals(currentEnv.getCode())) { + serverUrl = ExternalServerEnum.getUrl(SpecialCustomerOrgConstant.YUSHAN_TEST_CUSTOMER_ID); + } if (StringUtils.isBlank(serverUrl)) { log.warn(String.format("当前客户:%s,未配置服务器地址", customerId)); return;