Authored by mali

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

@@ -8,6 +8,8 @@ import java.util.Map; @@ -8,6 +8,8 @@ import java.util.Map;
8 import javax.servlet.http.HttpServletRequest; 8 import javax.servlet.http.HttpServletRequest;
9 import javax.servlet.http.HttpServletResponse; 9 import javax.servlet.http.HttpServletResponse;
10 10
  11 +import com.yohoufo.order.service.pay.alipay.AlipayCrossBorderService;
  12 +import com.yohoufo.order.service.pay.alipay.AlipayServiceAbstract;
11 import com.yohoufo.order.service.pay.unionpay.JsUnionpayService; 13 import com.yohoufo.order.service.pay.unionpay.JsUnionpayService;
12 import net.sf.oval.constraint.AssertURL; 14 import net.sf.oval.constraint.AssertURL;
13 import org.apache.commons.lang.StringUtils; 15 import org.apache.commons.lang.StringUtils;
@@ -64,6 +66,9 @@ public class PaymentController { @@ -64,6 +66,9 @@ public class PaymentController {
64 AlipayOuyinService alipayService; 66 AlipayOuyinService alipayService;
65 67
66 @Autowired 68 @Autowired
  69 + AlipayCrossBorderService alipayCrossBorderService;
  70 +
  71 + @Autowired
67 JsUnionpayService jsUnionpayService; 72 JsUnionpayService jsUnionpayService;
68 73
69 public static final String RETURN_CODE = "return_code"; 74 public static final String RETURN_CODE = "return_code";
@@ -243,8 +248,17 @@ public class PaymentController { @@ -243,8 +248,17 @@ public class PaymentController {
243 return ; 248 return ;
244 } 249 }
245 250
  251 + AlipayServiceAbstract alipayServiceAbstract;
  252 +
  253 + // 跨境支付宝的回调
  254 + if (params.containsKey("currency")){
  255 + alipayServiceAbstract = alipayCrossBorderService;
  256 + }else{
  257 + alipayServiceAbstract = alipayService;
  258 + }
  259 +
246 //回调验证 260 //回调验证
247 - if(!alipayService.notifyVerify(params)) { 261 + if(!alipayServiceAbstract.notifyVerify(params)) {
248 notifyResponse.setNotifyResult(NotifyResponse.PAYMENT_NOTIFY_RESULT_VERFAIL); 262 notifyResponse.setNotifyResult(NotifyResponse.PAYMENT_NOTIFY_RESULT_VERFAIL);
249 alipayLogger.error("[{}] notification verify failed", out_trade_no); 263 alipayLogger.error("[{}] notification verify failed", out_trade_no);
250 return ; 264 return ;
@@ -252,7 +266,7 @@ public class PaymentController { @@ -252,7 +266,7 @@ public class PaymentController {
252 266
253 PaymentData paymentData = null; 267 PaymentData paymentData = null;
254 try { 268 try {
255 - paymentData = alipayService.getPaymentData(params); 269 + paymentData = alipayServiceAbstract.getPaymentData(params);
256 270
257 alipayLogger.info("method alipayService.getPaymentData is {}", paymentData); 271 alipayLogger.info("method alipayService.getPaymentData is {}", paymentData);
258 272
@@ -412,7 +426,7 @@ public class PaymentController { @@ -412,7 +426,7 @@ public class PaymentController {
412 return false; 426 return false;
413 } 427 }
414 428
415 - if (!trade_status.equals("TRADE_SUCCESS")) { 429 + if (!trade_status.equals("TRADE_SUCCESS") && !trade_status.equals("TRADE_FINISHED")) {
416 logger.info("[{}] trade_status: {}", params.get("out_trade_no"), trade_status); 430 logger.info("[{}] trade_status: {}", params.get("out_trade_no"), trade_status);
417 return false; 431 return false;
418 } 432 }
@@ -114,7 +114,7 @@ public class ShoppingController { @@ -114,7 +114,7 @@ public class ShoppingController {
114 114
115 ShoppingRequest req = ShoppingRequest.builder().uid(uid) 115 ShoppingRequest req = ShoppingRequest.builder().uid(uid)
116 .skup(skup) 116 .skup(skup)
117 - .couponCodes(activityTypeEnum.isCouponFlag() ? CouponCodeUtils.asListDefaultUseAutoRecommended(couponCode) : null) 117 + .couponCodes(activityTypeEnum.isCouponFlag() ? CouponCodeUtils.asList(couponCode) : null)
118 .addressId(addressId) 118 .addressId(addressId)
119 .userActivityId(userActivityId).activityType(activityTypeEnum) 119 .userActivityId(userActivityId).activityType(activityTypeEnum)
120 .appVersion(appVersion) 120 .appVersion(appVersion)
@@ -4,6 +4,7 @@ import com.google.common.collect.Lists; @@ -4,6 +4,7 @@ import com.google.common.collect.Lists;
4 import com.yohobuy.ufo.model.order.bo.PrdPrice; 4 import com.yohobuy.ufo.model.order.bo.PrdPrice;
5 import com.yohobuy.ufo.model.order.bo.SellerBo; 5 import com.yohobuy.ufo.model.order.bo.SellerBo;
6 import com.yohobuy.ufo.model.order.common.OrderStatus; 6 import com.yohobuy.ufo.model.order.common.OrderStatus;
  7 +import com.yohobuy.ufo.model.order.common.Payment;
7 import com.yohobuy.ufo.model.order.common.SellerFuncEnum; 8 import com.yohobuy.ufo.model.order.common.SellerFuncEnum;
8 import com.yohobuy.ufo.model.order.common.SkupStatus; 9 import com.yohobuy.ufo.model.order.common.SkupStatus;
9 import com.yohobuy.ufo.model.order.constants.SkupType; 10 import com.yohobuy.ufo.model.order.constants.SkupType;
@@ -18,19 +19,18 @@ import com.yohoufo.dal.order.model.BuyerOrder; @@ -18,19 +19,18 @@ import com.yohoufo.dal.order.model.BuyerOrder;
18 import com.yohoufo.dal.order.model.BuyerOrderGoods; 19 import com.yohoufo.dal.order.model.BuyerOrderGoods;
19 import com.yohoufo.dal.order.model.SellerOrder; 20 import com.yohoufo.dal.order.model.SellerOrder;
20 import com.yohoufo.dal.order.model.SellerOrderGoods; 21 import com.yohoufo.dal.order.model.SellerOrderGoods;
21 -import com.yohobuy.ufo.model.order.common.Payment;  
22 import com.yohoufo.order.model.dto.ChangePricePrepareDTO; 22 import com.yohoufo.order.model.dto.ChangePricePrepareDTO;
23 import com.yohoufo.order.model.dto.SellerOrderComputeResult; 23 import com.yohoufo.order.model.dto.SellerOrderComputeResult;
24 import com.yohoufo.order.model.dto.SkupDto; 24 import com.yohoufo.order.model.dto.SkupDto;
25 import com.yohoufo.order.model.request.PrdQueryReq; 25 import com.yohoufo.order.model.request.PrdQueryReq;
26 -import com.yohoufo.order.service.seller.setting.SellerService;  
27 import com.yohoufo.order.service.seller.OrderComputeHandler; 26 import com.yohoufo.order.service.seller.OrderComputeHandler;
28 import com.yohoufo.order.service.seller.OrderComputeProvider; 27 import com.yohoufo.order.service.seller.OrderComputeProvider;
29 import com.yohoufo.order.service.seller.SellerAuthCheckService; 28 import com.yohoufo.order.service.seller.SellerAuthCheckService;
  29 +import com.yohoufo.order.service.seller.fee.GoodsAmountService;
30 import com.yohoufo.order.service.seller.processor.ChangePriceCommonPrepareProcessor; 30 import com.yohoufo.order.service.seller.processor.ChangePriceCommonPrepareProcessor;
31 import com.yohoufo.order.service.seller.processor.PriceComputePrepareProcessor; 31 import com.yohoufo.order.service.seller.processor.PriceComputePrepareProcessor;
  32 +import com.yohoufo.order.service.seller.setting.SellerService;
32 import com.yohoufo.order.utils.LoggerUtils; 33 import com.yohoufo.order.utils.LoggerUtils;
33 -import com.yohoufo.order.utils.OrderAssist;  
34 import com.yohoufo.order.utils.SellerGoodsHelper; 34 import com.yohoufo.order.utils.SellerGoodsHelper;
35 import org.apache.commons.collections.CollectionUtils; 35 import org.apache.commons.collections.CollectionUtils;
36 import org.slf4j.Logger; 36 import org.slf4j.Logger;
@@ -74,6 +74,9 @@ public class SingleGoodsChangePricePrepareProcessor { @@ -74,6 +74,9 @@ public class SingleGoodsChangePricePrepareProcessor {
74 @Autowired 74 @Autowired
75 private ChangePriceCommonPrepareProcessor changePriceCommonPrepareProcessor; 75 private ChangePriceCommonPrepareProcessor changePriceCommonPrepareProcessor;
76 76
  77 + @Autowired
  78 + private GoodsAmountService goodsAmountService;
  79 +
77 public void checkGoodsStatus(SellerOrderGoods psog){ 80 public void checkGoodsStatus(SellerOrderGoods psog){
78 if (SkupStatus.CAN_SELL.getCode() != psog.getStatus().intValue()){ 81 if (SkupStatus.CAN_SELL.getCode() != psog.getStatus().intValue()){
79 logger.warn("in SingleGoodsChangePricePrepareProcessor.checkGoodsStatus not can sale, SellerOrderGoods {}", psog); 82 logger.warn("in SingleGoodsChangePricePrepareProcessor.checkGoodsStatus not can sale, SellerOrderGoods {}", psog);
@@ -131,8 +134,7 @@ public class SingleGoodsChangePricePrepareProcessor { @@ -131,8 +134,7 @@ public class SingleGoodsChangePricePrepareProcessor {
131 134
132 String tips = priceComputePrepareProcessor.checkSuggestPrice(prdPrice, salePrice, skupType); 135 String tips = priceComputePrepareProcessor.checkSuggestPrice(prdPrice, salePrice, skupType);
133 // compute every fee from price 136 // compute every fee from price
134 - boolean isImperfect = SellerGoodsHelper.isImperfectGoods(skupType);  
135 - SellerOrderComputeResult pcc = isImperfect ? null : OrderAssist.buildPersonalComputeConfig(prdPrice); 137 + SellerOrderComputeResult pcc = goodsAmountService.getGoodsServiceFeeRate(uid, storageId, prdPrice, skupType);
136 OrderComputeHandler computeHandler = orderComputeProvider.findBySkupType(skupType); 138 OrderComputeHandler computeHandler = orderComputeProvider.findBySkupType(skupType);
137 SellerOrderComputeResult computeResult = computeHandler.compute(salePrice, pcc); 139 SellerOrderComputeResult computeResult = computeHandler.compute(salePrice, pcc);
138 //check income 140 //check income
@@ -9,6 +9,7 @@ import com.yohoufo.order.service.impl.OrderDynamicConfig; @@ -9,6 +9,7 @@ import com.yohoufo.order.service.impl.OrderDynamicConfig;
9 import com.yohoufo.order.service.support.SellerPlatformServiceFeeSupport; 9 import com.yohoufo.order.service.support.SellerPlatformServiceFeeSupport;
10 import com.yohoufo.order.utils.LoggerUtils; 10 import com.yohoufo.order.utils.LoggerUtils;
11 import com.yohoufo.order.utils.OrderAssist; 11 import com.yohoufo.order.utils.OrderAssist;
  12 +import com.yohoufo.order.utils.SellerGoodsHelper;
12 import org.slf4j.Logger; 13 import org.slf4j.Logger;
13 import org.springframework.beans.factory.annotation.Autowired; 14 import org.springframework.beans.factory.annotation.Autowired;
14 import org.springframework.stereotype.Service; 15 import org.springframework.stereotype.Service;
@@ -56,18 +57,22 @@ public class GoodsAmountService { @@ -56,18 +57,22 @@ public class GoodsAmountService {
56 logger.info("in GoodsAmountService.getGoodsServiceFeeRate uid {}, storageId {},prdPrice {} skupType {}", 57 logger.info("in GoodsAmountService.getGoodsServiceFeeRate uid {}, storageId {},prdPrice {} skupType {}",
57 uid, storageId, prdPrice, skupType); 58 uid, storageId, prdPrice, skupType);
58 ServiceFeeRate rate = orderDynamicConfig.getServiceFeeRate(skupType); 59 ServiceFeeRate rate = orderDynamicConfig.getServiceFeeRate(skupType);
  60 + boolean isImperfect = SellerGoodsHelper.isImperfectGoods(skupType);
  61 + //不适用类型:二手
  62 + if (!isImperfect) {
  63 + //skn + uid 指定的费率
  64 + //最高优先级 不仅决定了抽成费率 且决定了其他两项平台费用(鉴定费 包装费)
59 SellerOrderComputeResult highPriority = OrderAssist.buildHighestPriorityConfig(prdPrice, rate); 65 SellerOrderComputeResult highPriority = OrderAssist.buildHighestPriorityConfig(prdPrice, rate);
60 - if (highPriority != null){ 66 + if (highPriority != null) {
61 return highPriority; 67 return highPriority;
62 } 68 }
63 - 69 + }
64 List<GoodsServiceFeeRateWrapper> allConfig = Lists.newArrayListWithCapacity(4); 70 List<GoodsServiceFeeRateWrapper> allConfig = Lists.newArrayListWithCapacity(4);
65 - //build One User One GoodsType 71 + //build One User One GoodsType 卖家不同商品类型的指定费率
66 allConfig.add(buildOneUserOneGoodsType(uid, skupType)); 72 allConfig.add(buildOneUserOneGoodsType(uid, skupType));
67 // build by skn 73 // build by skn
68 allConfig.add(buildWithSkn(prdPrice)); 74 allConfig.add(buildWithSkn(prdPrice));
69 - //build by goods type  
70 - 75 + //build by goods type 不同商品类型指定的费率
71 allConfig.add(buildWithGoodsType(rate)); 76 allConfig.add(buildWithGoodsType(rate));
72 logger.info("in GoodsAmountService.getGoodsServiceFeeRate uid {}, storageId {}, skupType {} prdPrice {} allConfig {}", 77 logger.info("in GoodsAmountService.getGoodsServiceFeeRate uid {}, storageId {}, skupType {} prdPrice {} allConfig {}",
73 uid, storageId, skupType, prdPrice, allConfig); 78 uid, storageId, skupType, prdPrice, allConfig);
@@ -91,10 +96,8 @@ public class GoodsAmountService { @@ -91,10 +96,8 @@ public class GoodsAmountService {
91 } 96 }
92 97
93 public GoodsServiceFeeRateWrapper buildWithGoodsType(ServiceFeeRate rate){ 98 public GoodsServiceFeeRateWrapper buildWithGoodsType(ServiceFeeRate rate){
94 -  
95 -  
96 GoodsServiceFeeRateWrapper gsfrw = new GoodsServiceFeeRateWrapper(); 99 GoodsServiceFeeRateWrapper gsfrw = new GoodsServiceFeeRateWrapper();
97 - gsfrw.setGoodsServiceFeeRateDimension(GoodsServiceFeeRateDimension.ONE_USER_ONE_GOODS_TYPE); 100 + gsfrw.setGoodsServiceFeeRateDimension(GoodsServiceFeeRateDimension.GOODS_TYPE);
98 gsfrw.setGoodsPaymentRate(rate == null ? null : rate.getGoodsPaymentRate()); 101 gsfrw.setGoodsPaymentRate(rate == null ? null : rate.getGoodsPaymentRate());
99 return gsfrw; 102 return gsfrw;
100 } 103 }
@@ -3,10 +3,22 @@ package com.yohoufo.order.service.seller.fee; @@ -3,10 +3,22 @@ package com.yohoufo.order.service.seller.fee;
3 import lombok.Getter; 3 import lombok.Getter;
4 4
5 public enum GoodsServiceFeeRateDimension { 5 public enum GoodsServiceFeeRateDimension {
6 - 6 + /**
  7 + * 不同商品类型对应独自费率
  8 + */
7 GOODS_TYPE(1), 9 GOODS_TYPE(1),
  10 + /**
  11 + * 一个skn 指定若干卖家,每个卖家有独自的费率
  12 + * 目前由合同控制,隶属第一优先级
  13 + */
8 ONE_USER_ONE_SKN(2), 14 ONE_USER_ONE_SKN(2),
  15 + /**
  16 + * 每个卖家指定多个商品类型,每个商品有独立的费率
  17 + */
9 ONE_USER_ONE_GOODS_TYPE(3), 18 ONE_USER_ONE_GOODS_TYPE(3),
  19 + /**
  20 + * skn 维度
  21 + */
10 SKN(4); 22 SKN(4);
11 23
12 @Getter 24 @Getter
@@ -19,11 +19,11 @@ import com.yohoufo.order.model.dto.ChangePricePrepareDTO; @@ -19,11 +19,11 @@ import com.yohoufo.order.model.dto.ChangePricePrepareDTO;
19 import com.yohoufo.order.model.dto.SellerOrderComputeResult; 19 import com.yohoufo.order.model.dto.SellerOrderComputeResult;
20 import com.yohoufo.order.model.dto.SkupDto; 20 import com.yohoufo.order.model.dto.SkupDto;
21 import com.yohoufo.order.model.request.PrdQueryReq; 21 import com.yohoufo.order.model.request.PrdQueryReq;
22 -import com.yohoufo.order.service.seller.setting.SellerService;  
23 import com.yohoufo.order.service.seller.OrderComputeHandler; 22 import com.yohoufo.order.service.seller.OrderComputeHandler;
24 import com.yohoufo.order.service.seller.OrderComputeProvider; 23 import com.yohoufo.order.service.seller.OrderComputeProvider;
  24 +import com.yohoufo.order.service.seller.fee.GoodsAmountService;
  25 +import com.yohoufo.order.service.seller.setting.SellerService;
25 import com.yohoufo.order.utils.LoggerUtils; 26 import com.yohoufo.order.utils.LoggerUtils;
26 -import com.yohoufo.order.utils.OrderAssist;  
27 import com.yohoufo.order.utils.SellerGoodsHelper; 27 import com.yohoufo.order.utils.SellerGoodsHelper;
28 import org.apache.commons.collections.CollectionUtils; 28 import org.apache.commons.collections.CollectionUtils;
29 import org.slf4j.Logger; 29 import org.slf4j.Logger;
@@ -70,6 +70,9 @@ public abstract class AbsEntryChangePricePrepareProcessor<T extends SellerBaseCh @@ -70,6 +70,9 @@ public abstract class AbsEntryChangePricePrepareProcessor<T extends SellerBaseCh
70 @Autowired 70 @Autowired
71 ChangePriceCommonPrepareProcessor changePriceCommonPrepareProcessor; 71 ChangePriceCommonPrepareProcessor changePriceCommonPrepareProcessor;
72 72
  73 + @Autowired
  74 + private GoodsAmountService goodsAmountService;
  75 +
73 76
74 public ChangePricePrepareDTO checkAndAcquire(T req) { 77 public ChangePricePrepareDTO checkAndAcquire(T req) {
75 int uid = req.getUid(); 78 int uid = req.getUid();
@@ -106,7 +109,7 @@ public abstract class AbsEntryChangePricePrepareProcessor<T extends SellerBaseCh @@ -106,7 +109,7 @@ public abstract class AbsEntryChangePricePrepareProcessor<T extends SellerBaseCh
106 prdPrice = priceComputePrepareProcessor.checkPriceRange(pqr, req.isShowPriceError()); 109 prdPrice = priceComputePrepareProcessor.checkPriceRange(pqr, req.isShowPriceError());
107 String tips = priceComputePrepareProcessor.checkSuggestPrice(prdPrice, salePrice, skupType); 110 String tips = priceComputePrepareProcessor.checkSuggestPrice(prdPrice, salePrice, skupType);
108 // compute every fee from price 111 // compute every fee from price
109 - SellerOrderComputeResult pcc = OrderAssist.buildPersonalComputeConfig(prdPrice); 112 + SellerOrderComputeResult pcc = goodsAmountService.getGoodsServiceFeeRate(uid, storageId, prdPrice, skupType);
110 OrderComputeHandler computeHandler = orderComputeProvider.findBySkupType(skupType); 113 OrderComputeHandler computeHandler = orderComputeProvider.findBySkupType(skupType);
111 SellerOrderComputeResult computeResult = computeHandler.compute(salePrice, pcc); 114 SellerOrderComputeResult computeResult = computeHandler.compute(salePrice, pcc);
112 int num = skupMap.size(); 115 int num = skupMap.size();
@@ -11,12 +11,12 @@ import com.yohoufo.common.exception.UfoServiceException; @@ -11,12 +11,12 @@ import com.yohoufo.common.exception.UfoServiceException;
11 import com.yohoufo.order.model.SellerOrderContext; 11 import com.yohoufo.order.model.SellerOrderContext;
12 import com.yohoufo.order.model.dto.ImPrdNode; 12 import com.yohoufo.order.model.dto.ImPrdNode;
13 import com.yohoufo.order.model.dto.SellerOrderComputeResult; 13 import com.yohoufo.order.model.dto.SellerOrderComputeResult;
14 -import com.yohoufo.order.service.seller.SkupService;  
15 import com.yohoufo.order.service.seller.OrderComputeHandler; 14 import com.yohoufo.order.service.seller.OrderComputeHandler;
16 import com.yohoufo.order.service.seller.OrderComputeProvider; 15 import com.yohoufo.order.service.seller.OrderComputeProvider;
17 import com.yohoufo.order.service.seller.PublishProcessor; 16 import com.yohoufo.order.service.seller.PublishProcessor;
  17 +import com.yohoufo.order.service.seller.SkupService;
  18 +import com.yohoufo.order.service.seller.fee.GoodsAmountService;
18 import com.yohoufo.order.utils.LoggerUtils; 19 import com.yohoufo.order.utils.LoggerUtils;
19 -import com.yohoufo.order.utils.OrderAssist;  
20 import org.slf4j.Logger; 20 import org.slf4j.Logger;
21 import org.springframework.beans.factory.annotation.Autowired; 21 import org.springframework.beans.factory.annotation.Autowired;
22 import org.springframework.stereotype.Service; 22 import org.springframework.stereotype.Service;
@@ -41,6 +41,9 @@ public class ImportPublishProcessor @@ -41,6 +41,9 @@ public class ImportPublishProcessor
41 @Autowired 41 @Autowired
42 private SkupService skupService; 42 private SkupService skupService;
43 43
  44 + @Autowired
  45 + private GoodsAmountService goodsAmountService;
  46 +
44 47
45 @Override 48 @Override
46 public SellerOrderContext buildPublishCtx(ImPrdNode node) { 49 public SellerOrderContext buildPublishCtx(ImPrdNode node) {
@@ -135,7 +138,7 @@ public class ImportPublishProcessor @@ -135,7 +138,7 @@ public class ImportPublishProcessor
135 PrdPrice prdPrice = new PrdPrice(); 138 PrdPrice prdPrice = new PrdPrice();
136 prdPrice.setCanPublish(true); 139 prdPrice.setCanPublish(true);
137 prdPrice.setGoodsPaymentRate(goodsPaymentRate); 140 prdPrice.setGoodsPaymentRate(goodsPaymentRate);
138 - SellerOrderComputeResult pcc = OrderAssist.buildPersonalComputeConfig(prdPrice); 141 + SellerOrderComputeResult pcc = goodsAmountService.getGoodsServiceFeeRate(uid, storageId, prdPrice, skupType);
139 OrderComputeHandler computeHandler = orderComputeProvider.findBySkupType(skupType); 142 OrderComputeHandler computeHandler = orderComputeProvider.findBySkupType(skupType);
140 SellerOrderComputeResult computeResult = computeHandler.compute(goodsInfo.getPrice(), pcc); 143 SellerOrderComputeResult computeResult = computeHandler.compute(goodsInfo.getPrice(), pcc);
141 logger.info("in buildImportPrdCxt , uid {}, storageId {}, price {}, computeResult {}", uid, storageId, 144 logger.info("in buildImportPrdCxt , uid {}, storageId {}, price {}, computeResult {}", uid, storageId,
@@ -12,19 +12,19 @@ import com.yohoufo.common.exception.UfoServiceException; @@ -12,19 +12,19 @@ import com.yohoufo.common.exception.UfoServiceException;
12 import com.yohoufo.common.utils.BigDecimalHelper; 12 import com.yohoufo.common.utils.BigDecimalHelper;
13 import com.yohoufo.order.model.dto.SellerOrderComputeResult; 13 import com.yohoufo.order.model.dto.SellerOrderComputeResult;
14 import com.yohoufo.order.model.request.PrdQueryReq; 14 import com.yohoufo.order.model.request.PrdQueryReq;
15 -import com.yohoufo.order.service.seller.SellerOrderRiskWatchDog;  
16 -import com.yohoufo.order.service.seller.setting.SellerService;  
17 import com.yohoufo.order.service.proxy.ProductProxyService; 15 import com.yohoufo.order.service.proxy.ProductProxyService;
18 import com.yohoufo.order.service.seller.OrderComputeHandler; 16 import com.yohoufo.order.service.seller.OrderComputeHandler;
19 import com.yohoufo.order.service.seller.OrderComputeProvider; 17 import com.yohoufo.order.service.seller.OrderComputeProvider;
20 import com.yohoufo.order.service.seller.SellerAuthCheckService; 18 import com.yohoufo.order.service.seller.SellerAuthCheckService;
  19 +import com.yohoufo.order.service.seller.SellerOrderRiskWatchDog;
  20 +import com.yohoufo.order.service.seller.fee.GoodsAmountService;
  21 +import com.yohoufo.order.service.seller.setting.SellerService;
21 import com.yohoufo.order.utils.LoggerUtils; 22 import com.yohoufo.order.utils.LoggerUtils;
22 -import com.yohoufo.order.utils.OrderAssist;  
23 import com.yohoufo.order.utils.SellerGoodsHelper; 23 import com.yohoufo.order.utils.SellerGoodsHelper;
24 import lombok.AllArgsConstructor; 24 import lombok.AllArgsConstructor;
  25 +import lombok.Builder;
25 import lombok.Data; 26 import lombok.Data;
26 import lombok.NoArgsConstructor; 27 import lombok.NoArgsConstructor;
27 -import lombok.Builder;  
28 import org.apache.commons.lang3.StringUtils; 28 import org.apache.commons.lang3.StringUtils;
29 import org.slf4j.Logger; 29 import org.slf4j.Logger;
30 import org.springframework.beans.factory.annotation.Autowired; 30 import org.springframework.beans.factory.annotation.Autowired;
@@ -58,6 +58,8 @@ public class PriceComputePrepareProcessor { @@ -58,6 +58,8 @@ public class PriceComputePrepareProcessor {
58 @Autowired 58 @Autowired
59 private SellerOrderRiskWatchDog sellerOrderRiskWatchDog; 59 private SellerOrderRiskWatchDog sellerOrderRiskWatchDog;
60 60
  61 + @Autowired
  62 + private GoodsAmountService goodsAmountService;
61 63
62 @Data 64 @Data
63 @Builder 65 @Builder
@@ -151,7 +153,7 @@ public class PriceComputePrepareProcessor { @@ -151,7 +153,7 @@ public class PriceComputePrepareProcessor {
151 //check suggest price 153 //check suggest price
152 String tips = checkSuggestPrice(prdPrice, salePrice, skupType); 154 String tips = checkSuggestPrice(prdPrice, salePrice, skupType);
153 //calculate fee 155 //calculate fee
154 - SellerOrderComputeResult pcc = isImperfect ? null : OrderAssist.buildPersonalComputeConfig(prdPrice); 156 + SellerOrderComputeResult pcc = goodsAmountService.getGoodsServiceFeeRate(uid, storageId, prdPrice, skupType);
155 OrderComputeHandler computeHandler = orderComputeProvider.findBySkupType(skupType); 157 OrderComputeHandler computeHandler = orderComputeProvider.findBySkupType(skupType);
156 SellerOrderComputeResult computeResult = computeHandler.compute(salePrice, pcc); 158 SellerOrderComputeResult computeResult = computeHandler.compute(salePrice, pcc);
157 //check seller type and wallet 159 //check seller type and wallet
@@ -13,11 +13,11 @@ import com.yohoufo.common.utils.AddressUtil; @@ -13,11 +13,11 @@ import com.yohoufo.common.utils.AddressUtil;
13 import com.yohoufo.order.model.SellerOrderContext; 13 import com.yohoufo.order.model.SellerOrderContext;
14 import com.yohoufo.order.model.dto.SellerOrderComputeResult; 14 import com.yohoufo.order.model.dto.SellerOrderComputeResult;
15 import com.yohoufo.order.model.request.PrdQueryReq; 15 import com.yohoufo.order.model.request.PrdQueryReq;
16 -import com.yohoufo.order.service.seller.*;  
17 import com.yohoufo.order.service.proxy.UserProxyService; 16 import com.yohoufo.order.service.proxy.UserProxyService;
  17 +import com.yohoufo.order.service.seller.*;
  18 +import com.yohoufo.order.service.seller.fee.GoodsAmountService;
18 import com.yohoufo.order.utils.AddressHelper; 19 import com.yohoufo.order.utils.AddressHelper;
19 import com.yohoufo.order.utils.LoggerUtils; 20 import com.yohoufo.order.utils.LoggerUtils;
20 -import com.yohoufo.order.utils.OrderAssist;  
21 import org.slf4j.Logger; 21 import org.slf4j.Logger;
22 import org.springframework.beans.factory.annotation.Autowired; 22 import org.springframework.beans.factory.annotation.Autowired;
23 import org.springframework.stereotype.Service; 23 import org.springframework.stereotype.Service;
@@ -49,6 +49,9 @@ public class SellerOrderPrepareProcessor @@ -49,6 +49,9 @@ public class SellerOrderPrepareProcessor
49 @Autowired 49 @Autowired
50 private SellerOrderRiskWatchDog sellerOrderRiskWatchDog; 50 private SellerOrderRiskWatchDog sellerOrderRiskWatchDog;
51 51
  52 + @Autowired
  53 + private GoodsAmountService goodsAmountService;
  54 +
52 private SellerOrderContext buildPublishPrdCtx(SellerOrderSubmitReq req) { 55 private SellerOrderContext buildPublishPrdCtx(SellerOrderSubmitReq req) {
53 SellerOrderContext ctx = buildSellerOrderContext(req); 56 SellerOrderContext ctx = buildSellerOrderContext(req);
54 int uid = ctx.getUid(); 57 int uid = ctx.getUid();
@@ -141,7 +144,7 @@ public class SellerOrderPrepareProcessor @@ -141,7 +144,7 @@ public class SellerOrderPrepareProcessor
141 } 144 }
142 145
143 // compute every fee from price 146 // compute every fee from price
144 - SellerOrderComputeResult pcc = OrderAssist.buildPersonalComputeConfig(prdPrice); 147 + SellerOrderComputeResult pcc = goodsAmountService.getGoodsServiceFeeRate(uid, storageId, prdPrice, skupType);
145 OrderComputeHandler computeHandler = orderComputeProvider.findBySkupType(skupType); 148 OrderComputeHandler computeHandler = orderComputeProvider.findBySkupType(skupType);
146 SellerOrderComputeResult computeResult = computeHandler.compute(goodsInfo.getPrice(), pcc); 149 SellerOrderComputeResult computeResult = computeHandler.compute(goodsInfo.getPrice(), pcc);
147 priceComputePrepareProcessor.checkIncome(storageId, computeResult.getIncome()); 150 priceComputePrepareProcessor.checkIncome(storageId, computeResult.getIncome());
@@ -81,12 +81,16 @@ public class OrderAssist { @@ -81,12 +81,16 @@ public class OrderAssist {
81 } 81 }
82 82
83 public static SellerOrderComputeResult buildHighestPriorityConfig(PrdPrice prdPrice, ServiceFeeRate serviceFeeRate){ 83 public static SellerOrderComputeResult buildHighestPriorityConfig(PrdPrice prdPrice, ServiceFeeRate serviceFeeRate){
84 - SellerOrderComputeResult socr = new SellerOrderComputeResult(); 84 + SellerOrderComputeResult socr = null;
85 PlatformFeeDto platformFee; 85 PlatformFeeDto platformFee;
86 BigDecimal goodsPaymentRate; 86 BigDecimal goodsPaymentRate;
87 - if (Objects.nonNull(prdPrice) && Objects.nonNull(goodsPaymentRate = prdPrice.getGoodsPaymentRate())){ 87 + if (Objects.nonNull(prdPrice)
  88 + && Objects.nonNull(goodsPaymentRate = prdPrice.getGoodsPaymentRate())){
  89 + socr = new SellerOrderComputeResult();
88 // 90 //
89 serviceFeeRate.setGoodsPaymentRate(goodsPaymentRate); 91 serviceFeeRate.setGoodsPaymentRate(goodsPaymentRate);
  92 + //
  93 + socr.setServiceFeeRate(serviceFeeRate);
90 //如果基础商品已经设置了抽成比率,则鉴定费和包装费免除 94 //如果基础商品已经设置了抽成比率,则鉴定费和包装费免除
91 platformFee = new PlatformFeeDto(); 95 platformFee = new PlatformFeeDto();
92 platformFee.setAppraiseFee(new BigDecimal(0)); 96 platformFee.setAppraiseFee(new BigDecimal(0));
@@ -94,7 +98,7 @@ public class OrderAssist { @@ -94,7 +98,7 @@ public class OrderAssist {
94 // 98 //
95 socr.setPlatformFee(platformFee); 99 socr.setPlatformFee(platformFee);
96 } 100 }
97 - socr.setServiceFeeRate(serviceFeeRate); 101 +
98 return socr; 102 return socr;
99 } 103 }
100 104