Browse Source

投药报表,小时||天维度,fix

Davidliu 2 days ago
parent
commit
d93b321281

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

@@ -41,8 +41,8 @@ public class TXlhtAddRecordController extends BaseController{
         //2024年10月24日17:24:13 如果没有指定日期,那么这里给默认15天的数据
         Date nowDate = DateUtils.getNowDate();
         Date dayBefore14 = DateUtils.plusDate(-14, nowDate);
-        timeEnd = StringUtils.isBlank(timeEnd) ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH, nowDate) : timeEnd;
-        timeBegin = StringUtils.isBlank(timeBegin) ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH, dayBefore14) : timeBegin;
+        timeEnd = StringUtils.isBlank(timeEnd) ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, nowDate) : timeEnd;
+        timeBegin = StringUtils.isBlank(timeBegin) ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, dayBefore14) : timeBegin;
         TXlhtAddRecord req = TXlhtAddRecord.builder().timeBegin(timeBegin).timeEnd(timeEnd).build();
         return R.ok(this.txlhtAddRecordService.selectTXlhtAddRecordHourList(req));
     }
@@ -57,8 +57,8 @@ public class TXlhtAddRecordController extends BaseController{
         //2024年10月24日17:24:13 如果没有指定日期,那么这里给默认15天的数据
         Date nowDate = DateUtils.getNowDate();
         Date dayBefore14 = DateUtils.plusDate(-14, nowDate);
-        timeEnd = StringUtils.isBlank(timeEnd) ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH, nowDate) : timeEnd;
-        timeBegin = StringUtils.isBlank(timeBegin) ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH, dayBefore14) : timeBegin;
+        timeEnd = StringUtils.isBlank(timeEnd) ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, nowDate) : timeEnd;
+        timeBegin = StringUtils.isBlank(timeBegin) ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, dayBefore14) : timeBegin;
         TXlhtAddRecord req = TXlhtAddRecord.builder().timeBegin(timeBegin).timeEnd(timeEnd).build();
         List<TXlhtAddRecord> list = this.txlhtAddRecordService.selectTXlhtAddRecordHourList(req);
 
@@ -111,8 +111,8 @@ public class TXlhtAddRecordController extends BaseController{
         //2024年10月24日17:24:13 如果没有指定日期,那么这里给默认15天的数据
         Date nowDate = DateUtils.getNowDate();
         Date dayBefore14 = DateUtils.plusDate(-14, nowDate);
-        timeEnd = StringUtils.isBlank(timeEnd) ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, nowDate) : timeEnd;
-        timeBegin = StringUtils.isBlank(timeBegin) ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, dayBefore14) : timeBegin;
+        timeEnd = StringUtils.isBlank(timeEnd) ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, nowDate) : timeEnd;
+        timeBegin = StringUtils.isBlank(timeBegin) ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, dayBefore14) : timeBegin;
         TXlhtAddRecord req = TXlhtAddRecord.builder().timeBegin(timeBegin).timeEnd(timeEnd).build();
         return R.ok(this.txlhtAddRecordService.selectTXlhtAddRecordDayList(req));
     }
@@ -127,8 +127,8 @@ public class TXlhtAddRecordController extends BaseController{
         //2024年10月24日17:24:13 如果没有指定日期,那么这里给默认15天的数据
         Date nowDate = DateUtils.getNowDate();
         Date dayBefore14 = DateUtils.plusDate(-14, nowDate);
-        timeEnd = StringUtils.isBlank(timeEnd) ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, nowDate) : timeEnd;
-        timeBegin = StringUtils.isBlank(timeBegin) ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, dayBefore14) : timeBegin;
+        timeEnd = StringUtils.isBlank(timeEnd) ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, nowDate) : timeEnd;
+        timeBegin = StringUtils.isBlank(timeBegin) ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, dayBefore14) : timeBegin;
         TXlhtAddRecord req = TXlhtAddRecord.builder().timeBegin(timeBegin).timeEnd(timeEnd).build();
         List<TXlhtAddRecord> list = this.txlhtAddRecordService.selectTXlhtAddRecordDayList(req);