Browse Source

创建学校

tags/正式3.2.0
王宁 2 years ago
parent
commit
ede79a5159
20 changed files with 563 additions and 27 deletions
  1. 26
    1
      sapi/src/main/java/com/xhkjedu/sapi/mapper/gradeclass/ClassMapper.java
  2. 13
    0
      sapi/src/main/java/com/xhkjedu/sapi/mapper/gradeclass/ClassStudentMapper.java
  3. 13
    0
      sapi/src/main/java/com/xhkjedu/sapi/mapper/gradeclass/ClassTeacherMapper.java
  4. 13
    0
      sapi/src/main/java/com/xhkjedu/sapi/mapper/gradeclass/GroupMapper.java
  5. 13
    0
      sapi/src/main/java/com/xhkjedu/sapi/mapper/gradeclass/GroupStudentMapper.java
  6. 16
    0
      sapi/src/main/java/com/xhkjedu/sapi/mapper/system/RoleMapper.java
  7. 16
    0
      sapi/src/main/java/com/xhkjedu/sapi/mapper/system/RoleModuleMapper.java
  8. 5
    0
      sapi/src/main/java/com/xhkjedu/sapi/mapper/system/UserMapper.java
  9. 15
    0
      sapi/src/main/java/com/xhkjedu/sapi/mapper/system/UserRoleMapper.java
  10. 78
    0
      sapi/src/main/java/com/xhkjedu/sapi/model/gradeclass/TClassStudent.java
  11. 59
    0
      sapi/src/main/java/com/xhkjedu/sapi/model/gradeclass/TClassTeacher.java
  12. 52
    0
      sapi/src/main/java/com/xhkjedu/sapi/model/gradeclass/TGroup.java
  13. 33
    0
      sapi/src/main/java/com/xhkjedu/sapi/model/gradeclass/TGroupStudent.java
  14. 42
    0
      sapi/src/main/java/com/xhkjedu/sapi/model/system/TRole.java
  15. 30
    0
      sapi/src/main/java/com/xhkjedu/sapi/model/system/TRoleModule.java
  16. 35
    0
      sapi/src/main/java/com/xhkjedu/sapi/model/system/TUserModule.java
  17. 32
    0
      sapi/src/main/java/com/xhkjedu/sapi/model/system/TUserRole.java
  18. 28
    26
      sapi/src/main/java/com/xhkjedu/sapi/service/system/SchoolService.java
  19. 36
    0
      sapi/src/main/resources/mapper/gradeclass/ClassMapper.xml
  20. 8
    0
      sapi/src/main/resources/mapper/system/UserMapper.xml

+ 26
- 1
sapi/src/main/java/com/xhkjedu/sapi/mapper/gradeclass/ClassMapper.java View File

2
 
2
 
3
 
3
 
4
 import com.xhkjedu.sapi.base.TkMapper;
4
 import com.xhkjedu.sapi.base.TkMapper;
5
-import com.xhkjedu.sapi.model.gradeclass.TClass;
5
+import com.xhkjedu.sapi.model.gradeclass.*;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+import java.util.List;
6
 
9
 
7
 public interface ClassMapper extends TkMapper<TClass> {
10
 public interface ClassMapper extends TkMapper<TClass> {
8
     //获取班级当前年份
11
     //获取班级当前年份
10
 
13
 
11
     //根据班级名称获取班级id
14
     //根据班级名称获取班级id
12
     Integer getClassIdByName(String classname, Integer schoolid, Integer gradeid, Integer year);
15
     Integer getClassIdByName(String classname, Integer schoolid, Integer gradeid, Integer year);
16
+
17
+    //修改班级状态
18
+    void updateClassState(@Param("classstate") Integer classstate, @Param("classids") String classids);
19
+
20
+
21
+    //要升级的班级列表
22
+    List<TClass> listClassBySchoolId(@Param("schoolid") Integer schoolid, @Param("year") Integer year);
23
+    //升级时要毕业的班级列表
24
+    List<TClass> listClassBiyeBySchoolId(@Param("schoolid") Integer schoolid,@Param("year") Integer year,@Param("classstate") Integer classstate);
25
+
26
+    //要升级的班级id字符串
27
+    String listClassIdBySchoolId(@Param("schoolid") Integer schoolid,@Param("year") Integer year);
28
+
29
+    //获取要升级的学生列表
30
+    List<TClassStudent> listStudentByClassIds(@Param("classIds") String classIds);
31
+    //要升级的教师列表
32
+    List<TClassTeacher> listTeacherByClassIds(@Param("classIds") String classIds);
33
+    //要升级的全体分组列表
34
+    List<TGroup> listGroupByClassIds(@Param("classIds") String classIds);
35
+    //获取要升级的学生列表
36
+    List<TGroupStudent> listStudentByGroupIds(@Param("groupIds") String groupIds);
37
+
13
 }
38
 }

