From 3aa63f15b853e9103a906102c46d26784be7655e Mon Sep 17 00:00:00 2001
From: ZhuDongming <773644075@qq.com>
Date: Thu, 15 Aug 2019 17:23:45 +0800
Subject: [PATCH] 添加无人机历史查询最大值和最小值的sql语句
---
src/main/java/com/moral/controller/ReportController.java | 51 +++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 47 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/moral/controller/ReportController.java b/src/main/java/com/moral/controller/ReportController.java
index 1d247bb..d191744 100644
--- a/src/main/java/com/moral/controller/ReportController.java
+++ b/src/main/java/com/moral/controller/ReportController.java
@@ -4,7 +4,6 @@
import static com.moral.common.util.WebUtils.getParametersStartingWith;
import java.io.OutputStream;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -21,8 +20,12 @@
import org.springframework.web.bind.annotation.RestController;
import com.moral.common.bean.ResultBean;
+import com.moral.common.util.WebUtils;
import com.moral.entity.charts.LineChartCriteria;
-import com.moral.service.AlarmService;
+import com.moral.security.auth.JwtAuthenticationToken;
+import com.moral.security.model.UserContext;
+import com.moral.service.AlarmDailyService;
+import com.moral.service.HistoryDailyService;
import com.moral.service.HistoryMinutelyService;
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -35,7 +38,7 @@
private HistoryMinutelyService historyMinutelyService;
@Resource
- private AlarmService alarmService;
+ private AlarmDailyService alarmDailyService;
@GetMapping("compare")
public ResultBean<Map<String, List>> getCompareReport(HttpServletRequest request) throws Exception {
@@ -75,9 +78,49 @@
@GetMapping("pie")
public ResultBean<Map<String, Object>> getPieData(HttpServletRequest request) throws Exception {
Map<String, Object> parameters = getParametersStartingWith(request, null);
- Map pieData = alarmService.getPieData(parameters);
+ Map pieData = alarmDailyService.getPieData(parameters);
return new ResultBean<Map<String, Object>>(pieData);
}
+ @GetMapping("alarm-year")
+ public ResultBean<List<Integer>> getAlarmDataByYear(HttpServletRequest request) throws Exception {
+ Map<String, Object> parameters = getParametersStartingWith(request, null);
+ List<Integer> result = alarmDailyService.getAlarmDataByYear(parameters);
+
+ return new ResultBean<List<Integer>>(result);
+ }
+
+ @GetMapping("alarm-month")
+ public ResultBean<List<Map<String, Object>>> getAlarmDataByMonth(HttpServletRequest request) throws Exception {
+ Map<String, Object> parameters = getParametersStartingWith(request, null);
+ List<Map<String, Object>> result = alarmDailyService.getAlarmDataByMonth(parameters);
+
+ return new ResultBean<List<Map<String, Object>>>(result);
+ }
+
+ @Resource
+ private HistoryDailyService historyDailyService;
+
+ @GetMapping("emissions")
+ public ResultBean<List<Map<String, Object>>> getemissionsData(HttpServletRequest request, JwtAuthenticationToken token) throws Exception {
+ Map<String, Object> parameters = WebUtils.getParametersStartingWith(request, null);
+ UserContext userContext = token.getPrincipal();
+ Integer orgId = userContext.getOrganizationId();
+ parameters.put("orgId", orgId);
+ List<Map<String, Object>> result = historyDailyService.getEmissionsData(parameters);
+ return new ResultBean<List<Map<String, Object>>>(result);
+ }
+
+
+ @GetMapping("overproof")
+ public ResultBean<Map> getOverproofData(HttpServletRequest request, JwtAuthenticationToken token) throws Exception {
+ Map<String, Object> parameters = WebUtils.getParametersStartingWith(request, null);
+ UserContext userContext = token.getPrincipal();
+ Integer orgId = userContext.getOrganizationId();
+ parameters.put("orgId", orgId);
+ //List<Map<String, Object>> result = null;
+ Map result = historyDailyService.getOverproofData(parameters);
+ return new ResultBean<Map>(result);
+ }
}
--
Gitblit v1.8.0