Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzwf
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzwf
提交
f41efe4b
提交
f41efe4b
编写于
4月 08, 2021
作者:
zhouweidong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
动态实例标记
上级
3db5640e
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
35 行增加
和
42 行删除
+35
-42
WFCoreService.java
...izlab/core/workflow/extensions/service/WFCoreService.java
+20
-27
WFCoreResource.java
...n/java/cn/ibizlab/api/rest/extensions/WFCoreResource.java
+15
-15
未找到文件。
ibzwf-core/src/main/java/cn/ibizlab/core/workflow/extensions/service/WFCoreService.java
浏览文件 @
f41efe4b
...
...
@@ -172,33 +172,12 @@ public class WFCoreService
public
List
<
WFProcessDefinition
>
getDynamicWorkflow
(
String
system
,
String
appname
,
String
entity
)
{
String
orgId
=
null
;
String
systemId
=
null
;
if
(
RequestContextHolder
.
getRequestAttributes
()==
null
&&
!(
RequestContextHolder
.
getRequestAttributes
()
instanceof
ServletRequestAttributes
)){
return
null
;
}
ServletRequestAttributes
requestAttributes
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
if
(
requestAttributes
!=
null
)
{
HttpServletRequest
request
=
requestAttributes
.
getRequest
();
if
(
request
!=
null
&&
!
StringUtils
.
isEmpty
(
request
.
getHeader
(
"srforgid"
))){
orgId
=
request
.
getHeader
(
"srforgid"
);
}
if
(
request
!=
null
&&
!
StringUtils
.
isEmpty
(
request
.
getHeader
(
"srfsystemid"
))){
systemId
=
request
.
getHeader
(
"srfsystemid"
);
}
}
if
(
StringUtils
.
isEmpty
(
orgId
)
||
StringUtils
.
isEmpty
(
systemId
)){
throw
new
BadRequestAlertException
(
"无法获取当前用户组织及系统信息"
,
""
,
""
);
}
String
dynaModelId
=
rtProxy
.
getDynaModelId
(
orgId
,
systemId
);
if
(
StringUtils
.
isEmpty
(
dynaModelId
)){
throw
new
BadRequestAlertException
(
"获取动态模型标识失败"
,
""
,
""
);
}
String
dynaModelId
=
getDynaModelId
(
null
,
null
);
return
StringUtils
.
isEmpty
(
dynaModelId
)?
new
ArrayList
<>()
:
wfModelService
.
getDynamicWorkflow
(
dynaModelId
,
system
,
entity
);
}
p
ublic
List
<
WFProcessDefinition
>
getDynamicWorkflow
(
String
module
,
String
moduletag
,
String
system
,
String
appname
,
String
entity
)
{
p
rivate
String
getDynaModelId
(
String
instTag
,
String
instTag2
)
{
String
orgId
=
null
;
String
systemId
=
null
;
if
(
RequestContextHolder
.
getRequestAttributes
()==
null
&&
!(
RequestContextHolder
.
getRequestAttributes
()
instanceof
ServletRequestAttributes
)){
...
...
@@ -217,10 +196,22 @@ public class WFCoreService
if
(
StringUtils
.
isEmpty
(
orgId
)
||
StringUtils
.
isEmpty
(
systemId
)){
throw
new
BadRequestAlertException
(
"无法获取当前用户组织及系统信息"
,
""
,
""
);
}
String
dynaModelId
=
rtProxy
.
getDynaModelId
(
module
,
moduletag
,
orgId
,
systemId
);
String
dynaModelId
=
null
;
if
(
StringUtils
.
isEmpty
(
instTag
)
&&
StringUtils
.
isEmpty
(
instTag2
)){
dynaModelId
=
rtProxy
.
getDynaModelId
(
orgId
,
systemId
);
}
else
{
dynaModelId
=
rtProxy
.
getDynaModelId
(
instTag
,
instTag2
,
orgId
,
systemId
);
}
if
(
StringUtils
.
isEmpty
(
dynaModelId
)){
throw
new
BadRequestAlertException
(
"获取动态模型标识失败"
,
""
,
""
);
}
return
dynaModelId
;
}
public
List
<
WFProcessDefinition
>
getDynamicWorkflow
(
String
instTag
,
String
instTag2
,
String
system
,
String
appname
,
String
entity
)
{
String
dynaModelId
=
getDynaModelId
(
instTag
,
instTag2
);
return
StringUtils
.
isEmpty
(
dynaModelId
)?
new
ArrayList
<>()
:
wfModelService
.
getDynamicWorkflow
(
dynaModelId
,
system
,
entity
);
}
...
...
@@ -464,16 +455,18 @@ public class WFCoreService
return
""
;
}
public
Map
<
String
,
Map
<
String
,
Object
>>
getDynaBusinessKeys
(
String
system
,
String
appname
,
String
entity
,
String
dynainstid
,
String
userId
,
TaskType
type
)
{
public
Map
<
String
,
Map
<
String
,
Object
>>
getDynaBusinessKeys
(
String
system
,
String
appname
,
String
entity
,
String
instTag
,
String
instTag2
,
String
userId
,
TaskType
type
)
{
Map
<
String
,
Map
<
String
,
Object
>>
businessKeys
=
new
HashMap
<>();
Page
<
WFTask
>
tasks
;
if
(
StringUtils
.
isEmpty
(
userId
))
userId
=
AuthenticationUser
.
getAuthenticationUser
().
getUserid
();
if
(
StringUtils
.
isEmpty
(
userId
)
&&
StringUtils
.
isEmpty
(
dynainstid
))
String
dynaModelId
=
getDynaModelId
(
instTag
,
instTag2
);
if
(
StringUtils
.
isEmpty
(
userId
)
&&
StringUtils
.
isEmpty
(
dynaModelId
))
return
businessKeys
;
WFTaskSearchContext
context
=
new
WFTaskSearchContext
();
List
<
String
>
keys
=
this
.
getDynaWorkflowKey
(
dyna
insti
d
,
system
,
appname
,
entity
);
List
<
String
>
keys
=
this
.
getDynaWorkflowKey
(
dyna
ModelI
d
,
system
,
appname
,
entity
);
if
(
ObjectUtils
.
isEmpty
(
keys
)){
return
businessKeys
;
}
...
...
ibzwf-provider/ibzwf-provider-api/src/main/java/cn/ibizlab/api/rest/extensions/WFCoreResource.java
浏览文件 @
f41efe4b
...
...
@@ -55,10 +55,10 @@ public class WFCoreResource
}
@ApiOperation
(
value
=
"getWFProcessDefinition"
,
tags
=
{
"WFProcessDefinition"
},
notes
=
"根据动态实例查找当前适配的工作流模型"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/{system}-app-{appname}/{
module}/{moduletag
}/{entity}/process-definitions"
)
public
ResponseEntity
<
List
<
WFProcessDefinition
>>
getDynaWorkflow2
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"appname"
)
String
appname
,
@PathVariable
(
"
module"
)
String
module
,
@PathVariable
(
"moduletag"
)
String
moduletag
,
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/{system}-app-{appname}/{
insttag}/{insttag2
}/{entity}/process-definitions"
)
public
ResponseEntity
<
List
<
WFProcessDefinition
>>
getDynaWorkflow2
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"appname"
)
String
appname
,
@PathVariable
(
"
insttag"
)
String
instTag
,
@PathVariable
(
"insttag2"
)
String
instTag2
,
@PathVariable
(
"entity"
)
String
entity
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
wfCoreService
.
getDynamicWorkflow
(
module
,
moduletag
,
system
,
appname
,
entity
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
wfCoreService
.
getDynamicWorkflow
(
instTag
,
instTag2
,
system
,
appname
,
entity
));
}
...
...
@@ -71,31 +71,31 @@ public class WFCoreResource
}
@ApiOperation
(
value
=
"getBusinessKeys"
,
tags
=
{
"String"
},
notes
=
"根据动态实例查询我的待办主键清单"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/{system}-user-{userId}/{
dynainstid
}/{entity}/tasks"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/{system}-user-{userId}/{
insttag}/{insttag2
}/{entity}/tasks"
)
public
ResponseEntity
<
Map
<
String
,
Map
<
String
,
Object
>>>
getTaskByUserId
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"userId"
)
String
userId
,
@PathVariable
(
"entity"
)
String
entity
,
@PathVariable
(
"
dynainstid"
)
String
dynainstid
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
wfCoreService
.
getDynaBusinessKeys
(
system
,
""
,
entity
,
dynainstid
,
userId
,
TaskType
.
WORK
));
@PathVariable
(
"entity"
)
String
entity
,
@PathVariable
(
"
insttag"
)
String
instTag
,
@PathVariable
(
"insttag2"
)
String
instTag2
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
wfCoreService
.
getDynaBusinessKeys
(
system
,
""
,
entity
,
instTag
,
instTag2
,
userId
,
TaskType
.
WORK
));
}
@ApiOperation
(
value
=
"getBusinessKeys"
,
tags
=
{
"String"
},
notes
=
"根据流程步骤查询我的待阅主键清单"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/{system}-user-{userId}/{
dynainstid
}/{entity}/tasks/unread"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/{system}-user-{userId}/{
insttag}/{insttag2
}/{entity}/tasks/unread"
)
public
ResponseEntity
<
Map
<
String
,
Map
<
String
,
Object
>>>
getUnReadTaskByUserId
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"userId"
)
String
userId
,
@PathVariable
(
"entity"
)
String
entity
,
@PathVariable
(
"
dynainstid"
)
String
dynainstid
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
wfCoreService
.
getDynaBusinessKeys
(
system
,
""
,
entity
,
dynainstid
,
userId
,
TaskType
.
READ
));
@PathVariable
(
"entity"
)
String
entity
,
@PathVariable
(
"
insttag"
)
String
instTag
,
@PathVariable
(
"insttag2"
)
String
instTag2
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
wfCoreService
.
getDynaBusinessKeys
(
system
,
""
,
entity
,
instTag
,
instTag2
,
userId
,
TaskType
.
READ
));
}
@ApiOperation
(
value
=
"getBusinessKeys"
,
tags
=
{
"String"
},
notes
=
"根据流程步骤查询我的已办主键清单"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/{system}-user-{userId}/{
dynainstid
}/{entity}/tasks/done"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/{system}-user-{userId}/{
insttag}/{insttag2
}/{entity}/tasks/done"
)
public
ResponseEntity
<
Map
<
String
,
Map
<
String
,
Object
>>>
getDoneByUserId
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"userId"
)
String
userId
,
@PathVariable
(
"entity"
)
String
entity
,
@PathVariable
(
"
dynainstid"
)
String
dynainstid
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
wfCoreService
.
getDynaBusinessKeys
(
system
,
""
,
entity
,
dynainstid
,
userId
,
TaskType
.
DONE
));
@PathVariable
(
"entity"
)
String
entity
,
@PathVariable
(
"
insttag"
)
String
instTag
,
@PathVariable
(
"insttag2"
)
String
instTag2
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
wfCoreService
.
getDynaBusinessKeys
(
system
,
""
,
entity
,
instTag
,
instTag2
,
userId
,
TaskType
.
DONE
));
}
@ApiOperation
(
value
=
"getBusinessKeys"
,
tags
=
{
"String"
},
notes
=
"根据流程步骤查询我的办结主键清单"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/{system}-user-{userId}/{
dynainstid
}/{entity}/tasks/finish"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/{system}-user-{userId}/{
insttag}/{insttag2
}/{entity}/tasks/finish"
)
public
ResponseEntity
<
Map
<
String
,
Map
<
String
,
Object
>>>
getFinishByUserId
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"userId"
)
String
userId
,
@PathVariable
(
"entity"
)
String
entity
,
@PathVariable
(
"
dynainstid"
)
String
dynainstid
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
wfCoreService
.
getDynaBusinessKeys
(
system
,
""
,
entity
,
dynainstid
,
userId
,
TaskType
.
FINISH
));
@PathVariable
(
"entity"
)
String
entity
,
@PathVariable
(
"
insttag"
)
String
instTag
,
@PathVariable
(
"insttag2"
)
String
instTag2
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
wfCoreService
.
getDynaBusinessKeys
(
system
,
""
,
entity
,
instTag
,
instTag2
,
userId
,
TaskType
.
FINISH
));
}
@ApiOperation
(
value
=
"标记任务已读"
,
tags
=
{
"工作流标记任务已读"
},
notes
=
"标记任务已读"
)
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录