Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzwf
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzwf
提交
5e81e604
提交
5e81e604
编写于
5月 03, 2020
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
工作流编程
上级
77e28278
变更
4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
447 行增加
和
0 行删除
+447
-0
WFCoreService.java
...ava/cn/ibizlab/core/extensions/service/WFCoreService.java
+276
-0
WFModelService.java
...va/cn/ibizlab/core/extensions/service/WFModelService.java
+77
-0
WFCoreResource.java
...n/java/cn/ibizlab/api/rest/extensions/WFCoreResource.java
+80
-0
pom.xml
ibzwf-util/pom.xml
+14
-0
未找到文件。
ibzwf-core/src/main/java/cn/ibizlab/core/extensions/service/WFCoreService.java
0 → 100644
浏览文件 @
5e81e604
package
cn
.
ibizlab
.
core
.
extensions
.
service
;
import
cn.ibizlab.core.workflow.domain.WFProcessDefinition
;
import
cn.ibizlab.core.workflow.domain.WFProcessInstance
;
import
cn.ibizlab.core.workflow.domain.WFProcessNode
;
import
cn.ibizlab.core.workflow.domain.WFTaskWay
;
import
cn.ibizlab.core.workflow.service.IWFProcessDefinitionService
;
import
cn.ibizlab.util.errors.BadRequestAlertException
;
import
cn.ibizlab.util.security.AuthenticationUser
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
org.activiti.api.process.runtime.ProcessRuntime
;
import
org.activiti.api.task.runtime.TaskRuntime
;
import
org.activiti.bpmn.model.FlowElement
;
import
org.activiti.bpmn.model.SequenceFlow
;
import
org.activiti.bpmn.model.UserTask
;
import
org.activiti.engine.HistoryService
;
import
org.activiti.engine.RepositoryService
;
import
org.activiti.engine.RuntimeService
;
import
org.activiti.engine.TaskService
;
import
org.activiti.engine.delegate.DelegateExecution
;
import
org.activiti.engine.impl.identity.Authentication
;
import
org.activiti.engine.repository.ProcessDefinition
;
import
org.activiti.engine.runtime.ProcessInstance
;
import
org.activiti.engine.task.Task
;
import
org.activiti.engine.task.TaskQuery
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.StringUtils
;
import
java.sql.Timestamp
;
import
java.util.*
;
public
class
WFCoreService
{
@Autowired
private
ProcessRuntime
processRuntime
;
@Autowired
private
TaskRuntime
taskRuntime
;
@Autowired
private
RepositoryService
repositoryService
;
@Autowired
private
HistoryService
historyService
;
@Autowired
private
TaskService
taskService
;
@Autowired
private
RuntimeService
runtimeService
;
@Autowired
private
WFModelService
wfModelService
;
public
List
<
WFProcessDefinition
>
getWorkflow
(
String
system
,
String
appname
,
String
entity
)
{
return
wfModelService
.
getWorkflow
(
system
,
entity
);
}
public
List
<
String
>
getWorkflowKey
(
String
system
,
String
appname
,
String
entity
)
{
List
<
String
>
definitionKeys
=
new
ArrayList
<>();
for
(
WFProcessDefinition
wfdef:
wfModelService
.
getWorkflow
(
system
,
entity
))
definitionKeys
.
add
(
wfdef
.
getDefinitionkey
());
return
definitionKeys
;
}
public
List
<
WFProcessNode
>
getWFStep
(
String
system
,
String
appname
,
String
entity
)
{
List
<
WFProcessNode
>
rt
=
new
ArrayList
<>();
for
(
WFProcessDefinition
wfdef:
wfModelService
.
getWorkflow
(
system
,
entity
))
{
LinkedHashMap
<
String
,
UserTask
>
userTasks
=
wfModelService
.
getModelStepByKey
(
wfdef
.
getDefinitionkey
());
for
(
UserTask
userTask:
userTasks
.
values
())
{
WFProcessNode
node
=
new
WFProcessNode
();
node
.
setUsertaskid
(
userTask
.
getId
());
node
.
setUsertaskname
(
userTask
.
getName
());
node
.
setProcessdefinitionkey
(
wfdef
.
getDefinitionkey
());
node
.
setProcessdefinitionname
(
wfdef
.
getDefinitionname
());
rt
.
add
(
node
);
}
}
return
rt
;
}
public
Map
<
String
,
Long
>
getWFStepCnt
(
String
system
,
String
appname
,
String
entity
,
String
processDefinitionKey
,
String
wfstepcode
)
{
Map
<
String
,
Long
>
wfStepCnt
=
new
LinkedHashMap
<
String
,
Long
>();
String
userId
=
AuthenticationUser
.
getAuthenticationUser
().
getUserid
();
if
(
StringUtils
.
isEmpty
(
userId
))
return
wfStepCnt
;
TaskQuery
query
=
taskService
.
createTaskQuery
().
taskCandidateOrAssigned
(
userId
);
if
(!
StringUtils
.
isEmpty
(
processDefinitionKey
))
query
.
processDefinitionKey
(
processDefinitionKey
);
else
{
query
.
processDefinitionKeyIn
(
this
.
getWorkflowKey
(
system
,
appname
,
entity
));
}
if
(!
StringUtils
.
isEmpty
(
wfstepcode
))
{
if
(
wfstepcode
.
indexOf
(
"tid-"
)!=
0
)
{
wfstepcode
=
"tid-"
+
wfstepcode
+
"-"
;
query
.
taskDefinitionKeyLike
(
wfstepcode
);
}
else
query
.
taskDefinitionKey
(
wfstepcode
);
}
Long
total
=
query
.
count
();
if
(
total
==
0
)
return
wfStepCnt
;
if
(!
StringUtils
.
isEmpty
(
wfstepcode
))
{
List
<
Task
>
list
=
query
.
listPage
(
0
,
1
);
if
(
list
.
size
()>
0
)
wfStepCnt
.
put
(
list
.
get
(
0
).
getTaskDefinitionKey
(),
total
);
return
wfStepCnt
;
}
Long
sumstep
=
0L
;
for
(
WFProcessNode
node:
this
.
getWFStep
(
system
,
appname
,
entity
)){
if
((!
StringUtils
.
isEmpty
(
processDefinitionKey
))&&(!
node
.
getProcessdefinitionkey
().
equals
(
processDefinitionKey
)))
continue
;
Long
stepcnt
=
taskService
.
createTaskQuery
().
taskCandidateOrAssigned
(
userId
).
processDefinitionKey
(
node
.
getProcessdefinitionkey
()).
taskDefinitionKey
(
node
.
getUsertaskid
()).
count
();
if
(
stepcnt
>
0
)
wfStepCnt
.
put
(
node
.
getUsertaskid
(),
stepcnt
);
sumstep
+=
stepcnt
;
if
(
sumstep
>=
total
)
break
;
}
return
wfStepCnt
;
}
public
WFProcessInstance
wfStart
(
String
system
,
String
appname
,
String
entity
,
String
businessKey
,
WFProcessInstance
instance
)
{
String
userId
=
AuthenticationUser
.
getAuthenticationUser
().
getUserid
();
if
(
StringUtils
.
isEmpty
(
userId
))
throw
new
BadRequestAlertException
(
"未传入当前用户"
,
entity
,
businessKey
);
String
processDefinitionKey
=
instance
.
getProcessdefinitionkey
();
if
(
StringUtils
.
isEmpty
(
processDefinitionKey
)){
List
<
String
>
definitionKeys
=
this
.
getWorkflowKey
(
system
,
appname
,
entity
);
if
(
definitionKeys
.
size
()==
0
)
throw
new
BadRequestAlertException
(
"未找到对应的工作流配置"
,
entity
,
businessKey
);
processDefinitionKey
=
definitionKeys
.
get
(
0
);
}
String
processInstanceBusinessKey
=
system
+
":"
+
entity
+
":srfkey-"
+
businessKey
;
Map
<
String
,
Object
>
variables
=
new
LinkedHashMap
<>();
variables
.
put
(
"businessKey"
,
businessKey
);
variables
.
put
(
"activedata"
,
instance
.
get
(
"activedata"
));
variables
.
put
(
"curuser"
,
AuthenticationUser
.
getAuthenticationUser
());
variables
.
put
(
"cloud-serviceid"
,
system
+
"-app-"
+
appname
);
variables
.
put
(
"entitys"
,
entity
);
//根据流程定义启动流程
Authentication
.
setAuthenticatedUserId
(
userId
);
ProcessInstance
processInstance
=
runtimeService
.
startProcessInstanceByKey
(
processDefinitionKey
,
processInstanceBusinessKey
,
variables
);
//流程定时标识、业务标识、变量
instance
.
setBusinesskey
(
processInstanceBusinessKey
);
instance
.
setId
(
processInstance
.
getId
());
instance
.
setName
(
processInstance
.
getName
());
instance
.
setProcessdefinitionkey
(
processInstance
.
getProcessDefinitionKey
());
instance
.
setProcessdefinitionname
(
processInstance
.
getProcessDefinitionName
());
if
(
processInstance
.
getStartTime
()!=
null
)
instance
.
setStarttime
(
new
Timestamp
(
processInstance
.
getStartTime
().
getTime
()));
instance
.
setStartuserid
(
processInstance
.
getStartUserId
());
return
instance
;
}
public
List
<
WFTaskWay
>
getWFLink
(
String
system
,
String
appname
,
String
entity
,
String
businessKey
,
String
taskDefinitionKey
)
{
List
<
WFTaskWay
>
taskWays
=
new
ArrayList
<>();
String
processInstanceBusinessKey
=
system
+
":"
+
entity
+
":srfkey-"
+
businessKey
;
String
userId
=
AuthenticationUser
.
getAuthenticationUser
().
getUserid
();
if
(
StringUtils
.
isEmpty
(
userId
))
return
taskWays
;
TaskQuery
query
=
taskService
.
createTaskQuery
().
taskCandidateOrAssigned
(
userId
).
processInstanceBusinessKey
(
processInstanceBusinessKey
);
if
(!
StringUtils
.
isEmpty
(
taskDefinitionKey
))
query
.
taskDefinitionKey
(
taskDefinitionKey
);
List
<
Task
>
list
=
query
.
orderByTaskCreateTime
().
desc
().
listPage
(
0
,
1
);
if
(
list
.
size
()==
0
)
return
taskWays
;
Task
task
=
list
.
get
(
0
);
if
((!
StringUtils
.
isEmpty
(
task
.
getProcessDefinitionId
()))&&(!
StringUtils
.
isEmpty
(
task
.
getTaskDefinitionKey
())))
{
UserTask
userTask
=
wfModelService
.
getModelStepById
(
task
.
getProcessDefinitionId
()).
get
(
task
.
getTaskDefinitionKey
());
if
(
userTask
!=
null
&&
userTask
.
getOutgoingFlows
()!=
null
)
{
for
(
SequenceFlow
sequenceFlow:
userTask
.
getOutgoingFlows
())
{
WFTaskWay
way
=
new
WFTaskWay
();
way
.
setSequenceflowid
(
sequenceFlow
.
getId
());
way
.
setSequenceflowname
(
sequenceFlow
.
getName
());
way
.
setProcessdefinitionkey
(
task
.
getProcessDefinitionId
().
split
(
":"
)[
0
]);
way
.
setTaskid
(
task
.
getId
());
way
.
setProcessinstanceid
(
task
.
getProcessInstanceId
());
way
.
setTaskprocessdefinitionkey
(
task
.
getTaskDefinitionKey
());
way
.
setProcessinstancebusinesskey
(
processInstanceBusinessKey
);
taskWays
.
add
(
way
);
}
}
}
return
taskWays
;
}
public
List
<
WFTaskWay
>
getTaskLink
(
String
system
,
String
appname
,
String
entity
,
String
businessKey
,
String
taskId
)
{
List
<
WFTaskWay
>
taskWays
=
new
ArrayList
<>();
String
processInstanceBusinessKey
=
system
+
":"
+
entity
+
":srfkey-"
+
businessKey
;
String
userId
=
AuthenticationUser
.
getAuthenticationUser
().
getUserid
();
if
(
StringUtils
.
isEmpty
(
userId
))
return
taskWays
;
TaskQuery
query
=
taskService
.
createTaskQuery
().
taskCandidateOrAssigned
(
userId
).
taskId
(
taskId
);
List
<
Task
>
list
=
query
.
orderByTaskCreateTime
().
desc
().
listPage
(
0
,
1
);
if
(
list
.
size
()==
0
)
return
taskWays
;
Task
task
=
list
.
get
(
0
);
if
((!
StringUtils
.
isEmpty
(
task
.
getProcessDefinitionId
()))&&(!
StringUtils
.
isEmpty
(
task
.
getTaskDefinitionKey
())))
{
UserTask
userTask
=
wfModelService
.
getModelStepById
(
task
.
getProcessDefinitionId
()).
get
(
task
.
getTaskDefinitionKey
());
if
(
userTask
!=
null
&&
userTask
.
getOutgoingFlows
()!=
null
)
{
for
(
SequenceFlow
sequenceFlow:
userTask
.
getOutgoingFlows
())
{
WFTaskWay
way
=
new
WFTaskWay
();
way
.
setSequenceflowid
(
sequenceFlow
.
getId
());
way
.
setSequenceflowname
(
sequenceFlow
.
getName
());
way
.
setProcessdefinitionkey
(
task
.
getProcessDefinitionId
().
split
(
":"
)[
0
]);
way
.
setTaskid
(
task
.
getId
());
way
.
setProcessinstanceid
(
task
.
getProcessInstanceId
());
way
.
setTaskprocessdefinitionkey
(
task
.
getTaskDefinitionKey
());
way
.
setProcessinstancebusinesskey
(
processInstanceBusinessKey
);
taskWays
.
add
(
way
);
}
}
}
return
taskWays
;
}
public
List
<
String
>
getBusinessKeys
(
String
system
,
String
appname
,
String
entity
,
String
processDefinitionKey
,
String
taskDefinitionKey
)
{
List
<
String
>
businessKeys
=
new
ArrayList
<>();
String
processInstanceBusinessKeyLike
=
system
+
":"
+
entity
+
":srfkey-"
;
String
userId
=
AuthenticationUser
.
getAuthenticationUser
().
getUserid
();
if
(
StringUtils
.
isEmpty
(
userId
))
return
businessKeys
;
TaskQuery
query
=
taskService
.
createTaskQuery
().
taskCandidateOrAssigned
(
userId
);
if
(!
StringUtils
.
isEmpty
(
processDefinitionKey
))
query
.
processDefinitionKey
(
processDefinitionKey
);
else
{
query
.
processDefinitionKeyIn
(
this
.
getWorkflowKey
(
system
,
appname
,
entity
));
}
if
(!
StringUtils
.
isEmpty
(
taskDefinitionKey
))
query
.
taskDefinitionKey
(
taskDefinitionKey
);
List
<
Task
>
tasks
=
query
.
includeProcessVariables
().
listPage
(
0
,
500
);
for
(
Task
task:
tasks
)
{
Object
key
=
task
.
getProcessVariables
().
get
(
"businessKey"
);
if
(
key
!=
null
)
{
String
str
=
key
.
toString
();
if
(
str
.
indexOf
(
":srfkey-"
)>
0
)
str
=
str
.
split
(
":srfkey-"
)[
1
];
businessKeys
.
add
(
str
);
}
}
return
businessKeys
;
}
public
WFProcessInstance
wfsubmit
(
String
system
,
String
appname
,
String
entity
,
String
businessKey
,
String
taskId
,
WFTaskWay
taskWay
)
{
WFProcessInstance
instance
=
new
WFProcessInstance
();
return
instance
;
}
public
void
execute
(
DelegateExecution
delegateExecution
,
Object
activedata
)
throws
Exception
{
String
entity
=
(
String
)
delegateExecution
.
getVariable
(
"pass"
);
// Boolean val = (Boolean) pass.getValue(delegateExecution);
//logger.info("=ProductFactoryNewProductTask=>business:{} prossId:{} pass:{}",delegateExecution.getProcessInstanceBusinessKey(),delegateExecution.getProcessInstanceId(),val.toString());
// //修改产品状态为审核中
// ProductDto pactDto = new ProductDto();
// pactDto.setId(Long.valueOf(delegateExecution.getBusinessKey()));
// pactDto.setStatus(ProductStatusEnum.product_status__publishing.getStatus());
// ResponseResult<Integer> responseResult = productApi.update(pactDto);
//
// logger.info("ProductFactoryNewProductTask end!");
}
public
Timestamp
getnow
()
{
return
new
Timestamp
(
new
java
.
util
.
Date
().
getTime
());
}
}
ibzwf-core/src/main/java/cn/ibizlab/core/extensions/service/WFModelService.java
0 → 100644
浏览文件 @
5e81e604
package
cn
.
ibizlab
.
core
.
extensions
.
service
;
import
cn.ibizlab.core.workflow.domain.WFProcessDefinition
;
import
cn.ibizlab.core.workflow.domain.WFProcessNode
;
import
cn.ibizlab.core.workflow.service.IWFProcessDefinitionService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
org.activiti.bpmn.model.FlowElement
;
import
org.activiti.bpmn.model.UserTask
;
import
org.activiti.engine.RepositoryService
;
import
org.activiti.engine.repository.ProcessDefinition
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.StringUtils
;
import
java.util.*
;
public
class
WFModelService
{
@Autowired
private
RepositoryService
repositoryService
;
@Autowired
private
IWFProcessDefinitionService
iwfProcessDefinitionService
;
public
List
<
WFProcessDefinition
>
getWorkflow
(
String
system
,
String
entity
)
{
return
iwfProcessDefinitionService
.
list
(
new
QueryWrapper
<
WFProcessDefinition
>().
likeRight
(
"definitionkey"
,
system
+
"-"
+
entity
+
"-"
).
eq
(
"modelenable"
,
1
).
orderByDesc
(
"modelversion"
));
}
public
LinkedHashMap
<
String
,
UserTask
>
getModelStepByKey
(
String
definitionkey
)
{
LinkedHashMap
<
String
,
UserTask
>
allTask
=
new
LinkedHashMap
<
String
,
UserTask
>();
List
<
ProcessDefinition
>
list
=
repositoryService
.
createProcessDefinitionQuery
().
processDefinitionKey
(
definitionkey
).
orderByProcessDefinitionVersion
().
desc
().
list
();
boolean
blastest
=
true
;
for
(
ProcessDefinition
def
:
list
)
{
LinkedHashMap
<
String
,
UserTask
>
userTasks
=
getModelStepById
(
def
.
getId
());
if
(
blastest
){
allTask
.
putAll
(
userTasks
);
blastest
=
false
;
}
else
{
for
(
String
key:
userTasks
.
keySet
())
{
if
(!
allTask
.
containsKey
(
key
))
{
String
taskName
=
userTasks
.
get
(
key
).
getName
()
+
"-历史版本v"
+
def
.
getVersion
();
userTasks
.
get
(
key
).
setName
(
taskName
);
allTask
.
put
(
key
,
userTasks
.
get
(
key
));
}
}
}
}
return
allTask
;
}
public
LinkedHashMap
<
String
,
UserTask
>
getModelStepById
(
String
definitionid
)
{
LinkedHashMap
<
String
,
UserTask
>
userTasks
=
new
LinkedHashMap
<
String
,
UserTask
>();
Map
<
String
,
UserTask
>
map
=
new
HashMap
<>();
for
(
FlowElement
f:
repositoryService
.
getBpmnModel
(
definitionid
).
getMainProcess
().
getFlowElements
())
{
if
(
f
instanceof
UserTask
)
{
map
.
put
(
f
.
getId
(),(
UserTask
)
f
);
}
}
List
<
Map
.
Entry
<
String
,
UserTask
>>
infoIds
=
new
ArrayList
<
Map
.
Entry
<
String
,
UserTask
>>(
map
.
entrySet
());
Collections
.
sort
(
infoIds
,
new
Comparator
<
Map
.
Entry
<
String
,
UserTask
>>()
{
public
int
compare
(
Map
.
Entry
<
String
,
UserTask
>
o1
,
Map
.
Entry
<
String
,
UserTask
>
o2
)
{
String
p1
=
o1
.
getKey
();
String
p2
=
o2
.
getKey
();
return
p1
.
compareTo
(
p2
);
}
});
for
(
Map
.
Entry
<
String
,
UserTask
>
entity
:
infoIds
){
userTasks
.
put
(
entity
.
getKey
(),
entity
.
getValue
());
System
.
out
.
println
(
entity
.
getKey
());
}
return
userTasks
;
}
}
ibzwf-provider/ibzwf-provider-api/src/main/java/cn/ibizlab/api/rest/extensions/WFCoreResource.java
0 → 100644
浏览文件 @
5e81e604
package
cn
.
ibizlab
.
api
.
rest
.
extensions
;
import
cn.ibizlab.core.workflow.domain.*
;
import
cn.ibizlab.core.extensions.service.WFCoreService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
@Slf4j
@Api
(
tags
=
{
"wfcore"
})
@RestController
(
"api-wfcore"
)
@RequestMapping
(
""
)
public
class
WFCoreResource
{
@Autowired
private
WFCoreService
wfCoreService
;
@ApiOperation
(
value
=
"getWFProcessDefinition"
,
tags
=
{
"WFProcessDefinition"
},
notes
=
"根据系统实体查找当前适配的工作流模型"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/wfcore/{system}-app-{appname}/{entity}/process-definitions"
)
public
ResponseEntity
<
List
<
WFProcessDefinition
>>
getworkflow
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"appname"
)
String
appname
,
@PathVariable
(
"entity"
)
String
entity
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
null
);
}
@ApiOperation
(
value
=
"getStepByEntity"
,
tags
=
{
"WFProcessNode"
},
notes
=
"根据系统实体查找当前适配的工作流模型步骤"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/wfcore/{system}-app-{appname}/{entity}/process-definitions-nodes"
)
public
ResponseEntity
<
List
<
WFProcessNode
>>
getwfstep
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"appname"
)
String
appname
,
@PathVariable
(
"entity"
)
String
entity
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
null
);
}
@PreAuthorize
(
"hasPermission(#entity,'WFSTART',this.getEntity())"
)
@ApiOperation
(
value
=
"wfstart"
,
tags
=
{
"WFProcessInstance"
},
notes
=
"启动工作流"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/wfcore/{system}-app-{appname}/{entity}/{businessKey}/process-instances"
)
public
ResponseEntity
<
WFProcessInstance
>
wfstart
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"appname"
)
String
appname
,
@PathVariable
(
"entity"
)
String
entity
,
@PathVariable
(
"businessKey"
)
String
businessKey
,
@RequestBody
WFProcessInstance
instance
)
{
instance
.
setBusinesskey
(
businessKey
);
return
ResponseEntity
.
ok
(
instance
);
}
@ApiOperation
(
value
=
"getWayByBusinessKey"
,
tags
=
{
"WFTaskWay"
},
notes
=
"根据业务主键和当前步骤获取操作路径"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/wfcore/{system}-app-{appname}/{entity}/{businessKey}/usertasks/{taskDefinitionKey}/ways"
)
public
ResponseEntity
<
List
<
WFTaskWay
>>
getwflink
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"appname"
)
String
appname
,
@PathVariable
(
"entity"
)
String
entity
,
@PathVariable
(
"businessKey"
)
String
businessKey
,
@PathVariable
(
"taskDefinitionKey"
)
String
taskDefinitionKey
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
null
);
}
@ApiOperation
(
value
=
"getWayByTaskId"
,
tags
=
{
"WFTaskWay"
},
notes
=
"根据业务主键和当前步骤获取操作路径"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/wfcore/{system}-app-{appname}/{entity}/{businessKey}/tasks/{taskId}/ways"
)
public
ResponseEntity
<
List
<
WFTaskWay
>>
gettasklink
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"appname"
)
String
appname
,
@PathVariable
(
"entity"
)
String
entity
,
@PathVariable
(
"businessKey"
)
String
businessKey
,
@PathVariable
(
"taskId"
)
String
taskId
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
null
);
}
@PreAuthorize
(
"hasPermission(#entity,'WFSTART',this.getEntity())"
)
@ApiOperation
(
value
=
"wfsubmit"
,
tags
=
{
"WFProcessInstance"
},
notes
=
"工作流执行步骤"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/wfcore/{system}-app-{appname}/{entity}/{businessKey}/tasks/{taskId}"
)
public
ResponseEntity
<
WFProcessInstance
>
wfsubmit
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"appname"
)
String
appname
,
@PathVariable
(
"entity"
)
String
entity
,
@PathVariable
(
"businessKey"
)
String
businessKey
,
@PathVariable
(
"taskId"
)
String
taskId
,
@RequestBody
WFTaskWay
taskWay
)
{
WFProcessInstance
instance
=
new
WFProcessInstance
();
return
ResponseEntity
.
ok
(
instance
);
}
}
ibzwf-util/pom.xml
浏览文件 @
5e81e604
...
@@ -54,5 +54,19 @@
...
@@ -54,5 +54,19 @@
<artifactId>
problem-spring-web
</artifactId>
<artifactId>
problem-spring-web
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
org.activiti
</groupId>
<artifactId>
activiti-spring-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
org.activiti
</groupId>
<artifactId>
activiti-json-converter
</artifactId>
</dependency>
<dependency>
<groupId>
org.activiti
</groupId>
<artifactId>
activiti-image-generator
</artifactId>
</dependency>
</dependencies>
</dependencies>
</project>
</project>
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录