Browse Source

用户模块

tags/正式3.2.0
雍文秀 2 years ago
parent
commit
3a966c5571
36 changed files with 384 additions and 629 deletions
  1. 5
    6
      suser/src/main/java/com/xhkjedu/suser/controller/system/TeacherRoleController.java
  2. 0
    23
      suser/src/main/java/com/xhkjedu/suser/mapper/gradeclass/ClassMapper.java
  3. 0
    11
      suser/src/main/java/com/xhkjedu/suser/mapper/gradeclass/ClassStudentMapper.java
  4. 0
    15
      suser/src/main/java/com/xhkjedu/suser/mapper/gradeclass/ClassTeacherMapper.java
  5. 0
    5
      suser/src/main/java/com/xhkjedu/suser/mapper/gradeclass/GroupMapper.java
  6. 0
    3
      suser/src/main/java/com/xhkjedu/suser/mapper/gradeclass/GroupStudentMapper.java
  7. 3
    0
      suser/src/main/java/com/xhkjedu/suser/mapper/gradeclass/SchoolMapper.java
  8. 14
    0
      suser/src/main/java/com/xhkjedu/suser/mapper/liveplay/CourseMapper.java
  9. 56
    0
      suser/src/main/java/com/xhkjedu/suser/mapper/subjectbook/TeacherPowersbMapper.java
  10. 15
    0
      suser/src/main/java/com/xhkjedu/suser/mapper/subjectbook/TeacherSubjectbookMapper.java
  11. 24
    0
      suser/src/main/java/com/xhkjedu/suser/mapper/system/MsgMapper.java
  12. 9
    0
      suser/src/main/java/com/xhkjedu/suser/mapper/system/UserLogMapper.java
  13. 0
    34
      suser/src/main/java/com/xhkjedu/suser/mapper/system/UserMapper.java
  14. 22
    0
      suser/src/main/java/com/xhkjedu/suser/mapper/system/UserModuleMapper.java
  15. 5
    131
      suser/src/main/java/com/xhkjedu/suser/service/gradeclass/ClassService.java
  16. 21
    28
      suser/src/main/java/com/xhkjedu/suser/service/gradeclass/ClassStudentService.java
  17. 12
    16
      suser/src/main/java/com/xhkjedu/suser/service/gradeclass/ClassTeacherService.java
  18. 7
    8
      suser/src/main/java/com/xhkjedu/suser/service/gradeclass/GroupService.java
  19. 49
    49
      suser/src/main/java/com/xhkjedu/suser/service/system/TeacherRoleService.java
  20. 44
    78
      suser/src/main/java/com/xhkjedu/suser/service/system/UserService.java
  21. 0
    26
      suser/src/main/java/com/xhkjedu/suser/vo/subjectbook/LsbBookVo.java
  22. 0
    22
      suser/src/main/java/com/xhkjedu/suser/vo/subjectbook/SubjectVo.java
  23. 0
    40
      suser/src/main/java/com/xhkjedu/suser/vo/subjectbook/TeacherSubjectbookVo.java
  24. 2
    2
      suser/src/main/java/com/xhkjedu/suser/vo/system/TeacherRoleVo.java
  25. 0
    36
      suser/src/main/resources/mapper/gradeclass/ClassMapper.xml
  26. 0
    25
      suser/src/main/resources/mapper/gradeclass/ClassStudentMapper.xml
  27. 0
    16
      suser/src/main/resources/mapper/gradeclass/ClassTeacherMapper.xml
  28. 0
    8
      suser/src/main/resources/mapper/gradeclass/GroupMapper.xml
  29. 0
    4
      suser/src/main/resources/mapper/gradeclass/GroupStudentMapper.xml
  30. 4
    0
      suser/src/main/resources/mapper/gradeclass/SchoolMapper.xml
  31. 16
    0
      suser/src/main/resources/mapper/liveplay/CourseMapper.xml
  32. 33
    0
      suser/src/main/resources/mapper/subjectbook/TeacherPowersbMapper.xml
  33. 17
    0
      suser/src/main/resources/mapper/subjectbook/TeacherSubjectBookMapper.xml
  34. 13
    0
      suser/src/main/resources/mapper/system/MsgMapper.xml
  35. 2
    43
      suser/src/main/resources/mapper/system/UserMapper.xml
  36. 11
    0
      suser/src/main/resources/mapper/system/UserModuleMapper.xml

+ 5
- 6
suser/src/main/java/com/xhkjedu/suser/controller/system/TeacherRoleController.java View File

1
 package com.xhkjedu.suser.controller.system;
1
 package com.xhkjedu.suser.controller.system;
2
 
2
 
3
 import com.xhkjedu.suser.service.system.TeacherRoleService;
3
 import com.xhkjedu.suser.service.system.TeacherRoleService;
4
-import com.xhkjedu.utils.N_Utils;
5
-import com.xhkjedu.vo.ResultVo;
6
 import com.xhkjedu.suser.vo.gradeclass.GradeVo;
4
 import com.xhkjedu.suser.vo.gradeclass.GradeVo;
7
-import com.xhkjedu.suser.vo.subjectbook.LsbBookVo;
8
-import com.xhkjedu.suser.vo.subjectbook.SubjectVo;
9
 import com.xhkjedu.suser.vo.system.TeacherRoleParam;
5
 import com.xhkjedu.suser.vo.system.TeacherRoleParam;
10
 import com.xhkjedu.suser.vo.system.TeacherRoleVo;
6
 import com.xhkjedu.suser.vo.system.TeacherRoleVo;
7
+import com.xhkjedu.utils.N_Utils;
8
+import com.xhkjedu.vo.ResultVo;
11
 import org.springframework.beans.factory.annotation.Autowired;
9
 import org.springframework.beans.factory.annotation.Autowired;
12
 import org.springframework.web.bind.annotation.PostMapping;
10
 import org.springframework.web.bind.annotation.PostMapping;
13
 import org.springframework.web.bind.annotation.RequestBody;
11
 import org.springframework.web.bind.annotation.RequestBody;
15
 import org.springframework.web.bind.annotation.RestController;
13
 import org.springframework.web.bind.annotation.RestController;
16
 
14
 
17
 import java.util.List;
15
 import java.util.List;
16
+import java.util.Map;
18
 
17
 
19
 /**
18
 /**
20
  * @ClassName TeacherRoleController
19
  * @ClassName TeacherRoleController
91
     public ResultVo listSubject(@RequestBody TeacherRoleParam trole){
90
     public ResultVo listSubject(@RequestBody TeacherRoleParam trole){
92
         Integer teacherid = trole.getTeacherid();
91
         Integer teacherid = trole.getTeacherid();
93
         N_Utils.validation(new Object[]{teacherid,"教师id",1});
92
         N_Utils.validation(new Object[]{teacherid,"教师id",1});
94
-        List<SubjectVo> subject = teacherRoleService.listSubject(teacherid);
93
+        List<Map> subject = teacherRoleService.listSubject(teacherid);
95
         return new ResultVo(0,"获取教师权限科目列表成功",subject);
94
         return new ResultVo(0,"获取教师权限科目列表成功",subject);
96
     }
95
     }
97
 
96
 
107
         Integer teacherid = trole.getTeacherid();
106
         Integer teacherid = trole.getTeacherid();
108
         String subjectid = trole.getSubjectid();
107
         String subjectid = trole.getSubjectid();
109
         N_Utils.validation(new Object[]{teacherid,"教师id",1,subjectid,"科目id",2});
108
         N_Utils.validation(new Object[]{teacherid,"教师id",1,subjectid,"科目id",2});
110
-        List<LsbBookVo> subject = teacherRoleService.listBookBySubjectid(teacherid,subjectid);
109
+        List<Map> subject = teacherRoleService.listBookBySubjectid(teacherid, subjectid);
111
         return new ResultVo(0,"获取科目下权限教材列表成功",subject);
110
         return new ResultVo(0,"获取科目下权限教材列表成功",subject);
112
     }
111
     }
113
 
112
 

+ 0
- 23
suser/src/main/java/com/xhkjedu/suser/mapper/gradeclass/ClassMapper.java View File

17
     //更新班级、分组学生数量
17
     //更新班级、分组学生数量
18
     void updateNum2(@Param("classid") Integer classid);
18
     void updateNum2(@Param("classid") Integer classid);
19
 
19
 
20
-    //要升级的班级列表
21
-    List<TClass> listClassBySchoolId(@Param("schoolid") Integer schoolid,@Param("year") Integer year);
22
-    //升级时要毕业的班级列表
23
-    List<TClass> listClassBiyeBySchoolId(@Param("schoolid") Integer schoolid,@Param("year") Integer year,@Param("classstate") Integer classstate);
24
-
25
-    //要升级的班级id字符串
26
-    String listClassIdBySchoolId(@Param("schoolid") Integer schoolid,@Param("year") Integer year);
27
-
28
     //基本信息
20
     //基本信息
29
     ClassVo getById(Integer classid);
21
     ClassVo getById(Integer classid);
30
 
22
 
31
-    //年级下班级id集合
32
-    List<Integer> listClassidsByGradeid(@Param("gradeid") Integer gradeid,@Param("schoolid") Integer schoolid);
33
-
34
     //根据班级名称获取班级信息
23
     //根据班级名称获取班级信息
35
     TClass getByName(@Param("tClass") TClass tClass);
24
     TClass getByName(@Param("tClass") TClass tClass);
36
 
25
 
37
     //获取任教老师列表
26
     //获取任教老师列表
38
     List<String> listTeacher(@Param("classid") Integer classid);
27
     List<String> listTeacher(@Param("classid") Integer classid);
39
 
28
 
40
-    //修改班级状态
41
-    void updateClassState(@Param("classstate") Integer classstate, @Param("classids") String classids);
42
-
43
     //修改单个班级状态
29
     //修改单个班级状态
44
     Integer updateClassstateByClassid(@Param("classid") Integer classid, @Param("classstate") Integer classstate);
30
     Integer updateClassstateByClassid(@Param("classid") Integer classid, @Param("classstate") Integer classstate);
45
-
46
-    //修改的那个班级类型
47
-    Integer updateClasstype(@Param("classid") Integer classid, @Param("classtype") Integer classtype);
48
-
49
-    //获取班级当前年份
50
-    Integer getYearById(Integer classid);
51
-
52
-    //根据班级名称获取班级id
53
-    Integer getClassIdByName(String classname, Integer schoolid, Integer gradeid, Integer year);
54
 }
31
 }

+ 0
- 11
suser/src/main/java/com/xhkjedu/suser/mapper/gradeclass/ClassStudentMapper.java View File

5
 import com.xhkjedu.suser.vo.gradeclass.ClassStudentVo;
5
 import com.xhkjedu.suser.vo.gradeclass.ClassStudentVo;
6
 import com.xhkjedu.suser.vo.gradeclass.ClassVo;
6
 import com.xhkjedu.suser.vo.gradeclass.ClassVo;
7
 import com.xhkjedu.suser.vo.gradeclass.ImportStudentVo;
7
 import com.xhkjedu.suser.vo.gradeclass.ImportStudentVo;
8
-import com.xhkjedu.suser.vo.paper.AStudentPaperVo;
9
-import com.xhkjedu.suser.vo.paper.AnalyzeSearchVo;
10
 import org.apache.ibatis.annotations.Param;
8
 import org.apache.ibatis.annotations.Param;
11
 
9
 
12
 import java.util.List;
10
 import java.util.List;
24
     //获取学生行政班id
22
     //获取学生行政班id
25
     Integer getClassIdByStuId(@Param("studentid") Integer studentid);
23
     Integer getClassIdByStuId(@Param("studentid") Integer studentid);
26
 
24
 
27
-    //获取要升级的学生列表
28
-    List<TClassStudent> listStudentByClassIds(@Param("classIds") String classIds);
29
-
30
     /**
25
     /**
31
      * 根据班级id和学生id获取班级学生信息
26
      * 根据班级id和学生id获取班级学生信息
32
      * @Param [classid, studentid]
27
      * @Param [classid, studentid]
52
     //添加
47
     //添加
53
     void save(@Param("student") TClassStudent student);
48
     void save(@Param("student") TClassStudent student);
54
 
49
 
55
-    //学生所在行政班
56
-    ClassVo getClassByStuId(@Param("studentid") Integer studentid);
57
-
58
-    //作业/预习统计--学生列表
59
-    List<AStudentPaperVo> listStu(@Param("paper") AnalyzeSearchVo paper);
60
-
61
     //获取学生所有提高班
50
     //获取学生所有提高班
62
     List<Integer> listTgClassid(Integer studentid);
51
     List<Integer> listTgClassid(Integer studentid);
63
 }
52
 }

+ 0
- 15
suser/src/main/java/com/xhkjedu/suser/mapper/gradeclass/ClassTeacherMapper.java View File

31
     //当前年份教师任教班级
31
     //当前年份教师任教班级
32
     List<ClassVo> listTeacherClass2(@Param("teacherid") Integer teacherid,@Param("year") Integer year);
32
     List<ClassVo> listTeacherClass2(@Param("teacherid") Integer teacherid,@Param("year") Integer year);
33
 
33
 
34
-    /**
35
-     * 要升级的教师列表
36
-     * @Param [classIds]
37
-     * @Author ywx
38
-     * @Date 2020/6/16 14:04
39
-     * @return java.util.List<com.xhkjedu.model.gradeclass.TClassTeacher>
40
-     **/
41
-    List<TClassTeacher> listTeacherByClassIds(@Param("classIds") String classIds);
42
-
43
     //删除教师任教班级
34
     //删除教师任教班级
44
     void deleteByUserid(Integer userid,Integer year);
35
     void deleteByUserid(Integer userid,Integer year);
45
 
36
 
81
     List<ClassTeacherVo> listTeahcersBySubjectGrade(@Param("ctp") ClassTeacherParams ctp);
72
     List<ClassTeacherVo> listTeahcersBySubjectGrade(@Param("ctp") ClassTeacherParams ctp);
82
 
73
 
83
     List<GradeVo> listGradeClassesByUserid2(@Param("role") TeacherRoleParam role);
74
     List<GradeVo> listGradeClassesByUserid2(@Param("role") TeacherRoleParam role);
84
-
85
-    //删除班级下所有教师
86
-    void deleteByClassId(Integer classid);
87
-
88
-    //获取教师任教行政和提高班id
89
-    String getClassIds(Integer teacherid);
90
 }
