|
@@ -135,8 +135,10 @@ public class StudentLessonExaminationServiceImpl extends ServiceImpl<StudentLess
|
|
detailDto.setMusicScoreName(musicScore.getName());
|
|
detailDto.setMusicScoreName(musicScore.getName());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (detailDto.getFileJson() != null) {
|
|
|
|
- detailDto.getFileJson().setExpireFlag(expireFlag);
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(detailDto.getFileJson())) {
|
|
|
|
+ for (CourseHomeworkWrapper.FileJson fileJson : detailDto.getFileJson()) {
|
|
|
|
+ fileJson.setExpireFlag(expireFlag);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
dto.setStudentLessonExaminationDetail(detailDto);
|
|
dto.setStudentLessonExaminationDetail(detailDto);
|
|
dto.setMemo(detailDto.getMemo());
|
|
dto.setMemo(detailDto.getMemo());
|
|
@@ -202,8 +204,12 @@ public class StudentLessonExaminationServiceImpl extends ServiceImpl<StudentLess
|
|
}
|
|
}
|
|
//更新详情
|
|
//更新详情
|
|
detail.setTrainingTime(now);
|
|
detail.setTrainingTime(now);
|
|
- if (submitDto.getFileJson() != null) {
|
|
|
|
- submitDto.getFileJson().setExpireFlag(false);
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(submitDto.getFileJson())) {
|
|
|
|
+ for (CourseHomeworkWrapper.FileJson fileJson : submitDto.getFileJson()) {
|
|
|
|
+ if (fileJson != null) {
|
|
|
|
+ fileJson.setExpireFlag(false);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
detail.setFileJson(JSON.toJSONString(submitDto.getFileJson()));
|
|
detail.setFileJson(JSON.toJSONString(submitDto.getFileJson()));
|
|
}
|
|
}
|
|
studentLessonExaminationDetailService.updateById(detail);
|
|
studentLessonExaminationDetailService.updateById(detail);
|
|
@@ -216,7 +222,31 @@ public class StudentLessonExaminationServiceImpl extends ServiceImpl<StudentLess
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<StudentLessonExaminationDto1> queryStudentPage(Long lessonExaminationId,Integer subjectId) {
|
|
public List<StudentLessonExaminationDto1> queryStudentPage(Long lessonExaminationId,Integer subjectId) {
|
|
- return baseMapper.queryStudentPage(lessonExaminationId,subjectId);
|
|
|
|
|
|
+ List<StudentLessonExaminationDto1> studentLessonExaminationDto1s = baseMapper.queryStudentPage(lessonExaminationId, subjectId);
|
|
|
|
+ if (CollectionUtils.isEmpty(studentLessonExaminationDto1s)) {
|
|
|
|
+ return new ArrayList<>();
|
|
|
|
+ }
|
|
|
|
+ LessonExamination lessonExamination = lessonExaminationService.getById(lessonExaminationId);
|
|
|
|
+ if (lessonExamination == null) {
|
|
|
|
+ throw new BizException("作业信息不存在");
|
|
|
|
+ }
|
|
|
|
+ boolean expireFlag = false;
|
|
|
|
+ if (lessonExamination.getFileExpireDay() != null && lessonExamination.getFileExpireDay() >0) {
|
|
|
|
+ expireFlag = DateUtil.addDays(lessonExamination.getExpireDate(), lessonExamination.getFileExpireDay()).before(new Date());
|
|
|
|
+ }
|
|
|
|
+ for (StudentLessonExaminationDto1 studentLessonExaminationDto1 : studentLessonExaminationDto1s) {
|
|
|
|
+ if (CollectionUtils.isNotEmpty(studentLessonExaminationDto1.getDetailDtos())) {
|
|
|
|
+ for (StudentLessonExaminationDetailDto1 detailDto : studentLessonExaminationDto1.getDetailDtos()) {
|
|
|
|
+ if (StringUtils.isNotBlank(detailDto.getFileJsons())) {
|
|
|
|
+ detailDto.setFileJson(JSON.parseArray(detailDto.getFileJsons(), CourseHomeworkWrapper.FileJson.class));
|
|
|
|
+ for (CourseHomeworkWrapper.FileJson e : detailDto.getFileJson()) {
|
|
|
|
+ e.setExpireFlag(expireFlag);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return studentLessonExaminationDto1s;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|