소스 검색

投药报表,小时||天维度,分页

Davidliu 2 일 전
부모
커밋
a8064dce63
1개의 변경된 파일9개의 추가작업 그리고 4개의 파일을 삭제
  1. 9 4
      src/main/java/com/xlht/xlhtproject/controller/TXlhtAddRecordController.java

+ 9 - 4
src/main/java/com/xlht/xlhtproject/controller/TXlhtAddRecordController.java

@@ -3,6 +3,7 @@ package com.xlht.xlhtproject.controller;
 import com.alibaba.excel.EasyExcel;
 import com.xlht.xlhtproject.domain.TXlhtAddRecord;
 import com.xlht.xlhtproject.respParse.bean.R;
+import com.xlht.xlhtproject.respParse.page.TableDataInfo;
 import com.xlht.xlhtproject.service.ITXlhtAddRecordService;
 import com.xlht.xlhtproject.utils.DateUtils;
 import com.xlht.xlhtproject.utils.StringUtils;
@@ -35,7 +36,7 @@ public class TXlhtAddRecordController extends BaseController{
      * @return
      */
     @GetMapping("/hourList")
-    public R<List<TXlhtAddRecord>> hourList(@RequestParam(required = false, name = "timeBegin") String timeBegin, @RequestParam(required = false, name = "timeEnd") String timeEnd)
+    public TableDataInfo hourList(@RequestParam(required = false, name = "timeBegin") String timeBegin, @RequestParam(required = false, name = "timeEnd") String timeEnd)
     {
         log.info("进入了 碳源投加 小时维度投药聚合报表 接口");
         //2024年10月24日17:24:13 如果没有指定日期,那么这里给默认15天的数据
@@ -44,7 +45,9 @@ public class TXlhtAddRecordController extends BaseController{
         timeEnd = StringUtils.isBlank(timeEnd) ? DateUtils.parseDateToStr("yyyy-MM-dd HH:00:00", nowDate) : timeEnd;
         timeBegin = StringUtils.isBlank(timeBegin) ? DateUtils.parseDateToStr("yyyy-MM-dd HH:00:00", dayBefore14) : timeBegin;
         TXlhtAddRecord req = TXlhtAddRecord.builder().timeBegin(timeBegin).timeEnd(timeEnd).build();
-        return R.ok(this.txlhtAddRecordService.selectTXlhtAddRecordHourList(req));
+        startPage();
+        List<TXlhtAddRecord> list = this.txlhtAddRecordService.selectTXlhtAddRecordHourList(req);
+        return getDataTable(list);
     }
 
     /**
@@ -105,7 +108,7 @@ public class TXlhtAddRecordController extends BaseController{
      * @return
      */
     @GetMapping("/dayList")
-    public R<List<TXlhtAddRecord>> dayList(@RequestParam(required = false, name = "timeBegin") String timeBegin, @RequestParam(required = false, name = "timeEnd") String timeEnd)
+    public TableDataInfo dayList(@RequestParam(required = false, name = "timeBegin") String timeBegin, @RequestParam(required = false, name = "timeEnd") String timeEnd)
     {
         log.info("进入了 碳源投加 天维度投药聚合报表 接口");
         //2024年10月24日17:24:13 如果没有指定日期,那么这里给默认15天的数据
@@ -114,7 +117,9 @@ public class TXlhtAddRecordController extends BaseController{
         timeEnd = StringUtils.isBlank(timeEnd) ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, nowDate) : timeEnd;
         timeBegin = StringUtils.isBlank(timeBegin) ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, dayBefore14) : timeBegin;
         TXlhtAddRecord req = TXlhtAddRecord.builder().timeBegin(timeBegin).timeEnd(timeEnd).build();
-        return R.ok(this.txlhtAddRecordService.selectTXlhtAddRecordDayList(req));
+        startPage();
+        List<TXlhtAddRecord> list = this.txlhtAddRecordService.selectTXlhtAddRecordDayList(req);
+        return getDataTable(list);
     }
 
     /**