Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
f813eeb5
Commit
f813eeb5
authored
Aug 19, 2025
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
大屏设备统计-增加一类二类三类数据块
parent
2c65fde4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
1 deletion
+30
-1
ComprehensiveStatisticalAnalysisServiceImpl.java
...ice/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
+30
-1
No files found.
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
View file @
f813eeb5
...
...
@@ -3286,6 +3286,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
Map
<
String
,
Object
>
staticCountByGroup
=
new
HashMap
<>();
// 组装数据
List
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
dataMapList
=
new
ArrayList
<>();
// 当设备默认进入时候,提前复制前置查询条件,供气瓶提级使用
BoolQueryBuilder
gasBoolQueryBuilder
=
new
BoolQueryBuilder
();
...
...
@@ -3307,6 +3308,9 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
List
<
String
>
codes
=
new
ArrayList
<>();
BoolQueryBuilder
pipeBoolMust
=
QueryBuilderUtils
.
copyBoolQuery
(
boolMust
);
Long
oneClassCount
=
0L
;
Long
twoClassCount
=
0L
;
Long
threeClassCount
=
0L
;
for
(
Map
<
String
,
Object
>
categoryMap
:
staticCountByGroupMap
)
{
BoolQueryBuilder
queryBuilder
=
QueryBuilderUtils
.
copyBoolQuery
(
pipeBoolMust
);
String
code
=
categoryMap
.
get
(
"value"
).
toString
();
...
...
@@ -3339,6 +3343,11 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
SearchSourceBuilder
scoreBuilder
=
new
SearchSourceBuilder
();
Map
<
String
,
Object
>
scoreCountByGroup
=
new
HashMap
<>();
getStatisticCountByGroup
(
request
,
scoreBuilder
,
scoreQuery
,
"DATA_QUALITY_SCORE"
,
scoreCountByGroup
,
"scoreCount"
);
if
(!
code
.
startsWith
(
"8"
)){
for
(
String
key
:
scoreCountByGroup
.
keySet
())
{
Long
classCount
=
"1"
.
equals
(
key
)
?
oneClassCount
+=
(
Long
)
scoreCountByGroup
.
get
(
key
)
:
(
"2"
.
equals
(
key
)
?
(
twoClassCount
+=
(
Long
)
scoreCountByGroup
.
get
(
key
))
:
(
threeClassCount
+=
(
Long
)
scoreCountByGroup
.
get
(
key
)));
}
}
map
.
put
(
"DATA_QUALITY_SCORE"
,
scoreCountByGroup
);
// 统计该分类下红黄绿码分别的分组数量 NEXT_INSPECT_DATE
Map
<
String
,
Long
>
nextInspectCountByGroup
=
new
HashMap
<>();
...
...
@@ -3382,6 +3391,9 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
Map
<
String
,
Object
>
scoreCountByGroup
=
new
HashMap
<>();
getStatisticCountByGroup
(
request
,
scoreBuilder
,
scoreQuery
,
"DATA_QUALITY_SCORE"
,
scoreCountByGroup
,
"scoreCount"
);
map
.
put
(
"DATA_QUALITY_SCORE"
,
scoreCountByGroup
);
for
(
String
key
:
scoreCountByGroup
.
keySet
())
{
Long
classCount
=
"1"
.
equals
(
key
)
?
oneClassCount
+=
(
Long
)
scoreCountByGroup
.
get
(
key
)
:
(
"2"
.
equals
(
key
)
?
(
twoClassCount
+=
(
Long
)
scoreCountByGroup
.
get
(
key
))
:
(
threeClassCount
+=
(
Long
)
scoreCountByGroup
.
get
(
key
)));
}
// 统计该分类下红黄绿码分别的分组数量 NEXT_INSPECT_DATE
Map
<
String
,
Long
>
nextInspectCountByGroup
=
new
HashMap
<>();
BoolQueryBuilder
nextInspectQuery
=
QueryBuilderUtils
.
copyBoolQuery
(
gasBoolQueryBuilder
);
...
...
@@ -3409,6 +3421,10 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
// 统计种类/类别/品种数据不对的数据字段
if
(!
ObjectUtils
.
isEmpty
(
staticCountByGroup
))
{
statisticOtherCount
(
request
,
dataMapList
,
staticCountByGroup
,
boolMust
,
groupField
,
equipCode
);
Map
<
String
,
Long
>
otherMap
=
(
Map
<
String
,
Long
>)
dataMapList
.
get
(
dataMapList
.
size
()
-
1
).
get
(
"DATA_QUALITY_SCORE"
);
oneClassCount
+=
otherMap
.
containsKey
(
"1"
)
?
otherMap
.
get
(
"1"
)
:
0L
;
twoClassCount
+=
otherMap
.
containsKey
(
"2"
)
?
otherMap
.
get
(
"2"
)
:
0L
;
threeClassCount
+=
otherMap
.
containsKey
(
"3"
)
?
otherMap
.
get
(
"3"
)
:
0L
;
}
if
(!
ObjectUtils
.
isEmpty
(
equipCode
))
{
...
...
@@ -3423,7 +3439,20 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
tabTotalMap
.
put
(
equipCode
,
dataMapList
.
stream
().
mapToLong
(
map
->
(
Long
)
map
.
get
(
"value"
)).
sum
());
}
}
return
dataMapList
;
for
(
int
i
=
1
;
i
<
4
;
i
++)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"key"
,
i
);
map
.
put
(
"code"
,
i
);
map
.
put
(
"noChild"
,
Boolean
.
TRUE
);
map
.
put
(
"noDetails"
,
Boolean
.
TRUE
);
map
.
put
(
"noBottom"
,
Boolean
.
TRUE
);
map
.
put
(
"fieldKey"
,
"DATA_QUALITY_SCORE"
);
map
.
put
(
"label"
,
i
==
1
?
"一类设备"
:
i
==
2
?
"二类设备"
:
"三类设备"
);
map
.
put
(
"value"
,
i
==
1
?
oneClassCount
:
i
==
2
?
twoClassCount
:
threeClassCount
);
resultList
.
add
(
map
);
}
resultList
.
addAll
(
dataMapList
);
return
resultList
;
}
private
void
statisticOtherCount
(
SearchRequest
request
,
List
<
Map
<
String
,
Object
>>
dataMapList
,
Map
<
String
,
Object
>
staticCountByGroup
,
BoolQueryBuilder
boolMust
,
String
groupField
,
String
equipCode
)
{
...
...
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