75
 }

+ 0
- 5
suser/src/main/java/com/xhkjedu/suser/mapper/gradeclass/GroupMapper.java View File

18
 
18
 
19
     //教师分组列表
19
     //教师分组列表
20
     List<ClassGroupVo> teacherList(@Param("teacherid") Integer teacherid,@Param("year") Integer year);
20
     List<ClassGroupVo> teacherList(@Param("teacherid") Integer teacherid,@Param("year") Integer year);
21
-
22
-    List<Integer> listStudentidsByGroupids(@Param("groupids") String groupids);
23
-
24
-    //要升级的全体分组列表
25
-    List<TGroup> listStudentByClassIds(@Param("classIds") String classIds);
26
 }
21
 }

+ 0
- 3
suser/src/main/java/com/xhkjedu/suser/mapper/gradeclass/GroupStudentMapper.java View File

11
     //列表
11
     //列表
12
     List<GroupStudentVo> findAll(Integer groupid);
12
     List<GroupStudentVo> findAll(Integer groupid);
13
 
13
 
14
-    //获取要升级的学生列表
15
-    List<TGroupStudent> listStudentByGroupIds(@Param("groupIds") String groupIds);
16
-
17
     //删除分组学生
14
     //删除分组学生
18
     Integer deleteByGroupId(Integer groupid);
15
     Integer deleteByGroupId(Integer groupid);
19
 
16
 

+ 3
- 0
suser/src/main/java/com/xhkjedu/suser/mapper/gradeclass/SchoolMapper.java View File

6
 
6
 
7
     //获取用户当前年份
7
     //获取用户当前年份
8
     Integer getYearByUserId(Integer userid);
8
     Integer getYearByUserId(Integer userid);
9
+
10
+    //获取学校账号数量
11
+    Integer getUserNumById(Integer schoolid);
9
 }
12
 }

+ 14
- 0
suser/src/main/java/com/xhkjedu/suser/mapper/liveplay/CourseMapper.java View File

1
+package com.xhkjedu.suser.mapper.liveplay;
2
+
3
+import org.apache.ibatis.annotations.Param;
4
+
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+public interface CourseMapper {
9
+    //更新已报学生数量
10
+    void updateStuNum(@Param("courseid") Integer courseid);
11
+
12
+    //行政班的所有直播课
13
+    List<Map> listXzCourse(Integer classid);
14
+}

+ 56
- 0
suser/src/main/java/com/xhkjedu/suser/mapper/subjectbook/TeacherPowersbMapper.java View File

1
+package com.xhkjedu.suser.mapper.subjectbook;
2
+
3
+import com.xhkjedu.suser.base.TkMapper;
4
+import com.xhkjedu.suser.model.subjectbook.TTeacherPowersb;
5
+import org.apache.ibatis.annotations.Param;
6
+import org.springframework.stereotype.Repository;
7
+
8
+import java.util.List;
9
+import java.util.Map;
10
+
11
+/**
12
+ * @ClassName TeacherPowersbMapper
13
+ * Description 教师教材权限
14
+ * Author WN
15
+ * Date 2020/7/1 19:05
16
+ **/
17
+@Repository
18
+public interface TeacherPowersbMapper extends TkMapper<TTeacherPowersb> {
19
+
20
+    /**
21
+     *功能描述  根据用户id删除教师权限教材
22
+     * @author WN
23
+     * @date 2020/7/1
24
+     * @param  * @param userid
25
+     * @return void
26
+     */
27
+    void deleteByUserid(@Param("userid")Integer userid);
28
+
29
+    /**
30
+     *功能描述  获取教师权限教材
31
+     * @author WN
32
+     * @date 2020/7/1
33
+     * @param  * @param userid
34
+     * @return java.util.List<com.xhkjedu.vo.subjectbook.TeacherSubjectbookVo>
35
+     */
36
+    List<Map> listLsbsByUserid(@Param("userid")Integer userid);
37
+
38
+    /**
39
+     * 教师权限科目
40
+     * @Param [teacherid]
41
+     * @Author ywx
42
+     * @Date 2020/7/24 9:26
43
+     * @return java.util.List<com.xhkjedu.vo.subjectbook.SubjectVo>
44
+     **/
45
+    List<Map> listSubject(@Param("teacherid") Integer teacherid);
46
+
47
+    /**
48
+     *功能描述 教师权限科目下,权限教材
49
+     * @author WN
50
+     * @date 2020/8/11
51
+     * @param  * @param teacherid
52
+     * @param subjectid
53
+     * @return java.util.List<com.xhkjedu.vo.subjectbook.LsbBookVo>
54
+     */
55
+    List<Map> listBookBySubjectid(@Param("teacherid") Integer teacherid, @Param("subjectid") String subjectid);
56
+}

+ 15
- 0
suser/src/main/java/com/xhkjedu/suser/mapper/subjectbook/TeacherSubjectbookMapper.java View File

1
+package com.xhkjedu.suser.mapper.subjectbook;
2
+
3
+import org.apache.ibatis.annotations.Param;
4
+import org.springframework.stereotype.Repository;
5
+
6
+import java.util.List;
7
+
8
+@Repository
9
+public interface TeacherSubjectbookMapper {
10
+    //获取用户教材集合
11
+    List<String> listLsbsByUserid(Integer userid);
12
+
13
+    //删除教师收藏教材
14
+    Integer deleteByLsbIdTeacherId(@Param("lsbids") List<String> lsbids,@Param("teacherid") Integer teacherid);
15
+}

+ 24
- 0
suser/src/main/java/com/xhkjedu/suser/mapper/system/MsgMapper.java View File

1
+package com.xhkjedu.suser.mapper.system;
2
+
3
+import com.xhkjedu.suser.base.TkMapper;
4
+import com.xhkjedu.suser.model.system.TMsg;
5
+
6
+public interface MsgMapper extends TkMapper<TMsg> {
7
+    /**
8
+     * 5分钟内发送短信次数
9
+     * @Param [userphone]
10
+     * @Author ywx
11
+     * @Date 2020/10/15 16:55
12
+     * @return java.lang.Integer
13
+     **/
14
+    Integer getMsgNumByUserPhone(String userphone);
15
+
16
+    /**
17
+     * 根据手机号和验证码获取短信信息
18
+     * @Param [userphone, msgcode]
19
+     * @Author ywx
20
+     * @Date 2020/10/15 17:04
21
+     * @return com.xhkjedu.model.system.TMsg
22
+     **/
23
+    TMsg findByUserPhoneAndCode(String userphone, Integer msgcode);
24
+}

+ 9
- 0
suser/src/main/java/com/xhkjedu/suser/mapper/system/UserLogMapper.java View File

1
+package com.xhkjedu.suser.mapper.system;
2
+
3
+import com.xhkjedu.suser.base.TkMapper;
4
+import com.xhkjedu.suser.model.system.TUserLog;
5
+import org.springframework.stereotype.Repository;
6
+
7
+@Repository
8
+public interface UserLogMapper extends TkMapper<TUserLog> {
9
+}

+ 0
- 34
suser/src/main/java/com/xhkjedu/suser/mapper/system/UserMapper.java View File

1
 package com.xhkjedu.suser.mapper.system;
1
 package com.xhkjedu.suser.mapper.system;
2
 
2
 
3
 import com.xhkjedu.suser.base.TkMapper;
3
 import com.xhkjedu.suser.base.TkMapper;
4
-import com.xhkjedu.suser.model.gradeclass.TClassStudent;
5
 import com.xhkjedu.suser.model.system.TUser;
4
 import com.xhkjedu.suser.model.system.TUser;
6
-import com.xhkjedu.suser.model.system.TUserLog;
7
 import com.xhkjedu.suser.vo.assess.AssessParams;
5
 import com.xhkjedu.suser.vo.assess.AssessParams;
8
 import com.xhkjedu.suser.vo.system.TeacherVo;
6
 import com.xhkjedu.suser.vo.system.TeacherVo;
9
 import com.xhkjedu.suser.vo.system.UserVo;
7
 import com.xhkjedu.suser.vo.system.UserVo;
150
      **/
148
      **/
151
     UserVo getUserByLoginnameMac(String loginname, String mac);
149
     UserVo getUserByLoginnameMac(String loginname, String mac);
152
 
150
 
153
-    /**
154
-     * 删除学生绑定信息
155
-     * @Param [schoolid]
156
-     * @Author ywx
157
-     * @Date 2020/9/24 11:42
158
-     * @return void
159
-     **/
160
-    void delBindmac(Integer schoolid);
161
-
162
     /**
151
     /**
163
      * 通过短信修改密码
152
      * 通过短信修改密码
164
      * @Param [user]
153
      * @Param [user]
177
      **/
166
      **/
178
     void batchUpdatePwd(@Param("user") TUser user);
167
     void batchUpdatePwd(@Param("user") TUser user);
179
 
168
 
180
-    String getUserNameById(@Param("userid")Integer userid);
181
-
182
-    //批量修改学生状态
183
-    void batchUpdateState(@Param("users")List<TClassStudent> users,@Param("userstate")Integer userstate);
184
-
185
-    //获取学校管理员
186
-    UserVo getSchoolAdminBySchoolid(@Param("schoolid")Integer schoolid);
187
-
188
     //校验手机号
169
     //校验手机号
189
     boolean checkUserPhone(Integer userid);
170
     boolean checkUserPhone(Integer userid);
190
 
171
 
191
-    //根据登录名获取学生id和行政和提高班班级id
192
-    TUser getObjByLoginName2(@Param("loginname") String loginname);
193
-
194
     //获取学校账号数量
172
     //获取学校账号数量
195
     Integer getUserNumBySchoolId(Integer schoolid);
173
     Integer getUserNumBySchoolId(Integer schoolid);
196
 
174
 
197
     //用户选择列表
175
     //用户选择列表
198
     List<Map> listForSel(@Param("user") AssessParams user, @Param("year") Integer year);
176
     List<Map> listForSel(@Param("user") AssessParams user, @Param("year") Integer year);
199
-
200
-    //根据班级id用户名获取学生id和数量
201
-    Map getUserIdByName(Integer schoolid, Integer classid, String username);
202
-
203
-    //根据班级科目id用户名获取教师id和数量
204
-    Map getUserIdByName2(Integer schoolid, Integer classid, String username, String subjectid);
205
-
206
-    //根据用户id获取用户类型
207
-    Integer getUsertypeById(Integer userid);
208
-
209
-    //添加登录日志
210
-    void saveUserLog(@Param("log") TUserLog userLog);
211
 }
177
 }

+ 22
- 0
suser/src/main/java/com/xhkjedu/suser/mapper/system/UserModuleMapper.java View File

1
+package com.xhkjedu.suser.mapper.system;
2
+
3
+import com.xhkjedu.suser.base.TkMapper;
4
+import com.xhkjedu.suser.model.system.TUserModule;
5
+import org.apache.ibatis.annotations.Param;
6
+import org.springframework.stereotype.Repository;
7
+
8
+/**
9
+ * @ClassName UserModuleMapper
10
+ * Description 用户常用模块
11
+ * Author WN
12
+ * Date 2020/6/15 14:51
13
+ **/
14
+@Repository
15
+public interface UserModuleMapper extends TkMapper<TUserModule> {
16
+    /**
17
+     * @author ywx
18
+     * @description 根据用户id删除没有权限的常用模块
19
+     * @date 2020/7/9 20:55
20
+     **/
21
+    Integer deleteNoRoleByUserId(@Param("userid") Integer userid);
22
+}

+ 5
- 131
suser/src/main/java/com/xhkjedu/suser/service/gradeclass/ClassService.java View File

1
 package com.xhkjedu.suser.service.gradeclass;
1
 package com.xhkjedu.suser.service.gradeclass;
2
 
2
 
3
 import com.xhkjedu.suser.mapper.gradeclass.ClassMapper;
3
 import com.xhkjedu.suser.mapper.gradeclass.ClassMapper;
4
-import com.xhkjedu.suser.mapper.gradeclass.ClassStudentMapper;
5
-import com.xhkjedu.suser.mapper.gradeclass.GroupStudentMapper;
6
-//import com.xhkjedu.suser.mapper.gradeclass.SchoolMapper;
4
+import com.xhkjedu.suser.mapper.gradeclass.SchoolMapper;
7
 import com.xhkjedu.suser.model.gradeclass.TClass;
5
 import com.xhkjedu.suser.model.gradeclass.TClass;
8
-import com.xhkjedu.suser.model.gradeclass.TClassStudent;
9
 import com.xhkjedu.suser.model.gradeclass.TGroup;
6
 import com.xhkjedu.suser.model.gradeclass.TGroup;
10
-import com.xhkjedu.suser.model.gradeclass.TGroupStudent;
11
-import com.xhkjedu.suser.model.gradeclass.TSchool;
7
+import com.xhkjedu.suser.vo.gradeclass.ClassVo;
12
 import com.xhkjedu.utils.N_Utils;
8
 import com.xhkjedu.utils.N_Utils;
13
 import com.xhkjedu.vo.ResultVo;
9
 import com.xhkjedu.vo.ResultVo;
14
-import com.xhkjedu.suser.vo.gradeclass.ClassVo;
15
-import org.springframework.beans.BeanUtils;
16
 import org.springframework.stereotype.Service;
10
 import org.springframework.stereotype.Service;
17
 
11
 
18
 import javax.annotation.Resource;
12
 import javax.annotation.Resource;
19
-import java.util.ArrayList;
20
 import java.util.List;
13
 import java.util.List;
21
 
14
 
22
 /**
15
 /**
32
     @Resource
25
     @Resource
33
     private GroupService groupService;
26
     private GroupService groupService;
34
     @Resource
27
     @Resource
35
-    private ClassStudentMapper classStudentMapper;
36
-    @Resource
37
-    private GroupStudentMapper groupStudentMapper;
38
-    //@Resource
39
-    //private SchoolMapper schoolMapper;
28
+    private SchoolMapper schoolMapper;
40
 
29
 
41
     //添加
30
     //添加
42
     public Integer save(TClass model) {
31
     public Integer save(TClass model) {
43
         model.setCreatetime(N_Utils.getSecondTimestamp());
32
         model.setCreatetime(N_Utils.getSecondTimestamp());
44
         model.setClassnum(0);
33
         model.setClassnum(0);
45
         model.setClassstate(1);
34
         model.setClassstate(1);
46
-        //TSchool school = schoolMapper.selectByPrimaryKey(model.getSchoolid());
47
-        //model.setYear(school.getYear());//当前年份必须和学校年份一致
35
+        Integer year = schoolMapper.getYearById(model.getSchoolid());
36
+        model.setYear(year);//当前年份必须和学校年份一致
48
         classMapper.insertUseGeneratedKeys(model);
37
         classMapper.insertUseGeneratedKeys(model);
49
         //创建全体分组
38
         //创建全体分组
50
         TGroup group = new TGroup();
39
         TGroup group = new TGroup();
59
 
48
 
60
     //删除
49
     //删除
61
     public ResultVo deleteById(Integer classid) {
50
     public ResultVo deleteById(Integer classid) {
62
-        //2021-06-07删除时执行逻辑删除,不再判断是否有学生
63
-        /*ImportStudentVo student = classStudentMapper.getNumById(classid,0);
64
-        if (student.getClassnum() !=0){
65
-            return new ResultVo(1,"班级已关联学生,暂无法删除");
66
-        }*/
67
         classMapper.updateClassstateByClassid(classid,10);//删除班级逻辑删除
51
         classMapper.updateClassstateByClassid(classid,10);//删除班级逻辑删除
68
         return new ResultVo(0,"删除成功");
52
         return new ResultVo(0,"删除成功");
69
     }
53
     }
70
 
54
 
71
-    //删除
72
-    public ResultVo deleteById2(Integer classid) {
73
-        classMapper.deleteByPrimaryKey(classid);
74
-        return new ResultVo(0,"删除成功");
75
-    }
76
-
77
     //修改
55
     //修改
78
     public Integer update(TClass model) {
56
     public Integer update(TClass model) {
79
         model.setYear(null);//当前年份不能修改
57
         model.setYear(null);//当前年份不能修改
85
         return classMapper.findAll(tClass);
63
         return classMapper.findAll(tClass);
86
     }
64
     }
87
 
65
 
88
-    //更新学生数量
89
-    public void updateNum(Integer classid) {
90
-        classMapper.updateNum(classid);
91
-    }
92
-
93
-    //更新班级、分组学生数量
94
-    public void updateNum2(Integer classid) {
95
-        classMapper.updateNum2(classid);
96
-    }
97
-
98
-    //基本信息
99
-    public ClassVo getById(Integer classid) {
100
-        return classMapper.getById(classid);
101
-    }
102
-
103
-    //学生选课
104
-    public void saveSelection(Integer classid, Integer studentid, Integer teacherid, Integer schoolid) {
105
-        TClassStudent student = classStudentMapper.getByClassIdStudentId(classid, studentid);
106
-        if (student == null) {
107
-            //班级学生
108
-            TClassStudent cs = new TClassStudent();
109
-            cs.setClassid(classid);
110
-            cs.setStudentid(studentid);
111
-            cs.setCreateid(teacherid);
112
-            cs.setSchoolid(schoolid);
113
-            cs.setCreatetime(N_Utils.getSecondTimestamp());
114
-            classStudentMapper.save(cs);
115
-
116
-            //分组学生
117
-            ClassVo classVo = getById(classid);
118
-            Integer groupid = classVo.getGroupid();
119
-            TGroupStudent gs = new TGroupStudent();
120
-            gs.setClassid(classid);
121
-            gs.setGroupid(groupid);
122
-            gs.setStudentid(studentid);
123
-            gs.setCreateid(teacherid);
124
-            gs.setSchoolid(schoolid);
125
-            gs.setCreatetime(N_Utils.getSecondTimestamp());
126
-            groupStudentMapper.save(gs);
127
-        }
128
-
129
-        //更新班级、分组学生数量
130
-        updateNum2(classid);
131
-    }
132
-
133
-    //学生取消选课
134
-    public void cancelSelection(Integer classid, Integer studentid) {
135
-        classStudentMapper.deleteById(classid, studentid);
136
-        //更新班级、分组学生数量
137
-        updateNum2(classid);
138
-    }
139
-
140
-    //批量添加报名学生
141
-    public void batchSaveStu(Integer createid, Integer schoolid, Integer classid, List<Integer> studentids) {
142
-        List<TClassStudent> classStudents = new ArrayList<>();
143
-        List<TGroupStudent> groupStudents = new ArrayList<>();
144
-        //班级学生
145
-        TClassStudent cs = new TClassStudent();
146
-        cs.setClassid(classid);
147
-        cs.setCreateid(createid);
148
-        cs.setSchoolid(schoolid);
149
-        cs.setCreatetime(N_Utils.getSecondTimestamp());
150
-        //分组学生
151
-        ClassVo classVo = getById(classid);
152
-        Integer groupid = classVo.getGroupid();
153
-        TGroupStudent gs = new TGroupStudent();
154
-        gs.setClassid(classid);
155
-        gs.setGroupid(groupid);
156
-        gs.setCreateid(createid);
157
-        gs.setSchoolid(schoolid);
158
-        gs.setCreatetime(N_Utils.getSecondTimestamp());
159
-        for (Integer studentid : studentids) {
160
-            TClassStudent classStudent = new TClassStudent();
161
-            BeanUtils.copyProperties(cs, classStudent);
162
-            classStudent.setStudentid(studentid);
163
-            classStudents.add(classStudent);
164
-
165
-            TGroupStudent groupStudent = new TGroupStudent();
166
-            BeanUtils.copyProperties(gs, groupStudent);
167
-            groupStudent.setStudentid(studentid);
168
-            groupStudents.add(groupStudent);
169
-        }
170
-        classStudentMapper.insertList(classStudents);
171
-        groupStudentMapper.insertList(groupStudents);
172
-        updateNum2(classid);
173
-    }
174
-
175
-    public TClassStudent getByClassIdStudentId(Integer classid,Integer studentid){
176
-        return classStudentMapper.getByClassIdStudentId(classid,studentid);
177
-    }
178
-
179
-    public List<Integer> listClassidsByGradeid(Integer gradeid,Integer schoolid){
180
-        return classMapper.listClassidsByGradeid(gradeid,schoolid);
181
-    }
182
-
183
     //根据班级名称获取班级信息
66
     //根据班级名称获取班级信息
184
     public TClass getByName(TClass tClass) {
67
     public TClass getByName(TClass tClass) {
185
         return classMapper.getByName(tClass);
68
         return classMapper.getByName(tClass);
189
     public List<String> listTeacher(Integer classid) {
72
     public List<String> listTeacher(Integer classid) {
190
         return classMapper.listTeacher(classid);
73
         return classMapper.listTeacher(classid);
191
     }
74
     }
192
-
193
-    //修改班级类型
194
-    public Integer updateClasstype(Integer classid, Integer classtype){
195
-        return classMapper.updateClasstype(classid, classtype);
196
-    }
197
-
198
-    public Integer updateClassstateByClassid(Integer classid,Integer classstate){
199
-        return classMapper.updateClassstateByClassid(classid, classstate);
200
-    }
201
 }
75
 }

+ 21
- 28
suser/src/main/java/com/xhkjedu/suser/service/gradeclass/ClassStudentService.java View File

3
 import com.xhkjedu.config.MissingParametersException;
3
 import com.xhkjedu.config.MissingParametersException;
4
 import com.xhkjedu.suser.mapper.gradeclass.ClassMapper;
4
 import com.xhkjedu.suser.mapper.gradeclass.ClassMapper;
5
 import com.xhkjedu.suser.mapper.gradeclass.ClassStudentMapper;
5
 import com.xhkjedu.suser.mapper.gradeclass.ClassStudentMapper;
6
-//import com.xhkjedu.suser.mapper.gradeclass.SchoolMapper;
7
-//import com.xhkjedu.suser.mapper.liveplay.CourseMapper;
8
-//import com.xhkjedu.suser.model.liveplay.LCourse;
6
+import com.xhkjedu.suser.mapper.gradeclass.SchoolMapper;
7
+import com.xhkjedu.suser.mapper.liveplay.CourseMapper;
9
 import com.xhkjedu.suser.model.gradeclass.TClassStudent;
8
 import com.xhkjedu.suser.model.gradeclass.TClassStudent;
10
 import com.xhkjedu.suser.model.gradeclass.TGroupStudent;
9
 import com.xhkjedu.suser.model.gradeclass.TGroupStudent;
11
 import com.xhkjedu.suser.model.system.TUser;
10
 import com.xhkjedu.suser.model.system.TUser;
12
 import com.xhkjedu.suser.service.system.UserService;
11
 import com.xhkjedu.suser.service.system.UserService;
13
-import com.xhkjedu.utils.N_Utils;
14
 import com.xhkjedu.suser.utils.PoiUtils;
12
 import com.xhkjedu.suser.utils.PoiUtils;
15
-import com.xhkjedu.vo.ResultVo;
16
 import com.xhkjedu.suser.vo.gradeclass.ClassStudentVo;
13
 import com.xhkjedu.suser.vo.gradeclass.ClassStudentVo;
17
 import com.xhkjedu.suser.vo.gradeclass.ClassVo;
14
 import com.xhkjedu.suser.vo.gradeclass.ClassVo;
18
 import com.xhkjedu.suser.vo.gradeclass.ImportStudentVo;
15
 import com.xhkjedu.suser.vo.gradeclass.ImportStudentVo;
16
+import com.xhkjedu.utils.N_Utils;
17
+import com.xhkjedu.vo.ResultVo;
19
 import lombok.extern.slf4j.Slf4j;
18
 import lombok.extern.slf4j.Slf4j;
20
 import org.springframework.stereotype.Service;
19
 import org.springframework.stereotype.Service;
21
 import org.springframework.transaction.annotation.Transactional;
20
 import org.springframework.transaction.annotation.Transactional;
44
     private GroupStudentService groupStudentService;
43
     private GroupStudentService groupStudentService;
45
     @Resource
44
     @Resource
46
     private ClassMapper classMapper;
45
     private ClassMapper classMapper;
47
-    //@Resource
48
-    //private SchoolMapper schoolMapper;
49
-    //@Resource
50
-    //private CourseMapper courseMapper;
46
+    @Resource
47
+    private SchoolMapper schoolMapper;
48
+    @Resource
49
+    private CourseMapper courseMapper;
51
 
50
 
52
     //批量添加
51
     //批量添加
53
     public void batchAdd(List<TClassStudent> students) throws Exception {
52
     public void batchAdd(List<TClassStudent> students) throws Exception {
135
             }
134
             }
136
         }
135
         }
137
 
136
 
138
-        //2021年4月28日,张道剑建议,南华凯、张剑、王宁 共同确认不再复制预习导学信息
139
-//        guideGroupStudentMapper.copyGuideResource(model.getStudentid(), model.getClassid());//复制学生预习导学信息
140
-
141
         //把这个学生加到此行政班、提高班相关的所有直播班中
137
         //把这个学生加到此行政班、提高班相关的所有直播班中
142
         if (classVo.getClasstype() == 1 || classVo.getClasstype() == 2) {
138
         if (classVo.getClasstype() == 1 || classVo.getClasstype() == 2) {
143
             saveCourseStu(model.getClassid(), model.getStudentid());
139
             saveCourseStu(model.getClassid(), model.getStudentid());
147
 
143
 
148
     //把这个学生加到此行政班相关的所有直播班中
144
     //把这个学生加到此行政班相关的所有直播班中
149
     public void saveCourseStu(Integer classid, Integer studentid) {
145
     public void saveCourseStu(Integer classid, Integer studentid) {
150
-        //List<LCourse> courses = courseMapper.listXzCourse(classid);
151
-        //for (LCourse course : courses) {
152
-        //    Integer courseid = course.getCourseid();
153
-        //    saveSelection(course.getClassid(), studentid, course.getCreateid(), course.getSchoolid());
154
-        //    courseMapper.updateStuNum(courseid);
155
-        //}
146
+        List<Map> courses = courseMapper.listXzCourse(classid);
147
+        for (Map course : courses) {
148
+            Integer courseid = (Integer) course.get("courseid");
149
+            saveSelection((Integer) course.get("classid"), studentid, (Integer) course.get("createid"), (Integer) course.get("schoolid"));
150
+            courseMapper.updateStuNum(courseid);
151
+        }
156
     }
152
     }
157
 
153
 
158
     //学生选课
154
     //学生选课
200
         //把这个学生从此行政班、提高班关联的所有直播班移除
196
         //把这个学生从此行政班、提高班关联的所有直播班移除
201
         ClassVo classVo = classMapper.getById(classid);
197
         ClassVo classVo = classMapper.getById(classid);
202
         if (classVo.getClasstype() == 1 || classVo.getClasstype() == 2) {
198
         if (classVo.getClasstype() == 1 || classVo.getClasstype() == 2) {
203
-            //List<LCourse> courses = courseMapper.listXzCourse(classid);
204
-            //for (LCourse course : courses) {
205
-            //    cancelSelection(course.getClassid(), studentid);
206
-            //}
199
+            List<Map> courses = courseMapper.listXzCourse(classid);
200
+            for (Map course : courses) {
201
+                cancelSelection((Integer) course.get("classid"), studentid);
202
+            }
207
         }
203
         }
208
     }
204
     }
209
 
205
 
468
      * @return java.util.List<com.xhkjedu.suser.vo.gradeclass.ClassVo>
464
      * @return java.util.List<com.xhkjedu.suser.vo.gradeclass.ClassVo>
469
      */
465
      */
470
     public List<ClassVo> listClassByStudentId(Integer studentid){
466
     public List<ClassVo> listClassByStudentId(Integer studentid){
471
-        //Integer year = schoolMapper.getYearByUserId(studentid);
472
-        Integer year=2021;
467
+        Integer year = schoolMapper.getYearByUserId(studentid);
473
         return classStudentMapper.listClassByStudentId(year,studentid);
468
         return classStudentMapper.listClassByStudentId(year,studentid);
474
     }
469
     }
475
 
470
 
496
 
491
 
497
     //获取学生所在年级列表
492
     //获取学生所在年级列表
498
     public List<Integer> listGrade(Integer studentid) {
493
     public List<Integer> listGrade(Integer studentid) {
499
-        //Integer year = schoolMapper.getYearByUserId(studentid);
500
-        Integer year=2021;
494
+        Integer year = schoolMapper.getYearByUserId(studentid);
501
         return classStudentMapper.listGrade(studentid, year);
495
         return classStudentMapper.listGrade(studentid, year);
502
     }
496
     }