+ 13
- 0
sapi/src/main/java/com/xhkjedu/sapi/mapper/gradeclass/ClassStudentMapper.java View File

1
+package com.xhkjedu.sapi.mapper.gradeclass;
2
+
3
+import com.xhkjedu.sapi.base.TkMapper;
4
+import com.xhkjedu.sapi.model.gradeclass.TClassStudent;
5
+
6
+/**
7
+ * @ClassName ClassStudentMapper
8
+ * Description TODO
9
+ * Author WN
10
+ * Date 2022/2/22 15:13
11
+ **/
12
+public interface ClassStudentMapper extends TkMapper<TClassStudent> {
13
+}

+ 13
- 0
sapi/src/main/java/com/xhkjedu/sapi/mapper/gradeclass/ClassTeacherMapper.java View File

1
+package com.xhkjedu.sapi.mapper.gradeclass;
2
+
3
+import com.xhkjedu.sapi.base.TkMapper;
4
+import com.xhkjedu.sapi.model.gradeclass.TClassTeacher;
5
+
6
+/**
7
+ * @ClassName ClassTeacherMapper
8
+ * Description 班级老师
9
+ * Author WN
10
+ * Date 2022/2/22 15:14
11
+ **/
12
+public interface ClassTeacherMapper extends TkMapper<TClassTeacher> {
13
+}

+ 13
- 0
sapi/src/main/java/com/xhkjedu/sapi/mapper/gradeclass/GroupMapper.java View File

1
+package com.xhkjedu.sapi.mapper.gradeclass;
2
+
3
+import com.xhkjedu.sapi.base.TkMapper;
4
+import com.xhkjedu.sapi.model.gradeclass.TGroup;
5
+
6
+/**
7
+ * @ClassName GroupMapper
8
+ * Description 班级分组
9
+ * Author WN
10
+ * Date 2022/2/22 15:12
11
+ **/
12
+public interface GroupMapper extends TkMapper<TGroup> {
13
+}

+ 13
- 0
sapi/src/main/java/com/xhkjedu/sapi/mapper/gradeclass/GroupStudentMapper.java View File

1
+package com.xhkjedu.sapi.mapper.gradeclass;
2
+
3
+import com.xhkjedu.sapi.base.TkMapper;
4
+import com.xhkjedu.sapi.model.gradeclass.TGroupStudent;
5
+
6
+/**
7
+ * @ClassName GroupStudentMapper
8
+ * Description TODO
9
+ * Author WN
10
+ * Date 2022/2/22 15:14
11
+ **/
12
+public interface GroupStudentMapper extends TkMapper<TGroupStudent> {
13
+}

+ 16
- 0
sapi/src/main/java/com/xhkjedu/sapi/mapper/system/RoleMapper.java View File

1
+package com.xhkjedu.sapi.mapper.system;
2
+
3
+import com.xhkjedu.sapi.base.TkMapper;
4
+import com.xhkjedu.sapi.model.system.TRole;
5
+import org.springframework.stereotype.Repository;
6
+
7
+/**
8
+ * @ClassName RoleMapper
9
+ * Description 角色、角色模块、角色用户
10
+ * Author WN
11
+ * Date 2022/2/22 14:47
12
+ **/
13
+@Repository
14
+public interface RoleMapper extends TkMapper<TRole> {
15
+
16
+}

+ 16
- 0
sapi/src/main/java/com/xhkjedu/sapi/mapper/system/RoleModuleMapper.java View File

1
+package com.xhkjedu.sapi.mapper.system;
2
+
3
+import com.xhkjedu.sapi.base.TkMapper;
4
+import com.xhkjedu.sapi.model.system.TRoleModule;
5
+import org.springframework.stereotype.Repository;
6
+
7
+/**
8
+ * @ClassName RoleModuleMapper
9
+ * Description 角色模块
10
+ * Author WN
11
+ * Date 2022/2/22 14:51
12
+ **/
13
+@Repository
14
+public interface RoleModuleMapper extends TkMapper<TRoleModule> {
15
+
16
+}

+ 5
- 0
sapi/src/main/java/com/xhkjedu/sapi/mapper/system/UserMapper.java View File

1
 package com.xhkjedu.sapi.mapper.system;
1
 package com.xhkjedu.sapi.mapper.system;
2
 
2
 
3
 import com.xhkjedu.sapi.base.TkMapper;
3
 import com.xhkjedu.sapi.base.TkMapper;
4
+import com.xhkjedu.sapi.model.gradeclass.TClassStudent;
4
 import com.xhkjedu.sapi.model.system.TUser;
5
 import com.xhkjedu.sapi.model.system.TUser;
5
 import com.xhkjedu.sapi.vo.system.UserVo;
6
 import com.xhkjedu.sapi.vo.system.UserVo;
6
 import org.apache.ibatis.annotations.Param;
7
 import org.apache.ibatis.annotations.Param;
30
 
31
 
31
     //获取学校管理员
32
     //获取学校管理员
32
     UserVo getSchoolAdminBySchoolid(@Param("schoolid")Integer schoolid);
33
     UserVo getSchoolAdminBySchoolid(@Param("schoolid")Integer schoolid);
34
+
35
+    //批量修改学生状态
36
+    void batchUpdateState(@Param("users")List<TClassStudent> users, @Param("userstate")Integer userstate);
37
+
33
 }
38
 }

+ 15
- 0
sapi/src/main/java/com/xhkjedu/sapi/mapper/system/UserRoleMapper.java View File

1
+package com.xhkjedu.sapi.mapper.system;
2
+
3
+import com.xhkjedu.sapi.base.TkMapper;
4
+import com.xhkjedu.sapi.model.system.TUserRole;
5
+import org.springframework.stereotype.Repository;
6
+
7
+/**
8
+ * @ClassName UserRoleMapper
9
+ * Description 用户角色
10
+ * Author WN
11
+ * Date 2022/2/22 14:52
12
+ **/
13
+@Repository
14
+public interface UserRoleMapper extends TkMapper<TUserRole> {
15
+}

+ 78
- 0
sapi/src/main/java/com/xhkjedu/sapi/model/gradeclass/TClassStudent.java View File

1
+package com.xhkjedu.sapi.model.gradeclass;
2
+
3
+import com.xhkjedu.sapi.model.BaseBean;
4
+import lombok.Data;
5
+
6
+import javax.persistence.Id;
7
+import javax.persistence.Table;
8
+import javax.persistence.Transient;
9
+
10
+@Table(name = "t_class_student")
11
+@Data
12
+public class TClassStudent extends BaseBean {
13
+    //班级关联学生id
14
+    @Id
15
+    private Integer csid;
16
+
17
+    //班级id
18
+    private Integer classid;
19
+
20
+    //学生id
21
+    private Integer studentid;
22
+
23
+    //创建人
24
+    private Integer createid;
25
+
26
+    //创建时间
27
+    private Integer createtime;
28
+
29
+    //学校id
30
+    private Integer schoolid;
31
+
32
+    //学号
33
+    @Transient
34
+    private String studentno;
35
+
36
+    //学生姓名
37
+    @Transient
38
+    private String studentname;
39
+
40
+    //性别1男2女
41
+    @Transient
42
+    private Integer usersex;
43
+
44
+    //全体分组id
45
+    @Transient
46
+    private Integer groupid;
47
+
48
+    //原班级id
49
+    @Transient
50
+    private Integer oldclassid;
51
+
52
+    //排序字段:学生姓名studentname 学号studentno 创建时间createtime
53
+    @Transient
54
+    private String fieldname;
55
+
56
+    //排序规则:正序asc 倒序desc
57
+    @Transient
58
+    private String fieldorder;
59
+
60
+    @Transient
61
+    //用户状态1正常2删除
62
+    private Integer userstate;
63
+
64
+    @Transient
65
+    //用户手机号
66
+    private String userphone;
67
+
68
+    @Transient
69
+    private Integer classtype;//班级类型1行政班2提高班3直播班99已直播班
70
+
71
+    @Transient
72
+    //当前年份
73
+    private Integer year;
74
+
75
+    @Transient
76
+    //有效期
77
+    private String usertime;
78
+}

+ 59
- 0
sapi/src/main/java/com/xhkjedu/sapi/model/gradeclass/TClassTeacher.java View File

1
+package com.xhkjedu.sapi.model.gradeclass;
2
+
3
+import com.xhkjedu.sapi.model.BaseBean;
4
+import lombok.Data;
5
+
6
+import javax.persistence.Id;
7
+import javax.persistence.Table;
8
+import javax.persistence.Transient;
9
+
10
+@Table(name = "t_class_teacher")
11
+@Data
12
+public class TClassTeacher extends BaseBean {
13
+    //班级教师表
14
+    @Id
15
+    private Integer ctid;
16
+
17
+    //班级id
18
+    private Integer classid;
19
+
20
+    //教师id
21
+    private Integer teacherid;
22
+
23
+    //创建人id
24
+    private Integer createid;
25
+
26
+    //创建时间
27
+    private Integer createtime;
28
+
29
+    //学校id
30
+    private Integer schoolid;
31
+
32
+    //教师姓名
33
+    @Transient
34
+    private String teachername;
35
+
36
+    //手机号
37
+    @Transient
38
+    private String userphone;
39
+
40
+    //排序字段:姓名teachername 登录账号loginname 创建时间createtime
41
+    @Transient
42
+    private String fieldname;
43
+
44
+    //排序规则:正序asc 倒序desc
45
+    @Transient
46
+    private String fieldorder;
47
+
48
+    @Transient
49
+    //所属年级
50
+    private Integer gradeid;
51
+
52
+    @Transient
53
+    //科目id
54
+    private String subjectid;
55
+
56
+    @Transient
57
+    //当前年份
58
+    private Integer year;
59
+}

+ 52
- 0
sapi/src/main/java/com/xhkjedu/sapi/model/gradeclass/TGroup.java View File

1
+package com.xhkjedu.sapi.model.gradeclass;
2
+
3
+import com.xhkjedu.sapi.model.BaseBean;
4
+import lombok.Data;
5
+
6
+import javax.persistence.Id;
7
+import javax.persistence.Table;
8
+import javax.persistence.Transient;
9
+import java.util.ArrayList;
10
+import java.util.List;
11
+import java.util.Map;
12
+
13
+@Table(name = "t_group")
14
+@Data
15
+public class TGroup extends BaseBean {
16
+    //班级分组id
17
+    @Id
18
+    private Integer groupid;
19
+
20
+    //分组名称
21
+    private String groupname;
22
+
23
+    //班级id
24
+    private Integer classid;
25
+
26
+    //班级分组类型1全体2一般分组
27
+    private Integer grouptype;
28
+
29
+    //分组人数
30
+    private Integer groupnum;
31
+
32
+    //创建人id
33
+    private Integer createid;
34
+
35
+    //创建时间
36
+    private Integer createtime;
37
+
38
+    //学校id
39
+    private Integer schoolid;
40
+
41
+    //当前年份
42
+    @Transient
43
+    private Integer year;
44
+
45
+    //资源id
46
+    @Transient
47
+    private String resourceid;
48
+
49
+    //分组下学生
50
+    @Transient
51
+    private List<Map> students = new ArrayList<>();
52
+}

+ 33
- 0
sapi/src/main/java/com/xhkjedu/sapi/model/gradeclass/TGroupStudent.java View File

1
+package com.xhkjedu.sapi.model.gradeclass;
2
+
3
+import com.xhkjedu.sapi.model.BaseBean;
4
+import lombok.Data;
5
+
6
+import javax.persistence.Id;
7
+import javax.persistence.Table;
8
+
9
+@Table(name = "t_group_student")
10
+@Data
11
+public class TGroupStudent extends BaseBean {
12
+    //分组学生表
13
+    @Id
14
+    private Integer gsid;
15
+
16
+    //班级id
17
+    private Integer classid;
18
+
19
+    //分组id
20
+    private Integer groupid;
21
+
22
+    //学生id
23
+    private Integer studentid;
24
+
25
+    //创建人id
26
+    private Integer createid;
27
+
28
+    //创建时间
29
+    private Integer createtime;
30
+
31
+    //学校id
32
+    private Integer schoolid;
33
+}

+ 42
- 0
sapi/src/main/java/com/xhkjedu/sapi/model/system/TRole.java View File

1
+package com.xhkjedu.sapi.model.system;
2
+
3
+import com.xhkjedu.sapi.model.BaseBean;
4
+import lombok.Data;
5
+
6
+import javax.persistence.Id;
7
+import javax.persistence.Table;
8
+import javax.persistence.Transient;
9
+import java.util.ArrayList;
10
+import java.util.List;
11
+import java.util.Map;
12
+
13
+@Table(name = "t_role")
14
+@Data
15
+public class TRole extends BaseBean {
16
+    //角色表
17
+    @Id
18
+    private Integer roleid;
19
+
20
+    //角色名称
21
+    private String rolename;
22
+
23
+    //角色备注
24
+    private String comm;
25
+
26
+    //创建人id
27
+    private Integer createid;
28
+
29
+    //创建时间
30
+    private Integer createtime;
31
+
32
+    //学校id
33
+    private Integer schoolid;
34
+
35
+    //用户数量
36
+    @Transient
37
+    private Integer usernum;
38
+
39
+    //选择模块
40
+    @Transient
41
+    private List<Map> modules = new ArrayList<>();
42
+}

+ 30
- 0
sapi/src/main/java/com/xhkjedu/sapi/model/system/TRoleModule.java View File

1
+package com.xhkjedu.sapi.model.system;
2
+
3
+import com.xhkjedu.sapi.model.BaseBean;
4
+import lombok.Data;
5
+
6
+import javax.persistence.Id;
7
+import javax.persistence.Table;
8
+
9
+@Table(name = "t_role_module")
10
+@Data
11
+public class TRoleModule extends BaseBean {
12
+    //角色模块表
13
+    @Id
14
+    private Integer rmid;
15
+
16
+    //角色id
17
+    private Integer roleid;
18
+
19
+    //模块表id
20
+    private String moduleid;
21
+
22
+    //创建人id
23
+    private Integer createid;
24
+
25
+    //创建时间
26
+    private Integer createtime;
27
+
28
+    //学校id
29
+    private Integer schoolid;
30
+}

+ 35
- 0
sapi/src/main/java/com/xhkjedu/sapi/model/system/TUserModule.java View File

