...
|
...
|
@@ -12,6 +12,7 @@ import com.yoho.order.model.SellerOrderGoods; |
|
|
import com.yoho.ufo.exception.PlatformException;
|
|
|
import com.yoho.ufo.order.service.impl.UfoLiveService;
|
|
|
import com.yoho.ufo.util.DateUtil;
|
|
|
import com.yohobuy.ufo.model.order.req.OrderTypeEnum;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
...
|
...
|
@@ -87,29 +88,45 @@ public class LiveEventsListener implements ApplicationListener<QiniuLiveRecordEv |
|
|
|
|
|
// 异步补充记录的卖家订单号,商品信息 // 并将之前的skup相关的视频置为不可见
|
|
|
private void completeRecord(QiniuLiveRecord record) {
|
|
|
List<SellerOrderGoods> sellerOrderGoodses = sellerOrderGoodsMapper.selectByIds(Lists.newArrayList(record.getSkup()));
|
|
|
if (CollectionUtils.isEmpty(sellerOrderGoodses)) {
|
|
|
return;
|
|
|
if (record.getOrderType().equals(OrderTypeEnum.ORDERTYPE_BUYERORDER.getCode())) {
|
|
|
List<SellerOrderGoods> sellerOrderGoodses = sellerOrderGoodsMapper.selectByIds(Lists.newArrayList(record.getSkup()));
|
|
|
if (CollectionUtils.isEmpty(sellerOrderGoodses)) {
|
|
|
return;
|
|
|
}
|
|
|
SellerOrderGoods sellerOrderGoods = sellerOrderGoodses.get(0);
|
|
|
record.setStorageId(sellerOrderGoods.getStorageId());
|
|
|
record.setProductId(sellerOrderGoods.getProductId());
|
|
|
record.setProductName(sellerOrderGoods.getProductName());
|
|
|
} else {
|
|
|
record.setStorageId(0);
|
|
|
//record.setProductId(sellerOrderGoods.getProductId());
|
|
|
//record.setProductName(sellerOrderGoods.getProductName());
|
|
|
}
|
|
|
SellerOrderGoods sellerOrderGoods = sellerOrderGoodses.get(0);
|
|
|
|
|
|
record.setSellerOrderCode(0L);
|
|
|
record.setUpdateTime(DateUtil.getCurrentTimeSeconds());
|
|
|
record.setStorageId(sellerOrderGoods.getStorageId());
|
|
|
record.setGoodsId(0);
|
|
|
record.setProductId(sellerOrderGoods.getProductId());
|
|
|
|
|
|
qiniuLiveRecordMapper.updateProductBySkup(record);
|
|
|
}
|
|
|
|
|
|
private QiniuLiveRecord convertQiNiuLiveRecord(BuyerOrderReq record) {
|
|
|
QiniuLiveRecord result = new QiniuLiveRecord();
|
|
|
|
|
|
if (null == record.getSkup() || null == record.getDepotNo()) { // 手机质检版没有传这些参数,需要重新查询库
|
|
|
List<BuyerOrderGoods> buyerOrderGoodses = buyerOrderGoodsMapper.selectByOrderCode(Lists.newArrayList(record.getOrderCode()));
|
|
|
BuyerOrderGoods buyerOrderGoods = buyerOrderGoodses.get(0);
|
|
|
record.setSkup(buyerOrderGoods.getSkup());
|
|
|
List<SellerOrderGoods> sellerOrderGoodses = sellerOrderGoodsMapper.selectByIds(Lists.newArrayList(record.getSkup()));
|
|
|
record.setDepotNo(sellerOrderGoodses.get(0).getDepotNo());
|
|
|
List<BuyerOrderGoods> buyerOrderGoodses = buyerOrderGoodsMapper.selectByOrderCode(Lists.newArrayList(record.getOrderCode()));
|
|
|
|
|
|
if (CollectionUtils.isEmpty(buyerOrderGoodses)) { // 买家订单表查询不到,则代表是鉴定服务
|
|
|
result.setOrderType(OrderTypeEnum.ORDERTYPE_APPRAISEORDER.getCode());
|
|
|
record.setSkup(0);
|
|
|
record.setDepotNo(0); // 鉴定服务默认北京
|
|
|
} else {
|
|
|
result.setOrderType(OrderTypeEnum.ORDERTYPE_BUYERORDER.getCode());
|
|
|
if (null == record.getSkup() || null == record.getDepotNo()) { // 手机质检版没有传这些参数,需要重新查询库
|
|
|
BuyerOrderGoods buyerOrderGoods = buyerOrderGoodses.get(0);
|
|
|
record.setSkup(buyerOrderGoods.getSkup());
|
|
|
List<SellerOrderGoods> sellerOrderGoodses = sellerOrderGoodsMapper.selectByIds(Lists.newArrayList(record.getSkup()));
|
|
|
record.setDepotNo(sellerOrderGoodses.get(0).getDepotNo());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
Integer startTime = null != record.getStartTime() ? record.getStartTime() : liveRecordTimeMapper.selectByOrderCode(Long.valueOf(record.getOrderCode()));
|
...
|
...
|
|