Authored by 匡佳华

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

@@ -71,7 +71,7 @@ public class ShoppingRiskWatchDog { @@ -71,7 +71,7 @@ public class ShoppingRiskWatchDog {
71 logger.warn("checkOverseaOrderUserInfo: need realName cert, uid is {}", uid); 71 logger.warn("checkOverseaOrderUserInfo: need realName cert, uid is {}", uid);
72 throw new UfoServiceException(ClientSpecialSemanticCode.needRealName, "请完成实名认证后操作"); 72 throw new UfoServiceException(ClientSpecialSemanticCode.needRealName, "请完成实名认证后操作");
73 } 73 }
74 - //(3) 校验收件人姓名是否和实名认证的姓名一致 74 + //(3) 校验收件人姓名是否和实名认证的姓名一致
75 String buyerName = zhimaCert.getCertName(); 75 String buyerName = zhimaCert.getCertName();
76 String receiverName = addressInfo.getConsignee(); 76 String receiverName = addressInfo.getConsignee();
77 if(!buyerName.equals(receiverName)){ 77 if(!buyerName.equals(receiverName)){
1 package com.yohoufo.order.service.support; 1 package com.yohoufo.order.service.support;
2 2
3 import com.google.common.collect.Lists; 3 import com.google.common.collect.Lists;
  4 +import com.yoho.core.config.ConfigReader;
4 import com.yohobuy.ufo.model.order.common.OrderAttributes; 5 import com.yohobuy.ufo.model.order.common.OrderAttributes;
5 import com.yohobuy.ufo.model.order.constants.DeliveryWayEnum; 6 import com.yohobuy.ufo.model.order.constants.DeliveryWayEnum;
6 import com.yohobuy.ufo.model.order.constants.OrderConstant; 7 import com.yohobuy.ufo.model.order.constants.OrderConstant;
@@ -15,6 +16,7 @@ import com.yohoufo.order.utils.MathUtils; @@ -15,6 +16,7 @@ import com.yohoufo.order.utils.MathUtils;
15 import com.yohoufo.order.utils.OrderDetailDescHelper; 16 import com.yohoufo.order.utils.OrderDetailDescHelper;
16 import com.yohoufo.order.utils.SellerGoodsHelper; 17 import com.yohoufo.order.utils.SellerGoodsHelper;
17 import org.apache.commons.lang3.StringUtils; 18 import org.apache.commons.lang3.StringUtils;
  19 +import org.springframework.beans.factory.annotation.Autowired;
18 import org.springframework.stereotype.Service; 20 import org.springframework.stereotype.Service;
19 21
20 import java.math.BigDecimal; 22 import java.math.BigDecimal;
@@ -24,6 +26,10 @@ import java.util.Objects; @@ -24,6 +26,10 @@ import java.util.Objects;
24 @Service 26 @Service
25 public class ShoppingSupport { 27 public class ShoppingSupport {
26 28
  29 +
  30 + @Autowired
  31 + private ConfigReader configReader;
  32 +
27 /** 33 /**
28 * 支付方式 34 * 支付方式
29 * @return 35 * @return
@@ -273,10 +279,27 @@ public class ShoppingSupport { @@ -273,10 +279,27 @@ public class ShoppingSupport {
273 279
274 public DepositResp getDepositResp(SkupType skupType){ 280 public DepositResp getDepositResp(SkupType skupType){
275 DepositResp depositResp = null; 281 DepositResp depositResp = null;
276 - if(SellerGoodsHelper.canDeposit(skupType)){ 282 + //若订单类型支持寄存,且开关已打开,则页面展示寄存
  283 + if(SellerGoodsHelper.canDeposit(skupType) && isDepositSwitchOpen(skupType)){
277 SkupType target = SellerGoodsHelper.getTargetSkupType4DepositOrder(OrderAttributes.DEPOSITE.getCode(), skupType); 284 SkupType target = SellerGoodsHelper.getTargetSkupType4DepositOrder(OrderAttributes.DEPOSITE.getCode(), skupType);
278 depositResp = DepositResp.builder().desc(OrderDetailDescHelper.getPaymentDepositDesc(target)).depositable(OrderConstant.Y_STR).build(); 285 depositResp = DepositResp.builder().desc(OrderDetailDescHelper.getPaymentDepositDesc(target)).depositable(OrderConstant.Y_STR).build();
279 } 286 }
280 return depositResp; 287 return depositResp;
281 } 288 }
  289 +
  290 +
  291 + private boolean isDepositSwitchOpen(SkupType skupType){
  292 + boolean depositSwitchStatus ;
  293 + switch (skupType){
  294 + case IN_STOCK://现货寄存
  295 + depositSwitchStatus = configReader.getBoolean("ufo.order.deposit.inStock.switch", false);break;
  296 + case QUICK_DELIVER://闪购寄存
  297 + depositSwitchStatus = configReader.getBoolean("ufo.order.deposit.quickDeliver.switch", false);break;
  298 + case FAST_DELIVERY://极速寄存
  299 + depositSwitchStatus = configReader.getBoolean("ufo.order.deposit.fastDeliver.switch", false);break;
  300 + default:
  301 + depositSwitchStatus = false;
  302 + }
  303 + return depositSwitchStatus;
  304 + }
282 } 305 }
@@ -80,6 +80,7 @@ public final class SellerGoodsHelper { @@ -80,6 +80,7 @@ public final class SellerGoodsHelper {
80 switch (skupType){ 80 switch (skupType){
81 case IN_STOCK: 81 case IN_STOCK:
82 case QUICK_DELIVER: 82 case QUICK_DELIVER:
  83 + case FAST_DELIVERY:
83 result = true; 84 result = true;
84 break; 85 break;
85 default: result = false; 86 default: result = false;