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;
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..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 @@
@@ -1004,7 +1008,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 +1033,7 @@
AND date_id #{endTime}
+ GROUP BY date_id, agency_id
ORDER BY date_id ASC
@@ -1035,6 +1041,7 @@
AND date_id =]]> #{startTime}
AND date_id #{endTime}
+ GROUP BY date_id, agency_id
ORDER BY date_id DESC
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"));
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/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/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/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..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
@@ -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;
/**
* 党员相关
@@ -134,6 +141,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