Bläddra i källkod

Merge remote-tracking branch 'cloud-schoolapi/ywx'

tags/正式版本
王宁 2 år sedan
förälder
incheckning
0dce062d22

+ 8
- 1
sexam/src/main/java/com/xhkjedu/sexam/service/paper/EPaperQtypeService.java Visa fil

@@ -70,12 +70,19 @@ public class EPaperQtypeService {
70 70
             return new ResultVo(1,"不能进行操作");
71 71
         }
72 72
 
73
+        List<EPaperQtype> qtypelist = paper.getQtypelist();
74
+        List<EPaperQtypeQuestion> questions = new ArrayList<>();
75
+        qtypelist.forEach(t -> {
76
+            questions.addAll(t.getQuestions());
77
+        });
78
+        long count = questions.stream().map(q -> q.getQn()).distinct().count();
79
+        if (count < questions.size()) return new ResultVo(1, "题号不能重复");
80
+
73 81
         //说明已经有改考试对应的试卷,删除试卷中试题,试卷分析
74 82
         ePaperQtypeMapper.deleteByEpid(espVo.getEpid());
75 83
         ePaperAnalyzeMapper.deleteByEpid(espVo.getEpid());
76 84
         ePaperFileMapper.deleteByEpid(espVo.getEpid());
77 85
 
78
-        List<EPaperQtype> qtypelist = paper.getQtypelist();
79 86
         List<EPaperQtypeQuestion> queslist = new ArrayList<>();//存放试题
80 87
         paper.setEpid(espVo.getEpid());
81 88
         setEPaperBaseDetail(paper,qtypelist);

+ 6
- 6
sexam/src/main/resources/mapper/paper/EPaperCorrectTeacherMapper.xml Visa fil

@@ -6,13 +6,13 @@
6 6
         select a.*,eb.examname,eb.gradeid,eb.examtype,es.sdate,es.begintime,es.endtime,es.subjectname
7 7
         ,truncate(a.pynum*100/a.tjnum,2)pgrate
8 8
         from(select p.esid,p.epid,group_concat(distinct pq.qn order by pq.qorder)qns
9
-        ,group_concat(distinct pq.qorder order by pq.qorder)qorders,group_concat(pc.classid)classids
9
+        ,group_concat(distinct pq.qorder order by pq.qorder)qorders,group_concat(distinct pc.classid)classids
10 10
         ,count(case when psq.answered=1 then psq.epsqid else null end)tjnum
11 11
         ,count(case when psq.answered=1 and psq.checked=2 then psq.epsqid else null end)pynum
12 12
         from e_paper p left join e_paper_qtype_question pq on p.epid = pq.epid
13 13
         left join e_paper_correctclass pc on p.epid = pc.epid
14 14
         left join e_paper_student_question psq on psq.epid = pc.epid and psq.classid=pc.classid and psq.qorder=pq.qorder
15
-        where pc.teacherid=#{teacherid} and pq.ctype in(3,14,15)
15
+        where pc.teacherid=#{teacherid} and pq.ctype in(3,14,15) group by p.epid
16 16
         union
17 17
         select p.esid,p.epid,group_concat(distinct pq.qn order by pq.qorder)qns
18 18
         ,group_concat(distinct pq.qorder order by pq.qorder)qorders,0 classids
@@ -20,7 +20,7 @@
20 20
         ,count(case when psq.answered=1 and psq.checked=2 then psq.epsqid else null end)pynum
21 21
         from e_paper p left join e_paper_correctquestion pq on p.epid = pq.epid
22 22
         left join e_paper_student_question psq on psq.epid = pq.epid and psq.qorder=pq.qorder
23
-        where pq.teacherid=#{teacherid})a left join e_subject es on a.esid = es.esid
23
+        where pq.teacherid=#{teacherid} group by p.epid)a left join e_subject es on a.esid = es.esid
24 24
         left join e_base eb on es.examid = eb.examid
25 25
         where a.tjnum!=a.pynum group by a.epid
26 26
     </select>
@@ -28,15 +28,15 @@
28 28
     <select id="listMarked" resultType="java.util.Map">
29 29
         select a.*,eb.examname,eb.gradeid,eb.examtype,es.sdate,es.begintime,es.endtime,es.subjectname
30 30
         from(select p.esid,p.epid,group_concat(distinct pq.qn order by pq.qorder)qns
31
-        ,group_concat(distinct pq.qorder order by pq.qorder)qorders,group_concat(pc.classid)classids
31
+        ,group_concat(distinct pq.qorder order by pq.qorder)qorders,group_concat(distinct pc.classid)classids
32 32
         from e_paper p left join e_paper_qtype_question pq on p.epid = pq.epid
33 33
         left join e_paper_correctclass pc on p.epid = pc.epid
34
-        where pc.teacherid=#{teacherid} and pq.ctype in(3,14,15)
34
+        where pc.teacherid=#{teacherid} and pq.ctype in(3,14,15) group by p.epid
35 35
         union
36 36
         select p.esid,p.epid,group_concat(distinct pq.qn order by pq.qorder)qns
37 37
         ,group_concat(distinct pq.qorder order by pq.qorder)qorders,0 classids
38 38
         from e_paper p left join e_paper_correctquestion pq on p.epid = pq.epid
39
-        where pq.teacherid=#{teacherid})a left join e_subject es on a.esid = es.esid
39
+        where pq.teacherid=#{teacherid} group by p.epid)a left join e_subject es on a.esid = es.esid
40 40
         left join e_base eb on es.examid = eb.examid
41 41
         left join e_paper_student ps on a.epid=ps.epid
42 42
         group by a.epid

Laddar…
Avbryt
Spara