bug
This commit is contained in:
@@ -983,11 +983,11 @@ public class BuyOrderController {
|
|||||||
userCourseBuyEntity.setCatalogueId(s.getCatalogueId());
|
userCourseBuyEntity.setCatalogueId(s.getCatalogueId());
|
||||||
userCourseBuyEntity.setDays(s.getDays());
|
userCourseBuyEntity.setDays(s.getDays());
|
||||||
userCourseBuyEntity.setCreateTime(new Date());
|
userCourseBuyEntity.setCreateTime(new Date());
|
||||||
userCourseBuyEntity.setStartTime(new Date());
|
// userCourseBuyEntity.setStartTime(new Date());
|
||||||
Calendar cal = Calendar.getInstance();
|
// Calendar cal = Calendar.getInstance();
|
||||||
cal.setTime(new Date());
|
// cal.setTime(new Date());
|
||||||
cal.add(Calendar.DAY_OF_MONTH,s.getDays());
|
// cal.add(Calendar.DAY_OF_MONTH,s.getDays());
|
||||||
userCourseBuyEntity.setEndTime(cal.getTime());
|
// userCourseBuyEntity.setEndTime(cal.getTime());
|
||||||
userCourseBuyDao.insert(userCourseBuyEntity);
|
userCourseBuyDao.insert(userCourseBuyEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,4 +44,11 @@ public class TaihuWelfareController {
|
|||||||
taihuWelfareService.removeById(id);
|
taihuWelfareService.removeById(id);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/getArticleDetail")
|
||||||
|
public R getArticleDetail(@RequestBody Map<String,Integer> map){
|
||||||
|
int id = map.get("id");
|
||||||
|
TaihuWelfareEntity byId = taihuWelfareService.getById(id);
|
||||||
|
return R.ok().put("result",byId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,13 +2,14 @@ package com.peanut.modules.master.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.peanut.common.utils.R;
|
||||||
import com.peanut.modules.common.entity.CourseCatalogueChapterVideoEntity;
|
import com.peanut.modules.common.entity.CourseCatalogueChapterVideoEntity;
|
||||||
import com.peanut.modules.common.to.ParamTo;
|
import com.peanut.modules.common.to.ParamTo;
|
||||||
|
|
||||||
public interface CourseCatalogueChapterVideoService extends IService<CourseCatalogueChapterVideoEntity> {
|
public interface CourseCatalogueChapterVideoService extends IService<CourseCatalogueChapterVideoEntity> {
|
||||||
Page getCourseCatalogueChapterVideoList(ParamTo param);
|
Page getCourseCatalogueChapterVideoList(ParamTo param);
|
||||||
|
|
||||||
CourseCatalogueChapterVideoEntity checkVideo(CourseCatalogueChapterVideoEntity video) throws Exception;
|
R checkVideo(CourseCatalogueChapterVideoEntity video) throws Exception;
|
||||||
|
|
||||||
void saveCoursePosition(int uId,int videoId,int position);
|
void saveCoursePosition(int uId,int videoId,int position);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.peanut.common.service.AsyncService;
|
import com.peanut.common.service.AsyncService;
|
||||||
|
import com.peanut.common.utils.R;
|
||||||
import com.peanut.common.utils.ShiroUtils;
|
import com.peanut.common.utils.ShiroUtils;
|
||||||
import com.peanut.common.utils.SpdbUtil;
|
import com.peanut.common.utils.SpdbUtil;
|
||||||
import com.peanut.modules.common.dao.*;
|
import com.peanut.modules.common.dao.*;
|
||||||
@@ -33,6 +34,8 @@ public class CourseCatalogueChapterVideoServiceImpl extends ServiceImpl<CourseCa
|
|||||||
private UserCourseVideoPositionDao userCourseVideoPositionDao;
|
private UserCourseVideoPositionDao userCourseVideoPositionDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
private AsyncService asyncService;
|
private AsyncService asyncService;
|
||||||
|
@Autowired
|
||||||
|
private UserCourseBuyDao userCourseBuyDao;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page getCourseCatalogueChapterVideoList(ParamTo param) {
|
public Page getCourseCatalogueChapterVideoList(ParamTo param) {
|
||||||
@@ -45,16 +48,27 @@ public class CourseCatalogueChapterVideoServiceImpl extends ServiceImpl<CourseCa
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CourseCatalogueChapterVideoEntity checkVideo(CourseCatalogueChapterVideoEntity videoEntity) throws Exception {
|
public R checkVideo(CourseCatalogueChapterVideoEntity videoEntity) throws Exception {
|
||||||
|
//获取基础数据
|
||||||
CourseCatalogueChapterVideoEntity video = this.getById(videoEntity.getId());
|
CourseCatalogueChapterVideoEntity video = this.getById(videoEntity.getId());
|
||||||
if (video.getDuration() == 0) {
|
if (video.getDuration() == 0) {
|
||||||
asyncService.pushDurationToVideo(video.getId());//获取mp4总时长
|
asyncService.pushDurationToVideo(video.getId());//补充视频信息,获取总时长
|
||||||
}
|
}
|
||||||
CourseCatalogueChapterEntity courseCatalogueChapterEntity = courseCatalogueChapterDao.selectById(video.getChapterId());
|
CourseCatalogueChapterEntity courseCatalogueChapterEntity = courseCatalogueChapterDao.selectById(video.getChapterId());
|
||||||
CourseCatalogueEntity courseCatalogueEntity = courseCatalogueDao.selectById(courseCatalogueChapterEntity.getCatalogueId());
|
CourseCatalogueEntity courseCatalogueEntity = courseCatalogueDao.selectById(courseCatalogueChapterEntity.getCatalogueId());
|
||||||
Integer uId = ShiroUtils.getUId();
|
Integer uId = ShiroUtils.getUId();
|
||||||
|
//审查课程观看权限
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//处理课程开始计时的逻辑
|
||||||
|
// if(courseCatalogueChapterEntity.getIsAudition()==0){
|
||||||
|
// userCourseBuyDao.selectList(new LambdaQueryWrapper<UserCourseBuyEntity>()
|
||||||
|
// .eq(UserCourseBuyEntity::getUserId,uId)
|
||||||
|
// .eq())
|
||||||
|
// }
|
||||||
|
//处理用户课程足迹
|
||||||
List<UserToCourseEntity> userToCourseEntities = userToCourseDao.selectList(new LambdaQueryWrapper<UserToCourseEntity>().eq(UserToCourseEntity::getUserId, uId).eq(UserToCourseEntity::getCourseId, courseCatalogueEntity.getCourseId()));
|
List<UserToCourseEntity> userToCourseEntities = userToCourseDao.selectList(new LambdaQueryWrapper<UserToCourseEntity>().eq(UserToCourseEntity::getUserId, uId).eq(UserToCourseEntity::getCourseId, courseCatalogueEntity.getCourseId()));
|
||||||
//用户课程足迹
|
|
||||||
if (userToCourseEntities.size() != 0) {
|
if (userToCourseEntities.size() != 0) {
|
||||||
UserToCourseEntity userToCourseEntity = userToCourseEntities.get(0);
|
UserToCourseEntity userToCourseEntity = userToCourseEntities.get(0);
|
||||||
userToCourseEntity.setUpdateTime(new Date());
|
userToCourseEntity.setUpdateTime(new Date());
|
||||||
@@ -67,7 +81,7 @@ public class CourseCatalogueChapterVideoServiceImpl extends ServiceImpl<CourseCa
|
|||||||
userToCourseEntity.setUpdateTime(new Date());
|
userToCourseEntity.setUpdateTime(new Date());
|
||||||
userToCourseDao.insert(userToCourseEntity);
|
userToCourseDao.insert(userToCourseEntity);
|
||||||
}
|
}
|
||||||
//加密视频组装playauth
|
//开始增加视频数据所需的其他信息,加密视频组装playauth
|
||||||
if (video.getType() == 1) {
|
if (video.getType() == 1) {
|
||||||
GetVideoPlayAuthResponse p = SpdbUtil.getPlayAuth(video.getVideo());
|
GetVideoPlayAuthResponse p = SpdbUtil.getPlayAuth(video.getVideo());
|
||||||
String playAuth = p.getBody().getPlayAuth();
|
String playAuth = p.getBody().getPlayAuth();
|
||||||
@@ -86,7 +100,6 @@ public class CourseCatalogueChapterVideoServiceImpl extends ServiceImpl<CourseCa
|
|||||||
}
|
}
|
||||||
video.setVideoUrl(s_str + video.getVideo());
|
video.setVideoUrl(s_str + video.getVideo());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(video.getType() == 2){
|
if(video.getType() == 2){
|
||||||
String s_str = "";
|
String s_str = "";
|
||||||
if (video.getVideo().startsWith("article/")) {
|
if (video.getVideo().startsWith("article/")) {
|
||||||
@@ -95,10 +108,8 @@ public class CourseCatalogueChapterVideoServiceImpl extends ServiceImpl<CourseCa
|
|||||||
s_str = "https://ehh-private-01.oss-cn-beijing.aliyuncs.com/voice/taiHuClass/";
|
s_str = "https://ehh-private-01.oss-cn-beijing.aliyuncs.com/voice/taiHuClass/";
|
||||||
}
|
}
|
||||||
video.setVideoUrl(s_str + video.getVideo());
|
video.setVideoUrl(s_str + video.getVideo());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
return R.ok().put("video",video);
|
||||||
return video;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -248,11 +248,11 @@ public class AliPayServiceImpl implements AliPayService {
|
|||||||
userCourseBuyEntity.setCatalogueId(s.getCatalogueId());
|
userCourseBuyEntity.setCatalogueId(s.getCatalogueId());
|
||||||
userCourseBuyEntity.setDays(s.getDays());
|
userCourseBuyEntity.setDays(s.getDays());
|
||||||
userCourseBuyEntity.setCreateTime(new Date());
|
userCourseBuyEntity.setCreateTime(new Date());
|
||||||
userCourseBuyEntity.setStartTime(new Date());
|
// userCourseBuyEntity.setStartTime(new Date());
|
||||||
Calendar cal = Calendar.getInstance();
|
// Calendar cal = Calendar.getInstance();
|
||||||
cal.setTime(new Date());
|
// cal.setTime(new Date());
|
||||||
cal.add(Calendar.DAY_OF_MONTH,s.getDays());
|
// cal.add(Calendar.DAY_OF_MONTH,s.getDays());
|
||||||
userCourseBuyEntity.setEndTime(cal.getTime());
|
// userCourseBuyEntity.setEndTime(cal.getTime());
|
||||||
userCourseBuyDao.insert(userCourseBuyEntity);
|
userCourseBuyDao.insert(userCourseBuyEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -187,11 +187,11 @@ public class WxpayServiceImpl extends ServiceImpl<PayWechatOrderDao, PayWechatOr
|
|||||||
userCourseBuyEntity.setCatalogueId(s.getCatalogueId());
|
userCourseBuyEntity.setCatalogueId(s.getCatalogueId());
|
||||||
userCourseBuyEntity.setDays(s.getDays());
|
userCourseBuyEntity.setDays(s.getDays());
|
||||||
userCourseBuyEntity.setCreateTime(new Date());
|
userCourseBuyEntity.setCreateTime(new Date());
|
||||||
userCourseBuyEntity.setStartTime(new Date());
|
// userCourseBuyEntity.setStartTime(new Date());
|
||||||
Calendar cal = Calendar.getInstance();
|
// Calendar cal = Calendar.getInstance();
|
||||||
cal.setTime(new Date());
|
// cal.setTime(new Date());
|
||||||
cal.add(Calendar.DAY_OF_MONTH,s.getDays());
|
// cal.add(Calendar.DAY_OF_MONTH,s.getDays());
|
||||||
userCourseBuyEntity.setEndTime(cal.getTime());
|
// userCourseBuyEntity.setEndTime(cal.getTime());
|
||||||
userCourseBuyDao.insert(userCourseBuyEntity);
|
userCourseBuyDao.insert(userCourseBuyEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -164,8 +164,7 @@ public class CourseController {
|
|||||||
*/
|
*/
|
||||||
@RequestMapping("/checkVideo")
|
@RequestMapping("/checkVideo")
|
||||||
public R checkVideo(@RequestBody CourseCatalogueChapterVideoEntity video) throws Exception {
|
public R checkVideo(@RequestBody CourseCatalogueChapterVideoEntity video) throws Exception {
|
||||||
CourseCatalogueChapterVideoEntity courseCatalogueChapterVideoEntity = courseCatalogueChapterVideoService.checkVideo(video);
|
return courseCatalogueChapterVideoService.checkVideo(video);
|
||||||
return R.ok().put("video",courseCatalogueChapterVideoEntity);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/getMyCourse")
|
@RequestMapping("/getMyCourse")
|
||||||
|
|||||||
Reference in New Issue
Block a user