Просмотр исходного кода

优化学生报告

tags/正式版本
王宁 2 лет назад
Родитель
Сommit
d62f84a492

+ 4
- 23
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportStudentService.java Просмотреть файл

@@ -84,34 +84,15 @@ public class EReportStudentService {
84 84
         List<Map> list = eRstudentMapper.getStudentScoreByExamid(examid, studentid);
85 85
         Map rtnmap = new LinkedHashMap();
86 86
 
87
-        Integer classid = null;
88 87
         if (list != null && list.size() > 0) {
89 88
             Map map1 = list.get(0);
90
-            classid = Integer.parseInt(map1.get("classid").toString());
89
+            Integer classid = Integer.parseInt(map1.get("classid").toString());
91 90
 
92
-        }else{
93
-            //获取学生关联班级id
94
-            classid = eClassStudentMapper.getClassidByStudentidAndExamid(examid,studentid);
95
-            Map smap = eRstudentMapper.getStudentScoreByExamidForNo(examid,classid);
96
-            if(smap != null){
97
-                smap.put("score",0);
98
-                smap.put("bzscore",0);
99
-                smap.put("classrank",0);
100
-                smap.put("classrankpre",0);
101
-                smap.put("schoolrank",0);
102
-                smap.put("goal",0);
103
-                smap.put("nextgoal",0);
104
-                smap.remove("rsid");
105
-                smap.remove("studentid");
106
-
107
-                list = new ArrayList<>();
108
-                list.add(smap);
109
-            }
91
+            Map gcnum = eRstudentMapper.getStudentNumByExamid(examid, classid);
92
+            rtnmap.put("classnum", gcnum.get("classnum").toString());
93
+            rtnmap.put("gradenum", gcnum.get("gradenum").toString());
110 94
         }
111 95
         rtnmap.put("subjects", list);
112
-        Map gcnum = eRstudentMapper.getStudentNumByExamid(examid, classid);
113
-        rtnmap.put("classnum", gcnum.get("classnum").toString());
114
-        rtnmap.put("gradenum", gcnum.get("gradenum").toString());
115 96
         return rtnmap;
116 97
     }
117 98
 

+ 2
- 1
sexam/src/main/resources/mapper/report/ERstudentMapper.xml Просмотреть файл

@@ -97,6 +97,7 @@
97 97
         <result property="gradesrate" column="gradesrate" />
98 98
         <result property="qscore" column="score" />
99 99
         <result property="epid" column="epid" />
100
+        <result property="qn" column="qn" />
100 101
         <result property="studentid" column="studentid" />
101 102
         <collection property="ques" ofType="java.util.Map" javaType="java.util.List"
102 103
                     column="{studentid=studentid,epid=epid,questionid=questionid}" select="listSubjectQuestionsStuScore">
@@ -107,7 +108,7 @@
107 108
     </resultMap>
108 109
     <select id="listSubjectQuestionsForTk" resultMap="listSubjectQuesTk">
109 110
         select cq.questionid,cq.classscore,cq.classsrate,cq.gradescore,cq.gradesrate,cq.qtypename,cq.score,
110
-        cq.epid,ps.studentid from e_rclass_question cq
111
+        cq.epid,cq.qn,ps.studentid from e_rclass_question cq
111 112
         left join e_paper_student ps on cq.epid=ps.epid and cq.classid=ps.classid
112 113
         where  cq.epid=#{epid} and ps.studentid=#{studentid} order by cq.qorder
113 114
     </select>

+ 0
- 16
sexam/src/test/java/com/xhkjedu/sexam/SexamApplicationTests.java Просмотреть файл

@@ -1,30 +1,14 @@
1 1
 package com.xhkjedu.sexam;
2 2
 
3
-import com.xhkjedu.sexam.model.paper.EPaper;
4
-import com.xhkjedu.sexam.service.paper.EPaperQtypeService;
5
-import com.xhkjedu.sexam.service.report.EReportGenerateService;
6 3
 import org.junit.jupiter.api.Test;
7 4
 import org.springframework.boot.test.context.SpringBootTest;
8 5
 
9
-import javax.annotation.Resource;
10 6
 
11 7
 @SpringBootTest
12 8
 class SexamApplicationTests {
13 9
 
14
-    @Resource
15
-    private EReportGenerateService eReportGenerateService;
16
-    @Resource
17
-    private EPaperQtypeService ePaperQtypeService;
18
-
19 10
     @Test
20 11
     void contextLoads() {
21
-        eReportGenerateService.saveClassQuestions(2);
22
-//        EPaper epaper = new EPaper();
23
-//        epaper.setEpid(6);
24
-//        epaper.setPnum(12);
25
-//        epaper.setPscore(100.0);
26
-//        ePaperQtypeService.savePaperAnalyzeForQuestion(epaper);
27
-
28 12
     }
29 13
 
30 14
 }

Загрузка…
Отмена
Сохранить