diff --git a/haiwei-admin/src/main/java/com/haiwei/web/controller/broad/ApiController.java b/haiwei-admin/src/main/java/com/haiwei/web/controller/broad/ApiController.java index 36265d3..207bae7 100644 --- a/haiwei-admin/src/main/java/com/haiwei/web/controller/broad/ApiController.java +++ b/haiwei-admin/src/main/java/com/haiwei/web/controller/broad/ApiController.java @@ -7,10 +7,7 @@ import static com.haiwei.common.core.domain.AjaxResult.*; import com.haiwei.common.core.page.TableDataInfo; import com.haiwei.common.utils.poi.ExcelUtil_2; -import com.haiwei.manage.domain.BaseDeviceType; -import com.haiwei.manage.domain.DeviceState; -import com.haiwei.manage.domain.RecordRaramData; -import com.haiwei.manage.domain.RecordRaramDataB; +import com.haiwei.manage.domain.*; import com.haiwei.manage.service.IApiService; import com.haiwei.manage.service.IBaseCustomerService; import com.haiwei.manage.service.IBaseDeviceInfoService; @@ -67,7 +64,7 @@ public class ApiController extends BaseController { return AjaxResult.success(iApiService.queryPram(name)); } - @ApiOperation(tags = {"60脱水机"}, value = "获取设备状态 msg字段") + @ApiOperation(tags = {"60脱水机"}, value = "获取设备状态") @GetMapping("/home/queryDeviceState") public AjaxResult queryDeviceState(String name) { if (name.equals("60型一体机A") ){ @@ -92,14 +89,39 @@ public class ApiController extends BaseController { // } @ApiOperation(tags = {"60脱水机"}, value = "获取数据记录") @GetMapping("/home/queryParamData") - public TableDataInfo queryParamData(@RequestParam(defaultValue = "1") int timeInterval, Date beginTime, Date endTime) { - System.out.println("时间间隔" + timeInterval); + public TableDataInfo queryParamData(QueryParam param) { + startPage(); - List recordRaramData = iApiService.queryParamData(timeInterval, beginTime, endTime); + List recordRaramData = iApiService.queryParamData(param.getTimeInterval(), + param.getBeginTime(),param.getEndTime()); return getDataTable(recordRaramData); } + //查询数据B + @ApiOperation(tags = {"60脱水机"}, value = "获取一体机B数据记录") + @GetMapping("/home/queryParamDataB") + public TableDataInfo queryParamDataB(@RequestParam(defaultValue = "1") int timeInterval, Date beginTime, Date endTime) { + startPage(); + List data = iApiService.queryParamData_B(timeInterval, beginTime, endTime); + return getDataTable(data); + } + + + //查询数据B + @ApiOperation(tags = {"60脱水机"}, value = "获取一体机B趋势") + @GetMapping("/home/queryBTrend") + public AjaxResult queryBTrend(@RequestParam(defaultValue = "1") int timeInterval, Date beginTime, Date endTime) { + + return AjaxResult.success(iApiService.queryParamData_B(timeInterval, beginTime, endTime)); + } + + + + + + + @ApiOperation(tags = {"60脱水机"}, value = "导出数据记录") @PostMapping("/home/exportParamList") @@ -125,13 +147,6 @@ public class ApiController extends BaseController { return util.exportExcel(list, "数据记录", name + "," + type); } - //查询数据B - @ApiOperation(tags = {"60脱水机"}, value = "获取数据记录") - @GetMapping("/home/queryParamDataB") - public AjaxResult queryParamDataB(@RequestParam(defaultValue = "1") int timeInterval, Date beginTime, Date endTime) { - System.out.println("时间间隔" + timeInterval); - return AjaxResult.success(iApiService.queryParamData_B(timeInterval, beginTime, endTime)); - } @ApiOperation(tags = {"60脱水机"}, value = "导出数据记录") @PostMapping("/home/exportParamListB") diff --git a/haiwei-manage/src/main/java/com/haiwei/manage/domain/QueryParam.java b/haiwei-manage/src/main/java/com/haiwei/manage/domain/QueryParam.java new file mode 100644 index 0000000..4b52992 --- /dev/null +++ b/haiwei-manage/src/main/java/com/haiwei/manage/domain/QueryParam.java @@ -0,0 +1,29 @@ +package com.haiwei.manage.domain; + +import com.haiwei.common.core.domain.BaseEntity; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.Date; + +/** + * @author wanghao + * @date 2024/7/22 9:45 + */ +public class QueryParam extends BaseEntity { + + private int timeInterval; + private Date beginTime; + private Date endTime; + + public int getTimeInterval() { + return timeInterval; + } + + public Date getBeginTime() { + return beginTime; + } + + public Date getEndTime() { + return endTime; + } +}