Преглед на файлове

班级报告题库试卷概况

tags/正式版本
雍文秀 преди 2 години
родител
ревизия
1f42472a20

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/reportclass/EReportClassMapper.java Целия файл

@@ -34,4 +34,7 @@ public interface EReportClassMapper {
34 34
 
35 35
     //学生试卷基础信息
36 36
     Map getStuPaperInfo(@Param("rank") ERankParamVo rank);
37
+
38
+    //题库试题
39
+    List<Map> listTkQuestion(@Param("epid") Integer epid);
37 40
 }

+ 56
- 5
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportClassService.java Целия файл

@@ -139,15 +139,25 @@ public class EReportClassService {
139 139
                 String pointname = p.get("pointname").toString();
140 140
                 List<Map> qlist = JSON.parseArray(ques, Map.class);
141 141
                 for (Map q : qlist) {
142
-                    List<Integer> eptqids = JSON.parseArray(q.get("eptqids").toString(), Integer.class);
143
-                    if (N_Utils.numInList(eptqid, eptqids)) {
144
-                        pointnames.add(pointname);
145
-                        break;
142
+                    if (N_Utils.isEmptyInteger(eptqid)) {
143
+                        String qn = ct.get("qn").toString();
144
+                        String[] qnList = qn.split(",");
145
+                        List<String> qns = JSON.parseArray(q.get("qns").toString(), String.class);
146
+                        for (String num : qnList) {
147
+                            if (qns.contains(num)) {
148
+                                pointnames.add(pointname);
149
+                            }
150
+                        }
151
+                    } else {
152
+                        List<Integer> eptqids = JSON.parseArray(q.get("eptqids").toString(), Integer.class);
153
+                        if (N_Utils.numInList(eptqid, eptqids)) {
154
+                            pointnames.add(pointname);
155
+                        }
146 156
                     }
147 157
                 }
148 158
             }
149 159
         }
150
-        ct.put("pointnames", pointnames);
160
+        ct.put("pointnames", pointnames.stream().distinct().collect(Collectors.toList()));
151 161
     }
152 162
 
153 163
     //单科概况-需关注学生
