Authored by chenchao

support quick deliver 4 buyer order

... ... @@ -33,7 +33,6 @@ import com.yohoufo.order.service.impl.PaymentServiceImpl;
import com.yohoufo.order.service.impl.SellerService;
import com.yohoufo.order.service.impl.SellerWrapper;
import com.yohoufo.order.service.impl.TradeBillsService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -44,7 +43,6 @@ import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.function.Supplier;
import java.util.stream.Collectors;
@Service
public class MerchantOrderPaymentService extends AbstractOrderPaymentService {
... ...
package com.yohoufo.order.service.impl;
import com.yohobuy.ufo.model.order.bo.OrderInfo;
import com.yohoufo.order.model.request.PaymentRequest;
import com.yohoufo.order.model.response.PrepayResponse;
import com.yohoufo.order.service.AbstractOrderPaymentService;
import org.springframework.stereotype.Service;
@Service
public class DeposiOrderPaymentService extends AbstractOrderPaymentService {
@Override
public boolean isTimeoutCancelStatus(OrderInfo orderInfo) {
return false;
}
@Override
public OrderInfo getOrderInfo(long orderCode, int uid) {
return null;
}
@Override
public OrderInfo getOrderInfo(long orderCode) {
return null;
}
@Override
public void checkOrderStatus(OrderInfo orderInfo) {
}
@Override
public void updatePayment(OrderInfo orderInfo, int payment) {
}
@Override
public PrepayResponse getAppPayRequest(PaymentRequest request) {
return null;
}
@Override
public void saveAppPayRequest(OrderInfo orderInfo, PrepayResponse response) {
}
@Override
public boolean isOrderWaitingPay(OrderInfo orderInfo) {
return false;
}
@Override
public boolean isOrderPaid(OrderInfo orderInfo) {
return false;
}
@Override
public boolean canRefund(OrderInfo orderInfo) {
return false;
}
@Override
public int updateOrderStatusPaid(OrderInfo orderInfo) {
return 0;
}
@Override
public void processAfterPay(OrderInfo orderInfo) {
}
}
... ...
... ... @@ -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;
}
... ...
... ... @@ -2,12 +2,12 @@ package com.yohoufo.order.service.support;
import com.google.common.collect.Lists;
import com.yohobuy.ufo.model.order.constants.DeliveryWayEnum;
import com.yohobuy.ufo.model.order.constants.OrderConstant;
import com.yohobuy.ufo.model.order.constants.OrderDetailDesc;
import com.yohobuy.ufo.model.order.constants.SkupType;
import com.yohobuy.ufo.model.promotion.constant.CouponTypeEnum;
import com.yohoufo.common.helper.ImageUrlAssist;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohobuy.ufo.model.order.constants.OrderConstant;
import com.yohoufo.order.charge.model.*;
import com.yohoufo.order.constants.CouponConstants;
import com.yohoufo.order.model.response.*;
... ... @@ -259,8 +259,7 @@ public class ShoppingSupport {
public DepositResp getDepositResp(SkupType skupType){
DepositResp depositResp = null;
if(SellerGoodsHelper.canDeposit(skupType)){
depositResp = new DepositResp();
depositResp.setDepositable(OrderConstant.Y_STR);
depositResp = DepositResp.builder().depositable(OrderConstant.Y_STR).build();
}
return depositResp;
}
... ...