Commit b404e1c348d19d5c9306b35d3a5a8c68ba739443
1 parent
dd4945f7
update:购物车库存为0,返回购物车商品状态异常
Showing
2 changed files
with
5 additions
and
1 deletions
etrade-order/src/main/java/com/diligrp/etrade/order/service/impl/ShopCartImpl.java
@@ -151,6 +151,9 @@ public class ShopCartImpl implements IShopCartService { | @@ -151,6 +151,9 @@ public class ShopCartImpl implements IShopCartService { | ||
151 | shopCartMessageVo.setUnitAmount(productPresetVo.getPrePrice() == null ? 0L : productPresetVo.getPrePrice()); | 151 | shopCartMessageVo.setUnitAmount(productPresetVo.getPrePrice() == null ? 0L : productPresetVo.getPrePrice()); |
152 | //预设件重克 | 152 | //预设件重克 |
153 | shopCartMessageVo.setPieceWeight(productPresetVo.getPieceWeight()); | 153 | shopCartMessageVo.setPieceWeight(productPresetVo.getPieceWeight()); |
154 | + if(shopCartMessageVo.getWeight().equals(0L)){ | ||
155 | + shopCartMessageVo.setProductState(ShopCartMessageProductState.ZERO.getCodeInteger()); | ||
156 | + } | ||
154 | } | 157 | } |
155 | }else{ | 158 | }else{ |
156 | shopCartMessageVo.setProductState(ShopCartMessageProductState.NONE.getCodeInteger()); | 159 | shopCartMessageVo.setProductState(ShopCartMessageProductState.NONE.getCodeInteger()); |
etrade-order/src/main/java/com/diligrp/etrade/order/type/ShopCartMessageProductState.java
@@ -6,7 +6,8 @@ public enum ShopCartMessageProductState implements IEnumType { | @@ -6,7 +6,8 @@ public enum ShopCartMessageProductState implements IEnumType { | ||
6 | NORMAL("正常", 1), | 6 | NORMAL("正常", 1), |
7 | UNIT_CHANGE("单位变更", 2), | 7 | UNIT_CHANGE("单位变更", 2), |
8 | TYPE_CHANGE("类型变更", 3), | 8 | TYPE_CHANGE("类型变更", 3), |
9 | - NONE("商品不存在", 4); | 9 | + NONE("商品不存在", 4), |
10 | + ZERO("商品库存为零", 5); | ||
10 | 11 | ||
11 | private String name; | 12 | private String name; |
12 | private Integer code; | 13 | private Integer code; |