Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
W
workflow
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
曲欣亮
workflow
Commits
7f87dafb
Commit
7f87dafb
authored
Sep 13, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加流程详情查询接口
parent
479147fa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
10 deletions
+28
-10
AbstractOpenApi.java
src/main/java/com/egolm/workflow/AbstractOpenApi.java
+22
-6
WorkflowEngine.java
...in/java/com/egolm/workflow/interfaces/WorkflowEngine.java
+5
-3
WorkflowService.java
...n/java/com/egolm/workflow/interfaces/WorkflowService.java
+1
-1
No files found.
src/main/java/com/egolm/workflow/AbstractOpenApi.java
View file @
7f87dafb
...
...
@@ -26,7 +26,7 @@ import com.egolm.workflow.interfaces.WorkflowService;
public
abstract
class
AbstractOpenApi
implements
WorkflowEngine
,
WorkflowService
,
WorkflowCallback
{
@Override
public
List
<
Map
<
String
,
Object
>>
queryHistoryWorkList
(
String
sUserID
,
Page
page
)
{
public
List
<
Map
<
String
,
Object
>>
queryHistoryWorkList
ByUserID
(
String
sUserID
,
Page
page
)
{
JdbcTemplate
jdbcTemplate
=
this
.
getFlowDBTemplate
();
TFlowLog
log
=
new
TFlowLog
();
log
.
setsTaskType
(
TaskType
.
start
);
...
...
@@ -47,7 +47,7 @@ public abstract class AbstractOpenApi implements WorkflowEngine, WorkflowService
}
@Override
public
List
<
Map
<
String
,
Object
>>
queryWorkList
(
String
sUserID
,
Page
page
)
{
public
List
<
Map
<
String
,
Object
>>
queryWorkList
ByUserID
(
String
sUserID
,
Page
page
)
{
JdbcTemplate
jdbcTemplate
=
this
.
getFlowDBTemplate
();
List
<
Object
>
objs
=
new
ArrayList
<
Object
>();
List
<
String
>
strs
=
new
ArrayList
<
String
>();
...
...
@@ -63,13 +63,29 @@ public abstract class AbstractOpenApi implements WorkflowEngine, WorkflowService
}
@Override
public
List
<
Map
<
String
,
Object
>>
queryTaskList
(
String
sUserID
,
Page
page
)
{
public
List
<
Map
<
String
,
Object
>>
queryTaskList
ByUserID
(
String
sUserID
,
Page
page
)
{
JdbcTemplate
jdbcTemplate
=
this
.
getFlowDBTemplate
();
String
sql
=
"select ft.* from t_flow_task ft, t_flow_user fu where (ft.sTaskID = fu.sTaskID and fu.sUserID = ?) or ft.sAcceptorID = ?"
;
sql
=
"select t.*, f.sFlowName from ("
+
sql
+
") t left join t_flow f on f.sFlowID = t.sFlowID"
;
return
jdbcTemplate
.
limit
(
sql
,
page
,
sUserID
,
sUserID
);
}
public
Map
<
String
,
Object
>
queryTaskByID
(
String
sTaskID
)
{
JdbcTemplate
jdbcTemplate
=
this
.
getFlowDBTemplate
();
Map
<
String
,
Object
>
map
=
jdbcTemplate
.
queryForMap
(
"select * from t_flow_task where sTaskID = ?"
,
sTaskID
);
String
sFlowID
=
(
String
)
map
.
get
(
"sFlowID"
);
String
sNodeID
=
(
String
)
map
.
get
(
"sNodeID"
);
TFlow
flow
=
this
.
queryFlowById
(
sFlowID
);
String
settings
=
flow
.
getsFlowSettings
();
Map
<?,
?>
settongsMap
=
JSON
.
parseObject
(
settings
);
Map
<?,
?>
nodesMap
=
(
Map
<?,
?>)
settongsMap
.
get
(
"nodes"
);
Map
<?,
?>
nodeMap
=
(
Map
<?,
?>)
nodesMap
.
get
(
sNodeID
);
Map
<?,
?>
transfersMap
=
(
Map
<?,
?>)
nodeMap
.
get
(
"transfers"
);
map
.
put
(
"transfers"
,
transfersMap
);
map
.
put
(
"sFlowSettings"
,
settings
);
return
map
;
}
@Override
@Transactional
public
TFlowTask
start
(
String
sFlowName
,
String
sUserID
,
Map
<
String
,
Object
>
vars
)
{
...
...
@@ -129,7 +145,7 @@ public abstract class AbstractOpenApi implements WorkflowEngine, WorkflowService
}
JdbcTemplate
jdbcTemplate
=
this
.
getFlowDBTemplate
();
TFlowTask
task
=
jdbcTemplate
.
queryForBean
(
"select * from t_flow_task where sTaskID = ?"
,
TFlowTask
.
class
,
sTaskID
);
TFlow
flow
=
jdbcTemplate
.
queryForBean
(
"select * from t_flow where sFlowID = ?"
,
TFlow
.
class
,
task
.
getsFlowID
());
TFlow
flow
=
this
.
queryFlowById
(
task
.
getsFlowID
());
Map
<
String
,
Object
>
mergedVars
=
new
HashMap
<
String
,
Object
>();
String
vars_json
=
task
.
getsVars
();
Map
<?,
?>
dbVars
=
JSON
.
parseObject
(
vars_json
);
...
...
@@ -269,9 +285,9 @@ public abstract class AbstractOpenApi implements WorkflowEngine, WorkflowService
}
@Override
public
Map
<
String
,
Object
>
queryFlowMap
ById
(
String
sFlowID
)
{
public
TFlow
queryFlow
ById
(
String
sFlowID
)
{
JdbcTemplate
jdbcTemplate
=
this
.
getFlowDBTemplate
();
return
jdbcTemplate
.
queryFor
Map
(
"select * from t_flow where sFlowID = ?"
,
sFlowID
);
return
jdbcTemplate
.
queryFor
Bean
(
"select * from t_flow where sFlowID = ?"
,
TFlow
.
class
,
sFlowID
);
}
@Override
...
...
src/main/java/com/egolm/workflow/interfaces/WorkflowEngine.java
View file @
7f87dafb
...
...
@@ -17,11 +17,13 @@ public interface WorkflowEngine {
* @param page
* @return
*/
List
<
Map
<
String
,
Object
>>
queryHistoryWorkList
(
String
sUserID
,
Page
page
);
List
<
Map
<
String
,
Object
>>
queryHistoryWorkList
ByUserID
(
String
sUserID
,
Page
page
);
List
<
Map
<
String
,
Object
>>
queryWorkList
(
String
sUserID
,
Page
page
);
List
<
Map
<
String
,
Object
>>
queryWorkList
ByUserID
(
String
sUserID
,
Page
page
);
List
<
Map
<
String
,
Object
>>
queryTaskList
(
String
sUserID
,
Page
page
);
List
<
Map
<
String
,
Object
>>
queryTaskListByUserID
(
String
sUserID
,
Page
page
);
Map
<
String
,
Object
>
queryTaskByID
(
String
sTaskID
);
TFlowTask
start
(
String
sFlowName
,
String
sUserID
,
Map
<
String
,
Object
>
vars
);
...
...
src/main/java/com/egolm/workflow/interfaces/WorkflowService.java
View file @
7f87dafb
...
...
@@ -29,7 +29,7 @@ public interface WorkflowService {
* @param sFlowID
* @return
*/
Map
<
String
,
Object
>
queryFlowMap
ById
(
String
sFlowID
);
TFlow
queryFlow
ById
(
String
sFlowID
);
/**
* 修改流程定义
...
...
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