Commit 2ee33af0 by 周晓航

调用会员优惠券接口 新增参数

Signed-off-by: 周晓航 <xiaohang.zhou@freemud.com>
parent 7392e8ae
......@@ -28,7 +28,8 @@ public class CouponPromotionVO {
private String unChooseCouponCode;
// 用于存放 优惠券数组 兼并老版本的 couponCode
private Set<String> couponCodes = new HashSet<>();
// 用于调用会员获取可用 优惠券问题
private Long deliveryAmount;
public void setCouponCode(String couponCode) {
this.couponCode = couponCode;
this.couponCodes.add(couponCode);
......
......@@ -35,4 +35,6 @@ public class CouponAvailableReqVo {
private String redeemChannel;
//购物车商品列表
private List<Product> productList;
private Integer freightAmount;
}
......@@ -484,14 +484,19 @@ public class CouponServiceImpl implements CouponService {
couponCodes.add(memberCoupon.getCouponCode());
}
});
List<CouponStateVo> couponStateList = buildAvailiableCoupons(cartGoods, partnerId, storeId, couponCodes, isNew,appId,menuType);
Integer freightAmount = null;
if (couponPromotionVO !=null) {
Long deliveryAmount = couponPromotionVO.getDeliveryAmount();
freightAmount = deliveryAmount ==null?null: deliveryAmount.intValue();
}
List<CouponStateVo> couponStateList = buildAvailiableCoupons(cartGoods, partnerId, storeId, couponCodes, isNew,appId,menuType,freightAmount);
if (CollectionUtils.isNotEmpty(couponStateList)) {
return returnSuccessAvailiableCoupons(couponPromotionVO == null ? new HashSet<>() : couponPromotionVO.getCouponCodes(), hasGoodsCoupon, availableCouponResponseVo, usableCoupons, disableCoupons, memberCouponMap, couponStateList, chooseCouponCode);
}
return null;
}
private List<CouponStateVo> buildAvailiableCoupons(List<CartGoods> cartGoods, String partnerId, String storeId, List<String> couponCodes, int isNew,String appId,String menuType) {
private List<CouponStateVo> buildAvailiableCoupons(List<CartGoods> cartGoods, String partnerId, String storeId, List<String> couponCodes, int isNew,String appId,String menuType,Integer freightAmount) {
String appSecret = getAppSecret(partnerId);
// 最大15一提交
int maxNum = 15;
......@@ -502,6 +507,7 @@ public class CouponServiceImpl implements CouponService {
couponAvailableReqVo.setMerchantId(partnerId);
couponAvailableReqVo.setStoreId(storeId);
couponAvailableReqVo.setAppId(appId);
couponAvailableReqVo.setFreightAmount(freightAmount);
List<Product> productList = Lists.newArrayList();
// 优惠券优先级最高,根据商品原价做计算
// 订单金额
......
......@@ -1696,6 +1696,9 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
*/
private void updateShoppingCartGoodsDiscount(CouponPromotionVO couponPromotionVO, ActivityQueryDto activityQueryDto, ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult, List<CartGoods> cartGoodsList
, ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo, ShoppingCartInfoRequestVo shoppingCartInfoRequestVo, UserLoginInfoDto userLoginInfoDto,String menuType,Long deliveryAmount) {
if (couponPromotionVO !=null) {
couponPromotionVO.setDeliveryAmount(deliveryAmount);
}
//默认计算优惠
DefaultPromotionService defaultPromotionService = (DefaultPromotionService) PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.DEFAULT_PROMOTION);
defaultPromotionService.updateShoppingCartGoodsDiscount(couponPromotionVO, activityQueryDto, calculationDiscountResult, cartGoodsList, shoppingCartGoodsResponseVo, userLoginInfoDto, shoppingCartInfoRequestVo);
......
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