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
9c1fb75a
Commit
9c1fb75a
authored
Jan 20, 2022
by
周晓航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品库存服务查询失败, 或者 数量为null 不校验库存
Signed-off-by: 周晓航 <xiaohang.zhou@freemud.com>
parent
532fe245
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
+6
-3
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
View file @
9c1fb75a
...
...
@@ -2368,11 +2368,14 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
requestDto
.
setStoreId
(
addShoppingCartGoodsRequestVo
.
getShopId
());
requestDto
.
setProductIds
(
productIds
);
GetProductStockResponseDto
availableStocks
=
stockClient
.
getAvailableStocks
(
requestDto
);
if
(
availableStocks
==
null
||
!
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
.
equals
(
availableStocks
.
getCode
()))
{
// 商品服务 返回null 或者 qty=null 表示不限制库存
if
(
Objects
.
isNull
(
availableStocks
)
||
Objects
.
isNull
(
availableStocks
.
getResult
().
get
(
0
).
getQty
()))
{
return
;
}
if
(!
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
.
equals
(
availableStocks
.
getCode
()))
{
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_STOCK_NOT_HAVE
);
}
int
stock
=
CollectionUtils
.
isEmpty
(
availableStocks
.
getResult
())
||
availableStocks
.
getResult
().
get
(
0
).
getQty
()
==
null
?
0
:
availableStocks
.
getResult
().
get
(
0
).
getQty
();
int
stock
=
availableStocks
.
getResult
().
get
(
0
).
getQty
();
if
(
stock
<=
0
)
{
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_STOCK_NOT_HAVE
);
}
else
if
(
stock
<
qty
)
{
...
...
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