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
9f929833
Commit
9f929833
authored
Apr 24, 2020
by
chenweisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
b19cb9f0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
13 deletions
+28
-13
TaskController.java
...in/java/com/keymobile/rest/controller/TaskController.java
+21
-13
ProcessDao.java
src/main/java/com/keymobile/rest/dao/ProcessDao.java
+2
-0
ProcessService.java
src/main/java/com/keymobile/rest/service/ProcessService.java
+5
-0
No files found.
src/main/java/com/keymobile/rest/controller/TaskController.java
View file @
9f929833
...
@@ -347,26 +347,34 @@ public class TaskController {
...
@@ -347,26 +347,34 @@ public class TaskController {
public
SimplePage
viewTasksProgress
(
int
pageNo
,
int
pageSize
)
{
public
SimplePage
viewTasksProgress
(
int
pageNo
,
int
pageSize
)
{
String
orderBy
=
"descending"
;
//
String
orderBy
=
"descending"
;
//
String
propBy
=
"id"
;
// groupBy
String
propBy
=
"id"
;
// groupBy
Page
<
Process
>
page
=
processService
.
findAll
(
pageNo
,
pageSize
,
orderBy
,
propBy
);
Page
<
Process
>
page
=
processService
.
findAll
ByActivityStatus
(
Activity
.
STATUS_BEGIN
,
pageNo
,
pageSize
,
orderBy
,
propBy
);
List
<
Process
>
processes
=
page
.
getContent
();
List
<
Process
>
processes
=
page
.
getContent
();
List
<
Map
>
list
=
new
ArrayList
<>();
List
<
Map
>
list
=
new
ArrayList
<>();
processes
.
forEach
(
process
->
{
processes
.
forEach
(
process
->
{
Map
map
=
new
HashMap
();
Map
map
=
new
HashMap
();
map
.
put
(
"id"
,
process
.
getId
());
map
.
put
(
"id"
,
process
.
getId
());
List
<
HistoricActivityInstance
>
lisst
=
historyService
// 历史相关Service
//
List<HistoricActivityInstance> lisst = historyService // 历史相关Service
.
createHistoricActivityInstanceQuery
()
// 创建历史活动实例查询
//
.createHistoricActivityInstanceQuery() // 创建历史活动实例查询
.
processInstanceId
(
process
.
getProcessId
())
// 执行流程实例id
//
.processInstanceId(process.getProcessId()) // 执行流程实例id
.
finished
()
//
.finished()
.
list
();
//
.list();
for
(
HistoricActivityInstance
hai
:
lisst
)
{
//
for (HistoricActivityInstance hai : lisst) {
System
.
out
.
println
(
"活动ID:"
+
hai
.
getId
());
//
System.out.println("活动ID:" + hai.getId());
}
//
}
List
<
ProcessInstance
>
s
=
runtimeService
.
createProcessInstanceQuery
()
List
<
ProcessInstance
>
s
=
runtimeService
.
createProcessInstanceQuery
()
.
processInstanceId
(
process
.
getProcessId
())
.
processInstanceId
(
process
.
getProcessId
())
.
active
()
.
list
();
.
list
();
for
(
ProcessInstance
hai
:
s
)
{
List
<
Task
>
asda
=
taskService
.
createTaskQuery
()
System
.
out
.
println
(
"活动ID:"
+
hai
.
getId
());
.
processInstanceId
(
process
.
getProcessId
()).
active
()
System
.
out
.
println
(
"流程实例ID:"
+
hai
.
getProcessInstanceId
()
+
hai
.
isEnded
()
+
hai
.
isSuspended
());
.
list
();
for
(
Task
hai
:
asda
)
{
int
nrOfInstances
=
Integer
.
parseInt
(
runtimeService
.
getVariable
(
hai
.
getExecutionId
(),
"nrOfInstances"
).
toString
());
// 当前获取的会签任务数量
int
nrOfActiveInstances
=
Integer
.
parseInt
(
runtimeService
.
getVariable
(
hai
.
getExecutionId
(),
"nrOfActiveInstances"
).
toString
());
// 已经完成的会签任务数量
int
nrOfCompletedInstances
=
Integer
.
parseInt
(
runtimeService
.
getVariable
(
hai
.
getExecutionId
(),
"nrOfCompletedInstances"
).
toString
());
System
.
out
.
println
(
nrOfInstances
+
"*"
+
nrOfActiveInstances
+
"*"
+
nrOfCompletedInstances
);
}
}
});
});
return
SimplePage
.
of
(
page
,
list
);
return
SimplePage
.
of
(
page
,
list
);
...
...
src/main/java/com/keymobile/rest/dao/ProcessDao.java
View file @
9f929833
...
@@ -11,4 +11,6 @@ public interface ProcessDao extends JpaRepository<Process, Long> {
...
@@ -11,4 +11,6 @@ public interface ProcessDao extends JpaRepository<Process, Long> {
Page
<
Process
>
findAll
(
Pageable
pageable
);
Page
<
Process
>
findAll
(
Pageable
pageable
);
Page
<
Process
>
findAllByActivity_status
(
int
status
,
Pageable
pageable
);
}
}
src/main/java/com/keymobile/rest/service/ProcessService.java
View file @
9f929833
...
@@ -32,6 +32,11 @@ public class ProcessService {
...
@@ -32,6 +32,11 @@ public class ProcessService {
return
processDao
.
findAll
(
pageable
);
return
processDao
.
findAll
(
pageable
);
}
}
public
Page
<
Process
>
findAllByActivityStatus
(
int
status
,
int
pageNo
,
int
pageSize
,
String
orderBy
,
String
propBy
)
{
Pageable
pageable
=
convert
(
pageNo
,
pageSize
,
orderBy
,
propBy
);
return
processDao
.
findAllByActivity_status
(
status
,
pageable
);
}
private
Pageable
convert
(
int
pageNo
,
int
pageSize
,
String
orderBy
,
String
propBy
)
{
private
Pageable
convert
(
int
pageNo
,
int
pageSize
,
String
orderBy
,
String
propBy
)
{
pageNo
--;
pageNo
--;
if
(
pageNo
<
0
)
{
if
(
pageNo
<
0
)
{
...
...
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