Browse Source

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

tags/正式版本
雍文秀 2 years ago
parent
commit
ebe8d56a91

+ 2
- 2
sexam/src/main/java/com/xhkjedu/sexam/model/paper/EPaperQtypeQuestion.java View File

1
 package com.xhkjedu.sexam.model.paper;
1
 package com.xhkjedu.sexam.model.paper;
2
 
2
 
3
 import com.xhkjedu.sexam.model.BaseBean;
3
 import com.xhkjedu.sexam.model.BaseBean;
4
-import com.xhkjedu.sexam.vo.paper.EPaperQPointVo;
5
 import lombok.Data;
4
 import lombok.Data;
6
 
5
 
7
 import javax.persistence.Id;
6
 import javax.persistence.Id;
9
 import javax.persistence.Transient;
8
 import javax.persistence.Transient;
10
 import java.util.ArrayList;
9
 import java.util.ArrayList;
11
 import java.util.List;
10
 import java.util.List;
11
+import java.util.Map;
12
 
12
 
13
 @Table(name = "e_paper_qtype_question")
13
 @Table(name = "e_paper_qtype_question")
14
 @Data
14
 @Data
68
 
68
 
69
     //试题关联知识点
69
     //试题关联知识点
70
     @Transient
70
     @Transient
71
-    private List<EPaperQPointVo> points = new ArrayList<>();
71
+    private List<Map> points = new ArrayList<>();
72
 
72
 
73
     //坐标集合
73
     //坐标集合
74
     @Transient
74
     @Transient

+ 24
- 22
sexam/src/main/java/com/xhkjedu/sexam/service/paper/EPaperQtypeService.java View File

201
         //总体分析(主观题、客观题)
201
         //总体分析(主观题、客观题)
202
         List<EPaperQtypeVo> qtypelist = ePaperQtypeMapper.listPaperQtypeQuestions(ePaper.getEpid());//试卷题型试题信息
202
         List<EPaperQtypeVo> qtypelist = ePaperQtypeMapper.listPaperQtypeQuestions(ePaper.getEpid());//试卷题型试题信息
203
         List<EPaperQtypeQuestionVo> queslist = new ArrayList<>();//试卷中所有试题(子题)
203
         List<EPaperQtypeQuestionVo> queslist = new ArrayList<>();//试卷中所有试题(子题)
204
-        List<EPaperQPointVo> quespoints = new ArrayList<>();//试卷中所有单题和子题以及对应知识点
204
+        List<Map> quespoints = new ArrayList<>();//试卷中所有单题和子题以及对应知识点
205
         List<EPaperQtypeQuestion> uplist = new ArrayList<>();//如果是客观题则获取客观题选项数量更改试卷中客观题选项数量
205
         List<EPaperQtypeQuestion> uplist = new ArrayList<>();//如果是客观题则获取客观题选项数量更改试卷中客观题选项数量
206
 
206
 
207
         //处理题型1单选题2多选题3主观题4判断对错5判断√×6判断TF7完形填空8阅读理解10任务型阅读11综合题12听力
207
         //处理题型1单选题2多选题3主观题4判断对错5判断√×6判断TF7完形填空8阅读理解10任务型阅读11综合题12听力
211
             List<Integer> qorderlist = new ArrayList<>();
211
             List<Integer> qorderlist = new ArrayList<>();
212
             for(EPaperQtypeQuestionVo q : qt.getQuestions()){
212
             for(EPaperQtypeQuestionVo q : qt.getQuestions()){
213
                 //处理试题关联知识点
213
                 //处理试题关联知识点
214
-                List<EPaperQPointVo> pointslist = q.getPoints();
214
+                List<Map> pointslist = q.getPoints();
215
                 if(pointslist != null && pointslist.size()>0){
215
                 if(pointslist != null && pointslist.size()>0){
216
-                    for(EPaperQPointVo point : pointslist){
217
-                        EPaperQPointVo p = new EPaperQPointVo();
218
-                        p.setPointid(point.getPointid());
219
-                        p.setPointname(point.getPointname());
220
-                        p.setQuestionid(q.getQuestionid());
221
-                        p.setQorder(q.getQorder());
222
-                        p.setScore(q.getScore());
216
+                    for(Map point : pointslist){
217
+                        Map p = new HashMap();
218
+                        p.put("pointid",point.get("pointid").toString());
219
+                        p.put("pointname",point.get("pointname").toString());
220
+                        p.put("eptqid",q.getEptqid());
221
+                        p.put("order",q.getQorder());
222
+                        p.put("score",q.getScore());
223
                         quespoints.add(p);
223
                         quespoints.add(p);
224
                     }
224
                     }
225
                 }
225
                 }
326
         }
326
         }