503
 
497
 
508
 
502
 
509
     //设置年份
503
     //设置年份
510
     public void setYear(TClassStudent student) {
504
     public void setYear(TClassStudent student) {
511
-        //Integer year = schoolMapper.getYearById(student.getSchoolid());
512
-        Integer year=2021;
505
+        Integer year = schoolMapper.getYearById(student.getSchoolid());
513
         student.setYear(year);
506
         student.setYear(year);
514
     }
507
     }
515
 
508
 

+ 12
- 16
suser/src/main/java/com/xhkjedu/suser/service/gradeclass/ClassTeacherService.java View File

2
 
2
 
3
 import com.xhkjedu.config.MissingParametersException;
3
 import com.xhkjedu.config.MissingParametersException;
4
 import com.xhkjedu.suser.mapper.gradeclass.ClassTeacherMapper;
4
 import com.xhkjedu.suser.mapper.gradeclass.ClassTeacherMapper;
5
-//import com.xhkjedu.suser.mapper.gradeclass.SchoolMapper;
5
+import com.xhkjedu.suser.mapper.gradeclass.SchoolMapper;
6
 import com.xhkjedu.suser.model.gradeclass.TClassTeacher;
6
 import com.xhkjedu.suser.model.gradeclass.TClassTeacher;
7
 import com.xhkjedu.suser.model.system.TUser;
7
 import com.xhkjedu.suser.model.system.TUser;
8
 import com.xhkjedu.suser.service.system.UserService;
8
 import com.xhkjedu.suser.service.system.UserService;
9
-import com.xhkjedu.utils.N_Utils;
10
-import com.xhkjedu.vo.ResultVo;
11
 import com.xhkjedu.suser.vo.gradeclass.ClassTeacherParams;
9
 import com.xhkjedu.suser.vo.gradeclass.ClassTeacherParams;
12
 import com.xhkjedu.suser.vo.gradeclass.ClassTeacherVo;
10
 import com.xhkjedu.suser.vo.gradeclass.ClassTeacherVo;
13
 import com.xhkjedu.suser.vo.gradeclass.ClassVo;
11
 import com.xhkjedu.suser.vo.gradeclass.ClassVo;
12
+import com.xhkjedu.utils.N_Utils;
13
+import com.xhkjedu.vo.ResultVo;
14
 import org.springframework.stereotype.Service;
14
 import org.springframework.stereotype.Service;
15
 
15
 
16
 import javax.annotation.Resource;
16
 import javax.annotation.Resource;
20
 /**
20
 /**
21
  * @author ywx
21
  * @author ywx
22
  * @classname TClassTeacherService
22
  * @classname TClassTeacherService
23
- * @description 
23
+ * @description
24
  * @date 2020/6/2 16:45
24
  * @date 2020/6/2 16:45
25
  **/
25
  **/
26
 @Service
26
 @Service
29
     private ClassTeacherMapper classTeacherMapper;
29
     private ClassTeacherMapper classTeacherMapper;
30
     @Resource
30
     @Resource
31
     private UserService userService;
31
     private UserService userService;
32
-    //@Resource
33
-    //private SchoolMapper schoolMapper;
32
+    @Resource
33
+    private SchoolMapper schoolMapper;
34
 
34
 
35
     //添加
35
     //添加
36
     public Integer save(TClassTeacher model) {
36
     public Integer save(TClassTeacher model) {
90
     }
90
     }
91
 
91
 
92
     public Integer getYear(Integer schoolid) {
92
     public Integer getYear(Integer schoolid) {
93
-        //return schoolMapper.getYearById(schoolid);
94
-        return 2021;
93
+        return schoolMapper.getYearById(schoolid);
95
     }
94
     }
96
 
95
 
97
     //当前年份教师任教班级
96
     //当前年份教师任教班级
98
     public List<ClassVo> listTeacherClass(Integer teacher,Integer classtype){
97
     public List<ClassVo> listTeacherClass(Integer teacher,Integer classtype){
99
-        //Integer year = schoolMapper.getYearByUserId(teacher);
100
-        Integer year=2021;
98
+        Integer year = schoolMapper.getYearByUserId(teacher);
101
         return classTeacherMapper.listTeacherClass(teacher,year,classtype);
99
         return classTeacherMapper.listTeacherClass(teacher,year,classtype);
102
     }
100
     }
103
     //当前年份教师任教班级
101
     //当前年份教师任教班级
104
     public List<ClassVo> listTeacherClass2(Integer teacher){
102
     public List<ClassVo> listTeacherClass2(Integer teacher){
105
-        //Integer year = schoolMapper.getYearByUserId(teacher);
106
-        Integer year=2021;
103
+        Integer year = schoolMapper.getYearByUserId(teacher);
107
         return classTeacherMapper.listTeacherClass2(teacher,year);
104
         return classTeacherMapper.listTeacherClass2(teacher,year);
108
     }
105
     }
109
 
106
 
132
      * @return java.util.List<com.xhkjedu.model.gradeclass.TClassTeacher>
129
      * @return java.util.List<com.xhkjedu.model.gradeclass.TClassTeacher>
133
      */
130
      */
134
     public List<ClassTeacherVo> listTeachersByGradeid(Integer schoolid,Integer gradeid){
131
     public List<ClassTeacherVo> listTeachersByGradeid(Integer schoolid,Integer gradeid){
135
-        //Integer year = schoolMapper.getYearById(schoolid);
136
-        Integer year=2021;
132
+        Integer year = schoolMapper.getYearById(schoolid);
137
         return classTeacherMapper.listTeachersByGradeid(schoolid,gradeid,year);
133
         return classTeacherMapper.listTeachersByGradeid(schoolid,gradeid,year);
138
     }
134
     }
139
 
135
 
145
      * @return java.util.List<com.xhkjedu.suser.vo.gradeclass.ClassTeacherVo>
141
      * @return java.util.List<com.xhkjedu.suser.vo.gradeclass.ClassTeacherVo>
146
      */
142
      */
147
     public List<ClassTeacherVo> listTeahcersBySubjectGrade(ClassTeacherParams ctp) {
143
     public List<ClassTeacherVo> listTeahcersBySubjectGrade(ClassTeacherParams ctp) {
148
-        //Integer year = schoolMapper.getYearById(ctp.getSchoolid());
149
-        //ctp.setYear(year);
144
+        Integer year = schoolMapper.getYearById(ctp.getSchoolid());
145
+        ctp.setYear(year);
150
         return classTeacherMapper.listTeahcersBySubjectGrade(ctp);
146
         return classTeacherMapper.listTeahcersBySubjectGrade(ctp);
151
     }
147
     }
152
 }
148
 }

+ 7
- 8
suser/src/main/java/com/xhkjedu/suser/service/gradeclass/GroupService.java View File

1
 package com.xhkjedu.suser.service.gradeclass;
1
 package com.xhkjedu.suser.service.gradeclass;
2
 
2
 
3
 import com.xhkjedu.suser.mapper.gradeclass.GroupMapper;
3
 import com.xhkjedu.suser.mapper.gradeclass.GroupMapper;
4
-//import com.xhkjedu.suser.mapper.gradeclass.SchoolMapper;
4
+import com.xhkjedu.suser.mapper.gradeclass.SchoolMapper;
5
 import com.xhkjedu.suser.model.gradeclass.TGroup;
5
 import com.xhkjedu.suser.model.gradeclass.TGroup;
6
-import com.xhkjedu.utils.N_Utils;
7
 import com.xhkjedu.suser.vo.gradeclass.ClassGroupVo;
6
 import com.xhkjedu.suser.vo.gradeclass.ClassGroupVo;
7
+import com.xhkjedu.utils.N_Utils;
8
 import org.springframework.stereotype.Service;
8
 import org.springframework.stereotype.Service;
9
 
9
 
10
 import javax.annotation.Resource;
10
 import javax.annotation.Resource;
13
 /**
13
 /**
14
  * @author ywx
14
  * @author ywx
15
  * @classname GroupService
15
  * @classname GroupService
16
- * @description 
16
+ * @description
17
  * @date 2020/6/2 17:26
17
  * @date 2020/6/2 17:26
18
  **/
18
  **/
19
 @Service
19
 @Service
22
     private GroupMapper groupMapper;
22
     private GroupMapper groupMapper;
23
     @Resource
23
     @Resource
24
     private GroupStudentService groupStudentService;
24
     private GroupStudentService groupStudentService;
25
-    //@Resource
26
-    //private SchoolMapper schoolMapper;
25
+    @Resource
26
+    private SchoolMapper schoolMapper;
27
 
27
 
28
     //添加
28
     //添加
29
     public Integer save(TGroup model) {
29
     public Integer save(TGroup model) {
30
         model.setGroupnum(0);
30
         model.setGroupnum(0);
31
         model.setCreatetime(N_Utils.getSecondTimestamp());
31
         model.setCreatetime(N_Utils.getSecondTimestamp());
32
         groupMapper.insertUseGeneratedKeys(model);
32
         groupMapper.insertUseGeneratedKeys(model);
33
-        if (N_Utils.isListNotEmpty(model.getStudents())){
33
+        if (N_Utils.isListNotEmpty(model.getStudents())) {
34
             model.setGroupid(model.getId());
34
             model.setGroupid(model.getId());
35
             groupStudentService.batchSave(model);//批量添加分组学生
35
             groupStudentService.batchSave(model);//批量添加分组学生
36
         }
36
         }
68
 
68
 
69
     //教师分组列表
69
     //教师分组列表
70
     public List<ClassGroupVo> teacherList(Integer teacherid) {
70
     public List<ClassGroupVo> teacherList(Integer teacherid) {
71
-        //Integer year = schoolMapper.getYearByUserId(teacherid);
72
-        Integer year=2022;
71
+        Integer year = schoolMapper.getYearByUserId(teacherid);
73
         return groupMapper.teacherList(teacherid, year);
72
         return groupMapper.teacherList(teacherid, year);
74
     }
73
     }
75
 }
74
 }

+ 49
- 49
suser/src/main/java/com/xhkjedu/suser/service/system/TeacherRoleService.java View File

1
 package com.xhkjedu.suser.service.system;
1
 package com.xhkjedu.suser.service.system;
2
 
2
 
3
 import com.xhkjedu.suser.mapper.gradeclass.ClassTeacherMapper;
3
 import com.xhkjedu.suser.mapper.gradeclass.ClassTeacherMapper;
4
-//import com.xhkjedu.suser.mapper.subjectbook.TeacherPowersbMapper;
5
-//import com.xhkjedu.suser.mapper.subjectbook.TeacherSubjectbookMapper;
4
+import com.xhkjedu.suser.mapper.gradeclass.SchoolMapper;
5
+import com.xhkjedu.suser.mapper.subjectbook.TeacherPowersbMapper;
6
+import com.xhkjedu.suser.mapper.subjectbook.TeacherSubjectbookMapper;
7
+import com.xhkjedu.suser.mapper.system.UserModuleMapper;
6
 import com.xhkjedu.suser.mapper.system.UserRoleMapper;
8
 import com.xhkjedu.suser.mapper.system.UserRoleMapper;
7
 import com.xhkjedu.suser.model.gradeclass.TClassTeacher;
9
 import com.xhkjedu.suser.model.gradeclass.TClassTeacher;
8
 import com.xhkjedu.suser.model.subjectbook.TTeacherPowersb;
10
 import com.xhkjedu.suser.model.subjectbook.TTeacherPowersb;
9
 import com.xhkjedu.suser.model.system.TUserRole;
11
 import com.xhkjedu.suser.model.system.TUserRole;
10
-import com.xhkjedu.suser.vo.system.TeacherRoleVo;
11
-import com.xhkjedu.utils.N_Utils;
12
 import com.xhkjedu.suser.vo.gradeclass.ClassVo;
12
 import com.xhkjedu.suser.vo.gradeclass.ClassVo;
13
 import com.xhkjedu.suser.vo.gradeclass.GradeVo;
13
 import com.xhkjedu.suser.vo.gradeclass.GradeVo;
14
-import com.xhkjedu.suser.vo.subjectbook.LsbBookVo;
15
-import com.xhkjedu.suser.vo.subjectbook.SubjectVo;
16
-import com.xhkjedu.suser.vo.subjectbook.TeacherSubjectbookVo;
17
 import com.xhkjedu.suser.vo.system.TeacherRoleParam;
14
 import com.xhkjedu.suser.vo.system.TeacherRoleParam;
15
+import com.xhkjedu.suser.vo.system.TeacherRoleVo;
18
 import com.xhkjedu.suser.vo.system.UserRoleVo;
16
 import com.xhkjedu.suser.vo.system.UserRoleVo;
17
+import com.xhkjedu.utils.N_Utils;
19
 import lombok.extern.slf4j.Slf4j;
18
 import lombok.extern.slf4j.Slf4j;
20
 import org.springframework.beans.factory.annotation.Autowired;
19
 import org.springframework.beans.factory.annotation.Autowired;
21
 import org.springframework.stereotype.Service;
20
 import org.springframework.stereotype.Service;
26
 import javax.annotation.Resource;
25
 import javax.annotation.Resource;
27
 import java.util.ArrayList;
26
 import java.util.ArrayList;
28
 import java.util.List;
27
 import java.util.List;
28
+import java.util.Map;
29
 
29
 
30
 /**
30
 /**
31
  * @ClassName TeacherRoleService
31
  * @ClassName TeacherRoleService
42
     @Autowired
42
     @Autowired
43
     private UserRoleMapper userRoleMapper;
43
     private UserRoleMapper userRoleMapper;
44
 
44
 
45
-    /*@Autowired
45
+    @Autowired
46
     private TeacherPowersbMapper teacherPowersbMapper;
46
     private TeacherPowersbMapper teacherPowersbMapper;
47
 
47
 
48
     @Resource
48
     @Resource
51
     @Autowired
51
     @Autowired
52
     private UserModuleMapper userModuleMapper;
52
     private UserModuleMapper userModuleMapper;
53
     @Resource
53
     @Resource
54
-    private SchoolMapper schoolMapper;*/
54
+    private SchoolMapper schoolMapper;
55
 
55
 
