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
4bcaea17
Commit
4bcaea17
authored
Dec 03, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询运行实例时增加一个操作人
parent
34259cc6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
69 additions
and
41 deletions
+69
-41
ApiFlowController.java
...h-admin/src/main/java/com/byit/api/ApiFlowController.java
+5
-8
ApiFlowService.java
...-admin/src/main/java/com/byit/service/ApiFlowService.java
+3
-2
ApiFlowServiceImpl.java
...c/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
+8
-20
RunRecordingMapper.java
...ore/src/main/java/com/byit/mapper/RunRecordingMapper.java
+2
-5
RunRecordingMapper.xml
...min-core/src/main/resources/mapper/RunRecordingMapper.xml
+10
-6
LoadScheduleCondition.java
...in/java/com/byit/dto/recording/LoadScheduleCondition.java
+41
-0
No files found.
byit-myth-admin/src/main/java/com/byit/api/ApiFlowController.java
View file @
4bcaea17
...
...
@@ -3,6 +3,7 @@ package com.byit.api;
import
com.byit.dto.executor.KillDto
;
import
com.byit.dto.plugin.CollectData
;
import
com.byit.dto.plugin.StopFlowParam
;
import
com.byit.dto.recording.LoadScheduleCondition
;
import
com.byit.dto.specials.RepairFlow
;
import
com.byit.dto.web.ResponseResult
;
import
com.byit.model.RunRecording
;
...
...
@@ -134,17 +135,13 @@ public class ApiFlowController {
}
/**
* @param param startTime
* endTime
* flowName
* workspaceName
* @return
* @param loadScheduleCondition 查询条件
* @return 对应的任务实例
*/
@PostMapping
(
"loadScheduleResult"
)
@ApiOperation
(
"加载运行记录"
)
public
ResponseResult
loadScheduleResult
(
String
param
)
{
List
<
RunRecording
>
result
=
apiFlowService
.
loadScheduleResult
(
param
);
return
ResponseResult
.
ok
(
result
);
public
List
<
RunRecording
>
loadScheduleResult
(
@RequestBody
LoadScheduleCondition
loadScheduleCondition
)
{
return
apiFlowService
.
loadScheduleResult
(
loadScheduleCondition
);
}
/**
...
...
byit-myth-admin/src/main/java/com/byit/service/ApiFlowService.java
View file @
4bcaea17
...
...
@@ -3,6 +3,7 @@ package com.byit.service;
import
com.byit.dto.plugin.CollectData
;
import
com.byit.dto.plugin.PluginFlow
;
import
com.byit.dto.plugin.StopFlowParam
;
import
com.byit.dto.recording.LoadScheduleCondition
;
import
com.byit.dto.specials.RepairFlow
;
import
com.byit.model.RunRecording
;
import
com.byit.model.vo.RunRecordingVo
;
...
...
@@ -63,10 +64,10 @@ public interface ApiFlowService {
/**
* 加载运行记录
* @param
param
* @param
loadScheduleCondition
* @return
*/
List
<
RunRecording
>
loadScheduleResult
(
String
param
);
List
<
RunRecording
>
loadScheduleResult
(
LoadScheduleCondition
loadScheduleCondition
);
/**
* 补批
...
...
byit-myth-admin/src/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
View file @
4bcaea17
...
...
@@ -9,6 +9,7 @@ import com.byit.dto.StatisticsConditionDto;
import
com.byit.dto.api.DeleteDto
;
import
com.byit.dto.executor.RunParamWrapped
;
import
com.byit.dto.plugin.*
;
import
com.byit.dto.recording.LoadScheduleCondition
;
import
com.byit.dto.specials.RepairFlow
;
import
com.byit.dto.specials.RepairTimeParam
;
import
com.byit.enums.*
;
...
...
@@ -772,13 +773,12 @@ public class ApiFlowServiceImpl implements ApiFlowService {
}
@Override
public
List
<
RunRecording
>
loadScheduleResult
(
String
param
)
{
ValidationUtil
.
dataNotBank
(
param
,
"请求参数不允许为空!"
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
param
);
Long
startTime
=
jsonObject
.
getLong
(
"startTime"
);
public
List
<
RunRecording
>
loadScheduleResult
(
LoadScheduleCondition
loadScheduleCondition
)
{
ValidationUtil
.
dataNotNull
(
loadScheduleCondition
,
"请求参数不允许为空!"
);
Long
startTime
=
loadScheduleCondition
.
getStartTime
();
ValidationUtil
.
dataNotNull
(
startTime
,
"开始时间不允许为空!"
);
Long
endTime
=
jsonObject
.
getLong
(
"endTime"
);
Long
endTime
=
loadScheduleCondition
.
getEndTime
(
);
ValidationUtil
.
dataNotNull
(
endTime
,
"结束时间不允许为空!"
);
ValidationUtil
.
isTrueValidation
(
String
.
valueOf
(
startTime
).
length
()
<
13
||
String
.
valueOf
(
endTime
).
length
()
<
13
,
"时间格式必须是毫秒"
);
...
...
@@ -789,8 +789,8 @@ public class ApiFlowServiceImpl implements ApiFlowService {
ValidationUtil
.
isTrueValidation
(
between
>
60
,
"查询时间最长为60天!"
);
//获取工作空间名称
String
workspaceName
=
jsonObject
.
getString
(
"workspaceName"
);
String
flowName
=
jsonObject
.
getString
(
"flowName"
);
String
workspaceName
=
loadScheduleCondition
.
getWorkspaceName
(
);
String
flowName
=
loadScheduleCondition
.
getFlowName
(
);
List
<
Integer
>
flowIds
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotBlank
(
workspaceName
))
{
Workspace
workspace
=
workspaceMapper
.
getByName
(
workspaceName
);
...
...
@@ -807,19 +807,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
}
}
String
scheduleStatus
=
jsonObject
.
getString
(
"scheduleStatus"
);
List
<
String
>
scheduleStatusList
=
null
;
if
(
StringUtils
.
isNotEmpty
(
scheduleStatus
))
{
scheduleStatusList
=
Arrays
.
asList
(
scheduleStatus
.
split
(
","
));
}
String
executeStatus
=
jsonObject
.
getString
(
"executeStatus"
);
List
<
String
>
executeStatusList
=
null
;
if
(
StringUtils
.
isNotEmpty
(
executeStatus
))
{
executeStatusList
=
Arrays
.
asList
(
executeStatus
.
split
(
","
));
}
List
<
RunRecording
>
runRecordList
=
runRecordingMapper
.
findByStartAndEndTime
(
startTime
,
endTime
,
flowIds
,
scheduleStatusList
,
executeStatusList
);
return
runRecordList
;
return
runRecordingMapper
.
findByStartAndEndTime
(
loadScheduleCondition
,
flowIds
);
}
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/mapper/RunRecordingMapper.java
View file @
4bcaea17
...
...
@@ -5,6 +5,7 @@ import com.byit.dto.FlowStatusCoreDto;
import
com.byit.dto.StatisticsConditionDto
;
import
com.byit.dto.plugin.JobStatusDto
;
import
com.byit.dto.plugin.StatisticData
;
import
com.byit.dto.recording.LoadScheduleCondition
;
import
com.byit.model.RunRecording
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -221,11 +222,7 @@ public interface RunRecordingMapper {
*/
List
<
RunRecording
>
findUnFinishByRunId
(
@Param
(
"runId"
)
String
runId
,
@Param
(
"flowIdList"
)
List
<
Integer
>
flowIdList
);
List
<
RunRecording
>
findByStartAndEndTime
(
@Param
(
"startDate"
)
long
startDate
,
@Param
(
"endDate"
)
long
endDate
,
@Param
(
"flowIds"
)
List
<
Integer
>
flowIds
,
@Param
(
"scheduleStatusList"
)
List
<
String
>
scheduleStatusList
,
@Param
(
"executeStatusList"
)
List
<
String
>
executeStatusList
);
List
<
RunRecording
>
findByStartAndEndTime
(
@Param
(
"loadScheduleCondition"
)
LoadScheduleCondition
loadScheduleCondition
,
@Param
(
"flowIds"
)
List
<
Integer
>
flowIds
);
/**
...
...
byit-myth-core/myth-admin-core/src/main/resources/mapper/RunRecordingMapper.xml
View file @
4bcaea17
...
...
@@ -229,8 +229,8 @@
select
<include
refid=
"Base_Column_List"
/>
from run_recording
where trigger_time
>
= #{startDate}
and trigger_time
<
= #{endDate}
where trigger_time
>
= #{
loadScheduleCondition.
startDate}
and trigger_time
<
= #{
loadScheduleCondition.
endDate}
and schedule_type != 4
<if
test=
"flowIds != null"
>
and flow_id in (
...
...
@@ -239,20 +239,24 @@
</foreach>
)
</if>
<if
test=
"scheduleStatusList != null"
>
<if
test=
"
loadScheduleCondition.
scheduleStatusList != null"
>
and flow_status in (
<foreach
collection=
"scheduleStatusList"
item=
"scheduleStatus"
separator=
","
>
<foreach
collection=
"
loadScheduleCondition.
scheduleStatusList"
item=
"scheduleStatus"
separator=
","
>
#{scheduleStatus}
</foreach>
)
</if>
<if
test=
"executeStatusList != null"
>
<if
test=
"
loadScheduleCondition.
executeStatusList != null"
>
and flow_run_result in (
<foreach
collection=
"executeStatusList"
item=
"executeStatus"
separator=
","
>
<foreach
collection=
"
loadScheduleCondition.
executeStatusList"
item=
"executeStatus"
separator=
","
>
#{executeStatus}
</foreach>
)
</if>
<if
test=
"loadScheduleCondition.operator != null and loadScheduleCondition.operator != ''"
>
and operator = #{loadScheduleCondition.operator}
</if>
order by start_time desc
</select>
...
...
byit-myth-core/myth-dto-core/src/main/java/com/byit/dto/recording/LoadScheduleCondition.java
0 → 100644
View file @
4bcaea17
package
com
.
byit
.
dto
.
recording
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 加载运行实例条件
*
* @author huangfu
* @date 2020年12月3日10:29:03
*/
@Data
public
class
LoadScheduleCondition
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
3011707470248774142L
;
private
String
workspaceName
;
private
String
flowName
;
private
Long
startTime
;
private
Long
endTime
;
/**
* 责任人
*/
private
String
operator
;
/**
* 工作流的状态
*/
private
List
<
String
>
scheduleStatusList
;
/**
* 执行结果状态
*/
private
List
<
String
>
executeStatusList
;
}
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