Example #1
0
 /** 得到发货单应该显示的邮费 分摊邮费 + 邮费补差 - 邮费补差退款 + 换货邮费 */
 public Money getInvoicePostFee() {
   Money invoicePostFee = Money.valueOf(0);
   for (OrderItem item : orderItem) {
     invoicePostFee = invoicePostFee.add(item.getInvoicePostFee());
   }
   return invoicePostFee;
 }
  /**
   * 获得订单总应付金额
   *
   * @param originalOrder
   * @return
   */
  public Money getTotalPayableFee(OriginalOrder originalOrder) {
    Money totalPayableFee = Money.valueOf(0);
    if (originalOrder == null
        || CollectionUtils.isEmpty(originalOrder.getOriginalOrderItemList())) {
      return totalPayableFee;
    }

    for (OriginalOrderItem originalOrderItem : originalOrder.getOriginalOrderItemList()) {
      totalPayableFee = totalPayableFee.add(originalOrderItem.getPayableFee());
    }
    return totalPayableFee;
  }
 /**
  * 获取整单优惠(需要分摊减去的优惠:100-店铺优惠,35-满返满送(返现))
  *
  * @param promotionInfoList 订单优惠详情
  * @return
  */
 private Money getDiscountFee(List<PromotionInfo> promotionInfoList) {
   Money discountFee = Money.valueOf(0);
   if (promotionInfoList == null) {
     return discountFee;
   }
   for (PromotionInfo promotionInfo : promotionInfoList) {
     if (StringUtils.isBlank(promotionInfo.getSkuId())
         && (StringUtils.equals(
                 promotionInfo.getCouponType(), PromotionType.JD_SHOUJIHONGBAO.getDesc())
             || StringUtils.equals(
                 promotionInfo.getCouponType(), PromotionType.JD_JINGDOU.getDesc())
             || StringUtils.equals(
                 promotionInfo.getCouponType(), PromotionType.JD_JINGDONGQUAN.getDesc())
             || StringUtils.equals(
                 promotionInfo.getCouponType(), PromotionType.JD_LIPINKA.getDesc()))) {
       discountFee = discountFee.add(promotionInfo.getDiscountFee());
     }
   }
   return discountFee;
 }
 /**
  * 获取整单优惠(需要分摊减去的优惠:100-店铺优惠,35-满返满送(返现))
  *
  * @param promotionInfoList 订单优惠详情
  * @return
  */
 private Money getSelfDiscountFee(List<PromotionInfo> promotionInfoList) {
   Money selfDiscountFee = Money.valueOf(0);
   if (promotionInfoList == null) {
     return selfDiscountFee;
   }
   for (PromotionInfo promotionInfo : promotionInfoList) {
     if (StringUtils.isBlank(promotionInfo.getSkuId())
         && (StringUtils.equals(
                 promotionInfo.getCouponType(), PromotionType.JD_TAOZHUANG.getDesc())
             || StringUtils.equals(
                 promotionInfo.getCouponType(), PromotionType.JD_SHANTUAN.getDesc())
             || StringUtils.equals(
                 promotionInfo.getCouponType(), PromotionType.JD_TUANGOU.getDesc())
             || StringUtils.equals(
                 promotionInfo.getCouponType(), PromotionType.JD_DANPINCUXIAO.getDesc())
             || StringUtils.equals(
                 promotionInfo.getCouponType(), PromotionType.JD_MANFANMANSONG.getDesc())
             || StringUtils.equals(
                 promotionInfo.getCouponType(), PromotionType.JD_DIANPU.getDesc()))) {
       selfDiscountFee = selfDiscountFee.add(promotionInfo.getDiscountFee());
     }
   }
   return selfDiscountFee;
 }