From 3bf4a89e8470abf09ca61db5a5e8e8e84f45455b Mon Sep 17 00:00:00 2001
From: kaiyu <404897439@qq.com>
Date: Wed, 30 Sep 2020 14:12:56 +0800
Subject: [PATCH] 添加标识符
---
src/main/java/com/moral/controller/ScreenController.java | 52 +++++++++++++++++++++++++++++++++++-----------------
1 files changed, 35 insertions(+), 17 deletions(-)
diff --git a/src/main/java/com/moral/controller/ScreenController.java b/src/main/java/com/moral/controller/ScreenController.java
index 816d5eb..8ecf130 100644
--- a/src/main/java/com/moral/controller/ScreenController.java
+++ b/src/main/java/com/moral/controller/ScreenController.java
@@ -97,8 +97,8 @@
@Resource
DeviceVersionService deviceVersionService;
- @Resource
- HistorySpecialService historySpecialService;
+ /* @Resource
+ HistorySpecialService historySpecialService;*/
/**
* The screen service.
@@ -675,28 +675,43 @@
return new ResultBean<List<MonitorPoint>>(monitorPoints);
}
+
+ /*
+ * ���������monitorPoint=368&mac=p5dnd7a0392018&sensorKey=e92&time=2020-08-11
+ * ���������������������������
+ * */
@GetMapping("report_avg_datas")
public ResultBean<List<Map<String, Object>>> getMonitorPointOrDeviceAvgData(HttpServletRequest request)
throws Exception {
Map<String, Object> parameters = getParametersStartingWith(request, null);
+ //������������������������������������������������
ParameterUtils.getTimeType4Time(parameters);
- parameters.put("monitorPointId", parameters.remove("monitorPoint"));
- Object sensorKey = parameters.remove("sensorKey");
- parameters.put("sensors", Arrays.asList(sensorKey));
- // monitorPointService.isCompensateCalculation(parameters);
- List<Map<String, Object>> list = historyMinutelyService.getMonitorPointOrDeviceAvgData(parameters);
-
- for (Map<String, Object> map : list) {
- String time = map.get("time").toString();
- time = time.substring(time.length() - 2);
- map.put("time", Integer.valueOf(time));
- if(parameters.get("type").equals("day")){
- map.put("time", Integer.valueOf(time)+1);
+ String time1= (String) parameters.get("time");
+ String mac1= (String) parameters.get("mac");
+ List<Map<String, Object>> list=null;
+ if (mac1!=null && mac1.equals("p5dnd7a0392018") && time1.substring(0,4).equals("2019") ){
+ list=null;
+ }else {
+ parameters.put("monitorPointId", parameters.remove("monitorPoint"));
+ Object sensorKey = parameters.remove("sensorKey");
+ parameters.put("sensors", Arrays.asList(sensorKey));
+ // monitorPointService.isCompensateCalculation(parameters);
+ list = historyMinutelyService.getMonitorPointOrDeviceAvgData(parameters);
+ for (Map<String, Object> map : list) {
+ String time = map.get("time").toString();
+ time = time.substring(time.length() - 2);
+ map.put("time", Integer.valueOf(time));
+ if (parameters.get("type").equals("day")) {
+ map.put("time", Integer.valueOf(time) + 1);
+ }
+ map.put("value", map.remove(sensorKey));
}
- map.put("value", map.remove(sensorKey));
}
return new ResultBean<List<Map<String, Object>>>(list);
}
+
+
+
@GetMapping("report_alarm_datas")
public ResultBean<List<Map<String, Object>>> getAlarmData(HttpServletRequest request) throws Exception {
@@ -1484,13 +1499,15 @@
String startHour = st.substring(st.lastIndexOf("-") + 1);
String startTime = startYearAndDay + " " + startHour + ":00:00";
String et = parameters.get("endTime").toString();
+ String endYearAndDay = et.substring(0, st.lastIndexOf("-"));
String endHour = et.substring(et.lastIndexOf("-") + 1);
- int endHourValue = Integer.valueOf(endHour);
+ String endTime=endYearAndDay + " " + endHour + ":00:00";
+ /* int endHourValue = Integer.valueOf(endHour);
int startHourValue = Integer.valueOf(startHour);
if (endHourValue <= startHourValue) {
endHourValue = startHourValue + 1;
}
- String endTime = startYearAndDay + " " + endHourValue + ":00:00";
+ String endTime = startYearAndDay + " " + endHourValue + ":00:00";*/
parameters.put("startTime", startTime);
parameters.put("endTime", endTime);
String mac = parameters.get("mac").toString();
@@ -1597,6 +1614,7 @@
@RequestMapping(value = "/newMap-page", method = RequestMethod.GET)
public ModelAndView newMap(ModelAndView model, @RequestParam("areaCode") long code,
@RequestParam("accountId") int accountId) {
+
Account account = accountService.getAccountById(accountId);
List<MonitorPoint> monitorPointList = monitorPointService.getMonitorPointListByAccountId(accountId);
String regionName = areaService.queryFullNameByCode(code);
--
Gitblit v1.8.0