...
|
...
|
@@ -6,6 +6,7 @@ import com.yoho.error.ServiceError; |
|
|
import com.yoho.error.exception.ServiceException;
|
|
|
import com.yohobuy.ufo.model.order.common.Payment;
|
|
|
import com.yohobuy.ufo.model.order.common.SellerOrderStatus;
|
|
|
import com.yohobuy.ufo.model.order.constants.OrderConstant;
|
|
|
import com.yohoufo.common.alarm.EventBusPublisher;
|
|
|
import com.yohoufo.common.exception.UfoServiceException;
|
|
|
import com.yohoufo.common.utils.DateUtil;
|
...
|
...
|
@@ -15,8 +16,8 @@ import com.yohoufo.order.common.DelStatus; |
|
|
import com.yohoufo.order.constants.MetaKey;
|
|
|
import com.yohoufo.order.model.bo.SubmitSellerOrder;
|
|
|
import com.yohoufo.order.model.dto.SellerOrderComputeResult;
|
|
|
import com.yohoufo.order.service.support.BuyerOrderGoodsMapperSupport;
|
|
|
import com.yohoufo.order.utils.LoggerUtils;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
...
|
...
|
@@ -80,7 +81,7 @@ public class SellerBidOrderBindService { |
|
|
private SellerOrderMetaMapper somMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private BuyerOrderGoodsMapper buyerOrderGoodsMapper;
|
|
|
private BuyerOrderGoodsMapperSupport buyerOrderGoodsMapperSupport;
|
|
|
|
|
|
@Autowired
|
|
|
private BuyerOrderMapper buyerOrderMapper;
|
...
|
...
|
@@ -198,32 +199,18 @@ public class SellerBidOrderBindService { |
|
|
}
|
|
|
|
|
|
protected void bindSellerUidWithBuyerOrder(int skup, int sellerUid) {
|
|
|
BuyerOrderGoods buyerOrderGoods = getBuyerOrderGoods(skup);
|
|
|
BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapperSupport.selectBuyerOrderGoodsBySkup(skup);
|
|
|
BuyerOrder buyerOrder = new BuyerOrder();
|
|
|
buyerOrder.setUid(buyerOrderGoods.getUid());
|
|
|
buyerOrder.setOrderCode(buyerOrderGoods.getOrderCode());
|
|
|
buyerOrder.setSellerUid(sellerUid);
|
|
|
buyerOrder.setBidType(OrderConstant.BUYER_BID_TYPE);
|
|
|
boolean success = buyerOrderMapper.updateByOrderCode(buyerOrder) > 0;
|
|
|
if (!success) {
|
|
|
logger.warn("[{}] buyer order is bind with sellerUid:{} fail ", buyerOrderGoods.getOrderCode());
|
|
|
throw new UfoServiceException(500, "操作失败");
|
|
|
}
|
|
|
logger.warn("[{}] buyer order is bind with sellerUid:{} success ", buyerOrderGoods.getOrderCode());
|
|
|
}
|
|
|
|
|
|
private BuyerOrderGoods getBuyerOrderGoods(int skup) {
|
|
|
List<BuyerOrderGoods> buyerOrderGoodsList = buyerOrderGoodsMapper.selectOrderBySkups(skup);
|
|
|
if (CollectionUtils.isEmpty(buyerOrderGoodsList)) {
|
|
|
logger.warn("not find buyer order goods by skup:{}", skup);
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
if (buyerOrderGoodsList.size() != 1) {
|
|
|
logger.warn("is impossible,buyer order goods size != 1 by skup:{}", skup);
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
return buyerOrderGoodsList.get(0);
|
|
|
logger.info("[{}] buyer order is bind with sellerUid:{} success ", buyerOrderGoods.getOrderCode());
|
|
|
}
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|