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
2cd0df20
Commit
2cd0df20
authored
Aug 14, 2025
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug30410
parent
2396cca9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
24 deletions
+52
-24
ComprehensiveStatisticalAnalysisServiceImpl.java
...ice/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
+52
-24
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 @
2cd0df20
...
...
@@ -341,6 +341,13 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
filterParams
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
filter
.
get
(
"filterParams"
)));
// 组装人员过滤条件
this
.
getPersonBoolQueryBuilder
(
filterParams
,
boolMust
,
filterType
);
}
if
(
"custom"
.
equals
(
filterType
))
{
JSONArray
leftGroup
=
filterParams
.
getJSONArray
(
"group1"
);
JSONArray
rightGroup
=
filterParams
.
getJSONArray
(
"group2"
);
licensesStatusStr
=
getFilterPermitStatusOrLicensesStatus
(
leftGroup
,
rightGroup
,
StatisticalAnalysisEnum
.
person
.
getCode
());
}
else
{
// 资质判断
if
(
filterParams
.
containsKey
(
"expiryDate"
))
{
Object
permitStatus
=
filterParams
.
get
(
"expiryDate"
);
...
...
@@ -351,12 +358,9 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
}
}
}
if
(
"custom"
.
equals
(
filterType
))
{
JSONArray
leftGroup
=
filterParams
.
getJSONArray
(
"group1"
);
JSONArray
rightGroup
=
filterParams
.
getJSONArray
(
"group2"
);
licensesStatusStr
=
getFilterPermitStatusOrLicensesStatus
(
leftGroup
,
rightGroup
,
StatisticalAnalysisEnum
.
person
.
getCode
());
if
(
filterParams
.
containsKey
(
"certNo"
)
&&
filterParams
.
getJSONArray
(
"certNo"
).
size
()
==
1
&&
"0"
.
equals
(
filterParams
.
getJSONArray
(
"certNo"
).
get
(
0
).
toString
()))
{
licensesStatusStr
=
noLicenseReq
;
}
}
// 组装人员排序条件
this
.
getPersonBoolQuerySort
(
filter
,
builder
);
...
...
@@ -400,6 +404,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
String
nearStr
=
licensesStatusMap
.
get
(
near
);
String
normalStr
=
licensesStatusMap
.
get
(
normal
);
String
noneStr
=
licensesStatusMap
.
get
(
none
);
String
noLicenseStr
=
licensesStatusMap
.
get
(
noLicense
);
if
(!
ObjectUtils
.
isEmpty
(
licenses
))
{
if
(!
""
.
equals
(
licensesStatusStr
))
{
licensesStatus
=
licensesStatusMap
.
get
(
licensesStatusStr
);
...
...
@@ -407,6 +412,10 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
List
<
String
>
permissionStatusList
=
new
ArrayList
<>();
for
(
Object
object
:
licenses
)
{
JSONObject
json
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
object
));
if
(!
json
.
containsKey
(
"certNo"
)){
permissionStatusList
.
add
(
noLicenseStr
);
continue
;
}
if
(!
json
.
containsKey
(
"expiryDate"
))
{
permissionStatusList
.
add
(
noneStr
);
continue
;
...
...
@@ -423,23 +432,26 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
}
}
long
cq
=
permissionStatusList
.
stream
().
filter
(
e
->
e
.
equals
(
overdueStr
)).
count
();
long
lq
=
permissionStatusList
.
stream
().
filter
(
e
->
e
.
equals
(
nearStr
)).
count
();
long
no
=
permissionStatusList
.
stream
().
filter
(
e
->
e
.
equals
(
noneStr
)).
count
();
long
zc
=
permissionStatusList
.
stream
().
filter
(
e
->
e
.
equals
(
normalStr
)).
count
();
long
overdue
=
permissionStatusList
.
stream
().
filter
(
e
->
e
.
equals
(
overdueStr
)).
count
();
long
near
=
permissionStatusList
.
stream
().
filter
(
e
->
e
.
equals
(
nearStr
)).
count
();
long
no
=
permissionStatusList
.
stream
().
filter
(
e
->
e
.
equals
(
noLicenseStr
)).
count
();
long
none
=
permissionStatusList
.
stream
().
filter
(
e
->
e
.
equals
(
noneStr
)).
count
();
long
normal
=
permissionStatusList
.
stream
().
filter
(
e
->
e
.
equals
(
normalStr
)).
count
();
// 需按照资质严重顺序进行判断,先判断超期,再判断临期,再判断无有效期,最后判断正常
if
(
cq
>
0
)
{
if
(
overdue
>
0
)
{
licensesStatus
=
overdueStr
;
}
else
if
(
lq
>
0
)
{
}
else
if
(
near
>
0
)
{
licensesStatus
=
nearStr
;
}
else
if
(
no
>
0
)
{
licensesStatus
=
noLicenseStr
;
}
else
if
(
none
>
0
)
{
licensesStatus
=
noneStr
;
}
else
if
(
zc
>
0
)
{
}
else
if
(
normal
>
0
)
{
licensesStatus
=
normalStr
;
}
}
}
else
{
licensesStatus
=
licensesStatusMap
.
get
(
noLicense
)
;
licensesStatus
=
noLicenseStr
;
}
}
else
{
licensesStatus
=
!
""
.
equals
(
licensesStatusStr
)
?
licensesStatusMap
.
get
(
licensesStatusStr
)
:
licensesStatusMap
.
get
(
noLicenseReq
);
...
...
@@ -529,40 +541,46 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
licencesQueryBuilder
.
add
(
this
.
getNotNeedLicencesBuilderWithPerson
(),
or
);
}
}
else
if
(
k
.
equals
(
"expiryDate"
))
{
NestedQueryBuilder
nestedQuery
=
QueryBuilders
.
nestedQuery
(
path
,
existsQuery
(
path
+
"."
+
"certNo"
),
ScoreMode
.
None
);
boolMust
.
must
(
nestedQuery
);
// 不需要资质的人员查询构造条件
BoolQueryBuilder
notNeedLicensesQueryBuilder
=
this
.
getNotLicencesBuilderWithPerson
();
boolMust
.
must
(
notNeedLicensesQueryBuilder
);
if
(
item
.
equals
(
overdue
))
{
// 超期:小于当前日期
NestedQueryBuilder
nested
Query
=
QueryBuilders
.
nestedQuery
(
NestedQueryBuilder
overdue
Query
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
rangeQuery
(
nestedField
).
lt
(
LocalDate
.
now
().
format
(
formatter
)),
ScoreMode
.
None
);
boolMust
.
must
(
nested
Query
);
boolMust
.
must
(
overdue
Query
);
}
else
if
(
item
.
equals
(
near
))
{
// 临期:小于等于当前日期加上30天
NestedQueryBuilder
ne
sted
Query
=
QueryBuilders
.
nestedQuery
(
NestedQueryBuilder
ne
ar
Query
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
rangeQuery
(
nestedField
).
lte
(
LocalDate
.
now
().
plusDays
(
30
).
format
(
formatter
)).
gte
(
LocalDate
.
now
().
format
(
formatter
)),
ScoreMode
.
None
);
boolMust
.
must
(
ne
sted
Query
);
boolMust
.
must
(
ne
ar
Query
);
}
else
if
(
item
.
equals
(
normal
))
{
// 正常:大于当前日期加上30天
NestedQueryBuilder
n
ested
Query
=
QueryBuilders
.
nestedQuery
(
NestedQueryBuilder
n
ormal
Query
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
rangeQuery
(
nestedField
).
gt
(
LocalDate
.
now
().
plusDays
(
30
).
format
(
formatter
)),
ScoreMode
.
None
);
boolMust
.
must
(
n
ested
Query
);
boolMust
.
must
(
n
ormal
Query
);
}
else
if
(
item
.
equals
(
none
))
{
NestedQueryBuilder
n
ested
Query
=
QueryBuilders
.
nestedQuery
(
NestedQueryBuilder
n
one
Query
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
boolQuery
().
mustNot
(
existsQuery
(
nestedField
)),
ScoreMode
.
None
);
boolMust
.
must
(
n
ested
Query
);
boolMust
.
must
(
n
one
Query
);
}
}
else
if
(
k
.
equals
(
"certType"
)
||
k
.
equals
(
"permissionLevel"
))
{
NestedQueryBuilder
nestedQuery
=
QueryBuilders
.
nestedQuery
(
...
...
@@ -925,6 +943,12 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
private
String
getFilterPermitStatusOrLicensesStatus
(
JSONArray
leftGroup
,
JSONArray
rightGroup
,
String
code
)
{
String
filed
=
code
.
equals
(
StatisticalAnalysisEnum
.
company
.
getCode
())
?
"permitStatus"
:
"expiryDate"
;
List
<
Object
>
LeftNoLicenseList
=
leftGroup
.
stream
().
filter
(
e
->
"certNo"
.
equals
(((
JSONObject
)
e
).
getString
(
"field"
))
&&
((
JSONObject
)
e
).
containsKey
(
"value"
)
&&
((
JSONObject
)
e
).
getString
(
"value"
).
equals
(
"0"
)
&&
((
JSONObject
)
e
).
containsKey
(
"itemCondition"
)
&&
!((
JSONObject
)
e
).
getString
(
"itemCondition"
).
equals
(
"notIn"
)
).
collect
(
Collectors
.
toList
());
List
<
Object
>
rightNoLicenseList
=
rightGroup
.
stream
().
filter
(
e
->
"certNo"
.
equals
(((
JSONObject
)
e
).
getString
(
"field"
))
&&
((
JSONObject
)
e
).
containsKey
(
"value"
)
&&
((
JSONObject
)
e
).
getString
(
"value"
).
equals
(
"0"
)
&&
((
JSONObject
)
e
).
containsKey
(
"itemCondition"
)
&&
!((
JSONObject
)
e
).
getString
(
"itemCondition"
).
equals
(
"notIn"
)
).
collect
(
Collectors
.
toList
());
Boolean
noLicense
=
false
;
if
(
LeftNoLicenseList
.
size
()
>
0
||
rightNoLicenseList
.
size
()
>
0
)
{
noLicense
=
true
;
}
List
<
Object
>
leftPermitList
=
leftGroup
.
stream
().
filter
(
e
->
filed
.
equals
(((
JSONObject
)
e
).
getString
(
"field"
))
&&
((
JSONObject
)
e
).
containsKey
(
"value"
)
&&
((
JSONObject
)
e
).
containsKey
(
"itemCondition"
)
&&
!((
JSONObject
)
e
).
getString
(
"itemCondition"
).
equals
(
"notIn"
)).
collect
(
Collectors
.
toList
());
List
<
Object
>
rightPermitList
=
rightGroup
.
stream
().
filter
(
e
->
filed
.
equals
(((
JSONObject
)
e
).
getString
(
"field"
))
&&
((
JSONObject
)
e
).
containsKey
(
"value"
)
&&
((
JSONObject
)
e
).
containsKey
(
"itemCondition"
)
&&
!((
JSONObject
)
e
).
getString
(
"itemCondition"
).
equals
(
"notIn"
)).
collect
(
Collectors
.
toList
());
int
count
=
0
;
...
...
@@ -939,9 +963,9 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
isRight
=
true
;
}
String
statusStr
=
""
;
if
(
count
==
1
&&
isLeft
)
{
if
(
count
==
1
&&
isLeft
&&
!
noLicense
)
{
statusStr
=
((
JSONObject
)
leftPermitList
.
get
(
0
)).
getString
(
"value"
);
}
else
if
(
count
==
1
&&
isRight
)
{
}
else
if
(
count
==
1
&&
isRight
&&
!
noLicense
)
{
statusStr
=
((
JSONObject
)
rightPermitList
.
get
(
0
)).
getString
(
"value"
);
}
return
statusStr
;
...
...
@@ -1694,6 +1718,10 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
for
(
int
i
=
0
;
i
<
group
.
size
();
i
++)
{
JSONObject
itemObj
=
group
.
getJSONObject
(
i
);
String
andOr
=
i
==
0
?
null
:
itemObj
.
getString
(
"andOr"
);
if
(
group
.
size
()
>
1
&&
i
==
0
)
{
JSONObject
nextItemObj
=
group
.
getJSONObject
(
i
+
1
);
andOr
=
nextItemObj
.
getString
(
"andOr"
).
equals
(
or
)
?
or
:
and
;
}
String
field
=
itemObj
.
getString
(
"field"
);
String
itemCondition
=
itemObj
.
getString
(
"itemCondition"
);
Object
value
=
itemObj
.
get
(
"value"
);
...
...
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