Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
mall
Commits
0387c981
Commit
0387c981
authored
Jul 26, 2023
by
macro
Browse files
批量更新商品sku时添加对pid的限制
parent
f4ab3a60
Changes
1
Hide whitespace changes
Inline
Side-by-side
mall-admin/src/main/java/com/macro/mall/service/impl/PmsSkuStockServiceImpl.java
View file @
0387c981
...
...
@@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* 商品SKU库存管理Service实现类
...
...
@@ -34,6 +35,9 @@ public class PmsSkuStockServiceImpl implements PmsSkuStockService {
@Override
public
int
update
(
Long
pid
,
List
<
PmsSkuStock
>
skuStockList
)
{
return
skuStockDao
.
replaceList
(
skuStockList
);
List
<
PmsSkuStock
>
filterSkuList
=
skuStockList
.
stream
()
.
filter
(
item
->
pid
.
equals
(
item
.
getProductId
()))
.
collect
(
Collectors
.
toList
());
return
skuStockDao
.
replaceList
(
filterSkuList
);
}
}
Write
Preview
Supports
Markdown
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