From 3dcfb1c9a4fd621300c390d26eb32238466f1332 Mon Sep 17 00:00:00 2001 From: mengff <1198151809@qq.com> Date: Wed, 17 Jan 2024 17:41:33 +0800 Subject: [PATCH] =?UTF-8?q?--=E5=A2=9E=E5=8A=A0=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/controller/StatusController.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/StatusController.java b/zc-business/src/main/java/com/zc/business/controller/StatusController.java index 84029a24..be771e9b 100644 --- a/zc-business/src/main/java/com/zc/business/controller/StatusController.java +++ b/zc-business/src/main/java/com/zc/business/controller/StatusController.java @@ -1,5 +1,7 @@ package com.zc.business.controller; +import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; import com.zc.business.domain.Status; import com.zc.business.service.impl.StatusService; import io.swagger.annotations.Api; @@ -13,29 +15,33 @@ import java.time.LocalDateTime; import java.time.temporal.ChronoUnit; import java.util.*; import java.util.stream.Collectors; -@Api("设备状态") + +import static com.ruoyi.common.utils.PageUtils.startPage; + +@Api(tags="设备状态") @RestController @RequestMapping("/system/status") -public class StatusController { +public class StatusController extends BaseController { @Autowired private StatusService statusService; //设备列表 - @ApiOperation("设备状态柱状按时间和类型") + @ApiOperation("设备状态列表按时间和类型") @GetMapping ("/tablist") - public AjaxResult getTabList(Status status) + public TableDataInfo getTabList(Status status) { + startPage(); LocalDateTime todayStart = status.getStartTime().truncatedTo(ChronoUnit.DAYS); LocalDateTime currentTime = status.getTime().truncatedTo(ChronoUnit.DAYS).plusDays(1); status.setStartTime(todayStart); status.setTime(currentTime); List listStatus = statusService.list(status); - return AjaxResult.success(listStatus); + return getDataTable(listStatus); } //按时间划分设备柱状图 - @ApiOperation("设备状态列表按时间和类型") + @ApiOperation("设备状态柱状图按时间和类型") @GetMapping ("/list") public AjaxResult getStatusList(Status status) {