1
+package com.xhkjedu.sapi.model.system;
2
+
3
+import com.xhkjedu.sapi.model.BaseBean;
4
+import lombok.Data;
5
+
6
+import javax.persistence.Id;
7
+import javax.persistence.Table;
8
+import java.util.ArrayList;
9
+import java.util.List;
10
+
11
+@Table(name = "t_user_module")
12
+@Data
13
+public class TUserModule extends BaseBean {
14
+    //用户常用模块表
15
+    @Id
16
+    private Integer umid;
17
+
18
+    //用户id
19
+    private Integer userid;
20
+
21
+    //模块id
22
+    private String moduleid;
23
+
24
+    //排序
25
+    private Integer umorder;
26
+
27
+    //创建时间
28
+    private Integer createtime;
29
+
30
+    //学校id
31
+    private Integer schoolid;
32
+
33
+    //批量保存用户常用模块
34
+    private List<String> moduleids = new ArrayList<>();
35
+}

+ 32
- 0
sapi/src/main/java/com/xhkjedu/sapi/model/system/TUserRole.java View File

1
+package com.xhkjedu.sapi.model.system;
2
+
3
+import com.xhkjedu.sapi.model.BaseBean;
4
+import lombok.Data;
5
+
6
+import javax.persistence.Id;
7
+import javax.persistence.Table;
8
+import javax.persistence.Transient;
9
+
10
+@Table(name = "t_user_role")
11
+@Data
12
+public class TUserRole extends BaseBean {
13
+    //用户角色表
14
+    @Id
15
+    private Integer urid;
16
+
17
+    //用户id
18
+    private Integer userid;
19
+
20
+    //角色id
21
+    private Integer roleid;
22
+
23
+    //创建人id
24
+    private Integer createid;
25
+
26
+    //创建时间
27
+    private Integer createtime;
28
+
29
+    //用户姓名
30
+    @Transient
31
+    private String username;
32
+}

+ 28
- 26
sapi/src/main/java/com/xhkjedu/sapi/service/system/SchoolService.java View File

1
 package com.xhkjedu.sapi.service.system;
1
 package com.xhkjedu.sapi.service.system;
2
 
2
 
3
-import com.xhkjedu.sapi.mapper.system.SchoolMapper;
4
-import com.xhkjedu.sapi.model.system.TSchool;
3
+import com.xhkjedu.sapi.mapper.gradeclass.*;
4
+import com.xhkjedu.sapi.mapper.system.*;
5
+import com.xhkjedu.sapi.model.gradeclass.*;
6
+import com.xhkjedu.sapi.model.system.*;
5
 import com.xhkjedu.utils.MD5;
7
 import com.xhkjedu.utils.MD5;
6
 import com.xhkjedu.utils.N_Utils;
8
 import com.xhkjedu.utils.N_Utils;
7
 import lombok.extern.slf4j.Slf4j;
9
 import lombok.extern.slf4j.Slf4j;
31
     private ModuledefaultService moduledefaultService;
33
     private ModuledefaultService moduledefaultService;
32
     @Resource
34
     @Resource
33
     private ModuleService moduleService;
35
     private ModuleService moduleService;
34
-   /* @Resource
36
+    @Resource
35
     private ClassMapper classMapper;
37
     private ClassMapper classMapper;
36
     @Resource
38
     @Resource
37
     private ClassStudentMapper classStudentMapper;
39
     private ClassStudentMapper classStudentMapper;
48
     @Autowired
50
     @Autowired
49
     private RoleModuleMapper roleModuleMapper;
51
     private RoleModuleMapper roleModuleMapper;
50
     @Autowired
52
     @Autowired
51
-    private UserRoleMapper userRoleMapper;*/
53
+    private UserRoleMapper userRoleMapper;
52
 
54
 
53
     //添加
55
     //添加
54
     @Transactional(rollbackFor = Exception.class)
56
     @Transactional(rollbackFor = Exception.class)
61
             schoolMapper.insertUseGeneratedKeys(model);
63
             schoolMapper.insertUseGeneratedKeys(model);
62
             schoolid = model.getId();
64
             schoolid = model.getId();
63
 
65
 
64
-           /* //添加管理员信息
66
+            //添加管理员信息
65
             Integer userid = saveUser(model, schoolid);
67
             Integer userid = saveUser(model, schoolid);
66
 
68
 
67
             //添加角色信息
69
             //添加角色信息
78
             }
80
             }
79
 
81
 
80
             //添加角色模块
82
             //添加角色模块
81
-            roleModuleMapper.insertList(roleModules);*/
83
+            roleModuleMapper.insertList(roleModules);
82
         } catch (DuplicateKeyException e) {
84
         } catch (DuplicateKeyException e) {
83
             log.error("添加学校失败",e.getMessage());
85
             log.error("添加学校失败",e.getMessage());
84
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
86
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
99
      * @Date 2020/7/2 11:52
101
      * @Date 2020/7/2 11:52
100
      * @return java.lang.Integer
102
      * @return java.lang.Integer
101
      **/
103
      **/
102
-   /* private Integer saveUserRole(Integer userid, Integer roleid) {
104
+    private Integer saveUserRole(Integer userid, Integer roleid) {
103
         TUserRole userRole = new TUserRole();
105
         TUserRole userRole = new TUserRole();
104
         userRole.setUserid(userid);
106
         userRole.setUserid(userid);
105
         userRole.setRoleid(roleid);
107
         userRole.setRoleid(roleid);
107
         userRole.setCreatetime(N_Utils.getSecondTimestamp());
109
         userRole.setCreatetime(N_Utils.getSecondTimestamp());
108
         userRoleMapper.insertUseGeneratedKeys(userRole);
110
         userRoleMapper.insertUseGeneratedKeys(userRole);
109
         return userRole.getId();
111
         return userRole.getId();
110
-    }*/
112
+    }
111
 
