|
@@ -41,6 +41,8 @@ import com.zhongzheng.modules.order.service.IOrderService;
|
|
|
import com.zhongzheng.modules.order.vo.OrderGoodsVo;
|
|
|
import com.zhongzheng.modules.order.vo.OrderListVo;
|
|
|
import com.zhongzheng.modules.order.vo.OrderUserGoodsVo;
|
|
|
+import com.zhongzheng.modules.polyv.bo.PolyvLiveQueryBo;
|
|
|
+import com.zhongzheng.modules.polyv.service.IPolyvLiveService;
|
|
|
import com.zhongzheng.modules.user.bo.UserExamGoodsQueryBo;
|
|
|
import com.zhongzheng.modules.user.bo.UserStudyRecordQueryBo;
|
|
|
import com.zhongzheng.modules.user.domain.User;
|
|
@@ -48,6 +50,8 @@ import com.zhongzheng.modules.user.service.IUserExamGoodsService;
|
|
|
import com.zhongzheng.modules.user.service.IUserService;
|
|
|
import com.zhongzheng.modules.user.service.IUserStudyRecordService;
|
|
|
import com.zhongzheng.modules.user.service.IUserSubscribeService;
|
|
|
+import net.polyv.common.v1.util.StringUtils;
|
|
|
+import net.polyv.live.v1.entity.channel.operate.LiveChannelBasicInfoResponse;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -112,6 +116,9 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
|
|
|
@Autowired
|
|
|
private ICourseSectionService courseSectionService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IPolyvLiveService ployvLiveService;
|
|
|
+
|
|
|
@Override
|
|
|
public OrderGoodsVo queryById(Long orderGoodsId) {
|
|
|
OrderGoods db = this.baseMapper.selectById(orderGoodsId);
|
|
@@ -520,6 +527,28 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
|
|
|
return new TableDataInfo<>();
|
|
|
}
|
|
|
List<CourseLiveVo> list = page.getRecords().stream().map(item -> BeanUtil.copyProperties(item, CourseLiveVo.class)).collect(Collectors.toList());
|
|
|
+ //获取保利威直播状态
|
|
|
+ Set<String> setUrl = list.stream().filter(x -> StringUtils.isNotBlank(x.getLiveUrl())).map(CourseLiveVo::getLiveUrl).collect(Collectors.toSet());
|
|
|
+ List<LiveChannelBasicInfoResponse> result = setUrl.stream().map(url -> {
|
|
|
+ PolyvLiveQueryBo bo = new PolyvLiveQueryBo();
|
|
|
+ bo.setChannelId(url);
|
|
|
+ LiveChannelBasicInfoResponse response = new LiveChannelBasicInfoResponse();
|
|
|
+ try {
|
|
|
+ response = ployvLiveService.GetChannelBasicInfo(bo);
|
|
|
+ } catch (Exception e) {
|
|
|
+// throw new CustomException("获取保利威直播状态失败");
|
|
|
+ response.setChannelId(url);
|
|
|
+ response.setWatchStatus("waiting");
|
|
|
+ }
|
|
|
+ return response;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ list.forEach(item -> {
|
|
|
+ for (LiveChannelBasicInfoResponse response : result) {
|
|
|
+ if (StringUtils.isNotBlank(item.getLiveUrl()) && item.getLiveUrl().equals(response.getChannelId())){
|
|
|
+ item.setWatchStatus(response.getWatchStatus());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
TableDataInfo<CourseLiveVo> info = new TableDataInfo<>();
|
|
|
info.setTotal(page.getTotal());
|
|
|
info.setRows(list);
|