Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
test
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
邬友楠
test
Commits
4a3df56d
Commit
4a3df56d
authored
Oct 27, 2020
by
雍欢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发布流程时可以通过easysearch查询已有bpmn xml文件
parent
83e6a7b0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
91 additions
and
36 deletions
+91
-36
README.md
README.md
+5
-0
ModelController.java
.../java/com/huigou/explorer/controller/ModelController.java
+0
-1
WorkflowController.java
...huigou/uasp/bpm/engine/controller/WorkflowController.java
+62
-28
ProcessManage.js
huigou-xt/src/main/webapp/system/configtool/ProcessManage.js
+24
-7
No files found.
README.md
View file @
4a3df56d
ALTER TABLE WF_PROCDEF
ADD (FORM_NO VARCHAR2(128) );
COMMENT ON COLUMN WF_PROCDEF.FORM_NO IS '表单编号';
ALTER TABLE WF_APPROVALRULEHANDLERUIPERM
ADD (FORM_FIELD_ID VARCHAR2(32) );
...
...
huigou-explorer/src/main/java/com/huigou/explorer/controller/ModelController.java
View file @
4a3df56d
...
...
@@ -11,7 +11,6 @@ import com.huigou.uasp.bmp.common.easysearch.EasySearch;
import
com.huigou.uasp.bmp.common.easysearch.domain.model.EasySearchParse
;
import
com.huigou.uasp.bmp.common.easysearch.domain.model.QuerySchemeField
;
import
com.huigou.uasp.bmp.opm.application.impl.MemEasySearcherImpl
;
import
com.huigou.uasp.bpm.FlowBroker
;
import
com.huigou.uasp.bpm.managment.application.ProcDefinitionApplication
;
import
com.huigou.uasp.bpm.managment.domain.model.ProcDefinition
;
import
com.huigou.uasp.client.CommonController
;
...
...
huigou-uasp/src/main/java/com/huigou/uasp/bpm/engine/controller/WorkflowController.java
View file @
4a3df56d
package
com
.
huigou
.
uasp
.
bpm
.
engine
.
controller
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
com.huigou.uasp.bmp.common.easysearch.EasySearch
;
import
com.huigou.uasp.bmp.common.easysearch.domain.model.EasySearchParse
;
import
com.huigou.uasp.bmp.common.easysearch.domain.model.QuerySchemeField
;
import
com.huigou.uasp.bmp.opm.application.impl.MemEasySearcherImpl
;
import
io.github.classgraph.ClassGraph
;
import
io.github.classgraph.Resource
;
import
io.github.classgraph.ScanResult
;
import
org.activiti.engine.impl.pvm.process.ActivityImpl
;
import
org.activiti.engine.runtime.ProcessInstance
;
import
org.activiti.engine.task.Comment
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.util.Assert
;
...
...
@@ -44,7 +51,7 @@ import com.huigou.util.StringUtil;
/**
* 工作流
*
*
* @author gongmm
*/
@Controller
...
...
@@ -138,6 +145,33 @@ public class WorkflowController extends CommonController {
return
success
();
}
/**
* 查询流程定义文件
*/
@EasySearch
(
configType
=
"bpm"
,
queryName
=
"bpmnModelXml"
)
public
Object
searchBpmnModelXml
(
SDO
sdo
)
{
Integer
intPage
=
sdo
.
getInteger
(
"intPage"
,
1
);
Integer
pageSize
=
sdo
.
getInteger
(
"pageSize"
);
PageRequest
pageRequest
=
new
PageRequest
(
intPage
-
1
,
pageSize
);
String
paramValue
=
sdo
.
getString
(
"paramValue"
);
List
<
QuerySchemeField
>
fields
=
Arrays
.
asList
(
new
QuerySchemeField
(
"流程定义文件"
,
"name"
,
"string"
,
600L
));
EasySearchParse
easySearchParse
=
new
EasySearchParse
();
easySearchParse
.
setFields
(
fields
);
easySearchParse
.
setWidth
(
600L
);
try
(
ScanResult
scanResult
=
new
ClassGraph
().
scan
())
{
List
<
Map
<
String
,
Object
>>
bpmnModelXMLs
=
scanResult
.
getResourcesWithExtension
(
"bpmn"
).
stream
()
.
map
(
file
->
{
Map
<
String
,
Object
>
bpmnModelXML
=
new
HashMap
<>(
1
);
bpmnModelXML
.
put
(
"name"
,
file
.
getPath
().
replace
(
"WEB-INF/classes/"
,
""
));
return
bpmnModelXML
;
}).
collect
(
Collectors
.
toList
());
return
new
MemEasySearcherImpl
<
Map
<
String
,
Object
>>().
search
(
bpmnModelXMLs
,
easySearchParse
,
pageRequest
,
(
bpmnModelXML
->
StringUtils
.
isBlank
(
paramValue
)
||
((
String
)
bpmnModelXML
.
get
(
"name"
)).
contains
(
paramValue
)));
}
}
public
String
startProcessInstanceByKey
()
{
SDO
params
=
this
.
getSDO
();
Map
<
String
,
Object
>
variables
=
new
HashMap
<
String
,
Object
>();
...
...
@@ -185,7 +219,7 @@ public class WorkflowController extends CommonController {
/**
* 流转
*
*
* @return
*/
public
String
advance
()
{
...
...
@@ -220,7 +254,7 @@ public class WorkflowController extends CommonController {
/**
* 完成任务
*
*
* @return
*/
public
String
completeTask
()
{
...
...
@@ -249,7 +283,7 @@ public class WorkflowController extends CommonController {
/**
* 转交
*
*
* @return
*/
public
String
transmit
()
{
...
...
@@ -288,7 +322,7 @@ public class WorkflowController extends CommonController {
/**
* 保存业务数据
*
*
* @return
*/
public
String
saveBizData
()
{
...
...
@@ -314,7 +348,7 @@ public class WorkflowController extends CommonController {
/**
* 终止任务
*
*
* @return
*/
public
String
abortTask
()
{
...
...
@@ -326,7 +360,7 @@ public class WorkflowController extends CommonController {
/**
* 删除流程实例
*
*
* @return
*/
public
String
deleteProcessInstance
()
{
...
...
@@ -482,7 +516,7 @@ public class WorkflowController extends CommonController {
/**
* 查询待办任务
*
*
* @return
*/
public
String
queryTasks
()
{
...
...
@@ -521,7 +555,7 @@ public class WorkflowController extends CommonController {
/**
* 获取任务节点信息
*
*
* @return String
*/
public
String
getProcedureInfo
()
{
...
...
@@ -534,7 +568,7 @@ public class WorkflowController extends CommonController {
/**
* 查询审批历史
*
*
* @return
*/
public
String
queryApprovalHistoryByProcInstId
()
{
...
...
@@ -558,7 +592,7 @@ public class WorkflowController extends CommonController {
/**
* 显示审批历史
*
*
* @return
*/
public
String
showApprovalHistory
()
{
...
...
@@ -573,7 +607,7 @@ public class WorkflowController extends CommonController {
/**
* 显示回退查询
*
*
* @return
*/
public
String
showBackQuery
()
{
...
...
@@ -650,7 +684,7 @@ public class WorkflowController extends CommonController {
if
(
procUnitId
.
equalsIgnoreCase
(
"apply"
)
||
isReplenish
)
{
if
(
isReplenish
)
{
ProcessInstance
pi
=
this
.
workflowApplication
.
getRunTimeService
().
createProcessInstanceQuery
()
.
processInstanceBusinessKey
(
String
.
valueOf
(
bizId
)).
singleResult
();
.
processInstanceBusinessKey
(
String
.
valueOf
(
bizId
)).
singleResult
();
Assert
.
notNull
(
pi
,
MessageSourceContext
.
getMessage
(
MessageConstants
.
OBJECT_NOT_FOUND_BY_BIZ_ID
,
"流程实例"
));
processInstanceId
=
pi
.
getProcessInstanceId
();
}
...
...
@@ -707,7 +741,7 @@ public class WorkflowController extends CommonController {
/**
* 显示协审查询
*
*
* @return
*/
public
String
showAssistDialog
()
{
...
...
@@ -729,7 +763,7 @@ public class WorkflowController extends CommonController {
/**
* 协审
*
*
* @return
*/
public
String
assist
()
{
...
...
@@ -780,7 +814,7 @@ public class WorkflowController extends CommonController {
SDO
params
=
this
.
getSDO
();
String
procUnitHandlerId
=
params
.
getString
(
"procUnitHandlerId"
);
ProcUnitHandlerManuscript
procUnitHandlerManuscript
=
this
.
workflowApplication
.
getProcUnitHandlerService
()
.
loadProcUnitHandlerManuscript
(
procUnitHandlerId
);
.
loadProcUnitHandlerManuscript
(
procUnitHandlerId
);
return
this
.
toResult
(
procUnitHandlerManuscript
);
}
...
...
@@ -866,7 +900,7 @@ public class WorkflowController extends CommonController {
/**
* 保存关联任务
*
*
* @return
* @throws
*/
...
...
@@ -896,7 +930,7 @@ public class WorkflowController extends CommonController {
/**
* 插入评论信息
*
*
* @return
* @throws
*/
...
...
@@ -914,7 +948,7 @@ public class WorkflowController extends CommonController {
/**
* 查询品论信息
*
*
* @return
* @throws
*/
...
...
@@ -947,8 +981,8 @@ public class WorkflowController extends CommonController {
String
procUnitId
=
params
.
getProperty
(
"procUnitId"
,
String
.
class
);
String
currentTaskId
=
params
.
getProperty
(
"currentTaskId"
,
String
.
class
);
List
<
Map
<
String
,
Object
>>
handlers
=
this
.
workflowApplication
.
getProcUnitHandlerService
().
groupProcUnitHandlers
(
bizId
,
approvalProcUnitId
,
procUnitId
,
currentTaskId
,
ContextUtil
.
getOperator
().
getUserId
());
currentTaskId
,
ContextUtil
.
getOperator
().
getUserId
());
return
toResult
(
handlers
);
}
...
...
@@ -1018,8 +1052,8 @@ public class WorkflowController extends CommonController {
Map
<
String
,
Object
>
data
=
this
.
workflowApplication
.
slicedQueryProcunitHandler
(
queryRequest
);
return
this
.
toResult
(
data
);
}
public
String
queryProcUnitHandler
(){
public
String
queryProcUnitHandler
()
{
SDO
params
=
this
.
getSDO
();
String
procUnitHandlerId
=
params
.
getString
(
"procUnitHandlerId"
);
ProcUnitHandler
procUnitHandler
=
this
.
workflowApplication
.
getProcUnitHandlerService
().
loadProcUnitHandler
(
procUnitHandlerId
);
...
...
huigou-xt/src/main/webapp/system/configtool/ProcessManage.js
View file @
4a3df56d
...
...
@@ -133,16 +133,21 @@ function deployProcessHandler() {
// 配置
function
deployProcess
(
id
)
{
var
html
=
[
'<div class="
ui-form" style="width:340px
">'
],
var
html
=
[
'<div class="
hg-form
">'
],
fields
=
[
{
id
:
'filePath'
,
text
:
'流程文件路径'
,
type
:
'text'
}
];
var
template
=
[
"<dt style='width:290px'>{text}<font color='#FF0000'>*</font> :</dt>"
];
template
.
push
(
"<dd style='width:330px'>"
);
template
.
push
(
"<input type='{type}' class='text' id='{id}' maxlength='300' value='{value}'/>"
);
template
.
push
(
"</dd>"
);
var
template
=
[
'<div class="hg-form-row">'
];
template
.
push
(
'<div class="col-xs-4 col-sm-4"><label class="hg-form-label">{text}</label></div>'
);
template
.
push
(
'<div class="col-xs-8 col-white-bg col-sm-8">'
)
template
.
push
(
'<input type="{type}" name="{id}" value="{value}" id="{id}">'
);
template
.
push
(
'</div>'
)
template
.
push
(
'</div>'
);
$
.
each
(
fields
,
function
(
i
,
o
)
{
html
.
push
(
template
.
join
(
''
).
replace
(
'{id}'
,
o
.
id
)
html
.
push
(
template
.
join
(
''
).
replace
All
(
'{id}'
,
o
.
id
)
.
replace
(
'{text}'
,
o
.
text
)
.
replace
(
'{value}'
,
o
.
value
||
''
)
.
replace
(
'{type}'
,
o
.
type
));
...
...
@@ -153,6 +158,18 @@ function deployProcess(id) {
title
:
'发布流程'
,
height
:
100
,
content
:
html
.
join
(
''
),
init
:
function
(
div
)
{
div
.
find
(
'[name="filePath"]'
).
searchbox
({
type
:
'bpm'
,
name
:
'bpmnModelXml'
,
getParam
:
function
()
{
return
{};
},
onChange
:
function
(
data
)
{
$
(
'#implementation'
,
div
).
val
(
data
.
text
?
(
'#{'
+
data
.
text
+
'}'
)
:
data
.
text
);
}
});
},
ok
:
function
()
{
var
fileName
=
$
(
"#filePath"
).
val
();
if
(
!
fileName
)
return
;
...
...
@@ -448,6 +465,6 @@ function openProcessModelerHandler() {
UICtrl
.
addTabItem
({
tabid
:
'ProcessModeler'
+
obj
.
id
,
text
:
'['
+
obj
.
name
+
'] 模型'
,
url
:
web_app
.
name
+
'/procDefinition/forwardModeler.do?id='
+
obj
.
id
,
url
:
web_app
.
name
+
'/procDefinition/forwardModeler.do?id='
+
obj
.
id
,
})
}
\ No newline at end of file
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