113
 
112
     /**
114
     /**
113
      * 添加角色信息
115
      * 添加角色信息
116
      * @Date 2020/7/2 11:51
118
      * @Date 2020/7/2 11:51
117
      * @return java.lang.Integer
119
      * @return java.lang.Integer
118
      **/
120
      **/
119
-   /* private Integer saveRole(Integer schoolid, Integer userid) {
121
+    private Integer saveRole(Integer schoolid, Integer userid) {
120
         TRole role = new TRole();
122
         TRole role = new TRole();
121
         role.setRolename("管理员");
123
         role.setRolename("管理员");
122
         role.setComm("拥有高权限");
124
         role.setComm("拥有高权限");
125
         role.setSchoolid(schoolid);
127
         role.setSchoolid(schoolid);
126
         roleMapper.insertUseGeneratedKeys(role);
128
         roleMapper.insertUseGeneratedKeys(role);
127
         return role.getId();
129
         return role.getId();
128
-    }*/
130
+    }
129
 
131
 
130
     /**
132
     /**
131
      * 添加管理员信息
133
      * 添加管理员信息
134
      * @Date 2020/7/2 11:49
136
      * @Date 2020/7/2 11:49
135
      * @return java.lang.Integer
137
      * @return java.lang.Integer
136
      **/
138
      **/
137
-   /* private Integer saveUser(TSchool model, Integer schoolid) {
139
+    private Integer saveUser(TSchool model, Integer schoolid) {
138
         TUser user = new TUser();
140
         TUser user = new TUser();
139
         user.setLoginname(model.getLoginname());
141
         user.setLoginname(model.getLoginname());
140
         user.setUsername("管理员");
142
         user.setUsername("管理员");
149
         user.setSchoolid(schoolid);
151
         user.setSchoolid(schoolid);
150
         userMapper.insertUseGeneratedKeys(user);
152
         userMapper.insertUseGeneratedKeys(user);
151
         return user.getId();
153
         return user.getId();
152
-    }*/
154
+    }
153
 
155
 
154
     /**
156
     /**
155
      * 保存子模块信息并设置角色模块信息
157
      * 保存子模块信息并设置角色模块信息
158
      * @Date 2020/7/2 11:47
160
      * @Date 2020/7/2 11:47
159
      * @return void
161
      * @return void
160
      **/
162
      **/
161
-   /* private void saveModuleSetRoleModule(Integer schoolid, Integer userid, Integer roleid, List<TRoleModule> roleModules, TModule module) {
163
+    private void saveModuleSetRoleModule(Integer schoolid, Integer userid, Integer roleid, List<TRoleModule> roleModules, TModule module) {
162
         module.setCreateid(userid);
164
         module.setCreateid(userid);
163
         module.setCreatetime(N_Utils.getSecondTimestamp());
165
         module.setCreatetime(N_Utils.getSecondTimestamp());
164
         module.setSchoolid(schoolid);
166
         module.setSchoolid(schoolid);
177
             roleModule.setSchoolid(schoolid);
179
             roleModule.setSchoolid(schoolid);
178
             roleModules.add(roleModule);
180
             roleModules.add(roleModule);
179
         }
181
         }
180
-    }*/
182
+    }
181
 
183
 
182
     /**
184
     /**
183
      * 保存子模块信息
185
      * 保存子模块信息
186
      * @Date 2020/7/2 11:46
188
      * @Date 2020/7/2 11:46
187
      * @return void
189
      * @return void
188
      **/
190
      **/
189
-   /* private void saveModuleChild(Integer schoolid, Integer userid, TModule module, List<TRoleModule> roleModules, Integer roleid) {
191
+    private void saveModuleChild(Integer schoolid, Integer userid, TModule module, List<TRoleModule> roleModules, Integer roleid) {
190
         String moduleid = module.getModuleid();
192
         String moduleid = module.getModuleid();
191
         List<TModule> modulechilds = module.getModulechilds();
193
         List<TModule> modulechilds = module.getModulechilds();
192
         if (N_Utils.isListNotEmpty(modulechilds)) {
194
         if (N_Utils.isListNotEmpty(modulechilds)) {
195
                 saveModuleSetRoleModule(schoolid, userid, roleid, roleModules, modulechild);
197
                 saveModuleSetRoleModule(schoolid, userid, roleid, roleModules, modulechild);
196
             }
198
             }
197
         }
199
         }
198
-    }*/
200
+    }
199
 
