Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzwf
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzwf
提交
c231f6ec
提交
c231f6ec
编写于
4月 01, 2021
作者:
zhouweidong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
工作流抄送
上级
f7d86193
变更
2
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
30 行增加
和
36 行删除
+30
-36
ProcessInstanceListener.java
...workflow/extensions/listener/ProcessInstanceListener.java
+24
-27
WFCoreService.java
...izlab/core/workflow/extensions/service/WFCoreService.java
+6
-9
未找到文件。
ibzwf-core/src/main/java/cn/ibizlab/core/workflow/extensions/listener/ProcessInstanceListener.java
浏览文件 @
c231f6ec
...
...
@@ -27,6 +27,7 @@ import org.flowable.identitylink.api.IdentityLinkType;
import
org.flowable.identitylink.service.impl.persistence.entity.IdentityLinkEntity
;
import
org.flowable.task.api.Task
;
import
org.flowable.task.service.impl.persistence.entity.TaskEntity
;
import
org.flowable.task.service.impl.persistence.entity.TaskEntityImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.context.expression.MapAccessor
;
...
...
@@ -286,7 +287,7 @@ public class ProcessInstanceListener extends AbstractFlowableEventListener {
}
}
}
else
if
(
evt
instanceof
FlowableEntityEventImpl
&&
evt
.
getType
()
!=
null
&&
FlowableEngineEventType
.
PROCESS_COMPLETED
==
evt
.
getType
()
)
else
if
(
evt
instanceof
FlowableEntityEventImpl
&&
evt
.
getType
()
!=
null
&&
FlowableEngineEventType
.
PROCESS_COMPLETED
==
evt
.
getType
())
{
FlowableEntityEventImpl
event
=((
FlowableEntityEventImpl
)
evt
);
FlowableEventType
eventType
=
event
.
getType
();
...
...
@@ -322,33 +323,29 @@ public class ProcessInstanceListener extends AbstractFlowableEventListener {
}
}
else
if
(
evt
instanceof
FlowableActivityEventImpl
)
{
else
if
(
evt
instanceof
FlowableActivityEventImpl
&&
evt
.
getType
()
!=
null
&&
FlowableEngineEventType
.
ACTIVITY_COMPLETED
==
evt
.
getType
()
)
{
FlowableActivityEventImpl
event
=
((
FlowableActivityEventImpl
)
evt
);
FlowableEventType
eventType
=
event
.
getType
();
if
(
eventType
==
FlowableEngineEventType
.
ACTIVITY_COMPLETED
&&
"userTask"
.
equals
(
event
.
getActivityType
()))
{
if
(
event
.
getExecution
().
getCurrentFlowElement
()
instanceof
UserTask
)
{
UserTask
task
=
(
UserTask
)
event
.
getExecution
().
getCurrentFlowElement
();
List
<
Task
>
exTask
=
taskService
.
createTaskQuery
().
processInstanceId
(
event
.
getProcessInstanceId
()).
list
();
String
sendCopyTag
=
wfCoreService
.
getParam
(
task
,
"form"
,
"procfunc"
);
if
(
sendCopyTag
.
contains
(
"sendcopy"
)){
// 从模板中读取抄送人名单
String
sendCopyUserList
=
wfCoreService
.
getParam
(
task
,
"form"
,
"senduser"
);
if
(
StringUtils
.
isEmpty
(
sendCopyUserList
)){
throw
new
BadRequestAlertException
(
"获取节点抄送用户失败"
,
""
,
""
);
}
String
userIds
=
wfCoreService
.
getGroupUsers
(
sendCopyUserList
,
event
.
getExecution
());
TaskEntity
sendCopyTask
=
null
;
if
(
exTask
.
size
()>
0
){
sendCopyTask
=
wfCoreService
.
createTask
(
exTask
.
get
(
0
));
String
procFunc
=
wfCoreService
.
getParam
(
task
,
"form"
,
"procfunc"
);
if
(!
StringUtils
.
isEmpty
(
procFunc
)
&&
procFunc
.
contains
(
"sendcopy"
))
{
String
sendCopyRoles
=
wfCoreService
.
getParam
(
task
,
"form"
,
"senduser"
);
if
(
StringUtils
.
isEmpty
(
sendCopyRoles
))
{
throw
new
BadRequestAlertException
(
"获取节点抄送用户失败"
,
""
,
""
);
}
TaskEntity
sendCopyTask
=
new
TaskEntityImpl
();
List
<
Task
>
sendCopyTasks
=
taskService
.
createTaskQuery
().
processInstanceId
(
event
.
getProcessInstanceId
()).
list
();
Set
<
WFMember
>
sendCopyUsers
=
wfCoreService
.
getGroupUsers2
(
sendCopyRoles
,
event
.
getExecution
());
if
(
sendCopyTasks
.
size
()
>
0
)
{
sendCopyTask
=
wfCoreService
.
createTask
(
sendCopyTasks
.
get
(
0
));
}
sendCopyTask
.
setId
(
UUID
.
randomUUID
().
toString
().
toLowerCase
());
sendCopyTask
.
setScopeType
(
"sendcopy"
);
taskService
.
saveTask
(
sendCopyTask
);
// 生成待阅抄送给用户
if
(!
StringUtils
.
isEmpty
(
userIds
)){
for
(
String
userid
:
userIds
.
split
(
","
))
{
taskService
.
addUserIdentityLink
(
sendCopyTask
.
getId
(),
userid
,
"sendcopy"
);
}
if
(!
ObjectUtils
.
isEmpty
(
sendCopyUsers
)){
for
(
WFMember
user
:
sendCopyUsers
)
{
taskService
.
addUserIdentityLink
(
sendCopyTask
.
getId
(),
user
.
getUserid
(),
"sendcopy"
);
}
}
}
...
...
ibzwf-core/src/main/java/cn/ibizlab/core/workflow/extensions/service/WFCoreService.java
浏览文件 @
c231f6ec
...
...
@@ -1923,7 +1923,7 @@ public class WFCoreService
List
<
IdentityLink
>
identityLinks
=
taskService
.
getIdentityLinksForTask
(
taskId
);
identityLinks
.
forEach
(
idl
->{
if
(
userId
.
equals
(
idl
.
getUserId
())){
completeSendCopy
(
identityLinks
,
task
,
userId
);
completeSendCopy
Task
(
identityLinks
,
task
);
Map
map
=
new
HashMap
();
map
.
put
(
"taskid"
,
task
.
getId
());
map
.
put
(
"userid"
,
userId
);
...
...
@@ -1938,16 +1938,13 @@ public class WFCoreService
* 判断除了本身其他link是否已读
* @return
*/
public
void
completeSendCopy
(
List
<
IdentityLink
>
identityLinks
,
Task
task
,
String
userId
){
List
<
IdentityLink
>
noReadLinks
=
identityLinks
.
stream
().
filter
(
link
->
StringUtils
.
isEmpty
(
link
.
getScopeType
())).
collect
(
Collectors
.
toList
());
// 全部消息已读之后,将抄送任务推送到history表中
String
type
=
task
.
getScopeType
()
==
null
?
""
:
task
.
getScopeType
();
if
(
type
.
equals
(
"sendcopy"
)
&&
noReadLinks
.
size
()
==
1
){
if
(
noReadLinks
.
get
(
0
).
getUserId
().
equals
(
userId
)){
public
void
completeSendCopyTask
(
List
<
IdentityLink
>
identityLinks
,
Task
task
){
List
<
IdentityLink
>
unReadLinks
=
identityLinks
.
stream
().
filter
(
link
->
StringUtils
.
isEmpty
(
link
.
getScopeType
())).
collect
(
Collectors
.
toList
());
String
scopeType
=
task
.
getScopeType
();
if
(!
StringUtils
.
isEmpty
(
scopeType
)
&&
"sendcopy"
.
equals
(
scopeType
)
&&
unReadLinks
.
size
()
==
1
)
{
taskService
.
complete
(
task
.
getId
());
}
}
}
/**
* @param taskId 当前需要回退的节点
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录