|
@@ -1,13 +1,11 @@
|
|
|
package com.xy.controller;
|
|
|
|
|
|
import com.xy.annotate.RestMappingController;
|
|
|
-import com.xy.dto.DeviceErrorsRecordDto;
|
|
|
-import com.xy.dto.DeviceNetRecordDto;
|
|
|
-import com.xy.dto.DeviceRecordsDto;
|
|
|
-import com.xy.dto.MiniDeviceRecordsDto;
|
|
|
+import com.xy.dto.*;
|
|
|
import com.xy.service.DeviceErrorsRecordService;
|
|
|
import com.xy.service.DeviceNetRecordService;
|
|
|
import com.xy.service.DeviceRecordsService;
|
|
|
+import com.xy.service.DeviceTempRecordsService;
|
|
|
import com.xy.utils.MercAuthUtils;
|
|
|
import com.xy.utils.PageBean;
|
|
|
import com.xy.utils.R;
|
|
@@ -23,7 +21,7 @@ import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
|
- *
|
|
|
+ * 小程序设备相关记录
|
|
|
* </p>
|
|
|
*
|
|
|
* @author hechunping
|
|
@@ -42,6 +40,8 @@ public class MercMiniDeviceRecordsController {
|
|
|
|
|
|
private final DeviceErrorsRecordService deviceErrorsRecordService;
|
|
|
|
|
|
+ private final DeviceTempRecordsService deviceTempRecordsService;
|
|
|
+
|
|
|
@ApiOperation("设备操作记录分页")
|
|
|
@PostMapping("deviceRecordsPage")
|
|
|
public R<PageBean<DeviceRecordsDto.Vo>> deviceRecordsPage(@RequestBody @Validated DeviceRecordsDto.Page dto) {
|
|
@@ -60,7 +60,7 @@ public class MercMiniDeviceRecordsController {
|
|
|
|
|
|
@ApiOperation("联网记录分页")
|
|
|
@PostMapping("deviceNetRecordPage")
|
|
|
- public R<PageBean<DeviceNetRecordDto.Vo>> deviceNetRecordPage(@RequestBody @Validated DeviceNetRecordDto.Page dto){
|
|
|
+ public R<PageBean<DeviceNetRecordDto.Vo>> deviceNetRecordPage(@RequestBody @Validated DeviceNetRecordDto.Page dto) {
|
|
|
return deviceNetRecordService.page(dto);
|
|
|
}
|
|
|
|
|
@@ -76,7 +76,7 @@ public class MercMiniDeviceRecordsController {
|
|
|
|
|
|
@ApiOperation("故障记录分页")
|
|
|
@PostMapping("deviceErrorPage")
|
|
|
- public R<PageBean<DeviceErrorsRecordDto.Vo>> deviceErrorPage(@RequestBody DeviceErrorsRecordDto.Page page){
|
|
|
+ public R<PageBean<DeviceErrorsRecordDto.Vo>> deviceErrorPage(@RequestBody DeviceErrorsRecordDto.Page page) {
|
|
|
return deviceErrorsRecordService.page(page);
|
|
|
}
|
|
|
|
|
@@ -90,13 +90,28 @@ public class MercMiniDeviceRecordsController {
|
|
|
return R.ok(recordsList);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("温度记录分页")
|
|
|
+ @PostMapping("deviceTempRecords")
|
|
|
+ public R<PageBean<DeviceTempRecordsDto.Vo>> deviceTempRecords(@RequestBody @Validated DeviceTempRecordsDto.Page dto) {
|
|
|
+ return deviceTempRecordsService.page(dto);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("设备详情首页-温度记录")
|
|
|
+ @PostMapping("indexDeviceTempRecords")
|
|
|
+ public R<List<DeviceTempRecordsDto.Vo>> indexDeviceTempRecords(@RequestBody @Validated MiniDeviceRecordsDto.DeviceIdDto dto) {
|
|
|
+ DeviceTempRecordsDto.Page page = (DeviceTempRecordsDto.Page) new DeviceTempRecordsDto.Page().setDeviceId(dto.getDeviceId());
|
|
|
+ page.setPage(getPageBean(INDEX_RECORDS_COUNT));
|
|
|
+ List<DeviceTempRecordsDto.Vo> recordsList = deviceTempRecords(page).getData().getRecords();
|
|
|
+ return R.ok(recordsList);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取分页信息
|
|
|
*
|
|
|
* @param count 显示条数
|
|
|
* @return {@link PageBean}
|
|
|
*/
|
|
|
- private PageBean getPageBean(int count){
|
|
|
+ private PageBean getPageBean(int count) {
|
|
|
List<PageBean.OrderItemBean> orderItemBeans = new ArrayList<>();
|
|
|
orderItemBeans.add(new PageBean.OrderItemBean().setColumn("id").setAsc(false));
|
|
|
return new PageBean<>().setSize(count).setSearchCount(false).setOrders(orderItemBeans);
|