diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataAnalysisService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataAnalysisService.java index 6e8e82ddbd03f80c250e0614c23d8bd7c7d4173b..a64e01e35f269e1f9cb71cf718edcce81c078bf6 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataAnalysisService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataAnalysisService.java @@ -23,6 +23,7 @@ import org.apache.dolphinscheduler.api.dto.TaskCountDto; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.utils.Constants; import org.apache.dolphinscheduler.common.enums.CommandType; +import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.common.enums.UserType; import org.apache.dolphinscheduler.common.queue.ITaskQueue; import org.apache.dolphinscheduler.common.queue.TaskQueueFactory; @@ -246,15 +247,18 @@ public class DataAnalysisService { Date start = null; Date end = null; - try { - start = DateUtils.getScheduleDate(startDate); - end = DateUtils.getScheduleDate(endDate); - } catch (Exception e) { - logger.error(e.getMessage(),e); - putErrorRequestParamsMsg(result); - return result; + if (startDate != null && endDate != null){ + try { + start = DateUtils.getScheduleDate(startDate); + end = DateUtils.getScheduleDate(endDate); + } catch (Exception e) { + logger.error(e.getMessage(),e); + putErrorRequestParamsMsg(result); + return result; + } } + Integer[] projectIdArray = getProjectIdsArrays(loginUser, projectId); // count command state List commandStateCounts = @@ -278,18 +282,21 @@ public class DataAnalysisService { // init data map -// dataMap.put(ExecutionStatus.SUBMITTED_SUCCESS,commonCommand); -// dataMap.put(ExecutionStatus.RUNNING_EXEUTION,commonCommand); -// dataMap.put(ExecutionStatus.READY_PAUSE,commonCommand); -// dataMap.put(ExecutionStatus.PAUSE,commonCommand); -// dataMap.put(ExecutionStatus.READY_STOP,commonCommand); -// dataMap.put(ExecutionStatus.STOP,commonCommand); -// dataMap.put(ExecutionStatus.FAILURE,commonCommand); -// dataMap.put(ExecutionStatus.SUCCESS,commonCommand); -// dataMap.put(ExecutionStatus.NEED_FAULT_TOLERANCE,commonCommand); -// dataMap.put(ExecutionStatus.KILL,commonCommand); -// dataMap.put(ExecutionStatus.WAITTING_THREAD,commonCommand); -// dataMap.put(ExecutionStatus.WAITTING_DEPEND,commonCommand); + /** + * START_PROCESS, START_CURRENT_TASK_PROCESS, RECOVER_TOLERANCE_FAULT_PROCESS, RECOVER_SUSPENDED_PROCESS, + START_FAILURE_TASK_PROCESS,COMPLEMENT_DATA,SCHEDULER, REPEAT_RUNNING,PAUSE,STOP,RECOVER_WAITTING_THREAD; + */ + dataMap.put(CommandType.START_PROCESS,commonCommand); + dataMap.put(CommandType.START_CURRENT_TASK_PROCESS,commonCommand); + dataMap.put(CommandType.RECOVER_TOLERANCE_FAULT_PROCESS,commonCommand); + dataMap.put(CommandType.RECOVER_SUSPENDED_PROCESS,commonCommand); + dataMap.put(CommandType.START_FAILURE_TASK_PROCESS,commonCommand); + dataMap.put(CommandType.COMPLEMENT_DATA,commonCommand); + dataMap.put(CommandType.SCHEDULER,commonCommand); + dataMap.put(CommandType.REPEAT_RUNNING,commonCommand); + dataMap.put(CommandType.PAUSE,commonCommand); + dataMap.put(CommandType.STOP,commonCommand); + dataMap.put(CommandType.RECOVER_WAITTING_THREAD,commonCommand); // put command state for (CommandCount executeStatusCount : commandStateCounts){ diff --git a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/CommandMapper.xml b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/CommandMapper.xml index e3ab6b23c9a9aa9e638d0f9dc4869276363d3d4f..370b0119b0ea6526d25c6d76af1144772eaa9044 100644 --- a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/CommandMapper.xml +++ b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/CommandMapper.xml @@ -9,7 +9,7 @@ limit 1 - select cmd.command_type as commandType, count(1) as count + select cmd.command_type as command_type, count(1) as count from t_ds_error_command cmd, t_ds_process_definition process where cmd.process_definition_id = process.id