记得上下班打卡 | 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
40252d49
Commit
40252d49
authored
Mar 05, 2022
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~API:SKU删除updateOne -> updateMany;
parent
222f1f2a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
GoblinStoreMgtGoodsServiceImpl.java
...n/service/impl/manage/GoblinStoreMgtGoodsServiceImpl.java
+10
-6
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+2
-2
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStoreMgtGoodsServiceImpl.java
View file @
40252d49
package
com
.
liquidnet
.
service
.
goblin
.
service
.
impl
.
manage
;
package
com
.
liquidnet
.
service
.
goblin
.
service
.
impl
.
manage
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.base.PagedResult
;
import
com.liquidnet.service.base.PagedResult
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.base.constant.MQConst
;
...
@@ -756,18 +757,18 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
...
@@ -756,18 +757,18 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
for
(
List
<
GoblinGoodsSpecDto
>
goblinGoodsSpecDtos
:
remainSkuSpecDtoList
)
{
for
(
List
<
GoblinGoodsSpecDto
>
goblinGoodsSpecDtos
:
remainSkuSpecDtoList
)
{
for
(
GoblinGoodsSpecDto
goblinGoodsSpecDto
:
goblinGoodsSpecDtos
)
{
for
(
GoblinGoodsSpecDto
goblinGoodsSpecDto
:
goblinGoodsSpecDtos
)
{
String
specName
=
goblinGoodsSpecDto
.
getSpecName
(),
specVname
=
goblinGoodsSpecDto
.
getSpecVname
();
String
specName
=
goblinGoodsSpecDto
.
getSpecName
(),
specVname
=
goblinGoodsSpecDto
.
getSpecVname
();
Set
<
String
>
s
pecVnameSet
=
remainSkuSpecMap
.
get
(
specName
);
Set
<
String
>
remainSkuS
pecVnameSet
=
remainSkuSpecMap
.
get
(
specName
);
if
(
CollectionUtils
.
isEmpty
(
s
pecVnameSet
))
{
if
(
CollectionUtils
.
isEmpty
(
remainSkuS
pecVnameSet
))
{
s
pecVnameSet
=
CollectionUtil
.
getStringArraySet
();
remainSkuS
pecVnameSet
=
CollectionUtil
.
getStringArraySet
();
}
}
s
pecVnameSet
.
add
(
specVname
);
remainSkuS
pecVnameSet
.
add
(
specVname
);
remainSkuSpecMap
.
put
(
specName
,
s
pecVnameSet
);
remainSkuSpecMap
.
put
(
specName
,
remainSkuS
pecVnameSet
);
}
}
}
}
List
<
GoblinGoodsSpecVo
>
specVoList
=
mgtGoodsInfoVo
.
getSpecVoList
();
Map
<
String
,
String
>
delGoodsSkuSpecMap
=
goodsSkuInfoVo
.
getSkuSpecList
().
stream
()
Map
<
String
,
String
>
delGoodsSkuSpecMap
=
goodsSkuInfoVo
.
getSkuSpecList
().
stream
()
.
collect
(
Collectors
.
toMap
(
GoblinGoodsSpecDto:
:
getSpecName
,
GoblinGoodsSpecDto:
:
getSpecVname
));
.
collect
(
Collectors
.
toMap
(
GoblinGoodsSpecDto:
:
getSpecName
,
GoblinGoodsSpecDto:
:
getSpecVname
));
List
<
GoblinGoodsSpecVo
>
specVoList
=
mgtGoodsInfoVo
.
getSpecVoList
();
LinkedList
<
Object
[]>
updateGoodsSpuSpecObjs
=
CollectionUtil
.
linkedListObjectArr
();
LinkedList
<
Object
[]>
updateGoodsSpuSpecObjs
=
CollectionUtil
.
linkedListObjectArr
();
for
(
int
i
=
0
;
i
<
specVoList
.
size
();
i
++)
{
// 处理商品规格信息
for
(
int
i
=
0
;
i
<
specVoList
.
size
();
i
++)
{
// 处理商品规格信息
GoblinGoodsSpecVo
specVo
=
specVoList
.
get
(
i
);
// 商品指定规格
GoblinGoodsSpecVo
specVo
=
specVoList
.
get
(
i
);
// 商品指定规格
...
@@ -811,6 +812,9 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
...
@@ -811,6 +812,9 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
List
<
String
>
delSkuIdList
=
goblinRedisUtils
.
getSkuRe
(
delSkuId
);
List
<
String
>
delSkuIdList
=
goblinRedisUtils
.
getSkuRe
(
delSkuId
);
delSkuIdList
=
null
==
delSkuIdList
?
CollectionUtil
.
arrayListString
()
:
delSkuIdList
;
delSkuIdList
=
null
==
delSkuIdList
?
CollectionUtil
.
arrayListString
()
:
delSkuIdList
;
delSkuIdList
.
add
(
delSkuId
);
delSkuIdList
.
add
(
delSkuId
);
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"商品管理:商品编辑:SKU删除[delSkuId={},skuReId={}]"
,
delSkuId
,
JsonUtils
.
toJson
(
delSkuIdList
));
}
if
(
goblinMongoUtils
.
delGoodsSkuInfoVo
(
goodsSkuInfoVo
,
delSkuIdList
))
{
if
(
goblinMongoUtils
.
delGoodsSkuInfoVo
(
goodsSkuInfoVo
,
delSkuIdList
))
{
delSkuIdList
.
forEach
(
skuId
->
{
delSkuIdList
.
forEach
(
skuId
->
{
goblinRedisUtils
.
delGoodsSkuInfoVo
(
skuId
);
goblinRedisUtils
.
delGoodsSkuInfoVo
(
skuId
);
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
40252d49
...
@@ -328,7 +328,7 @@ public class GoblinMongoUtils {
...
@@ -328,7 +328,7 @@ public class GoblinMongoUtils {
public
boolean
delGoodsInfoVoBySpuIds
(
String
storeId
,
List
<
String
>
spuIdList
,
String
uid
,
LocalDateTime
time
)
{
public
boolean
delGoodsInfoVoBySpuIds
(
String
storeId
,
List
<
String
>
spuIdList
,
String
uid
,
LocalDateTime
time
)
{
return
mongoTemplate
.
updateMulti
(
return
mongoTemplate
.
updateMulti
(
Query
.
query
(
Criteria
.
where
(
"storeId"
).
is
(
storeId
).
and
(
"spuId"
).
in
(
spuIdList
.
toArray
()
).
and
(
"delFlg"
).
is
(
"0"
)),
Query
.
query
(
Criteria
.
where
(
"storeId"
).
is
(
storeId
).
and
(
"spuId"
).
in
(
spuIdList
).
and
(
"delFlg"
).
is
(
"0"
)),
Update
.
update
(
"delFlg"
,
"1"
).
set
(
"updatedBy"
,
uid
).
set
(
"updatedAt"
,
time
).
set
(
"deletedBy"
,
uid
).
set
(
"deletedAt"
,
time
),
Update
.
update
(
"delFlg"
,
"1"
).
set
(
"updatedBy"
,
uid
).
set
(
"updatedAt"
,
time
).
set
(
"deletedBy"
,
uid
).
set
(
"deletedAt"
,
time
),
GoblinGoodsInfoVo
.
class
.
getSimpleName
()
GoblinGoodsInfoVo
.
class
.
getSimpleName
()
).
getModifiedCount
()
>
0
;
).
getModifiedCount
()
>
0
;
...
@@ -525,7 +525,7 @@ public class GoblinMongoUtils {
...
@@ -525,7 +525,7 @@ public class GoblinMongoUtils {
}
}
public
boolean
delGoodsSkuInfoVo
(
GoblinGoodsSkuInfoVo
vo
,
List
<
String
>
skuIdList
)
{
public
boolean
delGoodsSkuInfoVo
(
GoblinGoodsSkuInfoVo
vo
,
List
<
String
>
skuIdList
)
{
return
mongoTemplate
.
getCollection
(
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
()).
update
One
(
return
mongoTemplate
.
getCollection
(
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
()).
update
Many
(
Query
.
query
(
Criteria
.
where
(
"skuId"
).
in
(
skuIdList
).
and
(
"delFlg"
).
is
(
"0"
)).
getQueryObject
(),
Query
.
query
(
Criteria
.
where
(
"skuId"
).
in
(
skuIdList
).
and
(
"delFlg"
).
is
(
"0"
)).
getQueryObject
(),
Update
.
update
(
"delFlg"
,
"1"
).
set
(
"updatedBy"
,
vo
.
getUpdatedBy
()).
set
(
"updatedAt"
,
vo
.
getUpdatedAt
())
Update
.
update
(
"delFlg"
,
"1"
).
set
(
"updatedBy"
,
vo
.
getUpdatedBy
()).
set
(
"updatedAt"
,
vo
.
getUpdatedAt
())
.
set
(
"deletedBy"
,
vo
.
getDeletedBy
()).
set
(
"deletedAt"
,
vo
.
getDeletedAt
()).
getUpdateObject
()
.
set
(
"deletedBy"
,
vo
.
getDeletedBy
()).
set
(
"deletedAt"
,
vo
.
getDeletedAt
()).
getUpdateObject
()
...
...
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