...
|
...
|
@@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Optional;
|
...
|
...
|
@@ -110,6 +111,8 @@ public class QiniuLiveRecordService { |
|
|
|
|
|
LOG.info("method selectByOrderCodes in buyerOrders size is {}, productId is {}", buyerOrders.size(), productId);
|
|
|
|
|
|
List<OrderVideoResp> appraiseVideoList = new ArrayList<>();
|
|
|
|
|
|
buyerOrders.stream().forEach(item -> {
|
|
|
OrderVideoResp orderVideoResp = new OrderVideoResp();
|
|
|
QiniuLiveRecord qiniuLiveRecord = recordMap.get(item.getOrderCode());
|
...
|
...
|
@@ -119,11 +122,15 @@ public class QiniuLiveRecordService { |
|
|
orderVideoResp.setVideoPictureUrl(configReader.getString("ufo.order.realVideoPic", "http://img11.static.yhbimg.com/goodsimg/2019/01/15/17/01e7093ff7effcdf76ed191e68e4a5c4ca.png"));
|
|
|
orderVideoResp.setVideoUrl(makeLiveVideoUrl(qiniuLiveRecord.getVedioFileUrl()));
|
|
|
orderVideoResp.setInitFlag(Boolean.FALSE);
|
|
|
resps.add(orderVideoResp);
|
|
|
appraiseVideoList.add(orderVideoResp);
|
|
|
});
|
|
|
|
|
|
List<OrderVideoResp> sortResp = resps.stream().sorted((s1, s2) -> s2.getCreateTimeInt().compareTo(s1.getCreateTimeInt())).collect(Collectors.toList());
|
|
|
return sortResp.subList(0, sortResp.size() > 10 ? 10 : sortResp.size());
|
|
|
List<OrderVideoResp> sortResp = appraiseVideoList.stream().sorted((s1, s2) -> s2.getCreateTimeInt().compareTo(s1.getCreateTimeInt())).collect(Collectors.toList());
|
|
|
if (!CollectionUtils.isEmpty(sortResp)) {
|
|
|
resps.addAll(sortResp.subList(0, sortResp.size() > 10 ? 10 : sortResp.size()));
|
|
|
}
|
|
|
|
|
|
return resps;
|
|
|
}
|
|
|
|
|
|
// 查询宣传视频
|
...
|
...
|
|