|
|
|
@ -17,15 +17,20 @@
|
|
|
|
|
|
|
|
|
|
package org.apache.dolphinscheduler.api.service.impl; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import org.apache.commons.collections.CollectionUtils; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.*; |
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.*; |
|
|
|
|
import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.TASK_TYPE_DEPENDENT; |
|
|
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.api.dto.gantt.GanttDto; |
|
|
|
|
import org.apache.dolphinscheduler.api.dto.gantt.Task; |
|
|
|
|
import org.apache.dolphinscheduler.api.enums.Status; |
|
|
|
|
import org.apache.dolphinscheduler.api.exceptions.ServiceException; |
|
|
|
|
import org.apache.dolphinscheduler.api.service.*; |
|
|
|
|
import org.apache.dolphinscheduler.api.service.ExecutorService; |
|
|
|
|
import org.apache.dolphinscheduler.api.service.LoggerService; |
|
|
|
|
import org.apache.dolphinscheduler.api.service.ProcessDefinitionService; |
|
|
|
|
import org.apache.dolphinscheduler.api.service.ProcessInstanceService; |
|
|
|
|
import org.apache.dolphinscheduler.api.service.ProjectService; |
|
|
|
|
import org.apache.dolphinscheduler.api.service.UsersService; |
|
|
|
|
import org.apache.dolphinscheduler.api.utils.PageInfo; |
|
|
|
|
import org.apache.dolphinscheduler.api.utils.Result; |
|
|
|
|
import org.apache.dolphinscheduler.common.Constants; |
|
|
|
@ -47,22 +52,31 @@ import org.apache.dolphinscheduler.plugin.task.api.parameters.ParametersNode;
|
|
|
|
|
import org.apache.dolphinscheduler.service.expand.CuringParamsService; |
|
|
|
|
import org.apache.dolphinscheduler.service.process.ProcessService; |
|
|
|
|
import org.apache.dolphinscheduler.service.task.TaskPluginManager; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
import org.apache.commons.collections.CollectionUtils; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
|
|
|
|
|
import java.io.BufferedReader; |
|
|
|
|
import java.io.ByteArrayInputStream; |
|
|
|
|
import java.io.IOException; |
|
|
|
|
import java.io.InputStreamReader; |
|
|
|
|
import java.nio.charset.StandardCharsets; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Collections; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.Objects; |
|
|
|
|
import java.util.function.Function; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.*; |
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.*; |
|
|
|
|
import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.TASK_TYPE_DEPENDENT; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* process instance service impl |
|
|
|
@ -787,8 +801,7 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl implements Proce
|
|
|
|
|
if (!nodeList.isEmpty()) { |
|
|
|
|
List<Long> taskCodes = nodeList.stream().map(Long::parseLong).collect(Collectors.toList()); |
|
|
|
|
List<TaskInstance> taskInstances = taskInstanceMapper.queryByProcessInstanceIdsAndTaskCodes( |
|
|
|
|
Collections.singletonList(processInstanceId), taskCodes |
|
|
|
|
); |
|
|
|
|
Collections.singletonList(processInstanceId), taskCodes); |
|
|
|
|
for (String node : nodeList) { |
|
|
|
|
TaskInstance taskInstance = null; |
|
|
|
|
for (TaskInstance instance : taskInstances) { |
|
|
|
@ -809,7 +822,7 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl implements Proce
|
|
|
|
|
task.getEndDate().add(endTime.getTime()); |
|
|
|
|
task.setIsoStart(startTime); |
|
|
|
|
task.setIsoEnd(endTime); |
|
|
|
|
task.setStatus(taskInstance.getState().toString()); |
|
|
|
|
task.setStatus(taskInstance.getState().getDesc().toUpperCase()); |
|
|
|
|
task.setExecutionDate(taskInstance.getStartTime()); |
|
|
|
|
task.setDuration(DateUtils.format2Readable(endTime.getTime() - startTime.getTime())); |
|
|
|
|
taskList.add(task); |
|
|
|
|