Browse Source

优化学生报告

tags/正式版本
王宁 2 years ago
parent
commit
d62f84a492

+ 4
- 23
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportStudentService.java View File

84
         List<Map> list = eRstudentMapper.getStudentScoreByExamid(examid, studentid);
84
         List<Map> list = eRstudentMapper.getStudentScoreByExamid(examid, studentid);
85
         Map rtnmap = new LinkedHashMap();
85
         Map rtnmap = new LinkedHashMap();
86
 
86
 
87
-        Integer classid = null;
88
         if (list != null && list.size() > 0) {
87
         if (list != null && list.size() > 0) {
89
             Map map1 = list.get(0);
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
         rtnmap.put("subjects", list);
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
         return rtnmap;
96
         return rtnmap;
116
     }
97
     }
117
 
98
 

+ 2
- 1
sexam/src/main/resources/mapper/report/ERstudentMapper.xml View File

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

+ 0
- 16
sexam/src/test/java/com/xhkjedu/sexam/SexamApplicationTests.java View File

1
 package com.xhkjedu.sexam;
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
 import org.junit.jupiter.api.Test;
3
 import org.junit.jupiter.api.Test;
7
 import org.springframework.boot.test.context.SpringBootTest;
4
 import org.springframework.boot.test.context.SpringBootTest;
8
 
5
 
9
-import javax.annotation.Resource;
10
 
6
 
11
 @SpringBootTest
7
 @SpringBootTest
12
 class SexamApplicationTests {
8
 class SexamApplicationTests {
13
 
9
 
14
-    @Resource
15
-    private EReportGenerateService eReportGenerateService;
16
-    @Resource
17
-    private EPaperQtypeService ePaperQtypeService;
18
-
19
     @Test
10
     @Test
20
     void contextLoads() {
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
 }

Loading…
Cancel
Save