浏览代码

fix:bug 基础学生批量删除

caozixuan 3 年之前
父节点
当前提交
112f141ce4

+ 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;
     }