|
@@ -3,27 +3,22 @@ package com.bizmatics.controller.web;
|
|
|
|
|
|
import com.bizmatics.common.core.bean.ApiResult;
|
|
|
import com.bizmatics.common.core.bean.CommonPage;
|
|
|
-import com.bizmatics.common.core.util.DateUtils;
|
|
|
import com.bizmatics.model.Device;
|
|
|
import com.bizmatics.model.DeviceList;
|
|
|
-import com.bizmatics.model.HtAnalogData;
|
|
|
import com.bizmatics.model.vo.CorrespondDeviceListVO;
|
|
|
import com.bizmatics.model.vo.CorrespondDeviceVO;
|
|
|
import com.bizmatics.model.vo.DeviceOneVo;
|
|
|
-import com.bizmatics.persistence.mapper.DeviceMapper;
|
|
|
-import com.bizmatics.persistence.mapper.HtAnalogDataMapper;
|
|
|
import com.bizmatics.service.DeviceService;
|
|
|
import com.bizmatics.service.vo.DeviceCountVO;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
- * 设备
|
|
|
+ * 设备管理-通信设备
|
|
|
*
|
|
|
* @author ya
|
|
|
* @since 2021-07-07
|
|
@@ -35,13 +30,6 @@ public class DeviceController {
|
|
|
@Autowired
|
|
|
private DeviceService deviceService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private DeviceMapper deviceMapper;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private HtAnalogDataMapper htAnalogDataMapper;
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 查询设备总数
|
|
|
*
|
|
@@ -66,19 +54,12 @@ public class DeviceController {
|
|
|
return ApiResult.success(deviceService.selectDeviceCountByType(site));
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/test")
|
|
|
- public List<String> test() {
|
|
|
- List<Device> list = deviceMapper.list(1, null, null, null, null, null);
|
|
|
- List<String> list1 = new ArrayList<>();
|
|
|
- for (Device device : list) {
|
|
|
- long l = System.currentTimeMillis();
|
|
|
- List<HtAnalogData> list2 = htAnalogDataMapper.list(DateUtils.addYears(new Date(), -10), new Date(), device.getDeviceCode());
|
|
|
- long e = System.currentTimeMillis();
|
|
|
- log.info("一个站点的数据获取时间" + (e - l));
|
|
|
- }
|
|
|
- return list1;
|
|
|
- }
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 通信设备-设备下拉框查询
|
|
|
+ *
|
|
|
+ * @param siteId 站点ID
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@GetMapping("deviceList")
|
|
|
public ApiResult<List<DeviceList>> deviceList(@RequestParam String siteId) {
|
|
|
return ApiResult.success(deviceService.deviceList(siteId));
|
|
@@ -184,6 +165,7 @@ public class DeviceController {
|
|
|
|
|
|
/**
|
|
|
* 设备管理-通信设备-克隆
|
|
|
+ *
|
|
|
* @param type 1 新设备 2 已有设备
|
|
|
* @param newDeviceCode 克隆设备对象
|
|
|
* @param oldDeviceCode 设备编号
|
|
@@ -202,15 +184,16 @@ public class DeviceController {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 通信设备列表查询-无分页
|
|
|
- * @param siteId 站点ID
|
|
|
+ * 通信设备列表查询-无分页
|
|
|
+ *
|
|
|
+ * @param siteId 站点ID
|
|
|
* @param deviceType 1电力 2视频
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("deviceListOne")
|
|
|
public ApiResult<List<Device>> deviceListOne(@RequestParam Integer siteId,
|
|
|
- @RequestParam (value = "deviceType", required = false, defaultValue = "1") Integer deviceType) {
|
|
|
- return ApiResult.success(deviceService.deviceListOne(siteId,deviceType));
|
|
|
+ @RequestParam(value = "deviceType", required = false, defaultValue = "1") Integer deviceType) {
|
|
|
+ return ApiResult.success(deviceService.deviceListOne(siteId, deviceType));
|
|
|
}
|
|
|
}
|
|
|
|