201
 
200
     //删除
202
     //删除
201
     public Integer deleteById(Integer schoolid) {
203
     public Integer deleteById(Integer schoolid) {
229
     @Transactional(rollbackFor = Exception.class)
231
     @Transactional(rollbackFor = Exception.class)
230
     public void upgrade(Integer schoolid, Integer year) throws Exception {
232
     public void upgrade(Integer schoolid, Integer year) throws Exception {
231
         try {
233
         try {
232
-           /* List<TClass> classes = classMapper.listClassBySchoolId(schoolid, year);//要升级的班级列表
234
+            List<TClass> classes = classMapper.listClassBySchoolId(schoolid, year);//要升级的班级列表
233
             if (N_Utils.isListNotEmpty(classes)){
235
             if (N_Utils.isListNotEmpty(classes)){
234
                 String classIds = classMapper.listClassIdBySchoolId(schoolid, year);
236
                 String classIds = classMapper.listClassIdBySchoolId(schoolid, year);
235
-                List<TClassStudent> cStudents = classStudentMapper.listStudentByClassIds(classIds);//要升级的学生列表
236
-                List<TClassTeacher> cTeachers = classTeacherMapper.listTeacherByClassIds(classIds);//要升级的教师列表
237
+                List<TClassStudent> cStudents = classMapper.listStudentByClassIds(classIds);//要升级的学生列表
238
+                List<TClassTeacher> cTeachers = classMapper.listTeacherByClassIds(classIds);//要升级的教师列表
237
 
239
 
238
-                List<TGroup> groups = groupMapper.listStudentByClassIds(classIds);//要升级的全体分组列表
240
+                List<TGroup> groups = classMapper.listGroupByClassIds(classIds);//要升级的全体分组列表
239
                 StringBuilder sb = new StringBuilder();
241
                 StringBuilder sb = new StringBuilder();
240
                 groups.forEach(g->{sb.append(g.getGroupid()).append(",");});
242
                 groups.forEach(g->{sb.append(g.getGroupid()).append(",");});
241
                 String groupIds = sb.toString().substring(0,sb.toString().length()-1);
243
                 String groupIds = sb.toString().substring(0,sb.toString().length()-1);
242
-                List<TGroupStudent> gStudents = groupStudentMapper.listStudentByGroupIds(groupIds);//要升级的学生列表
244
+                List<TGroupStudent> gStudents = classMapper.listStudentByGroupIds(groupIds);//要升级的学生列表
243
 
245
 
244
                 List<TClassStudent> classStudents = new ArrayList<>();//升级后的班级学生
246
                 List<TClassStudent> classStudents = new ArrayList<>();//升级后的班级学生
245
                 List<TClassTeacher> classTeachers = new ArrayList<>();//升级后的班级教师
247
                 List<TClassTeacher> classTeachers = new ArrayList<>();//升级后的班级教师
326
                     }
328
                     }
327
                 }
329
                 }
328
 
330
 
329
-                List<TClassStudent> bystudents = classStudentMapper.listStudentByClassIds(byclassIds);//要毕业的学生列表
331
+                List<TClassStudent> bystudents = classMapper.listStudentByClassIds(byclassIds);//要毕业的学生列表
330
 
332
 
331
                 if (N_Utils.isNotEmpty(byclassIds)) {
333
                 if (N_Utils.isNotEmpty(byclassIds)) {
332
                     classMapper.updateClassState(3, byclassIds);//修改班级状态
334
                     classMapper.updateClassState(3, byclassIds);//修改班级状态
334
                 if (N_Utils.isListNotEmpty(bystudents)) {
336
                 if (N_Utils.isListNotEmpty(bystudents)) {
335
                     userMapper.batchUpdateState(bystudents, 3);   //修改学生状态为已毕业状态
337
                     userMapper.batchUpdateState(bystudents, 3);   //修改学生状态为已毕业状态
336
                 }
338
                 }
337
-            }*/
339
+            }
338
 
340
 
339
             schoolMapper.upgrade(schoolid);//学校年份升级
341
             schoolMapper.upgrade(schoolid);//学校年份升级
340
         }catch (Exception e){
342
         }catch (Exception e){
355
 
357
 
356
         schoolMapper.downgrade(schoolid, year);
358
         schoolMapper.downgrade(schoolid, year);
357
         //之前已毕业的班级进行恢复
359
         //之前已毕业的班级进行恢复
358
-        /*List<TClass> biyeclass = classMapper.listClassBiyeBySchoolId(schoolid,year,3);
360
+        List<TClass> biyeclass = classMapper.listClassBiyeBySchoolId(schoolid,year,3);
359
 
361
 
360
         if(N_Utils.isListNotEmpty(biyeclass)){
362
         if(N_Utils.isListNotEmpty(biyeclass)){
361
             String byclassIds = "";
363
             String byclassIds = "";
368
                 }
370
                 }
369
             }
371
             }
370
 
372
 
371
-            List<TClassStudent> bystudents = classStudentMapper.listStudentByClassIds(byclassIds);//要毕业的学生列表
373
+            List<TClassStudent> bystudents = classMapper.listStudentByClassIds(byclassIds);//要毕业的学生列表
372
 
374
 
373
             classMapper.updateClassState(1,byclassIds);//修改班级状态
375
             classMapper.updateClassState(1,byclassIds);//修改班级状态
374
             userMapper.batchUpdateState(bystudents,1);   //修改学生状态
376
             userMapper.batchUpdateState(bystudents,1);   //修改学生状态
375
-        }*/
377
+        }
376
     }
378
     }
377
 
379
 
378
     /**
380
     /**

+ 36
- 0
sapi/src/main/resources/mapper/gradeclass/ClassMapper.xml View File

10
         select c.classid from t_class c where c.schoolid=#{schoolid} and c.gradeid=#{gradeid} and c.classtype=1 and
10
         select c.classid from t_class c where c.schoolid=#{schoolid} and c.gradeid=#{gradeid} and c.classtype=1 and
11
         c.classstate=1 and c.classname=#{classname} and c.year=#{year}
11
         c.classstate=1 and c.classname=#{classname} and c.year=#{year}
12
     </select>
12
     </select>
13
+
14
+    <!--修改班级状态-->
15
+    <update id="updateClassState">
16
+       update t_class set classstate=#{classstate} where classid in (${classids})
17
+    </update>
18
+
19
+    <!--要升级的班级列表-->
20
+    <select id="listClassBySchoolId" resultType="com.xhkjedu.sapi.model.gradeclass.TClass">
21
+        select * from t_class where schoolid=#{schoolid} and year=#{year} and classtype in(1,2) and classstate=1 and gradeid in(1,2,3,4,5,7,8,10,11)
22
+    </select>
23
+    <!--升级时要毕业的班级列表-->
24
+    <select id="listClassBiyeBySchoolId" resultType="com.xhkjedu.sapi.model.gradeclass.TClass">
25
+        select * from t_class where schoolid=#{schoolid} and year=#{year} and classtype in(1,2) and classstate=#{classstate} and gradeid in(6,9,12)
26
+    </select>
27
+    <!--要升级的班级id字符串-->
28
+    <select id="listClassIdBySchoolId" resultType="java.lang.String">
29
+        select group_concat(classid) from t_class where schoolid=#{schoolid} and year=#{year} and classtype in(1,2) and classstate=1 and gradeid in(1,2,3,4,5,7,8,10,11)
30
+    </select>
31
+
32
+    <!--获取要升级的学生列表-->
33
+    <select id="listStudentByClassIds" resultType="com.xhkjedu.sapi.model.gradeclass.TClassStudent">
34
+        select * from t_class_student where classid in(${classIds}) order by classid;
35
+    </select>
36
+    <!--要升级的教师列表-->
37
+    <select id="listTeacherByClassIds" resultType="com.xhkjedu.sapi.model.gradeclass.TClassTeacher">
38
+        select * from t_class_teacher where classid in(${classIds}) order by classid;
39
+    </select>
40
+    <!--要升级的全体分组列表-->
41
+    <select id="listGroupByClassIds" resultType="com.xhkjedu.sapi.model.gradeclass.TGroup">
42
+        select g.* from t_group g where g.classid in(${classIds}) and g.grouptype=1 order by classid
43
+    </select>
44
+    <!--获取要升级的学生列表-->
45
+    <select id="listStudentByGroupIds" resultType="com.xhkjedu.sapi.model.gradeclass.TGroupStudent">
46
+        select * from t_group_student where groupid in(${groupIds}) order by groupid;
47
+    </select>
48
+
13
 </mapper>
49
 </mapper>

+ 8
- 0
sapi/src/main/resources/mapper/system/UserMapper.xml View File

22
         select usertype from t_user where userid=#{userid}
22
         select usertype from t_user where userid=#{userid}
23
     </select>
23
     </select>
24
 
24
 
25
+    <!--批量修改用户状态-->
26
+    <update id="batchUpdateState">
27
+        update t_user set userstate=#{userstate} where
28
+        <foreach collection="users" item="user" index="index" separator="or">
29
+            userid=${user.studentid}
30
+        </foreach>
31
+    </update>
32
+
25
 
33
 
26
     <!--获取学校管理员-->
34
     <!--获取学校管理员-->
27
     <select id="getSchoolAdminBySchoolid" resultType="com.xhkjedu.sapi.vo.system.UserVo">
35
     <select id="getSchoolAdminBySchoolid" resultType="com.xhkjedu.sapi.vo.system.UserVo">

Loading…
Cancel
Save