Authored by Lixiaodi

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

@@ -74,6 +74,7 @@ public class ShoppingController { @@ -74,6 +74,7 @@ public class ShoppingController {
74 @RequestMapping(params = "method=ufo.order.selectCoupon") 74 @RequestMapping(params = "method=ufo.order.selectCoupon")
75 public ApiResponse selectCoupon(@RequestParam(name = "uid") int uid, 75 public ApiResponse selectCoupon(@RequestParam(name = "uid") int uid,
76 @RequestParam(name = "skup") int skup, 76 @RequestParam(name = "skup") int skup,
  77 + @RequestParam(name = "addressId", required = false) String addressId,
77 @RequestParam(name = "coupon_code",required = false) String couponCode, 78 @RequestParam(name = "coupon_code",required = false) String couponCode,
78 @RequestParam(name="depositRequirement", required = false, defaultValue = OrderConstant.N_STR)String depositRequirement) { 79 @RequestParam(name="depositRequirement", required = false, defaultValue = OrderConstant.N_STR)String depositRequirement) {
79 //活动类型 80 //活动类型
@@ -84,6 +85,7 @@ public class ShoppingController { @@ -84,6 +85,7 @@ public class ShoppingController {
84 .couponCodes(activityTypeEnum.isCouponFlag() ? CouponCodeUtils.asList(couponCode) : null) 85 .couponCodes(activityTypeEnum.isCouponFlag() ? CouponCodeUtils.asList(couponCode) : null)
85 .userActivityId(0).activityType(activityTypeEnum) 86 .userActivityId(0).activityType(activityTypeEnum)
86 .depositRequirement(depositRequirement) 87 .depositRequirement(depositRequirement)
  88 + .addressId(addressId)
87 .build(); 89 .build();
88 logger.info("in ufo.order.selectCoupon, req {}", req); 90 logger.info("in ufo.order.selectCoupon, req {}", req);
89 ShoppingCouponListResp resp = buyerOrderService.selectCoupon(req); 91 ShoppingCouponListResp resp = buyerOrderService.selectCoupon(req);
@@ -342,7 +342,10 @@ public class ShoppingServiceImpl implements IShoppingService { @@ -342,7 +342,10 @@ public class ShoppingServiceImpl implements IShoppingService {
342 342
343 //构建算费 343 //构建算费
344 ChargeContext chargeContext = buildChargeContext(request, skupGood, activityPrice, ChargeParam.SELECT_COUPON); 344 ChargeContext chargeContext = buildChargeContext(request, skupGood, activityPrice, ChargeParam.SELECT_COUPON);
345 - 345 + if (StringUtils.isNoneBlank(request.getAddressId())){
  346 + Pair<AddressInfo, AddressInfo> addressInfoPair = getAndCheckAddressInfo(request);
  347 + chargeContext.setUserAddressPair(addressInfoPair);
  348 + }
346 //算费 349 //算费
347 chargeService.charge(chargeContext); 350 chargeService.charge(chargeContext);
348 351