Authored by 匡佳华

下单页展示现货/闪购/极速寄存增加开关控制

... ... @@ -71,7 +71,7 @@ public class ShoppingRiskWatchDog {
logger.warn("checkOverseaOrderUserInfo: need realName cert, uid is {}", uid);
throw new UfoServiceException(ClientSpecialSemanticCode.needRealName, "请完成实名认证后操作");
}
//(3) 校验收件人姓名是否和实名认证的姓名一致
//(3) 校验收件人姓名是否和实名认证的姓名一致
String buyerName = zhimaCert.getCertName();
String receiverName = addressInfo.getConsignee();
if(!buyerName.equals(receiverName)){
... ...
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;
}
}
... ...
... ... @@ -80,6 +80,7 @@ public final class SellerGoodsHelper {
switch (skupType){
case IN_STOCK:
case QUICK_DELIVER:
case FAST_DELIVERY:
result = true;
break;
default: result = false;
... ...