Commit 2cbe13a7cc5042aeb23f1f50e38089280822285b

Authored by fengliang
1 parent d4d3f479

update:修改购物车商品异常

etrade-order/src/main/java/com/diligrp/etrade/order/service/impl/ShopCartImpl.java
@@ -135,13 +135,15 @@ public class ShopCartImpl implements IShopCartService { @@ -135,13 +135,15 @@ public class ShopCartImpl implements IShopCartService {
135 shopCartMessageVo.setPrePrice(0L); 135 shopCartMessageVo.setPrePrice(0L);
136 shopCartMessageVo.setPieceWeight(0L); 136 shopCartMessageVo.setPieceWeight(0L);
137 shopCartMessageVo.setProductState(ShopCartMessageProductState.TYPE_CHANGE.getCodeInteger()); 137 shopCartMessageVo.setProductState(ShopCartMessageProductState.TYPE_CHANGE.getCodeInteger());
  138 + }else{
  139 + //商品包装单位
  140 + shopCartMessageVo.setSaleUnit(productPresetVo.getSaleUnit());
  141 + //预设价格分
  142 + shopCartMessageVo.setPrePrice(productPresetVo.getPrePrice() == null ? 0L : productPresetVo.getPrePrice());
  143 + //预设件重克
  144 + shopCartMessageVo.setPieceWeight(productPresetVo.getPieceWeight());
138 } 145 }
139 - //商品包装单位  
140 - shopCartMessageVo.setSaleUnit(productPresetVo.getSaleUnit());  
141 - //预设价格分  
142 - shopCartMessageVo.setPrePrice(productPresetVo.getPrePrice() == null ? 0L : productPresetVo.getPrePrice());  
143 - //预设件重克  
144 - shopCartMessageVo.setPieceWeight(productPresetVo.getPieceWeight()); 146 +
145 } else { 147 } else {
146 //按斤卖 148 //按斤卖
147 ProductPresetVo productPresetVo = map.get(SaleUnitType.CATTY.getCode()); 149 ProductPresetVo productPresetVo = map.get(SaleUnitType.CATTY.getCode());
@@ -151,11 +153,15 @@ public class ShopCartImpl implements IShopCartService { @@ -151,11 +153,15 @@ public class ShopCartImpl implements IShopCartService {
151 if(productPresetVo == null){ 153 if(productPresetVo == null){
152 shopCartMessageVo.setPrePrice(0L); 154 shopCartMessageVo.setPrePrice(0L);
153 shopCartMessageVo.setProductState(ShopCartMessageProductState.TYPE_CHANGE.getCodeInteger()); 155 shopCartMessageVo.setProductState(ShopCartMessageProductState.TYPE_CHANGE.getCodeInteger());
  156 + }else{
  157 + //商品包装单位
  158 + shopCartMessageVo.setSaleUnit(productPresetVo.getSaleUnit());
  159 + //商品包装单位
  160 + shopCartMessageVo.setSaleUnit(productPresetVo.getSaleUnit());
  161 +
  162 + shopCartMessageVo.setPrePrice(productPresetVo.getPrePrice() == null ? 0L : productPresetVo.getPrePrice());
154 } 163 }
155 - //商品包装单位  
156 - shopCartMessageVo.setSaleUnit(productPresetVo.getSaleUnit());  
157 164
158 - shopCartMessageVo.setPrePrice(productPresetVo.getPrePrice() == null ? 0L : productPresetVo.getPrePrice());  
159 } 165 }
160 } 166 }
161 }); 167 });