Browse Source

Merge remote-tracking branch 'remotes/origin/dev_data_stats' into dev

master
jianjun 5 years ago
parent
commit
644226126c
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java
  2. 5
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java
  3. 2
      epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml
  4. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java
  5. 26
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java
  6. 131
      epmet-module/data-statistical/data-statistical-client/src/main/java/feign/DataStatisticalOpenFeignClient.java
  7. 135
      epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/DataStatisticalOpenFeignClientFallBack.java
  8. 2
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java
  9. 2
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupGridDailyTask.java

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java

@ -117,5 +117,5 @@ public interface ServiceConstant {
/**
* 数据统计
*/
String DATA_STATISTICAL = "data-statistical-server";
String DATA_STATISTICAL_SERVER = "data-statistical-server";
}

5
epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java

@ -158,8 +158,9 @@ public class TopicServiceImpl implements TopicService {
String agencyId = this.getLoginUserDetails(tokenDto);
List<TopicSummaryInfoResultDTO> topicSummaryInfo = topicDao.topicSummaryInfo(agencyId);
TopicShiftedCountResultDTO shiftedCount = topicDao.getShiftedCount(agencyId);
int i = (shiftedCount.getShiftedIssueCount() / topicSummaryInfo.stream().collect(Collectors.summingInt(TopicSummaryInfoResultDTO::getValue))) * NumConstant.ONE_HUNDRED;
String ratio = String.valueOf(i) + TopicConstant.RATIO;
Integer collect = topicSummaryInfo.stream().collect(Collectors.summingInt(TopicSummaryInfoResultDTO::getValue));
String ratio;
ratio = collect == NumConstant.ZERO ? NumConstant.ZERO + TopicConstant.RATIO : (shiftedCount.getShiftedIssueCount() / collect) * NumConstant.ONE_HUNDRED + TopicConstant.RATIO;
TopicSummaryInfoResultDTO result = new TopicSummaryInfoResultDTO();
result.setName(TopicConstant.SHIFTED);
result.setRatio(ratio);

2
epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml

@ -35,6 +35,7 @@
WHERE fiad.DEL_FLAG = '0'
AND fiad.PID = #{agencyId}
GROUP BY AGENCY_ID
ORDER BY fiad.ISSUE_TOTAL DESC
</select>
<!-- 获取机关下网格统计信息-->
<select id="selectGridList" resultType="com.epmet.issue.dto.result.IssueDataDTO">
@ -52,6 +53,7 @@
WHERE figd.DEL_FLAG = '0'
AND figd.AGENCY_ID = #{agencyId}
GROUP BY GRID_ID
ORDER BY figd.ISSUE_TOTAL DESC
</select>
<!-- 获取当前机关日增量-->
<select id="selectAgencyIncDailyList" resultType="com.epmet.issue.dto.result.IssueDataDTO">

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java

@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.PostMapping;
* @date: 2020/6/22 17:39
* @author: jianjun liu
*/
@FeignClient(name = ServiceConstant.DATA_STATISTICAL, fallback = DataStatisticalOpenFeignClientFallBack.class)
@FeignClient(name = ServiceConstant.DATA_STATISTICAL_SERVER, fallback = DataStatisticalOpenFeignClientFallBack.class)
public interface DataStatisticalOpenFeignClient {
/**

26
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java

@ -25,7 +25,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
*/
@Override
public Result articleSummaryDailyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "articleSummaryDailyStatsjob");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "articleSummaryDailyStatsjob");
}
/**
@ -37,7 +37,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
*/
@Override
public Result tagUsedDailyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagUsedDailyStatsjob");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagUsedDailyStatsjob");
}
/**
@ -48,7 +48,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
*/
@Override
public Result tagUsedMonthlyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagUsedMonthlyStatsjob");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagUsedMonthlyStatsjob");
}
/**
@ -59,7 +59,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
*/
@Override
public Result tagUsedQuarterlyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagUsedQuarterlyStatsjob");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagUsedQuarterlyStatsjob");
}
/**
@ -70,7 +70,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
*/
@Override
public Result tagViewedDailyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagViewedDailyStatsjob");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagViewedDailyStatsjob");
}
/**
@ -81,7 +81,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
*/
@Override
public Result tagViewedMonthlyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagViewedMonthlyStatsjob");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagViewedMonthlyStatsjob");
}
/**
@ -92,27 +92,27 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
*/
@Override
public Result tagViewedQuarterlyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagViewedQuarterlyStatsjob");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagViewedQuarterlyStatsjob");
}
@Override
public Result groupGridDaily() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "groupGridDaily");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupGridDaily");
}
@Override
public Result groupAgencyDaily() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "groupAgencyDaily");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupAgencyDaily");
}
@Override
public Result groupAgencyMonthly() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "groupAgencyMonthly");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupAgencyMonthly");
}
@Override
public Result agencyGridIssueStats() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "agencyGridIssueStats");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "agencyGridIssueStats");
}
/**
@ -121,7 +121,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
*/
@Override
public Result agencyProjectStats() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "agencyProjectStats");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "agencyProjectStats");
}
/**
@ -130,6 +130,6 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
*/
@Override
public Result gridProjectStats() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "gridProjectStats");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "gridProjectStats");
}
}

131
epmet-module/data-statistical/data-statistical-client/src/main/java/feign/DataStatisticalOpenFeignClient.java

