|
@@ -38,7 +38,6 @@ public class CourseServiceImpl implements CourseService {
|
|
|
private final CourseSelectionRepository courseSelectionRepository;
|
|
private final CourseSelectionRepository courseSelectionRepository;
|
|
|
private final UserService userService;
|
|
private final UserService userService;
|
|
|
private final CoderService coderService;
|
|
private final CoderService coderService;
|
|
|
- //private final HelperService helperService;
|
|
|
|
|
private final EvalService evalService;
|
|
private final EvalService evalService;
|
|
|
private final OssUtil ossUtil;
|
|
private final OssUtil ossUtil;
|
|
|
|
|
|
|
@@ -193,7 +192,6 @@ public class CourseServiceImpl implements CourseService {
|
|
|
assert userService.isStudent(userVO.getRole());
|
|
assert userService.isStudent(userVO.getRole());
|
|
|
CourseSelectionKey courseSelectionKey = new CourseSelectionKey(userId, courseId);
|
|
CourseSelectionKey courseSelectionKey = new CourseSelectionKey(userId, courseId);
|
|
|
CourseVO course = this.findCourseById(courseId);
|
|
CourseVO course = this.findCourseById(courseId);
|
|
|
- // coder系统选课
|
|
|
|
|
if (course.getCoderId() != null) {
|
|
if (course.getCoderId() != null) {
|
|
|
JSONObject coderRes = coderService.chooseCourse(course.getInvitationCode());
|
|
JSONObject coderRes = coderService.chooseCourse(course.getInvitationCode());
|
|
|
}
|
|
}
|
|
@@ -201,10 +199,6 @@ public class CourseServiceImpl implements CourseService {
|
|
|
if (course.getEvalId() != null) {
|
|
if (course.getEvalId() != null) {
|
|
|
JSONObject evalRes = evalService.chooseCourse(course.getInvitationCode());
|
|
JSONObject evalRes = evalService.chooseCourse(course.getInvitationCode());
|
|
|
}
|
|
}
|
|
|
-// // 门户系统选课
|
|
|
|
|
-// if (course.getHelperId() != null) {
|
|
|
|
|
-// JSONObject jsonObject = helperService.chooseCourse(course.getInvitationCode());
|
|
|
|
|
-// }
|
|
|
|
|
CourseSelection courseSelection = new CourseSelection(courseSelectionKey);
|
|
CourseSelection courseSelection = new CourseSelection(courseSelectionKey);
|
|
|
courseSelection.setState(true);
|
|
courseSelection.setState(true);
|
|
|
courseSelectionRepository.save(courseSelection);
|
|
courseSelectionRepository.save(courseSelection);
|
|
@@ -272,6 +266,9 @@ public class CourseServiceImpl implements CourseService {
|
|
|
public Boolean isCourseAccessible(Long id) {
|
|
public Boolean isCourseAccessible(Long id) {
|
|
|
DomainUserDetails user = SecurityUtils.getCurrentUser();
|
|
DomainUserDetails user = SecurityUtils.getCurrentUser();
|
|
|
CourseVO courseVO = findCourseById(id);
|
|
CourseVO courseVO = findCourseById(id);
|
|
|
|
|
+ if(courseVO.getState().equals(ObjectState.EXAMPLE)){
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
if(user.getId().equals(courseVO.getTeacher().getId())){
|
|
if(user.getId().equals(courseVO.getTeacher().getId())){
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|