56
     /**
56
     /**
57
      *功能描述  保存教师设置权限
57
      *功能描述  保存教师设置权限
63
     @Transactional(rollbackFor = Exception.class)
63
     @Transactional(rollbackFor = Exception.class)
64
     public void save(TeacherRoleParam trole) throws Exception {
64
     public void save(TeacherRoleParam trole) throws Exception {
65
         try {
65
         try {
66
-            //Integer year = schoolMapper.getYearByUserId(trole.getTeacherid());
67
-            //trole.setYear(year);
66
+            Integer year = schoolMapper.getYearByUserId(trole.getTeacherid());
67
+            trole.setYear(year);
68
             int timestamp = N_Utils.getSecondTimestamp();
68
             int timestamp = N_Utils.getSecondTimestamp();
69
             //处理用户角色
69
             //处理用户角色
70
             // 先删除
70
             // 先删除
71
             userRoleMapper.deleteByUserid(trole.getTeacherid());
71
             userRoleMapper.deleteByUserid(trole.getTeacherid());
72
-            if(!CollectionUtils.isEmpty(trole.getRolelist())){
72
+            if (!CollectionUtils.isEmpty(trole.getRolelist())) {
73
                 List<TUserRole> rolelst = new ArrayList<>();
73
                 List<TUserRole> rolelst = new ArrayList<>();
74
-                for(Integer roleid : trole.getRolelist()){
74
+                for (Integer roleid : trole.getRolelist()) {
75
                     TUserRole ur = new TUserRole();
75
                     TUserRole ur = new TUserRole();
76
                     ur.setUserid(trole.getTeacherid());
76
                     ur.setUserid(trole.getTeacherid());
77
                     ur.setRoleid(roleid);
77
                     ur.setRoleid(roleid);
86
             }
86
             }
87
 
87
 
88
             //根据用户id删除没有权限的常用模块
88
             //根据用户id删除没有权限的常用模块
89
-            //userModuleMapper.deleteNoRoleByUserId(trole.getTeacherid());
90
-            //
91
-            ////处理用户教材
92
-            //List<String> lsbids = teacherSubjectbookMapper.listLsbsByUserid(trole.getTeacherid());
93
-            //List<String> lsbId = N_Utils.listNotInList3(lsbids, trole.getLsblist());
94
-            //if (N_Utils.isListNotEmpty(lsbId)){//删除教师收藏教材
95
-            //    teacherSubjectbookMapper.deleteByLsbIdTeacherId(lsbId, trole.getTeacherid());
96
-            //}
97
-            ////先删除
98
-            //teacherPowersbMapper.deleteByUserid(trole.getTeacherid());
99
-            if(!CollectionUtils.isEmpty(trole.getLsblist())){
89
+            userModuleMapper.deleteNoRoleByUserId(trole.getTeacherid());
90
+
91
+            //处理用户教材
92
+            List<String> lsbids = teacherSubjectbookMapper.listLsbsByUserid(trole.getTeacherid());
93
+            List<String> lsbId = N_Utils.listNotInList3(lsbids, trole.getLsblist());
94
+            if (N_Utils.isListNotEmpty(lsbId)) {//删除教师收藏教材
95
+                teacherSubjectbookMapper.deleteByLsbIdTeacherId(lsbId, trole.getTeacherid());
96
+            }
97
+            //先删除
98
+            teacherPowersbMapper.deleteByUserid(trole.getTeacherid());
99
+            if (!CollectionUtils.isEmpty(trole.getLsblist())) {
100
                 List<TTeacherPowersb> tpowerlist = new ArrayList<>();
100
                 List<TTeacherPowersb> tpowerlist = new ArrayList<>();
101
-                for(String lsbid : trole.getLsblist()){
101
+                for (String lsbid : trole.getLsblist()) {
102
                     TTeacherPowersb tp = new TTeacherPowersb();
102
                     TTeacherPowersb tp = new TTeacherPowersb();
103
                     tp.setTeacherid(trole.getTeacherid());
103
                     tp.setTeacherid(trole.getTeacherid());
104
                     tp.setLsbid(lsbid);
104
                     tp.setLsbid(lsbid);
109
                     tpowerlist.add(tp);
109
                     tpowerlist.add(tp);
110
                 }
110
                 }
111
 
111
 
112
-                //teacherPowersbMapper.insertList(tpowerlist);
112
+                teacherPowersbMapper.insertList(tpowerlist);
113
             }
113
             }
114
 
114
 
115
             //处理用户班级
115
             //处理用户班级
139
     }
139
     }
140
 
140
 
141
     //获取用户权限--角色、班级、教材 集合
141
     //获取用户权限--角色、班级、教材 集合
142
-    public TeacherRoleVo getTeacherRoles(TeacherRoleParam trparam){
143
-        //Integer year = schoolMapper.getYearByUserId(trparam.getTeacherid());
144
-        //trparam.setYear(year);
142
+    public TeacherRoleVo getTeacherRoles(TeacherRoleParam trparam) {
143
+        Integer year = schoolMapper.getYearByUserId(trparam.getTeacherid());
144
+        trparam.setYear(year);
145
         TeacherRoleVo trvo = new TeacherRoleVo();
145
         TeacherRoleVo trvo = new TeacherRoleVo();
146
         //获取已设置角色集合
146
         //获取已设置角色集合
147
         List<UserRoleVo> roleids = userRoleMapper.listRolesByUserid(trparam.getTeacherid());
147
         List<UserRoleVo> roleids = userRoleMapper.listRolesByUserid(trparam.getTeacherid());
148
-        List<ClassVo> classids = classTeacherMapper.listClassesByUserid(trparam.getTeacherid(),trparam.getYear(),trparam.getClasstype());
149
-        //List<TeacherSubjectbookVo> lsbids = teacherPowersbMapper.listLsbsByUserid(trparam.getTeacherid());
148
+        List<ClassVo> classids = classTeacherMapper.listClassesByUserid(trparam.getTeacherid(), trparam.getYear(), trparam.getClasstype());
149
+        List<Map> lsbids = teacherPowersbMapper.listLsbsByUserid(trparam.getTeacherid());
150
 
150
 
151
         trvo.setRolelist(roleids);
151
         trvo.setRolelist(roleids);
152
         trvo.setClasslist(classids);
152
         trvo.setClasslist(classids);
153
-        //trvo.setLsblist(lsbids);
153
+        trvo.setLsblist(lsbids);
154
 
154
 
155
         return trvo;
155
         return trvo;
156
     }
156
     }
165
     public TeacherRoleVo listBook(Integer teacherid) {
165
     public TeacherRoleVo listBook(Integer teacherid) {
166
         TeacherRoleVo trvo = new TeacherRoleVo();
166
         TeacherRoleVo trvo = new TeacherRoleVo();
167
         //获取已设置角色集合
167
         //获取已设置角色集合
168
-        //List<TeacherSubjectbookVo> lsbids = teacherPowersbMapper.listLsbsByUserid(teacherid);
169
-        //trvo.setLsblist(lsbids);
168
+        List<Map> lsbids = teacherPowersbMapper.listLsbsByUserid(teacherid);
169
+        trvo.setLsblist(lsbids);
170
         return trvo;
170
         return trvo;
171
     }
171
     }
172
 
172
 
173
     /**
173
     /**
174
      * 教师权限科目
174
      * 教师权限科目
175
+     *
176
+     * @return java.util.List<com.xhkjedu.suser.vo.subjectbook.SubjectVo>
175
      * @Param [teacherid]
177
      * @Param [teacherid]
176
      * @Author ywx
178
      * @Author ywx
177
      * @Date 2020/7/24 9:26
179
      * @Date 2020/7/24 9:26
178
-     * @return java.util.List<com.xhkjedu.suser.vo.subjectbook.SubjectVo>
179
      **/
180
      **/
180
-    public List<SubjectVo> listSubject(Integer teacherid) {
181
-        //return teacherPowersbMapper.listSubject(teacherid);
182
-        return null;
181
+    public List<Map> listSubject(Integer teacherid) {
182
+        return teacherPowersbMapper.listSubject(teacherid);
183
     }
183
     }
184
 
184
 
185
     /**
185
     /**
186
-     *功能描述 教师权限科目下,权限教材
187
-     * @author WN
188
-     * @date 2020/8/11
189
-     * @param  * @param teacherid
186
+     * 功能描述 教师权限科目下,权限教材
187
+     *
188
+     * @param *         @param teacherid
190
      * @param subjectid
189
      * @param subjectid
191
      * @return java.util.List<com.xhkjedu.suser.vo.subjectbook.LsbBookVo>
190
      * @return java.util.List<com.xhkjedu.suser.vo.subjectbook.LsbBookVo>
191
+     * @author WN
192
+     * @date 2020/8/11
192
      */
193
      */
193
-    public List<LsbBookVo> listBookBySubjectid(Integer teacherid,String subjectid){
194
-        //return teacherPowersbMapper.listBookBySubjectid(teacherid,subjectid);
195
-        return null;
194
+    public List<Map> listBookBySubjectid(Integer teacherid, String subjectid) {
195
+        return teacherPowersbMapper.listBookBySubjectid(teacherid, subjectid);
196
     }
196
     }
197
 
197
 
198
     /**
198
     /**
203
      * @return java.util.List<com.xhkjedu.suser.vo.gradeclass.ClassVo>
203
      * @return java.util.List<com.xhkjedu.suser.vo.gradeclass.ClassVo>
204
      **/
204
      **/
205
     public List<GradeVo> listGradeClassesByUserid(TeacherRoleParam role) {
205
     public List<GradeVo> listGradeClassesByUserid(TeacherRoleParam role) {
206
-        //Integer year = schoolMapper.getYearByUserId(role.getTeacherid());
207
-        //role.setYear(year);
206
+        Integer year = schoolMapper.getYearByUserId(role.getTeacherid());
207
+        role.setYear(year);
208
         return classTeacherMapper.listGradeClassesByUserid(role);
208
         return classTeacherMapper.listGradeClassesByUserid(role);
209
     }
209
     }
210
 
210
 
216
      * @return java.util.List<com.xhkjedu.suser.vo.gradeclass.GradeVo>
216
      * @return java.util.List<com.xhkjedu.suser.vo.gradeclass.GradeVo>
217
      **/
217
      **/
218
     public List<GradeVo> listGradeClassesByUserid2(TeacherRoleParam role) {
218
     public List<GradeVo> listGradeClassesByUserid2(TeacherRoleParam role) {
219
-        //Integer year = schoolMapper.getYearByUserId(role.getTeacherid());
220
-        //role.setYear(year);
219
+        Integer year = schoolMapper.getYearByUserId(role.getTeacherid());
220
+        role.setYear(year);
221
         return classTeacherMapper.listGradeClassesByUserid2(role);
221
         return classTeacherMapper.listGradeClassesByUserid2(role);
222
     }
222
     }
223
 }
223
 }

+ 44
- 78
suser/src/main/java/com/xhkjedu/suser/service/system/UserService.java View File

3
 import com.github.pagehelper.PageHelper;
3
 import com.github.pagehelper.PageHelper;
4
 import com.github.pagehelper.PageInfo;
4
 import com.github.pagehelper.PageInfo;
5
 import com.xhkjedu.suser.config.ConfigKey;
5
 import com.xhkjedu.suser.config.ConfigKey;
6
-//import com.xhkjedu.suser.mapper.gradeclass.SchoolMapper;
6
+import com.xhkjedu.suser.mapper.gradeclass.SchoolMapper;
7
+import com.xhkjedu.suser.mapper.system.MsgMapper;
8
+import com.xhkjedu.suser.mapper.system.UserLogMapper;
7
 import com.xhkjedu.suser.mapper.system.UserMapper;
9
 import com.xhkjedu.suser.mapper.system.UserMapper;
8
-import com.xhkjedu.vo.PageResult;
9
 import com.xhkjedu.suser.model.system.TMsg;
10
 import com.xhkjedu.suser.model.system.TMsg;
10
 import com.xhkjedu.suser.model.system.TUser;
11
 import com.xhkjedu.suser.model.system.TUser;
11
 import com.xhkjedu.suser.model.system.TUserLog;
12
 import com.xhkjedu.suser.model.system.TUserLog;
12
-import com.xhkjedu.utils.DESUtils;
13
-import com.xhkjedu.utils.DatesUtil;
14
 import com.xhkjedu.suser.utils.JedisUtil;
13
 import com.xhkjedu.suser.utils.JedisUtil;
15
-import com.xhkjedu.utils.MD5;
16
-import com.xhkjedu.utils.N_Utils;
17
-import com.xhkjedu.utils.PageUtil;
18
 import com.xhkjedu.suser.utils.PoiUtils;
14
 import com.xhkjedu.suser.utils.PoiUtils;
19
 import com.xhkjedu.suser.utils.SMSSender;
15
 import com.xhkjedu.suser.utils.SMSSender;
20
-import com.xhkjedu.vo.ResultVo;
21
 import com.xhkjedu.suser.vo.assess.AssessParams;
16
 import com.xhkjedu.suser.vo.assess.AssessParams;
22
 import com.xhkjedu.suser.vo.system.TeacherVo;
17
 import com.xhkjedu.suser.vo.system.TeacherVo;
23
 import com.xhkjedu.suser.vo.system.UserVo;
18
 import com.xhkjedu.suser.vo.system.UserVo;
24
 import com.xhkjedu.suser.vo.system.ZtMsgVo;
19
 import com.xhkjedu.suser.vo.system.ZtMsgVo;
20
+import com.xhkjedu.utils.DESUtils;
21
+import com.xhkjedu.utils.DatesUtil;
22
+import com.xhkjedu.utils.MD5;
23
+import com.xhkjedu.utils.N_Utils;
24
+import com.xhkjedu.utils.PageUtil;
25
+import com.xhkjedu.vo.PageResult;
26
+import com.xhkjedu.vo.ResultVo;
25
 import lombok.extern.slf4j.Slf4j;
27
 import lombok.extern.slf4j.Slf4j;
26
 import org.springframework.beans.factory.annotation.Autowired;
28
 import org.springframework.beans.factory.annotation.Autowired;
27
 import org.springframework.stereotype.Service;
29
 import org.springframework.stereotype.Service;
30
 
32
 
31
 import javax.annotation.Resource;
33
 import javax.annotation.Resource;
32
 import javax.servlet.http.HttpServletRequest;
34
 import javax.servlet.http.HttpServletRequest;
33
-import java.net.UnknownHostException;
34
 import java.util.ArrayList;
35
 import java.util.ArrayList;
35
 import java.util.HashMap;
36
 import java.util.HashMap;
36
 import java.util.List;
37
 import java.util.List;
49
 
50
 
50
     @Autowired
51
     @Autowired
51
     private UserMapper userMapper;
52
     private UserMapper userMapper;
52
-    /*@Autowired
53
-    private UserLogService userLogService;
53
+    @Autowired
54
+    private UserLogMapper userLogMapper;
54
     @Resource
55
     @Resource
55
-    private MsgService msgService;
56
+    private MsgMapper msgMapper;
56
     @Resource
57
     @Resource
57
-    private SchoolMapper schoolMapper;*/
58
+    private SchoolMapper schoolMapper;
58
 
59
 
59
     /**
60
     /**
60
      *功能描述  根据登录名和密码获取用户信息
61
      *功能描述  根据登录名和密码获取用户信息
70
         UserVo userVo = userMapper.getUserByLoginname(user.getLoginname());
71
         UserVo userVo = userMapper.getUserByLoginname(user.getLoginname());
71
 
72
 
72
         if(userVo!=null && userVo.getUserid()>0){
73
         if(userVo!=null && userVo.getUserid()>0){
73
-            //String schooldomain = userVo.getSchooldomain();
74
-            //if (checkDomain(request, schooldomain, userVo.getSchoolid())) return new ResultVo(1, "该账号不存在");
75
             user.setUserid(userVo.getUserid());
74
             user.setUserid(userVo.getUserid());
76
             user.setUsername(userVo.getUsername());
75
             user.setUsername(userVo.getUsername());
77
             user.setSchoolid(userVo.getSchoolid());
76
             user.setSchoolid(userVo.getSchoolid());
99
         return getLogResultVo(user, resultVo, loginpwd, request);
98
         return getLogResultVo(user, resultVo, loginpwd, request);
100
     }
99
     }
101
 
100
 
102
-    //校验域名
103
-    private boolean checkDomain(HttpServletRequest request, String schooldomain, Integer schoolid) {
104
-        String clientlogin = request.getHeader("clientlogin");//有值不校验
105
-        if (N_Utils.isNotEmpty(clientlogin)) return false;
106
-        //origin:pc端获取到的是file://、android和手机端获取的为空、开发环境获取的是localhost
107
-        String url = request.getHeader("origin");
108
-        if (N_Utils.isEmpty(schooldomain) || N_Utils.isEmpty(url)
109
-                || url.equals("file://") || url.contains("localhost")) {
110
-            return false;
111
-        }
112
-        String domain = url.replace("https://", "").replace("http://", "");
113
-        //Integer sid = schoolMapper.getSchoolIdByDomain(domain, schoolid);
114
-        //if (!schoolid.equals(sid)) {
115
-        //    return true;
116
-        //}
117
-        return false;
118
-    }
119
-
120
     //教师登录
101
     //教师登录
121
     public ResultVo loginTeacher(TUser user,HttpServletRequest request){
102
     public ResultVo loginTeacher(TUser user,HttpServletRequest request){
122
         ResultVo resultVo = null;
103
         ResultVo resultVo = null;
125
         UserVo userVo = userMapper.getUserByLoginname(user.getLoginname());
106
         UserVo userVo = userMapper.getUserByLoginname(user.getLoginname());
126
 
107
 
127
         if(userVo!=null && userVo.getUserid()>0) {
108
         if(userVo!=null && userVo.getUserid()>0) {
128
-            //String schooldomain = userVo.getSchooldomain();
129
-            //if (checkDomain(request, schooldomain, userVo.getSchoolid())) return new ResultVo(1, "该账号不存在");
130
             user.setUserid(userVo.getUserid());
109
             user.setUserid(userVo.getUserid());
131
             user.setUsername(userVo.getUsername());
110
             user.setUsername(userVo.getUsername());
132
             user.setSchoolid(userVo.getSchoolid());
111
             user.setSchoolid(userVo.getSchoolid());
167
         UserVo userVo = userMapper.getUserByLoginnameMac(user.getLoginname(),mac);
146
         UserVo userVo = userMapper.getUserByLoginnameMac(user.getLoginname(),mac);
168
 
147
 
169
         if(userVo!=null && userVo.getUserid()>0) {
148
         if(userVo!=null && userVo.getUserid()>0) {
170
-            //String schooldomain = userVo.getSchooldomain();
171
-            //if (checkDomain(request, schooldomain, userVo.getSchoolid())) return new ResultVo(1, "该账号不存在");
172
             Integer sbindmac = userVo.getSbindmac();
149
             Integer sbindmac = userVo.getSbindmac();
173
             user.setUserid(userVo.getUserid());
150
             user.setUserid(userVo.getUserid());
174
             user.setUsername(userVo.getUsername());
151
             user.setUsername(userVo.getUsername());
258
             userLog.setUltype(user.getUltype());
235
             userLog.setUltype(user.getUltype());
259
             userLog.setVersionnum(user.getVersionnum());
236
             userLog.setVersionnum(user.getVersionnum());
260
             userLog.setLogtime(N_Utils.getSecondTimestamp());
237
             userLog.setLogtime(N_Utils.getSecondTimestamp());
261
-            userMapper.saveUserLog(userLog);
238
+            userLogMapper.insertSelective(userLog);
262
         } catch (Exception e) {
239
         } catch (Exception e) {
263
             log.error("添加登录日志失败:" + e.getMessage());
240
             log.error("添加登录日志失败:" + e.getMessage());
264
             result = new ResultVo(1, "保存失败");
241
             result = new ResultVo(1, "保存失败");
275
      **/
252
      **/
276
     public ResultVo save(TUser user) {
253
     public ResultVo save(TUser user) {
277
         Integer schoolid = user.getSchoolid();
254
         Integer schoolid = user.getSchoolid();
278
-        /*Integer usernum = schoolMapper.getUserNumById(schoolid);
255
+        Integer usernum = schoolMapper.getUserNumById(schoolid);
279
         if (usernum != null) {
256
         if (usernum != null) {
280
             Integer usernum2 = userMapper.getUserNumBySchoolId(schoolid);
257
             Integer usernum2 = userMapper.getUserNumBySchoolId(schoolid);
281
             usernum2 = usernum2 + 1;//学校账号数量+本次添加的人
258
             usernum2 = usernum2 + 1;//学校账号数量+本次添加的人
282
             if (usernum.compareTo(usernum2) == -1) {
259
             if (usernum.compareTo(usernum2) == -1) {
283
                 return new ResultVo(1,"账号数量已超限,请联系管理员");
260
                 return new ResultVo(1,"账号数量已超限,请联系管理员");
284
             }
261
             }
285
-        }*/
262
+        }
286
         user.setUserstate(1);
263
         user.setUserstate(1);
287
         user.setCreatetime(N_Utils.getSecondTimestamp());
264
         user.setCreatetime(N_Utils.getSecondTimestamp());
288
         setLoginPwd(user);
265
         setLoginPwd(user);
289
-//        userMapper.insertSelective(user);
290
         userMapper.insertUseGeneratedKeys(user);
266
         userMapper.insertUseGeneratedKeys(user);
291
         return new ResultVo(0, "保存成功",user.getId());
267
         return new ResultVo(0, "保存成功",user.getId());
292
     }
268
     }
409
         }
385
         }
410
     }
386
     }
411
 
387
 
412
-    public Integer getNumByLoginName(String loginname) {
413
-        Integer num = userMapper.checkLoginName(loginname);
414
-        return num;
415
-    }
416
-
417
     /**
388
     /**
418
      * 根据登录账号获取用户详情
389
      * 根据登录账号获取用户详情
419
      * @Param [loginname]
390
      * @Param [loginname]
434
      **/
405
      **/
435
     public void batchSave(List<TUser> users) throws Exception {
406
     public void batchSave(List<TUser> users) throws Exception {
436
         Integer schoolid = users.get(0).getSchoolid();
407
         Integer schoolid = users.get(0).getSchoolid();
437
-        //Integer usernum = schoolMapper.getUserNumById(schoolid);
438
-        //if (usernum != null) {
439
-        //    Integer usernum2 = userMapper.getUserNumBySchoolId(schoolid);
440
-        //    usernum2 = usernum2 + users.size();//学校账号数量+本次添加的人
441
-        //    if (usernum.compareTo(usernum2) == -1) {
442
-        //        throw new Exception("账号数量已超限,请联系管理员");
443
-        //    }
444
-        //}
408
+        Integer usernum = schoolMapper.getUserNumById(schoolid);
409
+        if (usernum != null) {
410
+            Integer usernum2 = userMapper.getUserNumBySchoolId(schoolid);
411
+            usernum2 = usernum2 + users.size();//学校账号数量+本次添加的人
412
+            if (usernum.compareTo(usernum2) == -1) {
413
+                throw new Exception("账号数量已超限,请联系管理员");
414
+            }
415
+        }
445
         userMapper.insertList(users);
416
         userMapper.insertList(users);
446
     }
417
     }
447
 
418
 
471
             Map<String,Object> map = PoiUtils.readExcelUser(file, 1);
442
             Map<String,Object> map = PoiUtils.readExcelUser(file, 1);
472
             List<TUser> teachers = (List<TUser>)map.get("users");
443
             List<TUser> teachers = (List<TUser>)map.get("users");
473
             map.remove("users");//导入成功的教师信息不返回给前端
444
             map.remove("users");//导入成功的教师信息不返回给前端
474
-            /*if (!CollectionUtils.isEmpty((List<TUser>)map.get("excelExisted"))) {
475
-                map.put("code",1);
476
-                return new ResultVo(0, "导入失败", map);
477
-            }*/
478
 
445
 
479
             List<TUser> users = new ArrayList<>();
446
             List<TUser> users = new ArrayList<>();
480
             // 以下教师信息已存在
447
             // 以下教师信息已存在
603
      * @return boolean
570
      * @return boolean
604
      **/
571
      **/
605
     private boolean generateCode(String userphone, String templateCode) {
572
     private boolean generateCode(String userphone, String templateCode) {
606
-        //Integer msgNum = msgService.getMsgNumByUserPhone(userphone);//5分钟内发送短信次数
607
-        //if (msgNum != 0) return true;
573
+        Integer msgNum = msgMapper.getMsgNumByUserPhone(userphone);//5分钟内发送短信次数
574
+        if (msgNum != 0) return true;
608
 
575
 
609
         Integer messageCode = N_Utils.messageCode();
576
         Integer messageCode = N_Utils.messageCode();
610
         String msgtxt = "";
577
         String msgtxt = "";
611
-        if ("yhzc".equals(templateCode)){//用户注册验证码
612
-            msgtxt += "验证码"+messageCode+",您正在注册成为新用户,感谢您的支持!";
613
-        } else if ("xgmm".equals(templateCode)){//修改密码验证码
614
-            msgtxt += "验证码"+messageCode+",您正在尝试修改登录密码,请妥善保管账户信息。";
615
-        } else if ("dlqr".equals(templateCode)){//登录确认验证码
616
-            msgtxt += "验证码"+messageCode+",您正在登录,若非本人操作,请勿泄露。";
578
+        if ("yhzc".equals(templateCode)) {//用户注册验证码
579
+            msgtxt += "验证码" + messageCode + ",您正在注册成为新用户,感谢您的支持!";
580
+        } else if ("xgmm".equals(templateCode)) {//修改密码验证码
581
+            msgtxt += "验证码" + messageCode + ",您正在尝试修改登录密码,请妥善保管账户信息。";
582
+        } else if ("dlqr".equals(templateCode)) {//登录确认验证码
583
+            msgtxt += "验证码" + messageCode + ",您正在登录,若非本人操作,请勿泄露。";
617
         }
584
         }
618
         ZtMsgVo m = new ZtMsgVo();
585
         ZtMsgVo m = new ZtMsgVo();
619
         m.setMobile(userphone);
586
         m.setMobile(userphone);
620
         m.setContent(msgtxt);
587
         m.setContent(msgtxt);
621
         SMSSender.sendSms(m);
588
         SMSSender.sendSms(m);
622
-//        SendSmsUtil.sendMsg(userphone, templateCode, messageCode);
623
 
589
 
624
         //添加短信信息
590
         //添加短信信息
625
-        //TMsg msg = new TMsg();
626
-        //msg.setUserphone(userphone);
627
-        //msg.setMsgcode(messageCode);
628
-        //msg.setMsgtxt(msgtxt);
629
-        //msgService.save(msg);
591
+        TMsg msg = new TMsg();
592
+        msg.setUserphone(userphone);
593
+        msg.setMsgcode(messageCode);
594
+        msg.setMsgtxt(msgtxt);
595
+        msg.setCreatetime(N_Utils.getSecondTimestamp());
596
+        msgMapper.insertSelective(msg);
630
         return false;
597
         return false;
631
     }
598
     }
632
 
599
 
653
      * @return com.xhkjedu.model.baseinfo.ResultVo
620
      * @return com.xhkjedu.model.baseinfo.ResultVo
654
      **/
621
      **/
655
     private ResultVo getCodeResultVo(String userphone, Integer messageCode) {
622
     private ResultVo getCodeResultVo(String userphone, Integer messageCode) {
656
-        //TMsg msg = msgService.findByUserPhoneAndCode(userphone,messageCode);//根据手机号和验证码获取短信信息
657
-        //if (msg == null) return new ResultVo(1,"验证码有误");
658
-        //int secondTimestamp = N_Utils.getSecondTimestamp() - 300;//验证码有效时间为5分钟
659
-        //if (msg.getCreatetime()<secondTimestamp) return new ResultVo(1,"验证码失效");
623
+        TMsg msg = msgMapper.findByUserPhoneAndCode(userphone, messageCode);//根据手机号和验证码获取短信信息
624
+        if (msg == null) return new ResultVo(1, "验证码有误");
625
+        int secondTimestamp = N_Utils.getSecondTimestamp() - 300;//验证码有效时间为5分钟
626
+        if (msg.getCreatetime() < secondTimestamp) return new ResultVo(1, "验证码失效");
660
         return null;
627
         return null;
661
     }
628
     }
662
 
629
 
743
 
710
 
744
     //用户选择列表
711
     //用户选择列表
