Browse Source

Merge remote-tracking branch 'cloud-schoolapi/ywx'

tags/正式版本
王宁 2 years ago
parent
commit
146bd48760
18 changed files with 268 additions and 47 deletions
  1. 1
    1
      sexam/src/main/java/com/xhkjedu/sexam/controller/exam/EBaseController.java
  2. 40
    22
      sexam/src/main/java/com/xhkjedu/sexam/controller/exam/ESubjectBadstudentController.java
  3. 15
    0
      sexam/src/main/java/com/xhkjedu/sexam/controller/paperstudent/EPaperStudentController.java
  4. 30
    0
      sexam/src/main/java/com/xhkjedu/sexam/controller/paperstudent/EScanbatchController.java
  5. 11
    0
      sexam/src/main/java/com/xhkjedu/sexam/mapper/exam/ESubjectBadstudentMapper.java
  6. 1
    1
      sexam/src/main/java/com/xhkjedu/sexam/mapper/exam/ESubjectMapper.java
  7. 3
    0
      sexam/src/main/java/com/xhkjedu/sexam/mapper/paperstudent/EPaperStudentMapper.java
  8. 8
    0
      sexam/src/main/java/com/xhkjedu/sexam/mapper/paperstudent/EScanerrorMapper.java
  9. 8
    1
      sexam/src/main/java/com/xhkjedu/sexam/model/paperstudent/EScanerror.java
  10. 2
    2
      sexam/src/main/java/com/xhkjedu/sexam/service/exam/EBaseService.java
  11. 20
    16
      sexam/src/main/java/com/xhkjedu/sexam/service/exam/ESubjectBadstudentService.java
  12. 4
    0
      sexam/src/main/java/com/xhkjedu/sexam/service/paperstudent/EPaperStudentService.java
  13. 74
    3
      sexam/src/main/java/com/xhkjedu/sexam/service/paperstudent/EScanbatchService.java
  14. 28
    0
      sexam/src/main/resources/mapper/exam/ESubjectBadstudentMapper.xml
  15. 1
    0
      sexam/src/main/resources/mapper/exam/ESubjectMapper.xml
  16. 4
    0
      sexam/src/main/resources/mapper/paperstudent/EPaperStudentMapper.xml
  17. 2
    1
      sexam/src/main/resources/mapper/paperstudent/EScanbatchMapper.xml
  18. 16
    0
      sexam/src/main/resources/mapper/paperstudent/EScanerrorMapper.xml

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/controller/exam/EBaseController.java View File

107
                 return new ResultVo(1, e.getMessage());
107
                 return new ResultVo(1, e.getMessage());
108
             }
108
             }
109
         }
109
         }
110
-        eBaseService.setExam(subjects);
110
+        eBaseService.setExam(subjects, createid);
111
         
111
         
112
         noticeService.batchSave(noticeList, msgList, schoolid, createid, 2);
112
         noticeService.batchSave(noticeList, msgList, schoolid, createid, 2);
113
         return new ResultVo(0, "设置成功");
113
         return new ResultVo(0, "设置成功");

+ 40
- 22
sexam/src/main/java/com/xhkjedu/sexam/controller/exam/ESubjectBadstudentController.java View File

4
 import com.github.pagehelper.PageInfo;
4
 import com.github.pagehelper.PageInfo;
5
 import com.xhkjedu.sexam.model.exam.ESubjectBadstudent;
5
 import com.xhkjedu.sexam.model.exam.ESubjectBadstudent;
6
 import com.xhkjedu.sexam.service.exam.ESubjectBadstudentService;
6
 import com.xhkjedu.sexam.service.exam.ESubjectBadstudentService;
7
+import com.xhkjedu.utils.N_Utils;
7
 import com.xhkjedu.utils.PageUtil;
8
 import com.xhkjedu.utils.PageUtil;
8
 import com.xhkjedu.vo.PageResult;
9
 import com.xhkjedu.vo.PageResult;
9
 import com.xhkjedu.vo.ResultVo;
10
 import com.xhkjedu.vo.ResultVo;
14
 
15
 
15
 import javax.annotation.Resource;
16
 import javax.annotation.Resource;
16
 import java.util.List;
17
 import java.util.List;
18
+import java.util.Map;
17
 
19
 
18
 @RestController
20
 @RestController
19
-@RequestMapping("/e_badstudent")
21
+@RequestMapping("/ebs")
20
 public class ESubjectBadstudentController {
22
 public class ESubjectBadstudentController {
21
     @Resource
23
     @Resource
22
     private ESubjectBadstudentService eSubjectBadstudentService;
24
     private ESubjectBadstudentService eSubjectBadstudentService;
23
 
25
 
26
+    /**
27
+     * 保存违规学生记录
28
+     *
29
+     * @return com.xhkjedu.vo.ResultVo
30
+     * @Param [badstudent]
31
+     * @Author ywx
32
+     * @Date 2022/8/17 10:50
33
+     **/
24
     @PostMapping("/add")
34
     @PostMapping("/add")
25
-    public ResultVo add(@RequestBody ESubjectBadstudent eSubjectBadstudent) {
26
-        eSubjectBadstudentService.save(eSubjectBadstudent);
27
-        return new ResultVo(0,"保存成功");
35
+    public ResultVo add(@RequestBody ESubjectBadstudent badstudent) {
36
+        N_Utils.validation(new Object[]{badstudent.getStudentid(), "学生id", 1, badstudent.getEsid(), "考试科目id", 1
37
+                , badstudent.getClassid(), "班级id", 1, badstudent.getExamid(), "考试id", 1
38
+                , badstudent.getBadtype(), "违规类型", 1
39
+        });
40
+        eSubjectBadstudentService.save(badstudent);
41
+        return new ResultVo(0, "保存成功");
28
     }
42
     }
29
 
43
 
30
-    @PostMapping("/delete")
31
-    public ResultVo delete(@RequestBody ESubjectBadstudent eSubjectBadstudent) {
32
-        eSubjectBadstudentService.deleteById(eSubjectBadstudent.getId());
33
-        return new ResultVo(0,"删除成功");
34
-    }
35
-
36
-    @PostMapping("/update")
37
-    public ResultVo update(@RequestBody ESubjectBadstudent eSubjectBadstudent) {
38
-        eSubjectBadstudentService.update(eSubjectBadstudent);
39
-        return new ResultVo(0,"修改成功");
40
-    }
41
-
42
-    @PostMapping("/list")
43
-    public ResultVo list(@RequestBody ESubjectBadstudent eSubjectBadstudent) {
44
-        PageHelper.startPage(eSubjectBadstudent.getPage(), eSubjectBadstudent.getPageSize());
45
-        List<ESubjectBadstudent> list = eSubjectBadstudentService.listAll();
46
-        PageResult pageResult = PageUtil.getPageResult(new PageInfo(list));
47
-        return new ResultVo(0,"获取列表成功",pageResult);
44
+    /**
45
+     * 实时监控
46
+     *
47
+     * @return com.xhkjedu.vo.ResultVo
48
+     * @Param [badstudent]
49
+     * @Author ywx
50
+     * @Date 2022/8/17 11:44
51
+     **/
52
+    @PostMapping("/list_sjk")
53
+    public ResultVo listJk(@RequestBody ESubjectBadstudent badstudent) {
54
+        Integer examid = badstudent.getExamid();
55
+        Integer esid = badstudent.getEsid();
56
+        Integer classid = badstudent.getClassid();
57
+        Integer page = badstudent.getPage();
58
+        Integer pageSize = badstudent.getPageSize();
59
+        N_Utils.validation(new Object[]{examid, "考试id", 1, page, "页码", 1, pageSize, "显示条数", 1});
60
+        PageHelper.startPage(page, pageSize);
61
+        List<Map> list = eSubjectBadstudentService.listStu(esid, classid, badstudent.getCreatename());
62
+        PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
63
+        Map map = eSubjectBadstudentService.getJkDetail(examid, esid);
64
+        map.put("pageResult", pageResult);
65
+        return new ResultVo(0, "获取成功", map);
48
     }
66
     }
49
 }
67
 }

+ 15
- 0
sexam/src/main/java/com/xhkjedu/sexam/controller/paperstudent/EPaperStudentController.java View File

175
         }
175
         }
176
     }
176
     }
177
 
177
 
178
+    /**
179
+     * 学生进场
180
+     *
181
+     * @return com.xhkjedu.vo.ResultVo
182
+     * @Param [eps]
183
+     * @Author ywx
184
+     * @Date 2022/8/17 11:49
185
+     **/
186
+    @PostMapping("/in")
187
+    public ResultVo inPaper(@RequestBody EPaperStudent eps) {
188
+        Integer epsid = eps.getEpsid();
189
+        N_Utils.validation(new Object[]{epsid, "学生试卷id", 1});
190
+        ePaperStudentService.updateSstate(epsid, 1);
191
+        return new ResultVo(0, "进场成功");
192
+    }
178
 }
193
 }

+ 30
- 0
sexam/src/main/java/com/xhkjedu/sexam/controller/paperstudent/EScanbatchController.java View File

111
             return new ResultVo(0, "获取成功", pageResult);
111
             return new ResultVo(0, "获取成功", pageResult);
112
         }
112
         }
113
     }
113
     }
114
+
115
+    /**
116
+     * 获取扫描答卷识别异常详情
117
+     *
118
+     * @return com.xhkjedu.vo.ResultVo
119
+     * @Param [eps]
120
+     * @Author ywx
121
+     * @Date 2022/8/17 9:44
122
+     **/
123
+    @PostMapping("/edetail")
124
+    public ResultVo getScanErrorDetail(@RequestBody EPaperStudent eps) {
125
+        Integer epid = eps.getEpid();
126
+        N_Utils.validation(new Object[]{epid, "试卷id", 1});
127
+        Map map = eScanbatchService.getScanErrorDetail(epid);
128
+        return new ResultVo(0, "获取详情成功", map);
129
+    }
130
+
131
+    /**
132
+     * 批量标记待处理的扫描异常为已处理
133
+     *
134
+     * @return com.xhkjedu.vo.ResultVo
135
+     * @Param [serrorids]
136
+     * @Author ywx
137
+     * @Date 2022/8/17 10:32
138
+     **/
139
+    @PostMapping("/bhe")
140
+    public ResultVo batchHandleError(@RequestBody List<Integer> serrorids) {
141
+        eScanbatchService.batchHandleError(serrorids);
142
+        return new ResultVo(0, "处理成功");
143
+    }
114
 }
144
 }

+ 11
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/exam/ESubjectBadstudentMapper.java View File

2
 
2
 
3
 import com.xhkjedu.sexam.base.TkMapper;
3
 import com.xhkjedu.sexam.base.TkMapper;
4
 import com.xhkjedu.sexam.model.exam.ESubjectBadstudent;
4
 import com.xhkjedu.sexam.model.exam.ESubjectBadstudent;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+import java.util.List;
8
+import java.util.Map;
5
 
9
 
6
 public interface ESubjectBadstudentMapper extends TkMapper<ESubjectBadstudent> {
10
 public interface ESubjectBadstudentMapper extends TkMapper<ESubjectBadstudent> {
11
+    //试卷学生
12
+    List<Map> listStu(@Param("esid") Integer esid, @Param("classid") Integer classid, @Param("studentname") String studentname);
13
+
14
+    //试卷异常次数
15
+    Integer getErrNumByEsId(@Param("esid") Integer esid);
16
+
17
+    Map getPaperRate(@Param("esid") Integer esid);
7
 }
18
 }

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/mapper/exam/ESubjectMapper.java View File

9
 
9
 
10
 public interface ESubjectMapper extends TkMapper<ESubject> {
10
 public interface ESubjectMapper extends TkMapper<ESubject> {
11
     //考试设置
11
     //考试设置
12
-    void setExam(@Param("subjects") List<ESubject> subjects);
12
+    void setExam(@Param("subjects") List<ESubject> subjects, @Param("handleid") Integer handleid);
13
 
13
 
14
     //更新考试科目状态
14
     //更新考试科目状态
15
     void updateExamSubjectState(@Param("esstate") Integer esstate, @Param("esid") Integer esid);
15
     void updateExamSubjectState(@Param("esstate") Integer esstate, @Param("esid") Integer esid);

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/paperstudent/EPaperStudentMapper.java View File

66
 
66
 
67
     //搜索考试学生获取学生试卷id
67
     //搜索考试学生获取学生试卷id
68
     List<Map> getStuSubjectPaperByname(@Param("ps")EPaperStudent ps);
68
     List<Map> getStuSubjectPaperByname(@Param("ps")EPaperStudent ps);
69
+
70
+    //修改学生试卷状态
71
+    void updateSstate(@Param("epsid") Integer epsid, @Param("sstate") Integer sstate);
69
 }
72
 }

+ 8
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/paperstudent/EScanerrorMapper.java View File

2
 
2
 
3
 import com.xhkjedu.sexam.base.TkMapper;
3
 import com.xhkjedu.sexam.base.TkMapper;
4
 import com.xhkjedu.sexam.model.paperstudent.EScanerror;
4
 import com.xhkjedu.sexam.model.paperstudent.EScanerror;
5
+import org.apache.ibatis.annotations.Param;
5
 import org.springframework.stereotype.Repository;
6
 import org.springframework.stereotype.Repository;
6
 
7
 
8
+import java.util.List;
9
+
7
 @Repository
10
 @Repository
8
 public interface EScanerrorMapper extends TkMapper<EScanerror> {
11
 public interface EScanerrorMapper extends TkMapper<EScanerror> {
12
+    //试卷扫描出错列表
13
+    List<EScanerror> listByBatchIds(@Param("batchids") String batchids);
14
+
15
+    //批量标记待处理的扫描异常为已处理
16
+    void batchHandleError(@Param("serrorids") List<Integer> serrorids);
9
 }
17
 }

+ 8
- 1
sexam/src/main/java/com/xhkjedu/sexam/model/paperstudent/EScanerror.java View File

5
 
5
 
6
 import javax.persistence.Id;
6
 import javax.persistence.Id;
7
 import javax.persistence.Table;
7
 import javax.persistence.Table;
8
-import java.util.List;
8
+import javax.persistence.Transient;
9
 
9
 
10
 /**
10
 /**
11
  * @Description: TODO 扫描出错信息
11
  * @Description: TODO 扫描出错信息
35
 
35
 
36
     //创建时间
36
     //创建时间
37
     private Integer createtime;
37
     private Integer createtime;
38
+    
39
+    //状态0待处理1已处理
40
+    private Integer errorstate;
41
+
42
+    @Transient
43
+    //扫描批次名称
44
+    private String batchname;
38
 
45
 
39
 }
46
 }

+ 2
- 2
sexam/src/main/java/com/xhkjedu/sexam/service/exam/EBaseService.java View File

179
     }
179
     }
180
 
180
 
181
     //考试设置
181
     //考试设置
182
-    public void setExam(List<ESubject> subjects) {
183
-        eSubjectMapper.setExam(subjects);
182
+    public void setExam(List<ESubject> subjects, Integer handleid) {
183
+        eSubjectMapper.setExam(subjects, handleid);
184
     }
184
     }
185
 
185
 
186
     //发布考试
186
     //发布考试

+ 20
- 16
sexam/src/main/java/com/xhkjedu/sexam/service/exam/ESubjectBadstudentService.java View File

1
 package com.xhkjedu.sexam.service.exam;
1
 package com.xhkjedu.sexam.service.exam;
2
 
2
 
3
+import com.xhkjedu.sexam.mapper.exam.EBaseMapper;
4
+import com.xhkjedu.sexam.mapper.exam.EClassMapper;
3
 import com.xhkjedu.sexam.mapper.exam.ESubjectBadstudentMapper;
5
 import com.xhkjedu.sexam.mapper.exam.ESubjectBadstudentMapper;
4
 import com.xhkjedu.sexam.model.exam.ESubjectBadstudent;
6
 import com.xhkjedu.sexam.model.exam.ESubjectBadstudent;
5
 import com.xhkjedu.utils.N_Utils;
7
 import com.xhkjedu.utils.N_Utils;
7
 
9
 
8
 import javax.annotation.Resource;
10
 import javax.annotation.Resource;
9
 import java.util.List;
11
 import java.util.List;
12
+import java.util.Map;
10
 
13
 
11
 @Service
14
 @Service
12
 public class ESubjectBadstudentService {
15
 public class ESubjectBadstudentService {
13
     @Resource
16
     @Resource
14
     private ESubjectBadstudentMapper eSubjectBadstudentMapper;
17
     private ESubjectBadstudentMapper eSubjectBadstudentMapper;
18
+    @Resource
19
+    private EBaseMapper eBaseMapper;
20
+    @Resource
21
+    private EClassMapper eClassMapper;
15
 
22
 
16
     //添加
23
     //添加
17
     public void save(ESubjectBadstudent model) {
24
     public void save(ESubjectBadstudent model) {
19
         eSubjectBadstudentMapper.insertSelective(model);
26
         eSubjectBadstudentMapper.insertSelective(model);
20
     }
27
     }
21
 
28
 
22
-    //删除
23
-    public Integer deleteById(Integer id) {
24
-        return eSubjectBadstudentMapper.deleteByPrimaryKey(id);
25
-    }
26
-
27
-    //修改
28
-    public Integer update(ESubjectBadstudent model) {
29
-        return eSubjectBadstudentMapper.updateByPrimaryKeySelective(model);
30
-    }
31
-
32
-    //获取详情
33
-    public ESubjectBadstudent findById(Integer id) {
34
-        return eSubjectBadstudentMapper.selectByPrimaryKey(id);
29
+    //试卷学生
30
+    public List<Map> listStu(Integer esid, Integer classid, String studentname) {
31
+        List<Map> students = eSubjectBadstudentMapper.listStu(esid, classid, studentname);
32
+        return students;
35
     }
33
     }
36
 
34
 
37
-    //获取列表
38
-    public List <ESubjectBadstudent> listAll() {
39
-        return eSubjectBadstudentMapper.selectAll();
35
+    public Map getJkDetail(Integer examid, Integer esid) {
36
+        Map map = eBaseMapper.findById(examid);
37
+        List<Map> classes = eClassMapper.listByExamId(examid);
38
+        map.put("classes", classes);
39
+        Integer errnum = eSubjectBadstudentMapper.getErrNumByEsId(esid);//试卷异常次数
40
+        map.put("errnum", errnum);
41
+        Map rate = eSubjectBadstudentMapper.getPaperRate(esid);
42
+        map.putAll(rate);
43
+        return map;
40
     }
44
     }
41
 }
45
 }

+ 4
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/paperstudent/EPaperStudentService.java View File

616
         return ePaperStudentMapper.getStuSubjectPaperByname(ps);
616
         return ePaperStudentMapper.getStuSubjectPaperByname(ps);
617
     }
617
     }
618
 
618
 
619
+    //修改学生试卷状态
620
+    public void updateSstate(Integer epsid, Integer sstate) {
621
+        ePaperStudentMapper.updateSstate(epsid, sstate);
622
+    }
619
 }
623
 }

+ 74
- 3
sexam/src/main/java/com/xhkjedu/sexam/service/paperstudent/EScanbatchService.java View File

5
 import com.xhkjedu.sexam.mapper.exam.EClassMapper;
5
 import com.xhkjedu.sexam.mapper.exam.EClassMapper;
6
 import com.xhkjedu.sexam.mapper.paper.EPaperMapper;
6
 import com.xhkjedu.sexam.mapper.paper.EPaperMapper;
7
 import com.xhkjedu.sexam.mapper.paperstudent.EScanbatchMapper;
7
 import com.xhkjedu.sexam.mapper.paperstudent.EScanbatchMapper;
8
+import com.xhkjedu.sexam.mapper.paperstudent.EScanerrorMapper;
8
 import com.xhkjedu.sexam.model.paperstudent.EScanbatch;
9
 import com.xhkjedu.sexam.model.paperstudent.EScanbatch;
10
+import com.xhkjedu.sexam.model.paperstudent.EScanerror;
9
 import com.xhkjedu.sexam.utils.ExamUtil;
11
 import com.xhkjedu.sexam.utils.ExamUtil;
10
 import com.xhkjedu.utils.N_Utils;
12
 import com.xhkjedu.utils.N_Utils;
11
 import org.springframework.stereotype.Service;
13
 import org.springframework.stereotype.Service;
12
 
14
 
13
 import javax.annotation.Resource;
15
 import javax.annotation.Resource;
16
+import java.util.ArrayList;
14
 import java.util.HashMap;
17
 import java.util.HashMap;
15
 import java.util.List;
18
 import java.util.List;
16
 import java.util.Map;
19
 import java.util.Map;
20
+import java.util.stream.Collectors;
17
 
21
 
18
 /**
22
 /**
19
  * @Description: TODO
23
  * @Description: TODO
31
 
35
 
32
     @Resource
36
     @Resource
33
     private EClassMapper eClassMapper;
37
     private EClassMapper eClassMapper;
38
+    @Resource
39
+    private EScanerrorMapper eScanerrorMapper;
34
 
40
 
35
     /**
41
     /**
36
      * @description: 保持扫描试卷批次信息
42
      * @description: 保持扫描试卷批次信息
39
      * @author: wn
45
      * @author: wn
40
      * @date: 2022/8/11/011 9:42
46
      * @date: 2022/8/11/011 9:42
41
      **/
47
      **/
42
-    public Map saveScanBatch(EScanbatch eScanbatch){
48
+    public Map saveScanBatch(EScanbatch eScanbatch) {
43
         String batchname = eScanbatch.getDevice() + "-" + eScanbatch.getEpid() + "-";
49
         String batchname = eScanbatch.getDevice() + "-" + eScanbatch.getEpid() + "-";
44
         //获取数据库中该批次名的扫描批次数量
50
         //获取数据库中该批次名的扫描批次数量
45
         Integer bnum = eScanbatchMapper.getBatchNameLikeNum(batchname);
51
         Integer bnum = eScanbatchMapper.getBatchNameLikeNum(batchname);
46
-        if(bnum == null || bnum == 0){
52
+        if (bnum == null || bnum == 0) {
47
             bnum = 1;
53
             bnum = 1;
48
-        }else{
54
+        } else {
49
             bnum++;
55
             bnum++;
50
         }
56
         }
51
         batchname = batchname + bnum;
57
         batchname = batchname + bnum;
144
     public List<Map> listScanStu(Integer epid, Integer sstate, String username, Integer classid) {
150
     public List<Map> listScanStu(Integer epid, Integer sstate, String username, Integer classid) {
145
         return eScanbatchMapper.listScanStu(epid, sstate, username, classid);
151
         return eScanbatchMapper.listScanStu(epid, sstate, username, classid);
146
     }
152
     }
153
+
154
+    //获取扫描答卷识别异常详情
155
+    public Map getScanErrorDetail(Integer epid) {
156
+        Map map = eScanbatchMapper.listByEpId(epid);
157
+        List<Map> scanbatches = eScanbatchMapper.listScanBatchPapers(epid);//试卷扫描批次信息
158
+        Map<Object, String> batchMap = scanbatches.stream().collect(Collectors.toMap(s -> s.get("batchid"), s -> s.get(
159
+                "batchname").toString()));
160
+        String batchids = scanbatches.stream().map(s -> s.get("batchid").toString()).collect(Collectors.joining(","));
161
+        List<EScanerror> scanerrors = eScanerrorMapper.listByBatchIds(batchids);//试卷扫描出错列表
162
+        scanerrors.forEach(e -> {
163
+            e.setBatchname(batchMap.get(e.getBatchid()));
164
+        });
165
+        List<EScanerror> smccList = new ArrayList<>();//扫描出错集合
166
+        List<EScanerror> khywList = new ArrayList<>();//考号有误集合
167
+        List<EScanerror> zbdxsList = new ArrayList<>();//找不到学生集合
168
+        List<EScanerror> qsList = new ArrayList<>();//缺少考号或试卷id集合
169
+        Map<Integer, List<EScanerror>> collect = scanerrors.stream().collect(Collectors.groupingBy(s -> s.getErrortype()));
170
+        for (Map.Entry<Integer, List<EScanerror>> entry : collect.entrySet()) {
171
+            List<EScanerror> list = entry.getValue();
172
+            Integer errortype = entry.getKey();
173
+            if (errortype == 1) {
174
+                smccList = list;
175
+            } else if (errortype == 2) {
176
+                khywList = list;
177
+            } else if (errortype == 3) {
178
+                zbdxsList = list;
179
+            } else {
180
+                qsList = list;
181
+            }
182
+        }
183
+        Map smcc = new HashMap();//扫描出错
184
+        List<EScanerror> dclList = smccList.stream().filter(s -> s.getErrorstate().equals(0)).collect(Collectors.toList());
185
+        List<EScanerror> yclList = smccList.stream().filter(s -> s.getErrorstate().equals(1)).collect(Collectors.toList());
186
+        smcc.put("num", dclList.size());
187
+        smcc.put("dclList", dclList);
188
+        smcc.put("yclList", yclList);
189
+        map.put("smcc", smcc);
190
+        Map khyw = new HashMap();//考号有误
191
+        dclList = khywList.stream().filter(s -> s.getErrorstate().equals(0)).collect(Collectors.toList());
192
+        yclList = khywList.stream().filter(s -> s.getErrorstate().equals(1)).collect(Collectors.toList());
193
+        khyw.put("num", dclList.size());
194
+        khyw.put("dclList", dclList);
195
+        khyw.put("yclList", yclList);
196
+        map.put("khyw", khyw);
197
+        Map zbdxs = new HashMap();//找不到学生
198
+        dclList = zbdxsList.stream().filter(s -> s.getErrorstate().equals(0)).collect(Collectors.toList());
199
+        yclList = zbdxsList.stream().filter(s -> s.getErrorstate().equals(1)).collect(Collectors.toList());
200
+        zbdxs.put("num", dclList.size());
201
+        zbdxs.put("dclList", dclList);
202
+        zbdxs.put("yclList", yclList);
203
+        map.put("zbdxs", zbdxs);
204
+        Map qs = new HashMap();//缺少考号或试卷id
205
+        dclList = qsList.stream().filter(s -> s.getErrorstate().equals(0)).collect(Collectors.toList());
206
+        yclList = qsList.stream().filter(s -> s.getErrorstate().equals(1)).collect(Collectors.toList());
207
+        qs.put("num", dclList.size());
208
+        qs.put("dclList", dclList);
209
+        qs.put("yclList", yclList);
210
+        map.put("qs", qs);
211
+        return map;
212
+    }
213
+
214
+    //批量标记待处理的扫描异常为已处理
215
+    public void batchHandleError(List<Integer> serrorids) {
216
+        eScanerrorMapper.batchHandleError(serrorids);
217
+    }
147
 }
218
 }

+ 28
- 0
sexam/src/main/resources/mapper/exam/ESubjectBadstudentMapper.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.sexam.mapper.exam.ESubjectBadstudentMapper">
4
+    <!--试卷学生-->
5
+    <select id="listStu" resultType="java.util.Map">
6
+        select es.classid,es.sstate,u.username
7
+        from e_paper_student es left join t_user u on es.studentid = u.userid
8
+        where es.esid=#{esid}
9
+        <if test="classid!=null and classid!=0">
10
+            and es.classid=#{classid}
11
+        </if>
12
+        <if test="studentname!=null and studentname!=''">
13
+            and u.username like '%${studentname}%'
14
+        </if>
15
+    </select>
16
+    <!--试卷异常次数-->
17
+    <select id="getErrNumByEsId" resultType="java.lang.Integer">
18
+        select count(*) from e_subject_badstudent where esid=#{esid}
19
+    </select>
20
+    <select id="getPaperRate" resultType="java.util.Map">
21
+        select count(*)examnum
22
+             ,count(case when sstate!=0 then epsid else null end)jcnum
23
+             ,count(case when sstate=0 then epsid else null end)wjcnum
24
+             ,count(case when sstate=2 then epsid else null end)tjcnum
25
+             ,truncate(count(case when sstate!=0 then epsid else null end)*100/count(*),2)jcrate
26
+        from e_paper_student where esid=#{esid}
27
+    </select>
28
+</mapper>

+ 1
- 0
sexam/src/main/resources/mapper/exam/ESubjectMapper.xml View File

5
     <update id="setExam">
5
     <update id="setExam">
6
         <foreach collection="subjects" item="s" separator=";">
6
         <foreach collection="subjects" item="s" separator=";">
7
             update e_subject set sdate=#{s.sdate},begintime=#{s.begintime},endtime=#{s.endtime},teacherid=#{s.teacherid}
7
             update e_subject set sdate=#{s.sdate},begintime=#{s.begintime},endtime=#{s.endtime},teacherid=#{s.teacherid}
8
+            ,handleid=#{handleid},handletime=unix_timestamp()
8
             where examid=#{s.examid} and subjectid=#{s.subjectid}
9
             where examid=#{s.examid} and subjectid=#{s.subjectid}
9
         </foreach>
10
         </foreach>
10
     </update>
11
     </update>

+ 4
- 0
sexam/src/main/resources/mapper/paperstudent/EPaperStudentMapper.xml View File

224
         and u.username like concat('%',#{ps.stuname,jdbcType=VARCHAR},'%')
224
         and u.username like concat('%',#{ps.stuname,jdbcType=VARCHAR},'%')
225
         group by ps.studentid
225
         group by ps.studentid
226
     </select>
226
     </select>
227
+    <!--修改学生试卷状态-->
228
+    <update id="updateSstate">
229
+        update e_paper_student set sstate=#{sstate} where epsid=#{epsid}
230
+    </update>
227
 </mapper>
231
 </mapper>

+ 2
- 1
sexam/src/main/resources/mapper/paperstudent/EScanbatchMapper.xml View File

74
     </select>
74
     </select>
75
     <!--试卷基础信息-->
75
     <!--试卷基础信息-->
76
     <select id="listByEpId" resultType="java.util.Map">
76
     <select id="listByEpId" resultType="java.util.Map">
77
-        select ifnull(ep.scantronnum,1)scantronnum,eb.examname,eb.gradeid
77
+        select ifnull(ep.scantronnum,1)scantronnum,eb.examname,eb.gradeid,es.subjectname
78
         from e_paper ep left join e_base eb on ep.examid = eb.examid
78
         from e_paper ep left join e_base eb on ep.examid = eb.examid
79
+        left join e_subject es on ep.esid = es.esid
79
         where ep.epid=#{epid}
80
         where ep.epid=#{epid}
80
     </select>
81
     </select>
81
 </mapper>
82
 </mapper>

+ 16
- 0
sexam/src/main/resources/mapper/paperstudent/EScanerrorMapper.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.sexam.mapper.paperstudent.EScanerrorMapper">
4
+    <!--试卷扫描出错列表-->
5
+    <select id="listByBatchIds" resultType="com.xhkjedu.sexam.model.paperstudent.EScanerror">
6
+        select serrorid, batchid, errortype, pagenum, stupic, errorjson, createtime
7
+        from e_scanerror where batchid in (${batchids})
8
+    </select>
9
+    <!--批量标记待处理的扫描异常为已处理-->
10
+    <update id="batchHandleError">
11
+        update e_scanerror set errorstate=1 where serrorid in
12
+        <foreach collection="serrorids" item="serrorid" index="index" open="(" separator="," close=")">
13
+            ${serrorid}
14
+        </foreach>
15
+    </update>
16
+</mapper>

Loading…
Cancel
Save