@@ -161,8 +171,49 @@ public class EReportClassService {
161 171
         Integer ptype = (Integer) paper.get("ptype");
162 172
         if (ptype == 1) {
163 173
             List<Map> list = eReportClassMapper.listTkSjGk(rank);
174
+            List<Map> questions = eReportClassMapper.listTkQuestion((Integer) paper.get("epid"));
175
+            Object pointjson = paper.get("pointjson");
164 176
             for (Map q : list) {
177
+                q.put("pointjson", pointjson);
165 178
                 setQuestionPoint(q);//试题知识点
179
+                Object questionid = q.get("questionid");
180
+                Map qmap;
181
+                if (N_Utils.isEmpty(q.get("eptqid"))) {
182
+                    qmap = questions.stream().filter(tq -> questionid.equals(tq.get("mquestionid"))).findFirst().orElse(null);
183
+                    q.put("ctype", qmap.get("mctype"));
184
+                    q.put("qtypename", qmap.get("mqtypename"));
185
+                    q.put("qstem", qmap.get("mqstem"));
186
+                    q.put("qanalyze", qmap.get("mqanalyze"));
187
+                    q.put("hashear", qmap.get("mhashear"));
188
+                    q.put("hearfile", qmap.get("mhearfile"));
189
+                    List<Map> sonques = questions.stream().filter(tq -> questionid.equals(tq.get("questionpid")))
190
+                            .collect(Collectors.toList());
191
+                    sonques.forEach(sq -> {
192
+                        sq.remove("mctype");
193
+                        sq.remove("mqtypename");
194
+                        sq.remove("mqstem");
195
+                        sq.remove("mqanalyze");
196
+                        sq.remove("mhashear");
197
+                        sq.remove("mhearfile");
198
+                        sq.remove("hashear");
199
+                        sq.remove("hearfile");
200
+                    });
201
+                    q.put("sonques", sonques);
202
+                } else {
203
+                    qmap = questions.stream().filter(tq -> questionid.equals(tq.get("questionid")))
204
+                            .findFirst().orElse(null);
205
+                    q.put("ctype", qmap.get("ctype"));
206
+                    q.put("score", qmap.get("score"));
207
+                    q.put("answer", qmap.get("answer"));
208
+                    q.put("qtypename", qmap.get("qtypename"));
209
+                    q.put("qstem", qmap.get("qstem"));
210
+                    q.put("qoption", qmap.get("qoption"));
211
+                    q.put("qanalyze", qmap.get("qanalyze"));
212
+                    q.put("hashear", qmap.get("hashear"));
213
+                    q.put("hearfile", qmap.get("hearfile"));
214
+                    q.put("qn", qmap.get("qn"));
215
+                    q.put("qorder", qmap.get("qorder"));
216
+                }
166 217
             }
167 218
             return list;
168 219
         } else {

+ 2
- 2
sexam/src/main/resources/mapper/report/ERclassMapper.xml Целия файл

@@ -68,9 +68,9 @@
68 68
     <select id="listGpCt" resultType="java.util.Map">
69 69
         select erq.eptqid,erq.qn,erq.classsrate,erq.gradesrate,erq.answerjson
70 70
         ,epq.eptname,epqq.ctype,epqq.answer,epa.pointjson
71
-        from e_rclass_question erq left join e_paper_qtype_question epqq on erq.eptqid = epqq.eptqid
71
+        from e_rclass_question erq left join e_paper_qtype_question epqq on erq.epid = epqq.epid and erq.qorder=epqq.qorder
72 72
         left join e_paper_qtype epq on epqq.eptid = epq.eptid
73
-        left join e_paper_analyze epa on epq.epid = epa.epid
73
+        left join e_paper_analyze epa on erq.epid = epa.epid
74 74
         where erq.examid=#{rank.examid} and erq.classid=#{rank.classid}
75 75
         and erq.subjectid=#{rank.subjectid} and erq.classsrate&lt;40
76 76
     </select>

+ 11
- 4
sexam/src/main/resources/mapper/report/EReportClassMapper.xml Целия файл

@@ -11,15 +11,22 @@
11 11
     <!--试卷概况-题库-->
12 12
     <select id="listTkSjGk" resultType="java.util.Map">
13 13
         select erq.qn,erq.qorder,erq.classavgscore,erq.classsrate,erq.gradeavgscore,erq.gradesrate
14
-        ,erq.answerjson,erq.goodstujson,erq.badstujson
15
-        ,epqq.ctype,epqq.score,epqq.answer,epqq.qtypename,q.qstem,q.qoption,q.qanalyze
16
-        from e_rclass_question erq left join e_paper_qtype_question epqq on erq.eptqid = epqq.eptqid
17
-        left join t_question q on epqq.questionid = q.questionid
14
+        ,erq.answerjson,erq.goodstujson,erq.badstujson,erq.questionid,erq.eptqid
15
+        from e_rclass_question erq
18 16
         where erq.examid=#{rank.examid} and erq.classid=#{rank.classid}
19 17
         and erq.subjectid=#{rank.subjectid}
20 18
         <if test="rank.ranktype==1">order by erq.qorder</if>
21 19
         <if test="rank.ranktype==2">order by erq.classscore</if>
22 20
     </select>
21
+    <select id="listTkQuestion" resultType="java.util.Map">
22
+        select epqq.eptqid,epqq.ctype,epqq.score,epqq.answer,epqq.qtypename,epqq.questionid,epqq.qn,epqq.qorder
23
+        ,q.questionpid,q.qstem,q.qoption,q.qanalyze,q.hashear,q.hearfile
24
+        ,mq.questionid mquestionid,mq.qstem mqstem,mq.qanalyze mqanalyze,mq.ctype mctype
25
+        ,mq.qtypename mqtypename,mq.hashear mhashear,mq.hearfile mhearfile
26
+        from e_paper_qtype_question epqq left join t_question q on epqq.questionid = q.questionid
27
+        left join t_question mq on q.questionpid=mq.questionid
28
+        where epqq.epid=#{epid}
29
+    </select>
23 30
     <!--试卷概况-附件-->
24 31
     <select id="listFjSjGk" resultType="java.util.Map">
25 32
         select erq.qn,erq.qorder,erq.classavgscore,erq.classsrate,erq.gradeavgscore,erq.gradesrate

Loading…
Отказ
Запис