Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
0edab09e
Commit
0edab09e
authored
Apr 15, 2021
by
徐康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数量校验
parent
46c060fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
+4
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+4
-1
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
0edab09e
...
@@ -1582,7 +1582,10 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -1582,7 +1582,10 @@ public class ShoppingCartMCoffeeServiceImpl {
.
collect
(
Collectors
.
toMap
(
ProductBeanDTO
.
ProductComboType
::
getProductId
,
ProductBeanDTO
.
ProductComboType
::
getQuantity
,
(
k1
,
k2
)
->
k1
+
k2
));
.
collect
(
Collectors
.
toMap
(
ProductBeanDTO
.
ProductComboType
::
getProductId
,
ProductBeanDTO
.
ProductComboType
::
getQuantity
,
(
k1
,
k2
)
->
k1
+
k2
));
Map
<
String
,
Integer
>
cartGoodsMap
=
cartGoods
.
getProductComboList
().
stream
()
Map
<
String
,
Integer
>
cartGoodsMap
=
cartGoods
.
getProductComboList
().
stream
()
.
collect
(
Collectors
.
toMap
(
CartGoods
.
ComboxGoods
::
getSpuId
,
CartGoods
.
ComboxGoods
::
getQty
,
(
k1
,
k2
)
->
k1
+
k2
));
.
collect
(
Collectors
.
toMap
(
o
->
(
StringUtils
.
isBlank
(
o
.
getSpuId
())
||
"0"
.
equals
(
o
.
getSpuId
()))?
o
.
getSkuId
():
o
.
getSpuId
(),
CartGoods
.
ComboxGoods
::
getQty
,
(
k1
,
k2
)
->
k1
+
k2
));
if
(
productMap
.
entrySet
().
stream
().
filter
(
o
->
!
o
.
getValue
().
equals
(
cartGoodsMap
.
get
(
o
.
getKey
()))).
findFirst
().
isPresent
())
{
if
(
productMap
.
entrySet
().
stream
().
filter
(
o
->
!
o
.
getValue
().
equals
(
cartGoodsMap
.
get
(
o
.
getKey
()))).
findFirst
().
isPresent
())
{
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_VERSION_ERROR
,
"加购套餐子商品数量异常"
);
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_VERSION_ERROR
,
"加购套餐子商品数量异常"
);
...
...
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