...
|
...
|
@@ -8,6 +8,7 @@ import com.yoho.core.rest.client.hystrix.AsyncFuture; |
|
|
import com.yoho.service.model.response.ProfileInfoRsp;
|
|
|
import com.yoho.service.model.social.request.UicUserReqBO;
|
|
|
import com.yoho.service.model.social.response.UserInfoRspBO;
|
|
|
import com.yohobuy.ufo.model.order.constants.QNliveConstants;
|
|
|
import com.yohoufo.common.cache.CacheClient;
|
|
|
import com.yohoufo.common.exception.GatewayException;
|
|
|
import com.yohoufo.common.helper.ImageUrlAssist;
|
...
|
...
|
@@ -43,8 +44,6 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(ProductIdentifyServiceImpl.class);
|
|
|
|
|
|
public static final String LIVE_VEDIO_DOMAIN = "http://flv01.static.yhbimg.com/";
|
|
|
|
|
|
@Autowired
|
|
|
private IdentifyRecordsMapper identifyRecordsMapper;
|
|
|
|
...
|
...
|
@@ -105,7 +104,6 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
|
|
// Integer sellerUid = buyerOrder.getSellerUid();//卖家
|
|
|
Integer orderStatus = buyerOrder.getStatus();//5--订单已经完成
|
|
|
|
|
|
|
|
|
//3)订单号获取 skup
|
|
|
BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapper.selectOnlyByOrderCode(orderCode);
|
|
|
Integer skup = buyerOrderGoods.getSkup();
|
...
|
...
|
@@ -118,10 +116,8 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
|
|
result.setProductSize(sellerOrderGoods.getSizeName());
|
|
|
|
|
|
//4)vedioFileUrl视频链接
|
|
|
QiniuLiveRecord qiniuLiveRecords = qiniuLiveRecordMapper.selectByOrderCode(orderCode);
|
|
|
if (qiniuLiveRecords != null && StringUtils.isNotBlank(qiniuLiveRecords.getVedioFileUrl())) {
|
|
|
result.setVedioFileUrl(LIVE_VEDIO_DOMAIN + qiniuLiveRecords.getVedioFileUrl());
|
|
|
}
|
|
|
String vedioFileUrl = getLiveVideoUrlByOrderCode(orderCode);
|
|
|
result.setVedioFileUrl(vedioFileUrl);
|
|
|
|
|
|
//组装查询结果
|
|
|
//鉴定者的信息、鉴定时间、鉴定中心等
|
...
|
...
|
@@ -148,7 +144,6 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
|
|
|
|
|
//去获取用户的头像信息
|
|
|
UserInfoRspBO buyerInfo = getUserProfileInfo(buyerUid);
|
|
|
|
|
|
//订单轨迹
|
|
|
String mobile = MobileHelper.coverMobile2(buyerInfo.getMobile());//隐位的手机号码--赢藏中间6位
|
|
|
String headIcon = buyerInfo.getHeadIco();//头像
|
...
|
...
|
@@ -161,7 +156,6 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
|
|
updateOrderTrack.setContent("用户" + mobile + "成为商品新主人");
|
|
|
updateOrderTrack.setHeadIcon(headIcon);
|
|
|
updateOrderTrack.setMobile(mobile);
|
|
|
|
|
|
trackRespList.add(updateOrderTrack);
|
|
|
}
|
|
|
//创建订单的时间
|
...
|
...
|
@@ -207,7 +201,6 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
|
|
}
|
|
|
|
|
|
Long orderCode = identifyRecord.getOrderCode();//订单号
|
|
|
|
|
|
//订单号获取 skup
|
|
|
BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapper.selectOnlyByOrderCode(orderCode);
|
|
|
Integer skup = buyerOrderGoods.getSkup();
|
...
|
...
|
@@ -217,7 +210,6 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
|
|
result.setProductId(sellerOrderGoods.getProductId());
|
|
|
result.setProductName(sellerOrderGoods.getProductName());
|
|
|
result.setAllowTransfer(identifyRecord.getAllowTransfer() == 0 ? "Y" : "N");
|
|
|
|
|
|
//买家的头像
|
|
|
Integer buyerUid = buyerOrderGoods.getUid();
|
|
|
UserInfoRspBO profile = getUserProfileInfo(buyerUid);
|
...
|
...
|
@@ -246,12 +238,10 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
|
|
clientCache.set(kb.getKey(), 2 * 60 * 60, result );//两小时
|
|
|
}
|
|
|
return result;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
private IdentifyRecord queryIdentifyRecord(String tagId, String nfcUid) {
|
|
|
|
|
|
RedisKeyBuilder kb = new RedisKeyBuilder().appendFixed("ufo:product:identifyRecord:").
|
|
|
appendVar(tagId).appendVar(":").appendVar(nfcUid);
|
|
|
IdentifyRecord result = clientCache.get(kb, IdentifyRecord.class);
|
...
|
...
|
@@ -259,9 +249,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
|
|
logger.info("queryIdentifyRecord from cache success! tagId={},nfcUid={} ",tagId, nfcUid );
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
result = identifyRecordsMapper.selectByTagAndNfcId(tagId, nfcUid);
|
|
|
|
|
|
if(result != null){
|
|
|
clientCache.set(kb.getKey(), 5 * 60, result );
|
|
|
}
|
...
|
...
|
@@ -305,6 +293,37 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
|
|
|
|
|
}
|
|
|
|
|
|
private String formatDate(Integer time, String pattern) {
|
|
|
if(null == time ){
|
|
|
return null;
|
|
|
}
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat(pattern);
|
|
|
return dateFormat.format(new Date((long) time * 1000));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据订单号获取视频url --QiniuLiveRecordService.selectByOrderCodes()
|
|
|
* @param orderCode
|
|
|
* @return
|
|
|
*/
|
|
|
private String getLiveVideoUrlByOrderCode(Long orderCode) {
|
|
|
logger.info("enter getLiveVideoUrlByOrderCode ! orderCode={}", orderCode);
|
|
|
if (null == orderCode) {
|
|
|
return null;
|
|
|
}
|
|
|
QiniuLiveRecord qiniuLiveRecords = qiniuLiveRecordMapper.selectByOrderCode(orderCode);
|
|
|
if (null == qiniuLiveRecords || StringUtils.isEmpty(qiniuLiveRecords.getVedioFileUrl())) {
|
|
|
return null;
|
|
|
}
|
|
|
String filename = qiniuLiveRecords.getVedioFileUrl();
|
|
|
if (StringUtils.isBlank(filename)) {
|
|
|
return null;
|
|
|
}
|
|
|
logger.info("getLiveVideoUrlByOrderCode success! orderCode={},filename={}", orderCode,filename);
|
|
|
return QNliveConstants.LIVE_VIDEO_DOMAIN + filename;
|
|
|
}
|
|
|
|
|
|
|
|
|
// /**
|
|
|
// * 批量获取买家信息
|
|
|
// *
|
...
|
...
|
@@ -347,13 +366,6 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
|
|
// result = resultList.stream().collect(Collectors.toMap(ProfileInfoRsp :: getUid, (ProfileInfoRsp obj) -> obj));
|
|
|
// return result;
|
|
|
// }
|
|
|
private String formatDate(Integer time, String pattern) {
|
|
|
if(null == time ){
|
|
|
return null;
|
|
|
}
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat(pattern);
|
|
|
return dateFormat.format(new Date((long) time * 1000));
|
|
|
}
|
|
|
|
|
|
|
|
|
} |
...
|
...
|
|