Merge branch 'dev-promotion' of http://git.yoho.cn/ufo/yohoufo-fore into dev-promotion
Showing
4 changed files
with
22 additions
and
17 deletions
@@ -78,5 +78,9 @@ | @@ -78,5 +78,9 @@ | ||
78 | <groupId>com.yoho.ufo.model</groupId> | 78 | <groupId>com.yoho.ufo.model</groupId> |
79 | <artifactId>promotion-ufo-model</artifactId> | 79 | <artifactId>promotion-ufo-model</artifactId> |
80 | </dependency> | 80 | </dependency> |
81 | + <dependency> | ||
82 | + <groupId>com.yoho.core</groupId> | ||
83 | + <artifactId>yoho-core-transaction</artifactId> | ||
84 | + </dependency> | ||
81 | </dependencies> | 85 | </dependencies> |
82 | </project> | 86 | </project> |
@@ -210,7 +210,7 @@ public class ShoppingServiceImpl implements IShoppingService { | @@ -210,7 +210,7 @@ public class ShoppingServiceImpl implements IShoppingService { | ||
210 | ChargeResult chargeResult = chargeContext.getChargeResult(); | 210 | ChargeResult chargeResult = chargeContext.getChargeResult(); |
211 | 211 | ||
212 | ComputeResponse response = new ComputeResponse(); | 212 | ComputeResponse response = new ComputeResponse(); |
213 | - response.setCouponInfo(shoppingSupport.getCouponInfo(chargeResult)); | 213 | + response.setCouponInfo(couponSupport.getCouponInfo(chargeResult)); |
214 | response.setPromotionFormulaList(shoppingSupport.getPromotionFormula(chargeResult)); | 214 | response.setPromotionFormulaList(shoppingSupport.getPromotionFormula(chargeResult)); |
215 | response.setAmount(MathUtils.formatStr(chargeResult.getFinalAmount())); | 215 | response.setAmount(MathUtils.formatStr(chargeResult.getFinalAmount())); |
216 | 216 |
@@ -3,7 +3,10 @@ package com.yohoufo.order.service.support; | @@ -3,7 +3,10 @@ package com.yohoufo.order.service.support; | ||
3 | import com.google.common.collect.Lists; | 3 | import com.google.common.collect.Lists; |
4 | import com.yohobuy.ufo.model.order.constants.OrderConstant; | 4 | import com.yohobuy.ufo.model.order.constants.OrderConstant; |
5 | import com.yohobuy.ufo.model.promotion.UserCouponsBo; | 5 | import com.yohobuy.ufo.model.promotion.UserCouponsBo; |
6 | +import com.yohoufo.order.charge.model.ChargeResult; | ||
6 | import com.yohoufo.order.charge.model.CouponMatchResult; | 7 | import com.yohoufo.order.charge.model.CouponMatchResult; |
8 | +import com.yohoufo.order.charge.model.CouponPayResult; | ||
9 | +import com.yohoufo.order.model.response.CouponInfo; | ||
7 | import com.yohoufo.order.model.response.ShoppingCoupon; | 10 | import com.yohoufo.order.model.response.ShoppingCoupon; |
8 | import com.yohoufo.order.utils.DateUtil; | 11 | import com.yohoufo.order.utils.DateUtil; |
9 | import com.yohoufo.order.utils.MathUtils; | 12 | import com.yohoufo.order.utils.MathUtils; |
@@ -48,4 +51,18 @@ public class CouponSupport { | @@ -48,4 +51,18 @@ public class CouponSupport { | ||
48 | 51 | ||
49 | return result; | 52 | return result; |
50 | } | 53 | } |
54 | + | ||
55 | + /** | ||
56 | + * 使用的优惠券信息 | ||
57 | + * @param chargeResult | ||
58 | + * @return | ||
59 | + */ | ||
60 | + public CouponInfo getCouponInfo(ChargeResult chargeResult) { | ||
61 | + CouponPayResult couponPayResult = chargeResult.getCouponPayResult(); | ||
62 | + return CouponInfo.builder().couponCode(couponPayResult.getCouponCode()) | ||
63 | + .couponTitle(couponPayResult.getCouponTitle()) | ||
64 | + .couponAmountStr(MathUtils.formatCurrencyStr(couponPayResult.getCouponAmount())) | ||
65 | + .couponCount(couponPayResult.getCouponCount()) | ||
66 | + .build(); | ||
67 | + } | ||
51 | } | 68 | } |
@@ -6,7 +6,6 @@ import com.yohoufo.dal.order.model.SellerOrderGoods; | @@ -6,7 +6,6 @@ import com.yohoufo.dal.order.model.SellerOrderGoods; | ||
6 | import com.yohobuy.ufo.model.order.constants.OrderConstant; | 6 | import com.yohobuy.ufo.model.order.constants.OrderConstant; |
7 | import com.yohoufo.order.charge.model.ChargeResult; | 7 | import com.yohoufo.order.charge.model.ChargeResult; |
8 | import com.yohoufo.order.charge.model.CouponPayResult; | 8 | import com.yohoufo.order.charge.model.CouponPayResult; |
9 | -import com.yohoufo.order.model.response.CouponInfo; | ||
10 | import com.yohoufo.order.model.response.GoodsInfo; | 9 | import com.yohoufo.order.model.response.GoodsInfo; |
11 | import com.yohoufo.order.model.response.PaymentResponse; | 10 | import com.yohoufo.order.model.response.PaymentResponse; |
12 | import com.yohoufo.order.model.response.PromotionFormula; | 11 | import com.yohoufo.order.model.response.PromotionFormula; |
@@ -15,7 +14,6 @@ import org.springframework.beans.factory.annotation.Value; | @@ -15,7 +14,6 @@ import org.springframework.beans.factory.annotation.Value; | ||
15 | import org.springframework.stereotype.Service; | 14 | import org.springframework.stereotype.Service; |
16 | 15 | ||
17 | import java.math.BigDecimal; | 16 | import java.math.BigDecimal; |
18 | -import java.util.Arrays; | ||
19 | import java.util.List; | 17 | import java.util.List; |
20 | 18 | ||
21 | @Service | 19 | @Service |
@@ -129,18 +127,4 @@ public class ShoppingSupport { | @@ -129,18 +127,4 @@ public class ShoppingSupport { | ||
129 | return damagesDesc.toString(); | 127 | return damagesDesc.toString(); |
130 | 128 | ||
131 | } | 129 | } |
132 | - | ||
133 | - /** | ||
134 | - * 使用的优惠券信息 | ||
135 | - * @param chargeResult | ||
136 | - * @return | ||
137 | - */ | ||
138 | - public CouponInfo getCouponInfo(ChargeResult chargeResult) { | ||
139 | - CouponPayResult couponPayResult = chargeResult.getCouponPayResult(); | ||
140 | - return CouponInfo.builder().couponCode(couponPayResult.getCouponCode()) | ||
141 | - .couponTitle(couponPayResult.getCouponTitle()) | ||
142 | - .couponAmountStr(MathUtils.formatCurrencyStr(couponPayResult.getCouponAmount())) | ||
143 | - .couponCount(couponPayResult.getCouponCount()) | ||
144 | - .build(); | ||
145 | - } | ||
146 | } | 130 | } |
-
Please register or login to post a comment