745
     public List<Map> listForSel(AssessParams user) {
712
     public List<Map> listForSel(AssessParams user) {
746
-        //Integer year = schoolMapper.getYearById(user.getSchoolid());
747
-        Integer year=2021;
713
+        Integer year = schoolMapper.getYearById(user.getSchoolid());
748
         return userMapper.listForSel(user, year);
714
         return userMapper.listForSel(user, year);
749
     }
715
     }
750
 
716
 

+ 0
- 26
suser/src/main/java/com/xhkjedu/suser/vo/subjectbook/LsbBookVo.java View File

1
-package com.xhkjedu.suser.vo.subjectbook;
2
-
3
-import lombok.Data;
4
-
5
-/**
6
- * @ClassName LsbBookVo
7
- * Description 教材--册别
8
- * Author WN
9
- * Date 2020/6/3 10:17
10
- **/
11
-@Data
12
-public class LsbBookVo {
13
-
14
-    //教材id
15
-    private String lsbid;
16
-
17
-    //教材名称
18
-    private String lsbname;
19
-
20
-    //版本id
21
-    private String versionid;
22
-
23
-    //版本名称
24
-    private String versionname;
25
-
26
-}

+ 0
- 22
suser/src/main/java/com/xhkjedu/suser/vo/subjectbook/SubjectVo.java View File

1
-package com.xhkjedu.suser.vo.subjectbook;
2
-
3
-import lombok.Data;
4
-
5
-/**
6
- * @ClassName SubjectVo
7
- * Description
8
- * Author WN
9
- * Date 2020/6/1 17:58
10
- **/
11
-@Data
12
-public class SubjectVo {
13
-    //科目id
14
-    private String subjectid;
15
-
16
-    //科目名称
17
-    private String subjectname;
18
-
19
-    //归属1平台3学校
20
-    private Integer belong;
21
-
22
-}

+ 0
- 40
suser/src/main/java/com/xhkjedu/suser/vo/subjectbook/TeacherSubjectbookVo.java View File

1
-package com.xhkjedu.suser.vo.subjectbook;
2
-
3
-import lombok.Data;
4
-
5
-/**
6
- * @author ywx
7
- * @classname TeacherSubjectbookVo
8
- * @description 
9
- * @date 2020/6/5 15:52
10
- **/
11
-@Data
12
-public class TeacherSubjectbookVo {
13
-
14
-    //教师教材关系id
15
-    private Integer tbid;
16
-
17
-    //教材关联关系表id
18
-    private String lsbid;
19
-
20
-    //是否选中:0未选中1已选中
21
-    private Integer selected;
22
-
23
-    //科目id
24
-    private String subjectid;
25
-
26
-    //科目名称
27
-    private String subjectname;
28
-
29
-    //教材名称
30
-    private String lsbname;
31
-
32
-    private String coverpath;//封面图地址
33
-
34
-    //版本id
35
-    private String versionid;
36
-
37
-    //版本名称
38
-    private String versionname;
39
-
40
-}

+ 2
- 2
suser/src/main/java/com/xhkjedu/suser/vo/system/TeacherRoleVo.java View File

1
 package com.xhkjedu.suser.vo.system;
1
 package com.xhkjedu.suser.vo.system;
2
 
2
 
3
 import com.xhkjedu.suser.vo.gradeclass.ClassVo;
3
 import com.xhkjedu.suser.vo.gradeclass.ClassVo;
4
-import com.xhkjedu.suser.vo.subjectbook.TeacherSubjectbookVo;
5
 import lombok.Data;
4
 import lombok.Data;
6
 
5
 
7
 import java.util.ArrayList;
6
 import java.util.ArrayList;
8
 import java.util.List;
7
 import java.util.List;
8
+import java.util.Map;
9
 
9
 
