工作流版本管理 标签重复问题 up

This commit is contained in:
zhuangdashia 2025-11-26 16:52:33 +08:00
parent cff3edb710
commit b1810138c7

View File

@ -237,6 +237,13 @@ public class WorkflowServiceImpl implements WorkflowService {
// 获取DAG节点配置
NodeConfig nodeConfig = workflowRequestVO.getNodeConfig();
//判断版本标签是否重复
WorkflowHistory wfh = workflowHistoryMapper.selectOne(new LambdaQueryWrapper<WorkflowHistory>()
.eq(WorkflowHistory::getId, workflow.getId())
.eq(WorkflowHistory::getVersionTag,workflowRequestVO.getVersionTag()));
if(!Objects.isNull(wfh)){
throw new SnailJobServerException("版本标签重复,请重新输入!");
}
//取履历表中 最大得版本号 + 1
int version = workflow.getVersion();
int version_max = workflowHistoryMapper.selectMaxVersionByWorkflowId(workflow.getId());
@ -296,12 +303,6 @@ public class WorkflowServiceImpl implements WorkflowService {
.eq(Workflow::getVersion, version)) > 0,
() -> new SnailJobServerException("Update failed"));
//工作流表更新后插入履历表
//准备数据到履历表add 20250520
// WorkflowHistory history = new WorkflowHistory();
// Workflow workflow1 = workflowMapper.selectById(workflow.getId());
// BeanUtils.copyProperties(workflow1, history);
// history.setCreateDt(LocalDateTime.now());
//20251124 add
// 如果是保存新版本,保存到历史表
if (saveAsNewVersion) {