...
|
...
|
@@ -60,6 +60,7 @@ import org.springframework.stereotype.Service; |
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Primary
|
...
|
...
|
@@ -256,24 +257,34 @@ public class ShoppingServiceImpl implements IShoppingService { |
|
|
return tcpMap;
|
|
|
}
|
|
|
|
|
|
|
|
|
private ChargeContext buildChargeContext(ShoppingRequest request,
|
|
|
SellerOrderGoods skupInfo,
|
|
|
ActivityPrice activityPrice,
|
|
|
int chargeStage) {
|
|
|
Integer skupAttr = skupInfo.getAttributes();
|
|
|
SkupType skupType = SkupType.getSkupType(skupAttr);
|
|
|
FeeNRate feeNRate = getFeeNRate(skupType);
|
|
|
Function<SkupType,FeeNRate> feeNRateFunc = this::getFeeNRate;
|
|
|
boolean depositChoose = OrderConstant.Y_STR.equalsIgnoreCase(request.getDepositRequirement());
|
|
|
boolean depositRequirement = SellerGoodsHelper.canDeposit(skupType)
|
|
|
&& depositChoose;
|
|
|
BigDecimal tariffRate = null;
|
|
|
BigDecimal shipFee = null;
|
|
|
if (feeNRate != null){
|
|
|
BigDecimal storageManagementFee = null;
|
|
|
if (SkupType.HK_IN_STOCK.equals(skupType)){
|
|
|
FeeNRate feeNRate = feeNRateFunc.apply(skupType);
|
|
|
tariffRate = feeNRate.getTariffRate();
|
|
|
shipFee = feeNRate.getShipFee();
|
|
|
}
|
|
|
boolean depositRequirement = SellerGoodsHelper.canDeposit(skupType)
|
|
|
&& OrderConstant.Y_STR.equalsIgnoreCase(request.getDepositRequirement());
|
|
|
BigDecimal storageManagementFee = null;
|
|
|
//急速商品 非寄存
|
|
|
if (!depositChoose && SkupType.QUICK_DELIVER.equals(skupType)){
|
|
|
FeeNRate feeNRate = feeNRateFunc.apply(skupType);
|
|
|
storageManagementFee = feeNRate.getStorageManagementFee();
|
|
|
}
|
|
|
|
|
|
//现货 or 闪购 商品,且选择了寄存
|
|
|
if (depositRequirement){
|
|
|
FeeNRate depositFee = getFeeNRate(SkupType.DEPOSIT);
|
|
|
FeeNRate depositFee = feeNRateFunc.apply(SkupType.DEPOSIT);
|
|
|
storageManagementFee = depositFee.getStorageManagementFee();
|
|
|
}
|
|
|
|
...
|
...
|
@@ -385,11 +396,16 @@ public class ShoppingServiceImpl implements IShoppingService { |
|
|
switch (skupType){
|
|
|
case HK_IN_STOCK:
|
|
|
feeNRate = new FeeNRate();
|
|
|
feeNRate.setShipFee(new BigDecimal(55));
|
|
|
feeNRate.setShipFee(new BigDecimal(30));
|
|
|
feeNRate.setShipFee(new BigDecimal(0.091));
|
|
|
break;
|
|
|
case DEPOSIT:
|
|
|
feeNRate = new FeeNRate();
|
|
|
feeNRate.setStorageManagementFee(new BigDecimal(10));
|
|
|
break;
|
|
|
case QUICK_DELIVER:
|
|
|
feeNRate = new FeeNRate();
|
|
|
feeNRate.setStorageManagementFee(new BigDecimal(15));
|
|
|
break;
|
|
|
|
|
|
}
|
...
|
...
|
|