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
199af075
Commit
199af075
authored
Jul 25, 2025
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修改
parent
bf868e37
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
150 additions
and
35 deletions
+150
-35
ConditionEnum.java
.../amos/boot/module/statistics/api/enums/ConditionEnum.java
+4
-4
DataQualityScoreEnum.java
...oot/module/statistics/api/enums/DataQualityScoreEnum.java
+1
-1
EquipAdvanceSearchEnum.java
...t/module/statistics/api/enums/EquipAdvanceSearchEnum.java
+5
-5
ComprehensiveStatisticalAnalysisController.java
...ontroller/ComprehensiveStatisticalAnalysisController.java
+11
-0
ComprehensiveStatisticalAnalysisServiceImpl.java
...ice/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
+129
-25
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/ConditionEnum.java
View file @
199af075
...
...
@@ -20,13 +20,13 @@ public enum ConditionEnum {
numberEq
(
"等于"
,
"eq"
,
TechnicalParameter
.
ParamType
.
BIG_DECIMAL
),
numberGt
(
"大于"
,
"gt"
,
TechnicalParameter
.
ParamType
.
BIG_DECIMAL
),
numberLt
(
"小于"
,
"lt"
,
TechnicalParameter
.
ParamType
.
BIG_DECIMAL
),
numberGe
(
"大于等于"
,
"ge"
,
TechnicalParameter
.
ParamType
.
BIG_DECIMAL
),
numberLe
(
"小于等于"
,
"le"
,
TechnicalParameter
.
ParamType
.
BIG_DECIMAL
),
numberGe
(
"大于等于"
,
"g
t
e"
,
TechnicalParameter
.
ParamType
.
BIG_DECIMAL
),
numberLe
(
"小于等于"
,
"l
t
e"
,
TechnicalParameter
.
ParamType
.
BIG_DECIMAL
),
dateEq
(
"等于"
,
"eq"
,
TechnicalParameter
.
ParamType
.
DATE
),
dateGt
(
"大于"
,
"gt"
,
TechnicalParameter
.
ParamType
.
DATE
),
dateLt
(
"小于"
,
"lt"
,
TechnicalParameter
.
ParamType
.
DATE
),
dateGe
(
"大于等于"
,
"ge"
,
TechnicalParameter
.
ParamType
.
DATE
),
dateLe
(
"小于等于"
,
"le"
,
TechnicalParameter
.
ParamType
.
DATE
),
dateGe
(
"大于等于"
,
"g
t
e"
,
TechnicalParameter
.
ParamType
.
DATE
),
dateLe
(
"小于等于"
,
"l
t
e"
,
TechnicalParameter
.
ParamType
.
DATE
),
in
(
"包含"
,
"in"
,
null
),
notIn
(
"不包含"
,
"notIn"
,
null
),
eq
(
"等于"
,
"eq"
,
null
),
...
...
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 @
199af075
...
...
@@ -41,7 +41,7 @@ public enum DataQualityScoreEnum {
for
(
DataQualityScoreEnum
e
:
DataQualityScoreEnum
.
values
())
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"label"
,
e
.
name
);
jsonObject
.
put
(
"value"
,
e
.
nam
e
);
jsonObject
.
put
(
"value"
,
e
.
cod
e
);
jsonObject
.
put
(
"key"
,
e
.
code
);
jsonArray
.
add
(
jsonObject
);
}
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/enums/EquipAdvanceSearchEnum.java
View file @
199af075
...
...
@@ -24,7 +24,7 @@ public enum EquipAdvanceSearchEnum {
PRODUCT_NAME
(
"设备名称"
,
"PRODUCT_NAME"
,
TechnicalParameter
.
ParamType
.
STRING
,
""
,
null
,
null
,
FieldType
.
Keyword
),
TECH_PARAM
(
"技术参数"
,
"techParam"
,
null
,
"/statistics/comprehensiveStatisticalAnalysis/select/queryTechParam"
,
null
,
"EQU_LIST_CODE,EQU_CATEGORY_CODE,EQU_DEFINE_CODE,WHETHER_VEHICLE_CYLINDER,QZ_OR_TANK"
,
FieldType
.
Auto
),
PARAM_RANGE
(
"参数范围"
,
"paramRange"
,
TechnicalParameter
.
ParamType
.
STRING
,
""
,
null
,
null
,
FieldType
.
Auto
),
NEXT_INSPECT_DATE
(
"检验有效期"
,
"NEXT_INSPECT_DATE"
,
TechnicalParameter
.
ParamType
.
DATE
,
"
"
,
null
,
null
,
FieldType
.
Date
),
NEXT_INSPECT_DATE
(
"检验有效期"
,
"NEXT_INSPECT_DATE"
,
null
,
"/statistics/comprehensiveStatisticalAnalysis/select/queryInspectionDate
"
,
null
,
null
,
FieldType
.
Date
),
EQU_STATE
(
"设备状态"
,
"EQU_STATE"
,
null
,
"/statistics/comprehensiveStatisticalAnalysis/select/queryEquState"
,
null
,
null
,
FieldType
.
Integer
),
WHETHER_VEHICLE_CYLINDER
(
"是否车用气瓶"
,
"WHETHER_VEHICLE_CYLINDER"
,
null
,
"/statistics/comprehensiveStatisticalAnalysis/select/vehicleCylinder"
,
null
,
null
,
FieldType
.
Keyword
),
QZ_OR_TANK
(
"是否撬装球罐"
,
"QZ_OR_TANK"
,
null
,
"/statistics/comprehensiveStatisticalAnalysis/select/qzOrTank"
,
null
,
null
,
FieldType
.
Auto
),
...
...
@@ -37,13 +37,13 @@ public enum EquipAdvanceSearchEnum {
PRODUCE_UNIT_NAME
(
"制造单位名称"
,
"PRODUCE_UNIT_NAME"
,
TechnicalParameter
.
ParamType
.
STRING
,
""
,
null
,
null
,
FieldType
.
Keyword
),
DESIGN_UNIT_NAME
(
"设计单位名称"
,
"designUnitName"
,
TechnicalParameter
.
ParamType
.
STRING
,
""
,
null
,
null
,
FieldType
.
Text
),
ME_UNIT_NAME
(
"维保单位名称"
,
"MAINTAIN_UNIT_NAME"
,
TechnicalParameter
.
ParamType
.
STRING
,
""
,
null
,
null
,
FieldType
.
Keyword
),
AZUSC_UNIT_NAME
(
"安
改维
单位名称"
,
"USC_UNIT_NAME"
,
TechnicalParameter
.
ParamType
.
STRING
,
""
,
null
,
null
,
FieldType
.
Text
),
AZUSC_UNIT_NAME
(
"安
装改造维修
单位名称"
,
"USC_UNIT_NAME"
,
TechnicalParameter
.
ParamType
.
STRING
,
""
,
null
,
null
,
FieldType
.
Text
),
CODE96333
(
"96333识别码"
,
"CODE96333"
,
TechnicalParameter
.
ParamType
.
STRING
,
""
,
null
,
null
,
FieldType
.
Keyword
),
SUPERVISORY_CODE
(
"监管码"
,
"SUPERVISORY_CODE"
,
TechnicalParameter
.
ParamType
.
STRING
,
""
,
null
,
null
,
FieldType
.
Keyword
),
EQU_TYPE
(
"设备型号"
,
"EQU_TYPE"
,
TechnicalParameter
.
ParamType
.
STRING
,
""
,
null
,
null
,
FieldType
.
Text
),
PRODUCE_DATE
(
"制造日期"
,
"PRODUCE_DATE"
,
TechnicalParameter
.
ParamType
.
DATE
,
""
,
null
,
null
,
FieldType
.
Date
),
designDate
(
"设计日期"
,
"designDate"
,
TechnicalParameter
.
ParamType
.
DATE
,
""
,
null
,
null
,
FieldType
.
Date
),
use_date
(
"投用
如期"
,
"USE_DATE
"
,
TechnicalParameter
.
ParamType
.
DATE
,
""
,
null
,
null
,
FieldType
.
Date
),
use_date
(
"投用
日期"
,
"use_date
"
,
TechnicalParameter
.
ParamType
.
DATE
,
""
,
null
,
null
,
FieldType
.
Date
),
ISSUE_DATE
(
"使用登记证日期"
,
"issueDate"
,
TechnicalParameter
.
ParamType
.
DATE
,
""
,
null
,
null
,
FieldType
.
Date
),
JDJY
(
"监督检验日期"
,
"JDJY"
,
TechnicalParameter
.
ParamType
.
DATE
,
""
,
null
,
null
,
FieldType
.
Date
),
DQJY
(
"定期检验日期"
,
"DQJY"
,
TechnicalParameter
.
ParamType
.
DATE
,
""
,
null
,
null
,
FieldType
.
Date
),
...
...
@@ -51,8 +51,8 @@ public enum EquipAdvanceSearchEnum {
DTJY
(
"电梯检测日期"
,
"DTJY"
,
TechnicalParameter
.
ParamType
.
DATE
,
""
,
null
,
null
,
FieldType
.
Date
),
nextInspectDate
(
"下次检验日期"
,
"nextInspectDate"
,
TechnicalParameter
.
ParamType
.
DATE
,
""
,
null
,
null
,
FieldType
.
Date
),
// PRODUCE_DATE("是否进口", "PRODUCE_DATE", TechnicalParameter.ParamType.DATE,""),
USE_PLACE_CODE
(
"使用地点"
,
"USE_PLACE
_CODE
"
,
TechnicalParameter
.
ParamType
.
STRING
,
""
,
null
,
null
,
FieldType
.
Keyword
),
USE_PLACE
(
"使用场所"
,
"USE_
PLAC
E"
,
null
,
"/statistics/comprehensiveStatisticalAnalysis/select/queryDicData?type={type}"
,
"ADDRESS"
,
null
,
FieldType
.
Keyword
),
USE_PLACE_CODE
(
"使用地点"
,
"USE_PLACE"
,
TechnicalParameter
.
ParamType
.
STRING
,
""
,
null
,
null
,
FieldType
.
Keyword
),
USE_PLACE
(
"使用场所"
,
"USE_
SITE_COD
E"
,
null
,
"/statistics/comprehensiveStatisticalAnalysis/select/queryDicData?type={type}"
,
"ADDRESS"
,
null
,
FieldType
.
Keyword
),
;
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/controller/ComprehensiveStatisticalAnalysisController.java
View file @
199af075
...
...
@@ -439,4 +439,15 @@ public class ComprehensiveStatisticalAnalysisController extends BaseController {
public
ResponseModel
<
JSONArray
>
queryExpiryDate
()
{
return
ResponseHelper
.
buildResponse
(
statisticalAnalysisService
.
queryExpiryDate
());
}
/**
* @param
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/select/queryInspectionDate"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"高级搜索检验有效期"
,
notes
=
"高级搜索检验有效期"
)
public
ResponseModel
<
JSONArray
>
queryInspectionDate
()
{
return
ResponseHelper
.
buildResponse
(
statisticalAnalysisService
.
queryInspectionDate
());
}
}
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 @
199af075
...
...
@@ -115,7 +115,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"
);
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
>
personHandleOtherFields
=
Arrays
.
asList
(
"newPost"
,
"subPost"
,
"certNo"
,
"expiryDate"
,
"certType"
,
"permissionLevel"
,
"jobItem"
,
"permissionItem"
,
"issueDate"
,
"equipType"
);
...
...
@@ -300,9 +300,10 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
JSONObject
filterParams
=
null
;
String
licensesStatusStr
=
""
;
String
filterType
=
filter
.
getString
(
"filterType"
);
if
(!
ObjectUtils
.
isEmpty
(
filter
.
get
(
"filterParams"
)))
{
filterParams
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
filter
.
get
(
"filterParams"
)));
String
filterType
=
filter
.
getString
(
"filterType"
);
// 组装人员过滤条件
this
.
getPersonBoolQueryBuilder
(
filterParams
,
boolMust
,
filterType
);
// 资质判断
...
...
@@ -316,6 +317,12 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
}
}
if
(
"custom"
.
equals
(
filterType
))
{
JSONArray
leftGroup
=
filterParams
.
getJSONArray
(
"group1"
);
JSONArray
rightGroup
=
filterParams
.
getJSONArray
(
"group2"
);
licensesStatusStr
=
getFilterPermitStatusOrLicensesStatus
(
leftGroup
,
rightGroup
,
StatisticalAnalysisEnum
.
person
.
getCode
());
}
// 组装人员排序条件
this
.
getPersonBoolQuerySort
(
filter
,
builder
);
...
...
@@ -622,8 +629,9 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
boolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode.keyword"
,
orgCode
));
JSONObject
filterParams
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
filter
.
get
(
"filterParams"
)));
if
(!
ObjectUtils
.
isEmpty
(
filter
.
get
(
"filterParams"
)))
{
String
filterType
=
filter
.
getString
(
"filterType"
);
if
(!
ObjectUtils
.
isEmpty
(
filter
.
get
(
"filterParams"
)))
{
getCompanyBoolQueryBuilder
(
filterParams
,
filterType
,
boolMust
);
}
...
...
@@ -638,6 +646,12 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
}
if
(
"custom"
.
equals
(
filterType
))
{
JSONArray
leftGroup
=
filterParams
.
getJSONArray
(
"group1"
);
JSONArray
rightGroup
=
filterParams
.
getJSONArray
(
"group2"
);
permitStatusStr
=
getFilterPermitStatusOrLicensesStatus
(
leftGroup
,
rightGroup
,
StatisticalAnalysisEnum
.
company
.
getCode
());
}
// 排序
if
(!
ObjectUtils
.
isEmpty
(
filter
.
get
(
"sort"
)))
{
JSONObject
sort
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
filter
.
get
(
"sort"
)));
...
...
@@ -871,6 +885,30 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
}
private
String
getFilterPermitStatusOrLicensesStatus
(
JSONArray
leftGroup
,
JSONArray
rightGroup
,
String
code
)
{
String
filed
=
code
.
equals
(
StatisticalAnalysisEnum
.
company
.
getCode
())
?
"permitStatus"
:
"expiryDate"
;
List
<
Object
>
leftPermitList
=
leftGroup
.
stream
().
filter
(
e
->
filed
.
equals
(((
JSONObject
)
e
).
getString
(
"field"
))
&&
((
JSONObject
)
e
).
containsKey
(
"value"
)).
collect
(
Collectors
.
toList
());
List
<
Object
>
rightPermitList
=
rightGroup
.
stream
().
filter
(
e
->
filed
.
equals
(((
JSONObject
)
e
).
getString
(
"field"
))
&&
((
JSONObject
)
e
).
containsKey
(
"value"
)).
collect
(
Collectors
.
toList
());
int
count
=
0
;
Boolean
isLeft
=
false
;
Boolean
isRight
=
false
;
if
(!
ObjectUtils
.
isEmpty
(
leftPermitList
)
&&
leftPermitList
.
size
()
==
1
)
{
count
+=
1
;
isLeft
=
true
;
}
if
(!
ObjectUtils
.
isEmpty
(
rightPermitList
)
&&
rightPermitList
.
size
()
==
1
)
{
count
+=
1
;
isRight
=
true
;
}
String
statusStr
=
""
;
if
(
count
==
1
&&
isLeft
)
{
statusStr
=
((
JSONObject
)
leftPermitList
.
get
(
0
)).
getString
(
"value"
);
}
else
if
(
count
==
1
&&
isRight
)
{
statusStr
=
((
JSONObject
)
rightPermitList
.
get
(
0
)).
getString
(
"value"
);
}
return
statusStr
;
}
private
void
deleteUnitCategory
(
JSONObject
filterParams
)
{
if
(
filterParams
.
containsKey
(
"unitType"
)
&&
!
filterParams
.
getString
(
"unitType"
).
contains
(
"all"
)
&&
!
filterParams
.
getString
(
"unitType"
).
contains
(
"[]"
))
{
filterParams
.
remove
(
"unitCategory"
);
...
...
@@ -917,6 +955,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
field
=
"ORG_BRANCH_CODE"
;
}
else
if
(
field
.
equals
(
"USE_UNIT_NAME"
))
{
field
=
"USE_UNIT_CREDIT_CODE"
;
}
else
if
(
field
.
equals
(
"inspectStatus"
))
{
field
=
"NEXT_INSPECT_DATE"
;
}
builder
.
sort
(
field
,
sort
.
getString
(
"order"
).
equals
(
"desc"
)
?
SortOrder
.
DESC
:
SortOrder
.
ASC
);
}
...
...
@@ -1591,10 +1631,12 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
private
void
getItemQuery
(
String
field
,
String
itemCondition
,
Object
value
,
String
isOr
,
EnhancedDynamicQueryBuilder
builder
,
String
type
)
{
// 如果包含需要特殊处理的字段,则调用对应的处理方法,否则调用通用处理方法
if
(
equipHandleOtherFields
.
contains
(
field
)
||
companyHandleOtherFields
.
contains
(
field
)
||
personHandleOtherFields
.
contains
(
field
))
{
if
((
equipHandleOtherFields
.
contains
(
field
)
&&
StatisticalAnalysisEnum
.
equip
.
getCode
().
equals
(
type
))
||
(
companyHandleOtherFields
.
contains
(
field
)
&&
StatisticalAnalysisEnum
.
company
.
getCode
().
equals
(
type
))
||
(
personHandleOtherFields
.
contains
(
field
)
&&
StatisticalAnalysisEnum
.
person
.
getCode
().
equals
(
type
)))
{
handleOtherField
(
field
,
itemCondition
,
value
,
isOr
,
builder
);
}
else
{
field
=
field
.
equals
(
"nextInspectDate"
)
?
"NEXT_INSPECT_DATE"
:
field
;
field
=
field
.
equals
(
"nextInspectDate"
)
?
"NEXT_INSPECT_DATE"
:
field
.
equals
(
"use_date"
)
?
"USE_DATE"
:
field
;
String
finalField
=
field
;
if
(
itemCondition
.
contains
(
"like"
))
{
FieldType
esType
;
...
...
@@ -1942,27 +1984,39 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
private
void
equipFieldHandle
(
String
field
,
String
itemCondition
,
Object
value
,
String
isOr
,
EnhancedDynamicQueryBuilder
builder
)
{
if
(
field
.
equals
(
"NEXT_INSPECT_DATE"
))
{
if
(
value
.
equals
(
overdue
))
{
// 超期:小于当前日期
BoolQueryBuilder
overdueQuery
=
QueryBuilders
.
boolQuery
().
filter
(
QueryBuilders
.
rangeQuery
(
field
).
lt
(
LocalDate
.
now
().
format
(
formatter
)));
BoolQueryBuilder
nearQuery
=
QueryBuilders
.
boolQuery
().
filter
(
QueryBuilders
.
rangeQuery
(
field
).
gte
(
LocalDate
.
now
().
format
(
formatter
)).
lte
(
LocalDate
.
now
().
plusDays
(
30
).
format
(
formatter
)));
BoolQueryBuilder
normalQuery
=
QueryBuilders
.
boolQuery
().
filter
(
QueryBuilders
.
rangeQuery
(
field
).
gt
(
LocalDate
.
now
().
plusDays
(
30
).
format
(
formatter
)));
BoolQueryBuilder
noneQuery
=
QueryBuilders
.
boolQuery
().
mustNot
(
existsQuery
(
field
));
DynamicQueryBuilder
builders
=
new
DynamicQueryBuilder
();
if
(
itemCondition
.
equals
(
"eq"
)
||
itemCondition
.
equals
(
"in"
))
{
builder
.
add
(
QueryBuilders
.
boolQuery
().
filter
(
QueryBuilders
.
rangeQuery
(
field
).
lt
(
LocalDate
.
now
().
format
(
formatter
))),
isOr
);
}
else
{
builder
.
add
(
QueryBuilders
.
boolQuery
().
filter
(
QueryBuilders
.
rangeQuery
(
field
).
gt
(
LocalDate
.
now
().
format
(
formatter
))),
isOr
);
}
if
(
value
.
equals
(
overdue
))
{
builder
.
add
(
overdueQuery
,
isOr
);
}
else
if
(
value
.
equals
(
near
))
{
// 临期:小于等于当前日期加上30天
if
(
itemCondition
.
equals
(
"eq"
)
||
itemCondition
.
equals
(
"in"
))
{
builder
.
add
(
QueryBuilders
.
boolQuery
().
filter
(
QueryBuilders
.
rangeQuery
(
field
).
gte
(
LocalDate
.
now
().
format
(
formatter
)).
lte
(
LocalDate
.
now
().
plusDays
(
30
).
format
(
formatter
)))
,
isOr
);
builder
.
add
(
nearQuery
,
isOr
);
}
else
if
(
value
.
equals
(
normal
))
{
builder
.
add
(
normalQuery
,
isOr
);
}
else
{
builder
.
add
(
QueryBuilders
.
boolQuery
().
filter
(
QueryBuilders
.
rangeQuery
(
field
).
lt
(
LocalDate
.
now
().
format
(
formatter
))),
or
);
builder
.
add
(
QueryBuilders
.
boolQuery
().
filter
(
QueryBuilders
.
rangeQuery
(
field
).
gt
(
LocalDate
.
now
().
plusDays
(
30
).
format
(
formatter
))),
or
);
builder
.
add
(
noneQuery
,
isOr
);
}
}
else
{
// 正常:大于当前日期加上30天
if
(
itemCondition
.
equals
(
"eq"
)
||
itemCondition
.
equals
(
"in"
))
{
builder
.
add
(
QueryBuilders
.
boolQuery
().
filter
(
QueryBuilders
.
rangeQuery
(
field
).
gt
(
LocalDate
.
now
().
plusDays
(
30
).
format
(
formatter
))),
isOr
);
if
(
value
.
equals
(
overdue
))
{
builders
.
or
(
nearQuery
);
builders
.
or
(
normalQuery
);
builders
.
or
(
noneQuery
);
builder
.
add
(
builders
.
build
(),
isOr
);
}
else
if
(
value
.
equals
(
near
))
{
builders
.
or
(
overdueQuery
);
builders
.
or
(
normalQuery
);
builders
.
or
(
noneQuery
);
builder
.
add
(
builders
.
build
(),
isOr
);
}
else
if
(
value
.
equals
(
normal
))
{
builders
.
or
(
overdueQuery
);
builders
.
or
(
nearQuery
);
builders
.
or
(
noneQuery
);
builder
.
add
(
builders
.
build
(),
isOr
);
}
else
{
builder
.
add
(
QueryBuilders
.
boolQuery
().
filter
(
QueryBuilders
.
rangeQuery
(
field
).
lt
(
LocalDate
.
now
().
plusDays
(
30
).
format
(
formatter
)
)),
isOr
);
builder
.
add
(
QueryBuilders
.
boolQuery
().
must
(
existsQuery
(
field
)),
isOr
);
}
}
}
else
if
(
field
.
equals
(
"USE_DATE"
))
{
...
...
@@ -2007,12 +2061,13 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
else
{
queryBuilder
.
must
(
QueryBuilders
.
termsQuery
(
typeField
,
field
));
}
EnhancedDynamicQueryBuilder
queryBuilders
=
new
EnhancedDynamicQueryBuilder
();
NestedQueryBuilder
fieldQuery
=
QueryBuilders
.
nestedQuery
(
path
,
queryBuilder
,
ScoreMode
.
None
);
builder
.
add
(
fieldQuery
,
and
);
queryBuilders
.
add
(
fieldQuery
,
and
);
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
switch
(
itemCondition
)
{
case
"lt"
:
...
...
@@ -2033,7 +2088,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
query
,
ScoreMode
.
None
);
builder
.
add
(
dateQuery
,
isOr
);
queryBuilders
.
add
(
dateQuery
,
and
);
builder
.
add
(
queryBuilders
.
build
(),
isOr
);
}
else
if
(
field
.
equals
(
"QZ_OR_TANK"
))
{
if
(!
""
.
equals
(
value
)
&&
value
!=
null
)
{
if
(
itemCondition
.
equals
(
"eq"
)
||
itemCondition
.
equals
(
"in"
))
{
...
...
@@ -2044,10 +2100,13 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
}
else
if
(
field
.
equals
(
"registerStatus"
))
{
BoolQueryBuilder
registerQuery
=
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
termsQuery
(
"IS_INTO_MANAGEMENT"
,
Boolean
.
TRUE
))
.
must
(
existsQuery
(
"USE_ORG_CODE"
));
BoolQueryBuilder
noRegisterQuery
=
QueryBuilders
.
boolQuery
().
should
(
QueryBuilders
.
boolQuery
().
mustNot
(
existsQuery
(
"IS_INTO_MANAGEMENT"
)))
.
should
(
QueryBuilders
.
matchQuery
(
"IS_INTO_MANAGEMENT"
,
Boolean
.
FALSE
))
.
must
(
existsQuery
(
"USE_ORG_CODE"
))
.
mustNot
(
QueryBuilders
.
termQuery
(
"USE_ORG_CODE"
,
""
));
BoolQueryBuilder
noRegisterQuery
=
QueryBuilders
.
boolQuery
()
.
should
(
QueryBuilders
.
boolQuery
().
mustNot
(
existsQuery
(
"IS_INTO_MANAGEMENT"
)))
.
should
(
QueryBuilders
.
termQuery
(
"IS_INTO_MANAGEMENT"
,
Boolean
.
FALSE
))
.
should
(
QueryBuilders
.
boolQuery
().
mustNot
(
existsQuery
(
"USE_ORG_CODE"
)))
.
should
(
QueryBuilders
.
termQuery
(
"USE_ORG_CODE"
,
""
))
.
minimumShouldMatch
(
1
);
if
(
itemCondition
.
equals
(
"eq"
)
||
itemCondition
.
equals
(
"in"
))
{
if
(
value
.
equals
(
"1"
))
{
...
...
@@ -2062,6 +2121,23 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
builder
.
add
(
registerQuery
,
isOr
);
}
}
}
else
if
(
field
.
equals
(
"EQU_STATE"
))
{
if
(
itemCondition
.
equals
(
"eq"
)
||
itemCondition
.
equals
(
"in"
))
{
if
(!
value
.
equals
(
"99"
))
{
builder
.
add
(
QueryBuilders
.
termQuery
(
field
,
value
),
isOr
);
}
else
{
builder
.
add
(
QueryBuilders
.
boolQuery
().
mustNot
(
existsQuery
(
field
)),
isOr
);
}
}
else
{
if
(!
value
.
equals
(
"99"
))
{
DynamicQueryBuilder
dynamicQueryBuilder
=
new
DynamicQueryBuilder
();
dynamicQueryBuilder
.
or
(
QueryBuilders
.
boolQuery
().
mustNot
(
QueryBuilders
.
termQuery
(
field
,
value
)));
dynamicQueryBuilder
.
or
(
QueryBuilders
.
boolQuery
().
mustNot
(
existsQuery
(
field
)));
builder
.
add
(
dynamicQueryBuilder
.
build
(),
isOr
);
}
else
{
builder
.
add
(
QueryBuilders
.
boolQuery
().
must
(
existsQuery
(
field
)),
isOr
);
}
}
}
}
...
...
@@ -2741,6 +2817,34 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
return
permissionStatus
;
}
public
JSONArray
queryInspectionDate
()
{
//资质状态
JSONArray
permissionStatus
=
new
JSONArray
();
for
(
int
i
=
0
;
i
<
4
;
i
++)
{
JSONObject
object
=
new
JSONObject
();
if
(
0
==
i
)
{
object
.
put
(
"key"
,
normal
);
object
.
put
(
"value"
,
normal
);
object
.
put
(
"label"
,
inspectionStatusMap
.
get
(
normal
));
}
else
if
(
1
==
i
)
{
object
.
put
(
"key"
,
near
);
object
.
put
(
"value"
,
near
);
object
.
put
(
"label"
,
inspectionStatusMap
.
get
(
near
));
}
else
if
(
2
==
i
)
{
object
.
put
(
"key"
,
overdue
);
object
.
put
(
"value"
,
overdue
);
object
.
put
(
"label"
,
inspectionStatusMap
.
get
(
overdue
));
}
else
{
object
.
put
(
"key"
,
none
);
object
.
put
(
"value"
,
none
);
object
.
put
(
"label"
,
inspectionStatusMap
.
get
(
none
));
}
permissionStatus
.
add
(
object
);
}
return
permissionStatus
;
}
public
JSONArray
queryVehicleCylinder
()
{
//是否车用气瓶
JSONArray
vehicleCylinder
=
new
JSONArray
();
...
...
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