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
3d8e7fa5
Commit
3d8e7fa5
authored
Jul 17, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修正查询工作流状态SQLBUG
parent
7d4f7a68
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
23 deletions
+24
-23
ApiFlowStatusServiceImpl.java
.../java/com/byit/service/impl/ApiFlowStatusServiceImpl.java
+17
-16
RunRecordingMapper.xml
...min-core/src/main/resources/mapper/RunRecordingMapper.xml
+7
-7
No files found.
byit-myth-admin/src/main/java/com/byit/service/impl/ApiFlowStatusServiceImpl.java
View file @
3d8e7fa5
...
...
@@ -64,26 +64,27 @@ public class ApiFlowStatusServiceImpl implements ApiFlowStatusService {
}).
collect
(
Collectors
.
toList
());
flowStatusCoreDto
.
setFlowEntityCoreDtos
(
flowEntityCoreDtos
);
//查询对应条件的实例
List
<
RunRecording
>
byFlowNameAndTypeAndWId
=
runRecordingMapper
.
findByFlowNameAndTypeAndWId
(
flowStatusCoreDto
);
if
(
CollectionUtil
.
isNotEmpty
(
byFlowNameAndTypeAndWId
))
{
//筛选当天数据
List
<
RunRecording
>
collect
=
byFlowNameAndTypeAndWId
.
stream
().
filter
(
byFlowName
->
byFlowName
.
getTriggerTime
()
>
DateUtil
.
getThisDayStartDate
().
getTime
()
&&
byFlowName
.
getTriggerTime
()
<=
DateUtil
.
getThisDayEndDate
().
getTime
()).
collect
(
Collectors
.
toList
());
if
(
CollectionUtil
.
isNotEmpty
(
collect
))
{
collect
.
forEach
(
byFlowNameAndType
->{
JobStatusResultDto
jobStatusResultDto
=
new
JobStatusResultDto
();
jobStatusResultDto
.
setFindDateTime
(
System
.
currentTimeMillis
());
jobStatusResultDto
.
setEndTime
(
byFlowNameAndType
.
getEndTime
().
getTime
());
jobStatusResultDto
.
setJobName
(
byFlowNameAndType
.
getFlowName
());
jobStatusResultDto
.
setRunIng
(
"4"
.
equals
(
byFlowNameAndType
.
getFlowStatus
()));
jobStatusResultDto
.
setStartDateTime
(
byFlowNameAndType
.
getStartTime
().
getTime
());
jobStatusResultDtos
.
add
(
jobStatusResultDto
);
});
if
(
flowStatusCoreDto
!=
null
)
{
List
<
RunRecording
>
byFlowNameAndTypeAndWId
=
runRecordingMapper
.
findByFlowNameAndTypeAndWId
(
flowStatusCoreDto
);
if
(
CollectionUtil
.
isNotEmpty
(
byFlowNameAndTypeAndWId
))
{
//筛选当天数据
List
<
RunRecording
>
collect
=
byFlowNameAndTypeAndWId
.
stream
().
filter
(
byFlowName
->
byFlowName
.
getTriggerTime
()
>
DateUtil
.
getThisDayStartDate
().
getTime
()
&&
byFlowName
.
getTriggerTime
()
<=
DateUtil
.
getThisDayEndDate
().
getTime
()).
collect
(
Collectors
.
toList
());
if
(
CollectionUtil
.
isNotEmpty
(
collect
))
{
collect
.
forEach
(
byFlowNameAndType
->{
JobStatusResultDto
jobStatusResultDto
=
new
JobStatusResultDto
();
jobStatusResultDto
.
setFindDateTime
(
System
.
currentTimeMillis
());
jobStatusResultDto
.
setEndTime
(
byFlowNameAndType
.
getEndTime
().
getTime
());
jobStatusResultDto
.
setJobName
(
byFlowNameAndType
.
getFlowName
());
jobStatusResultDto
.
setRunIng
(
"4"
.
equals
(
byFlowNameAndType
.
getFlowStatus
()));
jobStatusResultDto
.
setStartDateTime
(
byFlowNameAndType
.
getStartTime
().
getTime
());
jobStatusResultDtos
.
add
(
jobStatusResultDto
);
});
}
}
}
}
});
return
jobStatusResultDtos
;
}
...
...
byit-myth-core/myth-admin-core/src/main/resources/mapper/RunRecordingMapper.xml
View file @
3d8e7fa5
...
...
@@ -208,14 +208,14 @@
select
<include
refid=
"Base_Column_List"
/>
from run_recording
<if
test=
"flowStatusCoreDtos != null"
>
(
<foreach
collection=
"flowStatusCoreDtos.flowEntityCoreDtos"
item=
"flowEntityCoreDto"
separator=
" or "
open=
"("
close=
")"
>
flow_name = #{flowEntityCoreDto.flowName} and schedule_type = #{flowEntityCoreDto.scheduleType}
</foreach>
)
<where>
<if
test=
"flowStatusCoreDtos != null"
>
<foreach
collection=
"flowStatusCoreDtos.flowEntityCoreDtos"
item=
"flowEntityCoreDto"
separator=
" or "
open=
"("
close=
")"
>
flow_name = #{flowEntityCoreDto.flowName} and schedule_type = #{flowEntityCoreDto.scheduleType}
</foreach>
and workspace_id = #{flowStatusCoreDtos.workspaceId}
</if>
</if>
</where>
</select>
<select
id=
"findByRunIdAndFlowName"
resultMap=
"BaseResultMap"
>
...
...
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