|
|
|
@ -14,6 +14,7 @@
|
|
|
|
|
* See the License for the specific language governing permissions and |
|
|
|
|
* limitations under the License. |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
package org.apache.dolphinscheduler.common.utils.placeholder; |
|
|
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.common.Constants; |
|
|
|
@ -36,6 +37,7 @@ public class BusinessTimeUtils {
|
|
|
|
|
private BusinessTimeUtils() { |
|
|
|
|
throw new IllegalStateException("BusinessTimeUtils class"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* get business time in parameters by different command types |
|
|
|
|
* |
|
|
|
@ -45,8 +47,12 @@ public class BusinessTimeUtils {
|
|
|
|
|
*/ |
|
|
|
|
public static Map<String, String> getBusinessTime(CommandType commandType, Date runTime) { |
|
|
|
|
Date businessDate = runTime; |
|
|
|
|
Map<String, String> result = new HashMap<>(); |
|
|
|
|
switch (commandType) { |
|
|
|
|
case COMPLEMENT_DATA: |
|
|
|
|
if (runTime == null) { |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case START_PROCESS: |
|
|
|
|
case START_CURRENT_TASK_PROCESS: |
|
|
|
@ -66,7 +72,6 @@ public class BusinessTimeUtils {
|
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
Date businessCurrentDate = addDays(businessDate, 1); |
|
|
|
|
Map<String, String> result = new HashMap<>(); |
|
|
|
|
result.put(Constants.PARAMETER_CURRENT_DATE, format(businessCurrentDate, PARAMETER_FORMAT_DATE)); |
|
|
|
|
result.put(Constants.PARAMETER_BUSINESS_DATE, format(businessDate, PARAMETER_FORMAT_DATE)); |
|
|
|
|
result.put(Constants.PARAMETER_DATETIME, format(businessCurrentDate, PARAMETER_FORMAT_TIME)); |
|
|
|
|