Authored by mali

鉴定服务

... ... @@ -138,4 +138,6 @@ public class BuyerOrderReq extends PageRequestBO{
private String settleFailReason;
private Integer abnormalType;//订单异常类型,1:卖家多发货 2:卖家少发货 3:卖家发错货
}
... ...
... ... @@ -45,6 +45,26 @@ public class QiniuLiveRecord {
private String phoneUid; // 手机唯一标识
private Integer orderType; // 订单类型 0 买家订单, 1 鉴定服务
private String productName; // 商品名称
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public Integer getOrderType() {
return orderType;
}
public void setOrderType(Integer orderType) {
this.orderType = orderType;
}
public String getPhoneUid() {
return phoneUid;
}
... ... @@ -255,6 +275,28 @@ public class QiniuLiveRecord {
private String phoneUid; // 手机唯一标识
private Integer orderType; // 订单类型 0 买家订单, 1 鉴定服务
private String productName; // 商品名称
public String getProductName() {
return productName;
}
public Builder setProductName(String productName) {
this.productName = productName;
return this;
}
public Integer getOrderType() {
return orderType;
}
public Builder setOrderType(Integer orderType) {
this.orderType = orderType;
return this;
}
public String getPhoneUid() {
return phoneUid;
}
... ... @@ -456,6 +498,8 @@ public class QiniuLiveRecord {
record.setVedioFileUrl(this.getVedioFileUrl());
record.setUpdateTime(this.getUpdateTime());
record.setPhoneUid(this.getPhoneUid());
record.setOrderType(this.getOrderType());
record.setProductName(this.getProductName());
return record;
}
... ...
... ... @@ -60,7 +60,8 @@
update_time = #{updateTime,jdbcType=INTEGER},
storage_id = #{storageId,jdbcType=INTEGER},
goods_id = #{goodsId,jdbcType=INTEGER},
product_id = #{productId,jdbcType=INTEGER}
product_id = #{productId,jdbcType=INTEGER},
product_name = #{productName,jdbcType=VARCHAR}
where skup = #{skup,jdbcType=INTEGER}
</update>
... ...
... ... @@ -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()));
... ...