Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
Z
zlmy-cloud
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
zlmy
zlmy-cloud
Commits
fbc69fec
Commit
fbc69fec
authored
Jul 18, 2025
by
Rensq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化租赁库同步
parent
486fb0d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
DepositoryManageBaseServiceImpl.java
...le/hire/service/impl/DepositoryManageBaseServiceImpl.java
+17
-6
No files found.
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/hire/service/impl/DepositoryManageBaseServiceImpl.java
View file @
fbc69fec
...
...
@@ -45,6 +45,7 @@ import org.apache.poi.ss.usermodel.Workbook;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.dao.DataIntegrityViolationException
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -357,12 +358,22 @@ public class DepositoryManageBaseServiceImpl extends ServiceImpl<DepositoryManag
sysOrg
.
setCounty
(
depositoryInfo
.
getDepositoryCountyName
());
sysOrg
.
setAddress
(
depositoryInfo
.
getDepositoryAddress
());
TSysOrg
byId
=
tHireOrgService
.
getById
(
vo
.
getId
());
if
(
byId
==
null
)
{
sysOrg
.
setCreateDate
(
new
Date
());
sysOrg
.
setUpdateDate
(
new
Date
());
tHireOrgService
.
save
(
sysOrg
);
}
else
{
//检查记录是否存在
TSysOrg
existing
=
tHireOrgService
.
getById
(
vo
.
getId
());
try
{
if
(
existing
==
null
)
{
// 新增逻辑
sysOrg
.
setCreateDate
(
new
Date
());
sysOrg
.
setUpdateDate
(
new
Date
());
tHireOrgService
.
save
(
sysOrg
);
}
else
{
// 更新逻辑
sysOrg
.
setUpdateDate
(
new
Date
());
tHireOrgService
.
updateById
(
sysOrg
);
}
}
catch
(
DataIntegrityViolationException
e
)
{
// 捕获主键冲突(可能在高并发时发生)
log
.
error
(
"主键冲突,自动转为更新模式: {}"
,
vo
.
getId
());
sysOrg
.
setUpdateDate
(
new
Date
());
tHireOrgService
.
updateById
(
sysOrg
);
}
...
...
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