Explorar el Código

扫码答题卡获取信息

tags/正式版本
王宁 hace 2 años
padre
commit
11229b3153

+ 0
- 1
sexam/src/main/java/com/xhkjedu/sexam/controller/paperstudent/EScanbatchController.java Ver fichero

@@ -33,7 +33,6 @@ public class EScanbatchController {
33 33
         return new ResultVo(0, "成功保存", map);
34 34
     }
35 35
 
36
-
37 36
     /**
38 37
      * 扫描答题卡列表
39 38
      *

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/model/paperstudent/EScanbatch.java Ver fichero

@@ -30,7 +30,7 @@ public class EScanbatch extends BaseBean {
30 30
     //批次应扫张数
31 31
     private Integer batchnum;
32 32
 
33
-    //扫描数量
33
+    //扫描数量(包含成和失败:只要调用保存的方法就加1)
34 34
     private Integer scannum;
35 35
 
36 36
     //扫描出错数量

+ 8
- 2
sexam/src/main/java/com/xhkjedu/sexam/service/paperstudent/EPaperStudentService.java Ver fichero

@@ -422,6 +422,10 @@ public class EPaperStudentService {
422 422
      **/
423 423
     @Transactional(rollbackFor = Exception.class)
424 424
     public void saveCommitPaperForScantron(PaperStudentWebVo pswvo) throws Exception{
425
+
426
+        //扫描一次扫描数量+1
427
+        eScanbatchMapper.updateScannum(pswvo.getBatchid());
428
+
425 429
         if(N_Utils.isEmptyInteger(pswvo.getEpid()) || N_Utils.isEmpty(pswvo.getExamno())){
426 430
             updateScanErrorInfo(4,pswvo);
427 431
             return;
@@ -504,8 +508,7 @@ public class EPaperStudentService {
504 508
 
505 509
             ePaperStudentQuestionMapper.updateBatchStuQuestion(sqlist);
506 510
             ePaperStudentMapper.updateStudentPaper(paperStudent);
507
-            //扫描完成更改批次数量
508
-            eScanbatchMapper.updateScannum(paperStudent.getBatchid());
511
+
509 512
             //更改违规数量
510 513
             if(paperStudent.getHasbad() == 1){
511 514
                 eScanbatchMapper.updateWgnum(paperStudent.getBatchid());
@@ -537,7 +540,10 @@ public class EPaperStudentService {
537 540
      * @author: wn
538 541
      * @date:
539 542
      **/
543
+    @Transactional(rollbackFor = Exception.class)
540 544
     public void saveScanPaperError(EScanerror eScanerror){
545
+        //扫描一次扫描数量+1
546
+        eScanbatchMapper.updateScannum(eScanerror.getBatchid());
541 547
         eScanerror.setErrortype(1);
542 548
         eScanerror.setCreatetime(N_Utils.getSecondTimestamp());
543 549
         eScanerrorMapper.insertUseGeneratedKeys(eScanerror);

+ 10
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/paperstudent/EScanbatchService.java Ver fichero

@@ -83,6 +83,16 @@ public class EScanbatchService {
83 83
      **/
84 84
     public Map scanPaperDetail(Integer epid) {
85 85
         Map paper = ePaperMapper.getExamPaperSubjectForScan(epid);
86
+        int ysznum = 0;
87
+        Integer ysrnum = Integer.parseInt(paper.get("ysrnum").toString());
88
+        if(paper.get("scantronfile")!=null){
89
+            String scantronfile = paper.get("scantronfile").toString();
90
+            List<String> sflist = JSON.parseArray(scantronfile,String.class);
91
+            int pn = sflist.size() / 2;//答题卡的张数
92
+            ysznum = ysrnum * pn;//应扫码张数
93
+        }
94
+        paper.put("ysznum",ysznum);
95
+
86 96
         String alljson = paper.get("alljson").toString();
87 97
         Map pamap = JSON.parseObject(alljson,Map.class);
88 98
         List<Map> ranglist = (List<Map>) pamap.get("ranglist");

+ 2
- 2
sexam/src/main/resources/mapper/paper/EPaperMapper.xml Ver fichero

@@ -127,8 +127,8 @@
127 127
 
128 128
     <!--根据试卷id获取考试科目信息-->
129 129
     <select id="getExamPaperSubjectForScan" resultType="java.util.Map">
130
-        select e.examname,e.gradeid,s.subjectname,p.pnum,p.ptype,a.alljson,
131
-               (select count(*) from e_paper_student ps where ps.epid=p.epid) ysnum
130
+        select e.examname,e.gradeid,s.subjectname,p.pnum,p.ptype,a.alljson,p.scantronfile,
131
+               (select count(*) from e_paper_student ps where ps.epid=p.epid) ysrnum
132 132
         from e_paper p left join e_subject s on p.esid=s.esid
133 133
         left join e_base e on s.examid=e.examid left join e_paper_analyze a on p.epid=a.epid
134 134
         where p.epid=#{epid} limit 1

+ 1
- 2
sexam/src/main/resources/mapper/paperstudent/EScanbatchMapper.xml Ver fichero

@@ -9,8 +9,7 @@
9 9
 
10 10
     <!--更改扫描数量-->
11 11
     <update id="updateScannum">
12
-        update e_scanbatch set scannum=(select count(*) from e_paper_student ps where ps.sstate=2 and ps.batchid=#{batchid})
13
-        where batchid=#{batchid}
12
+        update e_scanbatch set scannum=scannum+1 where batchid=#{batchid}
14 13
     </update>
15 14
     <!--更改缺考数量-->
16 15
     <update id="updateQknum">

Loading…
Cancelar
Guardar