Authored by Lixiaodi

库存转卖:鉴定视频拷贝

... ... @@ -17,6 +17,8 @@ public interface QiniuLiveRecordMapper {
QiniuLiveRecord selectByOrderCode(@Param("orderCode") Long orderCode);
QiniuLiveRecord selectByOrderCode4Copy(@Param("orderCode") Long orderCode);
// 包含状态为0的,因为有可能是新的鉴定视频链接
QiniuLiveRecord selectByOrderCodeEx(@Param("orderCode") Long orderCode);
... ...
... ... @@ -64,6 +64,14 @@
and show_flag = 1 and status = 1 order by id DESC limit 1
</select>
<select id="selectByOrderCode4Copy" resultMap="BaseResultMap" parameterType="java.lang.Long" >
select
<include refid="Base_Column_List" />
from qiniu_live_record
where order_code = #{orderCode, jdbcType=BIGINT}
and show_flag = 1 order by id DESC limit 1
</select>
<select id="selectByOrderCodeEx" resultMap="BaseResultMap" parameterType="java.lang.Long" >
select
<include refid="Base_Column_List" />
... ...
package com.yohoufo.order.service.impl;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.yoho.core.config.ConfigReader;
... ... @@ -53,21 +54,25 @@ public class QiniuLiveRecordService {
}
public void copyQiniuLiveRecord(StorageDeposit storageDeposit) {
LOG.info("copyQiniuLiveRecord storageDeposit is {}", storageDeposit);
if (Objects.isNull(storageDeposit)) {
return;
}
QiniuLiveRecord qiniuLiveRecords = qiniuLiveRecordMapper.selectByOrderCode(storageDeposit.getOrderCode());
QiniuLiveRecord qiniuLiveRecords = qiniuLiveRecordMapper.selectByOrderCode4Copy(storageDeposit.getOrderCode());
if (Objects.isNull(qiniuLiveRecords)) {
LOG.warn("copyQiniuLiveRecord qiniuLiveRecords is null");
return;
}
SellerOrder sellerOrder = sellerOrderMapper.selectBySkup(storageDeposit.getNewSkup());
if (Objects.isNull(sellerOrder)) {
LOG.warn("copyQiniuLiveRecord sellerOrder is null");
return;
}
qiniuLiveRecords.setId(null);
qiniuLiveRecords.setOrderCode(storageDeposit.getNewOrderCode());
qiniuLiveRecords.setSkup(sellerOrder.getSkup());
qiniuLiveRecords.setSellerOrderCode(sellerOrder.getOrderCode());
LOG.info("copyQiniuLiveRecord qiniuLiveRecords for insert is {}", JSON.toJSONString(qiniuLiveRecords));
qiniuLiveRecordMapper.insert(qiniuLiveRecords);
}
... ...