|
@@ -2,7 +2,10 @@ package com.zksy.web.controller.base.environment;
|
|
|
|
|
|
|
|
import com.zksy.base.environment.domain.ERealTimeData;
|
|
import com.zksy.base.environment.domain.ERealTimeData;
|
|
|
import com.zksy.base.environment.service.ERealTimeDataService;
|
|
import com.zksy.base.environment.service.ERealTimeDataService;
|
|
|
|
|
+import com.zksy.common.annotation.Anonymous;
|
|
|
import com.zksy.common.core.domain.AjaxResult;
|
|
import com.zksy.common.core.domain.AjaxResult;
|
|
|
|
|
+
|
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -14,6 +17,8 @@ import java.util.*;
|
|
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping("/api/env")
|
|
@RequestMapping("/api/env")
|
|
|
|
|
+@Api(tags = "环境数据接口")
|
|
|
|
|
+@Anonymous
|
|
|
public class ERealTimeDataController {
|
|
public class ERealTimeDataController {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -22,14 +27,14 @@ public class ERealTimeDataController {
|
|
|
private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
private static final DateTimeFormatter DATETIME_FORMAT = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
private static final DateTimeFormatter DATETIME_FORMAT = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
|
|
- @GetMapping("/latest")
|
|
|
|
|
|
|
+ @GetMapping("/visualization/latest")
|
|
|
@ApiOperation("查询最新数据")
|
|
@ApiOperation("查询最新数据")
|
|
|
public AjaxResult getLatest(@RequestParam Integer deviceId,
|
|
public AjaxResult getLatest(@RequestParam Integer deviceId,
|
|
|
@RequestParam Integer nodeId) {
|
|
@RequestParam Integer nodeId) {
|
|
|
return AjaxResult.success(dataService.getLatestByDeviceNode(deviceId, nodeId));
|
|
return AjaxResult.success(dataService.getLatestByDeviceNode(deviceId, nodeId));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @GetMapping("/daily-stats")
|
|
|
|
|
|
|
+ @GetMapping("/visualization/daily-stats")
|
|
|
@ApiOperation("按天统计(均值、最大值、最小值)")
|
|
@ApiOperation("按天统计(均值、最大值、最小值)")
|
|
|
public AjaxResult getDailyStats(@RequestParam Integer deviceId,
|
|
public AjaxResult getDailyStats(@RequestParam Integer deviceId,
|
|
|
@RequestParam Integer nodeId,
|
|
@RequestParam Integer nodeId,
|
|
@@ -38,7 +43,7 @@ public class ERealTimeDataController {
|
|
|
return AjaxResult.success(dataService.getDailyStats(deviceId, nodeId, localDate));
|
|
return AjaxResult.success(dataService.getDailyStats(deviceId, nodeId, localDate));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @GetMapping("/trend")
|
|
|
|
|
|
|
+ @GetMapping("/visualization/trend")
|
|
|
@ApiOperation("设备趋势分析")
|
|
@ApiOperation("设备趋势分析")
|
|
|
public AjaxResult getTrend(@RequestParam Integer deviceId,
|
|
public AjaxResult getTrend(@RequestParam Integer deviceId,
|
|
|
@RequestParam Integer nodeId,
|
|
@RequestParam Integer nodeId,
|
|
@@ -49,7 +54,7 @@ public class ERealTimeDataController {
|
|
|
return AjaxResult.success(dataService.getTrend(deviceId, nodeId, startTime, endTime));
|
|
return AjaxResult.success(dataService.getTrend(deviceId, nodeId, startTime, endTime));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @GetMapping("/alarms")
|
|
|
|
|
|
|
+ @GetMapping("/visualization/alarms")
|
|
|
@ApiOperation("查询报警数据")
|
|
@ApiOperation("查询报警数据")
|
|
|
public AjaxResult getAlarms(@RequestParam Integer deviceId,
|
|
public AjaxResult getAlarms(@RequestParam Integer deviceId,
|
|
|
@RequestParam Integer nodeId,
|
|
@RequestParam Integer nodeId,
|
|
@@ -61,4 +66,9 @@ public class ERealTimeDataController {
|
|
|
return AjaxResult.success(dataService.getAlarms(deviceId, nodeId, startTime, endTime, threshold));
|
|
return AjaxResult.success(dataService.getAlarms(deviceId, nodeId, startTime, endTime, threshold));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @GetMapping("/visualization/device-group")
|
|
|
|
|
+ @ApiOperation("根据设备分组查询")
|
|
|
|
|
+ public AjaxResult getDeviceGroup() {
|
|
|
|
|
+ return AjaxResult.success(dataService.getDeviceGroup());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|