Explorar el Código

增加一个保险,未初始化的学生补充保存一下,正常应该用不上

mingfu hace 3 semanas
padre
commit
873a926d70

+ 6 - 1
ie-admin/src/main/java/com/ruoyi/web/service/LearnTeacherService.java

@@ -446,7 +446,12 @@ public class LearnTeacherService {
             modules = directedKnowledge.getModules();
             upStudent.setModules(modules);
         }
-        learnStudentMapper.updateLearnStudent(upStudent);
+        // TODO 补充保存在注册和创建关联用户时没有初始化的, 但这时没有classId
+        if(null == learnStudentMapper.selectLearnStudentByStudentId(upStudent.getStudentId())) {
+            learnStudentMapper.insertLearnStudent(upStudent);
+        } else {
+            learnStudentMapper.updateLearnStudent(upStudent);
+        }
         Set<String> moduleSet = Sets.newHashSet(StringUtils.trimToEmpty(modules).split(","));
         return moduleSet.size() == 1 && moduleSet.contains("技能展示/实践操作") ? "该专业只考技能展示/实践操作" : "";
     }