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
7557ed3d
Commit
7557ed3d
authored
Jul 15, 2025
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新大屏设备统计接口
parent
bea3202d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
14 deletions
+34
-14
TzsCustomFilterMapper.xml
...s-api/src/main/resources/mapper/TzsCustomFilterMapper.xml
+3
-2
ComprehensiveStatisticalAnalysisServiceImpl.java
...ice/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
+31
-12
No files found.
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/resources/mapper/TzsCustomFilterMapper.xml
View file @
7557ed3d
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
code as value,
code as value,
name as label
name as label
from tz_equipment_category
from tz_equipment_category
where parent_id = #{parentId}
where
is_delete = 0 and
parent_id = #{parentId}
</select>
</select>
<select
id=
"queryEquCategory"
resultType=
"com.alibaba.fastjson.JSONObject"
>
<select
id=
"queryEquCategory"
resultType=
"com.alibaba.fastjson.JSONObject"
>
...
@@ -19,7 +19,8 @@
...
@@ -19,7 +19,8 @@
FROM
FROM
tz_equipment_category
tz_equipment_category
WHERE
WHERE
description = #{description}
is_delete = 0
and description = #{description}
<if
test=
"type != null and type != ''"
>
<if
test=
"type != null and type != ''"
>
AND parent_id = (SELECT id FROM tz_equipment_category where code = #{type})
AND parent_id = (SELECT id FROM tz_equipment_category where code = #{type})
</if>
</if>
...
...
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 @
7557ed3d
...
@@ -110,6 +110,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -110,6 +110,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
private
final
String
DOWNLOAD_TOPIC
=
"/topic/download/excel/%s"
;
private
final
String
DOWNLOAD_TOPIC
=
"/topic/download/excel/%s"
;
private
final
String
BUCKET_NAME
=
"upload"
;
private
final
String
BUCKET_NAME
=
"upload"
;
private
final
String
UPLOAD_PATH
=
"/tzs/excelTempFile"
;
private
final
String
UPLOAD_PATH
=
"/tzs/excelTempFile"
;
// 大屏统计图片路径前缀
private
final
String
dpEquipPhotoPrefix
=
"/upload/tzs/dpscreen/statistic/equip/"
;
private
final
List
<
String
>
equipHandleOtherFields
=
Arrays
.
asList
(
"techParam"
,
"paramRange"
,
"JDJY"
,
"DQJY"
,
"SCJY"
,
"DTJY"
,
"QZ_OR_TANK"
);
private
final
List
<
String
>
equipHandleOtherFields
=
Arrays
.
asList
(
"techParam"
,
"paramRange"
,
"JDJY"
,
"DQJY"
,
"SCJY"
,
"DTJY"
,
"QZ_OR_TANK"
);
private
final
List
<
String
>
companyHandleOtherFields
=
Arrays
.
asList
(
"itemCode"
,
"subItemCode"
,
"permitStatus"
,
"equipCategory"
,
"regulatoryLabels"
,
"unitType"
);
private
final
List
<
String
>
companyHandleOtherFields
=
Arrays
.
asList
(
"itemCode"
,
"subItemCode"
,
"permitStatus"
,
"equipCategory"
,
"regulatoryLabels"
,
"unitType"
);
...
@@ -2687,22 +2689,42 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -2687,22 +2689,42 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
}
JSONArray
typeData
=
filter
.
getJSONArray
(
"typeData"
);
JSONArray
typeData
=
filter
.
getJSONArray
(
"typeData"
);
String
groupField
=
"EQU_LIST_CODE"
;
String
groupField
=
null
;
List
<
Map
<
String
,
Object
>>
staticCountByGroupMap
=
new
ArrayList
<>();
if
(!
ObjectUtils
.
isEmpty
(
typeData
))
{
if
(!
ObjectUtils
.
isEmpty
(
typeData
))
{
String
id
=
null
;
if
(
typeData
.
size
()
==
1
)
{
if
(
typeData
.
size
()
==
1
)
{
groupField
=
"EQU_LIST_CODE"
;
}
else
if
(
typeData
.
size
()
==
2
)
{
groupField
=
"EQU_CATEGORY_CODE"
;
groupField
=
"EQU_CATEGORY_CODE"
;
}
else
if
(
typeData
.
size
()
==
3
)
{
id
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
typeData
.
get
(
0
))).
getString
(
"key"
);
}
else
if
(
typeData
.
size
()
==
2
)
{
groupField
=
"EQU_DEFINE_CODE"
;
groupField
=
"EQU_DEFINE_CODE"
;
id
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
typeData
.
get
(
1
))).
getString
(
"key"
);
}
}
staticCountByGroupMap
=
tzsCustomFilterMapper
.
selectEquipmentCategoryByParentId
(
id
);
}
else
{
groupField
=
"EQU_LIST_CODE"
;
Map
<
String
,
List
<
Map
<
String
,
Object
>>>
resourceJson
=
JsonUtils
.
getResourceJson
(
equipCategory
);
staticCountByGroupMap
=
resourceJson
.
get
(
EquipmentClassifityEnum
.
ZHTJFX
.
getCode
());
}
}
List
<
Map
<
String
,
Object
>>
staticCountByGroup
=
new
ArrayList
<>();
getStaticCountByGroup
(
request
,
builder
,
boolMust
,
groupField
,
tabTotalMap
,
staticCountByGroup
,
StatisticalAnalysisEnum
.
equip
.
getCode
());
return
staticCountByGroup
;
List
<
Map
<
String
,
Long
>>
staticCountByGroup
=
new
ArrayList
<>();
getStaticCountByGroup
(
request
,
builder
,
boolMust
,
groupField
,
staticCountByGroup
);
Long
otherCount
=
staticCountByGroup
.
stream
().
map
(
item
->
item
.
values
().
stream
().
reduce
(
0L
,
Long:
:
sum
)).
reduce
(
0L
,
Long:
:
sum
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
equip
.
getCode
(),
otherCount
);
for
(
Map
<
String
,
Object
>
map
:
staticCountByGroupMap
)
{
}
return
staticCountByGroupMap
;
}
}
private
void
getStaticCountByGroup
(
SearchRequest
request
,
SearchSourceBuilder
builder
,
BoolQueryBuilder
boolMust
,
String
groupField
,
Map
<
String
,
Object
>
tabTotalMap
,
List
<
Map
<
String
,
Object
>>
staticCountByGroup
,
String
businessType
)
{
private
void
getStaticCountByGroup
(
SearchRequest
request
,
SearchSourceBuilder
builder
,
BoolQueryBuilder
boolMust
,
String
groupField
,
List
<
Map
<
String
,
Long
>>
staticCountByGroup
)
{
builder
.
query
(
boolMust
);
builder
.
query
(
boolMust
);
builder
.
aggregation
(
AggregationBuilders
.
terms
(
groupField
).
field
(
groupField
).
missing
(
"null"
));
builder
.
aggregation
(
AggregationBuilders
.
terms
(
groupField
).
field
(
groupField
).
missing
(
"null"
));
...
@@ -2710,14 +2732,11 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -2710,14 +2732,11 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
try
{
try
{
SearchResponse
response
=
restHighLevelClient
.
search
(
request
,
RequestOptions
.
DEFAULT
);
SearchResponse
response
=
restHighLevelClient
.
search
(
request
,
RequestOptions
.
DEFAULT
);
Terms
terms
=
response
.
getAggregations
().
get
(
groupField
);
Terms
terms
=
response
.
getAggregations
().
get
(
groupField
);
Long
otherCount
=
0L
;
for
(
Terms
.
Bucket
bucket
:
terms
.
getBuckets
())
{
for
(
Terms
.
Bucket
bucket
:
terms
.
getBuckets
())
{
Map
<
String
,
Object
>
groupMap
=
new
HashMap
<>();
Map
<
String
,
Long
>
groupMap
=
new
HashMap
<>();
groupMap
.
put
(
bucket
.
getKeyAsString
(),
bucket
.
getDocCount
());
groupMap
.
put
(
bucket
.
getKeyAsString
(),
bucket
.
getDocCount
());
staticCountByGroup
.
add
(
groupMap
);
staticCountByGroup
.
add
(
groupMap
);
otherCount
+=
bucket
.
getDocCount
();
}
}
tabTotalMap
.
put
(
businessType
,
otherCount
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
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