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
2fece278
Commit
2fece278
authored
Jul 23, 2025
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 增加SUPERVISORY_CODE判断和压力管道长度统计查询功能
feat: 大屏总览管道查询修改为查询es
parent
1298b897
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
2 deletions
+36
-2
ComprehensiveStatisticalAnalysisServiceImpl.java
...ice/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
+2
-0
JGDPStatisticsServiceImpl.java
...statistcs/biz/service/impl/JGDPStatisticsServiceImpl.java
+34
-2
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 @
2fece278
...
@@ -1299,6 +1299,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -1299,6 +1299,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
BigDecimal
pipeLong
;
BigDecimal
pipeLong
;
BoolQueryBuilder
pipeLengthQuery
=
QueryBuilderUtils
.
copyBoolQuery
(
boolMust
);
BoolQueryBuilder
pipeLengthQuery
=
QueryBuilderUtils
.
copyBoolQuery
(
boolMust
);
pipeLengthQuery
.
must
(
QueryBuilders
.
existsQuery
(
"pipeLength"
));
pipeLengthQuery
.
must
(
QueryBuilders
.
existsQuery
(
"pipeLength"
));
pipeLengthQuery
.
must
(
existsQuery
(
"SUPERVISORY_CODE"
));
pipeLengthQuery
.
mustNot
(
QueryBuilders
.
termQuery
(
"SUPERVISORY_CODE"
,
""
));
SumAggregationBuilder
pipeLengthAgg
=
AggregationBuilders
.
sum
(
countField
).
field
(
"pipeLength"
).
missing
(
0
);
SumAggregationBuilder
pipeLengthAgg
=
AggregationBuilders
.
sum
(
countField
).
field
(
"pipeLength"
).
missing
(
0
);
builder
.
aggregation
(
pipeLengthAgg
).
size
(
0
);
builder
.
aggregation
(
pipeLengthAgg
).
size
(
0
);
request
.
source
(
builder
);
request
.
source
(
builder
);
...
...
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/JGDPStatisticsServiceImpl.java
View file @
2fece278
...
@@ -67,6 +67,8 @@ import org.elasticsearch.search.SearchHit;
...
@@ -67,6 +67,8 @@ import org.elasticsearch.search.SearchHit;
import
org.elasticsearch.search.aggregations.AggregationBuilders
;
import
org.elasticsearch.search.aggregations.AggregationBuilders
;
import
org.elasticsearch.search.aggregations.bucket.terms.Terms
;
import
org.elasticsearch.search.aggregations.bucket.terms.Terms
;
import
org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder
;
import
org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder
;
import
org.elasticsearch.search.aggregations.metrics.ParsedSum
;
import
org.elasticsearch.search.aggregations.metrics.SumAggregationBuilder
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.elasticsearch.search.sort.SortOrder
;
import
org.elasticsearch.search.sort.SortOrder
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
...
@@ -92,6 +94,7 @@ import java.util.function.Function;
...
@@ -92,6 +94,7 @@ import java.util.function.Function;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
com
.
alibaba
.
fastjson
.
JSON
.
parseArray
;
import
static
com
.
alibaba
.
fastjson
.
JSON
.
parseArray
;
import
static
org
.
elasticsearch
.
index
.
query
.
QueryBuilders
.
existsQuery
;
/**
/**
* 大屏统计实现类
* 大屏统计实现类
...
@@ -385,7 +388,9 @@ public class JGDPStatisticsServiceImpl {
...
@@ -385,7 +388,9 @@ public class JGDPStatisticsServiceImpl {
long
hasSupervisoryCodeEquipCount
=
stCommonService
.
queryHasSupervisoryCodeEquipCount
(
orgCode
,
false
);
long
hasSupervisoryCodeEquipCount
=
stCommonService
.
queryHasSupervisoryCodeEquipCount
(
orgCode
,
false
);
result
.
put
(
"total"
,
hasSupervisoryCodeEquipCount
);
result
.
put
(
"total"
,
hasSupervisoryCodeEquipCount
);
//2.压力管道长度统计
//2.压力管道长度统计
stCommonService
.
staticsCenterMapCountDataForPipeline
(
result
,
orgCode
,
true
,
false
);
// 修改为查询es
// stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode, true, false);
this
.
staticsCenterMapCountPipLine
(
result
,
orgCode
);
//3.单位数量统计
//3.单位数量统计
this
.
staticsCenterMapCountDataForCompany
(
result
,
orgCode
,
dpFilterParamDto
.
getCityCode
());
this
.
staticsCenterMapCountDataForCompany
(
result
,
orgCode
,
dpFilterParamDto
.
getCityCode
());
//4.人员数量统计
//4.人员数量统计
...
@@ -419,7 +424,9 @@ public class JGDPStatisticsServiceImpl {
...
@@ -419,7 +424,9 @@ public class JGDPStatisticsServiceImpl {
// 1. 8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
// 1. 8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
stCommonService
.
staticsCenterMapCountDataForEquip
(
result
,
cylinderNum
,
orgCode
,
true
,
true
,
false
);
stCommonService
.
staticsCenterMapCountDataForEquip
(
result
,
cylinderNum
,
orgCode
,
true
,
true
,
false
);
// 2. 压力管道长度统计
// 2. 压力管道长度统计
stCommonService
.
staticsCenterMapCountDataForPipeline
(
result
,
orgCode
,
true
,
false
);
// 修改为查询es
//stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode, true, false);
this
.
staticsCenterMapCountPipLine
(
result
,
orgCode
);
// 3. 人员数量统计
// 3. 人员数量统计
this
.
staticsCenterMapCountDataForPerson
(
result
,
dpFilterParamDto
,
orgCode
);
this
.
staticsCenterMapCountDataForPerson
(
result
,
dpFilterParamDto
,
orgCode
);
return
result
;
return
result
;
...
@@ -468,6 +475,31 @@ public class JGDPStatisticsServiceImpl {
...
@@ -468,6 +475,31 @@ public class JGDPStatisticsServiceImpl {
result
.
put
(
DPMapStatisticsItemEnum
.
PERSON_TOTAL
.
getCode
(),
personSum
);
result
.
put
(
DPMapStatisticsItemEnum
.
PERSON_TOTAL
.
getCode
(),
personSum
);
}
}
private
void
staticsCenterMapCountPipLine
(
Map
<
String
,
Object
>
result
,
String
orgCode
)
{
SearchRequest
request
=
new
SearchRequest
();
SearchSourceBuilder
builder
=
new
SearchSourceBuilder
();
request
.
indices
(
StatisticalAnalysisEnum
.
equip
.
getKey
());
BigDecimal
pipeLong
;
BoolQueryBuilder
pipeLengthQuery
=
new
BoolQueryBuilder
();
pipeLengthQuery
.
must
(
QueryBuilders
.
prefixQuery
(
"ORG_BRANCH_CODE"
,
orgCode
));
pipeLengthQuery
.
must
(
QueryBuilders
.
existsQuery
(
"pipeLength"
));
pipeLengthQuery
.
must
(
existsQuery
(
"SUPERVISORY_CODE"
));
pipeLengthQuery
.
mustNot
(
QueryBuilders
.
termQuery
(
"SUPERVISORY_CODE"
,
""
));
SumAggregationBuilder
pipeLengthAgg
=
AggregationBuilders
.
sum
(
"pipeLengthSum"
).
field
(
"pipeLength"
).
missing
(
0
);
builder
.
aggregation
(
pipeLengthAgg
).
size
(
0
);
request
.
source
(
builder
);
try
{
SearchResponse
response
=
restHighLevelClient
.
search
(
request
,
RequestOptions
.
DEFAULT
);
ParsedSum
sumAgg
=
response
.
getAggregations
().
get
(
"pipeLengthSum"
);
double
value
=
sumAgg
.
getValue
();
pipeLong
=
new
BigDecimal
(
value
);
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
result
.
put
(
DPMapStatisticsItemEnum
.
PRESSURE_PIPELINES
.
getCode
(),
pipeLong
.
divide
(
new
BigDecimal
(
1000
),
2
,
BigDecimal
.
ROUND_HALF_UP
));
}
private
void
staticsCenterMapCountDataForCompany
(
Map
<
String
,
Object
>
result
,
String
orgCode
,
String
cityCode
)
{
private
void
staticsCenterMapCountDataForCompany
(
Map
<
String
,
Object
>
result
,
String
orgCode
,
String
cityCode
)
{
if
(
orgCode
==
null
)
{
if
(
orgCode
==
null
)
{
setDefaultCompanyCountData
(
result
);
setDefaultCompanyCountData
(
result
);
...
...
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