Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
platform
/
platform-process-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8a7da356
authored
Sep 15, 2023
by
tiger
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
日志调整
1 parent
c874c65c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
7 deletions
platform-process/src/main/java/cn/com/glsx/process/job/xxljob/core/SopXxlJobUtil.java
platform-process/src/main/java/cn/com/glsx/process/job/xxljob/impl/SopInstLoadJobHandler.java
platform-process/src/main/java/cn/com/glsx/process/job/xxljob/impl/SopInstNodeExecuteJobHandler.java
platform-process/src/main/java/cn/com/glsx/process/job/xxljob/core/SopXxlJobUtil.java
View file @
8a7da35
...
@@ -3,6 +3,10 @@ package cn.com.glsx.process.job.xxljob.core;
...
@@ -3,6 +3,10 @@ package cn.com.glsx.process.job.xxljob.core;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.Set
;
import
java.util.Set
;
import
org.slf4j.Logger
;
import
com.xxl.job.core.context.XxlJobHelper
;
import
cn.com.glsx.process.job.elastic.param.SopInstNodeParam
;
import
cn.com.glsx.process.job.elastic.param.SopInstNodeParam
;
import
cn.com.glsx.process.modules.entity.SopInst
;
import
cn.com.glsx.process.modules.entity.SopInst
;
import
cn.com.glsx.process.modules.entity.SopInstNode
;
import
cn.com.glsx.process.modules.entity.SopInstNode
;
...
@@ -25,14 +29,15 @@ public class SopXxlJobUtil {
...
@@ -25,14 +29,15 @@ public class SopXxlJobUtil {
public
static
void
pauseSop
(
SopStruct
sop
)
{
public
static
void
pauseSop
(
SopStruct
sop
)
{
String
jobBusId
=
jobBusId
(
sop
.
getInst
());
String
jobBusId
=
jobBusId
(
sop
.
getInst
());
String
pause
=
XxlJobUtil
.
pause
(
jobBusId
);
String
pause
=
XxlJobUtil
.
pause
(
jobBusId
);
log
.
info
(
"【{}】Sop任务停止:{}"
,
jobBusId
,
pause
);
SopXxlJobUtil
.
log
(
log
,
"【{}】Sop任务停止:{}"
,
jobBusId
,
pause
);
if
(
sop
!=
null
)
{
if
(
sop
!=
null
)
{
// 遍历node,停止任务
// 遍历node,停止任务
for
(
SopInstNode
node
:
sop
.
getInstNodeMap
().
values
())
{
for
(
SopInstNode
node
:
sop
.
getInstNodeMap
().
values
())
{
jobBusId
=
jobBusId
(
sop
.
getInst
(),
node
);
jobBusId
=
jobBusId
(
sop
.
getInst
(),
node
);
pause
=
XxlJobUtil
.
pause
(
jobBusId
);
pause
=
XxlJobUtil
.
pause
(
jobBusId
);
log
.
info
(
"【{}】Sop节点任务停止:{}"
,
jobBusId
,
pause
);
SopXxlJobUtil
.
log
(
log
,
"【{}】Sop节点任务停止:{}"
,
jobBusId
,
pause
);
}
}
}
}
}
}
...
@@ -57,7 +62,7 @@ public class SopXxlJobUtil {
...
@@ -57,7 +62,7 @@ public class SopXxlJobUtil {
job
.
setTriggerStatus
(
1
);
job
.
setTriggerStatus
(
1
);
String
add
=
XxlJobUtil
.
add
(
job
);
String
add
=
XxlJobUtil
.
add
(
job
);
log
.
info
(
"【{}】任务启动:{}"
,
SOP_LOAD_JOB_ID
,
add
);
SopXxlJobUtil
.
log
(
log
,
"【{}】任务启动,cron:{},result:{}"
,
SOP_LOAD_JOB_ID
,
job
.
getScheduleConf
()
,
add
);
}
}
public
static
void
initSopJob
(
SopInst
inst
)
{
public
static
void
initSopJob
(
SopInst
inst
)
{
...
@@ -77,7 +82,8 @@ public class SopXxlJobUtil {
...
@@ -77,7 +82,8 @@ public class SopXxlJobUtil {
job
.
setBusKey
(
jobBusId
);
job
.
setBusKey
(
jobBusId
);
job
.
setTriggerStatus
(
1
);
job
.
setTriggerStatus
(
1
);
String
add
=
XxlJobUtil
.
add
(
job
);
String
add
=
XxlJobUtil
.
add
(
job
);
log
.
info
(
"【{}】Sop任务启动:{}"
,
inst
.
getInstId
(),
add
);
SopXxlJobUtil
.
log
(
log
,
"【{}】Sop任务启动,cron:{},result:{}"
,
inst
.
getInstId
(),
job
.
getScheduleConf
(),
add
);
}
}
public
static
void
initSopNodesJob
(
SopStruct
sop
)
{
public
static
void
initSopNodesJob
(
SopStruct
sop
)
{
...
@@ -127,7 +133,7 @@ public class SopXxlJobUtil {
...
@@ -127,7 +133,7 @@ public class SopXxlJobUtil {
job
.
setBusKey
(
jobBusId
);
job
.
setBusKey
(
jobBusId
);
job
.
setTriggerStatus
(
1
);
job
.
setTriggerStatus
(
1
);
String
add
=
XxlJobUtil
.
add
(
job
);
String
add
=
XxlJobUtil
.
add
(
job
);
log
.
info
(
"【{}】Sop节点任务启动:{}"
,
jobBusId
,
add
);
SopXxlJobUtil
.
log
(
log
,
"【{}】Sop节点任务启动,cron:{},result:{}"
,
jobBusId
,
job
.
getScheduleConf
()
,
add
);
}
}
public
static
String
jobBusId
(
SopInst
inst
)
{
public
static
String
jobBusId
(
SopInst
inst
)
{
...
@@ -137,4 +143,11 @@ public class SopXxlJobUtil {
...
@@ -137,4 +143,11 @@ public class SopXxlJobUtil {
public
static
String
jobBusId
(
SopInst
inst
,
SopInstNode
node
)
{
public
static
String
jobBusId
(
SopInst
inst
,
SopInstNode
node
)
{
return
inst
.
getInstId
()
+
"-"
+
node
.
getNodeId
();
return
inst
.
getInstId
()
+
"-"
+
node
.
getNodeId
();
}
}
// 日志相关
public
static
boolean
log
(
Logger
logger
,
String
appendLogPattern
,
Object
...
appendLogArguments
)
{
logger
.
info
(
appendLogPattern
,
appendLogArguments
);
return
XxlJobHelper
.
log
(
appendLogPattern
,
appendLogArguments
);
}
}
}
platform-process/src/main/java/cn/com/glsx/process/job/xxljob/impl/SopInstLoadJobHandler.java
View file @
8a7da35
...
@@ -23,7 +23,7 @@ public class SopInstLoadJobHandler {
...
@@ -23,7 +23,7 @@ public class SopInstLoadJobHandler {
@XxlJob
(
SopXxlJobUtil
.
SOP_LOAD_JOB_ID
)
@XxlJob
(
SopXxlJobUtil
.
SOP_LOAD_JOB_ID
)
public
void
handler
(
String
param
)
throws
Exception
{
public
void
handler
(
String
param
)
throws
Exception
{
log
.
info
(
"【加载Sop实例列表】{}"
,
param
);
SopXxlJobUtil
.
log
(
log
,
"【加载Sop实例列表】{}"
,
param
);
List
<
SopInst
>
all
=
sopService
.
loadAllInst
();
List
<
SopInst
>
all
=
sopService
.
loadAllInst
();
...
...
platform-process/src/main/java/cn/com/glsx/process/job/xxljob/impl/SopInstNodeExecuteJobHandler.java
View file @
8a7da35
...
@@ -23,7 +23,7 @@ public class SopInstNodeExecuteJobHandler {
...
@@ -23,7 +23,7 @@ public class SopInstNodeExecuteJobHandler {
@XxlJob
(
SopXxlJobUtil
.
SOP_NODE_EXECUTE_JOB_ID
)
@XxlJob
(
SopXxlJobUtil
.
SOP_NODE_EXECUTE_JOB_ID
)
public
void
handler
(
String
param
)
throws
Exception
{
public
void
handler
(
String
param
)
throws
Exception
{
param
=
XxlJobHelper
.
getJobParam
();
param
=
XxlJobHelper
.
getJobParam
();
log
.
info
(
"【执行Sop节点】{}"
,
param
);
SopXxlJobUtil
.
log
(
log
,
"【执行Sop节点】{}"
,
param
);
String
instId
=
param
;
String
instId
=
param
;
SopStruct
sop
=
sopService
.
loadSop
(
instId
);
SopStruct
sop
=
sopService
.
loadSop
(
instId
);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment