|
|
|
@ -146,6 +146,9 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl |
|
|
|
|
|
|
|
|
|
int roleId = Integer.parseInt(umsUserMapper.selectOne(new LambdaQueryWrapper<UmsUser>() |
|
|
|
|
.eq(UmsUser::getUsername, username)).getRoleId()); |
|
|
|
|
// System.out.println(courseQuery.getRoleId());
|
|
|
|
|
// int roleId = Integer.parseInt(courseQuery.getRoleId().get(0));
|
|
|
|
|
// System.out.println(roleId);
|
|
|
|
|
|
|
|
|
|
// int roleId = Math.toIntExact(umsAdminRoleRelation.getRoleId());
|
|
|
|
|
// int roleId = 0;
|
|
|
|
@ -163,7 +166,6 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl |
|
|
|
|
// roleId = Integer.parseInt((String) firstElement);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
System.out.println(roleId); |
|
|
|
|
PageDTO<CoursesVO> coursesVOPageDTO; |
|
|
|
|
|
|
|
|
|
switch (roleId) { |
|
|
|
@ -196,7 +198,7 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl |
|
|
|
|
.eq(courseQuery.getNature() != null && !courseQuery.getNature().isEmpty(), Courses::getNature, courseQuery.getNature()) |
|
|
|
|
.eq(courseQuery.getAssessmenttype() != null &&!courseQuery.getAssessmenttype().isEmpty(), Courses::getAssessmenttype, courseQuery.getAssessmenttype()) |
|
|
|
|
.page(page); |
|
|
|
|
return PageDTO.of(p, CoursesVO.class); |
|
|
|
|
return PageDTO.of(p,CoursesVO.class); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private PageDTO<CoursesVO> queryForStudent(CourseQuery courseQuery, String username) { |
|
|
|
@ -390,13 +392,15 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl |
|
|
|
|
* 修改课程信息 |
|
|
|
|
* @param coursesDTO |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
@Transactional |
|
|
|
|
public void updateCourse(CoursesDTO coursesDTO) { |
|
|
|
|
String courseId = coursesDTO.getId(); |
|
|
|
|
Courses course = coursesMapper.selectById(courseId); |
|
|
|
|
if (course.getStatus()==CourseCode.COURSE_UODATING.getValue()){ |
|
|
|
|
if (course.getStatus()==CourseCode.COURSE_UPDATING.getValue()){ |
|
|
|
|
throw new BusinessException(ErrorCode.SYSTEM_ERROR,"课程正在修改中,请等待修改完成后再进行操作"); |
|
|
|
|
} |
|
|
|
|
course.setStatus(CourseCode.COURSE_UODATING.getValue()); |
|
|
|
|
course.setStatus(CourseCode.COURSE_UPDATING.getValue()); |
|
|
|
|
coursesMapper.updateById(course); |
|
|
|
|
BeanUtil.copyProperties(coursesDTO, course); |
|
|
|
|
course.setStatus(0); |
|
|
|
|