com.macro.mall.portal.domain.CartPromotionItem Java Examples

The following examples show how to use com.macro.mall.portal.domain.CartPromotionItem. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OmsPromotionServiceImpl.java    From macrozheng with Apache License 2.0 6 votes vote down vote up
/**
 * 对没满足优惠条件的商品进行处理
 */
private void handleNoReduce(List<CartPromotionItem> cartPromotionItemList, List<OmsCartItem> itemList,PromotionProduct promotionProduct) {
    for (OmsCartItem item : itemList) {
        CartPromotionItem cartPromotionItem = new CartPromotionItem();
        BeanUtils.copyProperties(item,cartPromotionItem);
        cartPromotionItem.setPromotionMessage("无优惠");
        cartPromotionItem.setReduceAmount(new BigDecimal(0));
        PmsSkuStock skuStock = getOriginalPrice(promotionProduct,item.getProductSkuId());
        if(skuStock!=null){
            cartPromotionItem.setRealStock(skuStock.getStock()-skuStock.getLockStock());
        }
        cartPromotionItem.setIntegration(promotionProduct.getGiftPoint());
        cartPromotionItem.setGrowth(promotionProduct.getGiftGrowth());
        cartPromotionItemList.add(cartPromotionItem);
    }
}
 
Example #2
Source File: OmsPromotionServiceImpl.java    From mall-swarm with Apache License 2.0 6 votes vote down vote up
/**
 * 对没满足优惠条件的商品进行处理
 */
private void handleNoReduce(List<CartPromotionItem> cartPromotionItemList, List<OmsCartItem> itemList,PromotionProduct promotionProduct) {
    for (OmsCartItem item : itemList) {
        CartPromotionItem cartPromotionItem = new CartPromotionItem();
        BeanUtils.copyProperties(item,cartPromotionItem);
        cartPromotionItem.setPromotionMessage("无优惠");
        cartPromotionItem.setReduceAmount(new BigDecimal(0));
        PmsSkuStock skuStock = getOriginalPrice(promotionProduct,item.getProductSkuId());
        if(skuStock!=null){
            cartPromotionItem.setRealStock(skuStock.getStock()-skuStock.getLockStock());
        }
        cartPromotionItem.setIntegration(promotionProduct.getGiftPoint());
        cartPromotionItem.setGrowth(promotionProduct.getGiftGrowth());
        cartPromotionItemList.add(cartPromotionItem);
    }
}
 
Example #3
Source File: OmsPromotionServiceImpl.java    From mall with Apache License 2.0 6 votes vote down vote up
/**
 * 对没满足优惠条件的商品进行处理
 */
private void handleNoReduce(List<CartPromotionItem> cartPromotionItemList, List<OmsCartItem> itemList,PromotionProduct promotionProduct) {
    for (OmsCartItem item : itemList) {
        CartPromotionItem cartPromotionItem = new CartPromotionItem();
        BeanUtils.copyProperties(item,cartPromotionItem);
        cartPromotionItem.setPromotionMessage("无优惠");
        cartPromotionItem.setReduceAmount(new BigDecimal(0));
        PmsSkuStock skuStock = getOriginalPrice(promotionProduct,item.getProductSkuId());
        if(skuStock!=null){
            cartPromotionItem.setRealStock(skuStock.getStock()-skuStock.getLockStock());
        }
        cartPromotionItem.setIntegration(promotionProduct.getGiftPoint());
        cartPromotionItem.setGrowth(promotionProduct.getGiftGrowth());
        cartPromotionItemList.add(cartPromotionItem);
    }
}
 
Example #4
Source File: OmsCartItemServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
@Override
public List<CartPromotionItem> listPromotion(Long memberId, List<Long> cartIds) {
    List<OmsCartItem> cartItemList = list(memberId);
    if(CollUtil.isNotEmpty(cartIds)){
        cartItemList = cartItemList.stream().filter(item->cartIds.contains(item.getId())).collect(Collectors.toList());
    }
    List<CartPromotionItem> cartPromotionItemList = new ArrayList<>();
    if(!CollectionUtils.isEmpty(cartItemList)){
        cartPromotionItemList = promotionService.calcCartPromotion(cartItemList);
    }
    return cartPromotionItemList;
}
 
Example #5
Source File: OmsCartItemServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@Override
public List<CartPromotionItem> listPromotion(Long memberId) {
    List<OmsCartItem> cartItemList = list(memberId);
    List<CartPromotionItem> cartPromotionItemList = new ArrayList<>();
    if(!CollectionUtils.isEmpty(cartItemList)){
        cartPromotionItemList = promotionService.calcCartPromotion(cartItemList);
    }
    return cartPromotionItemList;
}
 
Example #6
Source File: UmsMemberCouponController.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@ApiOperation("获取登录会员购物车的相关优惠券")
@ApiImplicitParam(name = "type", value = "使用可用:0->不可用;1->可用",
        defaultValue = "1", allowableValues = "0,1", paramType = "query", dataType = "integer")
@RequestMapping(value = "/list/cart/{type}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<SmsCouponHistoryDetail>> listCart(@PathVariable Integer type) {
    List<CartPromotionItem> cartPromotionItemList = cartItemService.listPromotion(memberService.getCurrentMember().getId());
    List<SmsCouponHistoryDetail> couponHistoryList = memberCouponService.listCart(cartPromotionItemList, type);
    return CommonResult.success(couponHistoryList);
}
 
Example #7
Source File: OmsCartItemController.java    From mall with Apache License 2.0 5 votes vote down vote up
@ApiOperation("获取某个会员的购物车列表,包括促销信息")
@RequestMapping(value = "/list/promotion", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<CartPromotionItem>> listPromotion(@RequestParam(required = false) List<Long> cartIds) {
    List<CartPromotionItem> cartPromotionItemList = cartItemService.listPromotion(memberService.getCurrentMember().getId(), cartIds);
    return CommonResult.success(cartPromotionItemList);
}
 
Example #8
Source File: UmsMemberCouponServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
private BigDecimal calcTotalAmount(List<CartPromotionItem> cartItemList) {
    BigDecimal total = new BigDecimal("0");
    for (CartPromotionItem item : cartItemList) {
        BigDecimal realPrice = item.getPrice().subtract(item.getReduceAmount());
        total=total.add(realPrice.multiply(new BigDecimal(item.getQuantity())));
    }
    return total;
}
 
Example #9
Source File: UmsMemberCouponServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
private BigDecimal calcTotalAmountByproductCategoryId(List<CartPromotionItem> cartItemList,List<Long> productCategoryIds) {
    BigDecimal total = new BigDecimal("0");
    for (CartPromotionItem item : cartItemList) {
        if(productCategoryIds.contains(item.getProductCategoryId())){
            BigDecimal realPrice = item.getPrice().subtract(item.getReduceAmount());
            total=total.add(realPrice.multiply(new BigDecimal(item.getQuantity())));
        }
    }
    return total;
}
 
Example #10
Source File: UmsMemberCouponServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
private BigDecimal calcTotalAmountByProductId(List<CartPromotionItem> cartItemList,List<Long> productIds) {
    BigDecimal total = new BigDecimal("0");
    for (CartPromotionItem item : cartItemList) {
        if(productIds.contains(item.getProductId())){
            BigDecimal realPrice = item.getPrice().subtract(item.getReduceAmount());
            total=total.add(realPrice.multiply(new BigDecimal(item.getQuantity())));
        }
    }
    return total;
}
 
Example #11
Source File: UmsMemberCouponController.java    From mall with Apache License 2.0 5 votes vote down vote up
@ApiOperation("获取登录会员购物车的相关优惠券")
@ApiImplicitParam(name = "type", value = "使用可用:0->不可用;1->可用",
        defaultValue = "1", allowableValues = "0,1", paramType = "query", dataType = "integer")
@RequestMapping(value = "/list/cart/{type}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<SmsCouponHistoryDetail>> listCart(@PathVariable Integer type) {
    List<CartPromotionItem> cartPromotionItemList = cartItemService.listPromotion(memberService.getCurrentMember().getId(), null);
    List<SmsCouponHistoryDetail> couponHistoryList = memberCouponService.listCart(cartPromotionItemList, type);
    return CommonResult.success(couponHistoryList);
}
 
Example #12
Source File: UmsMemberCouponController.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@ApiOperation("获取登录会员购物车的相关优惠券")
@ApiImplicitParam(name = "type", value = "使用可用:0->不可用;1->可用",
        defaultValue = "1", allowableValues = "0,1", paramType = "query", dataType = "integer")
@RequestMapping(value = "/list/cart/{type}", method = RequestMethod.GET)
@ResponseBody
public Object listCart(@PathVariable Integer type) {
    List<CartPromotionItem> cartPromotionItemList = cartItemService.listPromotion(memberService.getCurrentMember().getId());
    List<SmsCouponHistoryDetail> couponHistoryList = memberCouponService.listCart(cartPromotionItemList, type);
    return new CommonResult().success(couponHistoryList);
}
 
Example #13
Source File: OmsCartItemController.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@ApiOperation("获取某个会员的购物车列表,包括促销信息")
@RequestMapping(value = "/list/promotion", method = RequestMethod.GET)
@ResponseBody
public Object listPromotion() {
    List<CartPromotionItem> cartPromotionItemList = cartItemService.listPromotion(memberService.getCurrentMember().getId());
    return new CommonResult().success(cartPromotionItemList);
}
 
Example #14
Source File: UmsMemberCouponServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
private BigDecimal calcTotalAmount(List<CartPromotionItem> cartItemList) {
    BigDecimal total = new BigDecimal("0");
    for (CartPromotionItem item : cartItemList) {
        BigDecimal realPrice = item.getPrice().subtract(item.getReduceAmount());
        total=total.add(realPrice.multiply(new BigDecimal(item.getQuantity())));
    }
    return total;
}
 
Example #15
Source File: UmsMemberCouponServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
private BigDecimal calcTotalAmountByproductCategoryId(List<CartPromotionItem> cartItemList,List<Long> productCategoryIds) {
    BigDecimal total = new BigDecimal("0");
    for (CartPromotionItem item : cartItemList) {
        if(productCategoryIds.contains(item.getProductCategoryId())){
            BigDecimal realPrice = item.getPrice().subtract(item.getReduceAmount());
            total=total.add(realPrice.multiply(new BigDecimal(item.getQuantity())));
        }
    }
    return total;
}
 
Example #16
Source File: UmsMemberCouponServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
private BigDecimal calcTotalAmountByProductId(List<CartPromotionItem> cartItemList,List<Long> productIds) {
    BigDecimal total = new BigDecimal("0");
    for (CartPromotionItem item : cartItemList) {
        if(productIds.contains(item.getProductId())){
            BigDecimal realPrice = item.getPrice().subtract(item.getReduceAmount());
            total=total.add(realPrice.multiply(new BigDecimal(item.getQuantity())));
        }
    }
    return total;
}
 
Example #17
Source File: OmsPromotionServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
/**
 * 对没满足优惠条件的商品进行处理
 */
private void handleNoReduce(List<CartPromotionItem> cartPromotionItemList, List<OmsCartItem> itemList,PromotionProduct promotionProduct) {
    for (OmsCartItem item : itemList) {
        CartPromotionItem cartPromotionItem = new CartPromotionItem();
        BeanUtils.copyProperties(item,cartPromotionItem);
        cartPromotionItem.setPromotionMessage("无优惠");
        cartPromotionItem.setReduceAmount(new BigDecimal(0));
        PmsSkuStock skuStock = getOriginalPrice(promotionProduct,item.getProductSkuId());
        cartPromotionItem.setRealStock(skuStock.getStock()-skuStock.getLockStock());
        cartPromotionItem.setIntegration(promotionProduct.getGiftPoint());
        cartPromotionItem.setGrowth(promotionProduct.getGiftGrowth());
        cartPromotionItemList.add(cartPromotionItem);
    }
}
 
Example #18
Source File: OmsCartItemServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@Override
public List<CartPromotionItem> listPromotion(Long memberId) {
    List<OmsCartItem> cartItemList = list(memberId);
    List<CartPromotionItem> cartPromotionItemList = new ArrayList<>();
    if(!CollectionUtils.isEmpty(cartItemList)){
        cartPromotionItemList = promotionService.calcCartPromotion(cartItemList);
    }
    return cartPromotionItemList;
}
 
Example #19
Source File: OmsCartItemServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@Override
public List<CartPromotionItem> listPromotion(Long memberId) {
    List<OmsCartItem> cartItemList = list(memberId);
    List<CartPromotionItem> cartPromotionItemList = new ArrayList<>();
    if(!CollectionUtils.isEmpty(cartItemList)){
        cartPromotionItemList = promotionService.calcCartPromotion(cartItemList);
    }
    return cartPromotionItemList;
}
 
Example #20
Source File: OmsCartItemController.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@ApiOperation("获取某个会员的购物车列表,包括促销信息")
@RequestMapping(value = "/list/promotion", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<CartPromotionItem>> listPromotion() {
    List<CartPromotionItem> cartPromotionItemList = cartItemService.listPromotion(memberService.getCurrentMember().getId());
    return CommonResult.success(cartPromotionItemList);
}
 
Example #21
Source File: UmsMemberCouponServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
private BigDecimal calcTotalAmount(List<CartPromotionItem> cartItemList) {
    BigDecimal total = new BigDecimal("0");
    for (CartPromotionItem item : cartItemList) {
        BigDecimal realPrice = item.getPrice().subtract(item.getReduceAmount());
        total=total.add(realPrice.multiply(new BigDecimal(item.getQuantity())));
    }
    return total;
}
 
Example #22
Source File: UmsMemberCouponServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
private BigDecimal calcTotalAmountByproductCategoryId(List<CartPromotionItem> cartItemList,List<Long> productCategoryIds) {
    BigDecimal total = new BigDecimal("0");
    for (CartPromotionItem item : cartItemList) {
        if(productCategoryIds.contains(item.getProductCategoryId())){
            BigDecimal realPrice = item.getPrice().subtract(item.getReduceAmount());
            total=total.add(realPrice.multiply(new BigDecimal(item.getQuantity())));
        }
    }
    return total;
}
 
Example #23
Source File: UmsMemberCouponServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
private BigDecimal calcTotalAmountByProductId(List<CartPromotionItem> cartItemList,List<Long> productIds) {
    BigDecimal total = new BigDecimal("0");
    for (CartPromotionItem item : cartItemList) {
        if(productIds.contains(item.getProductId())){
            BigDecimal realPrice = item.getPrice().subtract(item.getReduceAmount());
            total=total.add(realPrice.multiply(new BigDecimal(item.getQuantity())));
        }
    }
    return total;
}
 
Example #24
Source File: UmsMemberCouponServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
private BigDecimal calcTotalAmountByProductId(List<CartPromotionItem> cartItemList,List<Long> productIds) {
    BigDecimal total = new BigDecimal("0");
    for (CartPromotionItem item : cartItemList) {
        if(productIds.contains(item.getProductId())){
            BigDecimal realPrice = item.getPrice().subtract(item.getReduceAmount());
            total=total.add(realPrice.multiply(new BigDecimal(item.getQuantity())));
        }
    }
    return total;
}
 
Example #25
Source File: UmsMemberCouponController.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@ApiOperation("获取登录会员购物车的相关优惠券")
@ApiImplicitParam(name = "type", value = "使用可用:0->不可用;1->可用",
        defaultValue = "1", allowableValues = "0,1", paramType = "query", dataType = "integer")
@RequestMapping(value = "/list/cart/{type}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<SmsCouponHistoryDetail>> listCart(@PathVariable Integer type) {
    List<CartPromotionItem> cartPromotionItemList = cartItemService.listPromotion(memberService.getCurrentMember().getId());
    List<SmsCouponHistoryDetail> couponHistoryList = memberCouponService.listCart(cartPromotionItemList, type);
    return CommonResult.success(couponHistoryList);
}
 
Example #26
Source File: OmsCartItemController.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@ApiOperation("获取某个会员的购物车列表,包括促销信息")
@RequestMapping(value = "/list/promotion", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<CartPromotionItem>> listPromotion() {
    List<CartPromotionItem> cartPromotionItemList = cartItemService.listPromotion(memberService.getCurrentMember().getId());
    return CommonResult.success(cartPromotionItemList);
}
 
Example #27
Source File: UmsMemberCouponServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
private BigDecimal calcTotalAmount(List<CartPromotionItem> cartItemList) {
    BigDecimal total = new BigDecimal("0");
    for (CartPromotionItem item : cartItemList) {
        BigDecimal realPrice = item.getPrice().subtract(item.getReduceAmount());
        total=total.add(realPrice.multiply(new BigDecimal(item.getQuantity())));
    }
    return total;
}
 
Example #28
Source File: UmsMemberCouponServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
private BigDecimal calcTotalAmountByproductCategoryId(List<CartPromotionItem> cartItemList,List<Long> productCategoryIds) {
    BigDecimal total = new BigDecimal("0");
    for (CartPromotionItem item : cartItemList) {
        if(productCategoryIds.contains(item.getProductCategoryId())){
            BigDecimal realPrice = item.getPrice().subtract(item.getReduceAmount());
            total=total.add(realPrice.multiply(new BigDecimal(item.getQuantity())));
        }
    }
    return total;
}
 
Example #29
Source File: OmsCartItemService.java    From macrozheng with Apache License 2.0 2 votes vote down vote up
/**
 * 获取包含促销活动信息的购物车列表
 */
List<CartPromotionItem> listPromotion(Long memberId);
 
Example #30
Source File: UmsMemberCouponService.java    From macrozheng with Apache License 2.0 2 votes vote down vote up
/**
 * 根据购物车信息获取可用优惠券
 */
List<SmsCouponHistoryDetail> listCart(List<CartPromotionItem> cartItemList, Integer type);