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
8a7545d7
Commit
8a7545d7
authored
Jul 14, 2025
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新代码
parent
c855e24d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
13 deletions
+8
-13
ComprehensiveStatisticalAnalysisServiceImpl.java
...ice/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
+8
-13
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 @
8a7545d7
...
...
@@ -2641,9 +2641,6 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
String
companyIndex
=
StatisticalAnalysisEnum
.
company
.
getKey
();
String
personIndex
=
StatisticalAnalysisEnum
.
person
.
getKey
();
List
<
Long
>
collect
=
data
.
stream
().
map
(
e
->
Long
.
valueOf
(
e
.
get
(
"value"
).
toString
())).
collect
(
Collectors
.
toList
());
Long
otherCount
=
collect
.
stream
().
reduce
(
0L
,
Long:
:
sum
);
if
(
businessType
.
equals
(
StatisticalAnalysisEnum
.
equip
.
getCode
()))
{
// 获取企业总数
Long
companyCount
=
getStaticCount
(
companyBoolMust
,
companyIndex
);
...
...
@@ -2651,7 +2648,6 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
Long
personCount
=
getStaticCount
(
personBoolMust
,
personIndex
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
company
.
getCode
(),
companyCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
person
.
getCode
(),
personCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
equip
.
getCode
(),
otherCount
);
}
else
if
(
businessType
.
equals
(
StatisticalAnalysisEnum
.
company
.
getCode
()))
{
// 获取设备总数
Long
equipCount
=
getStaticCount
(
equipBoolMust
,
equipIndex
);
...
...
@@ -2659,7 +2655,6 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
Long
personCount
=
getStaticCount
(
personBoolMust
,
personIndex
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
equip
.
getCode
(),
equipCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
person
.
getCode
(),
personCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
company
.
getCode
(),
otherCount
);
}
else
{
// 获取设备总数
Long
equipCount
=
getStaticCount
(
equipBoolMust
,
equipIndex
);
...
...
@@ -2667,7 +2662,6 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
Long
companyCount
=
getStaticCount
(
companyBoolMust
,
companyIndex
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
equip
.
getCode
(),
equipCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
company
.
getCode
(),
companyCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
person
.
getCode
(),
otherCount
);
}
}
...
...
@@ -2703,26 +2697,27 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
groupField
=
"EQU_DEFINE_CODE"
;
}
}
List
<
Map
<
String
,
Object
>>
staticCountByGroup
=
getStaticCountByGroup
(
request
,
builder
,
boolMust
,
groupField
);
List
<
Map
<
String
,
Object
>>
staticCountByGroup
=
new
ArrayList
<>();
getStaticCountByGroup
(
request
,
builder
,
boolMust
,
groupField
,
tabTotalMap
,
staticCountByGroup
,
StatisticalAnalysisEnum
.
equip
.
getCode
()
);
return
staticCountByGroup
;
}
private
List
<
Map
<
String
,
Object
>>
getStaticCountByGroup
(
SearchRequest
request
,
SearchSourceBuilder
builder
,
BoolQueryBuilder
boolMust
,
String
groupField
)
{
private
void
getStaticCountByGroup
(
SearchRequest
request
,
SearchSourceBuilder
builder
,
BoolQueryBuilder
boolMust
,
String
groupField
,
Map
<
String
,
Object
>
tabTotalMap
,
List
<
Map
<
String
,
Object
>>
staticCountByGroup
,
String
businessType
)
{
builder
.
query
(
boolMust
);
builder
.
aggregation
(
AggregationBuilders
.
terms
(
groupField
).
field
(
groupField
).
missing
(
"null"
));
request
.
source
(
builder
);
List
<
Map
<
String
,
Object
>>
data
=
new
ArrayList
<>();
try
{
SearchResponse
response
=
restHighLevelClient
.
search
(
request
,
RequestOptions
.
DEFAULT
);
Terms
terms
=
response
.
getAggregations
().
get
(
groupField
);
Map
<
String
,
Object
>
groupMap
=
new
HashMap
<>()
;
Long
otherCount
=
0L
;
for
(
Terms
.
Bucket
bucket
:
terms
.
getBuckets
())
{
Map
<
String
,
Object
>
groupMap
=
new
HashMap
<>();
groupMap
.
put
(
bucket
.
getKeyAsString
(),
bucket
.
getDocCount
());
data
.
add
(
groupMap
);
staticCountByGroup
.
add
(
groupMap
);
otherCount
+=
bucket
.
getDocCount
();
}
return
data
;
tabTotalMap
.
put
(
businessType
,
otherCount
)
;
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
...
...
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