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
dc62d3c0
Commit
dc62d3c0
authored
Jul 09, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_tzs_register' of…
Merge branch 'develop_tzs_register' of
http://39.100.92.250:5000/moa/amos-boot-biz
into develop_tzs_register
parents
8238a720
a0102dd8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
23 deletions
+40
-23
DataQualityScoreEnum.java
...oot/module/statistics/api/enums/DataQualityScoreEnum.java
+3
-3
UnitTypeNewEnum.java
...mos/boot/module/statistics/api/enums/UnitTypeNewEnum.java
+1
-1
ComprehensiveStatisticalAnalysisServiceImpl.java
...ice/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
+36
-19
No files found.
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/enums/DataQualityScoreEnum.java
View file @
dc62d3c0
...
...
@@ -17,9 +17,9 @@ public enum DataQualityScoreEnum {
* *设备等级
*/
I
(
"一级(只有设备名称
其他使用登记证上信息无
)"
,
"3"
),
II
(
"二级(只有设备名称和使用登记证编号
其他使用登记证上信息无
)"
,
"2"
),
III
(
"三级(使用登记证
上
信息齐全)"
,
"1"
);
I
(
"一级(只有设备名称)"
,
"3"
),
II
(
"二级(只有设备名称和使用登记证编号)"
,
"2"
),
III
(
"三级(使用登记证信息齐全)"
,
"1"
);
private
String
name
;
private
String
code
;
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/enums/UnitTypeNewEnum.java
View file @
dc62d3c0
...
...
@@ -17,7 +17,7 @@ public enum UnitTypeNewEnum {
* *注册单位类型
*/
sydw
(
"
使用单位
"
,
"1232"
,
"use"
),
sydw
(
"
企业
"
,
"1232"
,
"use"
),
czdw
(
"充装单位"
,
"1231"
,
"license"
),
jydw
(
"检验单位"
,
"1233"
,
"license"
),
jcdw
(
"检测单位"
,
"1233"
,
"license"
),
...
...
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 @
dc62d3c0
...
...
@@ -40,6 +40,8 @@ import org.elasticsearch.action.search.SearchRequest;
import
org.elasticsearch.action.search.SearchResponse
;
import
org.elasticsearch.client.RequestOptions
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.elasticsearch.client.core.CountRequest
;
import
org.elasticsearch.client.core.CountResponse
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.NestedQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
...
...
@@ -83,8 +85,6 @@ import static org.elasticsearch.index.query.QueryBuilders.existsQuery;
@RequiredArgsConstructor
public
class
ComprehensiveStatisticalAnalysisServiceImpl
{
final
static
String
EQU_LIST
=
"EQU_LIST"
;
@Value
(
"classpath:/json/equipCategory.json"
)
private
Resource
equipCategory
;
...
...
@@ -258,7 +258,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
List
<
String
>
list
=
unitTypeByType
.
stream
().
map
(
e
->
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
e
)).
get
(
"value"
).
toString
()).
collect
(
Collectors
.
toList
());
list
.
forEach
(
item
->
boolMust
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
item
+
"*"
)).
minimumShouldMatch
(
1
));
}
}
else
if
(
k
.
equals
(
"newPost"
)
||
k
.
equals
(
"subPost"
))
{
}
else
if
(
k
.
equals
(
"newPost"
)
||
k
.
equals
(
"subPost"
)
||
k
.
equals
(
"unitType"
)
)
{
((
JSONArray
)
v
).
forEach
(
item
->
{
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
field
+
".keyword"
,
"*"
+
item
+
"*"
));
});
...
...
@@ -683,7 +683,9 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
String
condition
=
paramRangeJson
.
getString
(
"condition"
);
Object
value
=
paramRangeJson
.
getString
(
"value"
);
String
fieldType
=
paramRangeJson
.
getString
(
"fieldType"
);
getParamQuery
(
paramKey
,
condition
,
value
,
fieldType
,
false
,
boolMust
,
null
,
null
);
if
(!
ObjectUtils
.
isEmpty
(
condition
)
&&
!
ObjectUtils
.
isEmpty
(
value
)
&&
!
ObjectUtils
.
isEmpty
(
fieldType
))
{
getParamQuery
(
paramKey
,
condition
,
value
,
fieldType
,
false
,
boolMust
,
null
,
null
);
}
}
}
else
if
(!
k
.
equals
(
"paramRange"
))
{
if
(
v
instanceof
JSONArray
)
{
...
...
@@ -771,7 +773,9 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
queryBuilder
.
minimumShouldMatch
(
1
);
boolMust
.
must
(
queryBuilder
);
}
else
if
(
k
.
equals
(
"WHETHER_VEHICLE_CYLINDER"
))
{
boolMust
.
must
(
QueryBuilders
.
matchQuery
(
k
,
v
.
toString
()));
if
(!
""
.
equals
(
v
))
{
boolMust
.
must
(
QueryBuilders
.
matchQuery
(
k
,
v
.
toString
()));
}
}
}
}
...
...
@@ -822,15 +826,6 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
builder
.
query
(
boolMust
);
List
<
Map
<
String
,
Object
>>
statics
=
new
ArrayList
<>();
JSONArray
equList
=
(
JSONArray
)
filterParams
.
get
(
"EQU_LIST"
);
if
(
ObjectUtils
.
isEmpty
(
equList
)
||
equList
.
contains
(
"8000"
)
||
equList
.
contains
(
"all"
))
{
// 获取压力管道长度
BigDecimal
pipeLength
=
getPipeLength
(
boolMust
,
builder
);
Map
<
String
,
Object
>
pipeMap
=
new
HashMap
<>();
pipeMap
.
put
(
"name"
,
"压力管道(千米)"
);
pipeMap
.
put
(
"value"
,
pipeLength
.
divide
(
new
BigDecimal
(
1000
)));
statics
.
add
(
pipeMap
);
}
builder
.
from
((
current
-
1
)
*
size
);
builder
.
size
(
size
);
...
...
@@ -873,16 +868,37 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
filterParams
.
put
(
"EQU_LIST"
,
jsonArray
);
}
JSONArray
equList
=
(
JSONArray
)
filterParams
.
get
(
"EQU_LIST"
);
if
(
ObjectUtils
.
isEmpty
(
equList
)
||
equList
.
contains
(
"8000"
)
||
equList
.
contains
(
"all"
))
{
// 获取压力管道长度
// 压力管道长度
Map
<
String
,
Object
>
pipeMaps
=
new
HashMap
<>();
stCommonService
.
staticsCenterMapCountDataForPipeline
(
pipeMaps
,
orgCode
,
true
,
false
);
// 获取压力管道长度
// BigDecimal pipeLength = getPipeLength(boolMust, builder);
Map
<
String
,
Object
>
pipeMap
=
new
HashMap
<>();
pipeMap
.
put
(
"name"
,
"压力管道(千米)"
);
pipeMap
.
put
(
"value"
,
pipeMaps
.
get
(
"pressurePipelines"
));
statics
.
add
(
pipeMap
);
}
if
(
ObjectUtils
.
isEmpty
(
equList
)
||
equList
.
contains
(
"2000"
)
||
equList
.
contains
(
"all"
))
{
// 气瓶数量
Map
<
String
,
Object
>
gasMap
=
new
HashMap
<>();
gasMap
.
put
(
"name"
,
"气瓶(个)"
);
Map
<
String
,
Object
>
gas
=
new
HashMap
<>();
gas
.
put
(
DPMapStatisticsItemEnum
.
GAS
.
getCode
(),
0
);
long
cylinderNum
=
stCommonService
.
staticsCenterMapCountDataForCylinder
(
gas
,
orgCode
,
true
,
true
,
false
);
// 1. 8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
stCommonService
.
staticsCenterMapCountDataForEquip
(
gas
,
cylinderNum
,
orgCode
,
true
,
true
,
false
);
gasMap
.
put
(
"value"
,
gas
.
get
(
DPMapStatisticsItemEnum
.
GAS
.
getCode
()));
CountRequest
countRequest
=
new
CountRequest
();
countRequest
.
indices
(
StatisticalAnalysisEnum
.
equip
.
getKey
());
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"EQU_CATEGORY_CODE"
,
"2300"
));
countRequest
.
query
(
boolMust
);
CountResponse
response
=
null
;
try
{
response
=
restHighLevelClient
.
count
(
countRequest
,
RequestOptions
.
DEFAULT
);
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
gasMap
.
put
(
"value"
,
response
.
getCount
());
statics
.
add
(
gasMap
);
}
result
.
put
(
"statics"
,
statics
);
...
...
@@ -891,10 +907,11 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
private
BigDecimal
getPipeLength
(
BoolQueryBuilder
boolMust
,
SearchSourceBuilder
builder
)
{
SearchRequest
request
=
new
SearchRequest
();
request
.
indices
(
StatisticalAnalysisEnum
.
equip
.
getKey
());
BigDecimal
pipeLong
=
BigDecimal
.
ZERO
;
builder
.
query
(
boolMust
);
builder
.
from
(
0
);
builder
.
size
(
1000000
0
);
builder
.
size
(
1000000
);
request
.
source
(
builder
);
try
{
SearchResponse
response
=
restHighLevelClient
.
search
(
request
,
RequestOptions
.
DEFAULT
);
...
...
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