Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
byit-myth-job
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liyuan
byit-myth-job
Commits
f80c036e
Commit
f80c036e
authored
Sep 10, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
同步调度与DDMP平台版本生成策略
parent
f33df5fe
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
4 deletions
+43
-4
ApiFlowServiceImpl.java
...c/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
+18
-4
PluginFlow.java
...to-core/src/main/java/com/byit/dto/plugin/PluginFlow.java
+5
-0
JobVersionGenUtil.java
...-core/src/main/java/com/byit/utils/JobVersionGenUtil.java
+20
-0
No files found.
byit-myth-admin/src/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
View file @
f80c036e
...
@@ -23,6 +23,7 @@ import com.byit.service.ApiNodeCheckService;
...
@@ -23,6 +23,7 @@ import com.byit.service.ApiNodeCheckService;
import
com.byit.util.ApiFlowDagCheck
;
import
com.byit.util.ApiFlowDagCheck
;
import
com.byit.util.IDGenerationStrategy
;
import
com.byit.util.IDGenerationStrategy
;
import
com.byit.util.lock.RedissLockUtil
;
import
com.byit.util.lock.RedissLockUtil
;
import
com.byit.utils.JobVersionGenUtil
;
import
com.byit.utils.ValidationUtil
;
import
com.byit.utils.ValidationUtil
;
import
com.google.common.base.Joiner
;
import
com.google.common.base.Joiner
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -175,15 +176,28 @@ public class ApiFlowServiceImpl implements ApiFlowService {
...
@@ -175,15 +176,28 @@ public class ApiFlowServiceImpl implements ApiFlowService {
Flow
oldFlow
=
flowMapper
.
getByWorkSpaceAndName
(
workspaceId
,
pluginFlow
.
getName
());
Flow
oldFlow
=
flowMapper
.
getByWorkSpaceAndName
(
workspaceId
,
pluginFlow
.
getName
());
//判断是否是重发
//判断是否是重发
if
((
pluginFlow
.
isRePublish
()
&&
!
isInnner
)
||
(
isInnner
&&
null
!=
oldFlow
)){
if
((
pluginFlow
.
isRePublish
()
&&
!
isInnner
)
||
(
isInnner
&&
null
!=
oldFlow
)){
String
versionName
=
pluginFlow
.
getVersionName
();
flow
.
setFlowId
(
oldFlow
.
getFlowId
());
//当版本号不存在
if
(
StringUtils
.
isBlank
(
versionName
)){
String
version
=
oldFlow
.
getVersionName
();
String
version
=
oldFlow
.
getVersionName
();
Integer
versionTag
=
Integer
.
valueOf
(
version
.
split
(
"\\."
)[
1
]);
Integer
versionTag
=
Integer
.
valueOf
(
version
.
split
(
"\\."
)[
1
]);
flow
.
setFlowId
(
oldFlow
.
getFlowId
());
flow
.
setVersionName
(
JobVersionGenUtil
.
generateVersionName
(
versionTag
));
flow
.
setVersionName
(
"V."
+
(
versionTag
+
1
));
}
else
{
flow
.
setVersionName
(
versionName
);
}
flowMapper
.
updateByIdSelective
(
flow
);
flowMapper
.
updateByIdSelective
(
flow
);
updateNodeByFlow
(
pluginFlow
.
getNodeList
(),
flow
);
updateNodeByFlow
(
pluginFlow
.
getNodeList
(),
flow
);
}
else
{
}
else
{
flow
.
setVersionName
(
"V.1"
);
String
versionName
=
pluginFlow
.
getVersionName
();
if
(
StringUtils
.
isBlank
(
versionName
)){
flow
.
setVersionName
(
JobVersionGenUtil
.
generateVersionName
(
1
));
}
else
{
flow
.
setVersionName
(
versionName
);
}
Integer
flowId
=
flowMapper
.
insertSelective
(
flow
);
Integer
flowId
=
flowMapper
.
insertSelective
(
flow
);
saveNode
(
pluginFlow
.
getNodeList
(),
flow
);
saveNode
(
pluginFlow
.
getNodeList
(),
flow
);
}
}
...
...
byit-myth-core/myth-dto-core/src/main/java/com/byit/dto/plugin/PluginFlow.java
View file @
f80c036e
...
@@ -36,5 +36,10 @@ public class PluginFlow extends PluginBaseNode implements Serializable {
...
@@ -36,5 +36,10 @@ public class PluginFlow extends PluginBaseNode implements Serializable {
*/
*/
private
PluginFlowConfig
config
;
private
PluginFlowConfig
config
;
/**
* 版本索引
*/
private
String
versionName
;
private
static
final
long
serialVersionUID
=
3L
;
private
static
final
long
serialVersionUID
=
3L
;
}
}
byit-myth-core/myth-dto-core/src/main/java/com/byit/utils/JobVersionGenUtil.java
0 → 100644
View file @
f80c036e
package
com
.
byit
.
utils
;
/**
* 版本号生成策略
*
* @author huangfu
*/
public
class
JobVersionGenUtil
{
public
static
final
String
VERSION_NAME_PRE
=
"V.%s"
;
/**
* 调度版本生成策略
* @param versionIndex 版本索号
* @return 对应的版本名称
*/
public
static
String
generateVersionName
(
Integer
versionIndex
){
return
String
.
format
(
VERSION_NAME_PRE
,
versionIndex
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment