Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzwf
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzwf
提交
7db376d8
提交
7db376d8
编写于
4月 07, 2021
作者:
zhouweidong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
工作流启动
上级
a0fcf3c4
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
75 行增加
和
0 行删除
+75
-0
WFCoreService.java
...izlab/core/workflow/extensions/service/WFCoreService.java
+59
-0
WFCoreResource.java
...n/java/cn/ibizlab/api/rest/extensions/WFCoreResource.java
+16
-0
未找到文件。
ibzwf-core/src/main/java/cn/ibizlab/core/workflow/extensions/service/WFCoreService.java
浏览文件 @
7db376d8
...
@@ -7,6 +7,7 @@ import cn.ibizlab.core.workflow.mapper.WFCoreMapper;
...
@@ -7,6 +7,7 @@ import cn.ibizlab.core.workflow.mapper.WFCoreMapper;
import
cn.ibizlab.core.workflow.service.IWFGroupService
;
import
cn.ibizlab.core.workflow.service.IWFGroupService
;
import
cn.ibizlab.core.workflow.service.IWFProcessDefinitionService
;
import
cn.ibizlab.core.workflow.service.IWFProcessDefinitionService
;
import
cn.ibizlab.core.workflow.service.IWFUserService
;
import
cn.ibizlab.core.workflow.service.IWFUserService
;
import
cn.ibizlab.util.client.IBZRTProxyFeignClient
;
import
cn.ibizlab.util.client.IBZUAAFeignClient
;
import
cn.ibizlab.util.client.IBZUAAFeignClient
;
import
cn.ibizlab.util.enums.ProcFunction
;
import
cn.ibizlab.util.enums.ProcFunction
;
import
cn.ibizlab.util.enums.TaskType
;
import
cn.ibizlab.util.enums.TaskType
;
...
@@ -134,6 +135,9 @@ public class WFCoreService
...
@@ -134,6 +135,9 @@ public class WFCoreService
@Autowired
@Autowired
private
IBZUAAFeignClient
ibzuaaFeignClient
;
private
IBZUAAFeignClient
ibzuaaFeignClient
;
@Autowired
private
IBZRTProxyFeignClient
rtProxy
;
private
Map
<
String
,
List
<
Map
<
String
,
Object
>>>
taskMap
=
new
ConcurrentHashMap
<>();
private
Map
<
String
,
List
<
Map
<
String
,
Object
>>>
taskMap
=
new
ConcurrentHashMap
<>();
private
final
ExpressionParser
parser
=
new
SpelExpressionParser
();
private
final
ExpressionParser
parser
=
new
SpelExpressionParser
();
...
@@ -167,6 +171,59 @@ public class WFCoreService
...
@@ -167,6 +171,59 @@ 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
(
"获取动态模型标识失败"
,
""
,
""
);
}
return
StringUtils
.
isEmpty
(
dynaModelId
)?
new
ArrayList
<>()
:
wfModelService
.
getDynamicWorkflow
(
dynaModelId
,
system
,
entity
);
}
public
List
<
WFProcessDefinition
>
getDynamicWorkflow
(
String
module
,
String
moduletag
,
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
(
module
,
moduletag
,
orgId
,
systemId
);
if
(
StringUtils
.
isEmpty
(
dynaModelId
)){
throw
new
BadRequestAlertException
(
"获取动态模型标识失败"
,
""
,
""
);
}
return
StringUtils
.
isEmpty
(
dynaModelId
)?
new
ArrayList
<>()
:
wfModelService
.
getDynamicWorkflow
(
dynaModelId
,
system
,
entity
);
}
public
List
<
WFProcessDefinition
>
getWorkflow
(
String
system
,
String
appname
,
String
entity
)
{
public
List
<
WFProcessDefinition
>
getWorkflow
(
String
system
,
String
appname
,
String
entity
)
{
return
wfModelService
.
getWorkflow
(
system
,
entity
);
return
wfModelService
.
getWorkflow
(
system
,
entity
);
}
}
...
@@ -1086,6 +1143,8 @@ public class WFCoreService
...
@@ -1086,6 +1143,8 @@ public class WFCoreService
String
processDefinitionKey
;
String
processDefinitionKey
;
if
(!
StringUtils
.
isEmpty
(
dynainstid
))
if
(!
StringUtils
.
isEmpty
(
dynainstid
))
processDefinitionKey
=
"dyna-"
+
dynainstid
+
"-"
+
system
+
"-"
+
booking
+
"-"
+
params
[
1
];
processDefinitionKey
=
"dyna-"
+
dynainstid
+
"-"
+
system
+
"-"
+
booking
+
"-"
+
params
[
1
];
else
if
(!
StringUtils
.
isEmpty
(
bpmnFileName
)
&&
bpmnFileName
.
contains
(
":"
)
&&
bpmnFileName
.
split
(
":"
).
length
==
2
)
processDefinitionKey
=
"dyna-"
+
bpmnFileName
.
split
(
":"
)[
1
]+
"-"
+
system
+
"-"
+
booking
+
"-"
+
params
[
1
];
else
else
processDefinitionKey
=
system
+
"-"
+
booking
+
"-"
+
params
[
1
];
processDefinitionKey
=
system
+
"-"
+
booking
+
"-"
+
params
[
1
];
...
...
ibzwf-provider/ibzwf-provider-api/src/main/java/cn/ibizlab/api/rest/extensions/WFCoreResource.java
浏览文件 @
7db376d8
...
@@ -47,6 +47,22 @@ public class WFCoreResource
...
@@ -47,6 +47,22 @@ public class WFCoreResource
@Lazy
@Lazy
public
WFTaskMapping
wfTaskMapping
;
public
WFTaskMapping
wfTaskMapping
;
@ApiOperation
(
value
=
"getWFProcessDefinition"
,
tags
=
{
"WFProcessDefinition"
},
notes
=
"根据系统实体查找当前适配的工作流模型"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/{system}-app-{appname}/{entity}/process-definitions2"
)
public
ResponseEntity
<
List
<
WFProcessDefinition
>>
getDynaWorkflow
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"appname"
)
String
appname
,
@PathVariable
(
"entity"
)
String
entity
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
wfCoreService
.
getDynamicWorkflow
(
system
,
appname
,
entity
));
}
@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
,
@PathVariable
(
"entity"
)
String
entity
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
wfCoreService
.
getDynamicWorkflow
(
module
,
moduletag
,
system
,
appname
,
entity
));
}
@ApiOperation
(
value
=
"getWFProcessDefinition"
,
tags
=
{
"WFProcessDefinition"
},
notes
=
"根据动态实例查找当前适配的工作流模型"
)
@ApiOperation
(
value
=
"getWFProcessDefinition"
,
tags
=
{
"WFProcessDefinition"
},
notes
=
"根据动态实例查找当前适配的工作流模型"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/{system}-app-{appname}/{dynainstid}/{entity}/process-definitions"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/{system}-app-{appname}/{dynainstid}/{entity}/process-definitions"
)
public
ResponseEntity
<
List
<
WFProcessDefinition
>>
getDynaWorkflow
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"appname"
)
String
appname
,
@PathVariable
(
"dynainstid"
)
String
dynainstid
,
public
ResponseEntity
<
List
<
WFProcessDefinition
>>
getDynaWorkflow
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"appname"
)
String
appname
,
@PathVariable
(
"dynainstid"
)
String
dynainstid
,
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录