From b1810138c7eb3f7e669bcdb9311b09ead95fc54e Mon Sep 17 00:00:00 2001 From: zhuangdashia Date: Wed, 26 Nov 2025 16:52:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E7=AE=A1=E7=90=86=20=E6=A0=87=E7=AD=BE=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20up?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/service/impl/WorkflowServiceImpl.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/snail-job-server/snail-job-server-web/src/main/java/com/aizuda/snailjob/server/web/service/impl/WorkflowServiceImpl.java b/snail-job-server/snail-job-server-web/src/main/java/com/aizuda/snailjob/server/web/service/impl/WorkflowServiceImpl.java index 83eb12e8..b60f6915 100644 --- a/snail-job-server/snail-job-server-web/src/main/java/com/aizuda/snailjob/server/web/service/impl/WorkflowServiceImpl.java +++ b/snail-job-server/snail-job-server-web/src/main/java/com/aizuda/snailjob/server/web/service/impl/WorkflowServiceImpl.java @@ -237,6 +237,13 @@ public class WorkflowServiceImpl implements WorkflowService { // 获取DAG节点配置 NodeConfig nodeConfig = workflowRequestVO.getNodeConfig(); + //判断版本标签是否重复 + WorkflowHistory wfh = workflowHistoryMapper.selectOne(new LambdaQueryWrapper() + .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) {