Browse Source

--增加分页

develop
mengff 11 months ago
parent
commit
3dcfb1c9a4
  1. 18
      zc-business/src/main/java/com/zc/business/controller/StatusController.java

18
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<Status> listStatus = statusService.list(status);
return AjaxResult.success(listStatus);
return getDataTable(listStatus);
}
//按时间划分设备柱状图
@ApiOperation("设备状态列表按时间和类型")
@ApiOperation("设备状态柱状图按时间和类型")
@GetMapping ("/list")
public AjaxResult getStatusList(Status status)
{

Loading…
Cancel
Save