Browse Source

扫码错误类型3和4添加学生姓名

tags/正式版本
王宁 2 years ago
parent
commit
976c4f2fe9

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

16
 
16
 
17
     //根据考号搜索参加考试学生
17
     //根据考号搜索参加考试学生
18
     List<Map> listStudentByExamidAnExamno(@Param("examid")Integer examid,@Param("examno")String examno);
18
     List<Map> listStudentByExamidAnExamno(@Param("examid")Integer examid,@Param("examno")String examno);
19
+
20
+    //获取参与考试的学生集合
21
+    List<Map> listStudentsByEpid(@Param("epid")Integer epid);
19
 }
22
 }

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

79
 
79
 
80
     //批量更新试卷学生状态
80
     //批量更新试卷学生状态
81
     void batchUpdateSstate(@Param("sstate") Integer sstate, @Param("epsids") List<Integer> epsids);
81
     void batchUpdateSstate(@Param("sstate") Integer sstate, @Param("epsids") List<Integer> epsids);
82
+
83
+    //批量更新试卷学生试卷状态
84
+    void batchUpdatePStuState(@Param("list") List<EPaperStudent> list);
82
 }
85
 }

+ 10
- 2
sexam/src/main/java/com/xhkjedu/sexam/service/paperstudent/EPaperStudentService.java View File

772
     //缺考确认
772
     //缺考确认
773
     @Transactional(rollbackFor = Exception.class)
773
     @Transactional(rollbackFor = Exception.class)
774
     public void qkConfirm(List<PaperStudentWebVo> list) throws Exception {
774
     public void qkConfirm(List<PaperStudentWebVo> list) throws Exception {
775
-        List<Integer> epsids = list.stream().map(l -> l.getEpsid()).collect(Collectors.toList());
776
-        ePaperStudentMapper.batchUpdateSstate(2, epsids);//批量更新试卷学生状态
775
+        List<EPaperStudent> pslist = new ArrayList<>();
776
+        for(PaperStudentWebVo objvo : list){
777
+            EPaperStudent ps = new EPaperStudent();
778
+            ps.setEpsid(objvo.getEpsid());
779
+            ps.setSstate(objvo.getSstate());
780
+            pslist.add(ps);
781
+        }
782
+        ePaperStudentMapper.batchUpdatePStuState(pslist);
783
+        /*List<Integer> epsids = list.stream().map(l -> l.getEpsid()).collect(Collectors.toList());
784
+        ePaperStudentMapper.batchUpdateSstate(2, epsids);//批量更新试卷学生状态*/
777
         List<Integer> serrorids = list.stream().map(l -> l.getSerrorid()).collect(Collectors.toList());
785
         List<Integer> serrorids = list.stream().map(l -> l.getSerrorid()).collect(Collectors.toList());
778
         eScanerrorMapper.batchHandleError(serrorids);//更新缺考记录为已处理
786
         eScanerrorMapper.batchHandleError(serrorids);//更新缺考记录为已处理
779
     }
787
     }

+ 25
- 1
sexam/src/main/java/com/xhkjedu/sexam/service/paperstudent/EScanbatchService.java View File

1
 package com.xhkjedu.sexam.service.paperstudent;
1
 package com.xhkjedu.sexam.service.paperstudent;
2
 
2
 
3
 import com.alibaba.fastjson.JSON;
3
 import com.alibaba.fastjson.JSON;
4
+import com.sun.org.apache.xalan.internal.xsltc.runtime.ErrorMessages_ja;
4
 import com.xhkjedu.sexam.mapper.exam.EBaseMapper;
5
 import com.xhkjedu.sexam.mapper.exam.EBaseMapper;
5
 import com.xhkjedu.sexam.mapper.exam.EClassMapper;
6
 import com.xhkjedu.sexam.mapper.exam.EClassMapper;
7
+import com.xhkjedu.sexam.mapper.exam.EClassStudentMapper;
6
 import com.xhkjedu.sexam.mapper.paper.EPaperMapper;
8
 import com.xhkjedu.sexam.mapper.paper.EPaperMapper;
7
 import com.xhkjedu.sexam.mapper.paperstudent.EScanbatchMapper;
9
 import com.xhkjedu.sexam.mapper.paperstudent.EScanbatchMapper;
8
 import com.xhkjedu.sexam.mapper.paperstudent.EScanerrorMapper;
10
 import com.xhkjedu.sexam.mapper.paperstudent.EScanerrorMapper;
9
 import com.xhkjedu.sexam.model.paperstudent.EScanbatch;
11
 import com.xhkjedu.sexam.model.paperstudent.EScanbatch;
10
 import com.xhkjedu.sexam.model.paperstudent.EScanerror;
12
 import com.xhkjedu.sexam.model.paperstudent.EScanerror;
11
 import com.xhkjedu.sexam.utils.ExamUtil;
13
 import com.xhkjedu.sexam.utils.ExamUtil;
14
+import com.xhkjedu.sexam.vo.paperstudent.PaperStudentWebVo;
12
 import com.xhkjedu.utils.N_Utils;
15
 import com.xhkjedu.utils.N_Utils;
13
 import org.springframework.stereotype.Service;
16
 import org.springframework.stereotype.Service;
14
 
17
 
32
     private EPaperMapper ePaperMapper;
35
     private EPaperMapper ePaperMapper;
33
     @Resource
36
     @Resource
34
     private EBaseMapper eBaseMapper;
37
     private EBaseMapper eBaseMapper;
35
-
36
     @Resource
38
     @Resource
37
     private EClassMapper eClassMapper;
39
     private EClassMapper eClassMapper;
38
     @Resource
40
     @Resource
39
     private EScanerrorMapper eScanerrorMapper;
41
     private EScanerrorMapper eScanerrorMapper;
42
+    @Resource
43
+    private EClassStudentMapper eClassStudentMapper;
40
 
44
 
41
     /**
45
     /**
42
      * @description: 保持扫描试卷批次信息
46
      * @description: 保持扫描试卷批次信息
169
      **/
173
      **/
170
     public Map getScanErrorDetailByErrorType(Integer epid,Integer errortype){
174
     public Map getScanErrorDetailByErrorType(Integer epid,Integer errortype){
171
         List<EScanerror> list = eScanerrorMapper.listErrorsByErrortype(epid,errortype);
175
         List<EScanerror> list = eScanerrorMapper.listErrorsByErrortype(epid,errortype);
176
+        if(errortype == 3 || errortype == 4){
177
+            //获取参加考试的学生名单
178
+            List<Map> stulist = eClassStudentMapper.listStudentsByEpid(epid);
179
+            for(EScanerror e : list){
180
+
181
+                if(N_Utils.isNotEmpty(e.getErrorjson())){
182
+                    String errorsjon = e.getErrorjson();
183
+                    PaperStudentWebVo errvo = JSON.parseObject(errorsjon,PaperStudentWebVo.class);
184
+                    String examno = errvo.getExamno();
185
+                    Map stumap = stulist.stream().filter(s -> examno.equals(s.get("examno").toString())).findFirst().orElse(null);
186
+                    if(stumap!=null){
187
+                        String studentname = stumap.get("studentname").toString();
188
+                        errvo.setStudentname(studentname);
189
+                        e.setErrorjson(JSON.toJSONString(errvo));
190
+                    }
191
+
192
+                }
193
+            }
194
+        }
195
+
172
         List<EScanerror> dcllist = list.stream().filter(s -> s.getErrorstate().equals(0)).collect(Collectors.toList());
196
         List<EScanerror> dcllist = list.stream().filter(s -> s.getErrorstate().equals(0)).collect(Collectors.toList());
173
         List<EScanerror> ycllist = list.stream().filter(s -> s.getErrorstate().equals(10)).collect(Collectors.toList());
197
         List<EScanerror> ycllist = list.stream().filter(s -> s.getErrorstate().equals(10)).collect(Collectors.toList());
174
 
198
 

+ 2
- 0
sexam/src/main/java/com/xhkjedu/sexam/vo/paperstudent/PaperStudentWebVo.java View File

36
 
36
 
37
     private Integer pagenum;//当前批次第几页
37
     private Integer pagenum;//当前批次第几页
38
     private Integer serrorid;//扫描出错id
38
     private Integer serrorid;//扫描出错id
39
+
40
+    private String studentname;//学生名称
39
 }
41
 }

+ 7
- 0
sexam/src/main/resources/mapper/exam/EClassStudentMapper.xml View File

29
         LEFT JOIN t_user u on s.studentid=u.userid
29
         LEFT JOIN t_user u on s.studentid=u.userid
30
         left join e_base e on c.examid=e.examid
30
         left join e_base e on c.examid=e.examid
31
         where c.examid=#{examid} and u.usertype=2 and u.examno like concat('%', #{examno}, '%') group by s.studentid
31
         where c.examid=#{examid} and u.usertype=2 and u.examno like concat('%', #{examno}, '%') group by s.studentid
32
+    </select>
32
 
33
 
34
+    <!--获取考试参与的学生集合-->
35
+    <select id="listStudentsByEpid" resultType="java.util.Map">
36
+        select s.studentid,u.username studentname, u.examno from e_class_student s
37
+        left join t_user u on s.studentid=u.userid
38
+        left join e_paper p on s.examid=p.examid
39
+        where p.epid=#{epid} group by s.studentid order by s.studentid
33
     </select>
40
     </select>
34
 </mapper>
41
 </mapper>

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

252
             ${epsid}
252
             ${epsid}
253
         </foreach>
253
         </foreach>
254
     </update>
254
     </update>
255
+    <!--批量更新试卷学生试卷状态-->
256
+    <update id="batchUpdatePStuState">
257
+        update e_paper_student
258
+        <trim prefix="set" suffixOverrides=",">
259
+            <trim prefix="sstate = case" suffix="end,">
260
+                <foreach collection="list" item="q">
261
+                    when epsid=#{q.epsid} then #{q.sstate}
262
+                </foreach>
263
+            </trim>
264
+        </trim>
265
+        <where>
266
+            <foreach collection="list" item="q" separator="or">
267
+                epsid=#{q.epsid}
268
+            </foreach>
269
+        </where>
270
+    </update>
255
 </mapper>
271
 </mapper>

Loading…
Cancel
Save