소스 검색

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

tags/正式版本
雍文秀 2 년 전
부모
커밋
ebe8d56a91

+ 2
- 2
sexam/src/main/java/com/xhkjedu/sexam/model/paper/EPaperQtypeQuestion.java 파일 보기

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

+ 24
- 22
sexam/src/main/java/com/xhkjedu/sexam/service/paper/EPaperQtypeService.java 파일 보기

@@ -201,7 +201,7 @@ public class EPaperQtypeService {
201 201
         //总体分析(主观题、客观题)
202 202
         List<EPaperQtypeVo> qtypelist = ePaperQtypeMapper.listPaperQtypeQuestions(ePaper.getEpid());//试卷题型试题信息
203 203
         List<EPaperQtypeQuestionVo> queslist = new ArrayList<>();//试卷中所有试题(子题)
204
-        List<EPaperQPointVo> quespoints = new ArrayList<>();//试卷中所有单题和子题以及对应知识点
204
+        List<Map> quespoints = new ArrayList<>();//试卷中所有单题和子题以及对应知识点
205 205
         List<EPaperQtypeQuestion> uplist = new ArrayList<>();//如果是客观题则获取客观题选项数量更改试卷中客观题选项数量
206 206
 
207 207
         //处理题型1单选题2多选题3主观题4判断对错5判断√×6判断TF7完形填空8阅读理解10任务型阅读11综合题12听力
@@ -211,15 +211,15 @@ public class EPaperQtypeService {
211 211
             List<Integer> qorderlist = new ArrayList<>();
212 212
             for(EPaperQtypeQuestionVo q : qt.getQuestions()){
213 213
                 //处理试题关联知识点
214
-                List<EPaperQPointVo> pointslist = q.getPoints();
214
+                List<Map> pointslist = q.getPoints();
215 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 223
                         quespoints.add(p);
224 224
                     }
225 225
                 }
@@ -326,17 +326,17 @@ public class EPaperQtypeService {
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 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 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 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 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 340
             pm.put("score",cscore);
341 341
             pm.put("srate",scorerate);
342 342
             pm.put("order",thlist);
@@ -493,10 +493,10 @@ public class EPaperQtypeService {
493 493
                        mq.setQlevel(q.getMqlevel());
494 494
                        mq.setMhashear(q.getMhashear());
495 495
                        mq.setMhearfile(q.getMhearfile());
496
-                       List<EPaperQPointVo> allpoint = new ArrayList<>();
496
+                       List<Map> allpoint = new ArrayList<>();
497 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 500
                                if(!isExistEPaperPoints(allpoint,p)){
501 501
                                    allpoint.add(p);
502 502
                                }
@@ -521,9 +521,11 @@ public class EPaperQtypeService {
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 529
                 return true;
528 530
             }
529 531
         }

+ 8
- 6
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportGenerateService.java 파일 보기

@@ -557,10 +557,10 @@ public class EReportGenerateService {
557 557
                         mq.setQanswer(q.getMqanswer());
558 558
                         mq.setQorder(q.getQorder());
559 559
                         mq.setQlevel(q.getMqlevel());
560
-                        List<EPaperQPointVo> allpoint = new ArrayList<>();
560
+                        List<Map> allpoint = new ArrayList<>();
561 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 564
                                 if(!isExistEPaperPoints(allpoint,p)){
565 565
                                     allpoint.add(p);
566 566
                                 }
@@ -584,9 +584,11 @@ public class EReportGenerateService {
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 592
                 return true;
591 593
             }
592 594
         }

+ 2
- 1
sexam/src/main/java/com/xhkjedu/sexam/vo/paper/EPaperQtypeQuestionVo.java 파일 보기

@@ -4,6 +4,7 @@ import lombok.Data;
4 4
 
5 5
 import java.util.ArrayList;
6 6
 import java.util.List;
7
+import java.util.Map;
7 8
 
8 9
 /**
9 10
  * @Description 题库试卷题型下试题集合
@@ -109,7 +110,7 @@ public class EPaperQtypeQuestionVo {
109 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 116
     private List<EPaperQtypeQuestionVo> sonques;

+ 2
- 2
sexam/src/main/resources/mapper/paper/EPaperQtypeMapper.xml 파일 보기

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

Loading…
취소
저장