@ -1,131 +0,0 @@
package feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import feign.impl.DataStatisticalOpenFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
/**
* desc: 数据统计 对外feign client
*
* @return:
* @date: 2020/6/22 17:39
* @author: jianjun liu
*/
@FeignClient(name = ServiceConstant.DATA_STATISTICAL, fallback = DataStatisticalOpenFeignClientFallBack.class)
public interface DataStatisticalOpenFeignClient {
/**
* desc: 统计文章总数及在线文章总数 包含 机关 部门 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@PostMapping(value = "data/stats/statspublicity/articleSummaryDailyStatsjob")
Result articleSummaryDailyStatsjob();
/**
* desc: 定时任务 统计文章总数及在线文章总数 包含 机关 部门 网格
*
* @return:
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@PostMapping(value = "data/stats/statspublicity/tagUsedDailyStatsjob")
Result tagUsedDailyStatsjob();
/**
* desc: 统计发表文章最多的分类 包含 机关 部门 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@PostMapping(value = "data/stats/statspublicity/tagUsedMonthlyStatsjob")
Result tagUsedMonthlyStatsjob();
/**
* desc: 统计发表文章最多的分类 包含 机关 部门 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@PostMapping(value = "data/stats/statspublicity/tagUsedQuarterlyStatsjob")
Result tagUsedQuarterlyStatsjob();
/**
* desc: 统计阅读最多的标签 包含 机关 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@PostMapping(value = "data/stats/statspublicity/tagViewedDailyStatsjob")
Result tagViewedDailyStatsjob();
/**
* desc: 统计阅读最多的标签 包含 机关 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@PostMapping(value = "data/stats/statspublicity/tagViewedMonthlyStatsjob")
Result tagViewedMonthlyStatsjob();
/**
* desc: 统计阅读最多的标签 包含 机关 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@PostMapping(value = "data/stats/statspublicity/tagViewedQuarterlyStatsjob")
Result tagViewedQuarterlyStatsjob();
/**
* @Description 统计 网格小组 dim网格-
* @param
* @author zxc
*/
@PostMapping("/data/stats/statsgroup/groupgriddaily")
Result groupGridDaily();
/**
* @Description 统计 网格小组 dim机关-
* @param
* @author zxc
*/
@PostMapping("/data/stats/statsgroup/groupagencydaily")
Result groupAgencyDaily();
/**
* @Description 统计 网格小组 dim机关-
* @param
* @author zxc
*/
@PostMapping("/data/stats/statsgroup/groupagencymonthly")
Result groupAgencyMonthly();
/**
* 议题统计
* @author zhaoqifeng
* @date 2020/6/23 14:34
* @param
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("/data/stats/statsissue/issuestats")
Result agencyGridIssueStats();
/**
* @Description 数据统计-项目-机关日月统计
* @Author sun
*/
@PostMapping("/data/stats/statsproject/agencyprojectstats")
Result agencyProjectStats();
/**
* @Description 数据统计-项目-网格日月统计
* @Author sun
*/
@PostMapping("/data/stats/statsproject/gridprojectstats")
Result gridProjectStats();
}

135
epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/DataStatisticalOpenFeignClientFallBack.java

@ -1,135 +0,0 @@
package feign.impl;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import feign.DataStatisticalOpenFeignClient;
import org.springframework.stereotype.Component;
/**
* desc:
*
* @return:
* @date: 2020/6/22 9:38
* @author: jianjun liu
* email:liujianjun@git.elinkit.com.cn
*/
@Component
public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOpenFeignClient {
/**
* desc: 统计文章总数及在线文章总数 包含 机关 部门 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result articleSummaryDailyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "articleSummaryDailyStatsjob");
}
/**
* desc: 定时任务 统计文章总数及在线文章总数 包含 机关 部门 网格
*
* @return:
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result tagUsedDailyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagUsedDailyStatsjob");
}
/**
* desc: 统计发表文章最多的分类 包含 机关 部门 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result tagUsedMonthlyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagUsedMonthlyStatsjob");
}
/**
* desc: 统计发表文章最多的分类 包含 机关 部门 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result tagUsedQuarterlyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagUsedQuarterlyStatsjob");
}
/**
* desc: 统计阅读最多的标签 包含 机关 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result tagViewedDailyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagViewedDailyStatsjob");
}
/**
* desc: 统计阅读最多的标签 包含 机关 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result tagViewedMonthlyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagViewedMonthlyStatsjob");
}
/**
* desc: 统计阅读最多的标签 包含 机关 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result tagViewedQuarterlyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagViewedQuarterlyStatsjob");
}
@Override
public Result groupGridDaily() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "groupGridDaily");
}
@Override
public Result groupAgencyDaily() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "groupAgencyDaily");
}
@Override
public Result groupAgencyMonthly() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "groupAgencyMonthly");
}
@Override
public Result agencyGridIssueStats() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "agencyGridIssueStats");
}
/**
* @Description 数据统计-项目-机关日月统计
* @Author sun
*/
@Override
public Result agencyProjectStats() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "agencyProjectStats");
}
/**
* @Description 数据统计-项目-网格日月统计
* @Author sun
*/
@Override
public Result gridProjectStats() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "gridProjectStats");
}
}

2
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java

@ -24,7 +24,7 @@ public class StatsGroupAgencyDailyTask implements ITask {
@Override
public void run(String params) {
logger.debug("StatsGroupAgencyDailyTask定时任务正在执行,参数为:{}", params);
Result result = statsGroupService.groupGridDaily();
Result result = statsGroupService.groupAgencyDaily();
if (result.success()){
logger.debug("StatsGroupAgencyDailyTask定时任务正在执行定时任务执行成功");
}else {

2
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupGridDailyTask.java

@ -25,7 +25,7 @@ public class StatsGroupGridDailyTask implements ITask {
@Override
public void run(String params) {
logger.debug("StatsGroupGridDailyTask定时任务正在执行,参数为:{}", params);
Result result = statsGroupService.groupAgencyDaily();
Result result = statsGroupService.groupGridDaily();
if (result.success()){
logger.debug("StatsGroupGridDailyTask定时任务正在执行定时任务执行成功");
}else {

Loading…
Cancel
Save