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
368dc758
Commit
368dc758
authored
Apr 07, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
b93cdd5c
7a737258
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
4 deletions
+45
-4
ApiFlowServiceImpl.java
...c/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
+29
-0
JobTaskMapper.xml
...th-admin-core/src/main/resources/mapper/JobTaskMapper.xml
+1
-2
JobTaskScheduleMapper.xml
...-core/src/main/resources/mapper/JobTaskScheduleMapper.xml
+1
-1
RunRecordingMapper.xml
...min-core/src/main/resources/mapper/RunRecordingMapper.xml
+14
-1
No files found.
byit-myth-admin/src/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
View file @
368dc758
...
@@ -460,6 +460,8 @@ public class ApiFlowServiceImpl implements ApiFlowService {
...
@@ -460,6 +460,8 @@ public class ApiFlowServiceImpl implements ApiFlowService {
ValidationUtil
.
dataNotNull
(
flow
,
runInfo
.
getFlowName
()
+
"工作流不存在"
);
ValidationUtil
.
dataNotNull
(
flow
,
runInfo
.
getFlowName
()
+
"工作流不存在"
);
Node
node
=
nodeMapper
.
getByNameAndFlow
(
runInfo
.
getNodeName
(),
flow
.
getFlowId
());
Node
node
=
nodeMapper
.
getByNameAndFlow
(
runInfo
.
getNodeName
(),
flow
.
getFlowId
());
ValidationUtil
.
dataNotNull
(
node
,
runInfo
.
getNodeName
()
+
"节点不存在"
);
ValidationUtil
.
dataNotNull
(
node
,
runInfo
.
getNodeName
()
+
"节点不存在"
);
RunRecording
runRecording
=
runRecordingMapper
.
findRunRecordingByFlowIdAndRunId
(
flow
.
getFlowId
(),
runInfo
.
getRunId
());
ValidationUtil
.
dataNotNull
(
runRecording
,
"查无此运行记录"
);
//获取运行日志实例
//获取运行日志实例
JobTaskRunLog
jobTaskRunLog
=
jobTaskRunLogMapper
.
findByRunIdAndNodeId
(
runInfo
.
getRunId
(),
node
.
getNodeId
());
JobTaskRunLog
jobTaskRunLog
=
jobTaskRunLogMapper
.
findByRunIdAndNodeId
(
runInfo
.
getRunId
(),
node
.
getNodeId
());
ValidationUtil
.
dataNotNull
(
jobTaskRunLog
,
"查无此运行记录"
);
ValidationUtil
.
dataNotNull
(
jobTaskRunLog
,
"查无此运行记录"
);
...
@@ -487,6 +489,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
...
@@ -487,6 +489,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
//设置为重跑
//设置为重跑
jobTask
.
setScheduleType
(
ScheduleTypeEnum
.
REPEAT
.
getCode
());
jobTask
.
setScheduleType
(
ScheduleTypeEnum
.
REPEAT
.
getCode
());
jobTask
.
setOperator
(
userName
);
jobTask
.
setOperator
(
userName
);
jobTask
.
setLogId
(
null
);
//查询当前节点的依赖节点
//查询当前节点的依赖节点
List
<
Integer
>
dependNodeIdList
=
nodeDependencyMapper
.
findDependIdByNodeId
(
node
.
getNodeId
());
List
<
Integer
>
dependNodeIdList
=
nodeDependencyMapper
.
findDependIdByNodeId
(
node
.
getNodeId
());
...
@@ -507,9 +510,27 @@ public class ApiFlowServiceImpl implements ApiFlowService {
...
@@ -507,9 +510,27 @@ public class ApiFlowServiceImpl implements ApiFlowService {
}
}
}
}
RunRecording
newRunRecording
=
buildRunRecording
(
runRecording
,
triggerTime
,
reRunId
,
flow
,
userName
);
//生成新的工作流实例
runRecordingMapper
.
saveRunRecording
(
newRunRecording
);
jobTaskMapper
.
saveJobTasks
(
jobTaskList
);
jobTaskMapper
.
saveJobTasks
(
jobTaskList
);
}
}
private
RunRecording
buildRunRecording
(
RunRecording
runRecording
,
Long
triggerTime
,
String
reRunId
,
Flow
flow
,
String
userName
)
{
RunRecording
newRunRecording
=
new
RunRecording
();
BeanUtils
.
copyProperties
(
flow
,
newRunRecording
);
newRunRecording
.
setTriggerTime
(
triggerTime
);
newRunRecording
.
setReRunId
(
runRecording
.
getRunId
());
newRunRecording
.
setRunId
(
reRunId
);
newRunRecording
.
setOperator
(
userName
);
newRunRecording
.
setScheduleType
(
ScheduleTypeEnum
.
REPEAT
.
getCode
());
return
newRunRecording
;
}
@Override
@Override
public
void
reRunFlow
(
String
param
){
public
void
reRunFlow
(
String
param
){
...
@@ -556,6 +577,8 @@ public class ApiFlowServiceImpl implements ApiFlowService {
...
@@ -556,6 +577,8 @@ public class ApiFlowServiceImpl implements ApiFlowService {
//设置为重跑
//设置为重跑
jobTask
.
setScheduleType
(
ScheduleTypeEnum
.
REPEAT
.
getCode
());
jobTask
.
setScheduleType
(
ScheduleTypeEnum
.
REPEAT
.
getCode
());
jobTask
.
setOperator
(
userName
);
jobTask
.
setOperator
(
userName
);
jobTask
.
setLogId
(
null
);
//查询当前节点的依赖节点
//查询当前节点的依赖节点
List
<
Integer
>
dependNodeIdList
=
nodeDependencyMapper
.
findDependIdByNodeId
(
jobTaskRunLog
.
getNodeId
());
List
<
Integer
>
dependNodeIdList
=
nodeDependencyMapper
.
findDependIdByNodeId
(
jobTaskRunLog
.
getNodeId
());
if
(
dependNodeIdList
!=
null
&&
dependNodeIdList
.
size
()
>
0
){
if
(
dependNodeIdList
!=
null
&&
dependNodeIdList
.
size
()
>
0
){
...
@@ -563,6 +586,11 @@ public class ApiFlowServiceImpl implements ApiFlowService {
...
@@ -563,6 +586,11 @@ public class ApiFlowServiceImpl implements ApiFlowService {
}
}
jobTaskList
.
add
(
jobTask
);
jobTaskList
.
add
(
jobTask
);
});
});
//生成运行实例
RunRecording
newRunRecording
=
buildRunRecording
(
runRecording
,
triggerTime
,
reRunId
,
flow
,
userName
);
//生成新的工作流实例
runRecordingMapper
.
saveRunRecording
(
newRunRecording
);
jobTaskMapper
.
saveJobTasks
(
jobTaskList
);
jobTaskMapper
.
saveJobTasks
(
jobTaskList
);
}
}
}
}
...
@@ -579,6 +607,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
...
@@ -579,6 +607,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
//设置为重跑
//设置为重跑
jobTask
.
setScheduleType
(
ScheduleTypeEnum
.
REPEAT
.
getCode
());
jobTask
.
setScheduleType
(
ScheduleTypeEnum
.
REPEAT
.
getCode
());
jobTask
.
setOperator
(
userName
);
jobTask
.
setOperator
(
userName
);
jobTask
.
setLogId
(
null
);
//查询当前节点的依赖节点
//查询当前节点的依赖节点
List
<
Integer
>
dependNodeIdList
=
nodeDependencyMapper
.
findDependIdByNodeId
(
jobTaskRunLog
.
getNodeId
());
List
<
Integer
>
dependNodeIdList
=
nodeDependencyMapper
.
findDependIdByNodeId
(
jobTaskRunLog
.
getNodeId
());
...
...
byit-myth-core/myth-admin-core/src/main/resources/mapper/JobTaskMapper.xml
View file @
368dc758
...
@@ -311,8 +311,7 @@
...
@@ -311,8 +311,7 @@
#{jobTask.sourcePrincipal,jdbcType=VARCHAR},#{jobTask.triggerTime,jdbcType=BIGINT},#{jobTask.triggerStatus,jdbcType=CHAR},
#{jobTask.sourcePrincipal,jdbcType=VARCHAR},#{jobTask.triggerTime,jdbcType=BIGINT},#{jobTask.triggerStatus,jdbcType=CHAR},
#{jobTask.versionName,jdbcType=VARCHAR},#{jobTask.runCommand,jdbcType=VARCHAR},#{jobTask.runSource,jdbcType=LONGVARCHAR},
#{jobTask.versionName,jdbcType=VARCHAR},#{jobTask.runCommand,jdbcType=VARCHAR},#{jobTask.runSource,jdbcType=LONGVARCHAR},
#{jobTask.flowName,jdbcType=VARCHAR},#{jobTask.superSuccessRun,jdbcType=CHAR},#{jobTask.reRunId,jdbcType=VARCHAR},
#{jobTask.flowName,jdbcType=VARCHAR},#{jobTask.superSuccessRun,jdbcType=CHAR},#{jobTask.reRunId,jdbcType=VARCHAR},
#{jobTask.logId,jdbcType=INTEGER},#{jobTask.nodeDepend,jdbcType=VARCHAR},#{jobTask.operator,jdbcType=VARCHAR}, #{scheduleType,jdbcType=INTEGER},
#{jobTask.logId,jdbcType=INTEGER},#{jobTask.nodeDepend,jdbcType=VARCHAR},#{jobTask.operator,jdbcType=VARCHAR}, #{jobTask.scheduleType,jdbcType=INTEGER}
)
)
</foreach>
</foreach>
</insert>
</insert>
...
...
byit-myth-core/myth-admin-core/src/main/resources/mapper/JobTaskScheduleMapper.xml
View file @
368dc758
...
@@ -333,7 +333,7 @@
...
@@ -333,7 +333,7 @@
#{jobTaskSchedule.runCommand,jdbcType=VARCHAR}, #{jobTaskSchedule.runSource,jdbcType=LONGVARCHAR},
#{jobTaskSchedule.runCommand,jdbcType=VARCHAR}, #{jobTaskSchedule.runSource,jdbcType=LONGVARCHAR},
#{jobTaskSchedule.flowName,jdbcType=VARCHAR}, #{jobTaskSchedule.superSuccessRun,jdbcType=CHAR},
#{jobTaskSchedule.flowName,jdbcType=VARCHAR}, #{jobTaskSchedule.superSuccessRun,jdbcType=CHAR},
#{jobTaskSchedule.reRunId,jdbcType=VARCHAR}, #{jobTaskSchedule.nodeDepend,jdbcType=VARCHAR},
#{jobTaskSchedule.reRunId,jdbcType=VARCHAR}, #{jobTaskSchedule.nodeDepend,jdbcType=VARCHAR},
#{jobTaskSchedule.operator,jdbcType=VARCHAR}, #{
scheduleType,jdbcType=INTEGER},
#{jobTaskSchedule.operator,jdbcType=VARCHAR}, #{
jobTaskSchedule.scheduleType,jdbcType=INTEGER}
)
)
</foreach>
</foreach>
</insert>
</insert>
...
...
byit-myth-core/myth-admin-core/src/main/resources/mapper/RunRecordingMapper.xml
View file @
368dc758
...
@@ -24,11 +24,12 @@
...
@@ -24,11 +24,12 @@
<result
column=
"flow_node_count"
jdbcType=
"VARCHAR"
property=
"flowNodeCount"
/>
<result
column=
"flow_node_count"
jdbcType=
"VARCHAR"
property=
"flowNodeCount"
/>
<result
column=
"schedule_type"
jdbcType=
"INTEGER"
property=
"scheduleType"
/>
<result
column=
"schedule_type"
jdbcType=
"INTEGER"
property=
"scheduleType"
/>
<result
column=
"operator"
jdbcType=
"VARCHAR"
property=
"operator"
/>
<result
column=
"operator"
jdbcType=
"VARCHAR"
property=
"operator"
/>
<result
column=
"re_run_id"
jdbcType=
"VARCHAR"
property=
"reRunId"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
recording_id, run_id, alarm_email, dispatch_ip, flow_name, flow_run_result, flow_status,
recording_id, run_id, alarm_email, dispatch_ip, flow_name, flow_run_result, flow_status,
flow_timeout, flow_version_name, alarml_action, priority, trigger_time, principal,
flow_timeout, flow_version_name, alarml_action, priority, trigger_time, principal,
flow_id, start_time, end_time, is_alarm,is_inner,fail_fast, flow_node_count, schedule_type, operator
flow_id, start_time, end_time, is_alarm,is_inner,fail_fast, flow_node_count, schedule_type, operator
, re_run_id
</sql>
</sql>
<!--查询已完结 没有告警的-->
<!--查询已完结 没有告警的-->
...
@@ -257,6 +258,9 @@
...
@@ -257,6 +258,9 @@
<if
test=
"operator != null"
>
<if
test=
"operator != null"
>
operator,
operator,
</if>
</if>
<if
test=
"reRunId != null"
>
re_run_id,
</if>
</trim>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"recordingId != null"
>
<if
test=
"recordingId != null"
>
...
@@ -325,6 +329,9 @@
...
@@ -325,6 +329,9 @@
<if
test=
"operator != null"
>
<if
test=
"operator != null"
>
#{operator,jdbcType=VARCHAR},
#{operator,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"reRunId != null"
>
#{reRunId,jdbcType=VARCHAR},
</if>
</trim>
</trim>
</insert>
</insert>
<update
id=
"updateRunRecordingById"
parameterType=
"com.byit.model.RunRecording"
>
<update
id=
"updateRunRecordingById"
parameterType=
"com.byit.model.RunRecording"
>
...
@@ -393,6 +400,9 @@
...
@@ -393,6 +400,9 @@
<if
test=
"operator != null"
>
<if
test=
"operator != null"
>
operator = #{operator,jdbcType=VARCHAR},
operator = #{operator,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"reRunId != null"
>
re_run_id = #{reRunId,jdbcType=VARCHAR},
</if>
</set>
</set>
where recording_id = #{recordingId,jdbcType=INTEGER}
where recording_id = #{recordingId,jdbcType=INTEGER}
</update>
</update>
...
@@ -463,6 +473,9 @@
...
@@ -463,6 +473,9 @@
<if
test=
"operator != null"
>
<if
test=
"operator != null"
>
operator = #{operator,jdbcType=VARCHAR},
operator = #{operator,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"reRunId != null"
>
re_run_id = #{reRunId,jdbcType=VARCHAR},
</if>
</set>
</set>
where flow_id = #{flowId,jdbcType=INTEGER} and run_id = #{runId,jdbcType=VARCHAR}
where flow_id = #{flowId,jdbcType=INTEGER} and run_id = #{runId,jdbcType=VARCHAR}
</update>
</update>
...
...
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