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
53d06260
Commit
53d06260
authored
Jan 02, 2020
by
guominglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改引用报错
parent
54fec14a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
74 additions
and
63 deletions
+74
-63
pom.xml
byit-mybatis-plugin/pom.xml
+11
-0
ApiFlowController.java
...h-admin/src/main/java/com/byit/api/ApiFlowController.java
+4
-11
ApiFlowService.java
...-admin/src/main/java/com/byit/service/ApiFlowService.java
+2
-4
ApiFlowServiceImpl.java
...c/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
+2
-6
ApiWorkspaceServiceImpl.java
...n/java/com/byit/service/impl/ApiWorkspaceServiceImpl.java
+4
-0
FlowServiceImpl.java
.../src/main/java/com/byit/service/impl/FlowServiceImpl.java
+38
-42
pom.xml
pom.xml
+13
-0
No files found.
byit-mybatis-plugin/pom.xml
View file @
53d06260
...
@@ -33,6 +33,17 @@
...
@@ -33,6 +33,17 @@
</dependency>
</dependency>
</dependencies>
</dependencies>
<distributionManagement>
<repository>
<id>
releases
</id>
<url>
http://10.0.120.2/repository/maven-releases/
</url>
</repository>
<snapshotRepository>
<id>
snapshots
</id>
<url>
http://10.0.120.2/repository/maven-snapshots/
</url>
</snapshotRepository>
</distributionManagement>
<build>
<build>
<plugins>
<plugins>
<plugin>
<plugin>
...
...
byit-myth-admin/src/main/java/com/byit/api/ApiFlowController.java
View file @
53d06260
...
@@ -25,17 +25,10 @@ public class ApiFlowController {
...
@@ -25,17 +25,10 @@ public class ApiFlowController {
@Resource
@Resource
private
ApiFlowService
apiFlowService
;
private
ApiFlowService
apiFlowService
;
@PostMapping
(
"add"
)
@PostMapping
(
"publish"
)
@ApiOperation
(
"新建工作流,默认开始调度"
)
@ApiOperation
(
"发布工作流,并开始调度"
)
public
String
addFlow
(
@RequestBody
PluginFlow
flow
){
public
String
publishFlow
(
@RequestBody
PluginFlow
flow
){
apiFlowService
.
addFlow
(
flow
);
apiFlowService
.
publishFlow
(
flow
);
return
"SUCCESS"
;
}
@PostMapping
(
"update"
)
@ApiOperation
(
"更新工作流,默认开始调度"
)
public
String
updateFlow
(
@RequestBody
PluginFlow
flow
){
apiFlowService
.
updateFlow
(
flow
);
return
"SUCCESS"
;
return
"SUCCESS"
;
}
}
...
...
byit-myth-admin/src/main/java/com/byit/service/ApiFlowService.java
View file @
53d06260
...
@@ -10,10 +10,6 @@ import com.byit.job.dto.plugin.PluginFlowDepend;
...
@@ -10,10 +10,6 @@ import com.byit.job.dto.plugin.PluginFlowDepend;
*/
*/
public
interface
ApiFlowService
{
public
interface
ApiFlowService
{
void
addFlow
(
PluginFlow
flow
);
void
updateFlow
(
PluginFlow
flow
);
void
deleteFlow
(
String
flowName
);
void
deleteFlow
(
String
flowName
);
void
addDepend
(
String
flowName
,
String
dependFlowName
,
String
workspaceName
);
void
addDepend
(
String
flowName
,
String
dependFlowName
,
String
workspaceName
);
...
@@ -31,4 +27,6 @@ public interface ApiFlowService {
...
@@ -31,4 +27,6 @@ public interface ApiFlowService {
String
stopSchedule
(
String
flowName
,
String
workspaceName
);
String
stopSchedule
(
String
flowName
,
String
workspaceName
);
void
reStartSchedule
(
String
runId
);
void
reStartSchedule
(
String
runId
);
void
publishFlow
(
PluginFlow
flow
);
}
}
byit-myth-admin/src/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
View file @
53d06260
...
@@ -26,12 +26,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
...
@@ -26,12 +26,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
private
WorkspaceMapper
workspaceMapper
;
private
WorkspaceMapper
workspaceMapper
;
@Override
@Override
public
void
addFlow
(
PluginFlow
flow
)
{
public
void
publishFlow
(
PluginFlow
flow
)
{
}
@Override
public
void
updateFlow
(
PluginFlow
flow
)
{
}
}
...
@@ -79,4 +74,5 @@ public class ApiFlowServiceImpl implements ApiFlowService {
...
@@ -79,4 +74,5 @@ public class ApiFlowServiceImpl implements ApiFlowService {
public
void
reStartSchedule
(
String
runId
)
{
public
void
reStartSchedule
(
String
runId
)
{
}
}
}
}
byit-myth-admin/src/main/java/com/byit/service/impl/ApiWorkspaceServiceImpl.java
View file @
53d06260
...
@@ -13,4 +13,8 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -13,4 +13,8 @@ import org.springframework.transaction.annotation.Transactional;
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
class
ApiWorkspaceServiceImpl
implements
ApiWorkspaceService
{
public
class
ApiWorkspaceServiceImpl
implements
ApiWorkspaceService
{
@Override
public
void
add
(
String
workspaceName
)
{
}
}
}
byit-myth-core/myth-admin-core/src/main/java/com/byit/service/impl/FlowServiceImpl.java
View file @
53d06260
/*
package
com
.
byit
.
service
.
impl
;
package
com
.
byit
.
service
.
impl
;
import
com.byit.enums.FlowPropertyEnum
;
import
com.byit.enums.FlowPropertyEnum
;
import
com.byit.enums.NodePropertyEnum
;
import
com.byit.enums.NodePropertyEnum
;
import
com.byit.job.utils.CronExpression
;
import
com.byit.job.utils.CronExpression
;
import com.byit.mapper.FlowDependentMapper;
import
com.byit.mapper.FlowMapper
;
import
com.byit.mapper.FlowMapper
;
import
com.byit.mapper.NodeDependencyMapper
;
import
com.byit.mapper.NodeDependencyMapper
;
import
com.byit.mapper.NodeMapper
;
import
com.byit.mapper.NodeMapper
;
...
@@ -26,16 +24,16 @@ import java.util.ArrayList;
...
@@ -26,16 +24,16 @@ import java.util.ArrayList;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
*/
/**
/**
* @description: 工作流业务逻辑实现类
* @description: 工作流业务逻辑实现类
* @author: gml
* @author: gml
* @create: 2019-12-23 17:33
* @create: 2019-12-23 17:33
*/
/*
*/
@Service
@Service
@Slf4j
@Slf4j
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
class
FlowServiceImpl
implements
FlowService
{
public
class
FlowServiceImpl
implements
FlowService
{
@Resource
@Resource
...
@@ -43,8 +41,6 @@ public class FlowServiceImpl implements FlowService {
...
@@ -43,8 +41,6 @@ public class FlowServiceImpl implements FlowService {
@Resource
@Resource
private
NodeMapper
nodeMapper
;
private
NodeMapper
nodeMapper
;
@Resource
@Resource
private FlowDependentMapper flowDependentMapper;
@Resource
private
NodeDependencyMapper
nodeDependencyMapper
;
private
NodeDependencyMapper
nodeDependencyMapper
;
@Override
@Override
...
@@ -53,7 +49,7 @@ public class FlowServiceImpl implements FlowService {
...
@@ -53,7 +49,7 @@ public class FlowServiceImpl implements FlowService {
//设置在工作流上的节点相关信息
//设置在工作流上的节点相关信息
List
<
NodeVo
>
nodeVoList
=
flowVo
.
getNodeVoList
();
List
<
NodeVo
>
nodeVoList
=
flowVo
.
getNodeVoList
();
if (null != nodeVoList && nodeVoList.size() > 0){
if
(
null
!=
nodeVoList
&&
nodeVoList
.
size
()
>
0
)
{
//设置在工作流上的节点数目
//设置在工作流上的节点数目
log
.
info
(
"将【{}】个节点在工作流【{}】调度流程中"
,
nodeVoList
.
size
(),
flowVo
.
getFlowName
());
log
.
info
(
"将【{}】个节点在工作流【{}】调度流程中"
,
nodeVoList
.
size
(),
flowVo
.
getFlowName
());
//重新组织节点的依赖和调度关系
//重新组织节点的依赖和调度关系
...
@@ -77,12 +73,11 @@ public class FlowServiceImpl implements FlowService {
...
@@ -77,12 +73,11 @@ public class FlowServiceImpl implements FlowService {
return
flow
;
return
flow
;
}
}
*/
/**
/**
* 重新组织节点的依赖和调度关系
* 重新组织节点的依赖和调度关系
* @param flowVo
* @param flowVo
* @param nodeVoList
* @param nodeVoList
*/
/*
*/
private
void
reNodeDepend
(
FlowVo
flowVo
,
List
<
NodeVo
>
nodeVoList
)
{
private
void
reNodeDepend
(
FlowVo
flowVo
,
List
<
NodeVo
>
nodeVoList
)
{
...
@@ -128,40 +123,40 @@ public class FlowServiceImpl implements FlowService {
...
@@ -128,40 +123,40 @@ public class FlowServiceImpl implements FlowService {
}
}
*/
/**
/**
* 重新组织工作流的依赖关系
* 重新组织工作流的依赖关系
*
* @param flowVo
* @param flowVo
*/
/*
*/
private
void
reFlowDepend
(
FlowVo
flowVo
)
{
private
void
reFlowDepend
(
FlowVo
flowVo
)
{
//先去除所有的工作流依赖
// //先去除所有的工作流依赖
List<FlowDependentKey> flowDependentKeyList = flowDependentMapper.findByFlowId(flowVo.getFlowId());
// List<FlowDependentKey> flowDependentKeyList = flowDependentMapper.findByFlowId(flowVo.getFlowId());
//解除跟上游工作流的绑定
// //解除跟上游工作流的绑定
log.info("将【{}】工作流上游工作流设置为没有下游工作流", flowVo.getFlowName());
// log.info("将【{}】工作流上游工作流设置为没有下游工作流", flowVo.getFlowName());
for (FlowDependentKey flowDependentKey: flowDependentKeyList) {
// for (FlowDependentKey flowDependentKey: flowDependentKeyList) {
Flow flow = flowMapper.getById(flowDependentKey.getDependFlowId());
// Flow flow = flowMapper.getById(flowDependentKey.getDependFlowId());
flow.setIsHaveDepend(FlowPropertyEnum.NO_HAVE_DEPEND.getCode());
// flow.setIsHaveDepend(FlowPropertyEnum.NO_HAVE_DEPEND.getCode());
flowMapper.updateByIdSelective(flow);
// flowMapper.updateByIdSelective(flow);
}
// }
log.info("删除【{}】工作流的依赖关系", flowVo.getFlowName());
// log.info("删除【{}】工作流的依赖关系", flowVo.getFlowName());
flowDependentMapper.deleteByFlowId(flowVo.getFlowId());
// flowDependentMapper.deleteByFlowId(flowVo.getFlowId());
//
log.info("开始建立【{}】工作流的依赖关系,并将上游工作流设置为拥有下游工作流", flowVo.getFlowName());
// log.info("开始建立【{}】工作流的依赖关系,并将上游工作流设置为拥有下游工作流", flowVo.getFlowName());
//判断是否有工作流依赖
// //判断是否有工作流依赖
if (null != flowVo.getFlowDepend() && flowVo.getFlowDepend().size() > 0){
// if (null != flowVo.getFlowDepend() && flowVo.getFlowDepend().size() > 0){
List<Integer> flowDependList = flowVo.getFlowDepend();
// List<Integer> flowDependList = flowVo.getFlowDepend();
for (Integer flowDependId : flowDependList){
// for (Integer flowDependId : flowDependList){
Flow flow = flowMapper.getById(flowDependId);
// Flow flow = flowMapper.getById(flowDependId);
flow.setIsHaveDepend(FlowPropertyEnum.HAVE_DEPEND.getCode());
// flowMapper.updateByIdSelective(flow);
flowMapper.updateByIdSelective(flow);
// flowDependentMapper.insert(flowVo.getFlowId(), flowDependId);
flowDependentMapper.insert(flowVo.getFlowId(), flowDependId);
// }
}
// flowVo.setIsTop(FlowPropertyEnum.ISNOT_TOP.getCode());
flowVo.setIsTop(FlowPropertyEnum.ISNOT_TOP.getCode());
// }else {
}else {
// flowVo.setIsTop(FlowPropertyEnum.IS_TOP.getCode());
flowVo.setIsTop(FlowPropertyEnum.IS_TOP.getCode());
// }
}
}
}
...
@@ -259,7 +254,8 @@ public class FlowServiceImpl implements FlowService {
...
@@ -259,7 +254,8 @@ public class FlowServiceImpl implements FlowService {
/**
/**
* 判断是否可以包含这个工作流
* 判断是否可以包含这个工作流
* @param flowVo 当前工作流
*
* @param flowVo 当前工作流
* @param nodeVo
* @param nodeVo
* @return
* @return
*/
*/
...
@@ -286,5 +282,4 @@ public class FlowServiceImpl implements FlowService {
...
@@ -286,5 +282,4 @@ public class FlowServiceImpl implements FlowService {
flowMapper
.
updateByIdSelective
(
virtualFlow
);
flowMapper
.
updateByIdSelective
(
virtualFlow
);
return
null
;
return
null
;
}
}
}
}
*/
\ No newline at end of file
pom.xml
View file @
53d06260
...
@@ -181,4 +181,16 @@
...
@@ -181,4 +181,16 @@
</dependencies>
</dependencies>
</dependencyManagement>
</dependencyManagement>
<distributionManagement>
<repository>
<id>
releases
</id>
<url>
http://10.0.120.2/repository/maven-releases/
</url>
</repository>
<snapshotRepository>
<id>
snapshots
</id>
<url>
http://10.0.120.2/repository/maven-snapshots/
</url>
</snapshotRepository>
</distributionManagement>
</project>
</project>
\ No newline at end of file
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