Parcourir la source

提交:BUG处理

yangdamao il y a 3 ans
Parent
commit
b3c302c82b

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CheckSectionWatchVo.java

@@ -55,4 +55,7 @@ public class CheckSectionWatchVo implements Serializable {
 
     @ApiModelProperty("节类型 1录播 2直播 3回放")
     private Integer sectionType;
+
+    @ApiModelProperty("录播和回放的url地址")
+    private String recordingUrl;
 }

+ 20 - 16
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionWatchPerServiceImpl.java

@@ -52,22 +52,25 @@ public class CourseSectionWatchPerServiceImpl extends ServiceImpl<CourseSectionW
         CourseSectionWatchPerVo vo = new CourseSectionWatchPerVo();
         //获取课程节信息
         CourseSection section = courseSectionService.getById(bo.getSectionId());
-        String url = "";
-        //生成微信小程序码
-        switch (bo.getSectionType()){
-            case 2://直播 living-room/
-                String live = "living-room/";
-                vo.setEnCode(wxLoginService.getLiveEnCode(bo));
-                url = String.format("%s%s%s?a=1&cid=%s&gid=%s&sid=%s", liveGotoURL,live,section.getLiveUrl(), bo.getCourseId(), bo.getGoodsId(), bo.getSectionId());
-                break;
-            case 3://回放 my-live-detail/
-                String detail = "my-live-detail/";
-                vo.setEnCode(wxLoginService.getBackEnCode(bo));
-                url = String.format("%s%s%s?a=1&cid=%s&gid=%s&sid=%s", liveGotoURL,detail,bo.getGoodsId(), bo.getCourseId(), bo.getGoodsId(), bo.getSectionId());
-                break;
-            default:
-                throw new CustomException("课程节类型不正确,请检查");
-        }
+//        String url = "";
+        String live = "living-room/";
+        vo.setEnCode(wxLoginService.getLiveEnCode(bo));
+        String url = String.format("%s%s%s?a=1&cid=%s&gid=%s&sid=%s", liveGotoURL,live,section.getLiveUrl(), bo.getCourseId(), bo.getGoodsId(), bo.getSectionId());
+//        //生成微信小程序码
+//        switch (bo.getSectionType()){
+//            case 2://直播 living-room/
+//                String live = "living-room/";
+//                vo.setEnCode(wxLoginService.getLiveEnCode(bo));
+//                url = String.format("%s%s%s?a=1&cid=%s&gid=%s&sid=%s", liveGotoURL,live,section.getLiveUrl(), bo.getCourseId(), bo.getGoodsId(), bo.getSectionId());
+//                break;
+//            case 3://回放 my-live-detail/
+//                String detail = "my-live-detail/";
+//                vo.setEnCode(wxLoginService.getBackEnCode(bo));
+//                url = String.format("%s%s%s?a=1&cid=%s&gid=%s&sid=%s", liveGotoURL,detail,bo.getGoodsId(), bo.getCourseId(), bo.getGoodsId(), bo.getSectionId());
+//                break;
+//            default:
+//                throw new CustomException("课程节类型不正确,请检查");
+//        }
         vo.setEnCodePC(url);
         CourseSectionWatchPer watchPer = getOne(new LambdaQueryWrapper<CourseSectionWatchPer>()
                 .eq(ObjectUtils.isNotNull(bo.getCourseId()), CourseSectionWatchPer::getCourseId, bo.getCourseId())
@@ -145,6 +148,7 @@ public class CourseSectionWatchPerServiceImpl extends ServiceImpl<CourseSectionW
         watchVo.setChannelId(courseSection.getLiveUrl());
         watchVo.setCheckStatus(1);
         watchVo.setSectionType(courseSection.getSectionType());
+        watchVo.setRecordingUrl(courseSection.getRecordingUrl());
         return watchVo;
     }
 }

+ 9 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/UserPeriodServiceImpl.java

@@ -171,8 +171,16 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
     @Transactional(rollbackFor = Exception.class)
     public Boolean updateByEditBo(UserPeriodEditBo bo) {
         LoginUser loginUser = SecurityUtils.getLoginUser();
+        UserPeriodStatusVo oldData = userPeriodStatusService.queryById(bo.getId());
+        Long goodsId;
+        if (ObjectUtils.isNotNull(bo.getGoodsId())){
+            goodsId = bo.getGoodsId();
+        }else {
+            UserPeriod period = getById(oldData.getPeriodId());
+            goodsId = period.getGoodsId();
+        }
         //获取业务学时审核数据
-        Goods goods = iGoodsService.getById(bo.getGoodsId());
+        Goods goods = iGoodsService.getById(goodsId);
         CourseBusiness business = iCourseBusinessService.getById(goods.getBusinessId());
         if (ObjectUtils.isNull(business.getPeriodType()) || business.getPeriodType() == 1){
             //人工审核
@@ -183,7 +191,6 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
                 }
             }
             //获取旧的状态
-            UserPeriodStatusVo oldData = userPeriodStatusService.queryById(bo.getId());
             if (oldData.getStatus() != 2) {
                 throw new CustomException("无法修改非待审核记录");
             }