Browse Source

学生导入完善

tags/正式3.3.0
雍文秀 2 years ago
parent
commit
8f6938744d

+ 12
- 10
suser/src/main/java/com/xhkjedu/suser/service/gradeclass/ClassStudentService.java View File

475
                         Integer studentid = u.getUserid();
475
                         Integer studentid = u.getUserid();
476
                         Integer oldclassid = classStudentMapper.getClassIdByStuId(studentid);//获取学生行政班id
476
                         Integer oldclassid = classStudentMapper.getClassIdByStuId(studentid);//获取学生行政班id
477
                         Integer classid = user.getClassid();
477
                         Integer classid = user.getClassid();
478
-                        if (!classid.equals(oldclassid) && 2 == u.getUsertype() && schoolid == u.getSchoolid()) {
479
-                            if (1 != u.getUserstate()) {
480
-                                delUsers.add(u);
481
-                            }
478
+                        if (1 != u.getUserstate()) {
479
+                            delUsers.add(u);
480
+                        } else {
481
+                            studentsExisted.add(u);
482
+                        }
483
+                        if (!classid.equals(oldclassid)) {
482
                             //要添加的班级
484
                             //要添加的班级
483
                             setStudents(classid, schoolid, createid, user.getGroupid(), classStudents, groupStudents, studentid);//处理班级加入学生
485
                             setStudents(classid, schoolid, createid, user.getGroupid(), classStudents, groupStudents, studentid);//处理班级加入学生
484
                             List<Map> courses = listCourseByClassId(courseMap, classid);
486
                             List<Map> courses = listCourseByClassId(courseMap, classid);
513
                                 }
515
                                 }
514
                                 handleDelClassCourse2(delStudentList, changeCourseidList, courses2, studentid);//处理关联的直播课以及需要删除学生的直播班id
516
                                 handleDelClassCourse2(delStudentList, changeCourseidList, courses2, studentid);//处理关联的直播课以及需要删除学生的直播班id
515
                             }
517
                             }
516
-                        } else {//本班学生信息
517
-                            studentsExisted.add(u);
518
                         }
518
                         }
519
                     }
519
                     }
520
                 }
520
                 }
660
                     Integer classnum = student.getClassnum();//本班级学生数量
660
                     Integer classnum = student.getClassnum();//本班级学生数量
661
                     if (2 != u.getUsertype() || schoolid != u.getSchoolid() || 0 == student.getXznum()) {
661
                     if (2 != u.getUsertype() || schoolid != u.getSchoolid() || 0 == student.getXznum()) {
662
                         usersNotExisted.add(u);
662
                         usersNotExisted.add(u);
663
-                    } else if (0 == classnum && 2 == u.getUsertype() && schoolid == u.getSchoolid()) {
663
+                    } else {
664
                         if (1 != u.getUserstate()) {
664
                         if (1 != u.getUserstate()) {
665
                             delUsers.add(u);
665
                             delUsers.add(u);
666
                         }
666
                         }
667
-                        setStudents(classid, schoolid, createid, user.getGroupid(), classStudents, groupStudents, studentid);//处理班级加入学生
668
-                        List<Map> courses = listCourseByClassId(courseMap, classid);
669
-                        handleAddClassCourse(classStudents, groupStudents, changeCourseidList, courses, studentid);//处理班级加入学生中关联的直播课加入学生
667
+                        if (0 == classnum) {
668
+                            setStudents(classid, schoolid, createid, user.getGroupid(), classStudents, groupStudents, studentid);//处理班级加入学生
669
+                            List<Map> courses = listCourseByClassId(courseMap, classid);
670
+                            handleAddClassCourse(classStudents, groupStudents, changeCourseidList, courses, studentid);//处理班级加入学生中关联的直播课加入学生
671
+                        }
670
                     }
672
                     }
671
                 }
673
                 }
672
             }
674
             }

Loading…
Cancel
Save