瀏覽代碼

fix 直播

he2802 3 年之前
父節點
當前提交
97ee427394
共有 17 個文件被更改,包括 220 次插入99 次删除
  1. 8 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/user/UserStudyRecordController.java
  2. 2 0
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java
  3. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsRefundServiceImpl.java
  4. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/polyv/service/IPolyvLiveService.java
  5. 38 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/polyv/service/impl/PolyvLiveServiceImpl.java
  6. 93 95
      zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/impl/ScheduleServiceImpl.java
  7. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserStudyRecordAddBo.java
  8. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserStudyRecordEditBo.java
  9. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserStudyRecordPhotoAddBo.java
  10. 5 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserStudyRecordQueryBo.java
  11. 2 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/domain/UserStudyRecord.java
  12. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserStudyRecordMapper.java
  13. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserStudyRecordService.java
  14. 20 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java
  15. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/SectionStudyRecordVo.java
  16. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserStudyRecordVo.java
  17. 21 0
      zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordMapper.xml

+ 8 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/user/UserStudyRecordController.java

@@ -134,4 +134,12 @@ public class UserStudyRecordController extends BaseController {
         List<SectionStudyRecordVo> list = iUserStudyRecordService.listUserRecord(bo);
         return getDataTable(list);
     }
+
+    @ApiOperation("查询用户最后一次看的直播间的信息")
+    @GetMapping("/getLastLive")
+    public AjaxResult<SectionStudyRecordVo> getLastLive(UserStudyRecordQueryBo bo) throws Exception {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setUserId(loginUser.getUser().getUserId());
+        return AjaxResult.success(iUserStudyRecordService.getLastLive(bo));
+    }
 }

+ 2 - 0
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java

@@ -763,6 +763,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
                     throw new CustomException("用户姓名缺失");
                 }
                 UserSystemRegisterBo registerBo = BeanUtil.toBean(bo, UserSystemRegisterBo.class);
+                registerBo.setTel(bo.getTelphone());
+                registerBo.setRegisterPlat("4");
                 Long userId = systemRegisterUser(registerBo);
                 if(userId.longValue()>0){
                     UserIdCardBatchVo user = BeanUtil.toBean(bo, UserIdCardBatchVo.class);

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsRefundServiceImpl.java

@@ -182,6 +182,9 @@ public class OrderGoodsRefundServiceImpl extends ServiceImpl<OrderGoodsRefundMap
                 throw new CustomException("不满足退款");
             }
         }
+        if(goods.getGoodsType()==6){
+            throw new CustomException("直播商品不能退款");
+        }
         OrderGoodsRefund add = getOne(new LambdaQueryWrapper<OrderGoodsRefund>().eq(OrderGoodsRefund::getGoodsId,bo.getGoodsId()).eq(OrderGoodsRefund::getOrderSn,bo.getOrderSn()));
         String out_trade_no = null;
         if(Validator.isNotEmpty(add)){

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

@@ -11,6 +11,7 @@ import com.zhongzheng.modules.polyv.vo.PolyvCataData;
 import com.zhongzheng.modules.polyv.vo.PolyvVideoQuerVo;
 import com.zhongzheng.modules.polyv.vo.PolyvVideoVo;
 import com.zhongzheng.modules.polyv.vo.PolyvVo;
+import net.polyv.live.v1.entity.channel.operate.LiveChannelBasicInfoResponse;
 import net.polyv.live.v1.entity.channel.playback.LiveChannelVideoListResponse;
 import net.polyv.live.v1.entity.channel.playback.LiveListChannelSessionInfoResponse;
 
@@ -33,5 +34,8 @@ public interface IPolyvLiveService {
 	Map<String,Object> getLiveSign(PolyvLiveQueryBo bo) throws IOException, NoSuchAlgorithmException;
 
 	LiveChannelVideoListResponse.ChannelVedioInfo getListChannelSession(PolyvLiveQueryBo bo) throws Exception, NoSuchAlgorithmException;
+
 	LiveChannelVideoListResponse.ChannelVedioInfo getChannelVideo(PolyvLiveQueryBo bo) throws IOException, NoSuchAlgorithmException;
+
+	LiveChannelBasicInfoResponse GetChannelBasicInfo(PolyvLiveQueryBo bo) throws Exception, NoSuchAlgorithmException;
 }

+ 38 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/polyv/service/impl/PolyvLiveServiceImpl.java

@@ -41,6 +41,8 @@ import net.polyv.common.v1.exception.PloyvSdkException;
 import net.polyv.live.v1.constant.LiveConstant;
 import net.polyv.live.v1.entity.channel.operate.LiveChannelAuthTokenRequest;
 import net.polyv.live.v1.entity.channel.operate.LiveChannelAuthTokenResponse;
+import net.polyv.live.v1.entity.channel.operate.LiveChannelBasicInfoRequest;
+import net.polyv.live.v1.entity.channel.operate.LiveChannelBasicInfoResponse;
 import net.polyv.live.v1.entity.channel.playback.LiveChannelVideoListRequest;
 import net.polyv.live.v1.entity.channel.playback.LiveChannelVideoListResponse;
 import net.polyv.live.v1.entity.channel.playback.LiveListChannelSessionInfoRequest;
@@ -150,8 +152,6 @@ public class PolyvLiveServiceImpl implements IPolyvLiveService {
                     bo.setSessionId(sessionInfo.getSessionId());
                     return getChannelVideo(bo);
                 }
-                System.out.println("测试查询频道直播场次信息成功{}");
-                System.out.println(JSON.toJSONString(liveListChannelSessionInfoResponse));
                 //to do something ......
        //         log.debug("测试查询频道直播场次信息成功{}", JSON.toJSONString(liveListChannelSessionInfoResponse));
             }
@@ -165,6 +165,13 @@ public class PolyvLiveServiceImpl implements IPolyvLiveService {
         return null;
     }
 
+    /**
+     * 获取场次基本信息
+     * @param bo
+     * @return
+     * @throws IOException
+     * @throws NoSuchAlgorithmException
+     */
     @Override
     public LiveChannelVideoListResponse.ChannelVedioInfo getChannelVideo(PolyvLiveQueryBo bo) throws IOException, NoSuchAlgorithmException {
         LiveChannelVideoListRequest liveChannelVideoListRequest = new LiveChannelVideoListRequest();
@@ -192,4 +199,33 @@ public class PolyvLiveServiceImpl implements IPolyvLiveService {
         }
         return null;
     }
+
+
+    /**
+     * 获取频道基本信息
+     * @param bo
+     * @return
+     * @throws Exception
+     * @throws NoSuchAlgorithmException
+     */
+    @Override
+    public LiveChannelBasicInfoResponse GetChannelBasicInfo(PolyvLiveQueryBo bo) throws Exception, NoSuchAlgorithmException {
+        LiveChannelBasicInfoRequest liveChannelBasicInfoRequest = new LiveChannelBasicInfoRequest();
+        LiveChannelBasicInfoResponse liveChannelBasicInfoResponse;
+        try {
+            liveChannelBasicInfoRequest.setChannelId(bo.getChannelId());
+            liveChannelBasicInfoResponse = new LiveChannelOperateServiceImpl().getChannelBasicInfo(
+                    liveChannelBasicInfoRequest);
+            if (liveChannelBasicInfoResponse != null) {
+               System.out.println(liveChannelBasicInfoResponse);
+            }
+        } catch (PloyvSdkException e) {
+
+            // 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
+            throw e;
+        } catch (Exception e) {
+            throw e;
+        }
+        return null;
+    }
 }

+ 93 - 95
zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/impl/ScheduleServiceImpl.java

@@ -308,7 +308,7 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                     Map<String, Object> param = new HashMap<>();
                     param.put("goods", goodsVo1.getGoodsName());
                     ResultBean rb = IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), OpenTheGoodsCode);
-                    if(Validator.isNotEmpty(rb)){
+                    if (Validator.isNotEmpty(rb)) {
                         iInformUserService.insertByAddBo(informUserAddBo);
                     }
 
@@ -333,14 +333,14 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                     param.put("goods", goodsVo1.getGoodsName());
                     param.put("name", "");
                     ResultBean rb = IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), informationNotificationCode);
-                    if(Validator.isNotEmpty(rb)){
+                    if (Validator.isNotEmpty(rb)) {
                         iInformUserService.insertByAddBo(informUserAddBo);
                     }
                 }
             }
         }
         //同步用户购买商品的考试次数和前培次数
-    //    sendGoods();
+        //    sendGoods();
         return "请求成功";
     }
 
@@ -388,8 +388,8 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
             String res;
             String resEnd;
             SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
-            Long timeId = classTwentyGradeUserVo.getClassStartTime()*1000;
-            Long timeEndId = classTwentyGradeUserVo.getClassStartTime()*1000;
+            Long timeId = classTwentyGradeUserVo.getClassStartTime() * 1000;
+            Long timeEndId = classTwentyGradeUserVo.getClassStartTime() * 1000;
             Date date = new Date(timeId);
             Date dateEnd = new Date(timeEndId);
             res = simpleDateFormat.format(date);
@@ -408,10 +408,10 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                 informUserAddBo.setGradeId(classTwentyGradeUserVo.getGradeId());
                 informUserAddBo.setGoodsId(classTwentyGradeUserVo.getGoodsId());
                 GoodsVo goodsVo1 = iGoodsService.queryById(classTwentyGradeUserVo.getGoodsId());
-                informUserAddBo.setText("尊敬的用户:您购买的课程班级有效期还剩20天,未在"+resEnd+"前完成全部学时,可能会影响审核进度,最终导致学时无效,请尽快完成学习");
+                informUserAddBo.setText("尊敬的用户:您购买的课程班级有效期还剩20天,未在" + resEnd + "前完成全部学时,可能会影响审核进度,最终导致学时无效,请尽快完成学习");
                 iInformUserService.insertByAddBo(informUserAddBo);
             }
-            if (informTwentyRemindVo.getNoteStatus().equals(1)){
+            if (informTwentyRemindVo.getNoteStatus().equals(1)) {
                 InformUserAddBo informUserAddBo = new InformUserAddBo();
                 informUserAddBo.setUserId(classTwentyGradeUserVo.getUserId());
                 informUserAddBo.setSendTime(DateUtils.getNowTime());
@@ -424,13 +424,13 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                 informUserAddBo.setGoodsId(classTwentyGradeUserVo.getGoodsId());
                 informUserAddBo.setGradeId(classTwentyGradeUserVo.getGradeId());
                 GoodsVo goodsVo1 = iGoodsService.queryById(classTwentyGradeUserVo.getGoodsId());
-                informUserAddBo.setText("尊敬的用户:您购买的"+goodsVo1.getGoodsName()+"课程班级有效期还剩20天,未在"+resEnd+"前完成全部学时,可能会影响审核进度,最终导致学时无效,请尽快完成学习");
+                informUserAddBo.setText("尊敬的用户:您购买的" + goodsVo1.getGoodsName() + "课程班级有效期还剩20天,未在" + resEnd + "前完成全部学时,可能会影响审核进度,最终导致学时无效,请尽快完成学习");
                 UserVo userVo = iUserService.queryById(classTwentyGradeUserVo.getUserId());
                 Map<String, Object> param = new HashMap<>();
                 param.put("goods", goodsVo1.getGoodsName());
                 param.put("time", resEnd);
                 param.put("day", 20);
-                if(Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), remainingDaysValidityCode))){
+                if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), remainingDaysValidityCode))) {
                     iInformUserService.insertByAddBo(informUserAddBo);
                 }
             }
@@ -440,8 +440,8 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
             String res;
             String resEnd;
             SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
-            Long timeId = classTenGradeUserVo.getClassStartTime()*1000;
-            Long timeEndId = classTenGradeUserVo.getClassStartTime()*1000;
+            Long timeId = classTenGradeUserVo.getClassStartTime() * 1000;
+            Long timeEndId = classTenGradeUserVo.getClassStartTime() * 1000;
             Date date = new Date(timeId);
             Date dateEnd = new Date(timeEndId);
             res = simpleDateFormat.format(date);
@@ -460,10 +460,10 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                 informUserAddBo.setGradeId(classTenGradeUserVo.getGradeId());
                 informUserAddBo.setGoodsId(classTenGradeUserVo.getGoodsId());
                 GoodsVo goodsVo1 = iGoodsService.queryById(classTenGradeUserVo.getGoodsId());
-                informUserAddBo.setText("尊敬的用户:您购买的课程班级有效期还剩10天,未在"+resEnd+"前完成全部学时,可能会影响审核进度,最终导致学时无效,请尽快完成学习");
+                informUserAddBo.setText("尊敬的用户:您购买的课程班级有效期还剩10天,未在" + resEnd + "前完成全部学时,可能会影响审核进度,最终导致学时无效,请尽快完成学习");
                 iInformUserService.insertByAddBo(informUserAddBo);
             }
-            if (informTenRemindVo.getNoteStatus().equals(1)){
+            if (informTenRemindVo.getNoteStatus().equals(1)) {
                 InformUserAddBo informUserAddBo = new InformUserAddBo();
                 informUserAddBo.setUserId(classTenGradeUserVo.getUserId());
                 informUserAddBo.setSendTime(DateUtils.getNowTime());
@@ -476,14 +476,14 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                 informUserAddBo.setGoodsId(classTenGradeUserVo.getGoodsId());
                 informUserAddBo.setGradeId(classTenGradeUserVo.getGradeId());
                 GoodsVo goodsVo1 = iGoodsService.queryById(classTenGradeUserVo.getGoodsId());
-                informUserAddBo.setText("尊敬的用户:您购买的"+goodsVo1.getGoodsName()+"课程班级有效期还剩10天,未在"+resEnd+"前完成全部学时,可能会影响审核进度,最终导致学时无效,请尽快完成学习");
+                informUserAddBo.setText("尊敬的用户:您购买的" + goodsVo1.getGoodsName() + "课程班级有效期还剩10天,未在" + resEnd + "前完成全部学时,可能会影响审核进度,最终导致学时无效,请尽快完成学习");
 
                 UserVo userVo = iUserService.queryById(classTenGradeUserVo.getUserId());
                 Map<String, Object> param = new HashMap<>();
                 param.put("goods", goodsVo1.getGoodsName());
                 param.put("time", resEnd);
                 param.put("day", 10);
-                if(Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), remainingDaysValidityCode))){
+                if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), remainingDaysValidityCode))) {
                     iInformUserService.insertByAddBo(informUserAddBo);
                 }
             }
@@ -493,8 +493,8 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
             String res;
             String resEnd;
             SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
-            Long timeId = classFiveGradeUserVo.getClassStartTime()*1000;
-            Long timeEndId = classFiveGradeUserVo.getClassStartTime()*1000;
+            Long timeId = classFiveGradeUserVo.getClassStartTime() * 1000;
+            Long timeEndId = classFiveGradeUserVo.getClassStartTime() * 1000;
             Date date = new Date(timeId);
             Date dateEnd = new Date(timeEndId);
             res = simpleDateFormat.format(date);
@@ -513,10 +513,10 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                 informUserAddBo.setGradeId(classFiveGradeUserVo.getGradeId());
                 informUserAddBo.setGoodsId(classFiveGradeUserVo.getGoodsId());
                 GoodsVo goodsVo1 = iGoodsService.queryById(classFiveGradeUserVo.getGoodsId());
-                informUserAddBo.setText("尊敬的用户:您购买的课程班级有效期还剩5天,未在"+resEnd+"前完成全部学时,可能会影响审核进度,最终导致学时无效,请尽快完成学习");
+                informUserAddBo.setText("尊敬的用户:您购买的课程班级有效期还剩5天,未在" + resEnd + "前完成全部学时,可能会影响审核进度,最终导致学时无效,请尽快完成学习");
                 iInformUserService.insertByAddBo(informUserAddBo);
             }
-            if (informTenRemindVo.getNoteStatus().equals(1)){
+            if (informTenRemindVo.getNoteStatus().equals(1)) {
                 InformUserAddBo informUserAddBo = new InformUserAddBo();
                 informUserAddBo.setUserId(classFiveGradeUserVo.getUserId());
                 informUserAddBo.setSendTime(DateUtils.getNowTime());
@@ -529,13 +529,13 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                 informUserAddBo.setGoodsId(classFiveGradeUserVo.getGoodsId());
                 informUserAddBo.setGradeId(classFiveGradeUserVo.getGradeId());
                 GoodsVo goodsVo1 = iGoodsService.queryById(classFiveGradeUserVo.getGoodsId());
-                informUserAddBo.setText("尊敬的用户:您购买的"+goodsVo1.getGoodsName()+"课程班级有效期还剩5天,未在"+resEnd+"前完成全部学时,可能会影响审核进度,最终导致学时无效,请尽快完成学习");
+                informUserAddBo.setText("尊敬的用户:您购买的" + goodsVo1.getGoodsName() + "课程班级有效期还剩5天,未在" + resEnd + "前完成全部学时,可能会影响审核进度,最终导致学时无效,请尽快完成学习");
                 UserVo userVo = iUserService.queryById(classFiveGradeUserVo.getUserId());
                 Map<String, Object> param = new HashMap<>();
                 param.put("goods", goodsVo1.getGoodsName());
                 param.put("time", resEnd);
                 param.put("day", 5);
-                if(Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), remainingDaysValidityCode))){
+                if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), remainingDaysValidityCode))) {
                     iInformUserService.insertByAddBo(informUserAddBo);
                 }
             }
@@ -551,7 +551,7 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
         for (UserSubscribeVo subscribeVo : userSubscribeVo) {
             String res;
             SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
-            Long timeId = subscribeVo.getApplySiteExamTime()*1000;
+            Long timeId = subscribeVo.getApplySiteExamTime() * 1000;
             Date date = new Date(timeId);
             res = simpleDateFormat.format(date);
             String startTime = subscribeVo.getApplySiteStartTime();
@@ -568,11 +568,11 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                 informUserAddBo.setRemind("考试提醒");
                 informUserAddBo.setGoodsId(subscribeVo.getGoodsId());
                 GoodsVo goodsVo1 = iGoodsService.queryById(subscribeVo.getGoodsId());
-                informUserAddBo.setText("尊敬的用户:您预约的施工现场专业人员"+goodsVo1.getGoodsName()+"考试将在"+res+"("+startTime+"-"+endTime+")进行," +
-                        "考试地点:"+subscribeVo.getApplySiteAddress()+"");
+                informUserAddBo.setText("尊敬的用户:您预约的施工现场专业人员" + goodsVo1.getGoodsName() + "考试将在" + res + "(" + startTime + "-" + endTime + ")进行," +
+                        "考试地点:" + subscribeVo.getApplySiteAddress() + "");
                 iInformUserService.insertByAddBo(informUserAddBo);
             }
-            if (informRemindVo.getNoteStatus().equals(1)){
+            if (informRemindVo.getNoteStatus().equals(1)) {
                 InformUserAddBo informUserAddBo = new InformUserAddBo();
                 informUserAddBo.setUserId(subscribeVo.getUserId());
                 informUserAddBo.setSendTime(DateUtils.getNowTime());
@@ -584,14 +584,14 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                 informUserAddBo.setRemind("考试提醒");
                 informUserAddBo.setGoodsId(subscribeVo.getGoodsId());
                 GoodsVo goodsVo1 = iGoodsService.queryById(subscribeVo.getGoodsId());
-                informUserAddBo.setText("尊敬的用户:您预约的施工现场专业人员"+goodsVo1.getGoodsName()+"考试将在"+res+"("+startTime+"-"+endTime+")进行," +
-                        "考试地点:"+subscribeVo.getApplySiteAddress()+"");
+                informUserAddBo.setText("尊敬的用户:您预约的施工现场专业人员" + goodsVo1.getGoodsName() + "考试将在" + res + "(" + startTime + "-" + endTime + ")进行," +
+                        "考试地点:" + subscribeVo.getApplySiteAddress() + "");
                 UserVo userVo = iUserService.queryById(subscribeVo.getUserId());
                 Map<String, Object> param = new HashMap<>();
                 param.put("goods", goodsVo1.getGoodsName());
-                param.put("time", res+"("+startTime+"-"+endTime+")");
+                param.put("time", res + "(" + startTime + "-" + endTime + ")");
                 param.put("address", subscribeVo.getApplySiteAddress());
-                if(Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), examinationRemind))){
+                if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), examinationRemind))) {
                     iInformUserService.insertByAddBo(informUserAddBo);
                 }
             }
@@ -601,11 +601,11 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
     @Override
     public void closeTimeOutOrder() {
         OrderQueryBo bo = new OrderQueryBo();
-        Integer[] status={0};
+        Integer[] status = {0};
         bo.setOrderStatus(status);
         List<OrderListVo> list = iOrderService.selectListApp(bo);
         for (OrderListVo orderVo : list) {
-            if(orderVo.getCreateTime().longValue()<(new Long(DateUtils.getNowTime()-(24*3600))).longValue()){
+            if (orderVo.getCreateTime().longValue() < (new Long(DateUtils.getNowTime() - (24 * 3600))).longValue()) {
                 //超过24小时
                 Order order = new Order();
                 order.setOrderId(orderVo.getOrderId());
@@ -615,9 +615,9 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                 iOrderService.updateById(order);
                 //关闭锁定班级
                 LambdaQueryWrapper<ClassGradeUserTemp> lqwLock = new LambdaQueryWrapper<>();
-                lqwLock.eq(ClassGradeUserTemp::getOrderSn,orderVo.getOrderSn());
+                lqwLock.eq(ClassGradeUserTemp::getOrderSn, orderVo.getOrderSn());
                 ClassGradeUserTemp classGradeUserTemp = iClassGradeUserTempService.getOne(lqwLock);
-                if(classGradeUserTemp!=null&&classGradeUserTemp.getStatus()==ClassGradeUserTemp.STATUS_LOCK){
+                if (classGradeUserTemp != null && classGradeUserTemp.getStatus() == ClassGradeUserTemp.STATUS_LOCK) {
                     classGradeUserTemp.setStatus(ClassGradeUserTemp.STATUS_CLOSE); //
                     classGradeUserTemp.setUpdateTime(DateUtils.getNowTime());
                     iClassGradeUserTempService.updateById(classGradeUserTemp);//关闭锁定状态
@@ -640,12 +640,12 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
             statusList.add(2);
             LambdaQueryWrapper<InformUser> lqw = Wrappers.lambdaQuery();
             lqw.eq(InformUser::getInformId, informVo.getInformId());
-            lqw.in(InformUser::getSendStatus,statusList);
+            lqw.in(InformUser::getSendStatus, statusList);
             InformUser informUser = new InformUser();
             informUser.setSendTime(DateUtils.getNowTime());
             informUser.setSendStatus(1);
             informUser.setUpdateTime(DateUtils.getNowTime());
-            iInformUserService.update(informUser,lqw);
+            iInformUserService.update(informUser, lqw);
         }
         updateApply();
     }
@@ -702,8 +702,8 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                     for (Long seLong : seLongs) {
                         allNum += seLong;
                     }
-                    Long reduce = baseMapper.selectGoodsPlanCount(aLong,userPlanVo.getPlanId());
-                    sumUp = allNum-reduce;
+                    Long reduce = baseMapper.selectGoodsPlanCount(aLong, userPlanVo.getPlanId());
+                    sumUp = allNum - reduce;
                     //计算每天需要学习多少节课
                     int Sec = (int) Math.ceil((double) allNum / dutyDays);
                     secAll += Sec;
@@ -715,7 +715,7 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                                 }
                                 Calendar c5 = Calendar.getInstance();
                                 if (dayStudyVo.getDate() <= c5.get(Calendar.DAY_OF_MONTH) && clCalendarStudyVo.getMonth() == (c5.get(Calendar.MONTH) + 1) && clCalendarStudyVo.getYear() == (c5.get(Calendar.YEAR))) {
-                                    if(Validator.isNotEmpty(dayStudyVo.getPerform())&&dayStudyVo.getPerform().equals(0)){
+                                    if (Validator.isNotEmpty(dayStudyVo.getPerform()) && dayStudyVo.getPerform().equals(0)) {
                                         //过期且没完成
                                         dayStudyVo.setPerform(2);
                                     }
@@ -775,7 +775,7 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
             Calendar calendar = Calendar.getInstance();
             calendar.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));
             calendar.setTimeInMillis(System.currentTimeMillis());
-            if ((examApplyVo.getApplyEndTime()) < calendar.getTimeInMillis()/1000){
+            if ((examApplyVo.getApplyEndTime()) < calendar.getTimeInMillis() / 1000) {
                 ExamApply update = new ExamApply();
                 update.setApplyId(examApplyVo.getApplyId());
                 update.setStatus(2);
@@ -790,7 +790,7 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
             Calendar calendar = Calendar.getInstance();
             calendar.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));
             calendar.setTimeInMillis(System.currentTimeMillis());
-            if ((examBeforeVo.getBeforeEndTime()) < calendar.getTimeInMillis()/1000){
+            if ((examBeforeVo.getBeforeEndTime()) < calendar.getTimeInMillis() / 1000) {
                 ExamBefore update = new ExamBefore();
                 update.setBeforeId(examBeforeVo.getBeforeId());
                 update.setStatus(2);
@@ -810,10 +810,10 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
             Calendar calendar = Calendar.getInstance();
             calendar.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));
             calendar.setTimeInMillis(System.currentTimeMillis());
-            if ((userPlanVo.getEndTime()) < calendar.getTimeInMillis()/1000 && userPlanVo.getStatus().equals(1)){
-                if (userPlanVo.getPitchNum().equals(userPlanVo.getStudyNum())){
+            if ((userPlanVo.getEndTime()) < calendar.getTimeInMillis() / 1000 && userPlanVo.getStatus().equals(1)) {
+                if (userPlanVo.getPitchNum().equals(userPlanVo.getStudyNum())) {
                     userPlan.setStatus(2);
-                }else {
+                } else {
                     userPlan.setStatus(3);
                 }
                 userPlanMapper.updateById(userPlan);
@@ -888,13 +888,13 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
     @Override
     public void bindBefore(UserQueryBo bo) {
         List<ExamBeforeVo> list = examBeforeMapper.queryBindBefore(new ExamBeforeQueryBo());
-        if(Validator.isNotEmpty(list)){
-            for(ExamBeforeVo vo : list){
+        if (Validator.isNotEmpty(list)) {
+            for (ExamBeforeVo vo : list) {
                 //报考数据绑定前培
                 LambdaUpdateWrapper<UserSubscribe> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
                 objectLambdaUpdateWrapper.eq(UserSubscribe::getSubscribeId, vo.getSubscribeId());
                 objectLambdaUpdateWrapper.set(UserSubscribe::getBeforeId, vo.getBeforeId());
-                objectLambdaUpdateWrapper.set(UserSubscribe::getUpdateTime,DateUtils.getNowTime());
+                objectLambdaUpdateWrapper.set(UserSubscribe::getUpdateTime, DateUtils.getNowTime());
                 iUserSubscribeService.update(null, objectLambdaUpdateWrapper);
             }
         }
@@ -902,17 +902,18 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
 
     /**
      * 官方信息推送
+     *
      * @param bo
      */
     @Override
     public void officialInfoPush(UserQueryBo bo) {
         List<ClassGradeUserGoodsVo> list = iClassGradeUserService.selectOfficialNotPush(bo);
-        for(ClassGradeUserGoodsVo vo : list){
+        for (ClassGradeUserGoodsVo vo : list) {
             UserConfirmInfo confirmInfo = iUserConfirmInfoService.getOne(new LambdaQueryWrapper<UserConfirmInfo>()
                     .eq(UserConfirmInfo::getUserId, vo.getUserId()).eq(UserConfirmInfo::getOrderGoodsId, vo.getOrderGoodsId()
                     ).last("limit 1"));
             //有确认信息才允许推送
-            if(Validator.isNotEmpty(confirmInfo)){
+            if (Validator.isNotEmpty(confirmInfo)) {
                 ClassGradeUserQueryBo queryBo = new ClassGradeUserQueryBo();
                 queryBo.setGradeId(vo.getGradeId());
                 queryBo.setUserId(vo.getUserId());
@@ -923,12 +924,13 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
 
     /**
      * 官方学时推送
+     *
      * @param bo
      */
     @Override
     public void officialPeriodPush(UserQueryBo bo) {
         List<ClassGradeUserGoodsVo> list = iClassGradeUserService.selectPeriodNotPush(bo);
-        for(ClassGradeUserGoodsVo vo : list){
+        for (ClassGradeUserGoodsVo vo : list) {
             ClassGradeUserQueryBo queryBo = new ClassGradeUserQueryBo();
             queryBo.setGradeId(vo.getGradeId());
             queryBo.setUserId(vo.getUserId());
@@ -938,27 +940,28 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
 
     /**
      * 直播结束
+     *
      * @param bo
      */
     @Override
     public void overLive(UserQueryBo bo) {
         Long nowTime = DateUtils.getNowTime();
-        Long startTime = nowTime - 3600 * 24 ;
-        List<CourseSectionVo> list = iCourseSectionService.overSectionList(startTime,nowTime);
+        Long startTime = nowTime - 3600 * 24;
+        List<CourseSectionVo> list = iCourseSectionService.overSectionList(startTime, nowTime);
         List<Long> courseIds = new ArrayList<>();//课程ID
         List<ClassPeriodVo> periodList = new ArrayList<>();//学时列表
-        for(CourseSectionVo sectionVo : list){
+        for (CourseSectionVo sectionVo : list) {
             System.out.println(sectionVo.getSectionId());
             //当节为根目录时
             CourseMenuQueryBo menuQueryBo = new CourseMenuQueryBo();
             menuQueryBo.setType(3);
             menuQueryBo.setMenuId(sectionVo.getSectionId());
-            List<CourseMenuVo> menuList =  iCourseMenuService.queryList(menuQueryBo);
-            for(CourseMenuVo menuVo : menuList){
+            List<CourseMenuVo> menuList = iCourseMenuService.queryList(menuQueryBo);
+            for (CourseMenuVo menuVo : menuList) {
                 GoodsCourseQueryBo courseQueryBo = new GoodsCourseQueryBo();
                 courseQueryBo.setCourseId(menuVo.getCourseId());
                 List<GoodsCourseVo> goodsList = iGoodsCourseService.queryList(courseQueryBo);
-                for(GoodsCourseVo goodsCourseVo :goodsList){
+                for (GoodsCourseVo goodsCourseVo : goodsList) {
                     ClassPeriodVo periodVo = new ClassPeriodVo();
                     periodVo.setGoodsId(goodsCourseVo.getGoodsId());
                     periodVo.setCourseId(menuVo.getCourseId());
@@ -972,18 +975,18 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
             //当节在章下
             CourseChapterSectionQueryBo chapterSectionQueryBo = new CourseChapterSectionQueryBo();
             chapterSectionQueryBo.setSectionId(sectionVo.getSectionId());
-            List<CourseChapterSectionVo> chapterList =  iCourseChapterSectionService.queryList(chapterSectionQueryBo);
-            for(CourseChapterSectionVo chapterSectionVo : chapterList){
+            List<CourseChapterSectionVo> chapterList = iCourseChapterSectionService.queryList(chapterSectionQueryBo);
+            for (CourseChapterSectionVo chapterSectionVo : chapterList) {
                 //当章在根目录时
                 CourseMenuQueryBo menuQueryBo2 = new CourseMenuQueryBo();
                 menuQueryBo2.setType(2);
                 menuQueryBo2.setMenuId(chapterSectionVo.getChapterId());
-                List<CourseMenuVo> menuList2 =  iCourseMenuService.queryList(menuQueryBo2);
-                for(CourseMenuVo menuVo : menuList2){
+                List<CourseMenuVo> menuList2 = iCourseMenuService.queryList(menuQueryBo2);
+                for (CourseMenuVo menuVo : menuList2) {
                     GoodsCourseQueryBo courseQueryBo = new GoodsCourseQueryBo();
                     courseQueryBo.setCourseId(menuVo.getCourseId());
                     List<GoodsCourseVo> goodsList = iGoodsCourseService.queryList(courseQueryBo);
-                    for(GoodsCourseVo goodsCourseVo :goodsList){
+                    for (GoodsCourseVo goodsCourseVo : goodsList) {
                         ClassPeriodVo periodVo = new ClassPeriodVo();
                         periodVo.setGoodsId(goodsCourseVo.getGoodsId());
                         periodVo.setCourseId(menuVo.getCourseId());
@@ -998,17 +1001,17 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                 CourseModuleChapterQueryBo moduleChapterQueryBo = new CourseModuleChapterQueryBo();
                 moduleChapterQueryBo.setChapterId(chapterSectionVo.getChapterId());
                 List<CourseModuleChapterVo> moduleList = iCourseModuleChapterService.queryList(moduleChapterQueryBo);
-                for(CourseModuleChapterVo moduleChapterVo : moduleList){
+                for (CourseModuleChapterVo moduleChapterVo : moduleList) {
                     //当模块在根目录时
                     CourseMenuQueryBo menuQueryBo3 = new CourseMenuQueryBo();
                     menuQueryBo3.setType(1);
                     menuQueryBo3.setMenuId(moduleChapterVo.getModuleId());
-                    List<CourseMenuVo> menuList3 =  iCourseMenuService.queryList(menuQueryBo3);
-                    for(CourseMenuVo menuVo : menuList3){
+                    List<CourseMenuVo> menuList3 = iCourseMenuService.queryList(menuQueryBo3);
+                    for (CourseMenuVo menuVo : menuList3) {
                         GoodsCourseQueryBo courseQueryBo = new GoodsCourseQueryBo();
                         courseQueryBo.setCourseId(menuVo.getCourseId());
                         List<GoodsCourseVo> goodsList = iGoodsCourseService.queryList(courseQueryBo);
-                        for(GoodsCourseVo goodsCourseVo :goodsList){
+                        for (GoodsCourseVo goodsCourseVo : goodsList) {
                             ClassPeriodVo periodVo = new ClassPeriodVo();
                             periodVo.setGoodsId(goodsCourseVo.getGoodsId());
                             periodVo.setCourseId(menuVo.getCourseId());
@@ -1023,9 +1026,9 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
         }
 
         //获取所有直播结束节对应的用户班级列表
-        for(ClassPeriodVo periodVo :periodList){
+        for (ClassPeriodVo periodVo : periodList) {
             List<ClassGradeUserGoodsVo> gradeList = iClassGradeUserService.selectGoodsGradeList(periodVo.getGoodsId());
-            for(ClassGradeUserGoodsVo gradeUserGoodsVo : gradeList){
+            for (ClassGradeUserGoodsVo gradeUserGoodsVo : gradeList) {
                 UserStudyRecord entity = BeanUtil.toBean(periodVo, UserStudyRecord.class);
                 entity.setGradeId(gradeUserGoodsVo.getGradeId());
                 entity.setUserId(gradeUserGoodsVo.getUserId());
@@ -1059,7 +1062,7 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                 }
                 ClassPeriodVo queryBo = BeanUtil.toBean(entity, ClassPeriodVo.class);
                 Integer status = iUserStudyRecordService.getStudyStatus(queryBo);
-                if(Validator.isEmpty(status)||status!=1){
+                if (Validator.isEmpty(status) || status != 1) {
                     UserStudyRecord add = BeanUtil.toBean(entity, UserStudyRecord.class);
                     add.setCreateTime(DateUtils.getNowTime());
                     add.setUpdateTime(DateUtils.getNowTime());
@@ -1081,22 +1084,22 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
     @Override
     public void liveToReplay(UserQueryBo bo) {
         Long nowTime = DateUtils.getNowTime();
-        Long startTime = nowTime - 3600 * 24 ;
+        Long startTime = nowTime - 3600 * 24;
         //获取今天直播结束的所有直播节
-        List<CourseSectionVo> list = iCourseSectionService.overSectionList(startTime,nowTime);
-        for(CourseSectionVo sectionVo : list){
+        List<CourseSectionVo> list = iCourseSectionService.overSectionList(startTime, nowTime);
+        for (CourseSectionVo sectionVo : list) {
             PolyvLiveQueryBo queryBo = new PolyvLiveQueryBo();
-            try{
+            try {
                 queryBo.setChannelId(sectionVo.getLiveUrl()); //频道房间ID
                 LiveChannelVideoListResponse.ChannelVedioInfo info = iPolyvLiveService.getListChannelSession(queryBo);
-                if(Validator.isNotEmpty(info)){
+                if (Validator.isNotEmpty(info)) {
                     //秒数误差在1个小时以内的判定为节的保利威直播
-                    if(Math.abs(sectionVo.getLiveEndTime().longValue()-(info.getEndTime().getTime()/1000))<3600){
-                        if("complete".equals(info.getRecordFileType())){
+                    if (Math.abs(sectionVo.getLiveEndTime().longValue() - (info.getEndTime().getTime() / 1000)) < 3600) {
+                        if ("complete".equals(info.getRecordFileType())) {
                             CourseSection oldSection = iCourseSectionService.getOne(new LambdaQueryWrapper<CourseSection>()
                                     .eq(CourseSection::getSessionId, info.getChannelSessionId())
                                     .last("limit 1"));
-                            if(Validator.isEmpty(oldSection)){
+                            if (Validator.isEmpty(oldSection)) {
                                 //录播完成状态且场次ID没被使用
                                 sectionVo.setSessionId(info.getChannelSessionId());//场次ID
                                 sectionVo.setRealDuration(info.getDuration().longValue()); //视频秒数
@@ -1108,25 +1111,21 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                                 section.setUpdateTime(DateUtils.getNowTime());
                                 iCourseSectionService.updateById(section);
                             }
-                            }
+                        }
                     }
                 }
-            }catch (Exception e){
-
+            } catch (Exception e) {
             }
-
-
         }
-
     }
 
     //获得可用学习天数
-    private static int getDutyDays(Date  startDateStr, Date endDateStr,Long[] longs,Long studyDay)  {
+    private static int getDutyDays(Date startDateStr, Date endDateStr, Long[] longs, Long studyDay) {
         int result = 0;
         Date endDate = endDateStr;
         Calendar c = Calendar.getInstance();
         c.setTime(endDate);
-        c.add(Calendar.DATE, - Convert.toInt(studyDay));
+        c.add(Calendar.DATE, -Convert.toInt(studyDay));
         endDate = c.getTime();
 
         Date startDate = startDateStr;
@@ -1140,7 +1139,7 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
             }
             startDate.setDate(startDate.getDate() + 1);
         }
-        return result-1;
+        return result - 1;
     }
 
     private void updateApply() throws ParseException {
@@ -1149,14 +1148,14 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
         List<UserSubscribeVo> userSubscribeVos = iUserSubscribeService.listSubscribe(userSubscribeQueryBo);
         for (UserSubscribeVo userSubscribeVo : userSubscribeVos) {
             Date date = new Date();
-            Long times = userSubscribeVo.getApplySiteExamTime()*1000;//时间戳
+            Long times = userSubscribeVo.getApplySiteExamTime() * 1000;//时间戳
             SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
             String dateString = formatter.format(times);
-            String dateForma =null;
-            dateForma = dateString+" "+userSubscribeVo.getApplySiteStartTime();
+            String dateForma = null;
+            dateForma = dateString + " " + userSubscribeVo.getApplySiteStartTime();
             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
             Long time = sdf.parse(dateForma).getTime() / 1000;
-            if (System.currentTimeMillis()/1000 > time){
+            if (System.currentTimeMillis() / 1000 > time) {
                 UserSubscribe userSubscribe = new UserSubscribe();
                 userSubscribe.setSubscribeId(userSubscribeVo.getSubscribeId());
                 userSubscribe.setExamExpend(1);
@@ -1166,26 +1165,25 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                 userExamGoodsQueryBo.setGoodsId(userSubscribeVo.getGoodsId());
                 userExamGoodsQueryBo.setUserId(userSubscribeVo.getUserId());
                 List<UserExamGoodsVo> userExamGoodsVos = userExamGoodsService.queryList(userExamGoodsQueryBo);
-                if (!CollectionUtils.isEmpty(userExamGoodsVos)){
+                if (!CollectionUtils.isEmpty(userExamGoodsVos)) {
                     UserExamGoodsVo userExamGoodsVo = userExamGoodsVos.get(0);
                     UserExamGoods userExamGoods = new UserExamGoods();
                     userExamGoods.setUpdateTime(DateUtils.getNowTime());
                     userExamGoods.setUserExamGoodsId(userExamGoodsVo.getUserExamGoodsId());
-                    userExamGoods.setExpendNumber(userExamGoodsVo.getExpendNumber()+1);
+                    userExamGoods.setExpendNumber(userExamGoodsVo.getExpendNumber() + 1);
                     userExamGoodsService.updateById(userExamGoods);
                 }
             }
         }
     }
 
-
     private void sendExamSubscribe() {
         List<ExamUserApplyVo> examUserApplyVos = iInformUserService.listUserApply();
         for (ExamUserApplyVo examUserApplyVo : examUserApplyVos) {
             InformRemindVo informRemindVo = informRemindService.queryById(13L);
             String res;
             SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
-            Long timeId = examUserApplyVo.getApplyEndTime()*1000;
+            Long timeId = examUserApplyVo.getApplyEndTime() * 1000;
             Date date = new Date(timeId);
             res = simpleDateFormat.format(date);
             if (informRemindVo.getWayStatus().equals(1)) {
@@ -1201,7 +1199,7 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                 informUserAddBo.setGoodsId(examUserApplyVo.getGoodsId());
                 informUserAddBo.setGradeId(examUserApplyVo.getGradeId());
                 GoodsVo goodsVo1 = iGoodsService.queryById(examUserApplyVo.getGoodsId());
-                informUserAddBo.setText("尊敬的用户:七大员新考考试预约已经开始,预约截至时间"+res+",请马上点击进行预约考试。");
+                informUserAddBo.setText("尊敬的用户:七大员新考考试预约已经开始,预约截至时间" + res + ",请马上点击进行预约考试。");
                 iInformUserService.insertByAddBo(informUserAddBo);
             }
             if (informRemindVo.getNoteStatus().equals(1)) {
@@ -1217,11 +1215,11 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                 informUserAddBo.setGoodsId(examUserApplyVo.getGoodsId());
                 GoodsVo goodsVo1 = iGoodsService.queryById(examUserApplyVo.getGoodsId());
                 informUserAddBo.setGradeId(examUserApplyVo.getGradeId());
-                informUserAddBo.setText("尊敬的用户:七大员新考考试预约已经开始,预约截至时间"+res+",请马上点击进行预约考试。");
+                informUserAddBo.setText("尊敬的用户:七大员新考考试预约已经开始,预约截至时间" + res + ",请马上点击进行预约考试。");
                 UserVo userVo = iUserService.queryById(examUserApplyVo.getUserId());
                 Map<String, Object> param = new HashMap<>();
                 param.put("time", res);
-                if(Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), bookingReminder))){
+                if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), bookingReminder))) {
                     iInformUserService.insertByAddBo(informUserAddBo);
                 }
             }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserStudyRecordAddBo.java

@@ -1,5 +1,6 @@
 package com.zhongzheng.modules.user.bo;
 
+import com.zhongzheng.common.annotation.Excel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -71,4 +72,8 @@ public class UserStudyRecordAddBo {
     /** 当前状态 1 当前状态 0过往状态 */
     @ApiModelProperty("当前状态 1 当前状态 0过往状态")
     private Integer currentStatus;
+    /** 订单商品ID */
+    @Excel(name = "订单商品ID")
+    @ApiModelProperty("订单商品ID")
+    private Long orderGoodsId;
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserStudyRecordEditBo.java

@@ -1,5 +1,6 @@
 package com.zhongzheng.modules.user.bo;
 
+import com.zhongzheng.common.annotation.Excel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -80,4 +81,8 @@ public class UserStudyRecordEditBo {
     /** 当前状态 1 当前状态 0过往状态 */
     @ApiModelProperty("当前状态 1 当前状态 0过往状态")
     private Integer currentStatus;
+    /** 订单商品ID */
+    @Excel(name = "订单商品ID")
+    @ApiModelProperty("订单商品ID")
+    private Long orderGoodsId;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserStudyRecordPhotoAddBo.java

@@ -1,5 +1,6 @@
 package com.zhongzheng.modules.user.bo;
 
+import com.zhongzheng.common.annotation.Excel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -40,4 +41,5 @@ public class UserStudyRecordPhotoAddBo {
 
     @ApiModelProperty("用户ID")
     private Long userId;
+
 }

+ 5 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserStudyRecordQueryBo.java

@@ -1,5 +1,6 @@
 package com.zhongzheng.modules.user.bo;
 
+import com.zhongzheng.common.annotation.Excel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -91,5 +92,8 @@ public class UserStudyRecordQueryBo extends BaseEntity {
 	/** 当前状态 1 当前状态 0过往状态 */
 	@ApiModelProperty("当前状态 1 当前状态 0过往状态")
 	private Integer currentStatus;
-
+	/** 订单商品ID */
+	@Excel(name = "订单商品ID")
+	@ApiModelProperty("订单商品ID")
+	private Long orderGoodsId;
 }

+ 2 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/domain/UserStudyRecord.java

@@ -63,5 +63,6 @@ private static final long serialVersionUID=1L;
     private Long firstStartTime;
     /** 当前状态 1 当前状态 0过往状态 */
     private Integer currentStatus;
-
+    /** 订单商品ID */
+    private Long orderGoodsId;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserStudyRecordMapper.java

@@ -80,4 +80,6 @@ public interface UserStudyRecordMapper extends BaseMapper<UserStudyRecord> {
     Integer getStudyStatus(ClassPeriodVo bo);
 
     List<SectionStudyRecordVo> listUserRecord(UserStudyRecordQueryBo bo);
+
+    SectionStudyRecordVo getLastLive(UserStudyRecordQueryBo bo);
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserStudyRecordService.java

@@ -88,4 +88,6 @@ public interface IUserStudyRecordService extends IService<UserStudyRecord> {
 
 	Integer getStudyStatus(ClassPeriodVo bo);
 
+	SectionStudyRecordVo getLastLive(UserStudyRecordQueryBo bo) throws Exception;
+
 }

+ 20 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java

@@ -42,11 +42,14 @@ import com.zhongzheng.modules.inform.service.IInformRemindService;
 import com.zhongzheng.modules.inform.service.IInformUserService;
 import com.zhongzheng.modules.inform.vo.InformRemindBusinessVo;
 import com.zhongzheng.modules.inform.vo.InformRemindVo;
+import com.zhongzheng.modules.polyv.bo.PolyvLiveQueryBo;
+import com.zhongzheng.modules.polyv.service.IPolyvLiveService;
 import com.zhongzheng.modules.user.bo.*;
 import com.zhongzheng.modules.user.domain.*;
 import com.zhongzheng.modules.user.mapper.UserStudyRecordMapper;
 import com.zhongzheng.modules.user.service.*;
 import com.zhongzheng.modules.user.vo.*;
+import net.polyv.live.v1.entity.channel.operate.LiveChannelBasicInfoResponse;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -124,6 +127,8 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
     @Autowired
     private IUserExamGoodsService iUserExamGoodsService;
     @Autowired
+    private IPolyvLiveService iPolyvLiveService;
+    @Autowired
     private  RedisCache redisCache;
     @Override
     public UserStudyRecordVo queryById(Long recordId) {
@@ -515,6 +520,21 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
         return this.baseMapper.getStudyStatus(bo);
     }
 
+    @Override
+    public SectionStudyRecordVo getLastLive(UserStudyRecordQueryBo bo) throws Exception {
+        SectionStudyRecordVo recordVo = this.baseMapper.getLastLive(bo);
+        if(Validator.isNotEmpty(recordVo)){
+            //获取频道号信息
+            PolyvLiveQueryBo queryBo = new PolyvLiveQueryBo();
+            queryBo.setChannelId(recordVo.getLiveUrl());
+            LiveChannelBasicInfoResponse infoResponse = iPolyvLiveService.GetChannelBasicInfo(queryBo);
+            if(Validator.isNotEmpty(infoResponse)){
+
+            }
+        }
+        return recordVo;
+    }
+
 
     //判断当前未看完的节是否是点击播放的节
     private boolean compareSection(UserStudyRecordVo recordVo,UserStudyRecordQueryBo entity){

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/SectionStudyRecordVo.java

@@ -82,4 +82,8 @@ public class SectionStudyRecordVo {
     /** 节类型 1录播 2直播 3回放 */
     @ApiModelProperty("节类型 1录播 2直播 3回放")
     private Integer sectionType;
+    @ApiModelProperty("直播地址")
+    private String liveUrl;
+    @ApiModelProperty("频道的观看页状态,取值为:live(直播中)、end(直播结束)、playback(回放中)、waiting(等待直播)")
+    private String watchStatus;
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserStudyRecordVo.java

@@ -90,4 +90,8 @@ public class UserStudyRecordVo {
 	@Excel(name = "当前状态 1 当前状态 0过往状态")
 	@ApiModelProperty("当前状态 1 当前状态 0过往状态")
 	private Integer currentStatus;
+	/** 订单商品ID */
+	@Excel(name = "订单商品ID")
+	@ApiModelProperty("订单商品ID")
+	private Long orderGoodsId;
 }

+ 21 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordMapper.xml

@@ -19,6 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="videoCurrentTime" column="video_current_time"/>
         <result property="firstStartTime" column="first_start_time"/>
         <result property="currentStatus" column="current_status"/>
+        <result property="orderGoodsId" column="order_goods_id"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.user.vo.GoodsStudyRecordVo" id="GoodsStudyRecordVoResult">
@@ -41,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="endTime" column="end_time"/>
         <result property="studyStartTime" column="study_start_time"/>
         <result property="studyEndTime" column="study_end_time"/>
+        <result property="orderGoodsId" column="order_goods_id"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.user.vo.SubjectStudyRecordVo" id="SubjectStudyRecordVoResult">
@@ -80,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="chapterId" column="chapter_id"/>
         <result property="gradeId" column="grade_id"/>
         <result property="orderGoodsId" column="order_goods_id"/>
+        <result property="liveUrl" column="live_url"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.user.vo.ExamStudyRecordVo" id="ExamStudyRecordVoResult">
@@ -1237,4 +1240,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ORDER BY
             r.sort_time DESC
     </select>
+
+    <select id="getLastLive" parameterType="com.zhongzheng.modules.user.bo.UserStudyRecordQueryBo" resultMap="SectionStudyRecordVoResult">
+        SELECT
+            usr.*,
+            cs.live_url
+        FROM
+            user_study_record usr
+                LEFT JOIN course_section cs ON usr.section_id = cs.section_id
+        WHERE
+            cs.section_type = 2
+          AND usr.goods_id = #{goodsId}
+          AND usr.user_id = #{userId}
+          AND usr.grade_id = #{gradeId}
+          AND usr.course_id = #{courseId}
+        ORDER BY
+            usr.update_time
+            LIMIT 1
+    </select>
 </mapper>