he2802 3 жил өмнө
parent
commit
14b69f8937

+ 10 - 1
zhongzheng-admin/src/main/java/com/zhongzheng/controller/schedule/ScheduleController.java

@@ -29,6 +29,8 @@ public class ScheduleController extends BaseController {
 
     private final IScheduleService iScheduleService;
 
+    private final IPolyvLiveService iPolyvLiveService;
+
 
 
     /**
@@ -173,10 +175,17 @@ public class ScheduleController extends BaseController {
         return AjaxResult.success();
     }
 
-    @ApiOperation("保利威直播更新回放")
+    @ApiOperation("保利威直播结束更新回放")
     @GetMapping("/liveToReplay")
     public AjaxResult liveToReplay(UserQueryBo bo) throws Exception {
         iScheduleService.liveToReplay(bo);
         return AjaxResult.success();
     }
+
+    @ApiOperation("保利威直播结束提问同步")
+    @GetMapping("/chatLog")
+    public AjaxResult GetConsultingRecord(PolyvLiveQueryBo bo) throws Exception {
+        iPolyvLiveService.GetConsultingRecord(bo);
+        return AjaxResult.success();
+    }
 }

+ 3 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java

@@ -452,7 +452,9 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         GoodsVo goodsVo = baseMapper.selectUserDetail(bo);
         //获得当前所在班级
         ClassGradeVo classGradeVo = courseMapper.gradeIdSelect(bo.getUserId(),bo.getGoodsId(),null);
-        goodsVo.setGradeId(classGradeVo.getGradeId());
+        if(Validator.isNotEmpty(classGradeVo)){
+            goodsVo.setGradeId(classGradeVo.getGradeId());
+        }
         return goodsVo;
     }
 

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/polyv/service/IPolyvLiveService.java

@@ -41,4 +41,6 @@ public interface IPolyvLiveService {
 	LiveChannelBasicInfoResponse GetChannelBasicInfo(PolyvLiveQueryBo bo) throws Exception, NoSuchAlgorithmException;
 
 	List<LiveListChannelViewlogResponse.LiveChannelViewlog> ListChannelViewlog(PolyvLiveQueryBo bo) throws IOException, NoSuchAlgorithmException;
+
+	void GetConsultingRecord(PolyvLiveQueryBo bo) throws IOException, NoSuchAlgorithmException;
 }

+ 26 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/polyv/service/impl/PolyvLiveServiceImpl.java

@@ -49,9 +49,12 @@ import net.polyv.live.v1.entity.channel.playback.LiveListChannelSessionInfoReque
 import net.polyv.live.v1.entity.channel.playback.LiveListChannelSessionInfoResponse;
 import net.polyv.live.v1.entity.channel.viewdata.LiveListChannelViewlogRequest;
 import net.polyv.live.v1.entity.channel.viewdata.LiveListChannelViewlogResponse;
+import net.polyv.live.v1.entity.chat.LiveGetConsultingRecordRequest;
+import net.polyv.live.v1.entity.chat.LiveGetConsultingRecordResponse;
 import net.polyv.live.v1.service.channel.impl.LiveChannelOperateServiceImpl;
 import net.polyv.live.v1.service.channel.impl.LiveChannelPlaybackServiceImpl;
 import net.polyv.live.v1.service.channel.impl.LiveChannelViewdataServiceImpl;
+import net.polyv.live.v1.service.chat.impl.LiveChatRoomServiceImpl;
 import net.polyv.live.v1.util.LiveSignUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -258,4 +261,27 @@ public class PolyvLiveServiceImpl implements IPolyvLiveService {
         }
         return null;
     }
+
+    @Override
+    public void GetConsultingRecord(PolyvLiveQueryBo bo) throws IOException, NoSuchAlgorithmException {
+        LiveGetConsultingRecordRequest liveGetConsultingRecordRequest = new LiveGetConsultingRecordRequest();
+        List<LiveGetConsultingRecordResponse> liveGetConsultingRecordResponseList = null;
+        try {
+            liveGetConsultingRecordRequest.setChannelId(bo.getChannelId())
+                    .setBegin(0)
+                    .setEnd(10);
+            liveGetConsultingRecordResponseList = new LiveChatRoomServiceImpl().getConsultingRecord(liveGetConsultingRecordRequest);
+            if (liveGetConsultingRecordResponseList != null) {
+                //to do something ......
+                System.out.println("测试查询咨询提问记录成功{}");
+                System.out.println(JSON.toJSONString(liveGetConsultingRecordResponseList));
+            }
+        } catch (PloyvSdkException e) {
+            //参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
+            // 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
+            throw e;
+        } catch (Exception e) {
+            throw e;
+        }
+    }
 }