소스 검색

修改判断逻辑

liujunchi 2 년 전
부모
커밋
6674f6d66c
1개의 변경된 파일8개의 추가작업 그리고 19개의 파일을 삭제
  1. 8 19
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesServiceImpl.java

+ 8 - 19
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesServiceImpl.java

@@ -91,28 +91,17 @@ public class ExtracurricularExercisesServiceImpl extends BaseServiceImpl<Long, E
 		if(StringUtils.isBlank(exercises.getContent())){
 			// throw new BizException("请填写内容");
 		}
-		List<MusicScoreSubjectDto> scoreSubjectDtoList = exercises.getMusicScoreSubjectDtos();
 
-        if (exercises.getClassGroupId() != null) {
-            List<ClassGroupStudentMapper> studentMapperList = classGroupStudentMapperDao.findByClassGroup(
-                exercises.getClassGroupId());
-            if (CollectionUtils.isEmpty(studentMapperList)) {
-                throw new BizException("班级学生为空");
+        List<MusicScoreSubjectDto> scoreSubjectDtoList = exercises.getMusicScoreSubjectDtos();
+        if(StringUtils.isBlank(exercises.getStudentIdList())){
+            if(scoreSubjectDtoList == null || scoreSubjectDtoList.size() == 0){
+                throw new BizException("请指定学生");
+            }
+            List<Integer> studentIdList = new ArrayList<>();
+            for (MusicScoreSubjectDto musicScoreSubjectDto : scoreSubjectDtoList) {
+                studentIdList.addAll(musicScoreSubjectDto.getUserIdList());
             }
-            List<Integer> studentIdList = studentMapperList.stream()
-                .filter(o -> !o.getStatus().equals(ClassGroupStudentStatusEnum.QUIT))
-               .map(ClassGroupStudentMapper::getUserId)
-                .collect(Collectors.toList());
             exercises.setStudentIdList(StringUtils.join(studentIdList,","));
-
-        } else if(StringUtils.isNotBlank(exercises.getStudentIdList()) || CollectionUtils.isEmpty(scoreSubjectDtoList)) {
-			List<Integer> studentIdList = new ArrayList<>();
-			for (MusicScoreSubjectDto musicScoreSubjectDto : scoreSubjectDtoList) {
-				studentIdList.addAll(musicScoreSubjectDto.getUserIdList());
-			}
-			exercises.setStudentIdList(StringUtils.join(studentIdList,","));
-		} else {
-            throw new BizException("请指定学生");
         }
 
 		teacherDao.getLocked(exercises.getTeacherId());