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
453b1b9b
Commit
453b1b9b
authored
Jul 04, 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
5f8b487c
76e40646
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
19 deletions
+51
-19
DataQualityScoreEnum.java
...oot/module/statistics/api/enums/DataQualityScoreEnum.java
+10
-0
ComprehensiveStatisticalAnalysisServiceImpl.java
...ice/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
+41
-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 @
453b1b9b
...
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
java.util.EnumSet
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -46,4 +47,13 @@ public enum DataQualityScoreEnum {
}
return
jsonArray
;
}
public
static
String
getNameByCode
(
String
code
)
{
for
(
DataQualityScoreEnum
e
:
EnumSet
.
allOf
(
DataQualityScoreEnum
.
class
))
{
if
(
e
.
getCode
().
equals
(
code
)){
return
e
.
getName
();
}
}
return
null
;
}
}
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 @
453b1b9b
...
...
@@ -562,7 +562,9 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
}
else
if
(!
k
.
equals
(
"paramRange"
))
{
if
(
v
instanceof
JSONArray
)
{
if
(!((
JSONArray
)
v
).
contains
(
"all"
)
||
((
JSONArray
)
v
).
size
()
!=
0
)
{
// 判断是否需要解析参数
Boolean
parseParam
=
getParamAnalysis
(
v
);
if
(
parseParam
)
{
String
field
=
k
;
if
(
k
.
equals
(
"unitType"
))
{
String
finalField
=
field
;
...
...
@@ -675,7 +677,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
List
<
JSONObject
>
list
=
new
LinkedList
<>();
long
totle
=
0
;
double
pipeLong
=
0
;
//
double pipeLong = 0;
try
{
SearchResponse
response
=
restHighLevelClient
.
search
(
request
,
RequestOptions
.
DEFAULT
);
for
(
SearchHit
hit
:
response
.
getHits
().
getHits
())
{
...
...
@@ -683,17 +685,19 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
JSONObject
dto
=
jsonObject
.
getJSONObject
(
"sourceAsMap"
);
dto
.
put
(
"record"
,
dto
.
get
(
"SEQUENCE_NBR"
));
dto
.
put
(
"equipAddress"
,
dto
.
get
(
"USE_PLACE"
)
+
"/"
+
dto
.
get
(
"ADDRESS"
));
if
(
dto
.
get
(
"EQU_LIST_CODE"
).
equals
(
"8000"
))
{
JSONArray
techParams
=
(
JSONArray
)
dto
.
get
(
"techParams"
);
if
(!
ObjectUtils
.
isEmpty
(
techParams
))
{
Object
obj
=
techParams
.
stream
().
filter
(
item
->
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
item
)).
get
(
"paramKey"
).
equals
(
"pipeLength"
)).
findFirst
().
get
();
JSONObject
jsonParam
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
if
(
jsonParam
.
containsKey
(
"doubleValue"
))
{
String
pipeLength
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
)).
get
(
"doubleValue"
).
toString
();
pipeLong
+=
Double
.
parseDouble
(
pipeLength
);
}
}
}
String
dataQualityScore
=
ObjectUtils
.
isEmpty
(
dto
.
get
(
"DATA_QUALITY_SCORE"
))
?
null
:
DataQualityScoreEnum
.
getNameByCode
(
dto
.
get
(
"DATA_QUALITY_SCORE"
).
toString
());
dto
.
put
(
"DATA_QUALITY_SCORE"
,
dataQualityScore
);
// if (dto.get("EQU_LIST_CODE").equals("8000")) {
// JSONArray techParams = (JSONArray) dto.get("techParams");
// if (!ObjectUtils.isEmpty(techParams)) {
// Object obj = techParams.stream().filter(item -> JSONObject.parseObject(JSONObject.toJSONString(item)).get("paramKey").equals("pipeLength")).findFirst().get();
// JSONObject jsonParam = JSONObject.parseObject(JSONObject.toJSONString(obj));
// if (jsonParam.containsKey("doubleValue")) {
// String pipeLength = JSONObject.parseObject(JSONObject.toJSONString(obj)).get("doubleValue").toString();
// pipeLong += Double.parseDouble(pipeLength);
// }
// }
// }
list
.
add
(
dto
);
}
totle
=
Objects
.
requireNonNull
(
response
.
getInternalResponse
().
hits
().
getTotalHits
()).
value
;
...
...
@@ -710,7 +714,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
sum
.
put
(
"value"
,
totle
);
statics
.
add
(
sum
);
if
(
ObjectUtils
.
isEmpty
(
filterParams
)
||
!
filterParams
.
containsKey
(
"EQU_LIST"
))
{
if
(
ObjectUtils
.
isEmpty
(
filterParams
)
||
!
filterParams
.
containsKey
(
"EQU_LIST"
))
{
filterParams
=
new
JSONObject
();
JSONArray
jsonArray
=
new
JSONArray
();
jsonArray
.
add
(
"all"
);
...
...
@@ -718,14 +722,18 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
JSONArray
equList
=
(
JSONArray
)
filterParams
.
get
(
"EQU_LIST"
);
if
(
equList
.
contains
(
"8000"
)
||
equList
.
contains
(
"all"
))
{
if
(
equList
.
contains
(
"8000"
)
||
equList
.
contains
(
"all"
)
||
ObjectUtils
.
isEmpty
(
equList
)
)
{
// 压力管道长度
Map
<
String
,
Object
>
pipeMaps
=
new
HashMap
<>();
stCommonService
.
staticsCenterMapCountDataForPipeline
(
pipeMaps
,
orgCode
,
true
,
false
);
// 获取压力管道长度
// getPipeLength(pipeMaps, boolMust, builder, filterParams);
Map
<
String
,
Object
>
pipeMap
=
new
HashMap
<>();
pipeMap
.
put
(
"name"
,
"压力管道(千米)"
);
pipeMap
.
put
(
"value"
,
pipe
Long
);
pipeMap
.
put
(
"value"
,
pipe
Maps
.
get
(
"pressurePipelines"
)
);
statics
.
add
(
pipeMap
);
}
if
(
equList
.
contains
(
"2000"
)
||
equList
.
contains
(
"all"
))
{
if
(
equList
.
contains
(
"2000"
)
||
equList
.
contains
(
"all"
)
||
ObjectUtils
.
isEmpty
(
equList
)
)
{
// 气瓶数量
Map
<
String
,
Object
>
gasMap
=
new
HashMap
<>();
gasMap
.
put
(
"name"
,
"气瓶(个)"
);
...
...
@@ -741,6 +749,19 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
return
result
;
}
private
Boolean
getParamAnalysis
(
Object
v
)
{
Boolean
result
=
false
;
if
(
v
instanceof
JSONArray
)
{
JSONArray
jsonArray
=
(
JSONArray
)
v
;
result
=
jsonArray
.
size
()
!=
0
&&
!
jsonArray
.
get
(
0
).
equals
(
"all"
);
}
else
if
(
v
instanceof
String
)
{
if
(
"null"
.
equals
(
v
)
||
""
.
equals
(
v
)
||
null
==
v
)
{
result
=
true
;
}
}
return
result
;
}
private
void
getParamQuery
(
String
paramKey
,
String
condition
,
Object
value
,
String
fieldType
,
Boolean
isCustom
,
BoolQueryBuilder
boolMust
,
EnhancedDynamicQueryBuilder
builder
,
String
andOr
)
{
String
path
=
"techParams"
;
String
nestedFieldKey
=
path
+
".paramKey"
;
...
...
@@ -944,11 +965,12 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
private
void
addTechParam
(
JSONObject
techParam
,
JSONObject
paramRange
,
EnhancedDynamicQueryBuilder
builder
)
{
String
field
=
techParam
.
getString
(
"value"
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
techParam
));
String
field
=
jsonObject
.
getString
(
"value"
);
String
fieldType
=
jsonObject
.
getString
(
"fieldType"
);
String
itemCondition
=
paramRange
.
getString
(
"itemCondition"
);
Object
value
=
paramRange
.
get
(
"value"
);
String
andOr
=
paramRange
.
getString
(
"andOr"
);
String
fieldType
=
paramRange
.
getString
(
"fieldType"
);
getParamQuery
(
field
,
itemCondition
,
value
,
fieldType
,
true
,
null
,
builder
,
andOr
);
}
...
...
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