Skip to content

Commit

Permalink
修改枚举 TaskType 命名解决 swagger set 类型识别异常
Browse files Browse the repository at this point in the history
  • Loading branch information
qmdx committed Dec 23, 2024
1 parent 764f4c2 commit 6326f64
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import com.aizuda.bpm.engine.assist.Assert;
import com.aizuda.bpm.engine.assist.DateUtils;
import com.aizuda.bpm.engine.core.enums.InstanceState;
import com.aizuda.bpm.engine.core.enums.TaskState;
import com.aizuda.bpm.engine.core.enums.TaskType;
import com.aizuda.bpm.engine.model.NodeModel;
Expand Down Expand Up @@ -115,7 +114,7 @@ public static FlwHisTask ofCallInstance(NodeModel nodeModel, FlwInstance instanc
*/
public FlwTask undoTask(TaskType taskType) {
FlwTask flwTask = this.cloneTask(this.createId, this.createBy);
flwTask.setTaskType(taskType);
flwTask.taskType(taskType);
return flwTask;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void setVariable(String variable) {
this.variable = variable;
}

public void setTaskType(TaskType taskType) {
public void taskType(TaskType taskType) {
this.taskType = taskType.getValue();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public Optional<FlwTask> executeJumpTask(Long taskId, String nodeKey, FlowCreato

// 设置任务类型为跳转
FlwTask createTask = this.createTaskBase(nodeModel, execution);
createTask.setTaskType(taskTye);
createTask.taskType(taskTye);
if (TaskType.major == taskType) {
// 发起节点,创建发起任务,分配发起人
createTask.setPerformType(PerformType.start);
Expand Down Expand Up @@ -256,7 +256,7 @@ protected boolean moveToHisTask(FlwTask flwTask, TaskState taskState, FlowCreato
if (null != agentFlwTaskActor) {

// 设置历史代理任务状态为【代理人协办完成的任务】设置被代理人信息
hisTask.setTaskType(TaskType.agentAssist);
hisTask.taskType(TaskType.agentAssist);
taskActors.stream().filter(t -> Objects.equals(agentFlwTaskActor.getAgentId(), t.getActorId()))
.findFirst().ifPresent(t -> {
hisTask.setAssignorId(t.getActorId());
Expand All @@ -278,7 +278,7 @@ protected boolean moveToHisTask(FlwTask flwTask, TaskState taskState, FlowCreato
// 代理人完成任务,当前任务设置为代理人归还任务,代理人信息变更
FlwTask newFlwTask = new FlwTask();
newFlwTask.setId(flwTask.getId());
newFlwTask.setTaskType(TaskType.agentReturn);
newFlwTask.taskType(TaskType.agentReturn);
newFlwTask.setAssignorId(flowCreator.getCreateId());
newFlwTask.setAssignor(flowCreator.getCreateBy());
return taskDao.updateById(newFlwTask);
Expand All @@ -295,7 +295,7 @@ protected boolean moveToHisTask(FlwTask flwTask, TaskState taskState, FlowCreato
}
taskActors = newFlwTaskActor;
// 设置被代理人自己完成任务
flwTask.setTaskType(TaskType.agentOwn);
flwTask.taskType(TaskType.agentOwn);
}
}

Expand All @@ -305,7 +305,7 @@ else if (TaskType.agentReturn.eq(flwTask.getTaskType())) {
hisTaskDao.deleteById(flwTask.getId());

// 代理人协办完成的任务
hisTask.setTaskType(TaskType.agentAssist);
hisTask.taskType(TaskType.agentAssist);
}

// 会签情况处理其它任务 排除完成及自动跳过情况,自动跳过是当前任务归档非所有任务
Expand Down Expand Up @@ -487,7 +487,7 @@ public boolean transferTask(FlowCreator flowCreator, FlowCreator assigneeFlowCre
// 设置委托人信息
FlwTask ft = new FlwTask();
ft.setId(flwTaskActor.getTaskId());
ft.setTaskType(TaskType.transfer);
ft.taskType(TaskType.transfer);
ft.setAssignorId(flowCreator.getCreateId());
ft.setAssignor(flowCreator.getCreateBy());
if (taskDao.updateById(ft)) {
Expand Down Expand Up @@ -526,7 +526,7 @@ public boolean assigneeTask(Long taskId, TaskType taskType, FlowCreator flowCrea
// 设置任务为委派任务或者为转办任务
FlwTask flwTask = new FlwTask();
flwTask.setId(taskId);
flwTask.setTaskType(taskType);
flwTask.taskType(taskType);

if (taskType == TaskType.agent) {
// 设置代理人员信息,第一个人为主办 assignorId 其他人为协办 assignor 多个英文逗号分隔
Expand All @@ -553,7 +553,7 @@ public boolean assigneeTask(Long taskId, TaskType taskType, FlowCreator flowCrea

// 任务监听器通知
this.taskNotify(TaskEventType.assignment, () -> {
dbFlwTask.setTaskType(taskType);
dbFlwTask.taskType(taskType);
dbFlwTask.setAssignorId(flwTask.getAssignorId());
dbFlwTask.setAssignor(flwTask.getAssignor());
return dbFlwTask;
Expand Down Expand Up @@ -597,7 +597,7 @@ public boolean resolveTask(Long taskId, FlowCreator flowCreator) {
// 设置任务状态为委托归还,委托人设置为归还人
FlwTask temp = new FlwTask();
temp.setId(taskId);
temp.setTaskType(TaskType.delegateReturn);
temp.taskType(TaskType.delegateReturn);
temp.setAssignorId(flowCreator.getCreateId());
temp.setAssignor(flowCreator.getCreateBy());
Assert.isFalse(taskDao.updateById(temp), "resolveTask failed");
Expand Down Expand Up @@ -831,7 +831,7 @@ public List<FlwTask> createNewTask(Long taskId, TaskType taskType, PerformType p
FlowCreator flowCreator, Function<FlwTask, Execution> executionFunction) {
FlwTask flwTask = taskDao.selectCheckById(taskId);
FlwTask newFlwTask = flwTask.cloneTask(flowCreator.getCreateId(), flowCreator.getCreateBy());
newFlwTask.setTaskType(taskType);
newFlwTask.taskType(taskType);
newFlwTask.setPerformType(performType);
newFlwTask.setParentTaskId(taskId);
Execution execution = executionFunction.apply(newFlwTask);
Expand Down Expand Up @@ -1028,7 +1028,7 @@ public void saveTaskCc(NodeModel nodeModel, FlwTask flwTask, FlowCreator flowCre

// 抄送历史任务
FlwHisTask flwHisTask = FlwHisTask.of(flwTask, TaskState.complete);
flwHisTask.setTaskType(TaskType.cc);
flwHisTask.taskType(TaskType.cc);
flwHisTask.setPerformType(PerformType.copy);
flwHisTask.calculateDuration();
hisTaskDao.insert(flwHisTask);
Expand Down

0 comments on commit 6326f64

Please sign in to comment.