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
Show 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
ALTER TABLE WF_APPROVALRULEHANDLERUIPERM
ADD (FORM_FIELD_ID VARCHAR2(32) );
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;
...
@@ -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.EasySearchParse
;
import
com.huigou.uasp.bmp.common.easysearch.domain.model.QuerySchemeField
;
import
com.huigou.uasp.bmp.common.easysearch.domain.model.QuerySchemeField
;
import
com.huigou.uasp.bmp.opm.application.impl.MemEasySearcherImpl
;
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.application.ProcDefinitionApplication
;
import
com.huigou.uasp.bpm.managment.domain.model.ProcDefinition
;
import
com.huigou.uasp.bpm.managment.domain.model.ProcDefinition
;
import
com.huigou.uasp.client.CommonController
;
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
;
package
com
.
huigou
.
uasp
.
bpm
.
engine
.
controller
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.stream.Collectors
;
import
java.util.List
;
import
java.util.Map
;
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.impl.pvm.process.ActivityImpl
;
import
org.activiti.engine.runtime.ProcessInstance
;
import
org.activiti.engine.runtime.ProcessInstance
;
import
org.activiti.engine.task.Comment
;
import
org.activiti.engine.task.Comment
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.util.Assert
;
import
org.springframework.util.Assert
;
...
@@ -138,6 +145,33 @@ public class WorkflowController extends CommonController {
...
@@ -138,6 +145,33 @@ public class WorkflowController extends CommonController {
return
success
();
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
()
{
public
String
startProcessInstanceByKey
()
{
SDO
params
=
this
.
getSDO
();
SDO
params
=
this
.
getSDO
();
Map
<
String
,
Object
>
variables
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
variables
=
new
HashMap
<
String
,
Object
>();
...
@@ -1019,7 +1053,7 @@ public class WorkflowController extends CommonController {
...
@@ -1019,7 +1053,7 @@ public class WorkflowController extends CommonController {
return
this
.
toResult
(
data
);
return
this
.
toResult
(
data
);
}
}
public
String
queryProcUnitHandler
(){
public
String
queryProcUnitHandler
()
{
SDO
params
=
this
.
getSDO
();
SDO
params
=
this
.
getSDO
();
String
procUnitHandlerId
=
params
.
getString
(
"procUnitHandlerId"
);
String
procUnitHandlerId
=
params
.
getString
(
"procUnitHandlerId"
);
ProcUnitHandler
procUnitHandler
=
this
.
workflowApplication
.
getProcUnitHandlerService
().
loadProcUnitHandler
(
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() {
...
@@ -133,16 +133,21 @@ function deployProcessHandler() {
// 配置
// 配置
function
deployProcess
(
id
)
{
function
deployProcess
(
id
)
{
var
html
=
[
'<div class="
ui-form" style="width:340px
">'
],
var
html
=
[
'<div class="
hg-form
">'
],
fields
=
[
fields
=
[
{
id
:
'filePath'
,
text
:
'流程文件路径'
,
type
:
'text'
}
{
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}'/>"
);
var
template
=
[
'<div class="hg-form-row">'
];
template
.
push
(
"</dd>"
);
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
)
{
$
.
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
(
'{text}'
,
o
.
text
)
.
replace
(
'{value}'
,
o
.
value
||
''
)
.
replace
(
'{value}'
,
o
.
value
||
''
)
.
replace
(
'{type}'
,
o
.
type
));
.
replace
(
'{type}'
,
o
.
type
));
...
@@ -153,6 +158,18 @@ function deployProcess(id) {
...
@@ -153,6 +158,18 @@ function deployProcess(id) {
title
:
'发布流程'
,
title
:
'发布流程'
,
height
:
100
,
height
:
100
,
content
:
html
.
join
(
''
),
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
()
{
ok
:
function
()
{
var
fileName
=
$
(
"#filePath"
).
val
();
var
fileName
=
$
(
"#filePath"
).
val
();
if
(
!
fileName
)
return
;
if
(
!
fileName
)
return
;
...
@@ -448,6 +465,6 @@ function openProcessModelerHandler() {
...
@@ -448,6 +465,6 @@ function openProcessModelerHandler() {
UICtrl
.
addTabItem
({
UICtrl
.
addTabItem
({
tabid
:
'ProcessModeler'
+
obj
.
id
,
tabid
:
'ProcessModeler'
+
obj
.
id
,
text
:
'['
+
obj
.
name
+
'] 模型'
,
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