Commit 28634bc4 by xiaoer.li@freemud.com

Merge remote-tracking branch 'remotes/origin/fixbug_库存校验空指针' into qa

# Conflicts:
#	shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
parents b71cbbaf 1bb6c28d
...@@ -417,7 +417,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -417,7 +417,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
if ((CollectionUtils.isEmpty(availableStocks.getResult())) || (availableStocks.getResult().get(0).getQty() != null && if ((CollectionUtils.isEmpty(availableStocks.getResult())) || (availableStocks.getResult().get(0).getQty() != null &&
qty > availableStocks.getResult().get(0).getQty())) { qty > availableStocks.getResult().get(0).getQty())) {
Integer stock = 0; Integer stock = 0;
if (!CollectionUtils.isEmpty(availableStocks.getResult()) && (stock = availableStocks.getResult().get(0).getQty()) > 0) { if (availableStocks.getResult().get(0).getQty() != null && (stock = availableStocks.getResult().get(0).getQty()) > 0) {
throw new BizServiceException(ResponseResult.SHOPPING_CART_STOCK_NOT_HAVE, "仅剩" + stock + "件库存了"); throw new BizServiceException(ResponseResult.SHOPPING_CART_STOCK_NOT_HAVE, "仅剩" + stock + "件库存了");
} }
throw new ServiceException(ResponseResult.SHOPPING_CART_STOCK_NOT_HAVE); throw new ServiceException(ResponseResult.SHOPPING_CART_STOCK_NOT_HAVE);
...@@ -1038,7 +1038,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1038,7 +1038,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
shoppingCartGoodsResponseVo.setIsDiscountDelivery(false); shoppingCartGoodsResponseVo.setIsDiscountDelivery(false);
}else{ }else{
//DecimalFormat df = new DecimalFormat("###.##");
String desc = DELIVERY_DISCOUNT_DESC3; String desc = DELIVERY_DISCOUNT_DESC3;
shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, df.format(deliveryAmount.doubleValue() / 100))); shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, df.format(deliveryAmount.doubleValue() / 100)));
shoppingCartGoodsResponseVo.setDeliveryAmount(deliveryAmount); shoppingCartGoodsResponseVo.setDeliveryAmount(deliveryAmount);
...@@ -1220,7 +1219,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1220,7 +1219,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
(CollectionUtils.isEmpty(availableStocks.getResult()) || availableStocks.getResult().get(0).getQty() == null (CollectionUtils.isEmpty(availableStocks.getResult()) || availableStocks.getResult().get(0).getQty() == null
|| availableStocks.getResult().get(0).getQty() < qty)) { || availableStocks.getResult().get(0).getQty() < qty)) {
Integer stock = 0; Integer stock = 0;
if (!CollectionUtils.isEmpty(availableStocks.getResult()) && (stock = availableStocks.getResult().get(0).getQty()) > 0) { if (availableStocks.getResult().get(0).getQty() != null && (stock = availableStocks.getResult().get(0).getQty()) > 0) {
throw new BizServiceException(ResponseResult.SHOPPING_CART_STOCK_NOT_HAVE, "仅剩" + stock + "件库存了"); throw new BizServiceException(ResponseResult.SHOPPING_CART_STOCK_NOT_HAVE, "仅剩" + stock + "件库存了");
} }
throw new ServiceException(ResponseResult.SHOPPING_CART_STOCK_NOT_HAVE); throw new ServiceException(ResponseResult.SHOPPING_CART_STOCK_NOT_HAVE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment