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
87e4155e
Commit
87e4155e
authored
Oct 13, 2025
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 提取人员过滤条件构建逻辑到新方法
parent
f7b6a819
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
26 deletions
+23
-26
ComprehensiveStatisticalAnalysisServiceImpl.java
...ice/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
+23
-26
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 @
87e4155e
...
@@ -320,7 +320,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -320,7 +320,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
}
// 组装人员过滤条件
// 组装人员过滤条件
String
orgCode
=
filter
.
getString
(
"orgCode"
);
String
orgCode
=
filter
.
getString
(
"orgCode"
);
this
.
getPersonBoolQueryBuilder
(
filterParams
,
boolMust
,
filterType
,
orgCode
);
personOrgCodeBoolMust
(
orgCode
,
boolMust
);
this
.
getPersonBoolQueryBuilder
(
filterParams
,
boolMust
,
filterType
);
if
(
"custom"
.
equals
(
filterType
))
{
if
(
"custom"
.
equals
(
filterType
))
{
JSONArray
leftGroup
=
filterParams
.
getJSONArray
(
"group1"
);
JSONArray
leftGroup
=
filterParams
.
getJSONArray
(
"group1"
);
JSONArray
rightGroup
=
filterParams
.
getJSONArray
(
"group2"
);
JSONArray
rightGroup
=
filterParams
.
getJSONArray
(
"group2"
);
...
@@ -400,31 +401,27 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -400,31 +401,27 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
return
result
;
return
result
;
}
}
private
void
personOrgCodeBoolMust
(
String
orgCode
,
BoolQueryBuilder
boolMust
)
{
String
officeRegion
=
commonMapper
.
getCompanyCodeByOrgCode
(
orgCode
);
BoolQueryBuilder
queryBuilder1
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
queryBuilder2
=
QueryBuilders
.
boolQuery
();
EnhancedDynamicQueryBuilder
enhancedDynamicQueryBuilder
=
new
EnhancedDynamicQueryBuilder
();
queryBuilder1
.
must
(
QueryBuilders
.
termQuery
(
"superviseOrgCode"
,
"50"
))
.
must
(
QueryBuilders
.
wildcardQuery
(
"officeRegion"
,
"*"
+
officeRegion
+
"*"
));
queryBuilder2
.
mustNot
(
QueryBuilders
.
termQuery
(
"superviseOrgCode"
,
"50"
))
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode"
,
orgCode
));
enhancedDynamicQueryBuilder
.
add
(
queryBuilder1
,
or
);
enhancedDynamicQueryBuilder
.
add
(
queryBuilder2
,
or
);
boolMust
.
must
(
enhancedDynamicQueryBuilder
.
build
());
}
/**
/**
* 组装人员过滤条件
* 组装人员过滤条件
*/
*/
private
void
getPersonBoolQueryBuilder
(
JSONObject
filterParams
,
BoolQueryBuilder
boolMust
,
String
filterType
,
String
orgCode
)
{
private
void
getPersonBoolQueryBuilder
(
JSONObject
filterParams
,
BoolQueryBuilder
boolMust
,
String
filterType
)
{
deleteUnitCategory
(
filterParams
);
deleteUnitCategory
(
filterParams
);
// 快捷筛选和自定义筛选解析筛选规则不一致
// 快捷筛选和自定义筛选解析筛选规则不一致
if
(
filterType
.
equals
(
"advanced"
))
{
if
(
filterType
.
equals
(
"advanced"
))
{
JSONArray
unitType
=
filterParams
.
getJSONArray
(
"unitType"
);
if
(!
ObjectUtils
.
isEmpty
(
unitType
))
{
if
(
unitType
.
contains
(
"检验机构"
)
||
unitType
.
contains
(
"检测机构"
))
{
String
officeRegion
=
commonMapper
.
getCompanyCodeByOrgCode
(
orgCode
);
BoolQueryBuilder
queryBuilder1
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
queryBuilder2
=
QueryBuilders
.
boolQuery
();
EnhancedDynamicQueryBuilder
enhancedDynamicQueryBuilder
=
new
EnhancedDynamicQueryBuilder
();
queryBuilder1
.
must
(
QueryBuilders
.
termQuery
(
"superviseOrgCode"
,
"50"
))
.
must
(
QueryBuilders
.
wildcardQuery
(
"officeRegion"
,
"*"
+
officeRegion
+
"*"
));
queryBuilder2
.
mustNot
(
QueryBuilders
.
termQuery
(
"superviseOrgCode"
,
"50"
))
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode"
,
orgCode
));
enhancedDynamicQueryBuilder
.
add
(
queryBuilder1
,
or
);
enhancedDynamicQueryBuilder
.
add
(
queryBuilder2
,
or
);
boolMust
.
must
(
enhancedDynamicQueryBuilder
.
build
());
}
else
{
boolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode"
,
orgCode
));
}
}
filterParams
.
forEach
((
k
,
v
)
->
{
filterParams
.
forEach
((
k
,
v
)
->
{
if
(
v
instanceof
JSONArray
)
{
if
(
v
instanceof
JSONArray
)
{
if
(!((
JSONArray
)
v
).
contains
(
"all"
)
&&
((
JSONArray
)
v
).
size
()
>
0
)
{
if
(!((
JSONArray
)
v
).
contains
(
"all"
)
&&
((
JSONArray
)
v
).
size
()
>
0
)
{
...
@@ -3084,13 +3081,13 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3084,13 +3081,13 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
boolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode.keyword"
,
orgCode
));
boolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode.keyword"
,
orgCode
));
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
))
{
// boolMust.must(QueryBuilders.prefixQuery("superviseOrgCode", orgCode)
);
personOrgCodeBoolMust
(
orgCode
,
boolMust
);
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
));
boolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode.keyword"
,
orgCode
));
data
=
queryDpInspectionCompanyStatistics
(
filter
,
request
,
builder
,
boolMust
,
tabTotalMap
);
data
=
queryDpInspectionCompanyStatistics
(
filter
,
request
,
builder
,
boolMust
,
tabTotalMap
);
}
else
{
}
else
{
// boolMust.must(QueryBuilders.prefixQuery("superviseOrgCode", orgCode)
);
personOrgCodeBoolMust
(
orgCode
,
boolMust
);
data
=
queryDpInspectionPersonStatistics
(
filter
,
request
,
builder
,
boolMust
,
tabTotalMap
);
data
=
queryDpInspectionPersonStatistics
(
filter
,
request
,
builder
,
boolMust
,
tabTotalMap
);
}
}
...
@@ -3107,7 +3104,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3107,7 +3104,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"
;
// 组装人员过滤条件
// 组装人员过滤条件
this
.
getPersonBoolQueryBuilder
(
filterParams
,
boolMust
,
filterType
,
filter
.
getString
(
"orgCode"
)
);
this
.
getPersonBoolQueryBuilder
(
filterParams
,
boolMust
,
filterType
);
// 通过是否传参 unitType 单位类型 区分一二级查询
// 通过是否传参 unitType 单位类型 区分一二级查询
boolean
is2LeveFlag
=
Optional
.
of
(
filter
)
boolean
is2LeveFlag
=
Optional
.
of
(
filter
)
.
map
(
obj
->
obj
.
getJSONObject
(
"filterParams"
))
.
map
(
obj
->
obj
.
getJSONObject
(
"filterParams"
))
...
@@ -3291,7 +3288,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3291,7 +3288,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
String
filterType
=
"advanced"
;
String
filterType
=
"advanced"
;
String
unitCategory
=
filterParams
.
getString
(
"unitCategory"
);
String
unitCategory
=
filterParams
.
getString
(
"unitCategory"
);
// 组装人员过滤条件
// 组装人员过滤条件
this
.
getPersonBoolQueryBuilder
(
filterParams
,
boolMust
,
filterType
,
filter
.
getString
(
"orgCode"
)
);
this
.
getPersonBoolQueryBuilder
(
filterParams
,
boolMust
,
filterType
);
// 通过是否传参 unitType 单位类型 区分一二级查询
// 通过是否传参 unitType 单位类型 区分一二级查询
boolean
is2LeveFlag
=
Optional
.
of
(
filter
)
boolean
is2LeveFlag
=
Optional
.
of
(
filter
)
...
@@ -3973,8 +3970,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3973,8 +3970,8 @@ 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"
;
// 组装人员过滤条件
// 组装人员过滤条件
this
.
getPersonBoolQueryBuilder
(
filterParams
,
boolQuery
,
filterType
,
orgCode
);
personOrgCodeBoolMust
(
orgCode
,
boolQuery
);
this
.
getPersonBoolQueryBuilder
(
filterParams
,
boolQuery
,
filterType
);
// 查询
// 查询
JSONObject
expiryDateStatus
=
this
.
getExpiryDateStatusGroupStatistics
(
boolQuery
);
JSONObject
expiryDateStatus
=
this
.
getExpiryDateStatusGroupStatistics
(
boolQuery
);
JSONObject
personType
=
this
.
getPersonTypeGroupStatistics
(
boolQuery
);
JSONObject
personType
=
this
.
getPersonTypeGroupStatistics
(
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