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
c6cd1bb9
Commit
c6cd1bb9
authored
Jul 28, 2025
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修改
parent
6f8833de
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
107 additions
and
32 deletions
+107
-32
PipelineTechParamDefine.java
...s/boot/module/common/api/dto/PipelineTechParamDefine.java
+1
-1
CompanyAdvanceSearchEnum.java
...module/statistics/api/enums/CompanyAdvanceSearchEnum.java
+1
-1
ComprehensiveStatisticalAnalysisServiceImpl.java
...ice/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
+105
-30
No files found.
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/PipelineTechParamDefine.java
View file @
c6cd1bb9
...
...
@@ -25,7 +25,7 @@ public class PipelineTechParamDefine implements ITechParamDefine {
private
String
pipelineNumber
;
@TechnicalParameter
(
key
=
"deviceLevel"
,
label
=
"管道级别"
,
type
=
TechnicalParameter
.
ParamType
.
STRING
)
@TechnicalParameter
(
key
=
"deviceLevel"
,
label
=
"管道级别"
,
type
=
TechnicalParameter
.
ParamType
.
STRING
,
dictCode
=
"8100,8200,8300"
)
private
String
deviceLevel
;
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/enums/CompanyAdvanceSearchEnum.java
View file @
c6cd1bb9
...
...
@@ -55,7 +55,7 @@ public enum CompanyAdvanceSearchEnum {
}
else
if
(
TechnicalParameter
.
ParamType
.
STRING
.
equals
(
item
.
paramType
))
{
jsonObject
.
put
(
"type"
,
"input"
);
}
else
if
(
TechnicalParameter
.
ParamType
.
DATE
.
equals
(
item
.
paramType
))
{
jsonObject
.
put
(
"type"
,
FieldType
.
Date
);
jsonObject
.
put
(
"type"
,
"date"
);
}
else
{
jsonObject
.
put
(
"type"
,
"select"
);
}
...
...
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 @
c6cd1bb9
...
...
@@ -5,10 +5,12 @@ import cn.hutool.core.bean.copier.CopyOptions;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.yeejoin.amos.boot.biz.common.annotation.TechnicalParameter
;
import
com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.excel.ExcelUtil
;
...
...
@@ -103,6 +105,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
private
final
TzsCustomFilterMapper
tzsCustomFilterMapper
;
private
final
DataDictionaryServiceImpl
dataDictionaryService
;
private
final
DataDictionaryMapper
dataDictionaryMapper
;
private
final
EmqKeeper
emqKeeper
;
private
final
RestHighLevelClient
restHighLevelClient
;
...
...
@@ -116,7 +119,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
private
final
String
dpEquipPhotoSuffix
=
".png"
;
private
final
List
<
String
>
equipHandleOtherFields
=
Arrays
.
asList
(
"techParam"
,
"paramRange"
,
"JDJY"
,
"DQJY"
,
"SCJY"
,
"DTJY"
,
"QZ_OR_TANK"
,
"EQU_STATE"
,
"NEXT_INSPECT_DATE"
,
"registerStatus"
);
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"
,
"expiryDate"
);
private
final
List
<
String
>
personHandleOtherFields
=
Arrays
.
asList
(
"newPost"
,
"subPost"
,
"certNo"
,
"expiryDate"
,
"certType"
,
"permissionLevel"
,
"jobItem"
,
"permissionItem"
,
"issueDate"
,
"equipType"
);
private
final
String
or
=
"or"
;
...
...
@@ -216,14 +219,32 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
public
JSONArray
getData
(
String
dictCode
)
{
JSONArray
jsonArray
=
new
JSONArray
();
//根据dictCode查询数据字典
List
<
DataDictionary
>
dictionaries
=
dataDictionaryService
.
getByType
(
dictCode
);
for
(
DataDictionary
dictionary
:
dictionaries
)
{
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"label"
,
dictionary
.
getName
());
object
.
put
(
"value"
,
dictionary
.
getCode
());
object
.
put
(
"key"
,
dictionary
.
getCode
());
jsonArray
.
add
(
object
);
if
(
dictCode
.
contains
(
","
))
{
for
(
String
code
:
dictCode
.
split
(
","
))
{
LambdaQueryWrapper
<
DataDictionary
>
queryWrapper
=
new
LambdaQueryWrapper
();
queryWrapper
.
eq
(
DataDictionary:
:
getType
,
code
);
queryWrapper
.
eq
(
DataDictionary:
:
getIsDelete
,
Boolean
.
FALSE
);
queryWrapper
.
isNotNull
(
DataDictionary:
:
getParent
);
List
<
DataDictionary
>
dictionaries
=
dataDictionaryMapper
.
selectList
(
queryWrapper
);
for
(
DataDictionary
dictionary
:
dictionaries
)
{
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"label"
,
dictionary
.
getName
());
object
.
put
(
"value"
,
dictionary
.
getCode
());
object
.
put
(
"key"
,
dictionary
.
getCode
());
jsonArray
.
add
(
object
);
}
}
}
else
{
List
<
DataDictionary
>
dictionaries
=
dataDictionaryService
.
getByType
(
dictCode
);
for
(
DataDictionary
dictionary
:
dictionaries
)
{
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"label"
,
dictionary
.
getName
());
object
.
put
(
"value"
,
dictionary
.
getCode
());
object
.
put
(
"key"
,
dictionary
.
getCode
());
jsonArray
.
add
(
object
);
}
}
return
jsonArray
;
}
...
...
@@ -501,7 +522,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
// 超期:小于当前日期
NestedQueryBuilder
nestedQuery
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
rangeQuery
(
nestedField
).
lt
(
LocalDate
.
now
().
format
(
formatter
)
)),
QueryBuilders
.
rangeQuery
(
nestedField
).
lt
(
LocalDate
.
now
().
format
(
formatter
)),
ScoreMode
.
None
);
boolMust
.
must
(
nestedQuery
);
...
...
@@ -509,7 +530,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
// 临期:小于等于当前日期加上30天
NestedQueryBuilder
nestedQuery
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
rangeQuery
(
nestedField
).
lte
(
LocalDate
.
now
().
plusDays
(
30
).
format
(
formatter
)).
gte
(
LocalDate
.
now
().
format
(
formatter
)
)),
QueryBuilders
.
rangeQuery
(
nestedField
).
lte
(
LocalDate
.
now
().
plusDays
(
30
).
format
(
formatter
)).
gte
(
LocalDate
.
now
().
format
(
formatter
)),
ScoreMode
.
None
);
boolMust
.
must
(
nestedQuery
);
...
...
@@ -517,7 +538,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
// 正常:大于当前日期加上30天
NestedQueryBuilder
nestedQuery
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
rangeQuery
(
nestedField
).
gt
(
LocalDate
.
now
().
plusDays
(
30
).
format
(
formatter
)
)),
QueryBuilders
.
rangeQuery
(
nestedField
).
gt
(
LocalDate
.
now
().
plusDays
(
30
).
format
(
formatter
)),
ScoreMode
.
None
);
boolMust
.
must
(
nestedQuery
);
...
...
@@ -532,7 +553,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
else
if
(
k
.
equals
(
"certType"
)
||
k
.
equals
(
"permissionLevel"
))
{
NestedQueryBuilder
nestedQuery
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
termsQuery
(
nestedField
,
(
JSONArray
)
v
)
),
QueryBuilders
.
termsQuery
(
nestedField
,
(
JSONArray
)
v
),
ScoreMode
.
None
);
boolMust
.
must
(
nestedQuery
);
...
...
@@ -542,7 +563,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
wildcardQuery
(
nestedField
,
"*"
+
item
+
"*"
)),
ScoreMode
.
None
);
boolMust
.
should
(
nestedQuery
);
boolMust
.
must
(
nestedQuery
);
}
});
boolMust
.
must
(
licencesQueryBuilder
.
build
());
...
...
@@ -1494,17 +1515,23 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
break
;
case
"in"
:
JSONArray
inValues
=
new
JSONArray
();
if
(
value
instanceof
JSONArray
)
{
inValues
=
(
JSONArray
)
value
;
}
if
(
value
instanceof
List
)
{
// value转化为jsONArray
inValues
.
addAll
((
List
)
value
);
BoolQueryBuilder
boolQuery
=
QueryBuilders
.
boolQuery
().
must
(
termsQueryBuilder
);
if
(
value
instanceof
String
)
{
boolQuery
.
must
(
QueryBuilders
.
termQuery
(
path
+
tail
,
value
));
}
else
{
JSONArray
inValues
=
new
JSONArray
();
if
(
value
instanceof
JSONArray
)
{
inValues
=
(
JSONArray
)
value
;
}
if
(
value
instanceof
List
)
{
// value转化为jsONArray
inValues
.
addAll
((
List
)
value
);
}
boolQuery
.
must
(
QueryBuilders
.
termsQuery
(
path
+
tail
,
inValues
));
}
NestedQueryBuilder
inQuery
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
boolQuery
().
must
(
termsQueryBuilder
).
must
(
QueryBuilders
.
termsQuery
(
path
+
tail
,
inValues
))
,
boolQuery
,
ScoreMode
.
None
);
if
(
isCustom
)
{
...
...
@@ -1514,16 +1541,29 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
break
;
case
"notIn"
:
JSONArray
notInValues
=
(
JSONArray
)
value
;
BoolQueryBuilder
notInBoolQuery
=
QueryBuilders
.
boolQuery
().
must
(
termsQueryBuilder
);
if
(
value
instanceof
String
)
{
notInBoolQuery
.
mustNot
(
QueryBuilders
.
termQuery
(
path
+
tail
,
value
));
}
else
{
JSONArray
inValues
=
new
JSONArray
();
if
(
value
instanceof
JSONArray
)
{
inValues
=
(
JSONArray
)
value
;
}
if
(
value
instanceof
List
)
{
// value转化为jsONArray
inValues
.
addAll
((
List
)
value
);
}
notInBoolQuery
.
mustNot
(
QueryBuilders
.
termsQuery
(
path
+
tail
,
inValues
));
}
NestedQueryBuilder
notInQuery
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
boolQuery
().
must
(
termsQueryBuilder
).
must
(
QueryBuilders
.
termsQuery
(
path
+
tail
,
notInValues
))
,
notInBoolQuery
,
ScoreMode
.
None
);
if
(
isCustom
)
{
builder
.
add
(
QueryBuilders
.
boolQuery
().
mustNot
(
notInQuery
),
andOr
);
}
else
{
boolMust
.
must
Not
(
notInQuery
);
boolMust
.
must
(
notInQuery
);
}
break
;
}
...
...
@@ -1633,7 +1673,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
else
{
field
=
field
.
equals
(
"nextInspectDate"
)
?
"NEXT_INSPECT_DATE"
:
field
.
equals
(
"use_date"
)
?
"USE_DATE"
:
field
;
String
finalField
=
field
;
if
(
itemCondition
.
contains
(
"like
"
))
{
if
(
!
itemCondition
.
contains
(
"gt"
)
&&
!
itemCondition
.
contains
(
"lt"
)
&&
!
itemCondition
.
equals
(
"between
"
))
{
FieldType
esType
;
if
(
StatisticalAnalysisEnum
.
equip
.
getCode
().
equals
(
type
))
{
esType
=
EquipAdvanceSearchEnum
.
getEsType
.
get
(
field
);
...
...
@@ -1869,9 +1909,9 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
private
void
companyFieldHandle
(
String
field
,
String
itemCondition
,
Object
value
,
String
isOr
,
EnhancedDynamicQueryBuilder
builder
)
{
if
(
field
.
equals
(
"itemCode"
)
||
field
.
equals
(
"subItemCode"
)
||
field
.
equals
(
"permitStatus"
))
{
if
(
field
.
equals
(
"itemCode"
)
||
field
.
equals
(
"subItemCode"
)
||
field
.
equals
(
"permitStatus"
)
||
field
.
equals
(
"expiryDate"
)
)
{
String
path
=
"licenses"
;
String
nestedField
=
path
+
"."
+
(
field
.
equals
(
"permitStatus"
)
?
"expiryDate"
:
field
+
".keyword"
);
String
nestedField
=
path
+
"."
+
(
field
.
equals
(
"permitStatus"
)
||
field
.
equals
(
"expiryDate"
)
?
"expiryDate"
:
field
+
".keyword"
);
if
(
field
.
equals
(
"permitStatus"
))
{
// 无许可到期日期
NestedQueryBuilder
noneQuery
=
QueryBuilders
.
nestedQuery
(
...
...
@@ -1948,6 +1988,31 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
builder
.
add
(
QueryBuilders
.
boolQuery
().
must
(
noneQuery
),
or
);
}
}
}
else
if
(
field
.
equals
(
"expiryDate"
))
{
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
switch
(
itemCondition
)
{
case
"eq"
:
query
.
must
(
QueryBuilders
.
termQuery
(
nestedField
,
value
));
break
;
case
"lt"
:
query
.
must
(
QueryBuilders
.
rangeQuery
(
nestedField
).
lt
(
value
));
break
;
case
"lte"
:
query
.
must
(
QueryBuilders
.
rangeQuery
(
nestedField
).
lte
(
value
));
break
;
case
"gt"
:
query
.
must
(
QueryBuilders
.
rangeQuery
(
nestedField
).
gt
(
value
));
break
;
case
"gte"
:
query
.
must
(
QueryBuilders
.
rangeQuery
(
nestedField
).
gte
(
value
));
break
;
}
NestedQueryBuilder
dateQuery
=
QueryBuilders
.
nestedQuery
(
path
,
query
,
ScoreMode
.
None
);
builder
.
add
(
dateQuery
,
isOr
);
}
else
{
if
(
itemCondition
.
equals
(
"eq"
)
||
itemCondition
.
equals
(
"in"
))
{
// 创建嵌套查询
...
...
@@ -2319,11 +2384,21 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
public
JSONArray
queryXK
(
String
type
)
{
JSONArray
result
=
new
JSONArray
();
if
(
ValidationUtil
.
isEmpty
(
type
))
{
List
<
DataDictionary
>
xkxm
=
dataDictionaryService
.
lambdaQuery
().
like
(
DataDictionary:
:
getType
,
"XKXM"
).
eq
(
BaseEntity:
:
getIsDelete
,
false
).
list
();
if
(
null
==
type
)
{
List
<
DataDictionary
>
xkxm
=
dataDictionaryService
.
lambdaQuery
()
.
and
(
wrapper
->
wrapper
.
like
(
DataDictionary:
:
getType
,
"XKXM"
)
.
or
()
.
eq
(
DataDictionary:
:
getType
,
"sbpz"
))
.
eq
(
BaseEntity:
:
getIsDelete
,
false
)
.
list
();
result
=
deployDictionary
(
xkxm
);
}
else
{
List
<
DataDictionary
>
childrenxkxm
=
dataDictionaryService
.
lambdaQuery
().
eq
(
DataDictionary:
:
getTypeDesc
,
type
).
eq
(
BaseEntity:
:
getIsDelete
,
false
).
list
();
List
<
DataDictionary
>
childrenxkxm
=
new
ArrayList
<>();
if
(
""
.
equals
(
type
))
{
childrenxkxm
=
dataDictionaryService
.
lambdaQuery
().
eq
(
BaseEntity:
:
getIsDelete
,
false
).
list
();
}
else
{
childrenxkxm
=
dataDictionaryService
.
lambdaQuery
().
eq
(
DataDictionary:
:
getTypeDesc
,
type
).
eq
(
BaseEntity:
:
getIsDelete
,
false
).
list
();
}
result
=
deployDictionary
(
childrenxkxm
);
}
return
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