[Bug] [API] queryProcessDefinitionByCode bug (#7221)
parent
9d65bf1452
commit
2792c35d68
|
|
@ -148,6 +148,7 @@ public class SchedulerController extends BaseController {
|
|||
@ApiImplicitParam(name = "environmentCode", value = "ENVIRONMENT_CODE", dataType = "Long"),
|
||||
})
|
||||
@PutMapping("/{id}")
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
@ApiException(UPDATE_SCHEDULE_ERROR)
|
||||
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
|
||||
public Result updateSchedule(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser,
|
||||
|
|
@ -330,11 +331,12 @@ public class SchedulerController extends BaseController {
|
|||
@ApiImplicitParam(name = "warningType", value = "WARNING_TYPE", type = "WarningType"),
|
||||
@ApiImplicitParam(name = "warningGroupId", value = "WARNING_GROUP_ID", dataType = "Int", example = "100"),
|
||||
@ApiImplicitParam(name = "failureStrategy", value = "FAILURE_STRATEGY", type = "FailureStrategy"),
|
||||
@ApiImplicitParam(name = "workerGroupId", value = "WORKER_GROUP_ID", dataType = "Int", example = "100"),
|
||||
@ApiImplicitParam(name = "workerGroup", value = "WORKER_GROUP", dataType = "String", example = "default"),
|
||||
@ApiImplicitParam(name = "processInstancePriority", value = "PROCESS_INSTANCE_PRIORITY", type = "Priority"),
|
||||
@ApiImplicitParam(name = "environmentCode", value = "ENVIRONMENT_CODE", dataType = "Long"),
|
||||
})
|
||||
@PutMapping("/{code}")
|
||||
@PutMapping("/update/{code}")
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
@ApiException(UPDATE_SCHEDULE_ERROR)
|
||||
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
|
||||
public Result updateScheduleByProcessDefinitionCode(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser,
|
||||
|
|
|
|||
|
|
@ -177,6 +177,9 @@ public class WorkFlowLineageServiceImpl extends BaseServiceImpl implements WorkF
|
|||
|
||||
private Set<Long> querySourceWorkFlowCodes(long projectCode, long workFlowCode, List<TaskDefinition> taskDefinitionList) {
|
||||
Set<Long> sourceWorkFlowCodes = new HashSet<>();
|
||||
if (taskDefinitionList == null || taskDefinitionList.isEmpty()) {
|
||||
return sourceWorkFlowCodes;
|
||||
}
|
||||
List<TaskDefinitionLog> taskDefinitionLogs = taskDefinitionLogMapper.queryByTaskDefinitions(taskDefinitionList);
|
||||
for (TaskDefinitionLog taskDefinitionLog : taskDefinitionLogs) {
|
||||
if (taskDefinitionLog.getProjectCode() == projectCode) {
|
||||
|
|
|
|||
|
|
@ -136,9 +136,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.facebook.presto.jdbc.internal.guava.collect.Lists;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
/**
|
||||
* process relative dao that some mappers in this.
|
||||
|
|
@ -415,7 +415,7 @@ public class ProcessService {
|
|||
ProcessDefinition processDefinition = processDefineMapper.queryByCode(defineCode);
|
||||
if (processDefinition == null) {
|
||||
logger.error("process define not exists");
|
||||
return new ArrayList<>();
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
List<ProcessTaskRelationLog> processTaskRelations = processTaskRelationLogMapper.queryByProcessCodeAndVersion(processDefinition.getCode(), processDefinition.getVersion());
|
||||
Set<TaskDefinition> taskDefinitionSet = new HashSet<>();
|
||||
|
|
@ -424,8 +424,11 @@ public class ProcessService {
|
|||
taskDefinitionSet.add(new TaskDefinition(processTaskRelation.getPostTaskCode(), processTaskRelation.getPostTaskVersion()));
|
||||
}
|
||||
}
|
||||
if (taskDefinitionSet.isEmpty()) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
List<TaskDefinitionLog> taskDefinitionLogs = taskDefinitionLogMapper.queryByTaskDefinitions(taskDefinitionSet);
|
||||
return new ArrayList<>(taskDefinitionLogs);
|
||||
return Lists.newArrayList(taskDefinitionLogs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2409,6 +2412,9 @@ public class ProcessService {
|
|||
taskDefinitionSet.add(new TaskDefinition(processTaskRelation.getPostTaskCode(), processTaskRelation.getPostTaskVersion()));
|
||||
}
|
||||
}
|
||||
if (taskDefinitionSet.isEmpty()) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return taskDefinitionLogMapper.queryByTaskDefinitions(taskDefinitionSet);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue