Commit cafe8572 by 周晓航

购物车 套餐商品是否扣库存维护

parent c00ae2ce
...@@ -1408,11 +1408,13 @@ public class ShoppingCartConvertAdapter { ...@@ -1408,11 +1408,13 @@ public class ShoppingCartConvertAdapter {
if (isComboxGoods) { if (isComboxGoods) {
productComboType = parentProductBean.getProductComboList().stream().filter(p -> ObjectUtils.equals(comboxGoods.getGoodsId(), p.getProductId())).findFirst().orElse(new ProductComboType()); productComboType = parentProductBean.getProductComboList().stream().filter(p -> ObjectUtils.equals(comboxGoods.getGoodsId(), p.getProductId())).findFirst().orElse(new ProductComboType());
comboxGoods.setLinkedId(productComboType.getLinkedId()); comboxGoods.setLinkedId(productComboType.getLinkedId());
comboxGoods.setStockLimit(Objects.equals(1,productComboType.getStockLimit()));
} else { } else {
Map<String, GroupDetailType> map = new HashMap<>(); Map<String, GroupDetailType> map = new HashMap<>();
parentProductBean.getProductGroupList().stream().map(t -> t.getGroupDetail()).forEach(group -> group.forEach(detailType -> map.put(detailType.getProductId(), detailType))); parentProductBean.getProductGroupList().stream().map(t -> t.getGroupDetail()).forEach(group -> group.forEach(detailType -> map.put(detailType.getProductId(), detailType)));
groupDetailType = map.get(comboxGoods.getGoodsId()); groupDetailType = map.get(comboxGoods.getGoodsId());
comboxGoods.setLinkedId(groupDetailType.getLinkedId()); comboxGoods.setLinkedId(groupDetailType.getLinkedId());
comboxGoods.setStockLimit(Objects.equals(1,groupDetailType.getStockLimit()));
} }
// 若是固定商品则取商品详情的FinalPrice,若是可选商品则取MarkUpPrice // 若是固定商品则取商品详情的FinalPrice,若是可选商品则取MarkUpPrice
......
...@@ -25,4 +25,5 @@ public class ProductComboType { ...@@ -25,4 +25,5 @@ public class ProductComboType {
* 【订C,“POS编码”让凌顶那边去匹配商品】 https://www.tapd.cn/43862731/prong/stories/view/1143862731001039549 * 【订C,“POS编码”让凌顶那边去匹配商品】 https://www.tapd.cn/43862731/prong/stories/view/1143862731001039549
*/ */
private String linkedId ; private String linkedId ;
private Integer stockLimit;
} }
...@@ -391,6 +391,12 @@ public class CartGoods { ...@@ -391,6 +391,12 @@ public class CartGoods {
@Data @Data
public final static class ComboxGoods { public final static class ComboxGoods {
/** /**
* 是否限制库存
* 用于创建订单时,是否扣减库存
* 2022年10月19日11:20:11 tapd 新增套餐商品 可选搭配是否扣除库存 不走套餐主商品配置
*/
private boolean isStockLimit;
/**
* 【订C,“POS编码”让凌顶那边去匹配商品】 https://www.tapd.cn/43862731/prong/stories/view/1143862731001039549 * 【订C,“POS编码”让凌顶那边去匹配商品】 https://www.tapd.cn/43862731/prong/stories/view/1143862731001039549
*/ */
private String linkedId ; private String linkedId ;
......
...@@ -624,7 +624,7 @@ public class CalculationCommonService { ...@@ -624,7 +624,7 @@ public class CalculationCommonService {
com.setProductType(comb.isWeightType() ? ProductType.WEIGHT_PRODUCT.getCode() : ProductType.SETMEAL.getCode()); com.setProductType(comb.isWeightType() ? ProductType.WEIGHT_PRODUCT.getCode() : ProductType.SETMEAL.getCode());
com.setParentProductId(cartGoods.getGoodsId()); com.setParentProductId(cartGoods.getGoodsId());
com.setIsFixedProduct(isFixed); com.setIsFixedProduct(isFixed);
com.setStockLimit(cartGoods.isStockLimit()); com.setStockLimit(comb.isStockLimit());
com.setCustomerCode(comb.getCustomerCode()); com.setCustomerCode(comb.getCustomerCode());
com.setWeight(comb.getWeight()); com.setWeight(comb.getWeight());
com.setUnit(comb.getUnit()); com.setUnit(comb.getUnit());
......
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