|
@@ -15,6 +15,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.github.pagehelper.Page;
|
|
import com.github.pagehelper.Page;
|
|
|
import com.zhongzheng.common.core.redis.RedisCache;
|
|
import com.zhongzheng.common.core.redis.RedisCache;
|
|
|
|
|
+import com.zhongzheng.common.exception.CustomException;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.common.utils.http.HttpUtils;
|
|
import com.zhongzheng.common.utils.http.HttpUtils;
|
|
|
import com.zhongzheng.common.utils.polyv.PolyvUtils;
|
|
import com.zhongzheng.common.utils.polyv.PolyvUtils;
|
|
@@ -50,6 +51,7 @@ import com.zhongzheng.modules.exam.vo.ExamBeforeVo;
|
|
|
import com.zhongzheng.modules.exam.vo.ExamNumberVo;
|
|
import com.zhongzheng.modules.exam.vo.ExamNumberVo;
|
|
|
import com.zhongzheng.modules.exam.vo.ExamUserApplyVo;
|
|
import com.zhongzheng.modules.exam.vo.ExamUserApplyVo;
|
|
|
import com.zhongzheng.modules.goods.bo.GoodsCourseQueryBo;
|
|
import com.zhongzheng.modules.goods.bo.GoodsCourseQueryBo;
|
|
|
|
|
+import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsCourseService;
|
|
import com.zhongzheng.modules.goods.service.IGoodsCourseService;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsCourseVo;
|
|
import com.zhongzheng.modules.goods.vo.GoodsCourseVo;
|
|
@@ -75,6 +77,7 @@ import com.zhongzheng.modules.inform.vo.InformRemindVo;
|
|
|
import com.zhongzheng.modules.inform.vo.InformVo;
|
|
import com.zhongzheng.modules.inform.vo.InformVo;
|
|
|
import com.zhongzheng.modules.order.bo.OrderQueryBo;
|
|
import com.zhongzheng.modules.order.bo.OrderQueryBo;
|
|
|
import com.zhongzheng.modules.order.domain.Order;
|
|
import com.zhongzheng.modules.order.domain.Order;
|
|
|
|
|
+import com.zhongzheng.modules.order.mapper.OrderGoodsMapper;
|
|
|
import com.zhongzheng.modules.order.mapper.OrderMapper;
|
|
import com.zhongzheng.modules.order.mapper.OrderMapper;
|
|
|
import com.zhongzheng.modules.order.service.IOrderBusinessService;
|
|
import com.zhongzheng.modules.order.service.IOrderBusinessService;
|
|
|
import com.zhongzheng.modules.order.service.IOrderGoodsService;
|
|
import com.zhongzheng.modules.order.service.IOrderGoodsService;
|
|
@@ -224,6 +227,9 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private UserStudyRecordMapper userStudyRecordMapper;
|
|
private UserStudyRecordMapper userStudyRecordMapper;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private OrderGoodsMapper orderGoodsMapper;
|
|
|
|
|
+
|
|
|
@Value("${aliyun.sms.OpenTheGoodsCode}")
|
|
@Value("${aliyun.sms.OpenTheGoodsCode}")
|
|
|
private String OpenTheGoodsCode;
|
|
private String OpenTheGoodsCode;
|
|
|
|
|
|
|
@@ -951,6 +957,7 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
List<CourseSectionVo> list = iCourseSectionService.overSectionList(startTime, nowTime);
|
|
List<CourseSectionVo> list = iCourseSectionService.overSectionList(startTime, nowTime);
|
|
|
List<Long> courseIds = new ArrayList<>();//课程ID
|
|
List<Long> courseIds = new ArrayList<>();//课程ID
|
|
|
List<ClassPeriodVo> periodList = new ArrayList<>();//学时列表
|
|
List<ClassPeriodVo> periodList = new ArrayList<>();//学时列表
|
|
|
|
|
+ List<ClassPeriodVo> liveList = new ArrayList<>();//直播列表
|
|
|
for (CourseSectionVo sectionVo : list) {
|
|
for (CourseSectionVo sectionVo : list) {
|
|
|
//当节为根目录时
|
|
//当节为根目录时
|
|
|
CourseMenuQueryBo menuQueryBo = new CourseMenuQueryBo();
|
|
CourseMenuQueryBo menuQueryBo = new CourseMenuQueryBo();
|
|
@@ -958,9 +965,7 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
menuQueryBo.setMenuId(sectionVo.getSectionId());
|
|
menuQueryBo.setMenuId(sectionVo.getSectionId());
|
|
|
List<CourseMenuVo> menuList = iCourseMenuService.queryList(menuQueryBo);
|
|
List<CourseMenuVo> menuList = iCourseMenuService.queryList(menuQueryBo);
|
|
|
for (CourseMenuVo menuVo : menuList) {
|
|
for (CourseMenuVo menuVo : menuList) {
|
|
|
- GoodsCourseQueryBo courseQueryBo = new GoodsCourseQueryBo();
|
|
|
|
|
- courseQueryBo.setCourseId(menuVo.getCourseId());
|
|
|
|
|
- List<GoodsCourseVo> goodsList = iGoodsCourseService.queryList(courseQueryBo);
|
|
|
|
|
|
|
+ List<GoodsCourseVo> goodsList = iGoodsCourseService.selectGoodsList(menuVo.getCourseId());
|
|
|
for (GoodsCourseVo goodsCourseVo : goodsList) {
|
|
for (GoodsCourseVo goodsCourseVo : goodsList) {
|
|
|
ClassPeriodVo periodVo = new ClassPeriodVo();
|
|
ClassPeriodVo periodVo = new ClassPeriodVo();
|
|
|
periodVo.setGoodsId(goodsCourseVo.getGoodsId());
|
|
periodVo.setGoodsId(goodsCourseVo.getGoodsId());
|
|
@@ -968,7 +973,14 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
periodVo.setModuleId(0L);
|
|
periodVo.setModuleId(0L);
|
|
|
periodVo.setChapterId(0L);
|
|
periodVo.setChapterId(0L);
|
|
|
periodVo.setSectionId(sectionVo.getSectionId());
|
|
periodVo.setSectionId(sectionVo.getSectionId());
|
|
|
- periodList.add(periodVo);
|
|
|
|
|
|
|
+ periodVo.setLiveStartTime(sectionVo.getLiveStartTime());
|
|
|
|
|
+ periodVo.setLiveEndTime(sectionVo.getLiveEndTime());
|
|
|
|
|
+ if(goodsCourseVo.getGoodsType()==1){ //课程商品
|
|
|
|
|
+ periodList.add(periodVo);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(goodsCourseVo.getGoodsType()==6){ //直播商品
|
|
|
|
|
+ liveList.add(periodVo);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -983,9 +995,7 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
menuQueryBo2.setMenuId(chapterSectionVo.getChapterId());
|
|
menuQueryBo2.setMenuId(chapterSectionVo.getChapterId());
|
|
|
List<CourseMenuVo> menuList2 = iCourseMenuService.queryList(menuQueryBo2);
|
|
List<CourseMenuVo> menuList2 = iCourseMenuService.queryList(menuQueryBo2);
|
|
|
for (CourseMenuVo menuVo : menuList2) {
|
|
for (CourseMenuVo menuVo : menuList2) {
|
|
|
- GoodsCourseQueryBo courseQueryBo = new GoodsCourseQueryBo();
|
|
|
|
|
- courseQueryBo.setCourseId(menuVo.getCourseId());
|
|
|
|
|
- List<GoodsCourseVo> goodsList = iGoodsCourseService.queryList(courseQueryBo);
|
|
|
|
|
|
|
+ List<GoodsCourseVo> goodsList = iGoodsCourseService.selectGoodsList(menuVo.getCourseId());
|
|
|
for (GoodsCourseVo goodsCourseVo : goodsList) {
|
|
for (GoodsCourseVo goodsCourseVo : goodsList) {
|
|
|
ClassPeriodVo periodVo = new ClassPeriodVo();
|
|
ClassPeriodVo periodVo = new ClassPeriodVo();
|
|
|
periodVo.setGoodsId(goodsCourseVo.getGoodsId());
|
|
periodVo.setGoodsId(goodsCourseVo.getGoodsId());
|
|
@@ -993,7 +1003,15 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
periodVo.setModuleId(0L);
|
|
periodVo.setModuleId(0L);
|
|
|
periodVo.setChapterId(chapterSectionVo.getChapterId());
|
|
periodVo.setChapterId(chapterSectionVo.getChapterId());
|
|
|
periodVo.setSectionId(sectionVo.getSectionId());
|
|
periodVo.setSectionId(sectionVo.getSectionId());
|
|
|
- periodList.add(periodVo);
|
|
|
|
|
|
|
+ periodVo.setLiveStartTime(sectionVo.getLiveStartTime());
|
|
|
|
|
+ periodVo.setLiveEndTime(sectionVo.getLiveEndTime());
|
|
|
|
|
+ if(goodsCourseVo.getGoodsType()==1){ //课程商品
|
|
|
|
|
+ periodList.add(periodVo);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(goodsCourseVo.getGoodsType()==6){
|
|
|
|
|
+ liveList.add(periodVo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1008,9 +1026,7 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
menuQueryBo3.setMenuId(moduleChapterVo.getModuleId());
|
|
menuQueryBo3.setMenuId(moduleChapterVo.getModuleId());
|
|
|
List<CourseMenuVo> menuList3 = iCourseMenuService.queryList(menuQueryBo3);
|
|
List<CourseMenuVo> menuList3 = iCourseMenuService.queryList(menuQueryBo3);
|
|
|
for (CourseMenuVo menuVo : menuList3) {
|
|
for (CourseMenuVo menuVo : menuList3) {
|
|
|
- GoodsCourseQueryBo courseQueryBo = new GoodsCourseQueryBo();
|
|
|
|
|
- courseQueryBo.setCourseId(menuVo.getCourseId());
|
|
|
|
|
- List<GoodsCourseVo> goodsList = iGoodsCourseService.queryList(courseQueryBo);
|
|
|
|
|
|
|
+ List<GoodsCourseVo> goodsList = iGoodsCourseService.selectGoodsList(menuVo.getCourseId());
|
|
|
for (GoodsCourseVo goodsCourseVo : goodsList) {
|
|
for (GoodsCourseVo goodsCourseVo : goodsList) {
|
|
|
ClassPeriodVo periodVo = new ClassPeriodVo();
|
|
ClassPeriodVo periodVo = new ClassPeriodVo();
|
|
|
periodVo.setGoodsId(goodsCourseVo.getGoodsId());
|
|
periodVo.setGoodsId(goodsCourseVo.getGoodsId());
|
|
@@ -1018,21 +1034,27 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
periodVo.setModuleId(moduleChapterVo.getModuleId());
|
|
periodVo.setModuleId(moduleChapterVo.getModuleId());
|
|
|
periodVo.setChapterId(chapterSectionVo.getChapterId());
|
|
periodVo.setChapterId(chapterSectionVo.getChapterId());
|
|
|
periodVo.setSectionId(sectionVo.getSectionId());
|
|
periodVo.setSectionId(sectionVo.getSectionId());
|
|
|
- periodList.add(periodVo);
|
|
|
|
|
|
|
+ periodVo.setLiveStartTime(sectionVo.getLiveStartTime());
|
|
|
|
|
+ periodVo.setLiveEndTime(sectionVo.getLiveEndTime());
|
|
|
|
|
+ if(goodsCourseVo.getGoodsType()==1){
|
|
|
|
|
+ periodList.add(periodVo);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(goodsCourseVo.getGoodsType()==6){
|
|
|
|
|
+ liveList.add(periodVo);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //获取所有直播结束节对应的用户班级列表
|
|
|
|
|
|
|
+ //视频商品获取所有直播结束节对应的用户班级列表
|
|
|
for (ClassPeriodVo periodVo : periodList) {
|
|
for (ClassPeriodVo periodVo : periodList) {
|
|
|
List<ClassGradeUserGoodsVo> gradeList = iClassGradeUserService.selectGoodsGradeList(periodVo.getGoodsId());
|
|
List<ClassGradeUserGoodsVo> gradeList = iClassGradeUserService.selectGoodsGradeList(periodVo.getGoodsId());
|
|
|
for (ClassGradeUserGoodsVo gradeUserGoodsVo : gradeList) {
|
|
for (ClassGradeUserGoodsVo gradeUserGoodsVo : gradeList) {
|
|
|
UserStudyRecord entity = BeanUtil.toBean(periodVo, UserStudyRecord.class);
|
|
UserStudyRecord entity = BeanUtil.toBean(periodVo, UserStudyRecord.class);
|
|
|
entity.setGradeId(gradeUserGoodsVo.getGradeId());
|
|
entity.setGradeId(gradeUserGoodsVo.getGradeId());
|
|
|
entity.setUserId(gradeUserGoodsVo.getUserId());
|
|
entity.setUserId(gradeUserGoodsVo.getUserId());
|
|
|
- System.out.println(entity);
|
|
|
|
|
Long periodId = null;
|
|
Long periodId = null;
|
|
|
// 学习无记录加一条学时审核记录
|
|
// 学习无记录加一条学时审核记录
|
|
|
if (userStudyRecordMapper.selectStudyRecord(entity) < 1) {
|
|
if (userStudyRecordMapper.selectStudyRecord(entity) < 1) {
|
|
@@ -1055,10 +1077,9 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
userPeriodStatusAddBo.setPeriodId(userPeriod.getId());
|
|
userPeriodStatusAddBo.setPeriodId(userPeriod.getId());
|
|
|
userPeriodStatusAddBo.setCreateTime(DateUtils.getNowTime());
|
|
userPeriodStatusAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
userPeriodStatusAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
userPeriodStatusAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
- userPeriodStatusAddBo.setRecordEndTime(DateUtils.getNowTime());
|
|
|
|
|
|
|
+ userPeriodStatusAddBo.setRecordEndTime(periodVo.getLiveEndTime());
|
|
|
iUserPeriodStatusService.save(userPeriodStatusAddBo);
|
|
iUserPeriodStatusService.save(userPeriodStatusAddBo);
|
|
|
periodId = userPeriodStatusAddBo.getId();
|
|
periodId = userPeriodStatusAddBo.getId();
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
ClassPeriodVo queryBo = BeanUtil.toBean(entity, ClassPeriodVo.class);
|
|
ClassPeriodVo queryBo = BeanUtil.toBean(entity, ClassPeriodVo.class);
|
|
|
Integer status = iUserStudyRecordService.getStudyStatus(queryBo);
|
|
Integer status = iUserStudyRecordService.getStudyStatus(queryBo);
|
|
@@ -1067,18 +1088,44 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
add.setCreateTime(DateUtils.getNowTime());
|
|
add.setCreateTime(DateUtils.getNowTime());
|
|
|
add.setUpdateTime(DateUtils.getNowTime());
|
|
add.setUpdateTime(DateUtils.getNowTime());
|
|
|
add.setCurrentStatus(1);
|
|
add.setCurrentStatus(1);
|
|
|
|
|
+ add.setEndTime(periodVo.getLiveEndTime());
|
|
|
add.setStatus(1);
|
|
add.setStatus(1);
|
|
|
|
|
+ add.setOrderGoodsId(gradeUserGoodsVo.getOrderGoodsId());
|
|
|
iUserStudyRecordService.save(add);
|
|
iUserStudyRecordService.save(add);
|
|
|
iUserStudyRecordService.studyFinish(add);
|
|
iUserStudyRecordService.studyFinish(add);
|
|
|
UserPeriodStatus userPeriodStatus = userStudyRecordMapper.selectPeriodCount(entity);
|
|
UserPeriodStatus userPeriodStatus = userStudyRecordMapper.selectPeriodCount(entity);
|
|
|
- userPeriodStatus.setRecordEndTime(DateUtils.getNowTime());
|
|
|
|
|
|
|
+ userPeriodStatus.setRecordEndTime(periodVo.getLiveEndTime());
|
|
|
userPeriodStatus.setUpdateTime(DateUtils.getNowTime());
|
|
userPeriodStatus.setUpdateTime(DateUtils.getNowTime());
|
|
|
iUserPeriodStatusService.updateById(userPeriodStatus);
|
|
iUserPeriodStatusService.updateById(userPeriodStatus);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ //直播商品
|
|
|
|
|
+ for (ClassPeriodVo periodVo : liveList) {
|
|
|
|
|
+ GoodsQueryBo goodsQueryBo = new GoodsQueryBo();
|
|
|
|
|
+ //购买此商品得订单列表
|
|
|
|
|
+ List<OrderGoodsVo> orderGoodsVoList = orderGoodsMapper.listLiveGoodsList(goodsQueryBo);
|
|
|
|
|
+ for(OrderGoodsVo orderGoodsVo : orderGoodsVoList){
|
|
|
|
|
+ ClassPeriodVo queryBo = BeanUtil.toBean(periodVo, ClassPeriodVo.class);
|
|
|
|
|
+ if(Validator.isEmpty(orderGoodsVo.getOrderGoodsId())){
|
|
|
|
|
+ throw new CustomException("学习订单商品ID缺失");
|
|
|
|
|
+ }
|
|
|
|
|
+ queryBo.setOrderGoodsId(orderGoodsVo.getOrderGoodsId());
|
|
|
|
|
+ queryBo.setUserId(orderGoodsVo.getUserId());
|
|
|
|
|
+ Integer status = iUserStudyRecordService.getStudyStatus(queryBo);
|
|
|
|
|
+ if (Validator.isEmpty(status) || status != 1) {
|
|
|
|
|
+ UserStudyRecord add = BeanUtil.toBean(queryBo, UserStudyRecord.class);
|
|
|
|
|
+ add.setCreateTime(DateUtils.getNowTime());
|
|
|
|
|
+ add.setUpdateTime(DateUtils.getNowTime());
|
|
|
|
|
+ add.setCurrentStatus(1);
|
|
|
|
|
+ add.setStatus(1);
|
|
|
|
|
+ add.setEndTime(periodVo.getLiveEndTime());
|
|
|
|
|
+ add.setStartTime(periodVo.getLiveStartTime());
|
|
|
|
|
+ add.setFirstStartTime(periodVo.getLiveStartTime());
|
|
|
|
|
+ iUserStudyRecordService.save(add);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|