mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-12-05 05:38:30 +08:00
[Fix][Task] Fix dependent task can not predicate the status of the corresponding task correctly (#12253)
* [Fix][Task] dependent task can not predicate the status of the corresponding task correctly
This commit is contained in:
parent
35608becac
commit
3a14fd07b3
@ -128,16 +128,17 @@ public class DependentDateUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* get interval on first/last day of the last month
|
||||
* get interval on first/last day of the needed month
|
||||
* @param businessDate businessDate
|
||||
* @param isBeginDay isBeginDay
|
||||
* @return DateInterval list
|
||||
*/
|
||||
public static List<DateInterval> getLastMonthBeginInterval(Date businessDate,
|
||||
boolean isBeginDay) {
|
||||
public static List<DateInterval> getNeededMonthBeginInterval(Date businessDate,
|
||||
boolean isBeginDay,
|
||||
int neededMonth) {
|
||||
|
||||
Date firstDayThisMonth = DateUtils.getFirstDayOfMonth(businessDate);
|
||||
Date lastDay = DateUtils.getSomeDay(firstDayThisMonth, -1);
|
||||
Date lastDay = DateUtils.getSomeDay(firstDayThisMonth, neededMonth);
|
||||
Date firstDay = DateUtils.getFirstDayOfMonth(lastDay);
|
||||
if (isBeginDay) {
|
||||
return getDateIntervalListBetweenTwoDates(firstDay, firstDay);
|
||||
|
@ -130,14 +130,20 @@ public class DependentUtils {
|
||||
case "thisMonth":
|
||||
result = DependentDateUtils.getThisMonthInterval(businessDate);
|
||||
break;
|
||||
case "thisMonthBegin":
|
||||
result = DependentDateUtils.getNeededMonthBeginInterval(businessDate, true, 0);
|
||||
break;
|
||||
case "thisMonthEnd":
|
||||
result = DependentDateUtils.getNeededMonthBeginInterval(businessDate, false, 0);
|
||||
break;
|
||||
case "lastMonth":
|
||||
result = DependentDateUtils.getLastMonthInterval(businessDate);
|
||||
break;
|
||||
case "lastMonthBegin":
|
||||
result = DependentDateUtils.getLastMonthBeginInterval(businessDate, true);
|
||||
result = DependentDateUtils.getNeededMonthBeginInterval(businessDate, true, -1);
|
||||
break;
|
||||
case "lastMonthEnd":
|
||||
result = DependentDateUtils.getLastMonthBeginInterval(businessDate, false);
|
||||
result = DependentDateUtils.getNeededMonthBeginInterval(businessDate, false, -1);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user