327
 
327
 
328
         //知识点
328
         //知识点
329
-        Map<String,List<EPaperQPointVo>> pointmap =  quespoints.stream().collect(Collectors.groupingBy(EPaperQPointVo:: getPointid, Collectors.toList()));
329
+        Map<String,List<Map>> pointmap =  quespoints.stream().collect(Collectors.groupingBy(item -> item.get("pointid").toString(), Collectors.toList()));
330
         List<Map> pointlist = new ArrayList<>();
330
         List<Map> pointlist = new ArrayList<>();
331
-        for(Map.Entry<String, List<EPaperQPointVo>> entry : pointmap.entrySet()){
331
+        for(Map.Entry<String, List<Map>> entry : pointmap.entrySet()){
332
             Map pm = new HashMap();
332
             Map pm = new HashMap();
333
-            List<EPaperQPointVo> pvo = entry.getValue();
334
-            double cscore = pvo.stream().collect(Collectors.summingDouble(EPaperQPointVo:: getScore));
333
+            List<Map> pvo = entry.getValue();
334
+            double cscore = pvo.stream().collect(Collectors.summingDouble(item -> Double.valueOf(item.get("score").toString())));
335
             double scorerate = N_Utils.getDoubleDivideAndMulitiply(cscore, ePaper.getPscore());
335
             double scorerate = N_Utils.getDoubleDivideAndMulitiply(cscore, ePaper.getPscore());
336
-            List<Integer> thlist = pvo.stream().map(EPaperQPointVo :: getQorder).collect(Collectors.toList());
336
+            List<Integer> thlist = pvo.stream().map(item -> Integer.parseInt(item.get("order").toString())).collect(Collectors.toList());
337
             thlist = thlist.stream().distinct().collect(Collectors.toList());
337
             thlist = thlist.stream().distinct().collect(Collectors.toList());
338
-            pm.put("pointid",pvo.get(0).getPointid());
339
-            pm.put("pointname",pvo.get(0).getPointname());
338
+            pm.put("pointid",pvo.get(0).get("pointid").toString());
339
+            pm.put("pointname",pvo.get(0).get("pointname").toString());
340
             pm.put("score",cscore);
340
             pm.put("score",cscore);
341
             pm.put("srate",scorerate);
341
             pm.put("srate",scorerate);
342
             pm.put("order",thlist);
342
             pm.put("order",thlist);
493
                        mq.setQlevel(q.getMqlevel());
493
                        mq.setQlevel(q.getMqlevel());
494
                        mq.setMhashear(q.getMhashear());
494
                        mq.setMhashear(q.getMhashear());
495
                        mq.setMhearfile(q.getMhearfile());
495
                        mq.setMhearfile(q.getMhearfile());
496
-                       List<EPaperQPointVo> allpoint = new ArrayList<>();
496
+                       List<Map> allpoint = new ArrayList<>();
497
                        for(EPaperQtypeQuestionVo sq : sonqlist){
497
                        for(EPaperQtypeQuestionVo sq : sonqlist){
498
-                           List<EPaperQPointVo> sqpoints = sq.getPoints();
499
-                           for(EPaperQPointVo p : sqpoints){
498
+                           List<Map> sqpoints = sq.getPoints();
499
+                           for(Map p : sqpoints){
500
                                if(!isExistEPaperPoints(allpoint,p)){
500
                                if(!isExistEPaperPoints(allpoint,p)){
501
                                    allpoint.add(p);
501
                                    allpoint.add(p);
502
                                }
502
                                }
521
 
521
 
522
     }
522
     }
523
 
523
 
524
-    private boolean isExistEPaperPoints(List<EPaperQPointVo> allpoint,EPaperQPointVo p){
525
-        for(EPaperQPointVo pvo : allpoint){
526
-            if(p.getPointid().equals(pvo.getPointid())){
524
+    private boolean isExistEPaperPoints(List<Map> allpoint,Map p){
525
+        String ppointid = p.get("pointid").toString();
526
+        for(Map pvo : allpoint){
527
+            String pvopointid = pvo.get("pointid").toString();
528
+            if(ppointid.equals(pvopointid)){
527
                 return true;
529
                 return true;
528
             }
530
             }
529
         }
531
         }

+ 8
- 6
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportGenerateService.java View File

557
                         mq.setQanswer(q.getMqanswer());
557
                         mq.setQanswer(q.getMqanswer());
558
                         mq.setQorder(q.getQorder());
558
                         mq.setQorder(q.getQorder());
559
                         mq.setQlevel(q.getMqlevel());
559
                         mq.setQlevel(q.getMqlevel());
560
-                        List<EPaperQPointVo> allpoint = new ArrayList<>();
560
+                        List<Map> allpoint = new ArrayList<>();
561
                         for(EPaperQtypeQuestionVo sq : sonqlist){
561
                         for(EPaperQtypeQuestionVo sq : sonqlist){
562
-                            List<EPaperQPointVo> sqpoints = sq.getPoints();
563
-                            for(EPaperQPointVo p : sqpoints){
562
+                            List<Map> sqpoints = sq.getPoints();
563
+                            for(Map p : sqpoints){
564
                                 if(!isExistEPaperPoints(allpoint,p)){
564
                                 if(!isExistEPaperPoints(allpoint,p)){
565
                                     allpoint.add(p);
565
                                     allpoint.add(p);
566
                                 }
566
                                 }
584
         }
584
         }
585
 
585
 
586
     }
586
     }
587
-    private boolean isExistEPaperPoints(List<EPaperQPointVo> allpoint,EPaperQPointVo p){
588
-        for(EPaperQPointVo pvo : allpoint){
589
-            if(p.getPointid().equals(pvo.getPointid())){
587
+    private boolean isExistEPaperPoints(List<Map> allpoint,Map p){
588
+        String ppointid = p.get("pointid").toString();
589
+        for(Map pvo : allpoint){
590
+            String pvopointid = pvo.get("pointid").toString();
591
+            if(ppointid.equals(pvopointid)){
590
                 return true;
592
                 return true;
591
             }
593
             }
592
         }
594
         }

+ 2
- 1
sexam/src/main/java/com/xhkjedu/sexam/vo/paper/EPaperQtypeQuestionVo.java View File

4
 
4
 
5
 import java.util.ArrayList;
5
 import java.util.ArrayList;
6
 import java.util.List;
6
 import java.util.List;
7
+import java.util.Map;
7
 
8
 
8
 /**
9
 /**
9
  * @Description 题库试卷题型下试题集合
10
  * @Description 题库试卷题型下试题集合
109
     private String mhearfile;
110
     private String mhearfile;
110
 
111
 
111
     //试题关联知识点
112
     //试题关联知识点
112
-    private List<EPaperQPointVo> points = new ArrayList<>();
113
+    private List<Map> points = new ArrayList<>();
113
 
114
 
114
     //子题集合
115
     //子题集合
115
     private List<EPaperQtypeQuestionVo> sonques;
116
     private List<EPaperQtypeQuestionVo> sonques;

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

43
             <result column="mqlevel" property="mqlevel"></result>
43
             <result column="mqlevel" property="mqlevel"></result>
44
             <result column="mhashear" property="mhashear"></result>
44
             <result column="mhashear" property="mhashear"></result>
45
             <result column="mhearfile" property="mhearfile"></result>
45
             <result column="mhearfile" property="mhearfile"></result>
46
-            <collection property="points" ofType="com.xhkjedu.sexam.vo.paper.EPaperQPointVo" javaType="java.util.List"
46
+            <collection property="points" ofType="java.util.Map" javaType="java.util.List"
47
                         column="{questionid=questionid,qlevel=qlevel,questionpid=questionpid" select="listQuestionPoints">
47
                         column="{questionid=questionid,qlevel=qlevel,questionpid=questionpid" select="listQuestionPoints">
48
                 <result column="pointid" property="pointid"></result>
48
                 <result column="pointid" property="pointid"></result>
49
                 <result column="pointname" property="pointname"></result>
49
                 <result column="pointname" property="pointname"></result>
63
         where t.epid=#{epid} order by t.eptorder,tq.qorder,q.sorder
63
         where t.epid=#{epid} order by t.eptorder,tq.qorder,q.sorder
64
     </select>
64
     </select>
65
     <!--试题关联知识点-->
65
     <!--试题关联知识点-->
66
-    <select id="listQuestionPoints" resultType="com.xhkjedu.sexam.vo.paper.EPaperQPointVo">
66
+    <select id="listQuestionPoints" resultType="java.util.Map">
67
         select qp.pointid,p.pointname from t_question_point qp
67
         select qp.pointid,p.pointname from t_question_point qp
68
         left join t_point p on qp.pointid=p.pointid
68
         left join t_point p on qp.pointid=p.pointid
69
         where
69
         where

Loading…
Cancel
Save