Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
device-new-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
device-new-platform
Commits
8f590716
Commit
8f590716
authored
Apr 01, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改统计逻辑
parent
47275a79
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
11 deletions
+17
-11
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceMessageStatController.java
...ls/xhx/module/device/web/DeviceMessageStatController.java
+17
-11
No files found.
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceMessageStatController.java
View file @
8f590716
...
...
@@ -48,6 +48,8 @@ public class DeviceMessageStatController extends BaseCRUDJsonBodyMappingControll
List
<
DeviceMessageStatEntity
>
statEntities
=
(
List
<
DeviceMessageStatEntity
>)
model
.
get
(
KEY_RESULT_DATA
);
//重新分组返回 [{date:2024-8}]
if
(!
ObjectUtils
.
isEmpty
(
statEntities
))
{
//按月分组
Map
<
Integer
,
Map
<
String
,
List
<
DeviceMessageStatEntity
>>>
collect
=
statEntities
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
DeviceMessageStatEntity:
:
getMonth
,
Collectors
.
groupingBy
(
DeviceMessageStatEntity:
:
getProductName
,
...
...
@@ -62,6 +64,9 @@ public class DeviceMessageStatController extends BaseCRUDJsonBodyMappingControll
}
else
{
productEntities
=
productService
.
find
(
new
ProductEntity
());
}
String
month
=
query
.
getGroupList
().
stream
().
filter
(
f
->
"month"
.
equals
(
f
)).
findFirst
().
orElseGet
(()
->
null
);
if
(!
ObjectUtils
.
isEmpty
(
month
))
{
for
(
int
i
=
1
;
i
<=
12
;
i
++)
{
if
(!
collect
.
containsKey
(
i
))
{
Map
<
String
,
List
<
DeviceMessageStatEntity
>>
map
=
new
HashMap
<>();
...
...
@@ -76,6 +81,7 @@ public class DeviceMessageStatController extends BaseCRUDJsonBodyMappingControll
monthStat
.
put
(
i
,
0
);
}
}
}
model
.
put
(
"stat"
,
collect
);
model
.
put
(
"monthStat"
,
monthStat
);
...
...
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