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
f4889200
Commit
f4889200
authored
Dec 15, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重跑错误处理
parent
b7e04437
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
19 deletions
+15
-19
ApiFlowController.java
...h-admin/src/main/java/com/byit/api/ApiFlowController.java
+1
-1
ApiFlowService.java
...-admin/src/main/java/com/byit/service/ApiFlowService.java
+1
-1
ApiFlowServiceImpl.java
...c/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
+12
-16
JobUtils.java
...xecutor-plugin/src/main/java/com/byit/utils/JobUtils.java
+1
-1
No files found.
byit-myth-admin/src/main/java/com/byit/api/ApiFlowController.java
View file @
f4889200
...
...
@@ -116,7 +116,7 @@ public class ApiFlowController {
@PostMapping
(
"reRunJob"
)
@ApiOperation
(
"重跑节点"
)
public
ResponseResult
reRunJob
(
String
param
)
{
public
ResponseResult
reRunJob
(
@RequestBody
RunInfo
param
)
{
apiFlowService
.
reRunJob
(
param
);
return
ResponseResult
.
ok
(
"SUCCESS"
);
}
...
...
byit-myth-admin/src/main/java/com/byit/service/ApiFlowService.java
View file @
f4889200
...
...
@@ -49,7 +49,7 @@ public interface ApiFlowService {
* 重跑任务
* @param param
*/
void
reRunJob
(
String
param
);
void
reRunJob
(
RunInfo
param
);
/**
* 手动置为成功
...
...
byit-myth-admin/src/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
View file @
f4889200
...
...
@@ -8,7 +8,6 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONObject
;
import
com.byit.dto.StatisticsConditionDto
;
import
com.byit.dto.api.DeleteDto
;
import
com.byit.dto.executor.RunParamWrapped
;
import
com.byit.dto.executor.ScriptParamAndPlaceholderDto
;
import
com.byit.dto.plugin.*
;
import
com.byit.dto.recording.LoadScheduleCondition
;
...
...
@@ -18,7 +17,6 @@ import com.byit.enums.*;
import
com.byit.enums.plugin.PluginNodeTypeEnum
;
import
com.byit.job.utils.CronExpression
;
import
com.byit.job.utils.CurrentUserUtils
;
import
com.byit.job.utils.PlaceholderUtils
;
import
com.byit.mapper.*
;
import
com.byit.model.JobTaskRunLog
;
import
com.byit.model.RunRecording
;
...
...
@@ -152,11 +150,11 @@ public class ApiFlowServiceImpl implements ApiFlowService {
*/
private
Flow
saveFlow
(
PluginFlow
pluginFlow
,
Integer
workspaceId
,
boolean
isInnner
,
String
upFlowName
)
throws
Exception
{
//拼装工作流名称
upFlowName
=
String
.
format
(
"%s:%s"
,
upFlowName
,
pluginFlow
.
getName
());
upFlowName
=
String
.
format
(
"%s:%s"
,
upFlowName
,
pluginFlow
.
getName
());
Flow
flow
=
new
Flow
();
FlowExtendedConfiguration
extendedConfiguration
=
pluginFlow
.
getConfig
().
getExtendedConfiguration
();
if
(
extendedConfiguration
==
null
)
{
if
(
extendedConfiguration
==
null
)
{
extendedConfiguration
=
new
FlowExtendedConfiguration
();
}
extendedConfiguration
.
setFlowEmbedLogo
(
upFlowName
);
...
...
@@ -493,12 +491,11 @@ public class ApiFlowServiceImpl implements ApiFlowService {
/**
* 重跑任务
*
* @param
param
* @param
runInfo
*/
@Override
public
void
reRunJob
(
String
param
)
{
ValidationUtil
.
dataNotBank
(
param
,
"请求参数不允许为空!"
);
RunInfo
runInfo
=
JSON
.
parseObject
(
param
,
RunInfo
.
class
);
public
void
reRunJob
(
RunInfo
runInfo
)
{
ValidationUtil
.
dataNotNull
(
runInfo
,
"请求参数不允许为空!"
);
//获取工作空间名称
ValidationUtil
.
dataNotBank
(
runInfo
.
getWorkspaceName
(),
"工作空间名称不允许为空!"
);
//获取工作流名称
...
...
@@ -528,8 +525,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
JobTaskRunLog
jobTaskRunLog
=
jobTaskRunLogMapper
.
findByRunIdAndFlowIdAndNodeName
(
runInfo
.
getRunId
(),
flow
.
getFlowId
(),
runInfo
.
getNodeName
());
ValidationUtil
.
dataNotNull
(
jobTaskRunLog
,
"查无此运行记录"
);
String
userName
=
currentUserUtils
.
account
();
String
userName
=
runInfo
.
getOperator
();
//校验上级是否成功
if
(
StringUtils
.
isNotEmpty
(
jobTaskRunLog
.
getNodeDepend
()))
{
List
<
String
>
dependNodeList
=
Arrays
.
asList
(
jobTaskRunLog
.
getNodeDepend
().
split
(
","
));
...
...
@@ -664,7 +660,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
Node
node
=
nodeMapper
.
getByMapFlowId
(
flow
.
getFlowId
());
RunInfo
nodeRun
=
RunInfo
.
builder
().
workspaceName
(
runInfo
.
getWorkspaceName
()).
flowName
(
runInfo
.
getFlowName
())
.
nodeName
(
node
.
getNodeName
()).
runId
(
runInfo
.
getRunId
()).
runState
(
"1"
).
build
();
reRunJob
(
JSON
.
toJSONString
(
nodeRun
,
WriteClassName
)
);
reRunJob
(
nodeRun
);
}
else
{
//不是内嵌工作流
Long
triggerTime
=
System
.
currentTimeMillis
();
...
...
@@ -1335,14 +1331,14 @@ public class ApiFlowServiceImpl implements ApiFlowService {
waitingRecord
.
setWaitOrder
(++
order
);
String
extendedConfiguration
=
flow
.
getExtendedConfiguration
();
FlowExtendedConfiguration
flowExtendedConfiguration
=
JSON
.
parseObject
(
extendedConfiguration
,
FlowExtendedConfiguration
.
class
);
Map
<
String
,
String
>
publicParamMap
=
JSON
.
parseObject
(
flowExtendedConfiguration
.
getPublicParam
(),
Map
.
class
);
if
(
CollectionUtil
.
isEmpty
(
publicParamMap
))
{
Map
<
String
,
String
>
publicParamMap
=
JSON
.
parseObject
(
flowExtendedConfiguration
.
getPublicParam
(),
Map
.
class
);
if
(
CollectionUtil
.
isEmpty
(
publicParamMap
))
{
publicParamMap
=
new
HashMap
<>(
8
);
}
publicParamMap
.
put
(
PlaceholderEnum
.
DATE_PLACEHOLDER
.
getName
(),
repairTime
);
publicParamMap
.
put
(
PlaceholderEnum
.
NOW_DATE_PLACEHOLDER
.
getName
(),
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
));
publicParamMap
.
put
(
PlaceholderEnum
.
NOW_DATE_PLACEHOLDER
.
getName
(),
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
));
flowExtendedConfiguration
.
setPublicParam
(
JSON
.
toJSONString
(
publicParamMap
));
waitingRecord
.
setExtendedConfiguration
(
JSON
.
toJSONString
(
flowExtendedConfiguration
));
//需要按着时间先后来设置时间
...
...
@@ -1417,11 +1413,11 @@ public class ApiFlowServiceImpl implements ApiFlowService {
scriptParamAndPlaceholderDto
=
new
ScriptParamAndPlaceholderDto
();
}
Map
<
String
,
String
>
param
=
scriptParamAndPlaceholderDto
.
getParam
();
if
(
param
==
null
)
{
if
(
param
==
null
)
{
param
=
new
HashMap
<>(
8
);
}
Map
<
String
,
String
>
placeholder
=
scriptParamAndPlaceholderDto
.
getPlaceholder
();
if
(
placeholder
==
null
)
{
if
(
placeholder
==
null
)
{
placeholder
=
new
HashMap
<>(
8
);
}
...
...
byit-myth-executor/myth-executor-plugin/src/main/java/com/byit/utils/JobUtils.java
View file @
f4889200
...
...
@@ -537,7 +537,7 @@ public class JobUtils {
*/
public
static
ResponseResult
reRunJob
(
RunInfo
runInfo
)
{
//发送请求 添加任务
String
response
=
createHttpRequest
(
REQUEST_FLOW_RERUNJOB
,
"param="
+
JSON
.
toJSONString
(
runInfo
,
WriteClassName
));
String
response
=
createHttpRequest
(
REQUEST_FLOW_RERUNJOB
,
JSON
.
toJSONString
(
runInfo
,
WriteClassName
));
log
.
debug
(
"--------------------重跑节点接口调用成功,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
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