记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
52b2aab8
Commit
52b2aab8
authored
May 11, 2026
by
姜秀龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sqb 删除商品处理关联关系
parent
ee44a556
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
2 deletions
+48
-2
GoblinStoreMgtSqbGoodsController.java
...n/controller/manage/GoblinStoreMgtSqbGoodsController.java
+48
-2
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinStoreMgtSqbGoodsController.java
View file @
52b2aab8
...
@@ -10,7 +10,9 @@ import com.liquidnet.service.base.ErrorMapping;
...
@@ -10,7 +10,9 @@ import com.liquidnet.service.base.ErrorMapping;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsSqbAddParam
;
import
com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsSqbAddParam
;
import
com.liquidnet.service.goblin.dto.vo.*
;
import
com.liquidnet.service.goblin.dto.vo.*
;
import
com.liquidnet.service.goblin.entity.GoblinGoods
;
import
com.liquidnet.service.goblin.entity.GoblinSqbGoodsExt
;
import
com.liquidnet.service.goblin.entity.GoblinSqbGoodsExt
;
import
com.liquidnet.service.goblin.mapper.GoblinGoodsMapper
;
import
com.liquidnet.service.goblin.mapper.GoblinSqbGoodsExtMapper
;
import
com.liquidnet.service.goblin.mapper.GoblinSqbGoodsExtMapper
;
import
com.liquidnet.service.goblin.service.manage.IGoblinStoreMgtSqbGoodsService
;
import
com.liquidnet.service.goblin.service.manage.IGoblinStoreMgtSqbGoodsService
;
import
com.liquidnet.service.goblin.util.GoblinRedisUtils
;
import
com.liquidnet.service.goblin.util.GoblinRedisUtils
;
...
@@ -48,6 +50,8 @@ public class GoblinStoreMgtSqbGoodsController {
...
@@ -48,6 +50,8 @@ public class GoblinStoreMgtSqbGoodsController {
@Autowired
@Autowired
private
GoblinSqbGoodsExtMapper
goblinSqbGoodsExtMapper
;
private
GoblinSqbGoodsExtMapper
goblinSqbGoodsExtMapper
;
@Autowired
@Autowired
private
GoblinGoodsMapper
goblinGoodsMapper
;
@Autowired
private
SqbBiz
goblinShouQianBaService
;
private
SqbBiz
goblinShouQianBaService
;
/**
/**
...
@@ -188,10 +192,52 @@ public class GoblinStoreMgtSqbGoodsController {
...
@@ -188,10 +192,52 @@ public class GoblinStoreMgtSqbGoodsController {
}
}
private
boolean
existsSqbSpu
(
String
mallSn
,
String
sqbSpuId
)
{
private
boolean
existsSqbSpu
(
String
mallSn
,
String
sqbSpuId
)
{
return
goblinSqbGoodsExtMapper
.
selectCoun
t
(
new
LambdaQueryWrapper
<
GoblinSqbGoodsExt
>()
List
<
GoblinSqbGoodsExt
>
extList
=
goblinSqbGoodsExtMapper
.
selectLis
t
(
new
LambdaQueryWrapper
<
GoblinSqbGoodsExt
>()
.
eq
(
GoblinSqbGoodsExt:
:
getMallSn
,
mallSn
)
.
eq
(
GoblinSqbGoodsExt:
:
getMallSn
,
mallSn
)
.
eq
(
GoblinSqbGoodsExt:
:
getSqbSpuId
,
sqbSpuId
)
.
eq
(
GoblinSqbGoodsExt:
:
getSqbSpuId
,
sqbSpuId
)
.
eq
(
GoblinSqbGoodsExt:
:
getDelFlg
,
"0"
))
>
0
;
.
eq
(
GoblinSqbGoodsExt:
:
getDelFlg
,
"0"
)
.
last
(
"LIMIT 20"
));
if
(
CollectionUtils
.
isEmpty
(
extList
))
{
return
false
;
}
// 本地商品已删除但 ext 关系未清理时:允许重新同步(自动软删 ext 记录,避免“已存在”卡死)
boolean
hasLiveLocalSpu
=
false
;
for
(
GoblinSqbGoodsExt
ext
:
extList
)
{
if
(
ext
==
null
||
StringUtils
.
isBlank
(
ext
.
getSpuId
()))
{
continue
;
}
GoblinGoods
localGoods
=
goblinGoodsMapper
.
selectOne
(
new
LambdaQueryWrapper
<
GoblinGoods
>()
.
eq
(
GoblinGoods:
:
getSpuId
,
ext
.
getSpuId
())
.
eq
(
GoblinGoods:
:
getDelFlg
,
"0"
)
.
select
(
GoblinGoods:
:
getSpuId
)
.
last
(
"LIMIT 1"
));
if
(
localGoods
!=
null
)
{
hasLiveLocalSpu
=
true
;
break
;
}
}
if
(
hasLiveLocalSpu
)
{
return
true
;
}
try
{
LocalDateTime
now
=
LocalDateTime
.
now
();
for
(
GoblinSqbGoodsExt
ext
:
extList
)
{
if
(
ext
==
null
||
ext
.
getMid
()
==
null
)
{
continue
;
}
GoblinSqbGoodsExt
upd
=
new
GoblinSqbGoodsExt
();
upd
.
setMid
(
ext
.
getMid
());
upd
.
setDelFlg
(
"1"
);
upd
.
setUpdatedAt
(
now
);
upd
.
setDeletedAt
(
now
);
goblinSqbGoodsExtMapper
.
updateById
(
upd
);
}
}
catch
(
Exception
e
)
{
log
.
warn
(
"收钱吧商品管理:清理已删除SPU的ext关系失败, mallSn={}, sqbSpuId={}"
,
mallSn
,
sqbSpuId
,
e
);
}
return
false
;
}
}
private
void
saveSqbExtRelations
(
GoblinGoodsInfoVo
goodsInfoVo
,
GoblinSqbPerfGoodsVo
sqbGoods
)
{
private
void
saveSqbExtRelations
(
GoblinGoodsInfoVo
goodsInfoVo
,
GoblinSqbPerfGoodsVo
sqbGoods
)
{
...
...
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