Ver código fonte

删除学生修改

周箭河 5 anos atrás
pai
commit
d39dd6eaa1

+ 4 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupStudentMapperServiceImpl.java

@@ -56,8 +56,10 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
         classStudentMapper.setStatus(ClassGroupStudentStatusEnum.QUIT);
         update(classStudentMapper);
         StudentRegistration student = studentRegistrationService.findStudentByClassGroupIdAndUserId(userId, classGroupId);
-        student.setClassGroupId(0);
-        studentRegistrationService.update(student);
+        if(student != null) {
+            student.setClassGroupId(0);
+            studentRegistrationService.update(student);
+        }
 
         //2、班级人数调整
         classGroupService.updateClassStudentNum(classGroupId.longValue(), -1);