diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java
index c2aaddf70c..67aced6dbe 100644
--- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java
+++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java
@@ -127,4 +127,8 @@ public interface Constant {
*/
String UNREAD = "unread";
+ /**
+ * 创建时间字段名
+ */
+ String CREATED_TIME = "created_time";
}
diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java
index 1d91a3287a..35cbbc0390 100644
--- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java
+++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java
@@ -47,7 +47,7 @@ public class FactTagAgencyDTO implements Serializable {
/**
* 固定值:文章数量
*/
- private String type="文章数量";
+ private String type="阅读次数";
/**
* 机关Id
diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubAgencyResultDTO.java
index 87dd107010..3b599a64ff 100644
--- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubAgencyResultDTO.java
+++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubAgencyResultDTO.java
@@ -1,5 +1,6 @@
package com.epmet.topic.dto.result;
+import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@@ -32,4 +33,10 @@ public class TopicSubAgencyResultDTO implements Serializable {
* 机关Id
*/
private String agencyId;
+
+ /**
+ * 排序
+ */
+ @JsonIgnore
+ private Integer sort;
}
diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubGridResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubGridResultDTO.java
index 64cad1615c..d319e2c128 100644
--- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubGridResultDTO.java
+++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubGridResultDTO.java
@@ -1,5 +1,6 @@
package com.epmet.topic.dto.result;
+import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@@ -32,4 +33,10 @@ public class TopicSubGridResultDTO implements Serializable {
* 网格Id
*/
private String gridId;
+
+ /**
+ * 排序
+ */
+ @JsonIgnore
+ private Integer sort;
}
diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryInfoResultDTO.java
index 3112df3356..71b096ca0f 100644
--- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryInfoResultDTO.java
+++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryInfoResultDTO.java
@@ -16,15 +16,15 @@ public class TopicSummaryInfoResultDTO implements Serializable {
/**
* 名称
*/
- private String name;
+ private String name = "";
/**
* 值
*/
- private Integer value;
+ private Integer value = 0;
/**
* 百分比
*/
- private String ratio;
+ private String ratio = "0.0%";
}
diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryResultDTO.java
index 6f14a45fd5..c59017335b 100644
--- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryResultDTO.java
+++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryResultDTO.java
@@ -16,27 +16,27 @@ public class TopicSummaryResultDTO implements Serializable {
/**
* 话题总数
*/
- private Integer topicTotalCount;
+ private Integer topicTotalCount = 0;
/**
* 讨论中话题数量
*/
- private Integer talkingTotalCount;
+ private Integer talkingTotalCount = 0;
/**
* 已关闭话题数量
*/
- private Integer closedTotalCount;
+ private Integer closedTotalCount = 0;
/**
* 已屏蔽话题数量
*/
- private Integer shieldedTotalCount;
+ private Integer shieldedTotalCount = 0;
/**
* 话题已转议题数量
*/
- private Integer shiftedTotalCount;
+ private Integer shiftedTotalCount = 0;
/**
* 数据更新至 时间
diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml
index 2258dd43cf..21ee831dcc 100644
--- a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml
+++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml
@@ -2,7 +2,7 @@ version: "3.7"
services:
data-report-server:
container_name: data-report-server-dev
- image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.8
+ image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.9
ports:
- "8109:8109"
network_mode: host # 使用现有网络
diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml
index a03e16e222..8c2ac84759 100644
--- a/epmet-module/data-report/data-report-server/pom.xml
+++ b/epmet-module/data-report/data-report-server/pom.xml
@@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- 0.3.8
+ 0.3.9
data-report-server
diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/issue/IssueDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/issue/IssueDao.java
index f8f3058673..abf2c4d350 100644
--- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/issue/IssueDao.java
+++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/issue/IssueDao.java
@@ -18,27 +18,30 @@ public interface IssueDao {
* @author zhaoqifeng
* @date 2020/6/22 15:19
* @param agencyId
+ * @param dateId
* @return com.epmet.issue.dto.result.IssueDataDTO
*/
- IssueDataDTO selectAgencyInfo(@Param("agencyId") String agencyId);
+ IssueDataDTO selectAgencyInfo(@Param("agencyId") String agencyId, @Param("dateId") String dateId);
/**
* 获取下级机关统计信息
* @author zhaoqifeng
* @date 2020/6/22 15:20
* @param agencyId
+ * @param dateId
* @return java.util.List
*/
- List selectSubAgencyList(@Param("agencyId") String agencyId);
+ List selectSubAgencyList(@Param("agencyId") String agencyId, @Param("dateId") String dateId);
/**
* 获取机关下网格统计信息
* @author zhaoqifeng
* @date 2020/6/22 15:21
* @param agencyId
+ * @param dateId
* @return java.util.List
*/
- List selectGridList(@Param("agencyId") String agencyId);
+ List selectGridList(@Param("agencyId") String agencyId, @Param("dateId") String dateId);
/**
* 获取当前机关日增量
diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java
index 80a5624e3b..1c72f584fc 100644
--- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java
+++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java
@@ -15,7 +15,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
+import java.util.Comparator;
import java.util.List;
+import java.util.stream.Collectors;
/**
* @Author zxc
@@ -60,7 +62,8 @@ public class GroupServiceImpl implements GroupService {
}
});
});
- return result;
+ //倒序
+ return result.stream().sorted(Comparator.comparing(GroupSubAgencyResultDTO::getValue).reversed()).collect(Collectors.toList());
}
return new ArrayList<>();
}
diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java
index 207a7f9c30..d44576202e 100644
--- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java
+++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java
@@ -35,11 +35,13 @@ public class IssueServiceImpl implements IssueService {
@Override
public IssueSummaryInfoResultDTO getSummaryInfo(TokenDto tokenDto) {
IssueSummaryInfoResultDTO result = new IssueSummaryInfoResultDTO();
+ //获取当前日期前一天
+ Date date = DateUtils.getBeforeDay(new Date());
+ //获取日期维度
+ String dateId = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD);
String agencyId = getAgencyId(tokenDto);
- IssueDataDTO data = issueDao.selectAgencyInfo(agencyId);
+ IssueDataDTO data = issueDao.selectAgencyInfo(agencyId, dateId);
if (null == data) {
- //获取当前日期前一天
- Date date = DateUtils.getBeforeDay(new Date());
result.setAgencyId(agencyId);
result.setDateName(DateUtils.format(date, "yyyy.MM.dd"));
result.setIssueTotal(NumConstant.ZERO);
@@ -67,7 +69,11 @@ public class IssueServiceImpl implements IssueService {
public List getSummaryPie(TokenDto tokenDto) {
List list = new ArrayList<>();
String agencyId = getAgencyId(tokenDto);
- IssueDataDTO data = issueDao.selectAgencyInfo(agencyId);
+ //获取当前日期前一天
+ Date date = DateUtils.getBeforeDay(new Date());
+ //获取日期维度
+ String dateId = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD);
+ IssueDataDTO data = issueDao.selectAgencyInfo(agencyId, dateId);
if (null == data) {
IssueSummaryPieResultDTO voting = new IssueSummaryPieResultDTO();
voting.setName(IssueConstant.VOTING_NAME);
@@ -108,7 +114,11 @@ public class IssueServiceImpl implements IssueService {
public List getSubAgency(TokenDto tokenDto) {
List list = new ArrayList<>();
String agencyId = getAgencyId(tokenDto);
- List dataList = issueDao.selectSubAgencyList(agencyId);
+ //获取当前日期前一天
+ Date date = DateUtils.getBeforeDay(new Date());
+ //获取日期维度
+ String dateId = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD);
+ List dataList = issueDao.selectSubAgencyList(agencyId, dateId);
if(null != dataList) {
dataList.forEach(data -> {
IssueSubAgencyResultDTO voting = new IssueSubAgencyResultDTO();
@@ -138,7 +148,11 @@ public class IssueServiceImpl implements IssueService {
public List getSubGrid(TokenDto tokenDto) {
List list = new ArrayList<>();
String agencyId = getAgencyId(tokenDto);
- List dataList = issueDao.selectGridList(agencyId);
+ //获取当前日期前一天
+ Date date = DateUtils.getBeforeDay(new Date());
+ //获取日期维度
+ String dateId = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD);
+ List dataList = issueDao.selectGridList(agencyId, dateId);
if(null != dataList) {
dataList.forEach(data -> {
IssueSubGridResultDTO voting = new IssueSubGridResultDTO();
diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java
index 0859bd2632..3b81c15cfa 100644
--- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java
+++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java
@@ -14,9 +14,9 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
+import java.text.DecimalFormat;
+import java.time.LocalDate;
+import java.util.*;
import java.util.stream.Collectors;
/**
@@ -41,6 +41,7 @@ public class TopicServiceImpl implements TopicService {
TopicSummaryResultDTO result = new TopicSummaryResultDTO();
String agencyId = this.getLoginUserDetails(tokenDto);
List topicStatus = topicDao.getTopicStatus(agencyId);
+ result.setDeadline(LocalDate.now().minusDays(NumConstant.ONE).toString());
if (topicStatus.size() != NumConstant.ZERO){
topicStatus.forEach(topic -> {
if (topic.getTopicStatus().equals(TopicConstant.DISCUSSING)){
@@ -52,11 +53,11 @@ public class TopicServiceImpl implements TopicService {
}
});
result.setTopicTotalCount(topicStatus.stream().collect(Collectors.summingInt(TopicStatusResultDTO::getTopicCount)));
- }
- TopicShiftedCountResultDTO shiftedCount = topicDao.getShiftedCount(agencyId);
- if (shiftedCount != null){
- result.setShiftedTotalCount(shiftedCount.getShiftedIssueCount());
- result.setDeadline(shiftedCount.getDeadline());
+ TopicShiftedCountResultDTO shiftedCount = topicDao.getShiftedCount(agencyId);
+ if (shiftedCount != null){
+ result.setShiftedTotalCount(shiftedCount.getShiftedIssueCount());
+ result.setDeadline(shiftedCount.getDeadline());
+ }
}
return result;
}
@@ -94,6 +95,7 @@ public class TopicServiceImpl implements TopicService {
public List topicSubGrid(TokenDto tokenDto) {
String agencyId = this.getLoginUserDetails(tokenDto);
List result = new ArrayList<>();
+ List resultAll = new ArrayList<>();
List subGridIdList = topicDao.getSubGridIdList(agencyId);
if (subGridIdList.size() != NumConstant.ZERO){
List gridAllTopicInfoLastDay = topicDao.getGridAllTopicInfoLastDay();
@@ -110,7 +112,17 @@ public class TopicServiceImpl implements TopicService {
}
});
});
- return result;
+ Map> collect = result.stream().collect(Collectors.groupingBy(TopicSubGridResultDTO::getGridId));
+ Set>> entries = collect.entrySet();
+ entries.forEach(entry -> {
+ List value = entry.getValue();
+ Integer sort = value.stream().collect(Collectors.summingInt(TopicSubGridResultDTO::getValue));
+ value.forEach(v -> {
+ v.setSort(sort);
+ resultAll.add(v);
+ });
+ });
+ return resultAll.stream().sorted(Comparator.comparing(TopicSubGridResultDTO::getSort).reversed()).collect(Collectors.toList());
}
return new ArrayList<>();
}
@@ -124,6 +136,7 @@ public class TopicServiceImpl implements TopicService {
public List topicSubAgency(TokenDto tokenDto) {
String agencyId = this.getLoginUserDetails(tokenDto);
List result = new ArrayList<>();
+ List resultAll = new ArrayList<>();
List subAgencyIdList = topicDao.getSubAgencyIdList(agencyId);
//存在下级机关
if (subAgencyIdList.size() != NumConstant.ZERO){
@@ -142,7 +155,17 @@ public class TopicServiceImpl implements TopicService {
}
});
});
- return result;
+ Map> collect = result.stream().collect(Collectors.groupingBy(TopicSubAgencyResultDTO::getAgencyId));
+ Set>> entries = collect.entrySet();
+ entries.forEach(entry -> {
+ List value = entry.getValue();
+ Integer sort = value.stream().collect(Collectors.summingInt(TopicSubAgencyResultDTO::getValue));
+ value.forEach(v -> {
+ v.setSort(sort);
+ resultAll.add(v);
+ });
+ });
+ return resultAll.stream().sorted(Comparator.comparing(TopicSubAgencyResultDTO::getSort).reversed()).collect(Collectors.toList());
}
//不存在
return new ArrayList<>();
@@ -158,14 +181,17 @@ public class TopicServiceImpl implements TopicService {
String agencyId = this.getLoginUserDetails(tokenDto);
List topicSummaryInfo = topicDao.topicSummaryInfo(agencyId);
TopicShiftedCountResultDTO shiftedCount = topicDao.getShiftedCount(agencyId);
- Integer collect = topicSummaryInfo.stream().collect(Collectors.summingInt(TopicSummaryInfoResultDTO::getValue));
- String ratio;
- ratio = collect == NumConstant.ZERO ? NumConstant.ZERO + TopicConstant.RATIO : ((float)shiftedCount.getShiftedIssueCount() / (float)collect) * NumConstant.ONE_HUNDRED + TopicConstant.RATIO;
- TopicSummaryInfoResultDTO result = new TopicSummaryInfoResultDTO();
- result.setName(TopicConstant.SHIFTED);
- result.setRatio(ratio);
- result.setValue(shiftedCount.getShiftedIssueCount());
- topicSummaryInfo.add(result);
+ if (topicSummaryInfo.size() != NumConstant.ZERO && shiftedCount != null) {
+ Integer collect = topicSummaryInfo.stream().collect(Collectors.summingInt(TopicSummaryInfoResultDTO::getValue));
+ DecimalFormat decimalFormat = new DecimalFormat(".00");
+ String ratio;
+ ratio = collect == NumConstant.ZERO ? NumConstant.ZERO + TopicConstant.RATIO : decimalFormat.format(((float) shiftedCount.getShiftedIssueCount() / (float) collect) * NumConstant.ONE_HUNDRED) + TopicConstant.RATIO;
+ TopicSummaryInfoResultDTO result = new TopicSummaryInfoResultDTO();
+ result.setName(TopicConstant.SHIFTED);
+ result.setRatio(ratio);
+ result.setValue(shiftedCount.getShiftedIssueCount());
+ topicSummaryInfo.add(result);
+ }
return topicSummaryInfo;
}
diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java
index 5265749de5..a001f3847d 100644
--- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java
+++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java
@@ -26,7 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
-import java.text.DecimalFormat;
+import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
@@ -47,7 +47,6 @@ public class UserAnalysisServiceImpl implements UserAnalysisService {
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private UserAnalysisDao userAnalysisDao;
- DecimalFormat decimalFormat = new DecimalFormat("0.00");
/**
* @return java.lang.String
* @param
@@ -69,6 +68,7 @@ public class UserAnalysisServiceImpl implements UserAnalysisService {
throw new RenException(UserAnalysisConstant.QUERY_USER_AGENCY_FAILED);
}
}
+ logger.info(String.format("用户%s的所属机关id为%s",loginUserDetailsFormDTO.getUserId(),result.getData().getAgencyId()));
return result.getData().getAgencyId();
}
/**
@@ -92,9 +92,9 @@ public class UserAnalysisServiceImpl implements UserAnalysisService {
if(null!=userSummaryInfoResultDTO){
userSummaryInfoResultDTO.setCurrentDate(DateUtils.getxAxisDatePattern(userSummaryInfoResultDTO.getCurrentDate(),"."));
//提取出工具类
- String partyMemberProStr=decimalFormat.format(userSummaryInfoResultDTO.getPartymemberProportionValue());
+ String partyMemberProStr=userSummaryInfoResultDTO.getPartymemberProportionValue().setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString();
userSummaryInfoResultDTO.setPartymemberProportion(partyMemberProStr.concat("%"));
- String warmProStr=decimalFormat.format(userSummaryInfoResultDTO.getWarmHeartedProportionValue());
+ String warmProStr=userSummaryInfoResultDTO.getWarmHeartedProportionValue().setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString();
userSummaryInfoResultDTO.setWarmHeartedProportion(warmProStr.concat("%"));
}
logger.info(String.format("查询用户汇总信息返参%s",JSON.toJSONString(userSummaryInfoResultDTO)));
diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml
index 6bee70e94b..008dc0175f 100644
--- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml
+++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml
@@ -28,6 +28,7 @@
WHERE
del_flag = '0'
AND pid = #{agencyId}
+ AND agency_dim_type = 'all'
@@ -59,6 +60,7 @@
fggd.del_flag = '0'
AND fggd.agency_id = #{agencyId}
AND fggd.date_id = (SELECT MAX(date_id) FROM fact_group_grid_daily WHERE del_flag = '0')
+ ORDER BY value DESC
@@ -89,7 +91,7 @@
del_flag = '0'
AND agency_id = #{agencyId}
ORDER BY
- month_id DESC
+ month_id DESC, value DESC
LIMIT 12
diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml
index 468f4c7a89..49333cc3e4 100644
--- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml
+++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml
@@ -12,12 +12,13 @@
SHIFT_PROJECT_PERCENT,
CLOSED_TOTAL,
CLOSED_PERCENT,
- MAX(DATE_ID) AS DATE_ID,
- DATE_FORMAT(MAX(DATE_ID), '%Y.%m.%d') AS DATE_NAME
+ DATE_ID,
+ DATE_FORMAT(DATE_ID, '%Y.%m.%d') AS DATE_NAME
FROM
fact_issue_agency_daily fiad
WHERE DEL_FLAG = '0'
AND AGENCY_ID = #{agencyId}
+ AND DATE_ID = #{dateId}
@@ -45,13 +47,14 @@
VOTING_TOTAL,
SHIFT_PROJECT_TOTAL,
CLOSED_TOTAL,
- MAX(DATE_ID) AS DATE_ID
+ DATE_ID AS DATE_ID
FROM
fact_issue_grid_daily figd
INNER JOIN
dim_grid dg ON figd.GRID_ID = dg.ID
WHERE figd.DEL_FLAG = '0'
AND figd.AGENCY_ID = #{agencyId}
+ AND figd.DATE_ID = #{dateId}
GROUP BY GRID_ID
ORDER BY figd.ISSUE_TOTAL DESC
diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/PublicityDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/PublicityDao.xml
index cd536caa30..c7d032eb43 100644
--- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/PublicityDao.xml
+++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/PublicityDao.xml
@@ -24,7 +24,7 @@
where agency_id = #{agencyId}
AND month_id = #{monthId}
GROUP BY TAG_ID
- ORDER BY value DESC
+ ORDER BY value DESC ,tagId ASC
LIMIT #{pageSize}
@@ -39,7 +39,7 @@
where agency_id = #{agencyId}
AND quarter_id = #{quarterId}
GROUP BY TAG_ID
- ORDER BY value DESC
+ ORDER BY value DESC ,tagId ASC
LIMIT #{pageSize}
@@ -54,7 +54,7 @@
where agency_id = #{agencyId}
AND year_id = #{yearId}
GROUP BY tag_id
- ORDER BY value DESC
+ ORDER BY value DESC ,tagId ASC
LIMIT #{pageSize}
@@ -69,7 +69,7 @@
where agency_id = #{agencyId}
AND month_id = #{monthId}
GROUP BY TAG_ID
- ORDER BY value DESC
+ ORDER BY value DESC ,tagId ASC
LIMIT #{pageSize}
@@ -84,7 +84,7 @@
where agency_id = #{agencyId}
AND quarter_id = #{quarterId}
GROUP BY TAG_ID
- ORDER BY value DESC
+ ORDER BY value DESC ,tagId ASC
LIMIT #{pageSize}
@@ -99,7 +99,7 @@
where agency_id = #{agencyId}
AND year_id = #{yearId}
GROUP BY tag_id
- ORDER BY value DESC
+ ORDER BY value DESC ,tagId ASC
LIMIT #{pageSize}
@@ -118,6 +118,7 @@
AND pub.PID =#{agencyId}
AND pub.month_id=#{monthId}
GROUP BY pub.agency_id
+ ORDER BY value DESC,agencyId ASC
@@ -136,6 +137,7 @@
AND pub.PID =#{agencyId}
AND pub.quarter_id=#{quarterId}
GROUP BY pub.agency_id
+ ORDER BY value DESC,agencyId ASC
@@ -153,6 +155,7 @@
AND pub.PID =#{agencyId}
AND pub.year_id=#{yearId}
GROUP BY pub.agency_id
+ ORDER BY value DESC,agencyId ASC
@@ -170,6 +173,7 @@
AND pub.agency_id =#{agencyId}
AND pub.month_id=#{monthId}
GROUP BY pub.department_id
+ ORDER BY value DESC,departmentId ASC
@@ -188,6 +192,7 @@
AND pub.agency_id =#{agencyId}
AND pub.quarter_id=#{quarterId}
GROUP BY pub.department_id
+ ORDER BY value DESC,departmentId ASC
@@ -205,6 +210,7 @@
AND pub.agency_id =#{agencyId}
AND pub.year_id=#{yearId}
GROUP BY pub.department_id
+ ORDER BY value DESC,departmentId ASC
@@ -222,6 +228,7 @@
AND pub.agency_id = #{agencyId}
AND pub.month_id=#{monthId}
GROUP BY pub.grid_id
+ ORDER BY value DESC,gridId ASC
@@ -240,6 +247,7 @@
AND pub.agency_id = #{agencyId}
AND pub.quarter_id=#{quarterId}
GROUP BY pub.grid_id
+ ORDER BY value DESC,gridId ASC
@@ -257,6 +265,7 @@
AND pub.agency_id = #{agencyId}
AND pub.year_id = #{yearId}
GROUP BY pub.grid_id
+ ORDER BY value DESC,gridId ASC
\ No newline at end of file
diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml
index 69386bd324..00f845829a 100644
--- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml
+++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml
@@ -41,7 +41,7 @@
WHEN topic_status_id = 'hidden' THEN '已屏蔽'
WHEN topic_status_id = 'closed' THEN '已关闭'
ELSE '无' END) AS name,
- CONCAT(topic_proportion * 100,'%') AS ratio
+ CONCAT(ROUND(topic_proportion * 100,2),'%') AS ratio
FROM
fact_topic_status_agency_daily
WHERE
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IssueConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IssueConstant.java
index 338b35e1a1..c611d4b97e 100644
--- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IssueConstant.java
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IssueConstant.java
@@ -21,9 +21,9 @@ public interface IssueConstant {
/**
*已解决
*/
- String RESLOVED = "resloved";
+ String RESOLVED = "resolved";
/**
*未解决
*/
- String UNRESLOVED = "unresloved";
+ String UNRESOLVED = "unresolved";
}
diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml
index 9f622320e1..2478d1b203 100644
--- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml
+++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml
@@ -2,7 +2,7 @@ version: "3.7"
services:
data-statistical-server:
container_name: data-statistical-server-dev
- image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.7
+ image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.8
ports:
- "8108:8108"
network_mode: host # 使用现有网络
diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml
index 3cb1ed3e57..702c4a4194 100644
--- a/epmet-module/data-statistical/data-statistical-server/pom.xml
+++ b/epmet-module/data-statistical/data-statistical-server/pom.xml
@@ -2,7 +2,7 @@
- 0.3.7
+ 0.3.8
data-statistical
com.epmet
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsIssueController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsIssueController.java
index 850c3b7a75..b78ca89680 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsIssueController.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsIssueController.java
@@ -1,12 +1,17 @@
package com.epmet.controller;
+import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.service.StatsIssueService;
+import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import java.io.Serializable;
+
/**
* @author zhaoqifeng
* @dscription
@@ -30,4 +35,14 @@ public class StatsIssueController {
statsIssueService.agencyGridIssueStats();
return new Result();
}
+ @Data
+ private static class StatsDate implements Serializable {
+ private static final long serialVersionUID = 149723067011918433L;
+ private String date;
+ }
+ @PostMapping("date")
+ public Result agencyGridIssueStatsOfDate(@RequestBody StatsDate statsDate) {
+ statsIssueService.agencyGridIssueStatsOfDate(DateUtils.parse(statsDate.getDate(), DateUtils.DATE_PATTERN));
+ return new Result();
+ }
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java
index 98d2e0e96d..87cd7c6879 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java
@@ -18,11 +18,12 @@ public interface StatsIssueDao extends BaseDao {
* 获取当前日期组织下议题统计结果
*
* @param customerId
+ * @param date
* @return java.util.List
* @author zhaoqifeng
* @date 2020/6/17 14:13
*/
- List selectAgencyIssueTotal(@Param("customerId") String customerId);
+ List selectAgencyIssueTotal(@Param("customerId") String customerId, @Param("date") String date);
/**
* 获取当前日期组织下议题增量
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java
index c6b8a8bee0..4ffeb599c9 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java
@@ -18,9 +18,10 @@ public interface IssueService {
* @author zhaoqifeng
* @date 2020/6/17 16:04
* @param customerId
+ * @param date
* @return java.util.List
*/
- List getAgencyIssueTotal(String customerId);
+ List getAgencyIssueTotal(String customerId, String date);
/**
* 获取当前日期组织下议题增量
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java
index 9cef7c5340..443c9ddc41 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java
@@ -26,8 +26,8 @@ public class IssueServiceImpl implements IssueService {
private StatsIssueDao statsIssueDao;
@Override
- public List getAgencyIssueTotal(String customerId) {
- List list = statsIssueDao.selectAgencyIssueTotal(customerId);
+ public List getAgencyIssueTotal(String customerId, String date) {
+ List list = statsIssueDao.selectAgencyIssueTotal(customerId, date);
list.forEach(dto -> {
String[] pIds = dto.getPIds().split(":");
dto.setPId(pIds[pIds.length - 2]);
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java
index 5d0e6b4292..7faf406333 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java
@@ -17,6 +17,15 @@ public interface StatsIssueService {
*/
void agencyGridIssueStats();
+ /**
+ * 指定日期议题统计
+ * @author zhaoqifeng
+ * @date 2020/6/28 11:01
+ * @param date
+ * @return void
+ */
+ void agencyGridIssueStatsOfDate(Date date);
+
/**
* 机关下议题日统计
* @author zhaoqifeng
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java
index ab38ff305a..11f7e915fb 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java
@@ -20,6 +20,7 @@ import com.epmet.service.project.ProjectService;
import com.epmet.service.stats.*;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
+import oracle.sql.DATE;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
@@ -66,6 +67,28 @@ public class StatsIssueServiceImpl implements StatsIssueService {
//获取当前日期前一天
Date date = DateUtils.getBeforeDay(new Date());
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize);
+ if (!CollectionUtils.isEmpty(customerIdList)) {
+ for (String customerId : customerIdList) {
+ //遍历统计每一个客户数据
+ try {
+ customerStats(customerId, date);
+ } catch(Exception e) {
+ log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "agencyGridIssueStats", customerId, DateUtils.format(date),
+ e.getMessage()));
+ }
+ }
+ }
+ } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize);
+ }
+
+ @Override
+ public void agencyGridIssueStatsOfDate(Date date) {
+ int pageNo = 1;
+ int pageSize = 100;
+ List customerIdList = null;
+ do {
+ //获取当前日期前一天
+ customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize);
if (!CollectionUtils.isEmpty(customerIdList)) {
for (String customerId : customerIdList) {
//遍历统计每一个客户数据
@@ -109,7 +132,7 @@ public class StatsIssueServiceImpl implements StatsIssueService {
//获取当前客户下所有机关
List agencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO);
//获取机关下议题各种状态的数目统计
- List issueAgencyTotalList = issueService.getAgencyIssueTotal(customerId);
+ List issueAgencyTotalList = issueService.getAgencyIssueTotal(customerId, dateString);
//获取机关下议题各种状态的数目增量
List issueAgencyIncList = issueService.getAgencyIssueInc(customerId, dateString);
//获取机关下已关闭议题统计
@@ -129,10 +152,10 @@ public class StatsIssueServiceImpl implements StatsIssueService {
entity.setPid(agency.getPid());
String pIds;
- if (null == agency.getPids() || agency.getPids().isEmpty()) {
- pIds = agency.getPid().concat(":").concat(agency.getId());
+ if (NumConstant.ZERO_STR.equals(agency.getPid())) {
+ pIds = agency.getPid();
} else {
- pIds = ("0").concat(":").concat(agency.getPids()).concat(":").concat(agency.getId());
+ pIds = agency.getPids().concat(":").concat(agency.getId());
}
//总量统计
saveTotal(issueAgencyTotalList, agency, entity, pIds);
@@ -172,7 +195,7 @@ public class StatsIssueServiceImpl implements StatsIssueService {
//获取当前客户下所有机关
List agencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO);
//获取机关下议题各种状态的数目统计
- List issueAgencyTotalList = issueService.getAgencyIssueTotal(customerId);
+ List issueAgencyTotalList = issueService.getAgencyIssueTotal(customerId, dateString);
//获取机关下已关闭议题统计
List issueAgencyClosedTotalList = issueService.getAgencyClosedIssueTotal(customerId, dateString);
//已结案项目统计
@@ -185,10 +208,10 @@ public class StatsIssueServiceImpl implements StatsIssueService {
FactIssueAgencyMonthlyEntity monthly = initIssueAgencyMonthly(dimId);
String pIds;
- if (null == agency.getPids() || agency.getPids().isEmpty()) {
- pIds = agency.getPid().concat(":").concat(agency.getId());
+ if (NumConstant.ZERO_STR.equals(agency.getPid())) {
+ pIds = agency.getPid();
} else {
- pIds = ("0").concat(":").concat(agency.getPids()).concat(":").concat(agency.getId());
+ pIds = agency.getPids().concat(":").concat(agency.getId());
}
//总量统计
saveTotal(issueAgencyTotalList, agency, daily, pIds);
@@ -269,8 +292,8 @@ public class StatsIssueServiceImpl implements StatsIssueService {
})).collect(Collectors.toList());
Map> totalMap =
totalList.stream().collect(Collectors.groupingBy(IssueProjectDTO::getStatus));
- List resolveList = totalMap.get(IssueConstant.RESLOVED);
- List unResolveList = totalMap.get(IssueConstant.UNRESLOVED);
+ List resolveList = totalMap.get(IssueConstant.RESOLVED);
+ List unResolveList = totalMap.get(IssueConstant.UNRESOLVED);
if (null != resolveList) {
resolveMap = resolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, Collectors.counting()));
}
@@ -289,8 +312,8 @@ public class StatsIssueServiceImpl implements StatsIssueService {
})).collect(Collectors.toList());
Map> incMap =
incList.stream().collect(Collectors.groupingBy(IssueProjectDTO::getStatus));
- List resolveIncList = incMap.get(IssueConstant.RESLOVED);
- List unResolveIncList = incMap.get(IssueConstant.UNRESLOVED);
+ List resolveIncList = incMap.get(IssueConstant.RESOLVED);
+ List unResolveIncList = incMap.get(IssueConstant.UNRESOLVED);
if (null != resolveIncList) {
resolveIncMap = resolveIncList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, Collectors.counting()));
}
@@ -363,8 +386,8 @@ public class StatsIssueServiceImpl implements StatsIssueService {
})).collect(Collectors.toList());
Map> totalMap =
totalList.stream().collect(Collectors.groupingBy(IssueProjectDTO::getStatus));
- List resolveList = totalMap.get(IssueConstant.RESLOVED);
- List unResolveList = totalMap.get(IssueConstant.UNRESLOVED);
+ List resolveList = totalMap.get(IssueConstant.RESOLVED);
+ List unResolveList = totalMap.get(IssueConstant.UNRESOLVED);
if (null != resolveList) {
resolveMap = resolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, Collectors.counting()));
}
@@ -482,10 +505,10 @@ public class StatsIssueServiceImpl implements StatsIssueService {
for (IssueGridDTO dto : list) {
if (grid.getId().equals(dto.getGridId())) {
- if (IssueConstant.RESLOVED.equals(dto.getStatus())) {
+ if (IssueConstant.RESOLVED.equals(dto.getStatus())) {
//表决中议题数量
resolvedInc = dto.getCount();
- } else if (IssueConstant.UNRESLOVED.equals(dto.getStatus())) {
+ } else if (IssueConstant.UNRESOLVED.equals(dto.getStatus())) {
//已转项目议题数量
unresolvedInc = dto.getCount();
}
@@ -513,10 +536,10 @@ public class StatsIssueServiceImpl implements StatsIssueService {
for (IssueGridDTO dto : list) {
if (grid.getId().equals(dto.getGridId())) {
- if (IssueConstant.RESLOVED.equals(dto.getStatus())) {
+ if (IssueConstant.RESOLVED.equals(dto.getStatus())) {
//已解决议题数量
resolvedCount = dto.getCount();
- } else if (IssueConstant.UNRESLOVED.equals(dto.getStatus())) {
+ } else if (IssueConstant.UNRESOLVED.equals(dto.getStatus())) {
//未解决议题数量
unresolvedCount = dto.getCount();
}
@@ -550,6 +573,8 @@ public class StatsIssueServiceImpl implements StatsIssueService {
int shiftInc = NumConstant.ZERO;
//已关闭增量
int closedInc = NumConstant.ZERO;
+ //议题增量
+ int issueInc = NumConstant.ZERO;
for (IssueGridDTO dto : list) {
if (grid.getId().equals(dto.getGridId())) {
if (IssueConstant.VOTING.equals(dto.getStatus())) {
@@ -558,17 +583,16 @@ public class StatsIssueServiceImpl implements StatsIssueService {
} else if (IssueConstant.SHIFT_PROJECT.equals(dto.getStatus())) {
//已转项目议题数量
shiftInc = dto.getCount();
- } else {
+ } else if(IssueConstant.CLOSED.equals(dto.getStatus())) {
//已关闭议题数量
closedInc = dto.getCount();
}
}
}
- int issueInc = votingInc + shiftInc + closedInc;
entity.setVotingIncr(votingInc);
entity.setShiftProjectIncr(shiftInc);
entity.setClosedIncr(closedInc);
- entity.setIssueIncr(issueInc);
+ entity.setIssueIncr(votingInc);
}
/**
@@ -638,10 +662,10 @@ public class StatsIssueServiceImpl implements StatsIssueService {
for (ProjectAgencyDTO project : list) {
if (agency.getId().equals(project.getAgencyId()) || project.getPIds().contains(pIds)) {
- if (IssueConstant.RESLOVED.equals(project.getStatus())) {
+ if (IssueConstant.RESOLVED.equals(project.getStatus())) {
//已解决数量
resolvedCount = resolvedCount + project.getCount();
- } else if (IssueConstant.SHIFT_PROJECT.equals(project.getStatus())) {
+ } else if (IssueConstant.UNRESOLVED.equals(project.getStatus())) {
//未解决数量
unresolvedCount = unresolvedCount + project.getCount();
}
@@ -672,10 +696,10 @@ public class StatsIssueServiceImpl implements StatsIssueService {
for (ProjectAgencyDTO project : list) {
if (agency.getId().equals(project.getAgencyId()) || project.getPIds().contains(pIds)) {
- if (IssueConstant.RESLOVED.equals(project.getStatus())) {
+ if (IssueConstant.RESOLVED.equals(project.getStatus())) {
//已解决数量
resolvedCount = resolvedCount + project.getCount();
- } else if (IssueConstant.SHIFT_PROJECT.equals(project.getStatus())) {
+ } else if (IssueConstant.UNRESOLVED.equals(project.getStatus())) {
//未解决数量
unresolvedCount = unresolvedCount + project.getCount();
}
@@ -712,6 +736,8 @@ public class StatsIssueServiceImpl implements StatsIssueService {
int shiftInc = NumConstant.ZERO;
//已关闭增量
int closedInc = NumConstant.ZERO;
+ //议题增量
+ int issueInc = NumConstant.ZERO;
for (IssueAgencyDTO issueAgency : list) {
if (agency.getId().equals(issueAgency.getAgencyId()) || issueAgency.getPIds().contains(pIds)) {
if (IssueConstant.VOTING.equals(issueAgency.getStatus())) {
@@ -720,17 +746,16 @@ public class StatsIssueServiceImpl implements StatsIssueService {
} else if (IssueConstant.SHIFT_PROJECT.equals(issueAgency.getStatus())) {
//已转项目议题数量
shiftInc = shiftInc + issueAgency.getCount();
- } else {
+ } else if(IssueConstant.CLOSED.equals(issueAgency.getStatus())) {
//已关闭议题数量
closedInc = closedInc + issueAgency.getCount();
}
}
}
- int issueInc = votingInc + shiftInc + closedInc;
entity.setVotingIncr(votingInc);
entity.setShiftProjectIncr(shiftInc);
entity.setClosedIncr(closedInc);
- entity.setIssueIncr(issueInc);
+ entity.setIssueIncr(votingInc);
}
/**
@@ -802,10 +827,10 @@ public class StatsIssueServiceImpl implements StatsIssueService {
for (IssueAgencyDTO issueAgency : list) {
if (agency.getId().equals(issueAgency.getAgencyId()) || issueAgency.getPIds().contains(pIds)) {
- if (IssueConstant.RESLOVED.equals(issueAgency.getStatus())) {
+ if (IssueConstant.RESOLVED.equals(issueAgency.getStatus())) {
//表决中议题数量
resolvedCount = resolvedCount + issueAgency.getCount();
- } else if (IssueConstant.UNRESLOVED.equals(issueAgency.getStatus())) {
+ } else if (IssueConstant.UNRESOLVED.equals(issueAgency.getStatus())) {
//已转项目议题数量
unresolvedCount = unresolvedCount + issueAgency.getCount();
}
@@ -841,10 +866,10 @@ public class StatsIssueServiceImpl implements StatsIssueService {
for (IssueAgencyDTO issueAgency : list) {
if (agency.getId().equals(issueAgency.getAgencyId()) || issueAgency.getPIds().contains(pIds)) {
- if (IssueConstant.RESLOVED.equals(issueAgency.getStatus())) {
+ if (IssueConstant.RESOLVED.equals(issueAgency.getStatus())) {
//表决中议题数量
resolvedInc = resolvedInc + issueAgency.getCount();
- } else if (IssueConstant.UNRESLOVED.equals(issueAgency.getStatus())) {
+ } else if (IssueConstant.UNRESOLVED.equals(issueAgency.getStatus())) {
//已转项目议题数量
unresolvedInc = unresolvedInc + issueAgency.getCount();
}
@@ -854,7 +879,6 @@ public class StatsIssueServiceImpl implements StatsIssueService {
entity.setClosedUnresolvedIncr(unresolvedInc);
}
-
/**
* 初始化数据
*
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 0c4793e565..1dbb6f81f1 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
@@ -246,7 +246,7 @@ public class StatsProjectServiceImpl implements StatsProjectService {
agencyDailyEntity.setUnresolvedRatio(new BigDecimal(numberFormat.format((float) unResolvedTotal.intValue() / (float) closedTotal.intValue())));
}
agencyDailyEntity.setProjectIncr(projectIncr.intValue());
- agencyDailyEntity.setPendingIncr(projectIncr.intValue() - closedIncr.intValue());
+ agencyDailyEntity.setPendingIncr(projectIncr.intValue());
agencyDailyEntity.setClosedIncr(closedIncr.intValue());
agencyDailyEntity.setResolvedIncr(resolvedIncr.intValue());
agencyDailyEntity.setUnresolvedIncr(unResolvedIncr.intValue());
@@ -539,7 +539,7 @@ public class StatsProjectServiceImpl implements StatsProjectService {
gridDailyEntity.setUnresolvedRatio(new BigDecimal(numberFormat.format((float) unResolvedTotal.intValue() / (float) closedTotal.intValue())));
}
gridDailyEntity.setProjectIncr(projectIncr.intValue());
- gridDailyEntity.setPendingIncr(projectIncr.intValue() - closedIncr.intValue());
+ gridDailyEntity.setPendingIncr(projectIncr.intValue());
gridDailyEntity.setClosedIncr(closedIncr.intValue());
gridDailyEntity.setResolvedIncr(resolvedIncr.intValue());
gridDailyEntity.setUnresolvedIncr(unResolvedIncr.intValue());
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java
index 72b5ce2b1b..b7d5c4a20b 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java
@@ -389,7 +389,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
summary.setArticleTotalCount(summaryDTO.getArticleTotalCount());
summary.setArticlePublishedCount(summaryDTO.getArticlePublishedCount());
summary.setPublishedCount(summaryDTO.getPublishedCount());
- result.put(summaryDTO.getPublisherId(), summaryDTO);
+ result.put(summaryDTO.getAgencyId(), summaryDTO);
} else {
publishedSummaryDTO.setArticlePublishedCount(publishedSummaryDTO.getArticlePublishedCount() + summaryDTO.getArticlePublishedCount());
publishedSummaryDTO.setArticleTotalCount(publishedSummaryDTO.getArticleTotalCount() + summaryDTO.getArticlePublishedCount());
@@ -451,6 +451,20 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
try {
//转换为 需要插入的Entity
Map agencyDailyEntityMap = convertAgencyDailyEntity(agencyDTOList, dimIdBean);
+ if (!CollectionUtils.isEmpty(agencySummaryMap)){
+ //同一个机关下数据累加
+ for (Map.Entry entry : agencySummaryMap.entrySet()) {
+ String agencyId = entry.getKey();
+ ArticleGridPublishedSummaryDTO summary = entry.getValue();
+ FactArticlePublishedAgencyDailyEntity dimAgencyEntity = agencyDailyEntityMap.get(agencyId);
+ if (dimAgencyEntity == null) {
+ continue;
+ }
+ dimAgencyEntity.setArticleTotalCount(dimAgencyEntity.getArticlePublishedCount()+summary.getArticleTotalCount());
+ dimAgencyEntity.setArticlePublishedCount(dimAgencyEntity.getPublishedCount()+summary.getArticlePublishedCount());
+ dimAgencyEntity.setPublishedCount(dimAgencyEntity.getPublishedCount()+summary.getPublishedCount());
+ }
+ }
//获取当天的业务数据
List publishedArticleCount = articleService.getAllAgencyPublishedCount(customerId, statsDate);
Map haveDataAgencyDailyMap = new HashMap<>();
@@ -465,9 +479,11 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount());
gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount());
gridDailyEntities.setPublishedCount(summaryDTO.getPublishedCount());
+
+
+
haveDataAgencyDailyMap.put(summaryDTO.getAgencyId(), gridDailyEntities);
- //同一个机关下数据累加
- //buildAgencySummaryData(agencySummaryMap, summaryDTO);
+
//构建机关自己的数据
FactArticlePublishedAgencyDailyEntity selfDaily = ConvertUtils.sourceToTarget(dimIdBean, FactArticlePublishedAgencyDailyEntity.class);
selfDaily.setCustomerId(gridDailyEntities.getCustomerId());
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml
index 3120f939d8..2f6545f289 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml
@@ -12,26 +12,35 @@
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
+ AND DATE(UPDATED_TIME) #{date}
GROUP BY
ORG_ID, ISSUE_STATUS