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
146ad182
Commit
146ad182
authored
Nov 04, 2025
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(Statistics): 修改bug
parent
f87a83b3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
17 deletions
+22
-17
ComprehensiveStatisticalAnalysisServiceImpl.java
...ice/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
+22
-17
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 @
146ad182
...
@@ -322,7 +322,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -322,7 +322,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
}
// 组装人员过滤条件
// 组装人员过滤条件
String
orgCode
=
filter
.
getString
(
"orgCode"
);
String
orgCode
=
filter
.
getString
(
"orgCode"
);
personOrgCodeBoolMust
(
orgCode
,
boolMust
);
personOrgCodeBoolMust
(
orgCode
,
boolMust
,
StatisticalAnalysisEnum
.
person
.
getCode
()
);
this
.
getPersonBoolQueryBuilder
(
filterParams
,
boolMust
,
filterType
);
this
.
getPersonBoolQueryBuilder
(
filterParams
,
boolMust
,
filterType
);
if
(
"custom"
.
equals
(
filterType
))
{
if
(
"custom"
.
equals
(
filterType
))
{
JSONArray
leftGroup
=
filterParams
.
getJSONArray
(
"group1"
);
JSONArray
leftGroup
=
filterParams
.
getJSONArray
(
"group1"
);
...
@@ -403,15 +403,16 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -403,15 +403,16 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
return
result
;
return
result
;
}
}
private
void
personOrgCodeBoolMust
(
String
orgCode
,
BoolQueryBuilder
boolMust
)
{
private
void
personOrgCodeBoolMust
(
String
orgCode
,
BoolQueryBuilder
boolMust
,
String
type
)
{
String
superviseOrgCodeKey
=
type
.
equals
(
StatisticalAnalysisEnum
.
person
.
getCode
())
?
"superviseOrgCode"
:
"superviseOrgCode.keyword"
;
String
officeRegion
=
commonMapper
.
getCompanyCodeByOrgCode
(
orgCode
);
String
officeRegion
=
commonMapper
.
getCompanyCodeByOrgCode
(
orgCode
);
BoolQueryBuilder
queryBuilder1
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
queryBuilder1
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
queryBuilder2
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
queryBuilder2
=
QueryBuilders
.
boolQuery
();
EnhancedDynamicQueryBuilder
enhancedDynamicQueryBuilder
=
new
EnhancedDynamicQueryBuilder
();
EnhancedDynamicQueryBuilder
enhancedDynamicQueryBuilder
=
new
EnhancedDynamicQueryBuilder
();
queryBuilder1
.
must
(
QueryBuilders
.
termQuery
(
"superviseOrgCode"
,
"50"
))
queryBuilder1
.
must
(
QueryBuilders
.
termQuery
(
superviseOrgCodeKey
,
"50"
))
.
must
(
QueryBuilders
.
wildcardQuery
(
"officeRegion"
,
"*"
+
officeRegion
+
"*"
));
.
must
(
QueryBuilders
.
wildcardQuery
(
"officeRegion"
,
"*"
+
officeRegion
+
"*"
));
queryBuilder2
.
mustNot
(
QueryBuilders
.
termQuery
(
"superviseOrgCode"
,
"50"
))
queryBuilder2
.
mustNot
(
QueryBuilders
.
termQuery
(
superviseOrgCodeKey
,
"50"
))
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode"
,
orgCode
));
.
must
(
QueryBuilders
.
prefixQuery
(
superviseOrgCodeKey
,
orgCode
));
enhancedDynamicQueryBuilder
.
add
(
queryBuilder1
,
or
);
enhancedDynamicQueryBuilder
.
add
(
queryBuilder1
,
or
);
enhancedDynamicQueryBuilder
.
add
(
queryBuilder2
,
or
);
enhancedDynamicQueryBuilder
.
add
(
queryBuilder2
,
or
);
boolMust
.
must
(
enhancedDynamicQueryBuilder
.
build
());
boolMust
.
must
(
enhancedDynamicQueryBuilder
.
build
());
...
@@ -497,16 +498,20 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -497,16 +498,20 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
boolMust
.
must
(
licencesQueryBuilder
.
build
());
boolMust
.
must
(
licencesQueryBuilder
.
build
());
}
else
if
(
k
.
equals
(
"issueDate"
))
{
}
else
if
(
k
.
equals
(
"issueDate"
))
{
JSONArray
issueDates
=
(
JSONArray
)
v
;
JSONArray
issueDates
=
(
JSONArray
)
v
;
String
startDate
=
DateUtils
.
convertDateToString
(
issueDates
.
getDate
(
0
),
DateUtils
.
DATE_PATTERN
);
Date
startDate
=
issueDates
.
getDate
(
0
);
String
endDate
=
DateUtils
.
convertDateToString
(
issueDates
.
getDate
(
1
),
DateUtils
.
DATE_PATTERN
);
Date
endDate
=
issueDates
.
getDate
(
1
);
if
(!
""
.
equals
(
startDate
)
&&
!
""
.
equals
(
endDate
)
&&
!
ObjectUtils
.
isEmpty
(
startDate
)
&&
!
ObjectUtils
.
isEmpty
(
endDate
))
{
String
startDateString
=
DateUtils
.
convertDateToString
(
startDate
,
DateUtils
.
DATE_PATTERN
);
String
endDateString
=
DateUtils
.
convertDateToString
(
endDate
,
DateUtils
.
DATE_PATTERN
);
NestedQueryBuilder
nestedQuery
=
QueryBuilders
.
nestedQuery
(
NestedQueryBuilder
nestedQuery
=
QueryBuilders
.
nestedQuery
(
"licenses"
,
"licenses"
,
QueryBuilders
.
rangeQuery
(
"licenses."
+
k
).
gte
(
startDate
).
lte
(
endDate
),
QueryBuilders
.
rangeQuery
(
"licenses."
+
k
).
gte
(
startDateString
).
lte
(
endDateString
),
ScoreMode
.
None
ScoreMode
.
None
);
);
boolMust
.
filter
(
nestedQuery
);
boolMust
.
filter
(
nestedQuery
);
}
}
}
}
}
}
else
if
(
v
instanceof
String
)
{
}
else
if
(
v
instanceof
String
)
{
if
(
k
.
equals
(
"fuzzyInput"
))
{
if
(
k
.
equals
(
"fuzzyInput"
))
{
String
fuzzyValue
=
String
.
valueOf
(
v
);
String
fuzzyValue
=
String
.
valueOf
(
v
);
...
@@ -570,7 +575,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -570,7 +575,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
String
orgCode
=
filter
.
getString
(
"orgCode"
);
String
orgCode
=
filter
.
getString
(
"orgCode"
);
boolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode.keyword"
,
orgCode
));
personOrgCodeBoolMust
(
orgCode
,
boolMust
,
StatisticalAnalysisEnum
.
company
.
getCode
(
));
JSONObject
filterParams
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
filter
.
get
(
"filterParams"
)));
JSONObject
filterParams
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
filter
.
get
(
"filterParams"
)));
String
filterType
=
filter
.
getString
(
"filterType"
);
String
filterType
=
filter
.
getString
(
"filterType"
);
...
@@ -1152,7 +1157,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -1152,7 +1157,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
JSONArray
dates
=
(
JSONArray
)
v
;
JSONArray
dates
=
(
JSONArray
)
v
;
String
startDate
=
dates
.
getString
(
0
);
String
startDate
=
dates
.
getString
(
0
);
String
endDate
=
dates
.
getString
(
1
);
String
endDate
=
dates
.
getString
(
1
);
if
(!
""
.
equals
(
startDate
)
&&
!
""
.
equals
(
endDate
))
{
if
(!
""
.
equals
(
startDate
)
&&
!
""
.
equals
(
endDate
)
&&
!
ObjectUtils
.
isEmpty
(
startDate
)
&&
!
ObjectUtils
.
isEmpty
(
endDate
)
)
{
boolMust
.
filter
(
QueryBuilders
.
rangeQuery
(
field
).
gte
(
startDate
).
lte
(
endDate
));
boolMust
.
filter
(
QueryBuilders
.
rangeQuery
(
field
).
gte
(
startDate
).
lte
(
endDate
));
}
}
}
else
if
(
k
.
equals
(
"EQU_LIST"
)
||
k
.
equals
(
"EQU_CATEGORY"
)
||
k
.
equals
(
"EQU_DEFINE"
)
||
k
.
equals
(
"DATA_QUALITY_SCORE"
))
{
}
else
if
(
k
.
equals
(
"EQU_LIST"
)
||
k
.
equals
(
"EQU_CATEGORY"
)
||
k
.
equals
(
"EQU_DEFINE"
)
||
k
.
equals
(
"DATA_QUALITY_SCORE"
))
{
...
@@ -3142,16 +3147,16 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3142,16 +3147,16 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
boolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"ORG_BRANCH_CODE"
,
orgCode
));
boolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"ORG_BRANCH_CODE"
,
orgCode
));
data
=
queryDpEquipStatistics
(
filter
,
request
,
builder
,
boolMust
,
tabTotalMap
);
data
=
queryDpEquipStatistics
(
filter
,
request
,
builder
,
boolMust
,
tabTotalMap
);
}
else
if
(
StatisticalAnalysisEnum
.
company
.
getCode
().
equals
(
businessType
))
{
}
else
if
(
StatisticalAnalysisEnum
.
company
.
getCode
().
equals
(
businessType
))
{
boolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode.keyword"
,
orgCode
));
personOrgCodeBoolMust
(
orgCode
,
boolMust
,
StatisticalAnalysisEnum
.
company
.
getCode
(
));
data
=
queryDpCompanyStatistics
(
filter
,
request
,
builder
,
boolMust
,
tabTotalMap
);
data
=
queryDpCompanyStatistics
(
filter
,
request
,
builder
,
boolMust
,
tabTotalMap
);
}
else
if
(
StatisticalAnalysisEnum
.
person
.
getCode
().
equals
(
businessType
))
{
}
else
if
(
StatisticalAnalysisEnum
.
person
.
getCode
().
equals
(
businessType
))
{
personOrgCodeBoolMust
(
orgCode
,
boolMust
);
personOrgCodeBoolMust
(
orgCode
,
boolMust
,
StatisticalAnalysisEnum
.
person
.
getCode
()
);
data
=
queryDpPersonStatistics
(
filter
,
request
,
builder
,
boolMust
,
tabTotalMap
);
data
=
queryDpPersonStatistics
(
filter
,
request
,
builder
,
boolMust
,
tabTotalMap
);
}
else
if
(
StatisticalAnalysisEnum
.
inspectionCompany
.
getCode
().
equals
(
businessType
))
{
}
else
if
(
StatisticalAnalysisEnum
.
inspectionCompany
.
getCode
().
equals
(
businessType
))
{
boolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode.keyword"
,
orgCode
));
personOrgCodeBoolMust
(
orgCode
,
boolMust
,
StatisticalAnalysisEnum
.
company
.
getCode
(
));
data
=
queryDpInspectionCompanyStatistics
(
filter
,
request
,
builder
,
boolMust
,
tabTotalMap
);
data
=
queryDpInspectionCompanyStatistics
(
filter
,
request
,
builder
,
boolMust
,
tabTotalMap
);
}
else
{
}
else
{
personOrgCodeBoolMust
(
orgCode
,
boolMust
);
personOrgCodeBoolMust
(
orgCode
,
boolMust
,
StatisticalAnalysisEnum
.
person
.
getCode
()
);
data
=
queryDpInspectionPersonStatistics
(
filter
,
request
,
builder
,
boolMust
,
tabTotalMap
);
data
=
queryDpInspectionPersonStatistics
(
filter
,
request
,
builder
,
boolMust
,
tabTotalMap
);
}
}
...
@@ -3256,7 +3261,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3256,7 +3261,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
companyBoolMust
.
must
(
companyUnitTypeBoolMust
);
companyBoolMust
.
must
(
companyUnitTypeBoolMust
);
BoolQueryBuilder
personBoolMust
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
personBoolMust
=
QueryBuilders
.
boolQuery
();
personOrgCodeBoolMust
(
orgCode
,
personBoolMust
);
personOrgCodeBoolMust
(
orgCode
,
personBoolMust
,
StatisticalAnalysisEnum
.
person
.
getCode
()
);
personBoolMust
.
must
(
companyUnitTypeBoolMust
);
personBoolMust
.
must
(
companyUnitTypeBoolMust
);
BoolQueryBuilder
inspectionCompanyBoolMust
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
inspectionCompanyBoolMust
=
QueryBuilders
.
boolQuery
();
...
@@ -3266,7 +3271,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3266,7 +3271,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
BoolQueryBuilder
inspectionPersonBoolMust
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
inspectionPersonBoolMust
=
QueryBuilders
.
boolQuery
();
personOrgCodeBoolMust
(
orgCode
,
inspectionPersonBoolMust
);
personOrgCodeBoolMust
(
orgCode
,
personBoolMust
,
StatisticalAnalysisEnum
.
person
.
getCode
()
);
inspectionPersonBoolMust
.
must
(
inspectionUnitTypeBoolMust
);
inspectionPersonBoolMust
.
must
(
inspectionUnitTypeBoolMust
);
inspectionPersonBoolMust
.
mustNot
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*检验检测机构*"
));
inspectionPersonBoolMust
.
mustNot
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*检验检测机构*"
));
...
@@ -4034,7 +4039,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -4034,7 +4039,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
JSONObject
filterParams
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
filter
.
get
(
"filterParams"
)));
JSONObject
filterParams
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
filter
.
get
(
"filterParams"
)));
String
filterType
=
"advanced"
;
String
filterType
=
"advanced"
;
// 组装人员过滤条件
// 组装人员过滤条件
personOrgCodeBoolMust
(
orgCode
,
boolQuery
);
personOrgCodeBoolMust
(
orgCode
,
boolQuery
,
StatisticalAnalysisEnum
.
person
.
getCode
()
);
this
.
getPersonBoolQueryBuilder
(
filterParams
,
boolQuery
,
filterType
);
this
.
getPersonBoolQueryBuilder
(
filterParams
,
boolQuery
,
filterType
);
// 查询
// 查询
JSONObject
expiryDateStatus
=
this
.
getExpiryDateStatusGroupStatistics
(
boolQuery
);
JSONObject
expiryDateStatus
=
this
.
getExpiryDateStatusGroupStatistics
(
boolQuery
);
...
...
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