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
d0cc6f7d
Commit
d0cc6f7d
authored
Oct 26, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除多余的补批接口
parent
cfc0cb3d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
99 deletions
+0
-99
ApiFlowController.java
...h-admin/src/main/java/com/byit/api/ApiFlowController.java
+0
-13
ApiFlowService.java
...-admin/src/main/java/com/byit/service/ApiFlowService.java
+0
-6
ApiFlowServiceImpl.java
...c/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
+0
-80
No files found.
byit-myth-admin/src/main/java/com/byit/api/ApiFlowController.java
View file @
d0cc6f7d
...
...
@@ -172,19 +172,6 @@ public class ApiFlowController {
return
ResponseResult
.
ok
(
"SUCCESS"
);
}
/**
* 补批工作流
*
* @param repairFlow
* @return
*/
@PostMapping
(
"/repairFlow"
)
@ApiOperation
(
"补批工作流"
)
public
ResponseResult
repairFlow
(
@RequestBody
RepairFlow
repairFlow
)
{
apiFlowService
.
repairFlow
(
repairFlow
);
return
ResponseResult
.
ok
(
"SUCCESS"
);
}
/**
* 获取整体运行的统计数据
...
...
byit-myth-admin/src/main/java/com/byit/service/ApiFlowService.java
View file @
d0cc6f7d
...
...
@@ -74,12 +74,6 @@ public interface ApiFlowService {
*/
void
repairJob
(
String
param
);
/**
* 补批工作流
* @param param
*/
void
repairFlow
(
RepairFlow
repairFlow
);
/**
* 加载运行日志
...
...
byit-myth-admin/src/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
View file @
d0cc6f7d
...
...
@@ -1282,86 +1282,6 @@ public class ApiFlowServiceImpl implements ApiFlowService {
}
}
@Override
public
void
repairFlow
(
RepairFlow
repairFlow
)
{
ValidationUtil
.
dataNotNull
(
repairFlow
,
"请求参数不允许为空!"
);
//获取工作空间名称
String
workspaceName
=
repairFlow
.
getWorkspaceName
();
ValidationUtil
.
dataNotBank
(
workspaceName
,
"工作空间名称不允许为空!"
);
//获取工作流名称
String
flowName
=
repairFlow
.
getFlowName
();
ValidationUtil
.
dataNotBank
(
flowName
,
"工作流名称不允许为空!"
);
List
<
String
>
nodeNameList
=
repairFlow
.
getNodeNames
();
ValidationUtil
.
isTrueValidation
(
CollectionUtil
.
isEmpty
(
nodeNameList
),
"补批节点不允许为空!"
);
//获取补批的日期
List
<
String
>
repairTimeList
=
repairFlow
.
getRepairTimes
();
ValidationUtil
.
isTrueValidation
(
CollectionUtil
.
isEmpty
(
repairTimeList
),
"补批日期不允许为空!"
);
String
timeFormatName
=
repairFlow
.
getTimeFormatName
();
ValidationUtil
.
dataNotBank
(
timeFormatName
,
"补批时间格式不允许为空!"
);
String
nowDateTimeFormatName
=
repairFlow
.
getNowDateTimeFormatName
();
ValidationUtil
.
dataNotBank
(
nowDateTimeFormatName
,
"nowDate时间格式不允许为空!"
);
//开始校验
Workspace
workspace
=
workspaceMapper
.
getByName
(
workspaceName
);
ValidationUtil
.
dataNotNull
(
workspace
,
workspaceName
+
"工作空间不存在"
);
Flow
flow
=
flowMapper
.
getByWorkSpaceAndName
(
workspace
.
getWorkspaceId
(),
flowName
);
ValidationUtil
.
dataNotNull
(
flow
,
flowName
+
"工作流不存在"
);
List
<
Node
>
nodeList
=
nodeMapper
.
findByFlowIdAndName
(
flow
.
getFlowId
(),
nodeNameList
);
try
{
RedissLockUtil
.
trlock
(
flow
.
getFlowId
().
toString
(),
5
);
//设置触发时间
Long
triggerTime
=
System
.
currentTimeMillis
();
Map
<
String
,
List
<
WaitingTask
>>
waitTaskMap
=
buildTask
(
nodeList
,
nodeNameList
,
repairTimeList
,
triggerTime
,
flowName
,
timeFormatName
,
nowDateTimeFormatName
);
//将时间排序
Collections
.
sort
(
repairTimeList
);
//查看当前排队的工作流最大排队序号
Integer
order
=
waitingRecordMapper
.
findOrderByFlowId
(
flow
.
getFlowId
());
if
(
order
==
null
)
{
order
=
0
;
}
String
userName
=
currentUserUtils
.
account
();
for
(
String
repairTime
:
repairTimeList
)
{
WaitingRecord
waitingRecord
=
new
WaitingRecord
();
RunRecording
runRecording
=
new
RunRecording
();
String
runId
=
IDGenerationStrategy
.
runIdGenerationStrategy
(
serverPort
);
//设置排期
BeanUtils
.
copyProperties
(
flow
,
waitingRecord
);
waitingRecord
.
setFlowVersionName
(
flow
.
getVersionName
());
waitingRecord
.
setRunId
(
runId
);
waitingRecord
.
setFlowNodeCount
(
nodeList
.
size
());
waitingRecord
.
setOperator
(
userName
);
waitingRecord
.
setScheduleType
(
ScheduleTypeEnum
.
REPAIR
.
getCode
());
waitingRecord
.
setRepeatTime
(
repairTime
);
waitingRecord
.
setWaitOrder
(++
order
);
//需要按着时间先后来设置时间
waitingRecord
.
setTriggerTime
(
System
.
currentTimeMillis
());
//设置实例
BeanUtils
.
copyProperties
(
waitingRecord
,
runRecording
);
runRecording
.
setFlowStatus
(
"1"
);
runRecording
.
setTriggerTime
(
System
.
currentTimeMillis
());
runRecording
.
setWorkspaceId
(
flow
.
getWorkspaceId
());
Integer
waitId
=
waitingRecordMapper
.
insertSelective
(
waitingRecord
);
runRecordingMapper
.
saveRunRecording
(
runRecording
);
List
<
WaitingTask
>
repairTaskList
=
waitTaskMap
.
get
(
repairTime
);
repairTaskList
.
forEach
(
waitingTask
->
{
waitingTask
.
setWaitId
(
waitingRecord
.
getWaitId
());
waitingTaskMapper
.
insertSelective
(
waitingTask
);
});
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
RedissLockUtil
.
unlock
(
flow
.
getFlowId
().
toString
());
}
}
private
Map
<
String
,
List
<
WaitingTask
>>
buildTask
(
List
<
Node
>
nodeList
,
List
<
String
>
nodeNameList
,
List
<
String
>
repairTimeList
,
Long
triggerTime
,
String
flowName
,
String
timeFormatName
,
String
nowDateTimeFormatName
)
{
...
...
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