Commit 2b9294b0 authored by yanzg's avatar yanzg

修改地址

parent a44bc5c5
...@@ -101,6 +101,17 @@ public class PlanInfo<T> { ...@@ -101,6 +101,17 @@ public class PlanInfo<T> {
* @return 下次执行间隔时间 * @return 下次执行间隔时间
*/ */
public int getNextDayHourMillSecond(int day, int hour) { public int getNextDayHourMillSecond(int day, int hour) {
return getNextDayHourMillSecond(day, (double) hour);
}
/**
* 间隔N天后第N个小时执行
*
* @param day N天
* @param hour N小时
* @return 下次执行间隔时间
*/
public int getNextDayHourMillSecond(int day, double hour) {
if (this.getTime() == 0) { if (this.getTime() == 0) {
return 0; return 0;
} }
...@@ -109,7 +120,7 @@ public class PlanInfo<T> { ...@@ -109,7 +120,7 @@ public class PlanInfo<T> {
String prevToday = DateHelper.getToday(prevTime); String prevToday = DateHelper.getToday(prevTime);
// 通过MQ设置明天凌晨2点开始计算 // 通过MQ设置明天凌晨2点开始计算
Date nextDay = DateHelper.addDay(DateHelper.getDateTime(prevToday), day); Date nextDay = DateHelper.addDay(DateHelper.getDateTime(prevToday), day);
Date nextDayHour = DateHelper.addHour(nextDay, hour); Date nextDayHour = DateHelper.addMinute(nextDay, (int) (hour * 60));
// 下次执行时间 // 下次执行时间
long dedTime = Math.max(0, nextDayHour.getTime() - this.getTime()); long dedTime = Math.max(0, nextDayHour.getTime() - this.getTime());
return (int) dedTime; return (int) dedTime;
......
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