Browse Source

教师权限年级下班级

班级任教老师及科目
tags/正式3.3.0
王宁 2 years ago
parent
commit
43c7986099

+ 2
- 1
suser/src/main/java/com/xhkjedu/suser/controller/gradeclass/ClassController.java View File

2
 
2
 
3
 import com.xhkjedu.suser.model.gradeclass.TClass;
3
 import com.xhkjedu.suser.model.gradeclass.TClass;
4
 import com.xhkjedu.suser.service.gradeclass.ClassService;
4
 import com.xhkjedu.suser.service.gradeclass.ClassService;
5
+import com.xhkjedu.suser.vo.gradeclass.ClassTeacherSubjectVo;
5
 import com.xhkjedu.utils.N_Utils;
6
 import com.xhkjedu.utils.N_Utils;
6
 import com.xhkjedu.vo.ResultVo;
7
 import com.xhkjedu.vo.ResultVo;
7
 import com.xhkjedu.suser.vo.gradeclass.ClassVo;
8
 import com.xhkjedu.suser.vo.gradeclass.ClassVo;
71
     public ResultVo listTeacher(@RequestBody TClass tClass) {
72
     public ResultVo listTeacher(@RequestBody TClass tClass) {
72
         Integer classid = tClass.getClassid();
73
         Integer classid = tClass.getClassid();
73
         N_Utils.validation(new Object[]{classid, "班级id", 1});
74
         N_Utils.validation(new Object[]{classid, "班级id", 1});
74
-        List<String> list = classService.listTeacher(classid);
75
+        List<ClassTeacherSubjectVo> list = classService.listTeacher(classid);
75
         return new ResultVo(0, "获取任教老师列表成功", list);
76
         return new ResultVo(0, "获取任教老师列表成功", list);
76
     }
77
     }
77
 
78
 

+ 15
- 0
suser/src/main/java/com/xhkjedu/suser/controller/system/TeacherRoleController.java View File

126
         return new ResultVo(0,"获取教师权限班级列表成功",list);
126
         return new ResultVo(0,"获取教师权限班级列表成功",list);
127
     }
127
     }
128
 
128
 
129
+    /**
130
+     * @Description 获取教师权限年级下所有班级
131
+     * @Param [trole]
132
+     * @Return com.xhkjedu.vo.ResultVo
133
+     * @Author wn
134
+     * @Date 2022/6/28 9:33
135
+     **/
136
+    @PostMapping("/list_allclass")
137
+    public ResultVo listRoleGradeAllClass(@RequestBody TeacherRoleParam trole){
138
+        Integer teacherid = trole.getTeacherid();
139
+        N_Utils.validation(new Object[]{teacherid,"教师id",1});
140
+        List<GradeVo> list = teacherRoleService.listRoleGradeAllClass(trole);
141
+        return new ResultVo(0,"获取教师权限年级下班级列表成功",list);
142
+    }
143
+
129
 }
144
 }

+ 2
- 1
suser/src/main/java/com/xhkjedu/suser/mapper/gradeclass/ClassMapper.java View File

2
 
2
 
3
 import com.xhkjedu.suser.base.TkMapper;
3
 import com.xhkjedu.suser.base.TkMapper;
4
 import com.xhkjedu.suser.model.gradeclass.TClass;
4
 import com.xhkjedu.suser.model.gradeclass.TClass;
5
+import com.xhkjedu.suser.vo.gradeclass.ClassTeacherSubjectVo;
5
 import com.xhkjedu.suser.vo.gradeclass.ClassVo;
6
 import com.xhkjedu.suser.vo.gradeclass.ClassVo;
6
 import org.apache.ibatis.annotations.Param;
7
 import org.apache.ibatis.annotations.Param;
7
 
8
 
27
     TClass getByName(@Param("tClass") TClass tClass);
28
     TClass getByName(@Param("tClass") TClass tClass);
28
 
29
 
29
     //获取任教老师列表
30
     //获取任教老师列表
30
-    List<String> listTeacher(@Param("classid") Integer classid);
31
+    List<ClassTeacherSubjectVo> listTeacher(@Param("classid") Integer classid);
31
 
32
 
32
     //修改单个班级状态
33
     //修改单个班级状态
33
     Integer updateClassstateByClassid(@Param("classid") Integer classid, @Param("classstate") Integer classstate);
34
     Integer updateClassstateByClassid(@Param("classid") Integer classid, @Param("classstate") Integer classstate);

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

87
      * @date 2022/5/5 11:29
87
      * @date 2022/5/5 11:29
88
      */
88
      */
89
     List<Map> listTeahcersBySubjectGrade2(@Param("ctp") ClassTeacherParams ctp);
89
     List<Map> listTeahcersBySubjectGrade2(@Param("ctp") ClassTeacherParams ctp);
90
+
91
+    /**
92
+     * @Description 获取教师权限年级下所有班级
93
+     * @Param [role]
94
+     * @Return java.util.List<com.xhkjedu.suser.vo.gradeclass.GradeVo>
95
+     * @Author wn
96
+     * @Date 2022/6/28 9:32
97
+     **/
98
+    List<GradeVo> listRoleGradeAllClass(@Param("role")TeacherRoleParam role);
90
 }
99
 }

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

1
 package com.xhkjedu.suser.mapper.gradeclass;
1
 package com.xhkjedu.suser.mapper.gradeclass;
2
 
2
 
3
+import com.xhkjedu.suser.model.gradeclass.TSchool;
4
+import org.springframework.stereotype.Repository;
5
+
6
+@Repository
3
 public interface SchoolMapper {
7
 public interface SchoolMapper {
4
     //获取学校当前年份
8
     //获取学校当前年份
5
     Integer getYearById(Integer schoolid);
9
     Integer getYearById(Integer schoolid);
9
 
13
 
10
     //获取学校账号数量
14
     //获取学校账号数量
11
     Integer getUserNumById(Integer schoolid);
15
     Integer getUserNumById(Integer schoolid);
16
+
17
+    //更加用户id获取当前学校id和年份
18
+    TSchool getSchoolInfoByUserid(Integer userid);
12
 }
19
 }

+ 2
- 1
suser/src/main/java/com/xhkjedu/suser/service/gradeclass/ClassService.java View File

4
 import com.xhkjedu.suser.mapper.gradeclass.SchoolMapper;
4
 import com.xhkjedu.suser.mapper.gradeclass.SchoolMapper;
5
 import com.xhkjedu.suser.model.gradeclass.TClass;
5
 import com.xhkjedu.suser.model.gradeclass.TClass;
6
 import com.xhkjedu.suser.model.gradeclass.TGroup;
6
 import com.xhkjedu.suser.model.gradeclass.TGroup;
7
+import com.xhkjedu.suser.vo.gradeclass.ClassTeacherSubjectVo;
7
 import com.xhkjedu.suser.vo.gradeclass.ClassVo;
8
 import com.xhkjedu.suser.vo.gradeclass.ClassVo;
8
 import com.xhkjedu.utils.N_Utils;
9
 import com.xhkjedu.utils.N_Utils;
9
 import com.xhkjedu.vo.ResultVo;
10
 import com.xhkjedu.vo.ResultVo;
70
     }
71
     }
71
 
72
 
72
     //获取任教老师列表
73
     //获取任教老师列表
73
-    public List<String> listTeacher(Integer classid) {
74
+    public List<ClassTeacherSubjectVo> listTeacher(Integer classid) {
74
         return classMapper.listTeacher(classid);
75
         return classMapper.listTeacher(classid);
75
     }
76
     }
76
 
77
 

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

7
 import com.xhkjedu.suser.mapper.system.UserModuleMapper;
7
 import com.xhkjedu.suser.mapper.system.UserModuleMapper;
8
 import com.xhkjedu.suser.mapper.system.UserRoleMapper;
8
 import com.xhkjedu.suser.mapper.system.UserRoleMapper;
9
 import com.xhkjedu.suser.model.gradeclass.TClassTeacher;
9
 import com.xhkjedu.suser.model.gradeclass.TClassTeacher;
10
+import com.xhkjedu.suser.model.gradeclass.TSchool;
10
 import com.xhkjedu.suser.model.subjectbook.TTeacherPowersb;
11
 import com.xhkjedu.suser.model.subjectbook.TTeacherPowersb;
11
 import com.xhkjedu.suser.model.system.TUserRole;
12
 import com.xhkjedu.suser.model.system.TUserRole;
12
 import com.xhkjedu.suser.vo.gradeclass.ClassVo;
13
 import com.xhkjedu.suser.vo.gradeclass.ClassVo;
50
 
51
 
51
     @Autowired
52
     @Autowired
52
     private UserModuleMapper userModuleMapper;
53
     private UserModuleMapper userModuleMapper;
53
-    @Resource
54
+    @Autowired
54
     private SchoolMapper schoolMapper;
55
     private SchoolMapper schoolMapper;
55
 
56
 
56
     /**
57
     /**
220
         role.setYear(year);
221
         role.setYear(year);
221
         return classTeacherMapper.listGradeClassesByUserid2(role);
222
         return classTeacherMapper.listGradeClassesByUserid2(role);
222
     }
223
     }
224
+
225
+    /**
226
+     * @Description 获取教师权限年级下所有班级
227
+     * @Param [trole]
228
+     * @Return java.util.List<com.xhkjedu.suser.vo.gradeclass.GradeVo>
229
+     * @Author wn
230
+     * @Date 2022/6/28 9:32
231
+     **/
232
+    public List<GradeVo> listRoleGradeAllClass(TeacherRoleParam trole) {
233
+        TSchool school = schoolMapper.getSchoolInfoByUserid(trole.getTeacherid());
234
+        trole.setYear(school.getYear());
235
+        trole.setSchoolid(school.getSchoolid());
236
+        return classTeacherMapper.listRoleGradeAllClass(trole);
237
+    }
223
 }
