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
4b320574
Commit
4b320574
authored
Mar 12, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加完结工作流的时间信息和事件监听
parent
231461e7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
0 deletions
+65
-0
EndFlowEvent.java
...admin-core/src/main/java/com/byit/event/EndFlowEvent.java
+27
-0
FlowEventListener.java
...re/src/main/java/com/byit/listener/FlowEventListener.java
+38
-0
No files found.
byit-myth-core/myth-admin-core/src/main/java/com/byit/event/EndFlowEvent.java
0 → 100644
View file @
4b320574
package
com
.
byit
.
event
;
import
org.springframework.context.ApplicationEvent
;
/**
* 完结工作流的事件
* @author huangfu
*/
public
class
EndFlowEvent
extends
ApplicationEvent
{
private
Integer
flowId
;
/**
* 创建工作流完结的事件
*
* @param source the object on which the event initially occurred (never {@code null})
* @param flowId 工作流id
*/
public
EndFlowEvent
(
Object
source
,
Integer
flowId
)
{
super
(
source
);
this
.
flowId
=
flowId
;
}
public
Integer
getFlowId
()
{
return
flowId
;
}
}
byit-myth-core/myth-admin-core/src/main/java/com/byit/listener/FlowEventListener.java
0 → 100644
View file @
4b320574
package
com
.
byit
.
listener
;
import
com.byit.enums.FlowPropertyEnum
;
import
com.byit.event.EndFlowEvent
;
import
com.byit.model.Flow
;
import
com.byit.service.FlowService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.context.event.EventListener
;
import
org.springframework.stereotype.Component
;
/**
* 工作流的事件监听操作
* @author huangfu
*/
@Component
@Slf4j
public
class
FlowEventListener
{
private
final
FlowService
flowService
;
public
FlowEventListener
(
FlowService
flowService
)
{
this
.
flowService
=
flowService
;
}
/**
* 工作流完成事件监听
* @param endFlowEvent 事件信息
*/
@EventListener
public
void
flowEndEvent
(
EndFlowEvent
endFlowEvent
){
log
.
info
(
"-----------监听到事件{},工作流实例完成事件-------"
,
endFlowEvent
);
Flow
flow
=
Flow
.
builder
()
.
flowId
(
endFlowEvent
.
getFlowId
())
.
scanMark
(
FlowPropertyEnum
.
SCAN
.
getCode
())
.
build
();
flowService
.
updateByIdSelective
(
flow
);
}
}
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