10
 /**
10
 /**
11
  * @ClassName TeacherRoleVo
11
  * @ClassName TeacherRoleVo
19
     private List<UserRoleVo> rolelist = new ArrayList<>();
19
     private List<UserRoleVo> rolelist = new ArrayList<>();
20
 
20
 
21
     //教材
21
     //教材
22
-    private List<TeacherSubjectbookVo> lsblist = new ArrayList<>();
22
+    private List<Map> lsblist = new ArrayList<>();
23
 
23
 
24
     //班级
24
     //班级
25
     private List<ClassVo> classlist = new ArrayList<>();
25
     private List<ClassVo> classlist = new ArrayList<>();

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

35
         set c.classnum=a.num,g.groupnum=(SELECT COUNT(*) FROM t_group_student gs WHERE gs.groupid=g.groupid)
35
         set c.classnum=a.num,g.groupnum=(SELECT COUNT(*) FROM t_group_student gs WHERE gs.groupid=g.groupid)
36
         where c.classid=#{classid}
36
         where c.classid=#{classid}
37
     </update>
37
     </update>
38
-    <!--要升级的班级列表-->
39
-    <select id="listClassBySchoolId" resultType="com.xhkjedu.suser.model.gradeclass.TClass">
40
-        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)
41
-    </select>
42
-    <!--升级时要毕业的班级列表-->
43
-    <select id="listClassBiyeBySchoolId" resultType="com.xhkjedu.suser.model.gradeclass.TClass">
44
-        select * from t_class where schoolid=#{schoolid} and year=#{year} and classtype in(1,2) and classstate=#{classstate} and gradeid in(6,9,12)
45
-    </select>
46
-    <!--要升级的班级id字符串-->
47
-    <select id="listClassIdBySchoolId" resultType="java.lang.String">
48
-        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)
49
-    </select>
50
     <!--基本信息-->
38
     <!--基本信息-->
51
     <select id="getById" resultType="com.xhkjedu.suser.vo.gradeclass.ClassVo">
39
     <select id="getById" resultType="com.xhkjedu.suser.vo.gradeclass.ClassVo">
52
         select c.classid,c.classname,c.gradeid,c.classnum,tg.groupid,c.classtype,c.createid,c.schoolid,c.year
40
         select c.classid,c.classname,c.gradeid,c.classnum,tg.groupid,c.classtype,c.createid,c.schoolid,c.year
54
         where c.classid=#{classid} and tg.grouptype=1 limit 1
42
         where c.classid=#{classid} and tg.grouptype=1 limit 1
55
     </select>
43
     </select>
56
 
44
 
57
-    <!--获取年级下行政班班级id集合-->
58
-    <select id="listClassidsByGradeid" resultType="java.lang.Integer">
59
-        select c.classid from t_class c
60
-        LEFT JOIN t_school s on c.schoolid=s.schoolid and c.year=s.year
61
-        where c.gradeid=#{gradeid} and c.schoolid=#{schoolid} and c.classtype=1 and c.classstate=1
62
-    </select>
63
     <!--根据班级名称获取班级信息-->
45
     <!--根据班级名称获取班级信息-->
64
     <select id="getByName" resultType="com.xhkjedu.suser.model.gradeclass.TClass">
46
     <select id="getByName" resultType="com.xhkjedu.suser.model.gradeclass.TClass">
65
         select c.classid, c.classname, c.gradeid, c.classnum, c.classstate, c.classorder, c.schoolyear, c.year, c.classtype
47
         select c.classid, c.classname, c.gradeid, c.classnum, c.classstate, c.classorder, c.schoolyear, c.year, c.classtype
73
         where ct.classid=#{classid} and u.userstate=1
55
         where ct.classid=#{classid} and u.userstate=1
74
     </select>
56
     </select>
75
 
57
 
76
-    <!--修改班级状态-->
77
-    <update id="updateClassState">
78
-       update t_class set classstate=#{classstate} where classid in (${classids})
79
-    </update>
80
     <!--修改单个班级状态-->
58
     <!--修改单个班级状态-->
81
     <update id="updateClassstateByClassid">
59
     <update id="updateClassstateByClassid">
82
        update t_class set classstate=#{classstate} where classid=#{classid}
60
        update t_class set classstate=#{classstate} where classid=#{classid}
83
     </update>
61
     </update>
84
-
85
-    <!--修改班级类型-->
86
-    <update id="updateClasstype">
87
-        update t_class set classtype=#{classtype} where classid=#{classid}
88
-    </update>
89
-    <!--获取班级当前年份-->
90
-    <select id="getYearById" resultType="java.lang.Integer">
91
-        select year from t_class where classid=#{classid}
92
-    </select>
93
-    <!--根据班级名称获取班级id-->
94
-    <select id="getClassIdByName" resultType="java.lang.Integer">
95
-        select c.classid from t_class c where c.schoolid=#{schoolid} and c.gradeid=#{gradeid} and c.classtype=1 and
96
-        c.classstate=1 and c.classname=#{classname} and c.year=#{year}
97
-    </select>
98
 </mapper>
62
 </mapper>

+ 0
- 25
suser/src/main/resources/mapper/gradeclass/ClassStudentMapper.xml View File

45
         from t_class_student cs left join t_class c on cs.classid=c.classid
45
         from t_class_student cs left join t_class c on cs.classid=c.classid
46
         where cs.studentid=#{studentid} and c.classtype=1 and c.classstate=1 limit 1
46
         where cs.studentid=#{studentid} and c.classtype=1 and c.classstate=1 limit 1
47
     </select>
47
     </select>
48
-    <!--获取要升级的学生列表-->
49
-    <select id="listStudentByClassIds" resultType="com.xhkjedu.suser.model.gradeclass.TClassStudent">
50
-        select * from t_class_student where classid in(${classIds}) order by classid;
51
-    </select>
52
     <!--根据班级id和学生id获取班级学生信息-->
48
     <!--根据班级id和学生id获取班级学生信息-->
53
     <select id="getByClassIdStudentId" resultType="com.xhkjedu.suser.model.gradeclass.TClassStudent">
49
     <select id="getByClassIdStudentId" resultType="com.xhkjedu.suser.model.gradeclass.TClassStudent">
54
         select * from t_class_student where classid=#{classid} and studentid=#{studentid} limit 1
50
         select * from t_class_student where classid=#{classid} and studentid=#{studentid} limit 1
117
         insert ignore into t_class_student (classid,studentid,createid,createtime,schoolid)
113
         insert ignore into t_class_student (classid,studentid,createid,createtime,schoolid)
118
         values (#{student.classid},#{student.studentid},#{student.createid},#{student.createtime},#{student.schoolid})
114
         values (#{student.classid},#{student.studentid},#{student.createid},#{student.createtime},#{student.schoolid})
119
     </insert>
115
     </insert>
120
-    <!--学生所在行政班-->
121
-    <select id="getClassByStuId" resultType="com.xhkjedu.suser.vo.gradeclass.ClassVo">
122
-        select c.gradeid,c.classname from t_class_student cs left join t_class c on cs.classid=c.classid
123
-        left join t_school s on c.schoolid=s.schoolid
124
-        where cs.studentid=#{studentid} and c.year=s.year and c.classtype=1 and c.classstate=1 limit 1
125
-    </select>
126
-    <!--学生列表-->
127
-    <select id="listStu" resultType="com.xhkjedu.suser.vo.paper.AStudentPaperVo">
128
-        select cs.studentid,u.username studentname,u.loginname,c.gradeid,c.classname
129
-        from t_class_student cs left join t_class c on cs.classid=c.classid
130
-        left join t_user u on cs.studentid=u.userid
131
-        where c.schoolid=#{paper.schoolid} and c.gradeid=#{paper.gradeid} and c.year=#{paper.year}
132
-        and c.classtype=1 and u.userstate=1
133
-        <if test="paper.classid!=0">
134
-            and cs.classid=#{paper.classid}
135
-        </if>
136
-        <if test="paper.classids!=null and paper.classids!=''">
137
-            and cs.classid in (${paper.classids})
138
-        </if>
139
-        group by cs.studentid
140
-    </select>
141
     <!--获取学生所有提高班-->
116
     <!--获取学生所有提高班-->
142
     <select id="listTgClassid" resultType="java.lang.Integer">
117
     <select id="listTgClassid" resultType="java.lang.Integer">
143
         SELECT c.classid FROM t_class_student cs LEFT JOIN t_class c ON cs.classid=c.classid
118
         SELECT c.classid FROM t_class_student cs LEFT JOIN t_class c ON cs.classid=c.classid

+ 0
- 16
suser/src/main/resources/mapper/gradeclass/ClassTeacherMapper.xml View File

48
         and c.classtype in(1,2)
48
         and c.classtype in(1,2)
49
         order by c.gradeid,c.classtype,c.classorder
49
         order by c.gradeid,c.classtype,c.classorder
50
     </select>
50
     </select>
51
-    <!--要升级的教师列表-->
52
-    <select id="listTeacherByClassIds" resultType="com.xhkjedu.suser.model.gradeclass.TClassTeacher">
53
-        select * from t_class_teacher where classid in(${classIds}) order by classid;
54
-    </select>
55
     <!--前年份教师任教分组学生-->
51
     <!--前年份教师任教分组学生-->
56
     <resultMap id="teacherClass" type="java.util.Map">
52
     <resultMap id="teacherClass" type="java.util.Map">
57
         <result property="classid" column="classid"></result>
53
         <result property="classid" column="classid"></result>
157
         and c.classtype in(1,2)
153
         and c.classtype in(1,2)
158
         order by c.gradeid,c.classtype,c.classorder
154
         order by c.gradeid,c.classtype,c.classorder
159
     </select>
155
     </select>
160
-    <!--获取教师任教行政和提高班id-->
161
-    <select id="getClassIds" resultType="java.lang.String">
162
-        select group_concat(distinct c.classid)
163
-        from t_class_teacher ct left join  t_class c on ct.classid=c.classid
164
-        left join t_school s on ct.schoolid=s.schoolid
165
-        where ct.teacherid=#{teacherid} and c.year=s.year and c.classstate=1
166
-        and c.classtype in(1,2)
167
-    </select>
168
 
156
 
169
     <!--获取学校年级下教师-->
157
     <!--获取学校年级下教师-->
170
     <select id="listTeachersByGradeid" resultType="com.xhkjedu.suser.vo.gradeclass.ClassTeacherVo">
158
     <select id="listTeachersByGradeid" resultType="com.xhkjedu.suser.vo.gradeclass.ClassTeacherVo">
186
     and sb.subjectid=#{ctp.subjectid} and u.usertype=1 and u.userstate=1
174
     and sb.subjectid=#{ctp.subjectid} and u.usertype=1 and u.userstate=1
187
     group by ct.teacherid
175
     group by ct.teacherid
188
     </select>
176
     </select>
189
-    <!--删除班级下所有教师-->
190
-    <delete id="deleteByClassId">
191
-        delete from t_class_teacher where classid=#{classid}
192
-    </delete>
193
 
177
 
194
 
178
 
195
 
179
 

+ 0
- 8
suser/src/main/resources/mapper/gradeclass/GroupMapper.xml View File

51
         order by c.gradeid,c.classtype,c.classorder,g.grouptype asc, g.groupid desc
51
         order by c.gradeid,c.classtype,c.classorder,g.grouptype asc, g.groupid desc
52
     </select>
52
     </select>
53
 
53
 
54
-    <!--分组以及分组下所有学生id-->
55
-    <select id="listStudentidsByGroupids" resultType="java.lang.Integer">
56
-        SELECT DISTINCT studentid FROM t_group_student  WHERE groupid IN (${groupids})
57
-    </select>
58
     <!--获取班级的全体分组-->
54
     <!--获取班级的全体分组-->
59
     <select id="findByClassId" resultType="com.xhkjedu.suser.model.gradeclass.TGroup">
55
     <select id="findByClassId" resultType="com.xhkjedu.suser.model.gradeclass.TGroup">
60
         select g.* from t_group g where g.classid=#{classid} and g.grouptype=1
56
         select g.* from t_group g where g.classid=#{classid} and g.grouptype=1
61
     </select>
57
     </select>
62
-    <!--要升级的全体分组列表-->
63
-    <select id="listStudentByClassIds" resultType="com.xhkjedu.suser.model.gradeclass.TGroup">
64
-        select g.* from t_group g where g.classid in(${classIds}) and g.grouptype=1 order by classid
65
-    </select>
66
 </mapper>
58
 </mapper>

+ 0
- 4
suser/src/main/resources/mapper/gradeclass/GroupStudentMapper.xml View File

8
         where gs.groupid=#{groupid}
8
         where gs.groupid=#{groupid}
9
         order by convert(tu.username using gbk)
9
         order by convert(tu.username using gbk)
10
     </select>
10
     </select>
11
-    <!--获取要升级的学生列表-->
12
-    <select id="listStudentByGroupIds" resultType="com.xhkjedu.suser.model.gradeclass.TGroupStudent">
13
-        select * from t_group_student where groupid in(${groupIds}) order by groupid;
14
-    </select>
15
     <!--删除分组学生-->
11
     <!--删除分组学生-->
16
     <delete id="deleteByGroupId">
12
     <delete id="deleteByGroupId">
17
         delete from t_group_student where groupid=#{groupid}
13
         delete from t_group_student where groupid=#{groupid}

+ 4
- 0
suser/src/main/resources/mapper/gradeclass/SchoolMapper.xml View File

10
         select s.year from t_user u left join t_school s on u.schoolid=s.schoolid
10
         select s.year from t_user u left join t_school s on u.schoolid=s.schoolid
11
         where u.userid=#{userid}
11
         where u.userid=#{userid}
12
     </select>
12
     </select>
13
+    <!--获取学校账号数量-->
14
+    <select id="getUserNumById" resultType="java.lang.Integer">
15
+        select usernum from t_school where schoolid=#{schoolid}
16
+    </select>
13
 </mapper>
17
 </mapper>

+ 16
- 0
suser/src/main/resources/mapper/liveplay/CourseMapper.xml View File

1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.xhkjedu.suser.mapper.liveplay.CourseMapper">
4
+    <!--更新已报学生数量-->
5
+    <update id="updateStuNum">
6
+        update l_course c set c.stunum=(select tc.classnum from t_class tc where tc.classid=c.classid)
7
+        where c.courseid=#{courseid}
8
+    </update>
9
+    <!--行政班的所有直播课-->
10
+    <select id="listXzCourse" resultType="java.util.Map">
11
+        select c.courseid,c.classid,c.createid,c.schoolid
12
+        from l_course c left join l_course_class cc on cc.courseid=c.courseid
13
+        where c.coursetype=1 and cc.classid=#{classid}
14
+        group by c.courseid
15
+    </select>
16
+</mapper>

+ 33
- 0
suser/src/main/resources/mapper/subjectbook/TeacherPowersbMapper.xml View File

1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.xhkjedu.suser.mapper.subjectbook.TeacherPowersbMapper">
4
+    <!-- 根据用户id删除用户教材 -->
5
+    <delete id="deleteByUserid">
6
+        delete from t_teacher_powersb where teacherid=#{userid}
7
+    </delete>
8
+    <!-- 用户id获取教材集合 -->
9
+    <select id="listLsbsByUserid" resultType="java.util.Map">
10
+        SELECT tsb.lsbid,sb.subjectid,s.subjectname,sb.lsbname,sb.coverpath,sb.versionid,v.versionname
11
+        FROM t_teacher_powersb tsb LEFT JOIN t_subject_book sb ON tsb.lsbid=sb.lsbid
12
+        LEFT JOIN t_subject s ON sb.subjectid=s.subjectid
13
+        LEFT JOIN t_version v ON sb.versionid=v.versionid
14
+        WHERE tsb.teacherid=#{userid} and (sb.belong=1 or sb.schoolid=tsb.schoolid)
15
+        ORDER BY s.subjectorder,v.versionorder,sb.lsborder
16
+    </select>
17
+    <!--教师权限科目-->
18
+    <select id="listSubject" resultType="java.util.Map">
19
+        SELECT sb.subjectid,s.subjectname,s.level
20
+        FROM t_teacher_powersb tsb LEFT JOIN t_subject_book sb ON tsb.lsbid=sb.lsbid
21
+        LEFT JOIN t_subject s ON sb.subjectid=s.subjectid
22
+        WHERE tsb.teacherid=#{teacherid} and (sb.belong=1 or sb.schoolid=tsb.schoolid)
23
+        GROUP BY s.subjectid ORDER BY s.subjectorder
24
+    </select>
25
+
26
+    <select id="listBookBySubjectid" resultType="java.util.Map">
27
+        SELECT tsb.lsbid,sb.lsbname,sb.versionid,v.versionname
28
+         FROM t_teacher_powersb tsb LEFT JOIN t_subject_book sb ON tsb.lsbid=sb.lsbid
29
+         LEFT JOIN t_version v ON sb.versionid=v.versionid
30
+         WHERE tsb.teacherid=#{teacherid} AND sb.subjectid=#{subjectid} and (sb.belong=1 or sb.schoolid=tsb.schoolid)
31
+         GROUP BY sb.lsbid ORDER BY v.versionorder,sb.lsborder
32
+    </select>
33
+</mapper>

+ 17
- 0
suser/src/main/resources/mapper/subjectbook/TeacherSubjectBookMapper.xml View File

1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.xhkjedu.suser.mapper.subjectbook.TeacherSubjectbookMapper">
4
+    <!-- 用户id获取教材集合 -->
5
+    <select id="listLsbsByUserid" resultType="java.lang.String">
6
+        SELECT lsbid FROM t_teacher_subjectbook WHERE teacherid=#{userid}
7
+    </select>
8
+    <!--删除教师收藏教材-->
9
+    <delete id="deleteByLsbIdTeacherId">
10
+        delete from t_teacher_subjectbook
11
+        where teacherid=#{teacherid} and (
12
+        <foreach collection="lsbids" item="lsbid" separator="or">
13
+            lsbid=#{lsbid}
14
+        </foreach>
15
+        )
16
+    </delete>
17
+</mapper>

+ 13
- 0
suser/src/main/resources/mapper/system/MsgMapper.xml View File

1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.xhkjedu.suser.mapper.system.MsgMapper">
4
+    <!-- 5分钟内发送短信次数 -->
5
+    <select id="getMsgNumByUserPhone" resultType="java.lang.Integer">
6
+        select count(*) from t_msg where userphone=#{userphone} and createtime>=UNIX_TIMESTAMP(now())-300
7
+    </select>
8
+    <!--根据手机号和验证码获取短信信息-->
9
+    <select id="findByUserPhoneAndCode" resultType="com.xhkjedu.suser.model.system.TMsg">
10
+        select msgid,msgtxt,msgcode,userphone,createtime
11
+        from t_msg where userphone=#{userphone} and msgcode=#{msgcode} limit 1
12
+    </select>
13
+</mapper>

+ 2
- 43
suser/src/main/resources/mapper/system/UserMapper.xml View File

70
     <select id="getObjByLoginName" resultType="com.xhkjedu.suser.model.system.TUser">
70
     <select id="getObjByLoginName" resultType="com.xhkjedu.suser.model.system.TUser">
71
         select u.* from t_user u where u.loginname=#{loginname} limit 1
71
         select u.* from t_user u where u.loginname=#{loginname} limit 1
72
     </select>
72
     </select>
73
-    <!--根据登录名获取学生id和行政和提高班班级id-->
74
-    <select id="getObjByLoginName2" resultType="com.xhkjedu.suser.model.system.TUser">
75
-        select u.userid,u.usertype,u.userstate,u.schoolid,group_concat(distinct c.classid) ultype
76
-        from t_user u left join t_class_student cs on u.userid=cs.studentid
77
-        left join t_class c on cs.classid=c.classid and c.classtype in(1,2) and c.classstate=1
78
-        where u.loginname=#{loginname} limit 1
79
-    </select>
80
     <!--修改用户状态-->
73
     <!--修改用户状态-->
81
     <update id="updateState">
74
     <update id="updateState">
82
         update t_user set userstate=#{userstate} where userid=#{userid}
75
         update t_user set userstate=#{userstate} where userid=#{userid}
135
     <update id="updateBindMac">
128
     <update id="updateBindMac">
136
         update t_user set bindmac=#{user.bindmac},mac=#{user.mac} where userid=#{user.userid}
129
         update t_user set bindmac=#{user.bindmac},mac=#{user.mac} where userid=#{user.userid}
137
     </update>
130
     </update>
138
-    <!--删除学生绑定信息-->
139
-    <update id="delBindmac">
140
-        update t_user set bindmac=0,mac=null where schoolid=#{schoolid}
141
-    </update>
142
     <!--通过短信修改密码-->
131
     <!--通过短信修改密码-->
143
     <update id="updatePwdByCode">
132
     <update id="updatePwdByCode">
144
         update t_user set loginpwd=#{user.loginpwd} where userphone=#{user.userphone}
133
         update t_user set loginpwd=#{user.loginpwd} where userphone=#{user.userphone}
153
         )
142
         )
154
     </update>
143
     </update>
155
 
144
 
156
-    <!--根据用户id获取用户姓名-->
157
-    <select id="getUserNameById" resultType="java.lang.String">
158
-        select username from t_user where userid=#{userid}
159
-    </select>
160
-
161
-    <!--批量修改用户状态-->
162
-    <update id="batchUpdateState">
163
-        update t_user set userstate=#{userstate} where
164
-        <foreach collection="users" item="user" index="index" separator="or">
165
-            userid=${user.studentid}
166
-        </foreach>
167
-    </update>
168
-
169
-    <!--获取学校管理员-->
170
-    <select id="getSchoolAdminBySchoolid" resultType="com.xhkjedu.suser.vo.system.UserVo">
171
-        select userid,username,loginname,loginpwd from t_user where schoolid=#{schoolid}
172
-        and usertype=0 and userstate=1 order by userid limit 1
173
-    </select>
174
-
175
     <!--获取学校账号数量-->
145
     <!--获取学校账号数量-->
176
     <select id="getUserNumBySchoolId" resultType="java.lang.Integer">
146
     <select id="getUserNumBySchoolId" resultType="java.lang.Integer">
177
         select count(*) from t_user where schoolid=#{schoolid} and userstate=1
147
         select count(*) from t_user where schoolid=#{schoolid} and userstate=1
192
         group by u.userid
162
         group by u.userid
193
         order by convert(u.username using gbk)
163
         order by convert(u.username using gbk)
194
     </select>
164
     </select>
195
-    <!--根据班级id用户名获取学生id和数量-->
196
-    <select id="getUserIdByName" resultType="java.util.Map">
197
-        select u.userid,count(distinct u.userid)num
198
-        from t_user u left join t_class_student cs on u.userid=cs.studentid
199
-        where u.schoolid=#{schoolid} and u.userstate=1 and u.username=#{username} and cs.classid=#{classid}
200
-    </select>
165
+
166
+
201
     <!--根据班级科目id用户名获取教师id和数量-->
167
     <!--根据班级科目id用户名获取教师id和数量-->
202
     <select id="getUserIdByName2" resultType="java.util.Map">
168
     <select id="getUserIdByName2" resultType="java.util.Map">
203
         select u.userid,count(distinct u.userid)num
169
         select u.userid,count(distinct u.userid)num
212
     <select id="getUsertypeById" resultType="java.lang.Integer">
178
     <select id="getUsertypeById" resultType="java.lang.Integer">
213
         select usertype from t_user where userid=#{userid}
179
         select usertype from t_user where userid=#{userid}
214
     </select>
180
     </select>
215
-    <!--添加登录日志-->
216
-    <insert id="saveUserLog">
217
-        INSERT INTO t_user_log (userid, username, loginname, loginstate, logtime
218
-        , logip, logaddress, ultype, versionnum, logtxt, schoolid) VALUES
219
-        (#{log.userid},#{log.username},#{log.loginname},#{log.loginstate},#{log.logtime}
220
-        ,#{log.logip},#{log.logaddress},#{log.ultype},#{log.versionnum},#{log.logtxt},#{log.schoolid});
221
-    </insert>
222
 </mapper>
181
 </mapper>

+ 11
- 0
suser/src/main/resources/mapper/system/UserModuleMapper.xml View File

1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.xhkjedu.suser.mapper.system.UserModuleMapper">
4
+    <!--根据用户id删除没有权限的常用模块-->
5
+    <delete id="deleteNoRoleByUserId">
6
+        DELETE FROM t_user_module WHERE userid=#{userid} AND moduleid
7
+        NOT IN(SELECT rm.moduleid FROM t_user u LEFT JOIN t_user_role ur ON u.userid=ur.userid
8
+        LEFT JOIN t_role_module rm ON ur.roleid=rm.roleid
9
+        WHERE u.userid=#{userid} GROUP BY rm.moduleid)
10
+    </delete>
11
+</mapper>

Loading…
Cancel
Save