Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bpm
Overview
Overview
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
王厚康
bpm
Commits
9b7f3048
Commit
9b7f3048
authored
Sep 05, 2019
by
王厚康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpm分支出路优化
parent
ba83c0e8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
101 additions
and
23 deletions
+101
-23
TaskOperateController.java
src/main/java/com/bbd/bpm/controller/taskOperate/TaskOperateController.java
+45
-8
UserApiController.java
src/main/java/com/bbd/bpm/controller/user/UserApiController.java
+0
-11
BtnBean.java
src/main/java/com/bbd/bpm/dto/BtnBean.java
+4
-2
BpmUtil.java
src/main/java/com/bbd/bpm/util/BpmUtil.java
+47
-0
ValidateUtil.java
src/main/java/com/bbd/bpm/util/validate/ValidateUtil.java
+5
-2
No files found.
src/main/java/com/bbd/bpm/controller/taskOperate/TaskOperateController.java
View file @
9b7f3048
...
@@ -11,6 +11,7 @@ import com.bbd.bpm.dto.response.BpmResponse;
...
@@ -11,6 +11,7 @@ import com.bbd.bpm.dto.response.BpmResponse;
import
com.bbd.bpm.dto.response.PendingTaskListBean
;
import
com.bbd.bpm.dto.response.PendingTaskListBean
;
import
com.bbd.bpm.dto.response.QueryPiByUserIdBean
;
import
com.bbd.bpm.dto.response.QueryPiByUserIdBean
;
import
com.bbd.bpm.service.ActivitiService
;
import
com.bbd.bpm.service.ActivitiService
;
import
com.bbd.bpm.util.BpmUtil
;
import
com.bbd.bpm.util.validate.ValidateUtil
;
import
com.bbd.bpm.util.validate.ValidateUtil
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
...
@@ -27,6 +28,7 @@ import org.activiti.engine.impl.ProcessInstanceQueryImpl;
...
@@ -27,6 +28,7 @@ import org.activiti.engine.impl.ProcessInstanceQueryImpl;
import
org.activiti.engine.impl.RepositoryServiceImpl
;
import
org.activiti.engine.impl.RepositoryServiceImpl
;
import
org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity
;
import
org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity
;
import
org.activiti.engine.impl.util.ProcessDefinitionUtil
;
import
org.activiti.engine.impl.util.ProcessDefinitionUtil
;
import
org.activiti.engine.repository.ProcessDefinition
;
import
org.activiti.engine.runtime.ProcessInstance
;
import
org.activiti.engine.runtime.ProcessInstance
;
import
org.activiti.engine.task.Task
;
import
org.activiti.engine.task.Task
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -377,8 +379,8 @@ public class TaskOperateController {
...
@@ -377,8 +379,8 @@ public class TaskOperateController {
out
.
forEach
(
sequenceFlow1
->
{
out
.
forEach
(
sequenceFlow1
->
{
if
(
StringUtils
.
isNotBlank
(
sequenceFlow1
.
getName
()))
{
if
(
StringUtils
.
isNotBlank
(
sequenceFlow1
.
getName
()))
{
BtnBean
btn
=
new
BtnBean
();
BtnBean
btn
=
new
BtnBean
();
btn
.
setBtn
Key
(
sequenceFlow1
.
getName
());
btn
.
setBtn
Name
(
sequenceFlow1
.
getName
());
btn
.
setBtn
Value
(
sequenceFlow1
.
getId
());
btn
.
setBtn
Id
(
sequenceFlow1
.
getId
());
buttons
.
add
(
btn
);
buttons
.
add
(
btn
);
}
}
});
});
...
@@ -388,20 +390,20 @@ public class TaskOperateController {
...
@@ -388,20 +390,20 @@ public class TaskOperateController {
if
(
targetFlowElement
instanceof
UserTask
)
{
if
(
targetFlowElement
instanceof
UserTask
)
{
if
(
StringUtils
.
isNotBlank
(
targetFlowElement
.
getName
()))
{
if
(
StringUtils
.
isNotBlank
(
targetFlowElement
.
getName
()))
{
BtnBean
btn
=
new
BtnBean
();
BtnBean
btn
=
new
BtnBean
();
btn
.
setBtn
Valu
e
(
targetFlowElement
.
getName
());
btn
.
setBtn
Nam
e
(
targetFlowElement
.
getName
());
btn
.
setBtn
Key
(
targetFlowElement
.
getName
());
btn
.
setBtn
Id
(
targetFlowElement
.
getName
());
buttons
.
add
(
btn
);
buttons
.
add
(
btn
);
}
else
{
}
else
{
BtnBean
btn
=
new
BtnBean
();
BtnBean
btn
=
new
BtnBean
();
btn
.
setBtn
Valu
e
(
"提交"
);
btn
.
setBtn
Nam
e
(
"提交"
);
btn
.
setBtn
Key
(
"提交"
);
btn
.
setBtn
Id
(
"提交"
);
buttons
.
add
(
btn
);
buttons
.
add
(
btn
);
}
}
}
}
if
(
targetFlowElement
instanceof
EndEvent
)
{
if
(
targetFlowElement
instanceof
EndEvent
)
{
BtnBean
btn
=
new
BtnBean
();
BtnBean
btn
=
new
BtnBean
();
btn
.
setBtn
Valu
e
(
"结束"
);
btn
.
setBtn
Nam
e
(
"结束"
);
btn
.
setBtn
Key
(
"结束"
);
btn
.
setBtn
Id
(
"结束"
);
buttons
.
add
(
btn
);
buttons
.
add
(
btn
);
}
}
...
@@ -416,4 +418,39 @@ public class TaskOperateController {
...
@@ -416,4 +418,39 @@ public class TaskOperateController {
return
resp
;
return
resp
;
}
}
@ApiOperation
(
value
=
"根据流程部署ID获取开启流程时 需要的参数"
)
@GetMapping
(
"/outGoing_start"
)
@ResponseBody
public
BpmResponse
outGoing_start
(
String
actDefId
)
{
BpmResponse
resp
=
new
BpmResponse
();
try
{
ProcessDefinition
processDefinition
=
repositoryService
.
createProcessDefinitionQuery
().
deploymentId
(
actDefId
).
singleResult
();
BpmnModel
bpmnModel
=
repositoryService
.
getBpmnModel
(
processDefinition
.
getId
());
if
(
bpmnModel
!=
null
)
{
Collection
<
FlowElement
>
flowElements
=
bpmnModel
.
getMainProcess
().
getFlowElements
();
for
(
FlowElement
e
:
flowElements
)
{
if
(
e
.
getClass
().
toString
().
indexOf
(
"StartEvent"
)>-
1
){
StartEvent
start
=
(
StartEvent
)
bpmnModel
.
getFlowElement
(
e
.
getId
());
List
<
SequenceFlow
>
outgoingFlows
=
start
.
getOutgoingFlows
();
List
<
BtnBean
>
buttons
=
new
ArrayList
<>();
outgoingFlows
.
forEach
(
sequenceFlow
->
{
buttons
.
addAll
(
BpmUtil
.
forTargetFlowElement
(
sequenceFlow
));
});
resp
.
setData
(
buttons
);
break
;
}
}
}
resp
.
setSuccess
(
true
);
resp
.
setMessage
(
"根据流程部署ID获取开启流程时 需要的参数成功"
);
}
catch
(
Exception
e
)
{
Log
.
error
(
"根据流程部署ID获取开启流程时 需要的参数失败"
,
e
);
resp
.
setSuccess
(
false
);
}
return
resp
;
}
}
}
src/main/java/com/bbd/bpm/controller/user/UserApiController.java
View file @
9b7f3048
...
@@ -4,16 +4,11 @@ import com.bbd.bpm.base.PageBean;
...
@@ -4,16 +4,11 @@ import com.bbd.bpm.base.PageBean;
import
com.bbd.bpm.domain.User
;
import
com.bbd.bpm.domain.User
;
import
com.bbd.bpm.dto.SysCode
;
import
com.bbd.bpm.dto.SysCode
;
import
com.bbd.bpm.dto.response.BpmResponse
;
import
com.bbd.bpm.dto.response.BpmResponse
;
import
com.bbd.bpm.result.RespCode
;
import
com.bbd.bpm.result.Result
;
import
com.bbd.bpm.result.Result
;
import
com.bbd.bpm.result.ResultUtil
;
import
com.bbd.bpm.service.UserInfoService
;
import
com.bbd.bpm.service.UserInfoService
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.models.auth.In
;
import
org.activiti.bpmn.converter.BpmnXMLConverter
;
import
org.activiti.bpmn.model.BpmnModel
;
import
org.activiti.editor.constants.ModelDataJsonConstants
;
import
org.activiti.editor.constants.ModelDataJsonConstants
;
import
org.activiti.engine.RepositoryService
;
import
org.activiti.engine.RepositoryService
;
import
org.activiti.engine.repository.Model
;
import
org.activiti.engine.repository.Model
;
...
@@ -22,13 +17,7 @@ import org.springframework.stereotype.Controller;
...
@@ -22,13 +17,7 @@ import org.springframework.stereotype.Controller;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
springfox.documentation.annotations.ApiIgnore
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpSession
;
import
javax.xml.stream.XMLInputFactory
;
import
javax.xml.stream.XMLStreamException
;
import
javax.xml.stream.XMLStreamReader
;
import
java.io.*
;
import
java.io.*
;
/**
/**
...
...
src/main/java/com/bbd/bpm/dto/BtnBean.java
View file @
9b7f3048
...
@@ -7,7 +7,9 @@ import java.io.Serializable;
...
@@ -7,7 +7,9 @@ import java.io.Serializable;
@Data
@Data
public
class
BtnBean
implements
Serializable
{
public
class
BtnBean
implements
Serializable
{
String
btn
Valu
e
;
String
btn
Nam
e
;
String
btnKey
;
String
btnId
;
String
condition
;
}
}
src/main/java/com/bbd/bpm/util/BpmUtil.java
0 → 100644
View file @
9b7f3048
package
com
.
bbd
.
bpm
.
util
;
import
com.bbd.bpm.dto.BtnBean
;
import
org.activiti.bpmn.model.*
;
import
org.apache.commons.lang3.StringUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
BpmUtil
{
public
static
List
<
BtnBean
>
forTargetFlowElement
(
SequenceFlow
sequenceFlow
){
List
<
BtnBean
>
buttons
=
new
ArrayList
<>();
if
(
sequenceFlow
==
null
){
return
buttons
;
}
FlowElement
targetFlowElement
=
sequenceFlow
.
getTargetFlowElement
();
if
(
targetFlowElement
!=
null
&&
targetFlowElement
instanceof
ExclusiveGateway
){
List
<
SequenceFlow
>
out
=
((
ExclusiveGateway
)
targetFlowElement
).
getOutgoingFlows
();
out
.
forEach
(
sequenceFlow1
->
{
if
(
StringUtils
.
isNotBlank
(
sequenceFlow1
.
getConditionExpression
()))
{
BtnBean
btn
=
new
BtnBean
();
btn
.
setBtnName
(
sequenceFlow1
.
getName
());
btn
.
setBtnId
(
sequenceFlow1
.
getId
());
btn
.
setCondition
(
sequenceFlow1
.
getConditionExpression
());
buttons
.
add
(
btn
);
if
(
sequenceFlow1
.
getTargetFlowElement
()
instanceof
ExclusiveGateway
){
buttons
.
addAll
(
forTargetFlowElement
(
sequenceFlow1
));
}
}
});
}
else
{
if
(
StringUtils
.
isNotBlank
(
sequenceFlow
.
getConditionExpression
()))
{
BtnBean
btn
=
new
BtnBean
();
btn
.
setBtnName
(
sequenceFlow
.
getName
());
btn
.
setBtnId
(
sequenceFlow
.
getId
());
btn
.
setCondition
(
sequenceFlow
.
getConditionExpression
());
buttons
.
add
(
btn
);
}
}
return
buttons
;
}
}
src/main/java/com/bbd/bpm/util/validate/ValidateUtil.java
View file @
9b7f3048
...
@@ -36,6 +36,9 @@ public class ValidateUtil {
...
@@ -36,6 +36,9 @@ public class ValidateUtil {
if
(
StringUtils
.
isBlank
(
req
.
getTaskStatus
())
){
if
(
StringUtils
.
isBlank
(
req
.
getTaskStatus
())
){
return
"查询类型"
+
SysCode
.
NOT_ALLOW_NULL
;
return
"查询类型"
+
SysCode
.
NOT_ALLOW_NULL
;
}
}
if
(
req
.
getPage
()==
null
||
req
.
getPage
().
getPageSize
()==
0
){
return
"分页信息"
+
SysCode
.
NOT_ALLOW_NULL
;
}
/*if(req.getPage().get == null ){
/*if(req.getPage().get == null ){
return "分页信息"+SysCode.NOT_ALLOW_NULL;
return "分页信息"+SysCode.NOT_ALLOW_NULL;
}*/
}*/
...
@@ -50,9 +53,9 @@ public class ValidateUtil {
...
@@ -50,9 +53,9 @@ public class ValidateUtil {
if
(
StringUtils
.
isBlank
(
req
.
getAssignee
())
){
if
(
StringUtils
.
isBlank
(
req
.
getAssignee
())
){
return
"任务处理人id"
+
SysCode
.
NOT_ALLOW_NULL
;
return
"任务处理人id"
+
SysCode
.
NOT_ALLOW_NULL
;
}
}
/*if(req.getPage() == null
){
if
(
req
.
getPage
()==
null
||
req
.
getPage
().
getPageSize
()==
0
){
return
"分页信息"
+
SysCode
.
NOT_ALLOW_NULL
;
return
"分页信息"
+
SysCode
.
NOT_ALLOW_NULL
;
}
*/
}
return
null
;
return
null
;
}
}
...
...
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