소스 검색

fix:bug 基础学生批量删除

caozixuan 3 년 전
부모
커밋
112f141ce4
1개의 변경된 파일4개의 추가작업 그리고 7개의 파일을 삭제
  1. 4 7
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/BasicStudentServiceImpl.java

+ 4 - 7
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/BasicStudentServiceImpl.java

@@ -127,15 +127,12 @@ public class BasicStudentServiceImpl extends ServiceImpl<BasicStudentMapper, Bas
         List<BasicStudent> willDeleteStudent = this.list(basicStudentQueryWrapper);
 
         // 删除基础学生
-        if (willDeleteStudent.size() > 0){
-            this.removeByIds(willDeleteStudent);
-            // 同步删除教学学生
+        if (willDeleteStudent.size() > 0) {
             Set<Long> idSet = willDeleteStudent.stream().map(BaseEntity::getId).collect(Collectors.toSet());
-            if (idSet.size() > 0){
-                this.baseMapper.deleteTeachStudentByBasicStudentIdSet(idSet);
-            }
+            this.removeByIds(idSet);
+            // 同步删除教学学生
+            this.baseMapper.deleteTeachStudentByBasicStudentIdSet(idSet);
         }
-
         return true;
     }