Commit 27351eb8 by chongfu.liang

商品券

parent 2819efca
...@@ -109,7 +109,12 @@ public class AddGoodsBOAdapter { ...@@ -109,7 +109,12 @@ public class AddGoodsBOAdapter {
platformProductBO.setQty(qty); platformProductBO.setQty(qty);
Integer goodsType = StringUtils.isEmpty(skuId)||ObjectUtils.equals(spuId,skuId) ? GoodsTypeEnum.SPU_GOODS.getGoodsType() : GoodsTypeEnum.SKU_GOODS.getGoodsType(); Integer goodsType = StringUtils.isEmpty(skuId)||ObjectUtils.equals(spuId,skuId) ? GoodsTypeEnum.SPU_GOODS.getGoodsType() : GoodsTypeEnum.SKU_GOODS.getGoodsType();
if (spuId.startsWith(CommonsConstant.COUPON_PREFIX)) { if (spuId.startsWith(CommonsConstant.COUPON_PREFIX)) {
goodsType = GoodsTypeEnum.COUPON_GOODS.getGoodsType(); if (StringUtils.isNotBlank(skuId)){
goodsType = GoodsTypeEnum.HG_COUPON_GOODS.getGoodsType();
} else {
goodsType = GoodsTypeEnum.COUPON_GOODS.getGoodsType();
}
} else if (CollectionUtils.isNotEmpty(baseRequestDTO.getProductComboList()) || CollectionUtils.isNotEmpty(baseRequestDTO.getProductGroupList())) { } else if (CollectionUtils.isNotEmpty(baseRequestDTO.getProductComboList()) || CollectionUtils.isNotEmpty(baseRequestDTO.getProductGroupList())) {
goodsType = GoodsTypeEnum.SET_MEAL_GOODS.getGoodsType(); goodsType = GoodsTypeEnum.SET_MEAL_GOODS.getGoodsType();
} }
......
...@@ -221,13 +221,6 @@ public abstract class AbstractAddGoodsService implements AddGoodsService { ...@@ -221,13 +221,6 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
if (baseRequestBO.getSpuId().startsWith(CommonsConstant.COUPON_PREFIX)) { if (baseRequestBO.getSpuId().startsWith(CommonsConstant.COUPON_PREFIX)) {
CartGoods cartGoods = baseRequestBO.getAddGoods(); CartGoods cartGoods = baseRequestBO.getAddGoods();
cartGoods.setCartGoodsUid(baseRequestBO.getSpuId()); cartGoods.setCartGoodsUid(baseRequestBO.getSpuId());
// 设置商品类型为商品券
if (CouponTypeEnum.TYPE_4.getCode().equals(getProductBO.getCouponType())) {
cartGoods.setGoodsType(GoodsTypeEnum.HG_COUPON_GOODS.getGoodsType());
} else {
cartGoods.setGoodsType(GoodsTypeEnum.COUPON_GOODS.getGoodsType());
}
cartGoods.setOriginalPrice(spqBO.getProductPrice()); cartGoods.setOriginalPrice(spqBO.getProductPrice());
// 商品券Id // 商品券Id
...@@ -250,7 +243,6 @@ public abstract class AbstractAddGoodsService implements AddGoodsService { ...@@ -250,7 +243,6 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
cartGoods.setUnit(productsInfo.getUnit()); cartGoods.setUnit(productsInfo.getUnit());
cartGoods.setSpuName(productsInfo.getName()); cartGoods.setSpuName(productsInfo.getName());
cartGoods.setCouponProductPrice(productsInfo.getFinalPrice()); cartGoods.setCouponProductPrice(productsInfo.getFinalPrice());
cartGoods.setActivityCode(getProductBO.getActivityCode());
boolean stockLimit = false; boolean stockLimit = false;
if (productsInfo.getType() == ProductType.NOSPEC.getCode() if (productsInfo.getType() == ProductType.NOSPEC.getCode()
&& productsInfo.getStockLimit() == 1) { && productsInfo.getStockLimit() == 1) {
......
...@@ -79,7 +79,7 @@ public class PlatformAddGoodsService extends AbstractAddGoodsService { ...@@ -79,7 +79,7 @@ public class PlatformAddGoodsService extends AbstractAddGoodsService {
coupon.setActivityCode(cartGoods.getActivityCode()); coupon.setActivityCode(cartGoods.getActivityCode());
coupons.add(coupon); coupons.add(coupon);
if (GoodsTypeEnum.HG_COUPON_GOODS.getGoodsType().equals(cartGoods.getGoodsType())) { if (GoodsTypeEnum.HG_COUPON_GOODS.getGoodsType().equals(cartGoods.getGoodsType())) {
this.setSpqDiscountGoods(calculationDiscountGoodsList, cartGoods, goodsId, cartGoods.getCouponProductPrice(), cartGoods.getSpuId()); this.setSpqDiscountGoods(calculationDiscountGoodsList, cartGoods, goodsId, cartGoods.getCouponProductPrice(), cartGoods.getCartGoodsUid().substring(CommonsConstant.COUPON_PREFIX.length()));
} else { } else {
this.setSpqDiscountGoods(calculationDiscountGoodsList, cartGoods, goodsId, cartGoods.getCouponProductPrice(), null); this.setSpqDiscountGoods(calculationDiscountGoodsList, cartGoods, goodsId, cartGoods.getCouponProductPrice(), null);
} }
...@@ -176,6 +176,7 @@ public class PlatformAddGoodsService extends AbstractAddGoodsService { ...@@ -176,6 +176,7 @@ public class PlatformAddGoodsService extends AbstractAddGoodsService {
if (null == checkSpqInfo) { if (null == checkSpqInfo) {
cartGoodsList.remove(i); cartGoodsList.remove(i);
} else { } else {
cartGoods.setActivityCode(checkSpqInfo.getActiveCode());
cartGoods.setCouponProductPrice(checkSpqInfo.getPrice()); cartGoods.setCouponProductPrice(checkSpqInfo.getPrice());
} }
} }
......
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