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
ae96fb05
Commit
ae96fb05
authored
May 09, 2020
by
guominglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改虚节点的不跟随主工作流调度时间BUG
parent
09c58301
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
18 deletions
+34
-18
RunNodeServiceImpl.java
...c/main/java/com/byit/service/impl/RunNodeServiceImpl.java
+1
-1
RunRecordingAndJobTaskServiceImpl.java
...ce/mapservice/impl/RunRecordingAndJobTaskServiceImpl.java
+33
-17
No files found.
byit-myth-core/myth-admin-core/src/main/java/com/byit/service/impl/RunNodeServiceImpl.java
View file @
ae96fb05
...
@@ -89,7 +89,7 @@ public class RunNodeServiceImpl implements RunNodeServer, ApplicationEventPublis
...
@@ -89,7 +89,7 @@ public class RunNodeServiceImpl implements RunNodeServer, ApplicationEventPublis
jobTaskService
.
saveJobTasks
(
jobTasks
);
jobTaskService
.
saveJobTasks
(
jobTasks
);
log
.
info
(
"-------------【开始修改工作流{}的下次运行时间,以及各种状态】---------------"
,
flow
);
log
.
info
(
"-------------【开始修改工作流{}的下次运行时间,以及各种状态】---------------"
,
flow
);
try
{
try
{
flow
.
setTriggerNextTime
(
new
CronExpression
(
flow
.
getFlowCron
()).
getNextValidTimeAfter
(
new
Date
(
flow
.
getTriggerNextTime
()
)).
getTime
());
flow
.
setTriggerNextTime
(
new
CronExpression
(
flow
.
getFlowCron
()).
getNextValidTimeAfter
(
new
Date
()).
getTime
());
}
catch
(
ParseException
e
)
{
}
catch
(
ParseException
e
)
{
flow
.
setTriggerNextTime
(
999999999999999999L
);
flow
.
setTriggerNextTime
(
999999999999999999L
);
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/service/mapservice/impl/RunRecordingAndJobTaskServiceImpl.java
View file @
ae96fb05
...
@@ -88,7 +88,8 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
...
@@ -88,7 +88,8 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
jobTaskRunLog
.
setIsVirtual
(
jobTask
.
getIsVirtual
());
jobTaskRunLog
.
setIsVirtual
(
jobTask
.
getIsVirtual
());
jobTaskRunLog
.
setMapFlowId
(
jobTask
.
getMapFlowId
());
jobTaskRunLog
.
setMapFlowId
(
jobTask
.
getMapFlowId
());
jobTaskRunLog
.
setRunCode
(
NodeRunStatusPropertyEnum
.
RUN_ING
.
getCode
());
jobTaskRunLog
.
setRunCode
(
NodeRunStatusPropertyEnum
.
RUN_ING
.
getCode
());
jobTaskRunLog
.
setRunType
(
jobTask
.
getJobType
());
//目前都设置为执行机运行
jobTaskRunLog
.
setRunType
(
"1"
);
Date
thisDate
=
new
Date
();
Date
thisDate
=
new
Date
();
jobTaskRunLog
.
setTriggerTime
(
thisDate
);
jobTaskRunLog
.
setTriggerTime
(
thisDate
);
jobTaskRunLog
.
setStartTime
(
thisDate
);
jobTaskRunLog
.
setStartTime
(
thisDate
);
...
@@ -96,7 +97,6 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
...
@@ -96,7 +97,6 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
jobTaskRunLogService
.
saveJobTaskRunLog
(
jobTaskRunLog
);
jobTaskRunLogService
.
saveJobTaskRunLog
(
jobTaskRunLog
);
log
.
info
(
"-----------【虚节点保存运行记录】--------------"
);
log
.
info
(
"-----------【虚节点保存运行记录】--------------"
);
//保存进运行记录表
//保存进运行记录表
Long
triggerNextTime
=
virFlow
.
getTriggerNextTime
();
RunRecording
runRecording
=
RunRecording
.
builder
()
RunRecording
runRecording
=
RunRecording
.
builder
()
.
runId
(
jobTask
.
getRunId
())
.
runId
(
jobTask
.
getRunId
())
.
flowId
(
mapFlowId
)
.
flowId
(
mapFlowId
)
...
@@ -108,7 +108,7 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
...
@@ -108,7 +108,7 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
.
alarmEmail
(
virFlow
.
getAlarmEmail
())
.
alarmEmail
(
virFlow
.
getAlarmEmail
())
.
alarmlAction
(
virFlow
.
getAlarmlAction
())
.
alarmlAction
(
virFlow
.
getAlarmlAction
())
.
priority
(
virFlow
.
getPriority
())
.
priority
(
virFlow
.
getPriority
())
.
triggerTime
(
equals
?
mainRecording
.
getTriggerTime
():
triggerNextTime
)
.
triggerTime
(
equals
?
jobTask
.
getTriggerTime
():
virFlow
.
getTriggerNextTime
()
)
.
principal
(
virFlow
.
getPrincipal
())
.
principal
(
virFlow
.
getPrincipal
())
.
startTime
(
new
Date
())
.
startTime
(
new
Date
())
.
flowNodeCount
(
virFlow
.
getFlowNodeCount
())
.
flowNodeCount
(
virFlow
.
getFlowNodeCount
())
...
@@ -131,11 +131,18 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
...
@@ -131,11 +131,18 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
}
}
BeanUtils
.
copyProperties
(
node
,
task
);
BeanUtils
.
copyProperties
(
node
,
task
);
task
.
setTriggerTime
(
mainRecording
.
getTriggerTime
());
if
(
equals
)
{
if
(
equals
)
{
task
.
setTriggerTime
(
mainRecording
.
getTriggerTime
());
task
.
setTriggerTime
(
jobTask
.
getTriggerTime
());
}
else
if
(
virFlag
)
{
}
else
if
(
virFlag
)
{
task
.
setTriggerTime
(
triggerNextTime
);
task
.
setTriggerTime
(
virFlow
.
getTriggerNextTime
());
}
else
{
task
.
setTriggerTime
(
node
.
getTriggerNextTime
());
try
{
node
.
setTriggerNextTime
(
new
CronExpression
(
node
.
getNodeCron
()).
getNextValidTimeAfter
(
new
Date
()).
getTime
());
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
//TODO 添加节点的下次运行时间修改
}
}
task
.
setRunId
(
jobTask
.
getRunId
());
task
.
setRunId
(
jobTask
.
getRunId
());
task
.
setTriggerStatus
(
"1"
);
task
.
setTriggerStatus
(
"1"
);
...
@@ -147,9 +154,9 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
...
@@ -147,9 +154,9 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
jobTaskService
.
removeMythJobTaskById
(
jobTask
.
getId
());
jobTaskService
.
removeMythJobTaskById
(
jobTask
.
getId
());
log
.
info
(
"-----------saveRunRecordingAndTask end【虚节点保存服务】--------------"
);
log
.
info
(
"-----------saveRunRecordingAndTask end【虚节点保存服务】--------------"
);
if
(
StringUtils
.
isNotBlank
(
virFlow
.
getFlowCron
())){
if
(
StringUtils
.
isNotBlank
(
virFlow
.
getFlowCron
())){
virFlow
.
setTriggerNextTime
(
new
CronExpression
(
virFlow
.
getFlowCron
()).
getNextValidTimeAfter
(
new
Date
(
virFlow
.
getTriggerNextTime
())).
getTime
());
virFlow
.
setTriggerNextTime
(
new
CronExpression
(
virFlow
.
getFlowCron
()).
getNextValidTimeAfter
(
new
Date
()).
getTime
());
flowService
.
updateByIdSelective
(
virFlow
);
}
}
flowService
.
updateByIdSelective
(
virFlow
);
}
}
...
@@ -161,15 +168,13 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
...
@@ -161,15 +168,13 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
String
reRunId
=
jobTask
.
getReRunId
();
String
reRunId
=
jobTask
.
getReRunId
();
List
<
JobTaskRunLogWithBLOBs
>
reNodeLog
=
jobTaskRunLogService
.
findJobTaskRunLogWithBLOBsByFlowIdAndRunId
(
mapFlowId
,
reRunId
);
List
<
JobTaskRunLogWithBLOBs
>
reNodeLog
=
jobTaskRunLogService
.
findJobTaskRunLogWithBLOBsByFlowIdAndRunId
(
mapFlowId
,
reRunId
);
for
(
JobTaskRunLogWithBLOBs
jobTaskRunLogWithBLOBs
:
reNodeLog
)
{
for
(
JobTaskRunLogWithBLOBs
jobTaskRunLogWithBLOBs
:
reNodeLog
)
{
//将旧的运行日志修改为运行中
jobTaskRunLogWithBLOBs
.
setRunCode
(
ExecuteStatusEnum
.
RUNING
.
getCode
());
jobTaskRunLogWithBLOBs
.
setRunCode
(
ExecuteStatusEnum
.
RUNING
.
getCode
());
jobTaskRunLogWithBLOBs
.
setOperator
(
jobTask
.
getOperator
());
jobTaskRunLogWithBLOBs
.
setScheduleType
(
jobTask
.
getScheduleType
());
jobTaskRunLogWithBLOBs
.
setReRunId
(
jobTask
.
getReRunId
());
jobTaskRunLogWithBLOBs
.
setReRunId
(
jobTask
.
getRunId
());
//修改日志
//修改日志
jobTaskRunLogService
.
updateJobTaskRunLogWithBLOBs
(
jobTaskRunLogWithBLOBs
);
jobTaskRunLogService
.
updateJobTaskRunLogWithBLOBs
(
jobTaskRunLogWithBLOBs
);
//将日志修改为task节点
//将日志修改为task节点
JobTask
logConvertTask
=
logConvertTask
(
jobTaskRunLogWithBLOBs
);
JobTask
logConvertTask
=
logConvertTask
(
jobTaskRunLogWithBLOBs
);
logConvertTask
.
setRunId
(
jobTask
.
getRunId
());
logConvertTask
.
setReRunId
(
jobTask
.
getReRunId
());
logConvertTask
.
setReRunId
(
jobTask
.
getReRunId
());
logConvertTask
.
setOperator
(
jobTask
.
getOperator
());
logConvertTask
.
setOperator
(
jobTask
.
getOperator
());
logConvertTask
.
setScheduleType
(
jobTask
.
getScheduleType
());
logConvertTask
.
setScheduleType
(
jobTask
.
getScheduleType
());
...
@@ -179,11 +184,22 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
...
@@ -179,11 +184,22 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
RunRecording
runRecordingByFlowIdAndRunId
=
runRecordingService
.
findRunRecordingByFlowIdAndRunId
(
mapFlowId
,
reRunId
);
RunRecording
runRecordingByFlowIdAndRunId
=
runRecordingService
.
findRunRecordingByFlowIdAndRunId
(
mapFlowId
,
reRunId
);
runRecordingByFlowIdAndRunId
.
setFlowStatus
(
"2"
);
runRecordingByFlowIdAndRunId
.
setFlowStatus
(
"2"
);
runRecordingService
.
updateRunRecordingById
(
runRecordingByFlowIdAndRunId
);
runRecordingService
.
updateRunRecordingById
(
runRecordingByFlowIdAndRunId
);
runRecordingByFlowIdAndRunId
.
setRunId
(
jobTask
.
getRunId
());
runRecordingByFlowIdAndRunId
.
setReRunId
(
reRunId
);
RunRecording
runRecording
=
new
RunRecording
();
runRecordingByFlowIdAndRunId
.
setOperator
(
jobTask
.
getOperator
());
BeanUtils
.
copyProperties
(
runRecordingByFlowIdAndRunId
,
runRecording
);
runRecordingByFlowIdAndRunId
.
setScheduleType
(
jobTask
.
getScheduleType
());
runRecordingByFlowIdAndRunId
.
setRecordingId
(
null
);
runRecording
.
setFailFast
(
RunRecordingEnum
.
FAIL_FAST_NO
.
getCode
());
runRecording
.
setRunId
(
jobTask
.
getRunId
());
runRecording
.
setReRunId
(
reRunId
);
//设置为未开始
runRecording
.
setFlowStatus
(
RunRecordingEnum
.
FLOW_STATUS_NOT_RUN
.
getCode
());
runRecording
.
setFlowRunResult
(
null
);
runRecording
.
setEndTime
(
null
);
runRecording
.
setStartTime
(
new
Date
());
runRecording
.
setTriggerTime
(
jobTask
.
getTriggerTime
());
runRecording
.
setOperator
(
jobTask
.
getOperator
());
runRecording
.
setScheduleType
(
jobTask
.
getScheduleType
());
runRecording
.
setRecordingId
(
null
);
//新增一条重跑的运行记录
//新增一条重跑的运行记录
runRecordingService
.
saveRunRecording
(
runRecordingByFlowIdAndRunId
);
runRecordingService
.
saveRunRecording
(
runRecordingByFlowIdAndRunId
);
}
}
...
...
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