Kaynağa Gözat

Merge remote-tracking branch 'origin/master' into ywx

tags/正式版本
雍文秀 2 yıl önce
ebeveyn
işleme
f2f271469b

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/controller/paperstudent/EPaperStudentController.java Dosyayı Görüntüle

@@ -60,7 +60,7 @@ public class EPaperStudentController {
60 60
     //待考界面--考试信息
61 61
     @PostMapping("/info")
62 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 64
         Map map = ePaperStudentService.getExamSubjectPaperByEpsid(eps.getEpsid());
65 65
         return new ResultVo(0, "成功获取考试信息", map);
66 66
     }

+ 24
- 3
sexam/src/main/java/com/xhkjedu/sexam/listener/MessageConsumer.java Dosyayı Görüntüle

@@ -1,9 +1,10 @@
1 1
 package com.xhkjedu.sexam.listener;
2 2
 
3 3
 import com.alibaba.fastjson.JSON;
4
+import com.xhkjedu.sexam.mapper.paper.EPaperMapper;
4 5
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentQuestionMapper;
6
+import com.xhkjedu.sexam.model.paper.EPaper;
5 7
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
6
-import com.xhkjedu.utils.N_Utils;
7 8
 import lombok.extern.slf4j.Slf4j;
8 9
 import org.springframework.amqp.core.Message;
9 10
 import org.springframework.amqp.rabbit.annotation.RabbitHandler;
@@ -23,7 +24,8 @@ public class MessageConsumer {
23 24
     @Resource
24 25
     private EPaperStudentQuestionMapper ePaperStudentQuestionMapper;
25 26
 
26
-
27
+    @Resource
28
+    private EPaperMapper ePaperMapper;
27 29
 
28 30
     /*
29 31
      * 学生答案图片合并完处理转换状态
@@ -33,7 +35,6 @@ public class MessageConsumer {
33 35
      * @author ywx
34 36
      * @date 2022/5/9 13:44
35 37
      */
36
-
37 38
     @RabbitHandler
38 39
     @RabbitListener(queues = "${rabbitmq.examImgMergeHandleQueue}")
39 40
     public void imgMergeHandleQueue(Message message) {
@@ -51,4 +52,24 @@ public class MessageConsumer {
51 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 Dosyayı Görüntüle

@@ -23,6 +23,8 @@ public class MessageSender {
23 23
 
24 24
     @Value("${rabbitmq.examImgMergeQueue}")
25 25
     private String examImgMergeQueue;
26
+    @Value("${rabbitmq.examImgToPdfQueue}")
27
+    private String examImgToPdfQueue;
26 28
 
27 29
 
28 30
     /**
@@ -39,4 +41,18 @@ public class MessageSender {
39 41
         map.put("device", device);
40 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 Dosyayı Görüntüle

@@ -55,4 +55,7 @@ public interface EPaperMapper extends TkMapper<EPaper> {
55 55
 
56 56
     //保存试卷试题数量和分值
57 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 Dosyayı Görüntüle

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

+ 2
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/paper/EPaperQtypeService.java Dosyayı Görüntüle

@@ -621,6 +621,8 @@ public class EPaperQtypeService {
621 621
         ePaperQtypeMapper.updateBatchQuestionForScan(questions);
622 622
         if(paper.getPstate() == 1){
623 623
             eSubjectMapper.updateEsubjectStateByEpid(1,paper.getEpid());
624
+
625
+
624 626
         }
625 627
     }
626 628
 }

+ 2
- 1
sexam/src/main/resources/application.properties Dosyayı Görüntüle

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

+ 7
- 2
sexam/src/main/resources/mapper/paper/EPaperMapper.xml Dosyayı Görüntüle

@@ -52,7 +52,7 @@
52 52
     <select id="getExamPaperAndSubject" resultType="java.util.Map">
53 53
         select ep.epid,ep.esid,ep.ptype,e.examname,e.examstate,s.subjectname,ep.scantronfile,ep.scantronnote,ep.scantronwh
54 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 56
         from e_paper ep left join e_base e on ep.examid=e.examid
57 57
         left join t_subject s on ep.subjectid=s.subjectid where ep.epid=#{epid}
58 58
     </select>
@@ -94,7 +94,7 @@
94 94
         ,scantronwh=#{paper.scantronwh},scantroncol=#{paper.scantroncol},cantronmiss=#{paper.cantronmiss},
95 95
         cantronbad=#{paper.cantronbad},codetype=#{paper.codetype},codenum=#{paper.codenum},
96 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 98
         where epid=#{paper.epid}
99 99
     </update>
100 100
 
@@ -112,4 +112,9 @@
112 112
         where epid=#{paper.epid}
113 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 120
 </mapper>

Loading…
İptal
Kaydet