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
03fd4773
Commit
03fd4773
authored
Jul 14, 2025
by
刘林
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register
parents
22514a1f
178e32a7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
157 additions
and
54 deletions
+157
-54
ComprehensiveStatisticalAnalysisServiceImpl.java
...ice/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
+124
-54
QueryBuilderUtils.java
...os/boot/module/statistcs/biz/utils/QueryBuilderUtils.java
+33
-0
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 @
03fd4773
...
@@ -20,6 +20,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.ESEquipmentInfo;
...
@@ -20,6 +20,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.ESEquipmentInfo;
import
com.yeejoin.amos.boot.module.common.biz.utils.TechParamUtil
;
import
com.yeejoin.amos.boot.module.common.biz.utils.TechParamUtil
;
import
com.yeejoin.amos.boot.module.statistcs.biz.utils.JsonUtils
;
import
com.yeejoin.amos.boot.module.statistcs.biz.utils.JsonUtils
;
import
com.yeejoin.amos.boot.module.statistcs.biz.utils.MinioUtils
;
import
com.yeejoin.amos.boot.module.statistcs.biz.utils.MinioUtils
;
import
com.yeejoin.amos.boot.module.statistcs.biz.utils.QueryBuilderUtils
;
import
com.yeejoin.amos.boot.module.statistcs.factory.DynamicQueryBuilder
;
import
com.yeejoin.amos.boot.module.statistcs.factory.DynamicQueryBuilder
;
import
com.yeejoin.amos.boot.module.statistcs.factory.EnhancedDynamicQueryBuilder
;
import
com.yeejoin.amos.boot.module.statistcs.factory.EnhancedDynamicQueryBuilder
;
import
com.yeejoin.amos.boot.module.statistics.api.enums.*
;
import
com.yeejoin.amos.boot.module.statistics.api.enums.*
;
...
@@ -325,31 +326,42 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -325,31 +326,42 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
boolMust
.
must
(
queryBuilder
);
boolMust
.
must
(
queryBuilder
);
}
}
}
else
if
(
k
.
equals
(
"expiryDate"
))
{
}
else
if
(
k
.
equals
(
"expiryDate"
))
{
boolMust
.
must
(
existsQuery
(
nestedField
)
);
EnhancedDynamicQueryBuilder
enhancedDynamicQueryBuilder
=
new
EnhancedDynamicQueryBuilder
(
);
if
(
item
.
equals
(
"overdue"
))
{
if
(
item
.
equals
(
"overdue"
))
{
// 超期:小于当前日期
// 超期:小于当前日期
NestedQueryBuilder
nestedQuery
=
QueryBuilders
.
nestedQuery
(
NestedQueryBuilder
nestedQuery
=
QueryBuilders
.
nestedQuery
(
path
,
path
,
QueryBuilders
.
boolQuery
().
filter
(
QueryBuilders
.
rangeQuery
(
nestedField
).
lt
(
LocalDate
.
now
().
format
(
formatter
))),
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
rangeQuery
(
nestedField
).
lt
(
LocalDate
.
now
().
format
(
formatter
))),
ScoreMode
.
None
ScoreMode
.
None
);
);
boolMust
.
must
(
nestedQuery
);
enhancedDynamicQueryBuilder
.
add
(
nestedQuery
,
or
);
boolMust
.
must
(
enhancedDynamicQueryBuilder
.
build
());
}
else
if
(
item
.
equals
(
"near"
))
{
}
else
if
(
item
.
equals
(
"near"
))
{
// 临期:小于等于当前日期加上30天
// 临期:小于等于当前日期加上30天
NestedQueryBuilder
nestedQuery
=
QueryBuilders
.
nestedQuery
(
NestedQueryBuilder
nestedQuery
=
QueryBuilders
.
nestedQuery
(
path
,
path
,
QueryBuilders
.
boolQuery
().
filter
(
QueryBuilders
.
rangeQuery
(
nestedField
).
lte
(
LocalDate
.
now
().
plusDays
(
30
).
format
(
formatter
)).
gte
(
LocalDate
.
now
().
format
(
formatter
))),
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
rangeQuery
(
nestedField
).
lte
(
LocalDate
.
now
().
plusDays
(
30
).
format
(
formatter
)).
gte
(
LocalDate
.
now
().
format
(
formatter
))),
ScoreMode
.
None
ScoreMode
.
None
);
);
boolMust
.
must
(
nestedQuery
);
enhancedDynamicQueryBuilder
.
add
(
nestedQuery
,
or
);
boolMust
.
must
(
enhancedDynamicQueryBuilder
.
build
());
}
else
if
(
item
.
equals
(
"normal"
))
{
}
else
if
(
item
.
equals
(
"normal"
))
{
// 正常:大于当前日期加上30天
// 正常:大于当前日期加上30天
NestedQueryBuilder
nestedQuery
=
QueryBuilders
.
nestedQuery
(
NestedQueryBuilder
nestedQuery
=
QueryBuilders
.
nestedQuery
(
path
,
path
,
QueryBuilders
.
boolQuery
().
filter
(
QueryBuilders
.
rangeQuery
(
nestedField
).
gt
(
LocalDate
.
now
().
plusDays
(
30
).
format
(
formatter
))),
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
rangeQuery
(
nestedField
).
gt
(
LocalDate
.
now
().
plusDays
(
30
).
format
(
formatter
))),
ScoreMode
.
None
ScoreMode
.
None
);
);
boolMust
.
must
(
nestedQuery
);
enhancedDynamicQueryBuilder
.
add
(
nestedQuery
,
or
);
boolMust
.
must
(
enhancedDynamicQueryBuilder
.
build
());
}
else
if
(
item
.
equals
(
"none"
))
{
NestedQueryBuilder
nestedQuery
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
existsQuery
(
nestedField
)),
ScoreMode
.
None
);
enhancedDynamicQueryBuilder
.
add
(
nestedQuery
,
or
);
boolMust
.
must
(
enhancedDynamicQueryBuilder
.
build
());
}
}
}
else
if
(
k
.
equals
(
"certType"
)
||
k
.
equals
(
"permissionLevel"
))
{
}
else
if
(
k
.
equals
(
"certType"
)
||
k
.
equals
(
"permissionLevel"
))
{
NestedQueryBuilder
nestedQuery
=
QueryBuilders
.
nestedQuery
(
NestedQueryBuilder
nestedQuery
=
QueryBuilders
.
nestedQuery
(
...
@@ -448,7 +460,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -448,7 +460,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
}
dto
.
put
(
"equipType"
,
equipTypes
.
substring
(
0
,
equipTypes
.
length
()
-
1
));
dto
.
put
(
"equipType"
,
equipTypes
.
substring
(
0
,
equipTypes
.
length
()
-
1
));
}
}
String
licensesStauts
=
""
;
String
Builder
licensesStatus
=
new
StringBuilder
()
;
if
(
dto
.
containsKey
(
"licenses"
))
{
if
(
dto
.
containsKey
(
"licenses"
))
{
// 以下人员类型有资质要求
// 以下人员类型有资质要求
// 人员类型(newPost):检验人员:66151、检测人员:66152、作业人员:6552、检查人员:6763
// 人员类型(newPost):检验人员:66151、检测人员:66152、作业人员:6552、检查人员:6763
...
@@ -461,8 +473,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -461,8 +473,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
List
<
String
>
permissionStatusList
=
new
ArrayList
<>();
List
<
String
>
permissionStatusList
=
new
ArrayList
<>();
for
(
Object
object
:
licenses
)
{
for
(
Object
object
:
licenses
)
{
JSONObject
json
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
object
));
JSONObject
json
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
object
));
if
(!
json
.
containsKey
(
"
certNo
"
))
{
if
(!
json
.
containsKey
(
"
expiryDate
"
))
{
licensesSta
uts
=
"无资质"
;
licensesSta
tus
.
append
(
"/无有效期"
)
;
continue
;
continue
;
}
}
String
expiryDate
=
json
.
getString
(
"expiryDate"
);
String
expiryDate
=
json
.
getString
(
"expiryDate"
);
...
@@ -480,21 +492,30 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -480,21 +492,30 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
long
cq
=
permissionStatusList
.
stream
().
filter
(
e
->
e
.
equals
(
"超期"
)).
count
();
long
cq
=
permissionStatusList
.
stream
().
filter
(
e
->
e
.
equals
(
"超期"
)).
count
();
long
lq
=
permissionStatusList
.
stream
().
filter
(
e
->
e
.
equals
(
"临期"
)).
count
();
long
lq
=
permissionStatusList
.
stream
().
filter
(
e
->
e
.
equals
(
"临期"
)).
count
();
long
zc
=
permissionStatusList
.
stream
().
filter
(
e
->
e
.
equals
(
"正常"
)).
count
();
long
zc
=
permissionStatusList
.
stream
().
filter
(
e
->
e
.
equals
(
"正常"
)).
count
();
long
no
=
permissionStatusList
.
stream
().
filter
(
e
->
e
.
equals
(
"无有效期"
)).
count
();
if
(
cq
>
0
)
{
if
(
cq
>
0
)
{
licensesStauts
=
"超期"
;
licensesStatus
.
append
(
"/资质超期"
);
}
else
if
(
lq
>
0
)
{
}
licensesStauts
=
"临期"
;
if
(
lq
>
0
)
{
}
else
if
(
zc
>
0
)
{
licensesStatus
.
append
(
"/资质临期"
);
licensesStauts
=
"正常"
;
}
if
(
zc
>
0
)
{
licensesStatus
.
append
(
"/资质正常"
);
}
if
(
no
>
0
)
{
licensesStatus
.
append
(
"/无有效期"
);
}
}
}
else
{
}
else
{
licensesSta
uts
=
"无资质"
;
licensesSta
tus
.
append
(
"无资质"
)
;
}
}
}
else
{
}
else
{
licensesSta
uts
=
"无资质要求"
;
licensesSta
tus
.
append
(
"无资质要求"
)
;
}
}
}
}
dto
.
put
(
"licensesStauts"
,
licensesStauts
);
String
licensesStatusStr
=
licensesStatus
.
toString
();
licensesStatusStr
=
licensesStatusStr
.
startsWith
(
"/"
)
?
licensesStatusStr
.
substring
(
1
)
:
licensesStatusStr
;
licensesStatusStr
=
licensesStatusStr
.
endsWith
(
"/"
)
?
licensesStatusStr
.
substring
(
0
,
licensesStatusStr
.
length
()
-
1
)
:
licensesStatusStr
;
dto
.
put
(
"licensesStatus"
,
licensesStatusStr
);
list
.
add
(
dto
);
list
.
add
(
dto
);
}
}
totle
=
Objects
.
requireNonNull
(
response
.
getInternalResponse
().
hits
().
getTotalHits
()).
value
;
totle
=
Objects
.
requireNonNull
(
response
.
getInternalResponse
().
hits
().
getTotalHits
()).
value
;
...
@@ -512,6 +533,10 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -512,6 +533,10 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
statics
.
add
(
sum
);
statics
.
add
(
sum
);
result
.
put
(
"statics"
,
statics
);
result
.
put
(
"statics"
,
statics
);
// 获取许可状态统计
List
<
Map
<
String
,
Object
>>
staticMap
=
new
ArrayList
<>();
getCompanyOrPersonPermitStatusStatic
(
boolMust
,
staticMap
,
StatisticalAnalysisEnum
.
person
.
getKey
());
result
.
put
(
"keyIndicator"
,
staticMap
);
return
result
;
return
result
;
}
}
...
@@ -652,7 +677,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -652,7 +677,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
for
(
SearchHit
hit
:
response
.
getHits
().
getHits
())
{
for
(
SearchHit
hit
:
response
.
getHits
().
getHits
())
{
JSONObject
jsonObject
=
(
JSONObject
)
JSONObject
.
toJSON
(
hit
);
JSONObject
jsonObject
=
(
JSONObject
)
JSONObject
.
toJSON
(
hit
);
JSONObject
dto
=
jsonObject
.
getJSONObject
(
"sourceAsMap"
);
JSONObject
dto
=
jsonObject
.
getJSONObject
(
"sourceAsMap"
);
String
permissionStatus
=
null
;
String
Builder
permissionStatus
=
new
StringBuilder
()
;
if
(
dto
.
containsKey
(
"licenses"
))
{
if
(
dto
.
containsKey
(
"licenses"
))
{
JSONArray
licenses
=
dto
.
getJSONArray
(
"licenses"
);
JSONArray
licenses
=
dto
.
getJSONArray
(
"licenses"
);
if
(!
ObjectUtils
.
isEmpty
(
licenses
))
{
if
(!
ObjectUtils
.
isEmpty
(
licenses
))
{
...
@@ -678,13 +703,16 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -678,13 +703,16 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
long
zc
=
permissionStatusList
.
stream
().
filter
(
e
->
e
.
equals
(
"正常"
)).
count
();
long
zc
=
permissionStatusList
.
stream
().
filter
(
e
->
e
.
equals
(
"正常"
)).
count
();
long
no
=
permissionStatusList
.
stream
().
filter
(
e
->
e
.
equals
(
"无有效期"
)).
count
();
long
no
=
permissionStatusList
.
stream
().
filter
(
e
->
e
.
equals
(
"无有效期"
)).
count
();
if
(
cq
>
0
)
{
if
(
cq
>
0
)
{
permissionStatus
=
"许可超期"
;
permissionStatus
.
append
(
"/许可超期"
);
}
else
if
(
lq
>
0
)
{
}
permissionStatus
=
"许可临期"
;
if
(
lq
>
0
)
{
}
else
if
(
zc
>
0
)
{
permissionStatus
.
append
(
"/许可临期"
);
permissionStatus
=
"许可正常"
;
}
}
else
if
(
no
>
0
)
{
if
(
zc
>
0
)
{
permissionStatus
=
"无有效期"
;
permissionStatus
.
append
(
"/许可正常"
);
}
if
(
no
>
0
)
{
permissionStatus
.
append
(
"/无有效期"
);
}
}
}
}
}
else
if
(!
dto
.
containsKey
(
"licenses"
)
&&
(
dto
.
get
(
"unitType"
).
toString
().
contains
(
"检测单位"
)
||
}
else
if
(!
dto
.
containsKey
(
"licenses"
)
&&
(
dto
.
get
(
"unitType"
).
toString
().
contains
(
"检测单位"
)
||
...
@@ -693,9 +721,12 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -693,9 +721,12 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
dto
.
get
(
"unitType"
).
toString
().
contains
(
"充装单位"
)
||
dto
.
get
(
"unitType"
).
toString
().
contains
(
"充装单位"
)
||
dto
.
get
(
"unitType"
).
toString
().
contains
(
"设计单位"
)
||
dto
.
get
(
"unitType"
).
toString
().
contains
(
"设计单位"
)
||
dto
.
get
(
"unitType"
).
toString
().
contains
(
"安装改造维修单位"
)))
{
dto
.
get
(
"unitType"
).
toString
().
contains
(
"安装改造维修单位"
)))
{
permissionStatus
=
"无有效期"
;
permissionStatus
.
append
(
"/无有效期"
)
;
}
}
dto
.
put
(
"permissionStatus"
,
permissionStatus
);
String
permissionStatusStr
=
permissionStatus
.
toString
();
permissionStatusStr
=
permissionStatusStr
.
startsWith
(
"/"
)
?
permissionStatusStr
.
substring
(
1
)
:
permissionStatusStr
;
permissionStatusStr
=
permissionStatusStr
.
endsWith
(
"/"
)
?
permissionStatusStr
.
substring
(
0
,
permissionStatusStr
.
length
()
-
1
)
:
permissionStatusStr
;
dto
.
put
(
"permissionStatus"
,
permissionStatusStr
);
list
.
add
(
dto
);
list
.
add
(
dto
);
}
}
totle
=
Objects
.
requireNonNull
(
response
.
getInternalResponse
().
hits
().
getTotalHits
()).
value
;
totle
=
Objects
.
requireNonNull
(
response
.
getInternalResponse
().
hits
().
getTotalHits
()).
value
;
...
@@ -714,6 +745,11 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -714,6 +745,11 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
statics
.
add
(
sum
);
statics
.
add
(
sum
);
result
.
put
(
"statics"
,
statics
);
result
.
put
(
"statics"
,
statics
);
// 获取许可状态统计
List
<
Map
<
String
,
Object
>>
staticMap
=
new
ArrayList
<>();
getCompanyOrPersonPermitStatusStatic
(
boolMust
,
staticMap
,
StatisticalAnalysisEnum
.
company
.
getKey
());
result
.
put
(
"keyIndicator"
,
staticMap
);
return
result
;
return
result
;
}
}
...
@@ -1068,6 +1104,54 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -1068,6 +1104,54 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
}
private
void
getCompanyOrPersonPermitStatusStatic
(
BoolQueryBuilder
boolMust
,
List
<
Map
<
String
,
Object
>>
statics
,
String
index
)
{
String
path
=
"licenses"
;
String
nestedField
=
path
+
".expiryDate"
;
BoolQueryBuilder
normalBoolQuery
=
QueryBuilderUtils
.
copyBoolQuery
(
boolMust
);
NestedQueryBuilder
normalNestedQuery
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
rangeQuery
(
nestedField
).
gt
(
LocalDate
.
now
().
plusDays
(
30
).
format
(
formatter
))),
ScoreMode
.
None
);
normalBoolQuery
.
must
(
normalNestedQuery
);
Long
normalCount
=
getStaticCount
(
normalBoolQuery
,
index
);
BoolQueryBuilder
nearBoolQuery
=
QueryBuilderUtils
.
copyBoolQuery
(
boolMust
);
NestedQueryBuilder
nearNestedQuery
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
rangeQuery
(
nestedField
).
lte
(
LocalDate
.
now
().
plusDays
(
30
).
format
(
formatter
)).
gte
(
LocalDate
.
now
().
format
(
formatter
))),
ScoreMode
.
None
);
nearBoolQuery
.
must
(
nearNestedQuery
);
Long
nearCount
=
getStaticCount
(
nearBoolQuery
,
StatisticalAnalysisEnum
.
company
.
getKey
());
Map
<
String
,
Object
>
normalMap
=
new
HashMap
<>();
normalMap
.
put
(
"name"
,
index
.
equals
(
StatisticalAnalysisEnum
.
company
.
getKey
())
?
"许可正常"
:
"资质正常"
);
normalMap
.
put
(
"value"
,
normalCount
);
statics
.
add
(
normalMap
);
Map
<
String
,
Object
>
nearMap
=
new
HashMap
<>();
nearMap
.
put
(
"name"
,
index
.
equals
(
StatisticalAnalysisEnum
.
company
.
getKey
())
?
"许可临期"
:
"资质临期"
);
nearMap
.
put
(
"value"
,
nearCount
);
statics
.
add
(
nearMap
);
}
private
Long
getStaticCount
(
BoolQueryBuilder
builder
,
String
index
)
{
CountRequest
countRequest
=
new
CountRequest
();
countRequest
.
indices
(
index
);
CountResponse
response
=
null
;
countRequest
.
query
(
builder
);
try
{
response
=
restHighLevelClient
.
count
(
countRequest
,
RequestOptions
.
DEFAULT
);
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
return
ObjectUtils
.
isEmpty
(
response
)
?
0
:
response
.
getCount
();
}
private
BigDecimal
getPipeLength
(
BoolQueryBuilder
boolMust
,
SearchSourceBuilder
builder
)
{
private
BigDecimal
getPipeLength
(
BoolQueryBuilder
boolMust
,
SearchSourceBuilder
builder
)
{
SearchRequest
request
=
new
SearchRequest
();
SearchRequest
request
=
new
SearchRequest
();
request
.
indices
(
StatisticalAnalysisEnum
.
equip
.
getKey
());
request
.
indices
(
StatisticalAnalysisEnum
.
equip
.
getKey
());
...
@@ -1881,25 +1965,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -1881,25 +1965,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
}
result
.
put
(
"certNo"
,
certNoData
);
result
.
put
(
"certNo"
,
certNoData
);
//资质状态
//资质状态
JSONArray
permissionStatus
=
new
JSONArray
();
result
.
put
(
"expiryDate"
,
queryExpiryDate
());
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
JSONObject
object
=
new
JSONObject
();
if
(
0
==
i
)
{
object
.
put
(
"key"
,
"overdue"
);
object
.
put
(
"value"
,
"overdue"
);
object
.
put
(
"label"
,
"资质超期"
);
}
else
if
(
1
==
i
)
{
object
.
put
(
"key"
,
"near"
);
object
.
put
(
"value"
,
"near"
);
object
.
put
(
"label"
,
"资质临期"
);
}
else
{
object
.
put
(
"key"
,
"normal"
);
object
.
put
(
"value"
,
"normal"
);
object
.
put
(
"label"
,
"正常"
);
}
permissionStatus
.
add
(
object
);
}
result
.
put
(
"expiryDate"
,
permissionStatus
);
//证书类型
//证书类型
List
<
DictionarieValueModel
>
certType
=
Systemctl
.
dictionarieClient
.
dictValues
(
"CERT_TYPE"
).
getResult
();
List
<
DictionarieValueModel
>
certType
=
Systemctl
.
dictionarieClient
.
dictValues
(
"CERT_TYPE"
).
getResult
();
JSONArray
certTypeArray
=
new
JSONArray
();
JSONArray
certTypeArray
=
new
JSONArray
();
...
@@ -2442,20 +2508,24 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -2442,20 +2508,24 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
public
JSONArray
queryExpiryDate
()
{
public
JSONArray
queryExpiryDate
()
{
//资质状态
//资质状态
JSONArray
permissionStatus
=
new
JSONArray
();
JSONArray
permissionStatus
=
new
JSONArray
();
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
for
(
int
i
=
0
;
i
<
4
;
i
++)
{
JSONObject
object
=
new
JSONObject
();
JSONObject
object
=
new
JSONObject
();
if
(
0
==
i
)
{
if
(
0
==
i
)
{
object
.
put
(
"key"
,
"
overdue
"
);
object
.
put
(
"key"
,
"
normal
"
);
object
.
put
(
"value"
,
"
overdue
"
);
object
.
put
(
"value"
,
"
normal
"
);
object
.
put
(
"label"
,
"资质
超期
"
);
object
.
put
(
"label"
,
"资质
正常
"
);
}
else
if
(
1
==
i
)
{
}
else
if
(
1
==
i
)
{
object
.
put
(
"key"
,
"near"
);
object
.
put
(
"key"
,
"near"
);
object
.
put
(
"value"
,
"near"
);
object
.
put
(
"value"
,
"near"
);
object
.
put
(
"label"
,
"资质临期"
);
object
.
put
(
"label"
,
"资质临期"
);
}
else
if
(
2
==
i
)
{
object
.
put
(
"key"
,
"overdue"
);
object
.
put
(
"value"
,
"overdue"
);
object
.
put
(
"label"
,
"资质超期"
);
}
else
{
}
else
{
object
.
put
(
"key"
,
"no
rmal
"
);
object
.
put
(
"key"
,
"no
ne
"
);
object
.
put
(
"value"
,
"no
rmal
"
);
object
.
put
(
"value"
,
"no
ne
"
);
object
.
put
(
"label"
,
"
正常
"
);
object
.
put
(
"label"
,
"
无有效期
"
);
}
}
permissionStatus
.
add
(
object
);
permissionStatus
.
add
(
object
);
}
}
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/utils/QueryBuilderUtils.java
0 → 100644
View file @
03fd4773
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistcs
.
biz
.
utils
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
public
class
QueryBuilderUtils
{
public
static
BoolQueryBuilder
copyBoolQuery
(
BoolQueryBuilder
original
)
{
if
(
original
==
null
)
{
return
QueryBuilders
.
boolQuery
();
}
BoolQueryBuilder
copy
=
QueryBuilders
.
boolQuery
();
// 复制查询条件
original
.
must
().
forEach
(
copy:
:
must
);
original
.
filter
().
forEach
(
copy:
:
filter
);
original
.
should
().
forEach
(
copy:
:
should
);
original
.
mustNot
().
forEach
(
copy:
:
mustNot
);
// 复制minimumShouldMatch设置(新版本方式)
if
(
original
.
minimumShouldMatch
()
!=
null
)
{
copy
.
minimumShouldMatch
(
original
.
minimumShouldMatch
());
}
// 复制其他属性
copy
.
boost
(
original
.
boost
());
copy
.
queryName
(
original
.
queryName
());
return
copy
;
}
}
\ No newline at end of file
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