Authored by tanling

Merge branch 'dev_fast_delivery' into test6.9.12

@@ -60,7 +60,6 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { @@ -60,7 +60,6 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
60 @Autowired 60 @Autowired
61 BuyerOrderMetaMapper buyerOrderMetaMapper; 61 BuyerOrderMetaMapper buyerOrderMetaMapper;
62 62
63 -  
64 @Autowired 63 @Autowired
65 InBoxFacade inBoxFacade; 64 InBoxFacade inBoxFacade;
66 65
@@ -579,7 +578,7 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { @@ -579,7 +578,7 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
579 // skup --> product_name 578 // skup --> product_name
580 SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(buyerOrderGoods.getSkup()); 579 SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(buyerOrderGoods.getSkup());
581 580
582 - OrderInfo orderInfo = buildOrderInfo(buyerOrder); 581 + OrderInfo orderInfo = buildOrderInfo(buyerOrder, buyerOrderGoods);
583 if (sellerOrderGoods == null){ 582 if (sellerOrderGoods == null){
584 return orderInfo; 583 return orderInfo;
585 } 584 }
@@ -588,7 +587,7 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { @@ -588,7 +587,7 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
588 return orderInfo; 587 return orderInfo;
589 } 588 }
590 589
591 - private OrderInfo buildOrderInfo(BuyerOrder buyerOrder ) { 590 + private OrderInfo buildOrderInfo(BuyerOrder buyerOrder,BuyerOrderGoods buyerOrderGoods) {
592 OrderInfo orderInfo = OrderInfo.builder() 591 OrderInfo orderInfo = OrderInfo.builder()
593 .id(buyerOrder.getId()) 592 .id(buyerOrder.getId())
594 .uid(buyerOrder.getUid()) 593 .uid(buyerOrder.getUid())
@@ -601,6 +600,7 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { @@ -601,6 +600,7 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
601 .orderCodeType(OrderCodeType.BUYER_TYPE) 600 .orderCodeType(OrderCodeType.BUYER_TYPE)
602 .attributes(buyerOrder.getAttributes()) 601 .attributes(buyerOrder.getAttributes())
603 .sourceStatus(buyerOrder.getStatus()) 602 .sourceStatus(buyerOrder.getStatus())
  603 + .skup(buyerOrderGoods!=null?buyerOrderGoods.getSkup():0)
604 .payExpireTime(DelayTime.BUYER_ORDER_WAITING_PAY) 604 .payExpireTime(DelayTime.BUYER_ORDER_WAITING_PAY)
605 .payExpire(buyerOrder.getCreateTime()+ covertFen(DelayTime.SELLER_ORDER_WAITING_PAY)) 605 .payExpire(buyerOrder.getCreateTime()+ covertFen(DelayTime.SELLER_ORDER_WAITING_PAY))
606 .build(); 606 .build();
@@ -624,7 +624,9 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { @@ -624,7 +624,9 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
624 throw new ServiceException(ServiceError.ORDER_NULL); 624 throw new ServiceException(ServiceError.ORDER_NULL);
625 } 625 }
626 626
627 - return buildOrderInfo(buyerOrder ); 627 + BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapper.selectByOrderCode(buyerOrder.getUid(), buyerOrder.getOrderCode());
  628 +
  629 + return buildOrderInfo(buyerOrder,buyerOrderGoods);
628 } 630 }
629 631
630 632
@@ -2,11 +2,14 @@ package com.yohoufo.order.service.proxy; @@ -2,11 +2,14 @@ package com.yohoufo.order.service.proxy;
2 2
3 import com.alibaba.fastjson.JSONObject; 3 import com.alibaba.fastjson.JSONObject;
4 import com.yoho.core.config.ConfigReader; 4 import com.yoho.core.config.ConfigReader;
  5 +import com.yoho.error.exception.ServiceException;
5 import com.yohobuy.ufo.model.order.common.OrderAttributes; 6 import com.yohobuy.ufo.model.order.common.OrderAttributes;
6 import com.yohoufo.common.ApiResponse; 7 import com.yohoufo.common.ApiResponse;
7 import com.yohoufo.dal.order.SellerOrderGoodsMapper; 8 import com.yohoufo.dal.order.SellerOrderGoodsMapper;
8 import com.yohoufo.dal.order.model.SellerOrderGoods; 9 import com.yohoufo.dal.order.model.SellerOrderGoods;
9 import org.apache.commons.lang3.StringUtils; 10 import org.apache.commons.lang3.StringUtils;
  11 +import org.slf4j.Logger;
  12 +import org.slf4j.LoggerFactory;
10 import org.springframework.beans.factory.annotation.Autowired; 13 import org.springframework.beans.factory.annotation.Autowired;
11 import org.springframework.stereotype.Service; 14 import org.springframework.stereotype.Service;
12 15
@@ -21,6 +24,7 @@ public class FastDeliveryProxyService { @@ -21,6 +24,7 @@ public class FastDeliveryProxyService {
21 @Autowired 24 @Autowired
22 private SellerOrderGoodsMapper sellerOrderGoodsMapper; 25 private SellerOrderGoodsMapper sellerOrderGoodsMapper;
23 26
  27 + private final Logger logger = LoggerFactory.getLogger(getClass());
24 28
25 /** 29 /**
26 * 锁库存 30 * 锁库存
@@ -128,6 +132,12 @@ public class FastDeliveryProxyService { @@ -128,6 +132,12 @@ public class FastDeliveryProxyService {
128 * @return 132 * @return
129 */ 133 */
130 public boolean isFastDeliveryGoods(int skup){ 134 public boolean isFastDeliveryGoods(int skup){
  135 +
  136 + if (skup == 0){
  137 + logger.warn("isFastDeliveryGoods skup {}", skup);
  138 + throw new ServiceException(500, "skup为空");
  139 + }
  140 +
131 SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup); 141 SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
132 return sellerOrderGoods!=null && sellerOrderGoods.getAttributes() == OrderAttributes.FAST_DELIVERY.getCode(); 142 return sellerOrderGoods!=null && sellerOrderGoods.getAttributes() == OrderAttributes.FAST_DELIVERY.getCode();
133 } 143 }