Commit d2dde326 by huangfusuper

版本校验

parent 1e4e0007
...@@ -187,9 +187,14 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -187,9 +187,14 @@ public class ApiFlowServiceImpl implements ApiFlowService {
//设置超时时间,未设置默认5天 //设置超时时间,未设置默认5天
flow.setFlowTimeout(null == pluginFlow.getConfig().getFlowTimeout() ? TimeUnit.DAYS.toMillis(5) : pluginFlow.getConfig().getFlowTimeout()); flow.setFlowTimeout(null == pluginFlow.getConfig().getFlowTimeout() ? TimeUnit.DAYS.toMillis(5) : pluginFlow.getConfig().getFlowTimeout());
Flow oldFlow = flowMapper.getByWorkSpaceAndName(workspaceId, pluginFlow.getName()); Flow oldFlow = flowMapper.getByWorkSpaceAndName(workspaceId, pluginFlow.getName());
String versionName = pluginFlow.getVersionName();
if (StringUtils.isNoneBlank(versionName)) {
FlowVersion byWorkSpaceAndName = flowVersionMapper.getByWorkSpaceAndName(workspaceId, flow.getFlowName(), versionName);
ValidationUtil.isTrueValidation(byWorkSpaceAndName!=null,"该工作流版本已经存在,请联系调度团队!");
}
//判断是否是重发 //判断是否是重发
if ((pluginFlow.isRePublish() && !isInnner) || (isInnner && null != oldFlow)) { if ((pluginFlow.isRePublish() && !isInnner) || (isInnner && null != oldFlow)) {
String versionName = pluginFlow.getVersionName();
flow.setFlowId(oldFlow.getFlowId()); flow.setFlowId(oldFlow.getFlowId());
//当版本号不存在 //当版本号不存在
if (StringUtils.isBlank(versionName)) { if (StringUtils.isBlank(versionName)) {
...@@ -204,7 +209,6 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -204,7 +209,6 @@ public class ApiFlowServiceImpl implements ApiFlowService {
updateNodeByFlow(pluginFlow.getNodeList(), flow, upFlowName); updateNodeByFlow(pluginFlow.getNodeList(), flow, upFlowName);
} else { } else {
String versionName = pluginFlow.getVersionName();
if (StringUtils.isBlank(versionName)) { if (StringUtils.isBlank(versionName)) {
flow.setVersionName(JobVersionGenUtil.generateVersionName(1)); flow.setVersionName(JobVersionGenUtil.generateVersionName(1));
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment