Browse Source

试试监控相关

试卷文件获取
ywx
王宁 2 months ago
parent
commit
363506e515
18 changed files with 347 additions and 87 deletions
  1. 81
    25
      smarking/src/main/java/com/xhkjedu/smarking/controller/exam/MsSubjectBadstudentController.java
  2. 15
    0
      smarking/src/main/java/com/xhkjedu/smarking/controller/paper/MsPaperQtypeController.java
  3. 1
    1
      smarking/src/main/java/com/xhkjedu/smarking/mapper/exam/MsClassMapper.java
  4. 14
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/exam/MsSubjectBadstudentMapper.java
  5. 3
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/exam/MsSubjectInvigilateMapper.java
  6. 3
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/exam/MsSubjectMapper.java
  7. 4
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/paper/MsPaperFileMapper.java
  8. 4
    2
      smarking/src/main/java/com/xhkjedu/smarking/model/exam/MsSubjectBadstudent.java
  9. 8
    0
      smarking/src/main/java/com/xhkjedu/smarking/model/exam/MsSubjectInvigilate.java
  10. 127
    13
      smarking/src/main/java/com/xhkjedu/smarking/service/exam/MsSubjectBadstudentService.java
  11. 5
    5
      smarking/src/main/java/com/xhkjedu/smarking/service/exam/MsSubjectInvigilateService.java
  12. 0
    41
      smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsPaperFileService.java
  13. 11
    0
      smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsPaperQtypeService.java
  14. 1
    0
      smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsPaperService.java
  15. 51
    0
      smarking/src/main/resources/mapper/exam/MsSubjectBadstudentMapper.xml
  16. 6
    0
      smarking/src/main/resources/mapper/exam/MsSubjectInvigilateMapper.xml
  17. 8
    0
      smarking/src/main/resources/mapper/exam/MsSubjectMapper.xml
  18. 5
    0
      smarking/src/main/resources/mapper/paper/MsPaperFileMapper.xml

+ 81
- 25
smarking/src/main/java/com/xhkjedu/smarking/controller/exam/MsSubjectBadstudentController.java View File

@@ -3,15 +3,20 @@ package com.xhkjedu.smarking.controller.exam;
3 3
 import com.github.pagehelper.PageHelper;
4 4
 import com.github.pagehelper.PageInfo;
5 5
 import com.xhkjedu.smarking.model.exam.MsSubjectBadstudent;
6
+import com.xhkjedu.smarking.model.exam.MsSubjectInvigilate;
6 7
 import com.xhkjedu.smarking.service.exam.MsSubjectBadstudentService;
7 8
 import com.xhkjedu.utils.N_Utils;
8 9
 import com.xhkjedu.utils.PageUtil;
9 10
 import com.xhkjedu.vo.PageResult;
10 11
 import com.xhkjedu.vo.ResultVo;
11
-import org.springframework.web.bind.annotation.*;
12
+import org.springframework.web.bind.annotation.PostMapping;
13
+import org.springframework.web.bind.annotation.RequestBody;
14
+import org.springframework.web.bind.annotation.RequestMapping;
15
+import org.springframework.web.bind.annotation.RestController;
12 16
 
13 17
 import javax.annotation.Resource;
14 18
 import java.util.List;
19
+import java.util.Map;
15 20
 
16 21
 /**
17 22
  * @Description 阅卷科目违规学生表相关操作
@@ -19,39 +24,90 @@ import java.util.List;
19 24
  * @Date 2024-10-15
20 25
  */
21 26
 @RestController
22
-@RequestMapping("/msSubjectBadstudent")
27
+@RequestMapping("/msbad")
23 28
 public class MsSubjectBadstudentController {
24 29
     @Resource
25 30
     private MsSubjectBadstudentService msSubjectBadstudentService;
26 31
 
27
-    /**
28
-     * @Description 新增
29
-     * @Param [msSubjectBadstudent]
30
-     * @Author auto
31
-     * @Date 2024-10-15
32
-     * @return com.xhkjedu.vo.ResultVo
32
+    /*
33
+     * @Description 学生-保存违规记录
34
+     * @Date 2024/11/13 17:12:27
35
+     * @Author WN
36
+     * @Param [badstudent]
37
+     * @Return com.xhkjedu.vo.ResultVo
33 38
      **/
34 39
     @PostMapping("/save")
35
-    public ResultVo save(@RequestBody MsSubjectBadstudent msSubjectBadstudent) {
36
-        msSubjectBadstudentService.add(msSubjectBadstudent);
37
-        return new ResultVo(0, "保存成功!");
40
+    public ResultVo save(@RequestBody MsSubjectBadstudent badstudent) {
41
+        N_Utils.validation(new Object[]{badstudent.getStudentid(), "学生id", 1, badstudent.getMsid(), "考试科目id", 1
42
+                , badstudent.getBadtype(), "违规类型", 1,badstudent.getMpid(),"试卷id",1});
43
+        msSubjectBadstudentService.add(badstudent);
44
+        return new ResultVo(0, "保存成功");
38 45
     }
39 46
 
40
-    /**
41
-     * @Description 列表
42
-     * @Param [msSubjectBadstudent]
43
-     * @Author auto
44
-     * @Date 2024-10-15
45
-     * @return com.xhkjedu.vo.ResultVo
47
+
48
+    /*
49
+     * @Description 实时监控--监控班级
50
+     * @Date 2024/11/13 17:45:23
51
+     * @Author WN
52
+     * @Param [invigilate]
53
+     * @Return com.xhkjedu.vo.ResultVo
54
+     **/
55
+    @PostMapping("/jk_class")
56
+    public ResultVo listJkSchoolClass(@RequestBody MsSubjectInvigilate invigilate) {
57
+        Integer teacherid = invigilate.getTeacherid();
58
+        Integer msid = invigilate.getMsid();
59
+        N_Utils.validation(new Object[]{teacherid, "教师id", 1, msid, "考试科目id", 1});
60
+        Map map = msSubjectBadstudentService.listJkSchoolClass(invigilate);
61
+        return new ResultVo(0, "获取成功", map);
62
+    }
63
+
64
+    /*
65
+     * @Description 实时监控-班级学生
66
+     * @Date 2024/11/13 17:59:01
67
+     * @Author WN
68
+     * @Param [invigilate]
69
+     * @Return com.xhkjedu.vo.ResultVo
70
+     **/
71
+    @PostMapping("/jk_stu")
72
+    public ResultVo listJkClassStudents(@RequestBody MsSubjectInvigilate invigilate) {
73
+        Integer msid = invigilate.getMsid();
74
+        Integer classid = invigilate.getClassid();
75
+        N_Utils.validation(new Object[]{msid, "考试科目id", 1, classid, "班级id", 1});
76
+        List<Map<String, Object>> list = msSubjectBadstudentService.listClassStus(invigilate);
77
+        return new ResultVo(0, "获取成功", list);
78
+    }
79
+
80
+    /*
81
+     * @Description 实时监控-学生进场、提交情况
82
+     * @Date 2024/11/14 9:39:31
83
+     * @Author WN
84
+     * @Param [invigilate]
85
+     * @Return com.xhkjedu.vo.ResultVo
86
+     **/
87
+    @PostMapping("/jk_inrate")
88
+    public ResultVo getSubjectStuInRate(@RequestBody MsSubjectInvigilate invigilate) {
89
+        Integer msid = invigilate.getMsid();
90
+        N_Utils.validation(new Object[]{msid, "考试科目id", 1});
91
+        Map<String, Object> map = msSubjectBadstudentService.getSubjectStuInRate(invigilate);
92
+        return new ResultVo(0, "获取成功", map);
93
+    }
94
+
95
+    /*
96
+     * @Description 实时监控-学生违规照片
97
+     * @Date 2024/11/14 9:56:47
98
+     * @Author WN
99
+     * @Param [invigilate]
100
+     * @Return com.xhkjedu.vo.ResultVo
46 101
      **/
47
-    @PostMapping("/list")
48
-    public ResultVo queryList(@RequestBody MsSubjectBadstudent msSubjectBadstudent) {
49
-        Integer page = msSubjectBadstudent.getPage();
50
-        Integer size = msSubjectBadstudent.getPageSize();
51
-        N_Utils.validation(new Object[]{page, "显示页码", 1, size, "显示条数", 1});
52
-        PageHelper.startPage(page, size);
53
-        List<MsSubjectBadstudent> list = msSubjectBadstudentService.queryList(msSubjectBadstudent);
102
+    @PostMapping("/jk_badstu")
103
+    public ResultVo listSubjectStuBadPics(@RequestBody MsSubjectInvigilate invigilate) {
104
+        Integer msid = invigilate.getMsid();
105
+        Integer page = invigilate.getPage();
106
+        Integer pageSize = invigilate.getPageSize();
107
+        N_Utils.validation(new Object[]{msid, "考试科目id", 1, page, "页码", 1, pageSize, "显示条数", 1});
108
+        PageHelper.startPage(page, pageSize);
109
+        List<Map<String, Object>> list = msSubjectBadstudentService.listSubjectStuBadPics(invigilate);
54 110
         PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
55
-        return new ResultVo(0, "查询成功!", pageResult);
111
+        return new ResultVo(0, "获取成功", pageResult);
56 112
     }
57 113
 }

+ 15
- 0
smarking/src/main/java/com/xhkjedu/smarking/controller/paper/MsPaperQtypeController.java View File

@@ -161,5 +161,20 @@ public class MsPaperQtypeController {
161 161
         return new ResultVo(0,"获取成功" ,map);
162 162
     }
163 163
 
164
+    /*
165
+     * @Description 试卷文件-原卷或答案
166
+     * @Date 2024/11/14 10:42:34
167
+     * @Author WN
168
+     * @Param [paper]
169
+     * @Return com.xhkjedu.vo.ResultVo
170
+     **/
171
+    @PostMapping("/paper_file")
172
+    public ResultVo listSubjectiveQuesitons(@RequestBody MsPaperFile paper){
173
+        N_Utils.validation(new Object[]{paper.getMpid(),"试卷id",1,paper.getFiletype(),"文件类型",1});
174
+        List<Map<String,Object>> map =msPaperQtypeService.listFileByFiletype(paper.getMpid(),paper.getFiletype());
175
+        return new ResultVo(0,"获取成功" ,map);
176
+    }
177
+
178
+
164 179
 
165 180
 }

+ 1
- 1
smarking/src/main/java/com/xhkjedu/smarking/mapper/exam/MsClassMapper.java View File

@@ -21,7 +21,7 @@ public interface MsClassMapper extends TkMapper<MsClass> {
21 21
     List<Map<String,Object>> listByExamId(@Param("examid") Integer examid,@Param("subjectid") String subjectid);
22 22
 
23 23
     //考试关联学校班级
24
-    List<Map> listSchoolClassByExamId(@Param("schoolid") Integer schoolid,@Param("examid") Integer examid);
24
+    List<Map<String,Object>> listSchoolClassByExamId(@Param("schoolid") Integer schoolid,@Param("examid") Integer examid);
25 25
 
26 26
     //获取学校所有教师
27 27
     List<CTeacherVo> listTeacherBySchoolId(@Param("schoolid") Integer schoolid);

+ 14
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/exam/MsSubjectBadstudentMapper.java View File

@@ -2,6 +2,11 @@ package com.xhkjedu.smarking.mapper.exam;
2 2
 
3 3
 import com.xhkjedu.base.TkMapper;
4 4
 import com.xhkjedu.smarking.model.exam.MsSubjectBadstudent;
5
+import com.xhkjedu.smarking.model.exam.MsSubjectInvigilate;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+import java.util.List;
9
+import java.util.Map;
5 10
 
6 11
 /**
7 12
  * @Description 阅卷科目违规学生表 Mapper 接口
@@ -9,4 +14,13 @@ import com.xhkjedu.smarking.model.exam.MsSubjectBadstudent;
9 14
  * @Date 2024-10-15
10 15
  */
11 16
 public interface MsSubjectBadstudentMapper extends TkMapper<MsSubjectBadstudent> {
17
+
18
+    //实时监控-班级下学生
19
+    List<Map<String,Object>> listClassStus(@Param("mi")MsSubjectInvigilate mi);
20
+
21
+    //实时监控-学生进场、提交情况
22
+    Map<String,Object> getSubjectStuInRate(@Param("mi")MsSubjectInvigilate mi);
23
+
24
+    //实时监控-学生违规照片
25
+    List<Map<String,Object>> listSubjectStuBadPics(@Param("mi")MsSubjectInvigilate mi);
12 26
 }

+ 3
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/exam/MsSubjectInvigilateMapper.java View File

@@ -35,4 +35,7 @@ public interface MsSubjectInvigilateMapper extends TkMapper<MsSubjectInvigilate>
35 35
 
36 36
     //获取待监考数量
37 37
     Integer getJtJkSubjectNum(@Param("teacherid") Integer teacherid);
38
+
39
+    //实时监控-教师监考班级
40
+    Map<String, Object> getClassidsForJk(@Param("msid") Integer msid,@Param("teacherid") Integer teacherid);
38 41
 }

+ 3
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/exam/MsSubjectMapper.java View File

@@ -44,4 +44,7 @@ public interface MsSubjectMapper extends TkMapper<MsSubject> {
44 44
 
45 45
     //更改考试科目阅卷设置状态
46 46
     void updateCheckSetByMsId(@Param("msid") Integer msid, @Param("checkset") Integer checkset,@Param("correcttype") Integer correcttype);
47
+
48
+    //试监控-考试基本信息
49
+    Map<String,Object> getExamSubjectByMsid(@Param("msid") Integer msid);
47 50
 }

+ 4
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/paper/MsPaperFileMapper.java View File

@@ -5,6 +5,7 @@ import com.xhkjedu.smarking.model.paper.MsPaperFile;
5 5
 import org.apache.ibatis.annotations.Param;
6 6
 
7 7
 import java.util.List;
8
+import java.util.Map;
8 9
 
9 10
 /**
10 11
  * @Description 阅卷试卷附件表 Mapper 接口
@@ -22,6 +23,9 @@ public interface MsPaperFileMapper extends TkMapper<MsPaperFile> {
22 23
     //试卷附件
23 24
     List<MsPaperFile> listFilesbyMpidAndType(@Param("mpid")Integer mpid,@Param("filetype") Integer filetype);
24 25
 
26
+    //试卷原卷或答案
27
+    List<Map<String,Object>> listFileByFiletype(@Param("mpid")Integer mpid, @Param("filetype") Integer filetype);
28
+
25 29
     //更改试卷附件源文件路径
26 30
     int updateSourcepathByMpid(@Param("mpid")Integer mpid,@Param("sourcepath")String sourcepath,@Param("filetype") Integer filetype);
27 31
 }

+ 4
- 2
smarking/src/main/java/com/xhkjedu/smarking/model/exam/MsSubjectBadstudent.java View File

@@ -5,6 +5,7 @@ import lombok.Data;
5 5
 
6 6
 import javax.persistence.Id;
7 7
 import javax.persistence.Table;
8
+import javax.persistence.Transient;
8 9
 
9 10
 /**
10 11
  * @Description 阅卷科目违规学生表
@@ -19,8 +20,6 @@ public class MsSubjectBadstudent extends BaseBean {
19 20
     private Integer msbsid;
20 21
     //考试科目表id
21 22
     private Integer msid;
22
-    //班级id
23
-    private Integer classid;
24 23
     //学生id
25 24
     private Integer studentid;
26 25
     //违规类型1不在屏幕2多人3切出来
@@ -29,4 +28,7 @@ public class MsSubjectBadstudent extends BaseBean {
29 28
     private String picpath;
30 29
     //违规时间
31 30
     private Integer createtime;
31
+
32
+    @Transient
33
+    private Integer mpid;//试卷ID
32 34
 }

+ 8
- 0
smarking/src/main/java/com/xhkjedu/smarking/model/exam/MsSubjectInvigilate.java View File

@@ -5,6 +5,7 @@ import lombok.Data;
5 5
 
6 6
 import javax.persistence.Id;
7 7
 import javax.persistence.Table;
8
+import javax.persistence.Transient;
8 9
 
9 10
 /**
10 11
  * @Description 阅卷科目监考分配表
@@ -31,4 +32,11 @@ public class MsSubjectInvigilate extends BaseBean {
31 32
     private Integer createid;
32 33
     //创建时间
33 34
     private Integer createtime;
35
+
36
+    @Transient
37
+    //状态0未进场1已进场2已交卷3缺考
38
+    private Integer sstate;
39
+    @Transient
40
+    //班级ids
41
+    private String classids;
34 42
 }

+ 127
- 13
smarking/src/main/java/com/xhkjedu/smarking/service/exam/MsSubjectBadstudentService.java View File

@@ -1,11 +1,22 @@
1 1
 package com.xhkjedu.smarking.service.exam;
2 2
 
3
+import com.xhkjedu.smarking.mapper.exam.MsClassMapper;
3 4
 import com.xhkjedu.smarking.mapper.exam.MsSubjectBadstudentMapper;
5
+import com.xhkjedu.smarking.mapper.exam.MsSubjectInvigilateMapper;
6
+import com.xhkjedu.smarking.mapper.exam.MsSubjectMapper;
7
+import com.xhkjedu.smarking.mapper.system.SchoolMapper;
8
+import com.xhkjedu.smarking.mapper.system.UserMapper;
4 9
 import com.xhkjedu.smarking.model.exam.MsSubjectBadstudent;
10
+import com.xhkjedu.smarking.model.exam.MsSubjectInvigilate;
11
+import com.xhkjedu.smarking.utils.MarkingUtil;
12
+import com.xhkjedu.smarking.vo.system.SchoolCloudVo;
13
+import com.xhkjedu.utils.N_Utils;
5 14
 import org.springframework.stereotype.Service;
6 15
 
7 16
 import javax.annotation.Resource;
17
+import java.util.ArrayList;
8 18
 import java.util.List;
19
+import java.util.Map;
9 20
 
10 21
 /**
11 22
  * @Description 阅卷科目违规学生表 服务实现类
@@ -16,26 +27,129 @@ import java.util.List;
16 27
 public class MsSubjectBadstudentService {
17 28
     @Resource
18 29
     private MsSubjectBadstudentMapper msSubjectBadstudentMapper;
30
+    @Resource
31
+    private SchoolMapper schoolMapper;
32
+    @Resource
33
+    private MsSubjectMapper msSubjectMapper;
34
+    @Resource
35
+    private MsClassMapper msClassMapper;
36
+    @Resource
37
+    private UserMapper userMapper;
38
+    @Resource
39
+    private MsSubjectInvigilateMapper msSubjectInvigilateMapper;
19 40
 
20
-    /**
21
-     * @Description 新增
41
+    /*
42
+     * @Description 学生-保存违规记录
43
+     * @Date 2024/11/13 17:12:47
44
+     * @Author WN
22 45
      * @Param [msSubjectBadstudent]
23
-     * @Author auto
24
-     * @Date 2024-10-15
25
-     * @return void
46
+     * @Return void
26 47
      **/
27 48
     public void add(MsSubjectBadstudent msSubjectBadstudent){
49
+        //获取学校对应区域码,
50
+        SchoolCloudVo schoolCloudVo = schoolMapper.getSchoolCloudcode(msSubjectBadstudent.getMpid());
51
+        String saveFloder = schoolCloudVo.getCloudcode() + "/" + schoolCloudVo.getSchoolid() + "/marking/invigilate/";
52
+
53
+        String picpath = MarkingUtil.uploadBase64Img(msSubjectBadstudent.getPicpath(), 1, saveFloder);
54
+        if(N_Utils.isNotEmpty(picpath)){
55
+            msSubjectBadstudent.setPicpath(picpath);
56
+        }
57
+
58
+        msSubjectBadstudent.setCreatetime(N_Utils.getSecondTimestamp());
28 59
         msSubjectBadstudentMapper.insert(msSubjectBadstudent);
29 60
     }
30 61
 
31
-    /**
32
-     * @Description 列表
33
-     * @Param [msSubjectBadstudent]
34
-     * @Author auto
35
-     * @Date 2024-10-15
36
-     * @return java.util.List<com.xhkjedu.smarking.model.exam.MsSubjectBadstudent>
62
+    /*
63
+     * @Description 实时监控-考试信息、监控班级
64
+     * @Date 2024/11/13 17:42:36
65
+     * @Author WN
66
+     * @Param [msi]
67
+     * @Return java.util.Map<java.lang.String,java.lang.Object>
68
+     **/
69
+    public Map<String,Object> listJkSchoolClass(MsSubjectInvigilate msi) {
70
+        Integer msid = msi.getMsid();
71
+        Integer teacherid = msi.getTeacherid();
72
+        Map map = msSubjectMapper.getExamSubjectByMsid(msid);//考试科目基本信息
73
+        String classids = "";
74
+        Integer examid = (Integer) map.get("examid");
75
+        //考试学校班级学生
76
+        List<Map<String,Object>> schoolClasses = msClassMapper.listSchoolClassByExamId((Integer) map.get("schoolid"),examid);
77
+
78
+        Integer createid= (Integer) map.get("createid");
79
+        if (!N_Utils.isEmptyInteger(teacherid) && !createid.equals(teacherid)
80
+                && userMapper.getUsertypeByUserid(teacherid) == 1) {
81
+            Map claMap = msSubjectInvigilateMapper.getClassidsForJk(msid, teacherid);//教师监考班级
82
+            if (claMap == null) {
83
+                schoolClasses = new ArrayList<>();
84
+            } else if (claMap.get("majored").equals(0)) {//教师不是主监考
85
+                classids = claMap.get("classids").toString();
86
+                String[] classIds = classids.split(",");
87
+
88
+                List<Map<String,Object>> schoolClasses2 = new ArrayList<>();
89
+                for(Map scMap : schoolClasses){
90
+                    List<Map> classes2 = new ArrayList<>();
91
+                    List<Map> classMap = (List<Map>) scMap.get("classes");//获取学校下班级
92
+                    for (String classid : classIds) {
93
+                        for (Map cla : classMap) {
94
+                            if(cla.get("classid").toString().equals(classid)){
95
+                                classes2.add(cla);
96
+                                break;
97
+                            }
98
+                        }
99
+                    }
100
+                    if(N_Utils.isListEmpty(classes2)) continue;
101
+                    scMap.put("classes",classes2);
102
+                    schoolClasses2.add(scMap);
103
+                }
104
+
105
+                schoolClasses = schoolClasses2;
106
+            }
107
+        } else {
108
+            List<String> classidList = new ArrayList<>();
109
+            for(Map scMap : schoolClasses){
110
+                List<Map> classMap = (List<Map>) scMap.get("classes");//获取学校下班级
111
+                for(Map cMap : classMap){
112
+                    classidList.add(cMap.get("classid").toString());
113
+                }
114
+            }
115
+
116
+            classids = String.join(",",classidList);
117
+        }
118
+        map.put("classids", classids);
119
+        map.put("schools", schoolClasses);
120
+        return map;
121
+    }
122
+
123
+    /*
124
+     * @Description 实时监控-班级学生
125
+     * @Date 2024/11/13 17:57:47
126
+     * @Author WN
127
+     * @Param [msi]
128
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
129
+     **/
130
+    public List<Map<String,Object>> listClassStus(MsSubjectInvigilate msi){
131
+        return msSubjectBadstudentMapper.listClassStus(msi);
132
+    }
133
+
134
+    /*
135
+     * @Description 实时监控-学生进场、提交情况
136
+     * @Date 2024/11/14 9:35:45
137
+     * @Author WN
138
+     * @Param [msi]
139
+     * @Return java.util.Map<java.lang.String,java.lang.Object>
140
+     **/
141
+    public Map<String,Object> getSubjectStuInRate(MsSubjectInvigilate msi){
142
+        return msSubjectBadstudentMapper.getSubjectStuInRate(msi);
143
+    }
144
+
145
+    /*
146
+     * @Description 实时监控-学生违规照片
147
+     * @Date 2024/11/14 9:54:43
148
+     * @Author WN
149
+     * @Param [msi]
150
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
37 151
      **/
38
-    public List<MsSubjectBadstudent> queryList(MsSubjectBadstudent msSubjectBadstudent){
39
-        return msSubjectBadstudentMapper.selectAll();
152
+    public List<Map<String,Object>> listSubjectStuBadPics(MsSubjectInvigilate msi){
153
+        return msSubjectBadstudentMapper.listSubjectStuBadPics(msi);
40 154
     }
41 155
 }

+ 5
- 5
smarking/src/main/java/com/xhkjedu/smarking/service/exam/MsSubjectInvigilateService.java View File

@@ -74,7 +74,7 @@ public class MsSubjectInvigilateService {
74 74
         String msids = subjects.stream().map(s -> s.get("msid").toString()).collect(Collectors.joining(","));
75 75
         List<EITeacherVo> users = msSubjectInvigilateMapper.listUserByMsIds(msids);
76 76
         Integer schoolid = Integer.parseInt(map.get("schoolid").toString());
77
-        List<Map> schoolClasses = classMapper.listSchoolClassByExamId(schoolid, examid);//考试班级
77
+        List<Map<String,Object>> schoolClasses = classMapper.listSchoolClassByExamId(schoolid, examid);//考试班级
78 78
         int classnum = getClassNum(schoolClasses);
79 79
         for (Map s : subjects) {
80 80
             Integer msid = (Integer) s.get("msid");
@@ -117,10 +117,10 @@ public class MsSubjectInvigilateService {
117 117
     }
118 118
 
119 119
     //计算班级数量
120
-    private int getClassNum(List<Map> schoolClasses) {
120
+    private int getClassNum(List<Map<String,Object>> schoolClasses) {
121 121
         int classnum = 0;
122
-        for (Map s : schoolClasses) {
123
-            List<Map> classlist = (List<Map>) s.get("classes");
122
+        for (Map<String,Object> s : schoolClasses) {
123
+            List<Map<String,Object>> classlist = (List<Map<String,Object>>) s.get("classes");
124 124
             classnum = classnum + classlist.size();
125 125
         }
126 126
         return classnum;
@@ -140,7 +140,7 @@ public class MsSubjectInvigilateService {
140 140
         Integer examId = Integer.parseInt(examMap.get("examid").toString());
141 141
         Integer schoolId = Integer.parseInt(examMap.get("schoolid").toString());
142 142
         Map map = new HashMap();
143
-        List<Map> list = classMapper.listSchoolClassByExamId(schoolId, examId);//考试班级
143
+        List<Map<String,Object>> list = classMapper.listSchoolClassByExamId(schoolId, examId);//考试班级
144 144
         List<Map> users = msSubjectInvigilateMapper.listByMsId(msid);//单科考试监考人
145 145
         map.put("schools", list);
146 146
         map.put("teachers", users);

+ 0
- 41
smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsPaperFileService.java View File

@@ -1,41 +0,0 @@
1
-package com.xhkjedu.smarking.service.paper;
2
-
3
-import com.xhkjedu.smarking.mapper.paper.MsPaperFileMapper;
4
-import com.xhkjedu.smarking.model.paper.MsPaperFile;
5
-import org.springframework.stereotype.Service;
6
-
7
-import javax.annotation.Resource;
8
-import java.util.List;
9
-
10
-/**
11
- * @Description 阅卷试卷附件表 服务实现类
12
- * @Author auto
13
- * @Date 2024-10-15
14
- */
15
-@Service
16
-public class MsPaperFileService {
17
-    @Resource
18
-    private MsPaperFileMapper msPaperFileMapper;
19
-
20
-    /**
21
-     * @Description 新增
22
-     * @Param [msPaperFile]
23
-     * @Author auto
24
-     * @Date 2024-10-15
25
-     * @return void
26
-     **/
27
-    public void add(MsPaperFile msPaperFile){
28
-        msPaperFileMapper.insert(msPaperFile);
29
-    }
30
-
31
-    /**
32
-     * @Description 列表
33
-     * @Param [msPaperFile]
34
-     * @Author auto
35
-     * @Date 2024-10-15
36
-     * @return java.util.List<com.xhkjedu.smarking.model.paper.MsPaperFile>
37
-     **/
38
-    public List<MsPaperFile> queryList(MsPaperFile msPaperFile){
39
-        return msPaperFileMapper.selectAll();
40
-    }
41
-}

+ 11
- 0
smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsPaperQtypeService.java View File

@@ -1177,4 +1177,15 @@ public class MsPaperQtypeService {
1177 1177
 
1178 1178
         return rtnList;
1179 1179
     }
1180
+
1181
+    /*
1182
+     * @Description 试卷文件-原卷或答案
1183
+     * @Date 2024/11/14 10:39:08
1184
+     * @Author WN
1185
+     * @Param [mpid, filetype]
1186
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
1187
+     **/
1188
+    public List<Map<String,Object>> listFileByFiletype(Integer mpid,Integer filetype){
1189
+        return msPaperFileMapper.listFileByFiletype(mpid, filetype);
1190
+    }
1180 1191
 }

+ 1
- 0
smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsPaperService.java View File

@@ -74,4 +74,5 @@ public class MsPaperService {
74 74
     public Integer getExamidByMpid(Integer mpid){
75 75
         return msPaperMapper.getExamidByMpid(mpid);
76 76
     }
77
+
77 78
 }

+ 51
- 0
smarking/src/main/resources/mapper/exam/MsSubjectBadstudentMapper.xml View File

@@ -1,4 +1,55 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.xhkjedu.smarking.mapper.exam.MsSubjectBadstudentMapper">
4
+
5
+    <!--实时监控-班级下学生-->
6
+    <select id="listClassStus" resultType="java.util.Map">
7
+        select ms.studentid,ms.sstate,u.username as studentname
8
+        from ms_paper_student ms
9
+        left join ms_class_student cs on ms.examid=cs.examid and ms.subjectid=cs.subjectid and ms.studentid=cs.studentid
10
+        left join t_user u on ms.studentid = u.userid
11
+        where ms.msid=#{mi.msid} and cs.classid=#{mi.classid}
12
+        <if test="mi.sstate!=null and mi.sstate!=-1">
13
+            and ms.sstate=#{mi.sstate}
14
+        </if>
15
+        <if test="mi.createname!=null and mi.createname!=''">
16
+            and u.username like '%${ei.createname}%'
17
+        </if>
18
+        order by convert(u.username using gbk),u.userid
19
+    </select>
20
+
21
+    <!--实时监控-学生进场、提交情况-->
22
+    <select id="getSubjectStuInRate" resultType="java.util.Map">
23
+        select count(ps.mpsid)stunum
24
+        ,count(case when ps.sstate!=0 then ps.mpsid else null end)jcnum
25
+        ,count(case when ps.sstate=0 then ps.mpsid else null end)wjcnum
26
+        ,count(case when ps.sstate=2 then ps.mpsid else null end)tjcnum
27
+        ,truncate(count(case when ps.sstate!=0 then ps.mpsid else null end)*100/count(*),2)jcrate
28
+        from ms_paper_student ps
29
+        left join ms_class_student cs on ps.examid=cs.examid and ps.subjectid=cs.subjectid and ps.studentid=cs.studentid
30
+        where ps.msid=#{mi.msid}
31
+        <if test="mi.classid!=null and mi.classid!=0">
32
+            and cs.classid=#{mi.classid}
33
+        </if>
34
+        <if test="mi.classids!=null and mi.classids!=''">
35
+            and cs.classid in(${mi.classids})
36
+        </if>
37
+    </select>
38
+
39
+    <!--实时监控-学生违规照片-->
40
+    <select id="listSubjectStuBadPics" resultType="java.util.Map">
41
+        select ms.studentid,u.username,ms.badtype,ms.picpath,ms.createtime,c.classname
42
+        from ms_subject_badstudent ms left join t_user u on ms.studentid = u.userid
43
+        left join ms_subject s on ms.msid=s.msid
44
+        left join ms_class_student cs on s.examid=cs.examid and s.subjectid=cs.subjectid and ms.studentid=cs.studentid
45
+        left join ms_class c on cs.examid = c.examid and cs.subjectid=c.subjectid and cs.classid=c.classid
46
+        where ms.msid=#{mi.msid}
47
+        <if test="mi.classid!=null and mi.classid!=0">
48
+            and cs.classid=#{mi.classid}
49
+        </if>
50
+        <if test="mi.classids!=null and mi.classids!=''">
51
+            and cs.classid in(${mi.classids})
52
+        </if>
53
+        order by ms.msbsid desc, c.classtype
54
+    </select>
4 55
 </mapper>

+ 6
- 0
smarking/src/main/resources/mapper/exam/MsSubjectInvigilateMapper.xml View File

@@ -81,4 +81,10 @@
81 81
         where eb.deleted=1 and eb.examstate!=0 and eb.exammode=1 and eb.monitored=1
82 82
         and es.pstate!=2 and ei.teacherid=#{teacherid}
83 83
     </select>
84
+
85
+    <!--实时监控-教师监考班级-->
86
+    <select id="getClassidsForJk" resultType="java.util.Map">
87
+        select max(majored)majored,group_concat(classid)classids
88
+        from ms_subject_invigilate where msid=#{msid} and teacherid=#{teacherid}
89
+    </select>
84 90
 </mapper>

+ 8
- 0
smarking/src/main/resources/mapper/exam/MsSubjectMapper.xml View File

@@ -72,4 +72,12 @@
72 72
         where s.msid=#{msid}
73 73
     </update>
74 74
 
75
+    <!--考试监控-考试基本信息-->
76
+    <select id="getExamSubjectByMsid" resultType="java.util.Map">
77
+        select ms.sdate,ms.begintime,ms.endtime,ms.subjectname
78
+        ,e.examname,e.schoolid,e.examid,e.gradeid,e.examtype,e.createid,e.schoolid,e.hashb
79
+        from ms_subject ms left join ms_exam e on ms.examid = e.examid
80
+        where ms.msid=#{msid}
81
+    </select>
82
+
75 83
 </mapper>

+ 5
- 0
smarking/src/main/resources/mapper/paper/MsPaperFileMapper.xml View File

@@ -20,6 +20,11 @@
20 20
         </if>
21 21
         order by fileorder
22 22
     </select>
23
+    <!--试卷原卷或答案-->
24
+    <select id="listFileByFiletype" resultType="java.util.Map">
25
+        select filepath,sourcepath,filetype,fileorder from ms_paper_file where mpid=#{mpid} and filetype=#{filetype}
26
+        order by fileorder
27
+    </select>
23 28
 
24 29
     <!--更改试卷附件源文件路径-->
25 30
     <update id="updateSourcepathByMpid">

Loading…
Cancel
Save