Browse Source

修改预警bug

shengyang000 3 years ago
parent
commit
eaf15e5545

+ 8 - 8
src/main/java/com/unissoft/job/ToBeDoneJob.java

@@ -143,21 +143,21 @@ public class ToBeDoneJob implements Job, Serializable {
143
 
143
 
144
         Date startDate = null;
144
         Date startDate = null;
145
         if(timeType.equals(GrainConstant.STR_MINUTE)) {
145
         if(timeType.equals(GrainConstant.STR_MINUTE)) {
146
-            startDate = DateUtil.getNextMinute();
146
+            startDate = DateUtil.getCurrMinute();
147
         } else if(timeType.equals(GrainConstant.STR_HOUR)) {
147
         } else if(timeType.equals(GrainConstant.STR_HOUR)) {
148
-            startDate = DateUtil.getNextHour();
148
+            startDate = DateUtil.getCurrHour();
149
         } else if(timeType.equals(GrainConstant.STR_DAY)) {
149
         } else if(timeType.equals(GrainConstant.STR_DAY)) {
150
-            startDate = DateUtil.getNextDate();
150
+            startDate = DateUtil.getCurrDate();
151
         } else if(timeType.equals(GrainConstant.STR_WEEKDAY)) {
151
         } else if(timeType.equals(GrainConstant.STR_WEEKDAY)) {
152
-            startDate = DateUtil.getNextWeekday();
152
+            startDate = DateUtil.getCurrDate();
153
         } else if(timeType.equals(GrainConstant.STR_WEEK)) {
153
         } else if(timeType.equals(GrainConstant.STR_WEEK)) {
154
-            startDate = DateUtil.getFirstDateOfNextWeek();
154
+            startDate = DateUtil.getFirstDateOfCurrWeek();
155
         } else if(timeType.equals(GrainConstant.STR_MONTH)) {
155
         } else if(timeType.equals(GrainConstant.STR_MONTH)) {
156
-            startDate = DateUtil.getFirstDateOfNextMonth();
156
+            startDate = DateUtil.getFirstDateOfCurrMonth();
157
         } else if(timeType.equals(GrainConstant.STR_SEASON)) {
157
         } else if(timeType.equals(GrainConstant.STR_SEASON)) {
158
-            startDate = DateUtil.getFirstDateOfNextSeason();
158
+            startDate = DateUtil.getFirstDateOfCurrSeason();
159
         } else if(timeType.equals(GrainConstant.STR_YEAR)) {
159
         } else if(timeType.equals(GrainConstant.STR_YEAR)) {
160
-            startDate = DateUtil.getFirstDateOfNextYear();
160
+            startDate = DateUtil.getFirstDateOfCurrYear();
161
         }
161
         }
162
 
162
 
163
         return startDate;
163
         return startDate;

+ 10 - 8
src/main/java/com/unissoft/service/impl/SysEarlyWarningServiceImpl.java

@@ -402,19 +402,21 @@ public class SysEarlyWarningServiceImpl extends ServiceImpl<SysEarlyWarningMappe
402
     private static Date getStartAtDate4ToBeDone(String periodType) {
402
     private static Date getStartAtDate4ToBeDone(String periodType) {
403
         Date startAt = null;
403
         Date startAt = null;
404
         if(periodType.equals(GrainConstant.STR_MINUTE)) {
404
         if(periodType.equals(GrainConstant.STR_MINUTE)) {
405
-            startAt = DateUtil.getCurrMinute();
405
+            startAt = DateUtil.getNextMinute();
406
         } else if(periodType.equals(GrainConstant.STR_HOUR)) {
406
         } else if(periodType.equals(GrainConstant.STR_HOUR)) {
407
-            startAt = DateUtil.getCurrHour();
408
-        } else if(periodType.equals(GrainConstant.STR_DAY) || periodType.equals(GrainConstant.STR_WEEKDAY)) {
409
-            startAt = DateUtil.getCurrDate();
407
+            startAt = DateUtil.getNextHour();
408
+        } else if(periodType.equals(GrainConstant.STR_DAY)) {
409
+            startAt = DateUtil.getNextDate();
410
+        } else if(periodType.equals(GrainConstant.STR_WEEKDAY)) {
411
+            startAt = DateUtil.getNextWeekday();
410
         } else if(periodType.equals(GrainConstant.STR_WEEK)) {
412
         } else if(periodType.equals(GrainConstant.STR_WEEK)) {
411
-            startAt = DateUtil.getFirstDateOfCurrWeek();
413
+            startAt = DateUtil.getFirstDateOfNextWeek();
412
         } else if(periodType.equals(GrainConstant.STR_MONTH)) {
414
         } else if(periodType.equals(GrainConstant.STR_MONTH)) {
413
-            startAt = DateUtil.getFirstDateOfCurrMonth();
415
+            startAt = DateUtil.getFirstDateOfNextMonth();
414
         } else if(periodType.equals(GrainConstant.STR_SEASON)) {
416
         } else if(periodType.equals(GrainConstant.STR_SEASON)) {
415
-            startAt = DateUtil.getFirstDateOfCurrSeason();
417
+            startAt = DateUtil.getFirstDateOfNextSeason();
416
         } else if(periodType.equals(GrainConstant.STR_YEAR)) {
418
         } else if(periodType.equals(GrainConstant.STR_YEAR)) {
417
-            startAt = DateUtil.getFirstDateOfCurrYear();
419
+            startAt = DateUtil.getFirstDateOfNextYear();
418
         }
420
         }
419
 
421
 
420
         return startAt;
422
         return startAt;