Commit c0567c93 by guominglei

Merge remote-tracking branch 'origin/developer' into developer

parents 7cd0d0ac 667eb042
...@@ -10,4 +10,9 @@ public interface ApiNodeCheckService { ...@@ -10,4 +10,9 @@ public interface ApiNodeCheckService {
* @param mainFlowId 主工作流的id * @param mainFlowId 主工作流的id
*/ */
void checkFlowNode(Integer mainFlowId); void checkFlowNode(Integer mainFlowId);
/**
* 工作流节点校验 删除不在调度上的节点
*/
void checkFlowNode();
} }
...@@ -133,7 +133,7 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -133,7 +133,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
log.debug("生成版本"); log.debug("生成版本");
FlowVersion flowVersion = saveFlowVersion(flow); FlowVersion flowVersion = saveFlowVersion(flow);
apiNodeCheckService.checkFlowNode(flow.getFlowId()); apiNodeCheckService.checkFlowNode();
log.debug("插件端通过API保存成功!"); log.debug("插件端通过API保存成功!");
} }
......
...@@ -28,7 +28,12 @@ public class ApiNodeCheckServiceImpl implements ApiNodeCheckService { ...@@ -28,7 +28,12 @@ public class ApiNodeCheckServiceImpl implements ApiNodeCheckService {
this.flowService = flowService; this.flowService = flowService;
} }
/**
* 废弃原因:查询次数多,性能低
* @param mainFlowId 主工作流的id
*/
@Override @Override
@Deprecated
public void checkFlowNode(Integer mainFlowId) { public void checkFlowNode(Integer mainFlowId) {
//查询工作流 //查询工作流
FlowVo mainFlow = flowService.getFlowId(mainFlowId); FlowVo mainFlow = flowService.getFlowId(mainFlowId);
...@@ -48,6 +53,14 @@ public class ApiNodeCheckServiceImpl implements ApiNodeCheckService { ...@@ -48,6 +53,14 @@ public class ApiNodeCheckServiceImpl implements ApiNodeCheckService {
nodeService.deleteNode(collect); nodeService.deleteNode(collect);
} }
/**
* 删除不在调度上的节点
*/
@Override
public void checkFlowNode() {
nodeService.deleteNoForkNode();
}
private void getAllInnerNode(List<Node> mainNodes,List<Node> candidateNodes){ private void getAllInnerNode(List<Node> mainNodes,List<Node> candidateNodes){
for (Node node : mainNodes) { for (Node node : mainNodes) {
if("1".equals(node.getIsVirtual())) { if("1".equals(node.getIsVirtual())) {
......
...@@ -97,4 +97,10 @@ public interface NodeMapper { ...@@ -97,4 +97,10 @@ public interface NodeMapper {
List<Node> findbyFlowIds(@Param("flowIdList")List<Integer> flowIdList); List<Node> findbyFlowIds(@Param("flowIdList")List<Integer> flowIdList);
int deleteNodeByIds(@Param("ids") List<Integer> ids); int deleteNodeByIds(@Param("ids") List<Integer> ids);
/**
* 删除不在调度上的
* @return
*/
int deleteNoForkNode();
} }
\ No newline at end of file
...@@ -28,4 +28,10 @@ public interface NodeService { ...@@ -28,4 +28,10 @@ public interface NodeService {
int deleteNode(List<Integer> ids); int deleteNode(List<Integer> ids);
/**
* 删除不在调度上的节点
* @return 删除数目
*/
int deleteNoForkNode();
} }
...@@ -36,4 +36,9 @@ public class NodeServiceImpl implements NodeService { ...@@ -36,4 +36,9 @@ public class NodeServiceImpl implements NodeService {
return nodeMapper.deleteNodeByIds(ids); return nodeMapper.deleteNodeByIds(ids);
} }
@Override
public int deleteNoForkNode() {
return nodeMapper.deleteNoForkNode();
}
} }
...@@ -496,4 +496,8 @@ ...@@ -496,4 +496,8 @@
where node_id = #{nodeId,jdbcType=INTEGER} where node_id = #{nodeId,jdbcType=INTEGER}
</update> </update>
<delete id="deleteNoForkNode">
delete from node where on_fork = '1'
</delete>
</mapper> </mapper>
\ No newline at end of file
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