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
d516d987
Commit
d516d987
authored
May 09, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补批及sql传参功能修改
parent
ce13150e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
TaskAndLogServerImpl.java
...om/byit/service/mapservice/impl/TaskAndLogServerImpl.java
+9
-0
ScheduleThreadRunHelper.java
.../java/com/byit/thread/helper/ScheduleThreadRunHelper.java
+7
-2
No files found.
byit-myth-core/myth-admin-core/src/main/java/com/byit/service/mapservice/impl/TaskAndLogServerImpl.java
View file @
d516d987
package
com
.
byit
.
service
.
mapservice
.
impl
;
package
com
.
byit
.
service
.
mapservice
.
impl
;
import
com.byit.job.utils.PlaceholderUtils
;
import
com.byit.model.JobTask
;
import
com.byit.model.JobTask
;
import
com.byit.model.JobTaskRunLogWithBLOBs
;
import
com.byit.model.JobTaskRunLogWithBLOBs
;
import
com.byit.service.JobTaskRunLogService
;
import
com.byit.service.JobTaskRunLogService
;
import
com.byit.service.JobTaskService
;
import
com.byit.service.JobTaskService
;
import
com.byit.service.mapservice.TaskAndLogServer
;
import
com.byit.service.mapservice.TaskAndLogServer
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -34,6 +36,13 @@ public class TaskAndLogServerImpl implements TaskAndLogServer {
...
@@ -34,6 +36,13 @@ public class TaskAndLogServerImpl implements TaskAndLogServer {
jobTaskService
.
removeMythJobTaskById
(
jobTask
.
getId
());
jobTaskService
.
removeMythJobTaskById
(
jobTask
.
getId
());
//添加任务日志
//添加任务日志
JobTaskRunLogWithBLOBs
jobTaskRunLog
=
new
JobTaskRunLogWithBLOBs
();
JobTaskRunLogWithBLOBs
jobTaskRunLog
=
new
JobTaskRunLogWithBLOBs
();
//执行快速失败时 将参数替换强行替换进去
String
runParam
=
jobTask
.
getRunParam
();
if
(
StringUtils
.
isNotBlank
(
runParam
))
{
String
newParam
=
PlaceholderUtils
.
formatParam
(
runParam
);
jobTaskRunLog
.
setRunParams
(
newParam
);
}
BeanUtils
.
copyProperties
(
jobTask
,
jobTaskRunLog
);
BeanUtils
.
copyProperties
(
jobTask
,
jobTaskRunLog
);
jobTaskRunLog
.
setRunId
(
jobTask
.
getRunId
());
jobTaskRunLog
.
setRunId
(
jobTask
.
getRunId
());
jobTaskRunLog
.
setNodeId
(
jobTask
.
getNodeId
());
jobTaskRunLog
.
setNodeId
(
jobTask
.
getNodeId
());
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/thread/helper/ScheduleThreadRunHelper.java
View file @
d516d987
...
@@ -2,8 +2,10 @@ package com.byit.thread.helper;
...
@@ -2,8 +2,10 @@ package com.byit.thread.helper;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.byit.enums.NodeTypeEnum
;
import
com.byit.enums.NodeTypeEnum
;
import
com.byit.enums.PlaceholderEnum
;
import
com.byit.enums.ScheduleTypeEnum
;
import
com.byit.enums.ScheduleTypeEnum
;
import
com.byit.job.WorkRoulette
;
import
com.byit.job.WorkRoulette
;
import
com.byit.job.utils.DateUtil
;
import
com.byit.job.utils.PlaceholderUtils
;
import
com.byit.job.utils.PlaceholderUtils
;
import
com.byit.model.JobTaskRunLogWithBLOBs
;
import
com.byit.model.JobTaskRunLogWithBLOBs
;
import
com.byit.model.JobTaskSchedule
;
import
com.byit.model.JobTaskSchedule
;
...
@@ -19,6 +21,7 @@ import org.springframework.beans.BeanUtils;
...
@@ -19,6 +21,7 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
javax.sql.DataSource
;
import
javax.sql.DataSource
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -54,8 +57,10 @@ public class ScheduleThreadRunHelper extends BaseThreadRunHelper {
...
@@ -54,8 +57,10 @@ public class ScheduleThreadRunHelper extends BaseThreadRunHelper {
if
(
ScheduleTypeEnum
.
NORMAL
.
getCode
().
equals
(
mythJobTaskSchedule
.
getScheduleType
()))
{
if
(
ScheduleTypeEnum
.
NORMAL
.
getCode
().
equals
(
mythJobTaskSchedule
.
getScheduleType
()))
{
mythJobTaskSchedule
.
setRunParam
(
PlaceholderUtils
.
formatParam
(
mythJobTaskSchedule
.
getRunParam
()));
mythJobTaskSchedule
.
setRunParam
(
PlaceholderUtils
.
formatParam
(
mythJobTaskSchedule
.
getRunParam
()));
}
}
String
command
=
mythJobTaskSchedule
.
getRunCommand
();
assert
command
!=
null
;
command
.
replace
(
"${"
+
PlaceholderEnum
.
DATE_PLACEHOLDER
.
getName
()+
"}"
,
DateUtil
.
dateLessDayStr
(
new
Date
(),
"yyyyMMdd"
,
1
));
mythJobTaskSchedule
.
setRunCommand
(
command
);
Long
triggerTime
=
mythJobTaskSchedule
.
getTriggerTime
();
Long
triggerTime
=
mythJobTaskSchedule
.
getTriggerTime
();
TimerTask
timerTask
=
null
;
TimerTask
timerTask
=
null
;
if
(
NodeTypeEnum
.
JAVA
.
getType
().
equals
(
mythJobTaskSchedule
.
getJobType
()))
{
if
(
NodeTypeEnum
.
JAVA
.
getType
().
equals
(
mythJobTaskSchedule
.
getJobType
()))
{
...
...
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