Authored by tanling

Merge branch 'dev-promotion' of http://git.yoho.cn/ufo/yohoufo-fore into dev-promotion

... ... @@ -78,5 +78,9 @@
<groupId>com.yoho.ufo.model</groupId>
<artifactId>promotion-ufo-model</artifactId>
</dependency>
<dependency>
<groupId>com.yoho.core</groupId>
<artifactId>yoho-core-transaction</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
... ...
... ... @@ -210,7 +210,7 @@ public class ShoppingServiceImpl implements IShoppingService {
ChargeResult chargeResult = chargeContext.getChargeResult();
ComputeResponse response = new ComputeResponse();
response.setCouponInfo(shoppingSupport.getCouponInfo(chargeResult));
response.setCouponInfo(couponSupport.getCouponInfo(chargeResult));
response.setPromotionFormulaList(shoppingSupport.getPromotionFormula(chargeResult));
response.setAmount(MathUtils.formatStr(chargeResult.getFinalAmount()));
... ...
... ... @@ -3,7 +3,10 @@ package com.yohoufo.order.service.support;
import com.google.common.collect.Lists;
import com.yohobuy.ufo.model.order.constants.OrderConstant;
import com.yohobuy.ufo.model.promotion.UserCouponsBo;
import com.yohoufo.order.charge.model.ChargeResult;
import com.yohoufo.order.charge.model.CouponMatchResult;
import com.yohoufo.order.charge.model.CouponPayResult;
import com.yohoufo.order.model.response.CouponInfo;
import com.yohoufo.order.model.response.ShoppingCoupon;
import com.yohoufo.order.utils.DateUtil;
import com.yohoufo.order.utils.MathUtils;
... ... @@ -48,4 +51,18 @@ public class CouponSupport {
return result;
}
/**
* 使用的优惠券信息
* @param chargeResult
* @return
*/
public CouponInfo getCouponInfo(ChargeResult chargeResult) {
CouponPayResult couponPayResult = chargeResult.getCouponPayResult();
return CouponInfo.builder().couponCode(couponPayResult.getCouponCode())
.couponTitle(couponPayResult.getCouponTitle())
.couponAmountStr(MathUtils.formatCurrencyStr(couponPayResult.getCouponAmount()))
.couponCount(couponPayResult.getCouponCount())
.build();
}
}
... ...
... ... @@ -6,7 +6,6 @@ import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohobuy.ufo.model.order.constants.OrderConstant;
import com.yohoufo.order.charge.model.ChargeResult;
import com.yohoufo.order.charge.model.CouponPayResult;
import com.yohoufo.order.model.response.CouponInfo;
import com.yohoufo.order.model.response.GoodsInfo;
import com.yohoufo.order.model.response.PaymentResponse;
import com.yohoufo.order.model.response.PromotionFormula;
... ... @@ -15,7 +14,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
@Service
... ... @@ -129,18 +127,4 @@ public class ShoppingSupport {
return damagesDesc.toString();
}
/**
* 使用的优惠券信息
* @param chargeResult
* @return
*/
public CouponInfo getCouponInfo(ChargeResult chargeResult) {
CouponPayResult couponPayResult = chargeResult.getCouponPayResult();
return CouponInfo.builder().couponCode(couponPayResult.getCouponCode())
.couponTitle(couponPayResult.getCouponTitle())
.couponAmountStr(MathUtils.formatCurrencyStr(couponPayResult.getCouponAmount()))
.couponCount(couponPayResult.getCouponCount())
.build();
}
}
... ...