|
@@ -60,7 +60,8 @@ public class ExamSubjectSongServiceImpl extends BaseServiceImpl<Long, ExamSubjec
|
|
|
if(Objects.isNull(examinationBasic)){
|
|
|
throw new BizException("考级项目不存在");
|
|
|
}
|
|
|
- if(!ExamStatusEnum.SETTING.equals(examinationBasic.getStatus())){
|
|
|
+ if(!ExamStatusEnum.SETTING.equals(examinationBasic.getStatus())
|
|
|
+ &&!ExamStatusEnum.NOT_START.equals(examinationBasic.getStatus())){
|
|
|
throw new BizException("此状态考级项目不支持添加考级内容");
|
|
|
}
|
|
|
|
|
@@ -160,7 +161,10 @@ public class ExamSubjectSongServiceImpl extends BaseServiceImpl<Long, ExamSubjec
|
|
|
List<String> songNames=new ArrayList<>();
|
|
|
for (String s : examSubjectSongDto.getPerformSongIdList().split(",")) {
|
|
|
if(examSongIds.contains(Integer.valueOf(s))){
|
|
|
- songNames.add(idExamSongMap.get(Integer.valueOf(s)).getSongName());
|
|
|
+ ExamSong examSong = idExamSongMap.get(Integer.valueOf(s));
|
|
|
+ if(Objects.nonNull(examSong)){
|
|
|
+ songNames.add(examSong.getSongName());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
examSubjectSongDto.setPerformSongNames(StringUtils.join(songNames, ","));
|
|
@@ -173,6 +177,26 @@ public class ExamSubjectSongServiceImpl extends BaseServiceImpl<Long, ExamSubjec
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public int delete(Long id) {
|
|
|
+ if(Objects.isNull(id)){
|
|
|
+ throw new BizException("参数错误");
|
|
|
+ }
|
|
|
+ ExamSubjectSong examSubjectSong = examSubjectSongDao.get(id);
|
|
|
+ if(Objects.isNull(examSubjectSong)){
|
|
|
+ throw new BizException("数据错误");
|
|
|
+ }
|
|
|
+ ExaminationBasic examinationBasic = examinationBasicDao.get(examSubjectSong.getExaminationBasicId().longValue());
|
|
|
+ if(Objects.isNull(examinationBasic)){
|
|
|
+ throw new BizException("考级项目不存在");
|
|
|
+ }
|
|
|
+ if(!ExamStatusEnum.SETTING.equals(examinationBasic.getStatus())
|
|
|
+ &&!ExamStatusEnum.NOT_START.equals(examinationBasic.getStatus())){
|
|
|
+ throw new BizException("此状态无法删除");
|
|
|
+ }
|
|
|
+ return super.delete(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public List<ExamSong> getExamSubjectSong(Integer examinationBasicId,Long examSubjectId, Integer level) {
|
|
|
List<ExamSong> examSongs = new ArrayList<>();
|
|
|
ExamSubjectSong examSubjectSong = examSubjectSongDao.getExamSubjectSong(examinationBasicId,examSubjectId, level);
|