|
@@ -229,10 +229,14 @@ public class GoodsMgrController extends BaseApiController {
|
|
return AjaxResult.error("商品" + goods.getTitle() + "不满足多SKU条件!");
|
|
return AjaxResult.error("商品" + goods.getTitle() + "不满足多SKU条件!");
|
|
}else {
|
|
}else {
|
|
GoodsSku firstGoodsSku = skuList.get(0);
|
|
GoodsSku firstGoodsSku = skuList.get(0);
|
|
- goods.setOriginPrice(firstGoodsSku.getOriginPrice());
|
|
|
|
goods.setExchangePrice(firstGoodsSku.getExchangePrice());
|
|
goods.setExchangePrice(firstGoodsSku.getExchangePrice());
|
|
goods.setValue(firstGoodsSku.getValue());
|
|
goods.setValue(firstGoodsSku.getValue());
|
|
goods.setCost(firstGoodsSku.getCost());
|
|
goods.setCost(firstGoodsSku.getCost());
|
|
|
|
+ if(null == firstGoodsSku.getOriginPrice()) {
|
|
|
|
+ goods.setOriginPrice(firstGoodsSku.getExchangePrice());
|
|
|
|
+ }else {
|
|
|
|
+ goods.setOriginPrice(firstGoodsSku.getOriginPrice());
|
|
|
|
+ }
|
|
// 累计库存
|
|
// 累计库存
|
|
int totalQuantity = skuList.stream().mapToInt(GoodsSku::getQuantity).sum();
|
|
int totalQuantity = skuList.stream().mapToInt(GoodsSku::getQuantity).sum();
|
|
goods.setQuantity(totalQuantity);
|
|
goods.setQuantity(totalQuantity);
|