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
7091be9f
Commit
7091be9f
authored
Apr 07, 2020
by
guo_minglei@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加参数和处理类型问题
parent
ca12f3a1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
13 deletions
+44
-13
ApiFlowServiceImpl.java
...c/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
+6
-7
JobTaskMapper.xml
...th-admin-core/src/main/resources/mapper/JobTaskMapper.xml
+11
-2
JobTaskRunLogMapper.xml
...in-core/src/main/resources/mapper/JobTaskRunLogMapper.xml
+14
-1
JobTaskScheduleMapper.xml
...-core/src/main/resources/mapper/JobTaskScheduleMapper.xml
+13
-3
No files found.
byit-myth-admin/src/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
View file @
7091be9f
...
...
@@ -478,9 +478,8 @@ public class ApiFlowServiceImpl implements ApiFlowService {
//获取当前时间
String
reRunId
=
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
);
Long
triggerTime
=
System
.
currentTimeMillis
();
List
<
JobTask
>
jobTaskList
=
new
ArrayList
<>();
JobTask
jobTask
=
new
JobTask
();
BeanUtils
.
copyProperties
(
node
,
jobTask
);
BeanUtils
.
copyProperties
(
jobTaskRunLog
,
jobTask
);
jobTask
.
setTriggerTime
(
triggerTime
);
jobTask
.
setTriggerStatus
(
"1"
);
jobTask
.
setRunId
(
reRunId
);
...
...
@@ -495,6 +494,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
jobTask
.
setNodeDepend
(
Joiner
.
on
(
","
).
join
(
dependNodeIdList
));
}
List
<
JobTask
>
jobTaskList
=
new
ArrayList
<>();
jobTaskList
.
add
(
jobTask
);
//校验通过,开始设置重跑
...
...
@@ -508,7 +508,6 @@ public class ApiFlowServiceImpl implements ApiFlowService {
}
jobTaskMapper
.
saveJobTasks
(
jobTaskList
);
}
...
...
@@ -535,7 +534,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
if
(
FlowPropertyEnum
.
IS_INNER
.
getCode
().
equals
(
flow
.
getIsInner
())){
//是内嵌工作流
Node
node
=
nodeMapper
.
getByMapFlowId
(
flow
.
getFlowId
());
RunInfo
nodeRun
=
RunInfo
.
builder
().
workspaceName
(
runInfo
.
getWorkspaceName
()).
flowName
(
runInfo
.
getFlowName
())
.
nodeName
(
runInfo
.
getNodeName
()).
runId
(
runInfo
.
getRunId
()).
runState
(
"1"
).
build
();
.
nodeName
(
node
.
getNodeName
()).
runId
(
runInfo
.
getRunId
()).
runState
(
"1"
).
build
();
reRunJob
(
JSON
.
toJSONString
(
nodeRun
,
WriteClassName
));
}
else
{
//不是内嵌工作流
...
...
@@ -568,9 +567,9 @@ public class ApiFlowServiceImpl implements ApiFlowService {
private
void
addDependNode
(
String
reRunId
,
String
runId
,
Long
triggerTime
,
List
<
JobTask
>
jobTaskList
,
List
<
Integer
>
subNodeIdList
,
String
userName
)
{
subNodeIdList
.
forEach
(
childNodeId
->
{
Node
subNode
=
nodeMapper
.
getById
(
childNodeId
);
JobTaskRunLog
jobTaskRunLog
=
jobTaskRunLogMapper
.
findByRunIdAndNodeId
(
runId
,
childNodeId
);
JobTask
jobTask
=
new
JobTask
();
BeanUtils
.
copyProperties
(
subNode
,
jobTask
);
BeanUtils
.
copyProperties
(
jobTaskRunLog
,
jobTask
);
jobTask
.
setTriggerTime
(
triggerTime
);
jobTask
.
setTriggerStatus
(
"1"
);
jobTask
.
setRunId
(
reRunId
);
...
...
@@ -580,7 +579,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
jobTask
.
setOperator
(
userName
);
//查询当前节点的依赖节点
List
<
Integer
>
dependNodeIdList
=
nodeDependencyMapper
.
findDependIdByNodeId
(
subNode
.
getNodeId
());
List
<
Integer
>
dependNodeIdList
=
nodeDependencyMapper
.
findDependIdByNodeId
(
jobTaskRunLog
.
getNodeId
());
if
(
dependNodeIdList
!=
null
&&
dependNodeIdList
.
size
()
>
0
){
jobTask
.
setNodeDepend
(
Joiner
.
on
(
","
).
join
(
dependNodeIdList
));
}
...
...
byit-myth-core/myth-admin-core/src/main/resources/mapper/JobTaskMapper.xml
View file @
7091be9f
...
...
@@ -179,6 +179,9 @@
<if
test=
"operator != null"
>
operator,
</if>
<if
test=
"scheduleType != null"
>
schedule_type,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
...
...
@@ -283,6 +286,9 @@
<if
test=
"operator != null"
>
#{operator,jdbcType=VARCHAR},
</if>
<if
test=
"scheduleType != null"
>
#{scheduleType,jdbcType=INTEGER},
</if>
</trim>
</insert>
...
...
@@ -292,7 +298,7 @@
job_type, handler_name, node_desc, node_name, map_flow_id, node_timeout, is_virtual,
plugin_urls, priority, failed_retry_interval, routing_strategy, run_id, run_param,
run_source_desc, script_urls, source_principal, trigger_time, trigger_status, version_name,
run_command,run_source,flow_name,super_success_run, re_run_id ,log_id, node_depend, operator
run_command,run_source,flow_name,super_success_run, re_run_id ,log_id, node_depend, operator
, schedule_type
) values
<foreach
collection=
"jobTasks"
item=
"jobTask"
separator =
","
>
(
...
...
@@ -305,7 +311,7 @@
#{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.flowName,jdbcType=VARCHAR},#{jobTask.superSuccessRun,jdbcType=CHAR},#{jobTask.reRunId,jdbcType=VARCHAR},
#{jobTask.logId,jdbcType=INTEGER},#{jobTask.nodeDepend,jdbcType=VARCHAR},#{jobTask.operator,jdbcType=VARCHAR}
#{jobTask.logId,jdbcType=INTEGER},#{jobTask.nodeDepend,jdbcType=VARCHAR},#{jobTask.operator,jdbcType=VARCHAR}
, #{scheduleType,jdbcType=INTEGER},
)
</foreach>
...
...
@@ -414,6 +420,9 @@
<if
test=
"operator != null"
>
operator = #{operator,jdbcType=VARCHAR},
</if>
<if
test=
"scheduleType != null"
>
schedule_type = #{scheduleType,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
...
...
byit-myth-core/myth-admin-core/src/main/resources/mapper/JobTaskRunLogMapper.xml
View file @
7091be9f
...
...
@@ -32,6 +32,7 @@
<result
column=
"log_remotely_path"
jdbcType=
"VARCHAR"
property=
"logRemotelyPath"
/>
<result
column=
"node_depend"
jdbcType=
"VARCHAR"
property=
"nodeDepend"
/>
<result
column=
"operator"
jdbcType=
"VARCHAR"
property=
"operator"
/>
<result
column=
"schedule_type"
jdbcType=
"INTEGER"
property=
"scheduleType"
/>
</resultMap>
<resultMap
extends=
"BaseResultMap"
id=
"ResultMapWithBLOBs"
type=
"com.byit.model.JobTaskRunLogWithBLOBs"
>
<result
column=
"run_msg"
jdbcType=
"LONGVARCHAR"
property=
"runMsg"
/>
...
...
@@ -41,7 +42,7 @@
log_id, failed_remaining_count, version_name, flow_id, flow_name, job_group_id, handler_name,
node_name, is_virtual, run_code, run_params, start_time, run_type, trigger_code,
trigger_time, job_group_ip, map_flow_id, run_command, end_time, node_id,job_type,alert_end,run_id,re_run_id
,log_file_name, super_success_run, run_count, log_remotely_path, node_depend, operator
,log_file_name, super_success_run, run_count, log_remotely_path, node_depend, operator
, schedule_type
</sql>
<sql
id=
"Blob_Column_List"
>
run_msg, trigger_msg
...
...
@@ -251,6 +252,9 @@
<if
test=
"operator != null"
>
operator,
</if>
<if
test=
"scheduleType != null"
>
schedule_type,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"logId != null"
>
...
...
@@ -349,6 +353,9 @@
<if
test=
"operator != null"
>
#{operator,jdbcType=VARCHAR},
</if>
<if
test=
"scheduleType != null"
>
#{scheduleType,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update
id=
"updateJobTaskRunLogWithBLOBs"
parameterType=
"com.byit.model.JobTaskRunLogWithBLOBs"
>
...
...
@@ -447,6 +454,9 @@
<if
test=
"operator != null"
>
operator = #{operator,jdbcType=VARCHAR},
</if>
<if
test=
"scheduleType != null"
>
schedule_type = #{scheduleType,jdbcType=INTEGER},
</if>
</set>
where log_id = #{logId,jdbcType=INTEGER}
</update>
...
...
@@ -540,6 +550,9 @@
<if
test=
"operator != null"
>
operator = #{operator,jdbcType=VARCHAR},
</if>
<if
test=
"scheduleType != null"
>
schedule_type = #{scheduleType,jdbcType=INTEGER},
</if>
</set>
where log_id = #{logId,jdbcType=INTEGER}
</update>
...
...
byit-myth-core/myth-admin-core/src/main/resources/mapper/JobTaskScheduleMapper.xml
View file @
7091be9f
...
...
@@ -36,6 +36,7 @@
<result
column=
"re_run_id"
jdbcType=
"VARCHAR"
property=
"reRunId"
/>
<result
column=
"node_depend"
jdbcType=
"VARCHAR"
property=
"nodeDepend"
/>
<result
column=
"operator"
jdbcType=
"VARCHAR"
property=
"operator"
/>
<result
column=
"schedule_type"
jdbcType=
"INTEGER"
property=
"scheduleType"
/>
</resultMap>
<resultMap
extends=
"BaseResultMap"
id=
"ResultMapWithBLOBs"
type=
"com.byit.model.JobTaskSchedule"
>
...
...
@@ -47,7 +48,7 @@
job_type, handler_name, node_desc, node_name, map_flow_id, node_timeout, is_virtual,
plugin_urls, priority, failed_retry_interval, routing_strategy, run_id, run_param,
run_source_desc, script_urls, source_principal, trigger_time, trigger_status, version_name,
log_id, run_command,flow_name, super_success_run, re_run_id, node_depend, operator
log_id, run_command,flow_name, super_success_run, re_run_id, node_depend, operator
, schedule_type
</sql>
<sql
id=
"Blob_Column_List"
>
run_source
...
...
@@ -182,6 +183,9 @@
<if
test=
"operator != null"
>
operator,
</if>
<if
test=
"scheduleType != null"
>
schedule_type,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
...
...
@@ -286,6 +290,9 @@
<if
test=
"operator != null"
>
#{operator,jdbcType=VARCHAR},
</if>
<if
test=
"scheduleType != null"
>
#{scheduleType,jdbcType=INTEGER},
</if>
</trim>
</insert>
...
...
@@ -300,7 +307,7 @@
script_urls, source_principal, trigger_time,
trigger_status, version_name, log_id,
run_command, run_source,flow_name, super_success_run, re_run_id,
node_depend, operator
node_depend, operator
, schedule_type
)
values
<foreach
collection=
"jobTaskSchedules"
item=
"jobTaskSchedule"
separator=
","
>
...
...
@@ -326,7 +333,7 @@
#{jobTaskSchedule.runCommand,jdbcType=VARCHAR}, #{jobTaskSchedule.runSource,jdbcType=LONGVARCHAR},
#{jobTaskSchedule.flowName,jdbcType=VARCHAR}, #{jobTaskSchedule.superSuccessRun,jdbcType=CHAR},
#{jobTaskSchedule.reRunId,jdbcType=VARCHAR}, #{jobTaskSchedule.nodeDepend,jdbcType=VARCHAR},
#{jobTaskSchedule.operator,jdbcType=VARCHAR}
#{jobTaskSchedule.operator,jdbcType=VARCHAR}
, #{scheduleType,jdbcType=INTEGER},
)
</foreach>
</insert>
...
...
@@ -434,6 +441,9 @@
<if
test=
"operator != null"
>
operator = #{operator,jdbcType=VARCHAR},
</if>
<if
test=
"scheduleType != null"
>
schedule_type = #{scheduleType,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</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