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
8300c84a
Commit
8300c84a
authored
Jul 10, 2025
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 简化单位类型更新逻辑
parent
64d86fd7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
10 deletions
+9
-10
BaseEnterpriseUpdate.java
...common/biz/refresh/commonUpdate/BaseEnterpriseUpdate.java
+7
-0
DataHandlerServiceImpl.java
...ot/module/jg/biz/service/impl/DataHandlerServiceImpl.java
+1
-5
EnterpriseRefreshHandler.java
...ule/tcm/biz/refresh/handler/EnterpriseRefreshHandler.java
+1
-5
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/commonUpdate/BaseEnterpriseUpdate.java
View file @
8300c84a
...
...
@@ -4,6 +4,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.EsBaseEnterpriseInfo;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
org.thymeleaf.util.ListUtils
;
import
java.util.List
;
...
...
@@ -19,6 +20,9 @@ public class BaseEnterpriseUpdate {
public
final
String
jcjgCode
=
"1233-2"
;
public
String
updateJyjcUnitType
(
String
oldUnitType
,
List
<
EsBaseEnterpriseInfo
.
License
>
unitLicences
)
{
// 如果单位类型中包含检验检测机构、检测单位、检验单位,且有资质信息,则更新单位类型
if
((
oldUnitType
.
contains
(
jyjcjg
)
||
oldUnitType
.
contains
(
jydw
)
||
oldUnitType
.
contains
(
jcdw
))
&&
!
ListUtils
.
isEmpty
(
unitLicences
))
{
long
jyjgCount
=
unitLicences
.
stream
().
filter
(
e
->
e
.
getCertTypeCode
().
equals
(
jyjgCode
)).
count
();
long
jcjgCount
=
unitLicences
.
stream
().
filter
(
e
->
e
.
getCertTypeCode
().
equals
(
jcjgCode
)).
count
();
StringBuilder
afterType
=
new
StringBuilder
();
...
...
@@ -38,5 +42,8 @@ public class BaseEnterpriseUpdate {
afterType
.
append
(
"#"
).
append
(
jydw
);
}
return
oldUnitType
+
afterType
;
}
else
{
return
oldUnitType
;
}
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/DataHandlerServiceImpl.java
View file @
8300c84a
...
...
@@ -57,7 +57,6 @@ import org.springframework.transaction.annotation.Transactional;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StopWatch
;
import
org.thymeleaf.util.ListUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
...
...
@@ -1441,10 +1440,7 @@ public class DataHandlerServiceImpl {
return
esLicense
;
}).
collect
(
Collectors
.
toList
());
esBaseEnterpriseInfo
.
setLicenses
(
licenses
);
if
((
enterpriseInfo
.
getUnitType
().
contains
(
baseEnterpriseUpdate
.
jyjcjg
)
||
enterpriseInfo
.
getUnitType
().
contains
(
baseEnterpriseUpdate
.
jydw
)
||
enterpriseInfo
.
getUnitType
().
contains
(
baseEnterpriseUpdate
.
jcdw
))
&&
!
ListUtils
.
isEmpty
(
licenses
))
{
String
newUnitType
=
baseEnterpriseUpdate
.
updateJyjcUnitType
(
enterpriseInfo
.
getUnitType
(),
licenses
);
esBaseEnterpriseInfo
.
setUnitType
(
newUnitType
);
}
esBaseEnterpriseInfo
.
setUnitType
(
baseEnterpriseUpdate
.
updateJyjcUnitType
(
enterpriseInfo
.
getUnitType
(),
licenses
));
return
esBaseEnterpriseInfo
;
}).
collect
(
Collectors
.
toList
());
enterpriseInfoDao
.
saveAll
(
esBaseEnterpriseInfos
);
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/refresh/handler/EnterpriseRefreshHandler.java
View file @
8300c84a
...
...
@@ -21,7 +21,6 @@ import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsUserInfoMapper;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
org.thymeleaf.util.ListUtils
;
import
java.util.List
;
import
java.util.Optional
;
...
...
@@ -78,10 +77,7 @@ public class EnterpriseRefreshHandler implements IDataRefreshHandler {
return
esLicense
;
}).
collect
(
Collectors
.
toList
());
esBaseEnterpriseInfo
.
setLicenses
(
licenses
);
if
((
enterpriseInfo
.
getUnitType
().
contains
(
baseEnterpriseUpdate
.
jyjcjg
)
||
enterpriseInfo
.
getUnitType
().
contains
(
baseEnterpriseUpdate
.
jydw
)
||
enterpriseInfo
.
getUnitType
().
contains
(
baseEnterpriseUpdate
.
jcdw
))
&&
!
ListUtils
.
isEmpty
(
licenses
))
{
String
newUnitType
=
baseEnterpriseUpdate
.
updateJyjcUnitType
(
enterpriseInfo
.
getUnitType
(),
licenses
);
esBaseEnterpriseInfo
.
setUnitType
(
newUnitType
);
}
esBaseEnterpriseInfo
.
setUnitType
(
baseEnterpriseUpdate
.
updateJyjcUnitType
(
enterpriseInfo
.
getUnitType
(),
licenses
));
enterpriseInfoDao
.
save
(
esBaseEnterpriseInfo
);
// 人员更新冗余的单位信息
List
<
TzsUserInfo
>
userOfOneUnit
=
userInfoMapper
.
selectList
(
new
LambdaQueryWrapper
<
TzsUserInfo
>().
eq
(
TzsUserInfo:
:
getUnitCode
,
enterpriseInfo
.
getUseUnitCode
()).
eq
(
BaseEntity:
:
getIsDelete
,
false
).
select
(
BaseEntity:
:
getSequenceNbr
));
...
...
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