238
 }

+ 16
- 0
suser/src/main/java/com/xhkjedu/suser/vo/gradeclass/ClassTeacherSubjectVo.java View File

1
+package com.xhkjedu.suser.vo.gradeclass;
2
+
3
+import lombok.Data;
4
+
5
+/**
6
+ * @Description 班级任教教师及教师科目
7
+ * @Author WN
8
+ * Date 2022/6/28 10:31
9
+ **/
10
+@Data
11
+public class ClassTeacherSubjectVo {
12
+
13
+    private String teachername;
14
+
15
+    private String subjectname;
16
+}

+ 1
- 1
suser/src/main/resources/application.properties View File

57
 #郑州管城大数据SSO认证鉴权接口
57
 #郑州管城大数据SSO认证鉴权接口
58
 ssourl=http://gcdsj.zzgcjy.cn/portal/sso/api/agent
58
 ssourl=http://gcdsj.zzgcjy.cn/portal/sso/api/agent
59
 #版本号
59
 #版本号
60
-versionname=Test_v3.2.11
60
+versionname=Test_v3.2.12

+ 6
- 3
suser/src/main/resources/mapper/gradeclass/ClassMapper.xml View File

57
         and c.year=#{tClass.year} and c.gradeid=#{tClass.gradeid} and c.classstate=1 and c.classtype=#{tClass.classtype} limit 1
57
         and c.year=#{tClass.year} and c.gradeid=#{tClass.gradeid} and c.classstate=1 and c.classtype=#{tClass.classtype} limit 1
58
     </select>
58
     </select>
59
     <!--获取任教老师列表-->
59
     <!--获取任教老师列表-->
60
-    <select id="listTeacher" resultType="java.lang.String">
61
-        select u.username from t_class_teacher ct left join t_user u on ct.teacherid=u.userid
62
-        where ct.classid=#{classid} and u.userstate=1
60
+    <select id="listTeacher" resultType="com.xhkjedu.suser.vo.gradeclass.ClassTeacherSubjectVo">
61
+        select u.username as teachername,s.subjectname from t_class_teacher ct left join t_user u on ct.teacherid=u.userid
62
+        left join t_teacher_powersb tp on ct.teacherid=tp.teacherid
63
+        left join t_subject_book sb on tp.lsbid=sb.lsbid
64
+        left join t_subject s on sb.subjectid=s.subjectid
65
+        where ct.classid=#{classid} and u.userstate=1 group by u.userid order by u.userid
63
     </select>
66
     </select>
64
 
67
 
65
     <!--修改单个班级状态-->
68
     <!--修改单个班级状态-->

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

210
         </if>
210
         </if>
211
         group by ct.teacherid
211
         group by ct.teacherid
212
     </select>
212
     </select>
213
+
214
+    <!--获取教师权限年级下所有班级-->
215
+    <select id="listRoleGradeAllClass" resultMap="gradeClass">
216
+        select c.gradeid,c.classid,c.classname,c.classnum,c.classtype
217
+             ,(case c.gradeid when 1 then '一年级' when 2 then '二年级' when 3 then '三年级' when 4 then '四年级'
218
+                              when 5 then '五年级' when 6 then '六年级' when 7 then '七年级' when 8 then '八年级' when 9 then '九年级'
219
+                              when 10 then '高一' when 11 then '高二' when 12 then '高三' else '' end)gradename
220
+        from t_class c where c.schoolid=#{role.schoolid} and c.year=#{role.year} and c.classstate=1 and c.classtype in (1,2)
221
+        and c.gradeid=(
222
+        select c2.gradeid from t_class c2 left join t_class_teacher ct on c2.classid=ct.classid
223
+        where ct.teacherid=#{role.teacherid} and c2.year=#{role.year} and c2.classstate=1 and c2.classtype=1 limit 1)
224
+        order by c.classtype,c.classorder
225
+    </select>
213
 </mapper>
226
 </mapper>

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

14
     <select id="getUserNumById" resultType="java.lang.Integer">
14
     <select id="getUserNumById" resultType="java.lang.Integer">
15
         select usernum from t_school where schoolid=#{schoolid}
15
         select usernum from t_school where schoolid=#{schoolid}
16
     </select>
16
     </select>
17
+
18
+    <!--更加用户id获取当前学校id和年份-->
19
+    <select id="getSchoolInfoByUserid" resultType="com.xhkjedu.suser.model.gradeclass.TSchool">
20
+        select s.schoolid,s.year from t_user u left join t_school s on u.schoolid=s.schoolid
21
+        where u.userid=#{userid}
22
+    </select>
17
 </mapper>
23
 </mapper>

+ 1
- 0
suser/src/test/java/com/xhkjedu/suser/SuserApplicationTests.java View File

8
 
8
 
9
     @Test
9
     @Test
10
     void contextLoads() {
10
     void contextLoads() {
11
+
11
     }
12
     }
12
 
13
 
13
 }
14
 }

Loading…
Cancel
Save