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
f2fde46a
Commit
f2fde46a
authored
Jul 17, 2025
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 更新单位类型判断逻辑并优化空列表检查
parent
5ed1a444
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
RefreshCmService.java
...s/boot/module/common/biz/refresh/cm/RefreshCmService.java
+12
-8
No files found.
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/refresh/cm/RefreshCmService.java
View file @
f2fde46a
...
@@ -23,10 +23,14 @@ public class RefreshCmService {
...
@@ -23,10 +23,14 @@ public class RefreshCmService {
if
(
oldUnitType
==
null
||
oldUnitType
.
isEmpty
())
{
if
(
oldUnitType
==
null
||
oldUnitType
.
isEmpty
())
{
return
oldUnitType
;
return
oldUnitType
;
}
}
// 如果单位类型中包含检验检测机构、检测单位、检验单位,且有资质信息,则更新单位类型
// 如果单位类型中包含检验检测机构、检测单位、检验单位,则需要更新单位类型
if
((
oldUnitType
.
contains
(
jyjcjg
)
||
oldUnitType
.
contains
(
jyjg
)
||
oldUnitType
.
contains
(
jcjg
))
&&
!
ListUtils
.
isEmpty
(
unitLicences
))
{
if
(
oldUnitType
.
contains
(
jyjcjg
)
||
oldUnitType
.
contains
(
jyjg
)
||
oldUnitType
.
contains
(
jcjg
))
{
long
jydwCount
=
unitLicences
.
stream
().
filter
(
e
->
jyjgCode
.
equals
(
e
.
getCertTypeCode
())
||
jyjg
.
equals
(
e
.
getCertType
())).
count
();
long
jydwCount
=
0L
;
long
jcdwCount
=
unitLicences
.
stream
().
filter
(
e
->
jcjgCode
.
equals
(
e
.
getCertTypeCode
())
||
jcjg
.
equals
(
e
.
getCertType
())).
count
();
long
jcdwCount
=
0L
;
if
(!
ListUtils
.
isEmpty
(
unitLicences
))
{
jydwCount
=
unitLicences
.
stream
().
filter
(
e
->
jyjgCode
.
equals
(
e
.
getCertTypeCode
())
||
jyjg
.
equals
(
e
.
getCertType
())).
count
();
jcdwCount
=
unitLicences
.
stream
().
filter
(
e
->
jcjgCode
.
equals
(
e
.
getCertTypeCode
())
||
jcjg
.
equals
(
e
.
getCertType
())).
count
();
}
// 如果资质中不包含检测机构但历史的单位类型中包含检验检测机构,将此单位类型修改为检测机构
// 如果资质中不包含检测机构但历史的单位类型中包含检验检测机构,将此单位类型修改为检测机构
if
(
jcdwCount
==
0
&&
oldUnitType
.
contains
(
jyjcjg
))
{
if
(
jcdwCount
==
0
&&
oldUnitType
.
contains
(
jyjcjg
))
{
jydwCount
+=
1
;
jydwCount
+=
1
;
...
@@ -53,15 +57,15 @@ public class RefreshCmService {
...
@@ -53,15 +57,15 @@ public class RefreshCmService {
}
}
public
static
LocalDate
getMinDateFromLicensesEp
(
List
<
EsBaseEnterpriseInfo
.
License
>
licenses
)
{
public
static
LocalDate
getMinDateFromLicensesEp
(
List
<
EsBaseEnterpriseInfo
.
License
>
licenses
)
{
if
(
licenses
==
null
||
licenses
.
isEmpty
())
{
if
(
licenses
==
null
||
licenses
.
isEmpty
())
{
return
null
;
return
null
;
}
}
return
licenses
.
stream
().
map
(
EsBaseEnterpriseInfo
.
License
::
getExpiryDate
).
filter
(
Objects:
:
nonNull
).
min
(
LocalDate:
:
compareTo
).
orElse
(
null
);
return
licenses
.
stream
().
map
(
EsBaseEnterpriseInfo
.
License
::
getExpiryDate
).
filter
(
Objects:
:
nonNull
).
min
(
LocalDate:
:
compareTo
).
orElse
(
null
);
}
}
public
static
LocalDate
getMinDateFromLicensesUser
(
List
<
EsUserInfo
.
License
>
licenses
)
{
public
static
LocalDate
getMinDateFromLicensesUser
(
List
<
EsUserInfo
.
License
>
licenses
)
{
if
(
licenses
==
null
||
licenses
.
isEmpty
())
{
if
(
licenses
==
null
||
licenses
.
isEmpty
())
{
return
null
;
return
null
;
}
}
return
licenses
.
stream
().
map
(
EsUserInfo
.
License
::
getExpiryDate
).
filter
(
Objects:
:
nonNull
).
min
(
LocalDate:
:
compareTo
).
orElse
(
null
);
return
licenses
.
stream
().
map
(
EsUserInfo
.
License
::
getExpiryDate
).
filter
(
Objects:
:
nonNull
).
min
(
LocalDate:
:
compareTo
).
orElse
(
null
);
}
}
...
...
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