Authored by tanling

极速发货

... ... @@ -60,7 +60,6 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
@Autowired
BuyerOrderMetaMapper buyerOrderMetaMapper;
@Autowired
InBoxFacade inBoxFacade;
... ... @@ -579,7 +578,7 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
// skup --> product_name
SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(buyerOrderGoods.getSkup());
OrderInfo orderInfo = buildOrderInfo(buyerOrder);
OrderInfo orderInfo = buildOrderInfo(buyerOrder, buyerOrderGoods);
if (sellerOrderGoods == null){
return orderInfo;
}
... ... @@ -588,7 +587,7 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
return orderInfo;
}
private OrderInfo buildOrderInfo(BuyerOrder buyerOrder ) {
private OrderInfo buildOrderInfo(BuyerOrder buyerOrder,BuyerOrderGoods buyerOrderGoods) {
OrderInfo orderInfo = OrderInfo.builder()
.id(buyerOrder.getId())
.uid(buyerOrder.getUid())
... ... @@ -601,6 +600,7 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
.orderCodeType(OrderCodeType.BUYER_TYPE)
.attributes(buyerOrder.getAttributes())
.sourceStatus(buyerOrder.getStatus())
.skup(buyerOrderGoods!=null?buyerOrderGoods.getSkup():0)
.payExpireTime(DelayTime.BUYER_ORDER_WAITING_PAY)
.payExpire(buyerOrder.getCreateTime()+ covertFen(DelayTime.SELLER_ORDER_WAITING_PAY))
.build();
... ... @@ -624,7 +624,9 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
throw new ServiceException(ServiceError.ORDER_NULL);
}
return buildOrderInfo(buyerOrder );
BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapper.selectByOrderCode(buyerOrder.getUid(), buyerOrder.getOrderCode());
return buildOrderInfo(buyerOrder,buyerOrderGoods);
}
... ...
... ... @@ -2,11 +2,14 @@ package com.yohoufo.order.service.proxy;
import com.alibaba.fastjson.JSONObject;
import com.yoho.core.config.ConfigReader;
import com.yoho.error.exception.ServiceException;
import com.yohobuy.ufo.model.order.common.OrderAttributes;
import com.yohoufo.common.ApiResponse;
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
... ... @@ -21,6 +24,7 @@ public class FastDeliveryProxyService {
@Autowired
private SellerOrderGoodsMapper sellerOrderGoodsMapper;
private final Logger logger = LoggerFactory.getLogger(getClass());
/**
* 锁库存
... ... @@ -128,6 +132,12 @@ public class FastDeliveryProxyService {
* @return
*/
public boolean isFastDeliveryGoods(int skup){
if (skup == 0){
logger.warn("isFastDeliveryGoods skup {}", skup);
throw new ServiceException(500, "skup为空");
}
SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
return sellerOrderGoods!=null && sellerOrderGoods.getAttributes() == OrderAttributes.FAST_DELIVERY.getCode();
}
... ...