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
aa25e164
Commit
aa25e164
authored
Aug 14, 2019
by
Java-曹文达
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加查看高亮流程图
parent
58127b81
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
248 additions
and
2 deletions
+248
-2
TaskOperateController.java
src/main/java/com/bbd/bpm/controller/taskOperate/TaskOperateController.java
+0
-0
UserWebController.java
src/main/java/com/bbd/bpm/controller/user/UserWebController.java
+14
-1
SpecialRequest.java
src/main/java/com/bbd/bpm/dto/request/SpecialRequest.java
+54
-0
QueryPiByUserIdBean.java
src/main/java/com/bbd/bpm/dto/response/QueryPiByUserIdBean.java
+23
-0
ActivitiService.java
src/main/java/com/bbd/bpm/service/ActivitiService.java
+19
-0
ActivitiServiceImpl.java
src/main/java/com/bbd/bpm/serviceImpl/ActivitiServiceImpl.java
+82
-0
deplyment.html
src/main/resources/templates/deployment/deplyment.html
+43
-0
initiatedDeployList.html
src/main/resources/templates/deployment/initiatedDeployList.html
+13
-1
No files found.
src/main/java/com/bbd/bpm/controller/taskOperate/TaskOperateController.java
View file @
aa25e164
This diff is collapsed.
Click to expand it.
src/main/java/com/bbd/bpm/controller/user/UserWebController.java
View file @
aa25e164
...
...
@@ -5,6 +5,7 @@ import com.bbd.bpm.result.Result;
import
com.bbd.bpm.service.UserInfoService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.ModelMap
;
import
org.springframework.web.bind.annotation.*
;
/**
* 用户功能模块管理
...
...
@@ -102,6 +103,18 @@ public class UserWebController {
return
"deployment/importDeployment"
;
}
/**
* @Author:cwd
* @Description:进入组织管理
* @Date: 2019/03/04 22:53
* @Param:
* @return
**/
@GetMapping
(
value
=
"toSee"
)
public
String
toSee
(
String
taskId
,
String
executionId
,
ModelMap
modelMap
){
modelMap
.
addAttribute
(
"taskId"
,
taskId
);
modelMap
.
addAttribute
(
"executionId"
,
executionId
);
return
"deployment/deplyment"
;
}
}
src/main/java/com/bbd/bpm/dto/request/SpecialRequest.java
0 → 100644
View file @
aa25e164
package
com
.
bbd
.
bpm
.
dto
.
request
;
import
java.io.Serializable
;
/**
* Created by yanlj on 2017/10/19.
*/
public
class
SpecialRequest
implements
Serializable
{
private
String
userToken
;
private
String
taskId
;
private
String
executionId
;
private
String
processInstanceId
;
private
String
procdefId
;
public
String
getUserToken
()
{
return
userToken
;
}
public
void
setUserToken
(
String
userToken
)
{
this
.
userToken
=
userToken
;
}
public
String
getTaskId
()
{
return
taskId
;
}
public
void
setTaskId
(
String
taskId
)
{
this
.
taskId
=
taskId
;
}
public
String
getExecutionId
()
{
return
executionId
;
}
public
void
setExecutionId
(
String
executionId
)
{
this
.
executionId
=
executionId
;
}
public
String
getProcessInstanceId
()
{
return
processInstanceId
;
}
public
void
setProcessInstanceId
(
String
processInstanceId
)
{
this
.
processInstanceId
=
processInstanceId
;
}
public
String
getProcdefId
()
{
return
procdefId
;
}
public
void
setProcdefId
(
String
procdefId
)
{
this
.
procdefId
=
procdefId
;
}
}
src/main/java/com/bbd/bpm/dto/response/QueryPiByUserIdBean.java
View file @
aa25e164
...
...
@@ -18,6 +18,12 @@ public class QueryPiByUserIdBean {
private
String
processNodeName
;
private
String
taskId
;
private
String
executionId
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
startTime
;
...
...
@@ -91,4 +97,21 @@ public class QueryPiByUserIdBean {
public
void
setProcessNodeName
(
String
processNodeName
)
{
this
.
processNodeName
=
processNodeName
;
}
public
String
getExecutionId
()
{
return
executionId
;
}
public
void
setExecutionId
(
String
executionId
)
{
this
.
executionId
=
executionId
;
}
public
String
getTaskId
()
{
return
taskId
;
}
public
void
setTaskId
(
String
taskId
)
{
this
.
taskId
=
taskId
;
}
}
src/main/java/com/bbd/bpm/service/ActivitiService.java
0 → 100644
View file @
aa25e164
package
com
.
bbd
.
bpm
.
service
;
import
com.bbd.bpm.dto.request.SpecialRequest
;
import
java.io.IOException
;
/**
* Created by yanlj on 2017/9/1.
*/
public
interface
ActivitiService
{
/**
* 带跟踪的图片
*
* @param request
* @return
*/
byte
[]
traceProcessImage
(
SpecialRequest
request
)
throws
IOException
;
}
src/main/java/com/bbd/bpm/serviceImpl/ActivitiServiceImpl.java
0 → 100644
View file @
aa25e164
package
com
.
bbd
.
bpm
.
serviceImpl
;
import
com.bbd.bpm.dto.request.SpecialRequest
;
import
com.bbd.bpm.service.ActivitiService
;
import
org.activiti.bpmn.model.BpmnModel
;
import
org.activiti.engine.*
;
import
org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl
;
import
org.activiti.engine.impl.context.Context
;
import
org.activiti.engine.runtime.Execution
;
import
org.activiti.engine.runtime.ProcessInstance
;
import
org.activiti.engine.task.Task
;
import
org.activiti.image.ProcessDiagramGenerator
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* Created by yanlj on 2017/9/1.
*/
@Component
(
"activitiService"
)
public
class
ActivitiServiceImpl
implements
ActivitiService
{
@Autowired
private
RepositoryService
repositoryService
;
@Autowired
private
RuntimeService
runtimeService
;
@Autowired
private
TaskService
taskService
;
@Autowired
private
ProcessEngineConfiguration
processEngineConfiguration
;
@Autowired
private
ProcessEngine
processEngine
;
@Override
public
byte
[]
traceProcessImage
(
SpecialRequest
request
)
throws
IOException
{
Execution
execution
=
null
;
if
(
StringUtils
.
isNotBlank
(
request
.
getExecutionId
()))
{
execution
=
runtimeService
.
createExecutionQuery
().
executionId
(
request
.
getExecutionId
()).
singleResult
();
//执行实例
}
if
(
execution
==
null
)
{
if
(
StringUtils
.
isNotBlank
(
request
.
getTaskId
()))
{
Task
task
=
taskService
.
createTaskQuery
().
taskId
(
request
.
getTaskId
()).
singleResult
();
if
(
task
!=
null
)
{
execution
=
runtimeService
.
createExecutionQuery
().
executionId
(
task
.
getExecutionId
()).
singleResult
();
//执行实例
}
}
}
ProcessInstance
processInstance
=
runtimeService
.
createProcessInstanceQuery
().
processInstanceId
(
execution
.
getProcessInstanceId
()).
singleResult
();
BpmnModel
bpmnModel
=
repositoryService
.
getBpmnModel
(
processInstance
.
getProcessDefinitionId
());
List
<
String
>
activeActivityIds
=
runtimeService
.
getActiveActivityIds
(
execution
.
getId
());
// 使用spring注入引擎请使用下面的这行代码
processEngineConfiguration
=
processEngine
.
getProcessEngineConfiguration
();
Context
.
setProcessEngineConfiguration
((
ProcessEngineConfigurationImpl
)
processEngineConfiguration
);
ProcessDiagramGenerator
diagramGenerator
=
processEngineConfiguration
.
getProcessDiagramGenerator
();
InputStream
imageStream
=
diagramGenerator
.
generateDiagram
(
bpmnModel
,
"png"
,
activeActivityIds
,
new
ArrayList
<
String
>(),
"宋体"
,
"宋体"
,
null
,
null
,
1.0
);
byte
[]
bytes
=
IOUtils
.
toByteArray
(
imageStream
);
return
bytes
;
}
}
src/main/resources/templates/deployment/deplyment.html
0 → 100644
View file @
aa25e164
<!DOCTYPE html>
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
Title
</title>
<link
rel=
"stylesheet"
th:href=
"@{/css/common/base.css}"
/>
<link
rel=
"stylesheet"
th:href=
"@{/css/common/page_new.css}"
/>
<link
rel=
"stylesheet"
th:href=
"@{/js/plugins/bootstrapselect/css/product_list.css}"
/>
<link
rel=
"stylesheet"
th:href=
"@{/css/layui.css}"
media=
"all"
>
<link
rel=
"stylesheet"
href=
"https://unpkg.com/element-ui/lib/theme-chalk/index.css"
>
<script
src=
"https://unpkg.com/element-ui/lib/index.js"
></script>
</head>
<style>
#goBack
{
background
:
#fff
no-repeat
5px
center
;
}
</style>
<body>
<div
class=
"box"
>
<h2><span></span>
流程查看
<button
id=
"goBack"
onclick=
"javascript:history.go(-1)"
style=
"margin-right: 100px"
>
返回
</button><button
onclick=
"location.reload()"
>
刷新
</button></h2>
<img
id=
"image"
>
</div>
<input
type=
"hidden"
id=
"taskId"
th:value=
"${taskId}"
>
<input
type=
"hidden"
id=
"executionId"
th:value=
"${executionId}"
>
</body>
</html>
<script
src=
"/js/plugins/jquery.min.js"
></script>
<script
src=
"/js/plugins/layer/layer.js"
></script>
<script
src=
"/js/layui.js"
></script>
<script
type=
"text/javascript"
src=
"/js/plugins/page_new.js"
></script>
<script>
$
(
function
()
{
var
taskId
=
$
(
"#taskId"
).
val
()
var
executionId
=
$
(
"#executionId"
).
val
()
var
url
=
"http://localhost:8087/api/bpm/task/process/trace/current?executionId="
+
executionId
+
"&taskId="
+
taskId
$
(
"#image"
).
attr
(
"src"
,
url
)
})
</script>
src/main/resources/templates/deployment/initiatedDeployList.html
View file @
aa25e164
...
...
@@ -144,7 +144,7 @@
var
total
=
data
.
total
;
data
=
data
.
list
;
var
content
=
''
;
content
+=
'<thead><tr><th>流程实例Id</th><th>流程名称</th><th style="width: 8%">业务密钥</th><th>当前审批人</th><th style="width: 8%">审批节点名称</th><th style="width: 8%">审批开始时间</th><th style="width: 8%">审批结束时间</th></tr></thead>'
;
content
+=
'<thead><tr><th>流程实例Id</th><th>流程名称</th><th style="width: 8%">业务密钥</th><th>当前审批人</th><th style="width: 8%">审批节点名称</th><th style="width: 8%">审批开始时间</th><th style="width: 8%">审批结束时间</th><
th style="width: 8%">操作</th><
/tr></thead>'
;
if
(
data
!=
null
){
for
(
var
i
in
data
)
{
if
(
data
[
i
].
endTime
==
null
){
...
...
@@ -158,6 +158,11 @@
content
+=
'<td class="product_name" style="width: 5%;">'
+
data
[
i
].
processNodeName
+
'</td>'
;
content
+=
'<td class="product_name" style="width: 5%;">'
+
data
[
i
].
startTime
+
'</td>'
;
content
+=
'<td class="product_name" style="width: 5%;">'
+
data
[
i
].
endTime
+
'</td>'
;
if
(
data
[
i
].
name
==
'已审批完成'
){
content
+=
'<td class="cao_zuo" disabled><span style="width: 16%">完成</span>'
;
}
else
{
content
+=
'<td class="cao_zuo"><span style="width: 16%" onclick="toActivityDetail('
+
data
[
i
].
taskId
+
',
\'
'
+
data
[
i
].
executionId
+
'
\'
)">查看</span>'
;
}
content
+=
'</tr></tbody>'
;
}
$
(
'#pages'
).
text
(
pages
);
...
...
@@ -202,6 +207,13 @@
},
'json'
)
flushHtml
(
null
,
taskStatus
);
}
/*查看流程 */
function
toActivityDetail
(
taskId
,
executionId
)
{
location
.
href
=
"/web/bpm/user/toSee?taskId="
+
taskId
+
"&executionId="
+
executionId
}
</script>
...
...
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