Browse Source

学生帮-教师权限下班级

tags/正式版本
王宁 2 years ago
parent
commit
8aa17898f6

+ 0
- 3
sexam/src/main/java/com/xhkjedu/sexam/controller/report/EReportClassController.java View File

@@ -5,7 +5,6 @@ import com.github.pagehelper.PageInfo;
5 5
 import com.xhkjedu.sexam.model.reportstu.ERstudent;
6 6
 import com.xhkjedu.sexam.model.reportstu.ERstudentAction;
7 7
 import com.xhkjedu.sexam.service.report.EReportClassService;
8
-import com.xhkjedu.sexam.service.system.UserService;
9 8
 import com.xhkjedu.sexam.vo.report.ERankParamVo;
10 9
 import com.xhkjedu.sexam.vo.report.ReportParamsVo;
11 10
 import com.xhkjedu.utils.N_Utils;
@@ -33,8 +32,6 @@ import java.util.Map;
33 32
 public class EReportClassController {
34 33
     @Resource
35 34
     private EReportClassService eReportClassService;
36
-    @Resource
37
-    private UserService userService;
38 35
 
39 36
     /**
40 37
      * 考试概况--科目

+ 8
- 0
sexam/src/main/java/com/xhkjedu/sexam/controller/report/EReportStudentController.java View File

@@ -150,4 +150,12 @@ public class EReportStudentController {
150 150
     }
151 151
 
152 152
 
153
+    //获取考试基础--班级教师权限下班级
154
+    @PostMapping("/examt")
155
+    public ResultVo getExamSubjectClassForTeacher(@RequestBody ReportParamsVo params) {
156
+        Integer examid = params.getExamid();
157
+        N_Utils.validation(new Object[]{examid, "考试id", 1,params.getUserid(),"用户id",1});
158
+        Map map = eReportStudentService.getExamSubjectClassForTeacher(examid,params.getUserid());
159
+        return new ResultVo(0, "获取成功", map);
160
+    }
153 161
 }

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/exam/EClassMapper.java View File

@@ -39,6 +39,9 @@ public interface EClassMapper extends TkMapper<EClass> {
39 39
     //参加考试的班级和学生
40 40
     List<Map> listExamClassAndStu(@Param("examid") Integer examid);
41 41
 
42
+    //教师权限下参加考试班级和学生
43
+    List<Map> listExamClassAndStuForTeacher(@Param("examid") Integer examid,@Param("teacherid") Integer teacherid);
44
+
42 45
     //班级选择列表
43 46
     List<Map> listBj(@Param("schoolid") Integer schoolid, @Param("teacherid") Integer teacherid);
44 47
 }

+ 0
- 3
sexam/src/main/java/com/xhkjedu/sexam/mapper/system/UserMapper.java View File

@@ -27,7 +27,4 @@ public interface UserMapper {
27 27
 
28 28
     //根据用户ids查找用户姓名
29 29
     List<UserVo> listNameByUserIds(@Param("userids") List<Integer> userids);
30
-
31
-    //更加用户id获取用户类型
32
-    Map getUsertypeById(@Param("userid") Integer userid);
33 30
 }

+ 9
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportStudentService.java View File

@@ -61,6 +61,15 @@ public class EReportStudentService {
61 61
         return map;
62 62
     }
63 63
 
64
+    public Map getExamSubjectClassForTeacher(Integer examid,Integer userid) {
65
+        Map map = eBaseMapper.findById(examid);
66
+        List<Map> subjects = eSubjectMapper.listSubjectAndPnum(examid);
67
+        map.put("subjects", subjects);
68
+        List<Map> classes = eClassMapper.listExamClassAndStuForTeacher(examid,userid);
69
+        map.put("classes", classes);
70
+        return map;
71
+    }
72
+
64 73
     /**
65 74
      * @Description 报告概况--获取学生各科成绩单
66 75
      * @Param [examid]

+ 0
- 29
sexam/src/main/java/com/xhkjedu/sexam/service/system/UserService.java View File

@@ -1,29 +0,0 @@
1
-package com.xhkjedu.sexam.service.system;
2
-
3
-import com.xhkjedu.sexam.mapper.system.UserMapper;
4
-import org.springframework.stereotype.Service;
5
-
6
-import javax.annotation.Resource;
7
-import java.util.Map;
8
-
9
-/**
10
- * @Description
11
- * @Author WN
12
- * Date 2022/9/22 10:32
13
- **/
14
-@Service
15
-public class UserService {
16
-    @Resource
17
-    private UserMapper userMapper;
18
-
19
-    /**
20
-     * @Description 更加用户id获取用户类型
21
-     * @Param [userid]
22
-     * @Return java.lang.Integer
23
-     * @Author wn
24
-     * @Date 2022/9/22 10:33
25
-     **/
26
-    public Map getUsertypeById(Integer userid){
27
-        return userMapper.getUsertypeById(userid);
28
-    }
29
-}

+ 8
- 0
sexam/src/main/resources/mapper/exam/EClassMapper.xml View File

@@ -78,6 +78,14 @@
78 78
         left join t_user u on ps.studentid=u.userid
79 79
         where c.examid=#{examid} group by ps.studentid order by c.classid, ps.studentid
80 80
     </select>
81
+    <!--考试关联教师权限下班级学生-->
82
+    <select id="listExamClassAndStuForTeacher" resultMap="listExamClassStus">
83
+        select c.classid,c.classname,c.classnum,ps.studentid,u.username studentname,ps.sstate
84
+        from e_class c left join e_paper_student ps on c.examid=ps.examid and c.classid=ps.classid
85
+        left join t_user u on ps.studentid=u.userid
86
+        left join t_class_teacher ct on c.classid=ct.classid
87
+        where c.examid=#{examid} and ct.teacherid=#{teacherid} group by ps.studentid order by c.classid, ps.studentid
88
+    </select>
81 89
     <!--班级选择列表-->
82 90
     <select id="listBj" resultType="java.util.Map">
83 91
         select c.gradeid,c.classid,c.classname,c.classtype

+ 0
- 5
sexam/src/main/resources/mapper/system/UserMapper.xml View File

@@ -53,9 +53,4 @@
53 53
             ${userid}
54 54
         </foreach>
55 55
     </select>
56
-
57
-    <!--更加用户id获取用户usertype-->
58
-    <select id="getUsertypeById" resultType="java.util.Map">
59
-        select usertype,schoolid from t_user where userid=#{userid}
60
-    </select>
61 56
 </mapper>

Loading…
Cancel
Save