...
|
...
|
@@ -2,10 +2,7 @@ package com.yohoufo.order.service; |
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.yohobuy.ufo.model.order.bo.OrderInfo;
|
|
|
import com.yohobuy.ufo.model.order.common.OrderAttributes;
|
|
|
import com.yohobuy.ufo.model.order.common.OrderCodeType;
|
|
|
import com.yohobuy.ufo.model.order.common.PayChannelType;
|
|
|
import com.yohobuy.ufo.model.order.common.Payment;
|
|
|
import com.yohobuy.ufo.model.order.common.*;
|
|
|
import com.yohobuy.ufo.model.order.constants.OrderConstant;
|
|
|
import com.yohoufo.dal.order.AppraiseOrderMapper;
|
|
|
import com.yohoufo.dal.order.BuyerOrderGoodsMapper;
|
...
|
...
|
@@ -85,8 +82,13 @@ public class PaymentSupportService { |
|
|
}
|
|
|
|
|
|
else if (codeMeta.getType() == OrderCodeType.BUYER_TYPE.getType()){
|
|
|
BuyerOrder buyerOrder = findBuyerOrder(orderCode);
|
|
|
//定金禁止使用虚拟支付
|
|
|
if (isWaitingPayDepositStatus(buyerOrder)) {
|
|
|
return Lists.newArrayList(PayChannelType.REAL);
|
|
|
}
|
|
|
|
|
|
Pair<Integer, Integer> attributes = getOrderAttributes(orderCode);
|
|
|
Pair<Integer, Integer> attributes = getOrderAttributes(buyerOrder);
|
|
|
// 海外
|
|
|
if (isHkOrder(attributes)){
|
|
|
return Lists.newArrayList(PayChannelType.CROSS_BORDER);
|
...
|
...
|
@@ -143,19 +145,35 @@ public class PaymentSupportService { |
|
|
|| attributes.getRight() == OrderAttributes.OVERSEAS_PRE_SALE.getCode());
|
|
|
}
|
|
|
|
|
|
private Pair<Integer, Integer> getOrderAttributes(long orderCode){
|
|
|
private BuyerOrder findBuyerOrder(long orderCode) {
|
|
|
return buyerOrderMapper.selectByOrderCode(orderCode);
|
|
|
}
|
|
|
|
|
|
private Pair<Integer, Integer> getOrderAttributes(long orderCode) {
|
|
|
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
|
|
|
if (buyerOrder != null){
|
|
|
BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapper.selectOnlyByOrderCode(orderCode);
|
|
|
if (buyerOrderGoods != null){
|
|
|
return getOrderAttributes(buyerOrder);
|
|
|
}
|
|
|
|
|
|
private Pair<Integer, Integer> getOrderAttributes(BuyerOrder buyerOrder) {
|
|
|
if (buyerOrder != null) {
|
|
|
BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapper.selectOnlyByOrderCode(buyerOrder.getOrderCode());
|
|
|
if (buyerOrderGoods != null) {
|
|
|
SellerOrderGoods sellerOrder = sellerOrderGoodsMapper.selectByPrimaryKey(buyerOrderGoods.getSkup());
|
|
|
return Pair.of(buyerOrder.getAttributes(), sellerOrder.getAttributes());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return Pair.of(null, null);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 待付定金状态
|
|
|
* @return
|
|
|
*/
|
|
|
private boolean isWaitingPayDepositStatus(BuyerOrder buyerOrder) {
|
|
|
if (buyerOrder != null && buyerOrder.getStatus() != null && buyerOrder.getStatus() == OrderStatus.WAITING_PAY_DEPOSIT.getCode()) {
|
|
|
return true;
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|