Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
李苗
/
Vion-DevOps
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 4d6a9f1d
authored
Oct 30, 2024
by
HlQ
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[chg] 任务人员分析计算逻辑修改
1 parent
fc5cf70a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
src/main/java/vion/service/impl/TaskServiceImpl.java
src/main/java/vion/service/impl/TaskServiceImpl.java
View file @
4d6a9f1
...
...
@@ -457,7 +457,7 @@ public class TaskServiceImpl extends MPJBaseServiceImpl<TaskMapper, Task> implem
List
<
FaultLog
>
logList
=
faultLogService
.
lambdaQuery
().
list
();
Map
<
Long
,
Double
>
taskId2HourMap
=
logList
.
stream
()
.
filter
(
l
->
ObjUtil
.
isNotNull
(
l
.
getManHour
()))
.
collect
(
Collectors
.
groupingBy
(
FaultLog:
:
get
TaskId
,
Collectors
.
summingDouble
(
FaultLog:
:
getManHour
)));
.
collect
(
Collectors
.
groupingBy
(
FaultLog:
:
get
Operator
,
Collectors
.
summingDouble
(
FaultLog:
:
getManHour
)));
// 根据工单日志,判断工单完成人
var
user2TaskIdMap
=
logList
.
stream
()
...
...
@@ -469,7 +469,7 @@ public class TaskServiceImpl extends MPJBaseServiceImpl<TaskMapper, Task> implem
Map
<
Long
,
List
<
Task
>>
p2TaskMap
=
taskList
.
stream
().
collect
(
Collectors
.
groupingBy
(
Task:
:
getActiveUser
));
var
resList
=
new
ArrayList
<
Map
<
String
,
Object
>>();
p2TaskMap
.
forEach
((
p
,
list
)
->
{
var
hourSum
=
list
.
stream
().
mapToDouble
(
v
->
taskId2HourMap
.
getOrDefault
(
v
.
getId
(),
0
D
)).
sum
(
);
var
hourSum
=
taskId2HourMap
.
getOrDefault
(
p
,
0
D
);
var
inList
=
list
.
stream
().
filter
(
v
->
v
.
getStatus
().
equals
(
2
)).
toList
();
var
expList
=
inList
.
stream
().
filter
(
v
->
v
.
getExpDate
().
isAfter
(
LocalDate
.
now
())).
toList
();
...
...
@@ -477,7 +477,7 @@ public class TaskServiceImpl extends MPJBaseServiceImpl<TaskMapper, Task> implem
var
storeIdSet
=
list
.
stream
().
map
(
Task:
:
getStoreId
).
collect
(
Collectors
.
toSet
());
var
storeNameList
=
storeList
.
stream
().
filter
(
v
->
storeIdSet
.
contains
(
v
.
getId
())).
distinct
().
map
(
Store:
:
getName
).
collect
(
Collectors
.
joining
(
","
));
Map
<
String
,
Object
>
cntMap
=
Map
.
of
(
"person"
,
id2UsernameMap
.
get
(
p
),
"total"
,
list
,
"total"
,
CollUtil
.
unionDistinct
(
finishList
,
inList
)
,
"finish"
,
finishList
,
"in"
,
inList
,
"exp"
,
expList
,
...
...
@@ -486,7 +486,7 @@ public class TaskServiceImpl extends MPJBaseServiceImpl<TaskMapper, Task> implem
resList
.
add
(
cntMap
);
});
// resList 按照 total对应的list的size降序排列
resList
.
sort
((
o1
,
o2
)
->
((
List
<
Task
>)
o2
.
get
(
"total"
)).
size
()
-
((
Lis
t
<
Task
>)
o1
.
get
(
"total"
)).
size
());
resList
.
sort
((
o1
,
o2
)
->
((
Set
<
Task
>)
o2
.
get
(
"total"
)).
size
()
-
((
Se
t
<
Task
>)
o1
.
get
(
"total"
)).
size
());
return
resList
;
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment