Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
ldp-docs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
doc
ldp-docs
Commits
9cd33626
Commit
9cd33626
authored
Mar 29, 2021
by
马超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc: 修改流程代码集成文档
parent
28ed4bdf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
136 additions
and
21 deletions
+136
-21
LDP应用集成流程服务说明.md
流程系统集成/LDP应用集成流程服务说明.md
+136
-21
No files found.
流程系统集成/LDP应用集成流程服务说明.md
View file @
9cd33626
...
...
@@ -30,11 +30,33 @@ public class LdpCityServiceImpl extends AbsLocalBaseDao implements LdpCityServic
public
String
submit
(
LdpCity
ldpCity
)
{
//提交单据数据到本地数据库
String
id
=
(
String
)
this
.
addOne
(
ldpCity
);
String
id
=
ldpCity
.
getId
();
// 设置状态为审核中
ldpCity
.
setStatus
(
0
);
if
(
StringUtils
.
isEmpty
(
id
))
{
id
=
(
String
)
this
.
addOne
(
ldpCity
);
}
else
{
this
.
update
(
ldpCity
);
}
String
formKey
=
"demo"
;
try
{
// 调用流程引擎启动服务,catch并抛出异常
String
instanceId
=
processEngineService
.
start
(
formKey
,
id
,
new
ProcessParam
());
ProcessParam
processParam
=
new
ProcessParam
();
// 如果是用表单集成方式是【内置表单视图】, 需要将要显示的数据设置到formData中
processParam
.
setFormData
(
ldpCity
);
//其它相关变量,如流程网关变量,需要放到processVariables中
processParam
.
setProcessVariables
(
new
HashMap
<>());
// 如果配置的认领规则为【匹配表单关联组织】,则需要传入orgId
String
orgId
=
""
;
//如果是自动认领,则设置下一个节点的审批人
String
autoClaimAccount
=
processEngineService
.
getAutoClaimAccount
(
formKey
,
null
,
orgId
);
processParam
.
setAssignUserId
(
autoClaimAccount
);
//如果是【匹配表单关联组织】,则需要设置orgId
processParam
.
setOrgId
(
orgId
);
//启动流程
String
instanceId
=
processEngineService
.
start
(
formKey
,
id
,
processParam
);
}
catch
(
Exception
e
){
throw
e
;
}
...
...
@@ -115,7 +137,8 @@ public class LdpCityRest {
*/
@GetMapping
(
"/reject"
)
public
RestResult
reject
(
@RequestParam
String
businessKey
,
@RequestParam
String
comment
)
{
//如果是要打回到发起人需要调用back方法
//return new RestResult(ResultMsg.SUCCESS, processEngineService.back(businessKey,comment));
return
new
RestResult
(
ResultMsg
.
SUCCESS
,
processEngineService
.
reject
(
businessKey
,
comment
));
}
...
...
@@ -162,23 +185,37 @@ public class LdpCityRest {
@FeignClient
(
value
=
"bpm-service"
,
configuration
=
HeaderRequestInterceptorForToken
.
class
)
public
interface
BpmClientFeignService
{
/**
* 启动流程
*
* @param formKey 表单KEY
* @param businessKey 业务流程ID,一般为单据或表单ID
* @param startParam 启动参数
* @return 流程
实例
ID
* @return 流程ID
*/
@PostMapping
(
"/process/open/start"
)
RestResult
<
String
>
start
(
@RequestParam
(
"formKey"
)
String
formKey
,
@RequestParam
(
"businessKey"
)
String
businessKey
,
@RequestBody
ProcessParam
startParam
);
RestResult
<
String
>
start
(
@RequestParam
(
"formKey"
)
String
formKey
,
@RequestParam
(
"businessKey"
)
String
businessKey
,
@RequestBody
ProcessParam
startParam
);
/**
* 获取认领方式(开始流程时传formKey,其它时候传businessKey)
*
* @param formKey 表单KEY
* @return 认领方式
*/
@GetMapping
(
"/process/open/get/claimInfo"
)
RestResult
<
ProcessClaimInfo
>
getClaimInfo
(
@RequestParam
(
value
=
"formKey"
,
required
=
false
)
String
formKey
,
@RequestParam
(
value
=
"businessKey"
,
required
=
false
)
String
businessKey
,
@RequestParam
(
value
=
"orgId"
,
required
=
false
)
String
orgId
);
/**
* 获取审批流程内容
*
* @param businessKey 单据或表单ID
* @return
审批意见列表
* @return
*/
@GetMapping
(
"/process/comment/list"
)
@GetMapping
(
"/process/
open/
comment/list"
)
RestResult
<
List
<
ProcessComment
>>
getProcessComments
(
@RequestParam
(
"businessKey"
)
String
businessKey
);
...
...
@@ -186,28 +223,31 @@ public interface BpmClientFeignService {
* 流程审批流程图
*
* @param businessKey 单据或表单ID
* @return
流程图byte数组
* @return
*/
@GetMapping
(
"/process/open/image"
)
RestResult
<
byte
[]>
getProcessInstanceImage
(
@RequestParam
(
"businessKey"
)
String
businessKey
);
/**
* 获取待办列表
*
* @param formKey
* @return
待办列表
* @return
*/
@GetMapping
(
"/process/open/todo/list"
)
RestResult
<
List
<
ProcessInfo
>>
getTodoList
(
@RequestParam
(
"formKey"
)
String
formKey
);
/**
* 获取待办列表
* @return 待办列表
*
* @return
*/
@GetMapping
(
"/process/open/todo/list"
)
RestResult
<
List
<
ProcessInfo
>>
getTodoList
();
/**
* 终止流程
*
* @param businessKey 表单ID
* @param comment 审批意见
* @return
...
...
@@ -218,6 +258,7 @@ public interface BpmClientFeignService {
/**
* 审批同意(到下一个审批节点)
*
* @param businessKey 表单ID
* @param comment 审批意见
* @return
...
...
@@ -225,8 +266,22 @@ public interface BpmClientFeignService {
@PostMapping
(
"/process/open/agree"
)
RestResult
agree
(
@RequestParam
(
"businessKey"
)
String
businessKey
,
@RequestParam
(
"comment"
)
String
comment
);
/**
* 审批同意(到下一个审批节点),并指定下一个节点审批人
*
* @param businessKey 表单ID
* @param comment 审批意见
* @param assignUserId 下个节点审批人
* @return
*/
@PostMapping
(
"/process/open/agree"
)
RestResult
agree
(
@RequestParam
(
"businessKey"
)
String
businessKey
,
@RequestParam
(
"comment"
)
String
comment
,
@RequestParam
(
"assignUserId"
)
String
assignUserId
);
/**
* 拒绝打回(到上一个审批节点)
*
* @param businessKey 表单ID
* @param comment 审批意见
* @return
...
...
@@ -236,6 +291,7 @@ public interface BpmClientFeignService {
/**
* 打回到起始节点
*
* @param businessKey 表单ID
* @param comment 审批意见
* @return
...
...
@@ -258,22 +314,64 @@ public interface BpmClientFeignService {
public
interface
ProcessEngineService
{
/**
* 启动流程
*
* @param formKey 表单KEY
* @param businessKey 业务流程ID,一般为单据或表单ID
* @param startParam 启动参数
* @return 流程实例ID
*/
String
start
(
String
formKey
,
String
businessKey
,
ProcessParam
startParam
);
String
start
(
String
formKey
,
String
businessKey
,
ProcessParam
startParam
);
/**
* 获取认领方式(开始流程时传formKey)
*
* @param formKey 表单KEY
* @param businessKey 业务流程ID
* @return 认领方式
*/
ProcessClaimInfo
getClaimInfo
(
String
formKey
,
String
businessKey
);
/**
* 获取认领方式(开始流程时传formKey)
*
* @param formKey 表单KEY
* @param businessKey 业务流程ID
* @param orgId 组织ID
* @return 认领方式
*/
ProcessClaimInfo
getClaimInfo
(
String
formKey
,
String
businessKey
,
String
orgId
);
/**
* 获取下个节点认领用户Account
*
* @param formKey 表单KEY
* @param businessKey 业务流程ID
* @return 获取下个节点认领用户Account
*/
String
getAutoClaimAccount
(
String
formKey
,
String
businessKey
);
/**
* 获取下个节点认领用户Account
*
* @param formKey 表单KEY
* @param businessKey 业务流程ID
* @param orgId 组织ID
* @return 获取下个节点认领用户Account
*/
String
getAutoClaimAccount
(
String
formKey
,
String
businessKey
,
String
orgId
);
/**
* 获取审批流程内容
*
* @param businessKey 单据或表单ID
* @return
*/
List
<
ProcessComment
>
getProcessComments
(
String
businessKey
);
List
<
ProcessComment
>
getProcessComments
(
String
businessKey
);
/**
...
...
@@ -286,6 +384,7 @@ public interface ProcessEngineService {
/**
* 获取待办列表
*
* @param formKey
* @return
*/
...
...
@@ -293,43 +392,59 @@ public interface ProcessEngineService {
/**
* 获取待办列表
*
* @return
*/
List
<
ProcessInfo
>
getTodoList
();
/**
* 终止流程
*
* @param businessKey 表单ID
* @param comment 审批意见
* @return
*/
boolean
stop
(
String
businessKey
,
String
comment
);
void
stop
(
String
businessKey
,
String
comment
);
/**
* 审批同意(到下一个审批节点)
*
* @param businessKey 表单ID
* @param comment 审批意见
* @return
*/
boolean
agree
(
String
businessKey
,
String
comment
);
void
agree
(
String
businessKey
,
String
comment
);
/**
* 拒绝打回(到上一个审批节点)
* 审批同意(到下一个审批节点),并指定下一个节点审批人
*
* @param businessKey 表单ID
* @param comment 审批意见
* @param assignUserId 下个节点审批人
* @return
*/
boolean
reject
(
String
businessKey
,
String
comment
);
void
agree
(
String
businessKey
,
String
comment
,
String
assignUserId
);
/**
* 打回到起始节点
* 拒绝 (退回上一个节点)
*
* @param businessKey 表单ID
* @param comment 审批意见
* @return
*/
void
reject
(
String
businessKey
,
String
comment
);
/**
* 打回 (到发起人)
*
* @param businessKey 表单ID
* @param comment 审批意见
* @return
*/
boolean
back
(
String
businessKey
,
String
comment
);
void
back
(
String
businessKey
,
String
comment
);
}
```
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment