Browse Source

答题卡字段

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

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

60
     //待考界面--考试信息
60
     //待考界面--考试信息
61
     @PostMapping("/info")
61
     @PostMapping("/info")
62
     public ResultVo getExamSubjectPaper(@RequestBody EPaperStudent eps) {
62
     public ResultVo getExamSubjectPaper(@RequestBody EPaperStudent eps) {
63
-        N_Utils.validation(new Object[]{eps.getEpsid(), "学生id", 1});
63
+        N_Utils.validation(new Object[]{eps.getEpsid(), "考试学生id", 1});
64
         Map map = ePaperStudentService.getExamSubjectPaperByEpsid(eps.getEpsid());
64
         Map map = ePaperStudentService.getExamSubjectPaperByEpsid(eps.getEpsid());
65
         return new ResultVo(0, "成功获取考试信息", map);
65
         return new ResultVo(0, "成功获取考试信息", map);
66
     }
66
     }

+ 24
- 3
sexam/src/main/java/com/xhkjedu/sexam/listener/MessageConsumer.java View File

1
 package com.xhkjedu.sexam.listener;
1
 package com.xhkjedu.sexam.listener;
2
 
2
 
3
 import com.alibaba.fastjson.JSON;
3
 import com.alibaba.fastjson.JSON;
4
+import com.xhkjedu.sexam.mapper.paper.EPaperMapper;
4
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentQuestionMapper;
5
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentQuestionMapper;
6
+import com.xhkjedu.sexam.model.paper.EPaper;
5
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
7
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
6
-import com.xhkjedu.utils.N_Utils;
7
 import lombok.extern.slf4j.Slf4j;
8
 import lombok.extern.slf4j.Slf4j;
8
 import org.springframework.amqp.core.Message;
9
 import org.springframework.amqp.core.Message;
9
 import org.springframework.amqp.rabbit.annotation.RabbitHandler;
10
 import org.springframework.amqp.rabbit.annotation.RabbitHandler;
23
     @Resource
24
     @Resource
24
     private EPaperStudentQuestionMapper ePaperStudentQuestionMapper;
25
     private EPaperStudentQuestionMapper ePaperStudentQuestionMapper;
25
 
26
 
26
-
27
+    @Resource
28
+    private EPaperMapper ePaperMapper;
27
 
29
 
28
     /*
30
     /*
29
      * 学生答案图片合并完处理转换状态
31
      * 学生答案图片合并完处理转换状态
33
      * @author ywx
35
      * @author ywx
34
      * @date 2022/5/9 13:44
36
      * @date 2022/5/9 13:44
35
      */
37
      */
36
-
37
     @RabbitHandler
38
     @RabbitHandler
38
     @RabbitListener(queues = "${rabbitmq.examImgMergeHandleQueue}")
39
     @RabbitListener(queues = "${rabbitmq.examImgMergeHandleQueue}")
39
     public void imgMergeHandleQueue(Message message) {
40
     public void imgMergeHandleQueue(Message message) {
51
             log.error("学生试题答案合并失败:" + e.getMessage());
52
             log.error("学生试题答案合并失败:" + e.getMessage());
52
         }
53
         }
53
     }
54
     }
55
+
56
+    /**
57
+     * @Description 修改试卷答题卡pdf
58
+     * @Param [message]
59
+     * @Return void
60
+     * @Author wn
61
+     * @Date 2022/8/2 14:00
62
+     **/
63
+    @RabbitHandler
64
+    @RabbitListener(queues = "${rabbitmq.examImgToPdfHandleQueue}")
65
+    public void imgToPdfHandleQueue(Message message) {
66
+        try {
67
+            String msg = new String(message.getBody(), "UTF-8");
68
+            System.out.println(LocalDateTime.now() + "答题卡图片合并接收消息内容:" + msg);
69
+            EPaper paper = JSON.parseObject(msg, EPaper.class);
70
+            ePaperMapper.updatePaperScantronpdf(paper);
71
+        } catch (Exception e) {
72
+            log.error("答题卡图片合并失败:" + e.getMessage());
73
+        }
74
+    }
54
 }
75
 }

+ 16
- 0
sexam/src/main/java/com/xhkjedu/sexam/listener/MessageSender.java View File

23
 
23
 
24
     @Value("${rabbitmq.examImgMergeQueue}")
24
     @Value("${rabbitmq.examImgMergeQueue}")
25
     private String examImgMergeQueue;
25
     private String examImgMergeQueue;
26
+    @Value("${rabbitmq.examImgToPdfQueue}")
27
+    private String examImgToPdfQueue;
26
 
28
 
27
 
29
 
28
     /**
30
     /**
39
         map.put("device", device);
41
         map.put("device", device);
40
         rabbitTemplate.convertAndSend(examImgMergeQueue, JSON.toJSONString(map));
42
         rabbitTemplate.convertAndSend(examImgMergeQueue, JSON.toJSONString(map));
41
     }
43
     }
44
+
45
+    /**
46
+     * @Description 答题卡图片合并为pdf
47
+     * @Param [epid, imgs]
48
+     * @Return void
49
+     * @Author wn
50
+     * @Date 2022/8/2 13:57
51
+     **/
52
+    public void imgToPdf(Integer epid, List<String> imgs) {
53
+        Map map = new HashMap();
54
+        map.put("epid", epid);
55
+        map.put("imgs", imgs);
56
+        rabbitTemplate.convertAndSend(examImgToPdfQueue, JSON.toJSONString(map));
57
+    }
42
 }
58
 }

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/paper/EPaperMapper.java View File

55
 
55
 
56
     //保存试卷试题数量和分值
56
     //保存试卷试题数量和分值
57
     void updatePaperInfo(@Param("paper") EPaper paper);
57
     void updatePaperInfo(@Param("paper") EPaper paper);
58
+
59
+    //保存答题卡pdf
60
+    void updatePaperScantronpdf(@Param("paper") EPaper paper);
58
 }
61
 }

+ 3
- 1
sexam/src/main/java/com/xhkjedu/sexam/model/paper/EPaper.java View File

49
     //答题卡文件
49
     //答题卡文件
50
     private String scantronfile;
50
     private String scantronfile;
51
 
51
 
52
+    private String scantronpdf;//答题卡pdf
53
+
52
     //答题卡注意事项
54
     //答题卡注意事项
53
     private String scantronnote;
55
     private String scantronnote;
54
 
56
 
67
     //违规标记坐标3自定义考号
69
     //违规标记坐标3自定义考号
68
     private String cantronbad;
70
     private String cantronbad;
69
 
71
 
70
-    //考号类型1条形码2涂卡
72
+    //考号类型1条形码2准考证号(固定8位)3自定义考号
71
     private Integer codetype;
73
     private Integer codetype;
72
 
74
 
73
     //自定义考号列数
75
     //自定义考号列数

+ 2
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/paper/EPaperQtypeService.java View File

621
         ePaperQtypeMapper.updateBatchQuestionForScan(questions);
621
         ePaperQtypeMapper.updateBatchQuestionForScan(questions);
622
         if(paper.getPstate() == 1){
622
         if(paper.getPstate() == 1){
623
             eSubjectMapper.updateEsubjectStateByEpid(1,paper.getEpid());
623
             eSubjectMapper.updateEsubjectStateByEpid(1,paper.getEpid());
624
+
625
+
624
         }
626
         }
625
     }
627
     }
626
 }
628
 }

+ 2
- 1
sexam/src/main/resources/application.properties View File

54
 
54
 
55
 rabbitmq.examImgMergeQueue=xhkjedu.xhschool.examImgMergeQueue_dev
55
 rabbitmq.examImgMergeQueue=xhkjedu.xhschool.examImgMergeQueue_dev
56
 rabbitmq.examImgMergeHandleQueue=xhkjedu.xhschool.examImgMergeHandleQueue_dev
56
 rabbitmq.examImgMergeHandleQueue=xhkjedu.xhschool.examImgMergeHandleQueue_dev
57
-
57
+rabbitmq.examImgToPdfQueue=xhkjedu.xhschool.examImgToPdfQueue_dev
58
+rabbitmq.examImgToPdfHandleQueue=xhkjedu.xhschool.examImgToPdfHandleQueue_dev
58
 spring.rabbitmq.host=116.63.199.166
59
 spring.rabbitmq.host=116.63.199.166
59
 spring.rabbitmq.port=5672
60
 spring.rabbitmq.port=5672
60
 spring.rabbitmq.username=xhkjedu
61
 spring.rabbitmq.username=xhkjedu

+ 7
- 2
sexam/src/main/resources/mapper/paper/EPaperMapper.xml View File

52
     <select id="getExamPaperAndSubject" resultType="java.util.Map">
52
     <select id="getExamPaperAndSubject" resultType="java.util.Map">
53
         select ep.epid,ep.esid,ep.ptype,e.examname,e.examstate,s.subjectname,ep.scantronfile,ep.scantronnote,ep.scantronwh
53
         select ep.epid,ep.esid,ep.ptype,e.examname,e.examstate,s.subjectname,ep.scantronfile,ep.scantronnote,ep.scantronwh
54
         ,ep.scantroncol,ep.cantronmiss,ep.cantronbad,ep.codetype,ep.cantroncode,ep.pnum,ep.pscore,ep.cantronbarcode,
54
         ,ep.scantroncol,ep.cantronmiss,ep.cantronbad,ep.codetype,ep.cantroncode,ep.pnum,ep.pscore,ep.cantronbarcode,
55
-               ep.cantronqrcode,ep.cantronpage,ep.cantronloc,ep.scantronspace,ep.codenum
55
+               ep.cantronqrcode,ep.cantronpage,ep.cantronloc,ep.scantronspace,ep.codenum,ep.scantronpdf
56
         from e_paper ep left join e_base e on ep.examid=e.examid
56
         from e_paper ep left join e_base e on ep.examid=e.examid
57
         left join t_subject s on ep.subjectid=s.subjectid where ep.epid=#{epid}
57
         left join t_subject s on ep.subjectid=s.subjectid where ep.epid=#{epid}
58
     </select>
58
     </select>
94
         ,scantronwh=#{paper.scantronwh},scantroncol=#{paper.scantroncol},cantronmiss=#{paper.cantronmiss},
94
         ,scantronwh=#{paper.scantronwh},scantroncol=#{paper.scantroncol},cantronmiss=#{paper.cantronmiss},
95
         cantronbad=#{paper.cantronbad},codetype=#{paper.codetype},codenum=#{paper.codenum},
95
         cantronbad=#{paper.cantronbad},codetype=#{paper.codetype},codenum=#{paper.codenum},
96
         cantroncode=#{paper.cantroncode},cantronpage=#{paper.cantronpage},cantronbarcode=#{paper.cantronbarcode},
96
         cantroncode=#{paper.cantroncode},cantronpage=#{paper.cantronpage},cantronbarcode=#{paper.cantronbarcode},
97
-        cantronqrcode=#{paper.cantronqrcode},cantronloc=#{paper.cantronloc}
97
+        cantronqrcode=#{paper.cantronqrcode},cantronloc=#{paper.cantronloc},scantronspace=#{paper.scantronspace}
98
         where epid=#{paper.epid}
98
         where epid=#{paper.epid}
99
     </update>
99
     </update>
100
 
100
 
112
         where epid=#{paper.epid}
112
         where epid=#{paper.epid}
113
     </update>
113
     </update>
114
 
114
 
115
+    <!--保存答题卡pdf-->
116
+    <update id="updatePaperScantronpdf">
117
+        update e_paper set scantronpdf=#{paper.scantronpdf} where epid=#{paper.epid}
118
+    </update>
119
+
115
 </mapper>
120
 </mapper>

Loading…
Cancel
Save