Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzwf
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzwf
提交
61b5dcea
提交
61b5dcea
编写于
3月 29, 2021
作者:
lengyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
工作流辅助功能(加签、转办、回退)
上级
c4f13d71
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
107 行增加
和
123 行删除
+107
-123
WFCoreService.java
...izlab/core/workflow/extensions/service/WFCoreService.java
+100
-109
ProcFunction.java
...til/src/main/java/cn/ibizlab/util/enums/ProcFunction.java
+7
-14
未找到文件。
ibzwf-core/src/main/java/cn/ibizlab/core/workflow/extensions/service/WFCoreService.java
浏览文件 @
61b5dcea
...
...
@@ -546,7 +546,7 @@ public class WFCoreService
//加签逻辑
String
procFuncs
=
getParam
(
userTask
,
"form"
,
"procfunc"
);
if
(
DelegationState
.
PENDING
==
task
.
getDelegationState
()
&&
userId
.
equals
(
task
.
getAssignee
())
&&
!
StringUtils
.
isEmpty
(
procFuncs
)
&&
procFuncs
.
contains
(
ProcFunction
.
BEFORESIGN
.
value
)){
&&
!
StringUtils
.
isEmpty
(
procFuncs
)
&&
procFuncs
.
contains
(
ProcFunction
.
ADDSTEPBEFORE
.
value
)){
WFTaskWay
way
=
getFuncWay
(
task
,
ProcFunction
.
FINISH
.
value
);
if
(
way
!=
null
)
taskWays
.
add
(
way
);
...
...
@@ -630,33 +630,29 @@ public class WFCoreService
}
/**
* 流程辅助功能连接
* 流程辅助功能连接
(通过type区分预定义行为与标准行为)
* @param funcType
* @return
*/
public
WFTaskWay
getFuncWay
(
Task
task
,
String
funcType
){
WFTaskWay
way
=
new
WFTaskWay
();
if
(
funcType
.
equals
(
ProcFunction
.
ROLLBACK
.
value
)){
way
.
set
(
"type"
,
ProcFunction
.
ROLLBACK
.
value
);
way
.
setSequenceflowname
(
ProcFunction
.
ROLLBACK
.
text
);
}
else
if
(
funcType
.
equals
(
ProcFunction
.
BEFORESIGN
.
value
)){
way
.
set
(
"type"
,
ProcFunction
.
BEFORESIGN
.
value
);
way
.
setSequenceflowname
(
ProcFunction
.
BEFORESIGN
.
text
);
}
else
if
(
funcType
.
equals
(
ProcFunction
.
TRANSFER
.
value
)){
way
.
set
(
"type"
,
ProcFunction
.
TRANSFER
.
value
);
way
.
setSequenceflowname
(
ProcFunction
.
TRANSFER
.
text
);
}
else
if
(
funcType
.
equals
(
ProcFunction
.
FINISH
.
value
)){
way
.
set
(
"type"
,
ProcFunction
.
FINISH
.
value
);
way
.
setSequenceflowname
(
ProcFunction
.
FINISH
.
text
);
}
else
{
WFTaskWay
way
=
null
;
try
{
if
(!
StringUtils
.
isEmpty
(
funcType
)){
ProcFunction
function
=
ProcFunction
.
valueOf
(
funcType
.
toUpperCase
());
if
(
function
!=
null
){
if
(
function
==
ProcFunction
.
ADDSTEPAFTER
){
function
=
ProcFunction
.
TRANSFER
;
}
way
=
new
WFTaskWay
();
way
.
set
(
"type"
,
function
.
value
);
way
.
setSequenceflowname
(
function
.
text
);
way
.
setTaskid
(
task
.
getId
());
way
.
setTaskdefinitionkey
(
task
.
getTaskDefinitionKey
());
}
}
}
catch
(
IllegalArgumentException
e
)
{
return
null
;
}
way
.
setTaskid
(
task
.
getId
());
way
.
setTaskdefinitionkey
(
task
.
getTaskDefinitionKey
());
return
way
;
}
...
...
@@ -1374,6 +1370,88 @@ public class WFCoreService
return
strUsers
;
}
/**
* 获取工作流角色成员
* @param groupIds
* @param delegateExecution
* @return
*/
public
Set
<
WFMember
>
getGroupUsers2
(
String
groupIds
,
DelegateExecution
delegateExecution
)
{
Set
<
String
>
orgList
=
new
HashSet
<>();
Set
<
String
>
deptList
=
new
HashSet
<>();
Set
<
WFMember
>
memberList
=
new
HashSet
<>();
Object
activedata
=
delegateExecution
.
getVariable
(
"activedata"
);
if
(
delegateExecution
==
null
||
activedata
==
null
){
throw
new
BadRequestAlertException
(
"获取业务数据失败"
,
""
,
""
);
}
if
(
StringUtils
.
isEmpty
(
groupIds
))
throw
new
BadRequestAlertException
(
"当前步骤未配置用户组"
,
""
,
""
);
String
[]
groups
=
groupIds
.
split
(
","
);
for
(
String
groupId:
groups
)
{
String
userData
=
""
;
String
userData2
=
""
;
if
(
groupId
.
indexOf
(
"|"
)>
0
)
{
String
[]
arg
=
groupId
.
split
(
"[|]"
);
if
(
arg
.
length
==
3
)
{
groupId
=
arg
[
0
];
if
(
arg
[
1
]!=
null
)
userData
=
arg
[
1
].
toLowerCase
();
if
(
arg
[
2
]!=
null
)
userData2
=
arg
[
2
].
toLowerCase
();
}
}
if
((!
StringUtils
.
isEmpty
(
userData
))&&(!
StringUtils
.
isEmpty
(
userData2
)))
{
for
(
String
field
:
userData2
.
split
(
";"
)){
Object
fieldvalue
=
null
;
if
(
field
.
indexOf
(
"srf"
)==
0
)
{
FlowUser
curUser
=
FlowUser
.
getCurUser
();
if
(
curUser
!=
null
&&
curUser
.
getUser
()!=
null
){
fieldvalue
=
curUser
.
getUser
().
getSessionParams
().
get
(
field
);
}
}
else
{
if
(
activedata
instanceof
Map
)
{
fieldvalue
=
((
Map
)
activedata
).
get
(
field
);
}
}
if
(
fieldvalue
!=
null
){
if
(
"org"
.
equals
(
userData
)){
orgList
.
addAll
(
Arrays
.
asList
(
String
.
valueOf
(
fieldvalue
).
split
(
";"
)));
}
else
if
(
"dept"
.
equals
(
userData
)){
deptList
.
addAll
(
Arrays
.
asList
(
String
.
valueOf
(
fieldvalue
).
split
(
";"
)));
}
}
}
}
WFGroup
group
=
iwfGroupService
.
get
(
groupId
);
List
<
WFMember
>
list
=
group
.
getWfmember
();
if
(
list
!=
null
)
{
for
(
WFMember
member
:
list
)
{
String
orgId
=
member
.
getOrgid
();
String
deptId
=
member
.
getMdeptid
();
if
(
ObjectUtils
.
isEmpty
(
orgList
)
&&
ObjectUtils
.
isEmpty
(
deptList
)){
memberList
.
add
(
member
);
}
else
{
if
((!
ObjectUtils
.
isEmpty
(
orgId
)
&&
orgList
.
contains
(
orgId
))
||
(!
ObjectUtils
.
isEmpty
(
deptId
)
&&
deptList
.
contains
(
deptId
))){
memberList
.
add
(
member
);
}
}
}
}
}
return
memberList
;
}
/**
* 后加签 (转办-工作转移)
...
...
@@ -1448,93 +1526,6 @@ public class WFCoreService
return
true
;
}
/**
* 返回组成员,用于多实例会签( wfroleid = groupid +deptid )
* @param groupIds
* @param delegateExecution
* @return
*/
public
List
<
WFMember
>
getGroupUsers2
(
String
groupIds
,
DelegateExecution
delegateExecution
)
{
List
<
WFMember
>
users
=
new
ArrayList
<>();
if
(
StringUtils
.
isEmpty
(
groupIds
))
return
users
;
String
[]
groups
=
groupIds
.
split
(
","
);
for
(
String
groupId:
groups
)
{
String
userData
=
""
;
String
userData2
=
""
;
String
orgid
=
""
;
String
deptid
=
""
;
if
(
groupId
.
indexOf
(
"|"
)>
0
)
{
String
[]
arg
=
groupId
.
split
(
"[|]"
);
if
(
arg
.
length
==
3
)
{
groupId
=
arg
[
0
];
if
(
arg
[
1
]!=
null
)
userData
=
arg
[
1
].
toLowerCase
();
if
(
arg
[
2
]!=
null
)
userData2
=
arg
[
2
].
toLowerCase
();
}
}
if
((!
StringUtils
.
isEmpty
(
userData
))&&(!
StringUtils
.
isEmpty
(
userData2
)))
{
if
(
userData2
.
indexOf
(
"srf"
)==
0
)
{
FlowUser
curUser
=
FlowUser
.
getCurUser
();
if
(
curUser
!=
null
&&
curUser
.
getUser
()!=
null
)
{
Object
sessionValue
=
curUser
.
getUser
().
getSessionParams
().
get
(
userData2
);
if
(
sessionValue
!=
null
)
userData2
=
sessionValue
.
toString
();
else
userData2
=
""
;
}
else
userData2
=
""
;
}
else
{
Object
activedata
=
delegateExecution
.
getVariable
(
"activedata"
);
if
(
activedata
!=
null
&&
activedata
instanceof
Map
)
{
Map
entity
=
(
Map
)
activedata
;
if
(
entity
.
get
(
userData2
)!=
null
)
userData2
=
entity
.
get
(
userData2
).
toString
();
else
userData2
=
""
;
}
else
userData2
=
""
;
}
if
(!
StringUtils
.
isEmpty
(
userData2
))
{
if
(
userData
.
indexOf
(
"dept"
)>=
0
||
userData
.
indexOf
(
"orgsec"
)>=
0
)
deptid
=
userData2
;
else
if
(
userData
.
indexOf
(
"org"
)>=
0
)
orgid
=
userData2
;
}
}
WFGroup
group
=
iwfGroupService
.
get
(
groupId
);
List
<
WFMember
>
list
=
group
.
getWfmember
();
if
(
list
!=
null
)
{
for
(
WFMember
member
:
list
)
{
if
((!
StringUtils
.
isEmpty
(
deptid
))&&(!
deptid
.
equals
(
member
.
getMdeptid
())))
continue
;
if
((!
StringUtils
.
isEmpty
(
orgid
))&&(!
orgid
.
equals
(
member
.
getOrgid
())))
continue
;
users
.
add
(
member
);
}
}
}
return
users
;
}
private
ByteArrayOutputStream
getBpmnFile
(
InputStream
input
)
{
try
{
ByteArrayOutputStream
baos
=
new
ByteArrayOutputStream
();
...
...
ibzwf-util/src/main/java/cn/ibizlab/util/enums/ProcFunction.java
浏览文件 @
61b5dcea
...
...
@@ -4,21 +4,14 @@ package cn.ibizlab.util.enums;
* 工作流辅助功能
*/
public
enum
ProcFunction
{
/**
* 退回
*/
ROLLBACK
(
"rollback"
,
"退回"
),
/**
* 前加签
*/
BEFORESIGN
(
"beforesign"
,
"前加签"
),
/**
* 转办
*/
SENDBACK
(
"sendback"
,
"退回"
),
SUPPLYINFO
(
"supplyinfo"
,
"补充信息"
),
ADDSTEPBEFORE
(
"addstepbefore"
,
"前加签"
),
ADDSTEPAFTER
(
"addstepafter"
,
"后加签"
),
TAKEADVICE
(
"takeadvice"
,
"征求意见"
),
SENDCOPY
(
"sendcopy"
,
"抄送"
),
TRANSFER
(
"transfer"
,
"转办"
),
/**
* 加签完成
*/
FINISH
(
"finish"
,
"完成"
);
ProcFunction
(
String
value
,
String
text
)
{
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录