|
|
package com.yohoufo.order.service.support;
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.yoho.core.config.ConfigReader;
|
|
|
import com.yohobuy.ufo.model.order.common.OrderAttributes;
|
|
|
import com.yohobuy.ufo.model.order.constants.DeliveryWayEnum;
|
|
|
import com.yohobuy.ufo.model.order.constants.OrderConstant;
|
...
|
...
|
@@ -15,6 +16,7 @@ import com.yohoufo.order.utils.MathUtils; |
|
|
import com.yohoufo.order.utils.OrderDetailDescHelper;
|
|
|
import com.yohoufo.order.utils.SellerGoodsHelper;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
...
|
...
|
@@ -24,6 +26,10 @@ import java.util.Objects; |
|
|
@Service
|
|
|
public class ShoppingSupport {
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
private ConfigReader configReader;
|
|
|
|
|
|
/**
|
|
|
* 支付方式
|
|
|
* @return
|
...
|
...
|
@@ -273,10 +279,27 @@ public class ShoppingSupport { |
|
|
|
|
|
public DepositResp getDepositResp(SkupType skupType){
|
|
|
DepositResp depositResp = null;
|
|
|
if(SellerGoodsHelper.canDeposit(skupType)){
|
|
|
//若订单类型支持寄存,且开关已打开,则页面展示寄存
|
|
|
if(SellerGoodsHelper.canDeposit(skupType) && isDepositSwitchOpen(skupType)){
|
|
|
SkupType target = SellerGoodsHelper.getTargetSkupType4DepositOrder(OrderAttributes.DEPOSITE.getCode(), skupType);
|
|
|
depositResp = DepositResp.builder().desc(OrderDetailDescHelper.getPaymentDepositDesc(target)).depositable(OrderConstant.Y_STR).build();
|
|
|
}
|
|
|
return depositResp;
|
|
|
}
|
|
|
|
|
|
|
|
|
private boolean isDepositSwitchOpen(SkupType skupType){
|
|
|
boolean depositSwitchStatus ;
|
|
|
switch (skupType){
|
|
|
case IN_STOCK://现货寄存
|
|
|
depositSwitchStatus = configReader.getBoolean("ufo.order.deposit.inStock.switch", false);break;
|
|
|
case QUICK_DELIVER://闪购寄存
|
|
|
depositSwitchStatus = configReader.getBoolean("ufo.order.deposit.quickDeliver.switch", false);break;
|
|
|
case FAST_DELIVERY://极速寄存
|
|
|
depositSwitchStatus = configReader.getBoolean("ufo.order.deposit.fastDeliver.switch", false);break;
|
|
|
default:
|
|
|
depositSwitchStatus = false;
|
|
|
}
|
|
|
return depositSwitchStatus;
|
|
|
}
|
|
|
} |
...
|
...
|
|