!8 修改接口,立即发起流程时先写表再发起

Merge pull request !8 from new_new_new/feature/20260421-start-flow
This commit is contained in:
new_new_new
2026-04-21 01:34:35 +00:00
committed by Gitee
@@ -36,8 +36,13 @@ public class TaskTaskServiceImpl extends ServiceImpl<TaskTaskMapper, TaskTask> i
String jsonString = Optional.ofNullable(taskTask.getJsonData()) String jsonString = Optional.ofNullable(taskTask.getJsonData())
.map(JSON::toJSONString) // 使用 Fastjson 或 Jackson .map(JSON::toJSONString) // 使用 Fastjson 或 Jackson
.orElse("{}"); .orElse("{}");
Result<String> res = bpmBaseExtApiImpl.startMutilProcess(taskTask.getFlowCode(), taskTask.getBusinessId(), taskTask.getFormUrl(), taskTask.getFormUrl(), userName, jsonString); TaskTask newTask = new TaskTask();
return res.isSuccess(); BeanUtils.copyProperties(taskTask, newTask);
newTask.setId(null);
newTask.setStartTime(null);
this.save(newTask);
Result<String> res = bpmBaseExtApiImpl.startMutilProcess(taskTask.getFlowCode(), newTask.getId(), taskTask.getFormUrl(), taskTask.getFormUrl(), userName, jsonString);
return res.isSuccess();
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean multiFlowStart(TaskTask taskTask,String userName,Integer intervalType, Integer startCount) throws Exception{ public boolean multiFlowStart(TaskTask taskTask,String userName,Integer intervalType, Integer startCount) throws Exception{