更新java17,springboot3.3.9,maven3.9.10,
This commit is contained in:
@@ -22,7 +22,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -113,7 +112,7 @@ public class CourseController {
|
||||
public R addUserCourseStudying(@RequestBody Map<String,Integer> map){
|
||||
int isExist = userCourseStudyingDao.selectCount(new LambdaQueryWrapper<UserCourseStudying>()
|
||||
.eq(UserCourseStudying::getUserId,ShiroUtils.getUId())
|
||||
.eq(UserCourseStudying::getCourseId,map.get("courseId")));
|
||||
.eq(UserCourseStudying::getCourseId,map.get("courseId"))).intValue();
|
||||
if (isExist>0){
|
||||
return R.error("已存在");
|
||||
}else {
|
||||
|
||||
@@ -71,7 +71,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
||||
wrapper.orderByAsc(CourseToSociologyEntity::getSort);
|
||||
Page<CourseEntity> courseEntityPage = this.getBaseMapper().selectJoinPage(new Page<>(param.getPage(), param.getLimit()),CourseEntity.class, wrapper);
|
||||
for (CourseEntity c:courseEntityPage.getRecords()){
|
||||
Integer integer = userCourseBuyDao.selectCount(new LambdaQueryWrapper<UserCourseBuyEntity>().eq(UserCourseBuyEntity::getCourseId, c.getId()).eq(UserCourseBuyEntity::getUserId,uId).and(i -> i.apply("end_time IS NULL OR end_time > {0}", new Date())));
|
||||
Integer integer = userCourseBuyDao.selectCount(new LambdaQueryWrapper<UserCourseBuyEntity>().eq(UserCourseBuyEntity::getCourseId, c.getId()).eq(UserCourseBuyEntity::getUserId,uId).and(i -> i.apply("end_time IS NULL OR end_time > {0}", new Date()))).intValue();
|
||||
c.setIsBuy(integer>0?1:0);
|
||||
List<CourseCatalogueEntity> courseCatalogueEntities = courseCatalogueDao.selectList(new LambdaQueryWrapper<CourseCatalogueEntity>().eq(CourseCatalogueEntity::getCourseId, c.getId()));
|
||||
if (courseCatalogueEntities != null && courseCatalogueEntities.size() > 0){
|
||||
@@ -80,7 +80,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
||||
if (userVip!=null){
|
||||
cc.setIsBuy(1);
|
||||
}else {
|
||||
Integer cou = userCourseBuyDao.selectCount(new LambdaQueryWrapper<UserCourseBuyEntity>().eq(UserCourseBuyEntity::getCatalogueId, cc.getId()).eq(UserCourseBuyEntity::getUserId,uId).and(i -> i.apply("end_time IS NULL OR end_time > {0}", new Date())));
|
||||
Integer cou = userCourseBuyDao.selectCount(new LambdaQueryWrapper<UserCourseBuyEntity>().eq(UserCourseBuyEntity::getCatalogueId, cc.getId()).eq(UserCourseBuyEntity::getUserId,uId).and(i -> i.apply("end_time IS NULL OR end_time > {0}", new Date()))).intValue();
|
||||
cc.setIsBuy(cou>0?1:0);
|
||||
}
|
||||
}
|
||||
@@ -223,7 +223,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
||||
LambdaQueryWrapper<UserCourseBuyEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(UserCourseBuyEntity::getUserId,uId);
|
||||
wrapper.eq(UserCourseBuyEntity::getCatalogueId,catalogueId);
|
||||
Integer integer = userCourseBuyDao.selectCount(wrapper);
|
||||
Integer integer = userCourseBuyDao.selectCount(wrapper).intValue();
|
||||
if(integer>0){
|
||||
return R.error("您已拥有本门课程,无需领取");
|
||||
}
|
||||
@@ -361,7 +361,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
||||
for (Map<String,Object> map:courseList){
|
||||
int count = userCourseBuyDao.selectCount(new LambdaQueryWrapper<UserCourseBuyEntity>()
|
||||
.eq(UserCourseBuyEntity::getUserId,param.get("userId"))
|
||||
.eq(UserCourseBuyEntity::getCatalogueId,map.get("catalogueId")));
|
||||
.eq(UserCourseBuyEntity::getCatalogueId,map.get("catalogueId"))).intValue();
|
||||
if (!userVipService.isSociologyVip((int)param.get("userId"))&&count==0){
|
||||
courseEntities.add(map);
|
||||
}
|
||||
@@ -399,7 +399,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
||||
if(courseEntities!=null&&courseEntities.size()>0){
|
||||
for (CourseEntity co:courseEntities){
|
||||
//添加是否加入正在学习
|
||||
int i = studyingDao.selectCount(new LambdaQueryWrapper<UserCourseStudying>().eq(UserCourseStudying::getCourseId,co.getId()).eq(UserCourseStudying::getUserId,user.getId()));
|
||||
int i = studyingDao.selectCount(new LambdaQueryWrapper<UserCourseStudying>().eq(UserCourseStudying::getCourseId,co.getId()).eq(UserCourseStudying::getUserId,user.getId())).intValue();
|
||||
co.setIsStudying(i>0?1:0);
|
||||
List<CourseCatalogueEntity> courseCatalogueEntities = courseCatalogueDao.selectList(new MPJLambdaWrapper<CourseCatalogueEntity>().eq(CourseCatalogueEntity::getCourseId, co.getId()).orderByAsc(CourseCatalogueEntity::getSort));
|
||||
if (courseCatalogueEntities.size() > 0) {
|
||||
|
||||
Reference in New Issue
Block a user