Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
datacollector
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
chenweisong
datacollector
Commits
7419a00f
Commit
7419a00f
authored
Apr 24, 2020
by
chenweisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
1e7adaf5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
11 deletions
+40
-11
TaskController.java
...in/java/com/keymobile/rest/controller/TaskController.java
+40
-11
No files found.
src/main/java/com/keymobile/rest/controller/TaskController.java
View file @
7419a00f
...
...
@@ -347,20 +347,49 @@ public class TaskController {
Page
<
Process
>
page
=
processService
.
findAll
(
pageNo
,
pageSize
,
orderBy
,
propBy
);
List
<
Process
>
processes
=
page
.
getContent
();
List
<
Map
>
list
=
new
ArrayList
<>();
processes
.
forEach
(
process
->
{
Map
map
=
new
HashMap
();
map
.
put
(
"id"
,
process
.
getId
());
try
{
processes
.
forEach
(
process
->
{
Map
map
=
new
HashMap
();
map
.
put
(
"id"
,
process
.
getId
());
HistoricProcessInstance
historicProcessInstance
=
historyService
.
createHistoricProcessInstanceQuery
().
processInstanceId
(
process
.
getProcessId
()).
singleResult
();
int
total
=
0
;
int
completed
=
0
;
String
status
=
"已完成"
;
if
(
historicProcessInstance
.
getEndTime
()
==
null
)
{
List
<
Task
>
taskList
=
taskService
.
createTaskQuery
().
processInstanceId
(
process
.
getProcessId
()).
list
();
if
(
taskList
.
size
()
>
0
)
{
Task
task
=
taskList
.
get
(
0
);
if
(
task
.
getTaskDefinitionKey
().
equals
(
CommonConstant
.
MISSION_KEY_MANAGER_AUDIT
))
{
total
=
process
.
getDataInfoList
().
size
();
completed
=
process
.
getDataInfoList
().
size
();
status
=
"待确认"
;
}
else
if
(
task
.
getTaskDefinitionKey
().
equals
(
CommonConstant
.
MISSION_KEY_DATA_AUDIT
)
||
task
.
getTaskDefinitionKey
().
equals
(
CommonConstant
.
MISSION_KEY_DATA_ENTER
))
{
int
nrOfInstances
=
Integer
.
parseInt
(
runtimeService
.
getVariable
(
taskList
.
get
(
0
).
getExecutionId
(),
"nrOfInstances"
).
toString
());
// 当前获取的会签任务数量
int
nrOfActiveInstances
=
Integer
.
parseInt
(
runtimeService
.
getVariable
(
taskList
.
get
(
0
).
getExecutionId
(),
"nrOfActiveInstances"
).
toString
());
// 已经完成的会签任务数量
int
nrOfCompletedInstances
=
Integer
.
parseInt
(
runtimeService
.
getVariable
(
taskList
.
get
(
0
).
getExecutionId
(),
"nrOfCompletedInstances"
).
toString
());
total
=
nrOfInstances
;
completed
=
nrOfCompletedInstances
;
status
=
"补录中"
;
}
}
}
else
{
total
=
process
.
getDataInfoList
().
size
();
completed
=
process
.
getDataInfoList
().
size
();
HistoricProcessInstance
historicActivityInstances
=
historyService
.
createHistoricProcessInstanceQuery
().
processInstanceId
(
process
.
getProcessId
()).
singleResult
();
}
// int nrOfInstances = Integer.parseInt(runtimeService.getVariable(historicActivityInstances.getProcessVariables(), "nrOfInstances").toString());
// // 当前获取的会签任务数量
// int nrOfActiveInstances = Integer.parseInt(runtimeService.getVariable(historicActivityInstances.getExecutionId(), "nrOfActiveInstances").toString());
// // 已经完成的会签任务数量
// int nrOfCompletedInstances = Integer.parseInt(runtimeService.getVariable(historicActivityInstances.getExecutionId(), "nrOfCompletedInstances").toString());
// System.out.println(nrOfInstances + "*" + nrOfActiveInstances + "*" + nrOfCompletedInstances);
map
.
put
(
"status"
,
status
);
map
.
put
(
"total"
,
total
);
map
.
put
(
"completed"
,
completed
);
list
.
add
(
map
);
});
});
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
SimplePage
.
of
(
page
,
list
);
}
...
...
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