Переглянути джерело

试题栏添加ctyp,答题卡转pdf进行名字固定

tags/正式版本
王宁 2 роки тому
джерело
коміт
165356ddc4

+ 2
- 2
sexam/src/main/java/com/xhkjedu/sexam/listener/MessageSender.java Переглянути файл

@@ -51,13 +51,13 @@ public class MessageSender {
51 51
      * @Author wn
52 52
      * @Date 2022/8/2 13:57
53 53
      **/
54
-    public void base64ToPdf(Integer epid,Integer examid, List<String> imgs,String savefolder,Integer scantroncol) {
54
+    public void base64ToPdf(Integer examid, List<String> imgs,String savefolder,Integer scantroncol,String filename) {
55 55
         Map map = new HashMap();
56
-        map.put("epid", epid);
57 56
         map.put("examid", examid);
58 57
         map.put("imgs", imgs);
59 58
         map.put("scantroncol", scantroncol);
60 59
         map.put("savefolder",savefolder);
60
+        map.put("filename",filename);
61 61
 
62 62
         rabbitTemplate.convertAndSend(examBaseToPdfQueue, JSON.toJSONString(map));
63 63
     }

+ 4
- 2
sexam/src/main/java/com/xhkjedu/sexam/service/exam/EBaseService.java Переглянути файл

@@ -228,12 +228,14 @@ public class EBaseService {
228 228
                 Integer epid = paper.getEpid();
229 229
                 //获取试卷中所有试题
230 230
                 List<EPaperQtypeQuestion> queslist = ePaperQtypeQuestionMapper.listQuestionsByEpid(epid);
231
-                for (EPaperStudent ps : studentList) {
231
+                //获取该还是卷下试题学生信息
232
+                List<EPaperStudent> paperstulist = studentList.stream().filter(s -> s.getEpid().equals(epid)).collect(Collectors.toList());
233
+                for (EPaperStudent ps : paperstulist) {
232 234
                     for(EPaperQtypeQuestion q : queslist){
233 235
                         EPaperStudentQuestion epsq = new EPaperStudentQuestion();
234 236
                         epsq.setClassid(ps.getClassid());
235 237
                         epsq.setStudentid(ps.getStudentid());
236
-                        epsq.setEpid(ps.getEpid());
238
+                        epsq.setEpid(epid);
237 239
                         epsq.setEpsid(ps.getId());
238 240
                         epsq.setEptqid(q.getEptqid());
239 241
                         epsq.setCtype(q.getCtype());

+ 2
- 1
sexam/src/main/java/com/xhkjedu/sexam/service/paper/EPaperQtypeService.java Переглянути файл

@@ -811,8 +811,9 @@ public class EPaperQtypeService {
811 811
                 Integer schoolid = Integer.parseInt(map.get("schoolid").toString());
812 812
                 String cloudcode =  map.get("cloudcode").toString();
813 813
                 String path = cloudcode + File.separator + schoolid + File.separator + "exam";
814
+                String filename = map.get("examname").toString() + "(" + map.get("subjectname").toString() + ")";
814 815
                 Integer scantroncol = Integer.parseInt(map.get("scantroncol").toString());
815
-                convertUtil.baseToPdf(epid,examid,scantronfiles,path,scantroncol);
816
+                convertUtil.baseToPdf(examid,scantronfiles,path,scantroncol,filename);
816 817
             }
817 818
         }
818 819
     }

+ 3
- 4
sexam/src/main/java/com/xhkjedu/sexam/service/paperstudent/EPaperStudentService.java Переглянути файл

@@ -443,7 +443,6 @@ public class EPaperStudentService {
443 443
         if(!N_Utils.isTrueInteger(userid)){
444 444
             updateScanErrorInfo(2,pswvo);
445 445
             return;
446
-//            throw new Exception("考号有误");
447 446
         }
448 447
         //获取学生试卷
449 448
         EPaperStudent ps = ePaperStudentMapper.getPaperStudentByStuidAndEpid(pswvo.getEpid(),userid);
@@ -452,7 +451,6 @@ public class EPaperStudentService {
452 451
         if(ps == null) {
453 452
             updateScanErrorInfo(3,pswvo);
454 453
             return;
455
-//            throw new Exception("学生试卷不存在");
456 454
         }
457 455
         pswvo.setEpsid(ps.getEpsid());
458 456
         if(pswvo.getSstate() == 3){
@@ -520,10 +518,11 @@ public class EPaperStudentService {
520 518
             if(paperStudent.getHasbad() == 1){
521 519
                 eScanbatchMapper.updateWgnum(paperStudent.getBatchid());
522 520
             }
523
-            if(checked == 0){
521
+            //以下方法是合并答题卡图片,2022-08-19改成base64后客户端合并接口不再处理
522
+            /*if(checked == 0){
524 523
                 //获取试卷中需要合并图片的试题
525 524
                 chandleStudentQuestionNoconvertedPic(pswvo.getEpsid(),2);
526
-            }
525
+            }*/
527 526
         }
528 527
     }
529 528
 

+ 2
- 2
sexam/src/main/java/com/xhkjedu/sexam/utils/ConvertUtil.java Переглянути файл

@@ -36,8 +36,8 @@ public class ConvertUtil {
36 36
      * @Author wn
37 37
      * @Date 2022/8/2 17:20
38 38
      **/
39
-    public void baseToPdf(Integer epid,Integer examid, List<String> imgs, String savefolder,Integer scantroncol) {
40
-        messageSender.base64ToPdf(epid, examid,imgs, savefolder,scantroncol);
39
+    public void baseToPdf(Integer examid, List<String> imgs, String savefolder,Integer scantroncol,String filename) {
40
+        messageSender.base64ToPdf(examid,imgs, savefolder,scantroncol,filename);
41 41
     }
42 42
 
43 43
 }

+ 2
- 1
sexam/src/main/resources/mapper/paper/EPaperMapper.xml Переглянути файл

@@ -119,9 +119,10 @@
119 119
 
120 120
     <!--获取试卷中答题卡文件-->
121 121
     <select id="getPaperScantronfile" resultType="java.util.Map">
122
-        select p.epid,p.examid,p.scantronfile,p.scantroncol,e.schoolid,
122
+        select p.epid,p.examid,p.scantronfile,p.scantroncol,e.schoolid,e.examname,s.subjectname,
123 123
         (select cloudcode from t_cloud limit 1) cloudcode
124 124
         from e_paper p left join e_base e on p.examid=e.examid
125
+        left join e_subject s on p.esid=s.esid
125 126
         where p.epid=#{epid}
126 127
     </select>
127 128
 

+ 3
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/question/UserBasketMapper.java Переглянути файл

@@ -53,4 +53,7 @@ public interface UserBasketMapper extends TkMapper<TUserBasket> {
53 53
      * @return java.lang.Integer
54 54
      */
55 55
     Integer deleteByQuestioniduid(Integer userid, String questionid);
56
+
57
+    //获取试题处理题型
58
+    Integer getCtypeByQtypeid(@Param("qtypeid")String qtypeid);
56 59
 }

+ 2
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/model/question/TUserBasket.java Переглянути файл

@@ -19,6 +19,8 @@ public class TUserBasket extends BaseBean {
19 19
     //科目id
20 20
     private String subjectid;
21 21
 
22
+    private Integer ctype;
23
+
22 24
     //题型id
23 25
     private String qtypeid;
24 26
 

+ 3
- 4
sstudy/src/main/java/com/xhkjedu/sstudy/service/question/UserBasketService.java Переглянути файл

@@ -33,6 +33,8 @@ public class UserBasketService {
33 33
     public Integer save(TUserBasket model) {
34 34
         Integer ubid = userBasketMapper.getUbidByUserIdQuestionId(model.getUserid(),model.getQuestionid());
35 35
         if (N_Utils.isEmptyInteger(ubid)) {
36
+            Integer ctype = userBasketMapper.getCtypeByQtypeid(model.getQtypeid());
37
+            model.setCtype(ctype);
36 38
             model.setCreatetime(N_Utils.getSecondTimestamp());
37 39
             userBasketMapper.insertUseGeneratedKeys(model);
38 40
             questionMapper.updateCount(model.getQuestionid());//更新组题次数
@@ -75,10 +77,6 @@ public class UserBasketService {
75 77
 
76 78
                     questions = questions.stream().filter( o -> o.getHashear() ==0).collect(Collectors.toList());
77 79
                 }
78
-                /*b.setPtnum(questions.size());
79
-                Double scoretotal = questions.stream().collect(Collectors.summingDouble(QuestionVo::getScore));
80
-                b.setPtscore(scoretotal);
81
-                b.setQuestions(questions);*/
82 80
 
83 81
                 if(questions.size() > 0){
84 82
                     UserBasketVo bn = new UserBasketVo();
@@ -97,6 +95,7 @@ public class UserBasketService {
97 95
                 UserBasketVo tlvo = new UserBasketVo();
98 96
                 tlvo.setQtypeid("tlt");
99 97
                 tlvo.setQtypename("听力题");
98
+                tlvo.setCtype(12);
100 99
                 tlvo.setPtnum(hearqs.size());
101 100
                 Double scoretotal = hearqs.stream().collect(Collectors.summingDouble(QuestionVo::getScore));
102 101
                 tlvo.setPtscore(scoretotal);

+ 2
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/vo/question/UserBasketVo.java Переглянути файл

@@ -12,6 +12,8 @@ public class UserBasketVo {
12 12
     //科目id
13 13
     private String subjectid;
14 14
 
15
+    private Integer ctype;
16
+
15 17
     //题型id
16 18
     private String qtypeid;
17 19
 

+ 6
- 0
sstudy/src/main/resources/mapper/question/UserBasketMapper.xml Переглянути файл

@@ -4,6 +4,7 @@
4 4
     <resultMap id="basketResult" type="com.xhkjedu.sstudy.vo.question.UserBasketVo">
5 5
         <result property="userid" column="userid"></result>
6 6
         <result property="subjectid" column="subjectid"></result>
7
+        <result property="ctype" column="ctype"></result>
7 8
         <result property="qtypeid" column="qtypeid"></result>
8 9
         <result property="qtypename" column="qtypename"></result>
9 10
         <collection property="questions" ofType="com.xhkjedu.sstudy.vo.question.QuestionVo">
@@ -87,4 +88,9 @@
87 88
     <delete id="deleteByQuestioniduid">
88 89
         delete from t_user_basket where userid=#{userid} and questionid=#{questionid}
89 90
     </delete>
91
+
92
+    <!--获取试题处理题型-->
93
+    <select id="getCtypeByQtypeid" resultType="java.lang.Integer">
94
+        select ctype FROM t_subject_questiontype where qtypeid=#{qtypeid}
95
+    </select>
90 96
 </mapper>

Завантаження…
Відмінити
Зберегти