|
@@ -95,9 +95,9 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
|
|
|
@Autowired
|
|
|
private SysMusicScoreDao sysMusicScoreDao;
|
|
|
@Autowired
|
|
|
- private MusicGroupTrainPlanService musicGroupTrainPlanService;
|
|
|
+ private MusicGroupTrainPlanService musicGroupTrainPlanService;
|
|
|
@Autowired
|
|
|
- private StudentExtracurricularExercisesSituationDao studentExtracurricularExercisesSituationDao;
|
|
|
+ private StudentExtracurricularExercisesSituationDao studentExtracurricularExercisesSituationDao;
|
|
|
|
|
|
@Autowired
|
|
|
private ExtracurricularExercisesReplyService extracurricularExercisesReplyService;
|
|
@@ -222,27 +222,27 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
|
|
|
CourseSchedule courseSchedule = courseScheduleDao.get(courseScheduleID);
|
|
|
|
|
|
if(courseSchedule == null){
|
|
|
- throw new BizException("课程不存在");
|
|
|
+ throw new BizException("课程不存在");
|
|
|
}
|
|
|
|
|
|
MusicGroupTrainPlan musicGroupTrainPlan = null;
|
|
|
- //获取课程规划
|
|
|
- MusicGroupTrainPlanSaveDto schoolTerm = musicGroupTrainPlanService.getSchoolTerm(courseSchedule);
|
|
|
- int courseNumNo = courseScheduleDao.getCourseNumNo(schoolTerm);
|
|
|
- List<MusicGroupTrainPlan> planList = musicGroupTrainPlanService.queryPlan(schoolTerm);
|
|
|
- if(planList.size() >= courseNumNo){
|
|
|
- musicGroupTrainPlan = planList.get(courseNumNo - 1);
|
|
|
- }
|
|
|
-
|
|
|
+ //获取课程规划
|
|
|
+ MusicGroupTrainPlanSaveDto schoolTerm = musicGroupTrainPlanService.getSchoolTerm(courseSchedule);
|
|
|
+ int courseNumNo = courseScheduleDao.getCourseNumNo(schoolTerm);
|
|
|
+ List<MusicGroupTrainPlan> planList = musicGroupTrainPlanService.queryPlan(schoolTerm);
|
|
|
+ if(planList.size() >= courseNumNo){
|
|
|
+ musicGroupTrainPlan = planList.get(courseNumNo - 1);
|
|
|
+ }
|
|
|
+
|
|
|
CourseHomeworkStudentDetailDto courseHomeworkStudentDetail = studentCourseHomeworkDao.findCourseHomeworkStudentDetail(courseScheduleID, userId);
|
|
|
if(courseHomeworkStudentDetail == null){
|
|
|
- courseHomeworkStudentDetail = new CourseHomeworkStudentDetailDto();
|
|
|
- courseHomeworkStudentDetail.setMusicGroupTrainPlan(musicGroupTrainPlan);
|
|
|
- return courseHomeworkStudentDetail;
|
|
|
+ courseHomeworkStudentDetail = new CourseHomeworkStudentDetailDto();
|
|
|
+ courseHomeworkStudentDetail.setMusicGroupTrainPlan(musicGroupTrainPlan);
|
|
|
+ return courseHomeworkStudentDetail;
|
|
|
}
|
|
|
courseHomeworkStudentDetail.setExpire(DateUtil.isOverdue(courseHomeworkStudentDetail.getSubmitTime(),
|
|
|
sysConfigDao.findConfigValue("file_expiration_time")));
|
|
|
- courseHomeworkStudentDetail.setMusicGroupTrainPlan(musicGroupTrainPlan);
|
|
|
+ courseHomeworkStudentDetail.setMusicGroupTrainPlan(musicGroupTrainPlan);
|
|
|
|
|
|
SysUser sysUser = teacherDao.getUser(userId.intValue());
|
|
|
courseHomeworkStudentDetail.setStudentId(userId.intValue());
|
|
@@ -928,7 +928,6 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
|
|
|
/**
|
|
|
* 添加学生作业练习记录
|
|
|
*
|
|
|
- * @param record
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -962,8 +961,9 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
|
|
|
StandardEnum.NOT_START,
|
|
|
StandardEnum.NOT_STANDARD)
|
|
|
.list();
|
|
|
- if (!CollectionUtils.isEmpty(list)) {
|
|
|
- return true;
|
|
|
+ Boolean finish = false;
|
|
|
+ if (CollectionUtils.isEmpty(list)) {
|
|
|
+ finish = true;
|
|
|
}
|
|
|
|
|
|
// 设置个人作业练习记录
|
|
@@ -976,29 +976,33 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
|
|
|
if (studentCourseHomework == null) {
|
|
|
throw new BizException("学生作业记录不存在");
|
|
|
}
|
|
|
+ Boolean success = false;
|
|
|
if (studentCourseHomework.getStandardFlag() == null) {
|
|
|
|
|
|
} else
|
|
|
if (studentCourseHomework.getStandardFlag().equals(StandardEnum.STANDARD)
|
|
|
|| studentCourseHomework.getStandardFlag().equals(StandardEnum.EXCELLENT)){
|
|
|
- return true;
|
|
|
+ success = true;
|
|
|
}
|
|
|
// 设置作业完成
|
|
|
- studentCourseHomework.setStandardFlag(StandardEnum.STANDARD);
|
|
|
+ if (Boolean.TRUE.equals(finish)) {
|
|
|
+ studentCourseHomework.setStandardFlag(StandardEnum.STANDARD);
|
|
|
+ }
|
|
|
studentCourseHomework.setUpdateTime(new Date());
|
|
|
studentCourseHomework.setSubmitTime(new Date());
|
|
|
studentCourseHomeworkDao.update(studentCourseHomework);
|
|
|
|
|
|
- // 添加完成人数
|
|
|
- CourseHomework courseHomework = courseHomeworkDao.get(studentLessonTrainingDetail.getCourseHomeworkId());
|
|
|
- if (courseHomework == null) {
|
|
|
- throw new BizException("课程作业不存在");
|
|
|
- }
|
|
|
- if (courseHomework.getExpiryDate().compareTo(new Date()) < 0) {
|
|
|
- throw new BizException("作业已截止");
|
|
|
+ if (Boolean.TRUE.equals(finish) && Boolean.TRUE.equals(!success)) {
|
|
|
+ // 添加完成人数
|
|
|
+ CourseHomework courseHomework = courseHomeworkDao.get(studentLessonTrainingDetail.getCourseHomeworkId());
|
|
|
+ if (courseHomework == null) {
|
|
|
+ throw new BizException("课程作业不存在");
|
|
|
+ }
|
|
|
+ if (courseHomework.getExpiryDate().compareTo(new Date()) < 0) {
|
|
|
+ throw new BizException("作业已截止");
|
|
|
+ }
|
|
|
+ courseHomeworkDao.updateFinishNum(studentLessonTrainingDetail.getCourseHomeworkId());
|
|
|
}
|
|
|
- courseHomeworkDao.updateFinishNum(studentLessonTrainingDetail.getCourseHomeworkId());
|
|
|
-
|
|
|
|
|
|
} else {
|
|
|
ExtracurricularExercisesReply exercisesReply = extracurricularExercisesReplyDao.getByExtraIdAndUserId(
|
|
@@ -1007,27 +1011,34 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
|
|
|
if (exercisesReply == null) {
|
|
|
throw new BizException("学生作业记录不存在");
|
|
|
}
|
|
|
+
|
|
|
+ Boolean success = false;
|
|
|
if (exercisesReply.getStandardFlag() == null) {
|
|
|
|
|
|
} else
|
|
|
if (exercisesReply.getStandardFlag().equals(StandardEnum.STANDARD)
|
|
|
|| exercisesReply.getStandardFlag().equals(StandardEnum.EXCELLENT)){
|
|
|
- return true;
|
|
|
+ success = true;
|
|
|
}
|
|
|
// 设置作业完成
|
|
|
- exercisesReply.setStandardFlag(StandardEnum.STANDARD);
|
|
|
+ if (Boolean.TRUE.equals(finish)) {
|
|
|
+ exercisesReply.setStandardFlag(StandardEnum.STANDARD);
|
|
|
+ }
|
|
|
exercisesReply.setUpdateTime(new Date());
|
|
|
exercisesReply.setSubmitTime(new Date());
|
|
|
extracurricularExercisesReplyDao.update(exercisesReply);
|
|
|
// 添加完成人数
|
|
|
- ExtracurricularExercises extracurricularExercises = extracurricularExercisesDao.get(studentLessonTrainingDetail.getCourseHomeworkId());
|
|
|
- if (extracurricularExercises == null) {
|
|
|
- throw new BizException("课外作业不存在");
|
|
|
- }
|
|
|
- if (extracurricularExercises.getExpireDate().compareTo(new Date()) < 0) {
|
|
|
- throw new BizException("作业已截止");
|
|
|
+ if (Boolean.TRUE.equals(finish) && Boolean.TRUE.equals(!success)) {
|
|
|
+ ExtracurricularExercises extracurricularExercises = extracurricularExercisesDao.get(studentLessonTrainingDetail.getCourseHomeworkId());
|
|
|
+ if (extracurricularExercises == null) {
|
|
|
+ throw new BizException("课外作业不存在");
|
|
|
+ }
|
|
|
+ if (extracurricularExercises.getExpireDate().compareTo(new Date()) < 0) {
|
|
|
+ throw new BizException("作业已截止");
|
|
|
+ }
|
|
|
+ extracurricularExercisesDao.updateFinishNum(studentLessonTrainingDetail.getCourseHomeworkId());
|
|
|
}
|
|
|
- extracurricularExercisesDao.updateFinishNum(studentLessonTrainingDetail.getCourseHomeworkId());
|
|
|
+
|
|
|
}
|
|
|
return true;
|
|
|
}
|