Commit 63cf9379 authored by yanzg's avatar yanzg

执行时间

parent bbbf34b7
...@@ -100,7 +100,7 @@ public class PlanInfo<T> { ...@@ -100,7 +100,7 @@ public class PlanInfo<T> {
* @param hour N小时 * @param hour N小时
* @return 下次执行间隔时间 * @return 下次执行间隔时间
*/ */
public int getNextDayHourMillSecond(int day, int hour) { public long getNextDayHourMillSecond(int day, int hour) {
return getNextDayHourMillSecond(day, (double) hour); return getNextDayHourMillSecond(day, (double) hour);
} }
...@@ -111,9 +111,9 @@ public class PlanInfo<T> { ...@@ -111,9 +111,9 @@ public class PlanInfo<T> {
* @param hour N小时 * @param hour N小时
* @return 下次执行间隔时间 * @return 下次执行间隔时间
*/ */
public int getNextDayHourMillSecond(int day, double hour) { public long getNextDayHourMillSecond(int day, double hour) {
if (this.getTime() == 0) { if (this.getTime() == 0) {
return 60; return 60L;
} }
// 上次执行时间 // 上次执行时间
Date prevTime = new Date(this.getTime()); Date prevTime = new Date(this.getTime());
...@@ -122,8 +122,7 @@ public class PlanInfo<T> { ...@@ -122,8 +122,7 @@ public class PlanInfo<T> {
Date nextDay = DateHelper.addDay(DateHelper.getDateTime(prevToday), day); Date nextDay = DateHelper.addDay(DateHelper.getDateTime(prevToday), day);
Date nextDayHour = DateHelper.addMinute(nextDay, (int) (hour * 60)); Date nextDayHour = DateHelper.addMinute(nextDay, (int) (hour * 60));
// 下次执行时间 // 下次执行时间
long dedTime = Math.max(0, nextDayHour.getTime() - this.getTime()); return Math.max(0, nextDayHour.getTime() - this.getTime());
return (int) dedTime;
} }
public long getId() { public long getId() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment