Browse Source

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

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

+ 55
- 0
sexam/src/main/java/com/xhkjedu/sexam/controller/report/EReportClassController.java View File

@@ -3,6 +3,7 @@ package com.xhkjedu.sexam.controller.report;
3 3
 import com.github.pagehelper.PageHelper;
4 4
 import com.github.pagehelper.PageInfo;
5 5
 import com.xhkjedu.sexam.model.reportstu.ERstudent;
6
+import com.xhkjedu.sexam.model.reportstu.ERstudentAction;
6 7
 import com.xhkjedu.sexam.service.report.EReportClassService;
7 8
 import com.xhkjedu.sexam.vo.report.ERankParamVo;
8 9
 import com.xhkjedu.utils.N_Utils;
@@ -158,4 +159,58 @@ public class EReportClassController {
158 159
         Map map = eReportClassService.getSjFx(rank);
159 160
         return new ResultVo(0, "获取成功", map);
160 161
     }
162
+
163
+    /*
164
+     * 行为分析-科目
165
+     * @Param [rank]
166
+     * @Author ywx
167
+     * @Date 2022/9/2 11:36
168
+     * @return com.xhkjedu.vo.ResultVo
169
+     **/
170
+    @PostMapping("/list_xw_km")
171
+    public ResultVo listXwKm(@RequestBody ERstudentAction rank) {
172
+        N_Utils.validation(new Object[]{rank.getExamid(), "考试id", 1, rank.getActiontype(), "类型", 1
173
+                , rank.getClassid(), "班级id", 1});
174
+        List<Map> map = eReportClassService.listXwKm(rank);
175
+        return new ResultVo(0, "获取成功", map);
176
+    }
177
+
178
+    /*
179
+     * 行为分析-学生
180
+     * @Param [rank]
181
+     * @Author ywx
182
+     * @Date 2022/9/2 13:43
183
+     * @return com.xhkjedu.vo.ResultVo
184
+     **/
185
+    @PostMapping("/list_xw_xs")
186
+    public ResultVo listXwXs(@RequestBody ERstudentAction rank) {
187
+        Integer page = rank.getPage();
188
+        Integer pageSize = rank.getPageSize();
189
+        N_Utils.validation(new Object[]{rank.getExamid(), "考试id", 1, rank.getActiontype(), "类型", 1
190
+                , rank.getClassid(), "班级id", 1});
191
+        if (N_Utils.isEmptyInteger(page)) {
192
+            List<Map> list = eReportClassService.listXwXs(rank);
193
+            return new ResultVo(0, "获取成功", list);
194
+        } else {
195
+            PageHelper.startPage(page, pageSize);
196
+            List<Map> list = eReportClassService.listXwXs(rank);
197
+            PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
198
+            return new ResultVo(0, "获取成功", pageResult);
199
+        }
200
+    }
201
+
202
+    /*
203
+     * 优秀试卷分析-详情
204
+     * @Param [rank]
205
+     * @Author ywx
206
+     * @Date 2022/9/2 13:52
207
+     * @return com.xhkjedu.vo.ResultVo
208
+     **/
209
+    @PostMapping("/get_sjxq")
210
+    public ResultVo getSjXq(@RequestBody ERankParamVo rank) {
211
+        N_Utils.validation(new Object[]{rank.getExamid(), "考试id", 1
212
+                , rank.getSubjectid(), "科目id", 2, rank.getCreateid(), "学生id", 1});
213
+        Map map = eReportClassService.getSjXq(rank);
214
+        return new ResultVo(0, "获取成功", map);
215
+    }
161 216
 }

+ 10
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/reportclass/EReportClassMapper.java View File

@@ -1,5 +1,6 @@
1 1
 package com.xhkjedu.sexam.mapper.reportclass;
2 2
 
3
+import com.xhkjedu.sexam.model.reportstu.ERstudentAction;
3 4
 import com.xhkjedu.sexam.vo.report.ERankParamVo;
4 5
 import org.apache.ibatis.annotations.Param;
5 6
 
@@ -24,4 +25,13 @@ public interface EReportClassMapper {
24 25
 
25 26
     //试卷分析-知识点分析
26 27
     List<Map> listPoint(@Param("rank") ERankParamVo rank);
28
+
29
+    //行为分析-科目
30
+    String getSubjectJson(@Param("rank") ERstudentAction rank);
31
+
32
+    //行为分析-学生
33
+    List<Map> listXwXs(@Param("rank") ERstudentAction rank);
34
+
35
+    //学生试卷基础信息
36
+    Map getStuPaperInfo(@Param("rank") ERankParamVo rank);
27 37
 }

+ 30
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportClassService.java View File

@@ -8,7 +8,9 @@ import com.xhkjedu.sexam.mapper.reportclass.ERclassRankMapper;
8 8
 import com.xhkjedu.sexam.mapper.reportclass.EReportClassMapper;
9 9
 import com.xhkjedu.sexam.mapper.reportstu.ERstudentMapper;
10 10
 import com.xhkjedu.sexam.mapper.system.UserMapper;
11
+import com.xhkjedu.sexam.model.paper.EPaperQtype;
11 12
 import com.xhkjedu.sexam.model.reportstu.ERstudent;
13
+import com.xhkjedu.sexam.model.reportstu.ERstudentAction;
12 14
 import com.xhkjedu.sexam.vo.report.ERPaperVo;
13 15
 import com.xhkjedu.sexam.vo.report.ERankParamVo;
14 16
 import com.xhkjedu.sexam.vo.system.UserVo;
@@ -184,4 +186,32 @@ public class EReportClassService {
184 186
         map.put("points", points);
185 187
         return map;
186 188
     }
189
+
190
+    //行为分析-科目
191
+    public List<Map> listXwKm(ERstudentAction rank) {
192
+        String subjectjson = eReportClassMapper.getSubjectJson(rank);
193
+        List<Map> list = JSON.parseArray(subjectjson, Map.class);
194
+        return list;
195
+    }
196
+
197
+    //行为分析-学生
198
+    public List<Map> listXwXs(ERstudentAction rank) {
199
+        return eReportClassMapper.listXwXs(rank);
200
+    }
201
+
202
+    //优秀试卷分析-详情
203
+    public Map getSjXq(ERankParamVo rank) {
204
+        Map map = eReportClassMapper.getStuPaperInfo(rank);//学生试卷基础信息
205
+        List<EPaperQtype> questions;//试题详情
206
+        Integer ptype = (Integer) map.get("ptype");
207
+        Integer epsid = (Integer) map.get("epsid");
208
+        if (ptype == 1) {
209
+            //题库试卷试题
210
+            questions = ePaperStudentMapper.listStuPaperQuestionsForWeb(epsid);
211
+        } else {
212
+            questions = ePaperStudentMapper.listStuPaperFjQuestionsForWeb(epsid);
213
+        }
214
+        map.put("questions", questions);
215
+        return map;
216
+    }
187 217
 }

+ 1
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportGenerateService.java View File

@@ -138,6 +138,7 @@ public class EReportGenerateService {
138 138
             Map<Integer, List<ERstudent>> sCollect = studentList.stream().collect(Collectors.groupingBy(s -> s.getStudentid()));
139 139
             for (Map.Entry<Integer, List<ERstudent>> csEntry : sCollect.entrySet()) {
140 140
                 ERstudent cs = new ERstudent();
141
+                cs.setExamid(examid);
141 142
                 cs.setClassid(classid);
142 143
                 cs.setStudentid(csEntry.getKey());
143 144
                 cs.setSubjectid(subjectid);

+ 6
- 6
sexam/src/main/resources/mapper/report/ERclassMapper.xml View File

@@ -18,7 +18,7 @@
18 18
         ,er.stunum,er.missnum,er.yxrate,er.lhrate,er.jgrate,er.dfrate,er.bzc
19 19
         ,er.classid,(case when er.classid=0 then '全部班级' else ec.classname end)classname
20 20
         from e_rclass er left join e_class ec on er.examid = ec.examid and er.classid = ec.classid
21
-        where er.examid=#{rank.examid} and er.classid=#{rank.classid}
21
+        where er.examid=#{examid} and er.classid=#{classid}
22 22
     </select>
23 23
     <!--班级报告-单科概况-班级概况-->
24 24
     <select id="findById" resultType="java.util.Map">
@@ -45,20 +45,20 @@
45 45
     <select id="listGzXs" resultType="java.util.Map">
46 46
         select u.username,er.score,er.classrank,er.classrankpre,er.goal
47 47
         from e_rstudent er left join t_user u on er.studentid=u.userid
48
-        <if test="ranktype==3">
48
+        <if test="rank.ranktype==3">
49 49
             left join e_rsubject es on er.examid = es.examid and es.subjectid=er.subjectid
50 50
         </if>
51 51
         where er.examid=#{rank.examid} and er.classid=#{rank.classid} and er.subjectid=#{rank.subjectid}
52
-        <if test="ranktype==1">
52
+        <if test="rank.ranktype==1">
53 53
             and er.classrankpre>=5
54 54
         </if>
55
-        <if test="ranktype==2">
55
+        <if test="rank.ranktype==2">
56 56
             and er.classrankpre&lt;=5
57 57
         </if>
58
-        <if test="ranktype==3">
58
+        <if test="rank.ranktype==3">
59 59
             and es.score*0.6-er.score &lt;5
60 60
         </if>
61
-        <if test="ranktype==4">
61
+        <if test="rank.ranktype==4">
62 62
             and abs(er.classrankpre)>=10
63 63
         </if>
64 64
     </select>

+ 30
- 6
sexam/src/main/resources/mapper/report/EReportClassMapper.xml View File

@@ -3,10 +3,10 @@
3 3
 <mapper namespace="com.xhkjedu.sexam.mapper.reportclass.EReportClassMapper">
4 4
     <!--试卷基本信息-->
5 5
     <select id="getPaperByExamSubjectId" resultType="java.util.Map">
6
-        select epid,ptype,eb.examname,epa.pointjson
6
+        select ep.epid,ep.ptype,eb.examname,epa.pointjson
7 7
         from e_paper ep left join e_base eb on ep.examid = eb.examid
8 8
         left join e_paper_analyze epa on ep.epid = epa.epid
9
-        where examid=#{rank.examid} and subjectid=#{rank.subjectid} limit 1
9
+        where ep.examid=#{rank.examid} and ep.subjectid=#{rank.subjectid} limit 1
10 10
     </select>
11 11
     <!--试卷概况-题库-->
12 12
     <select id="listTkSjGk" resultType="java.util.Map">
@@ -17,8 +17,8 @@
17 17
         left join t_question q on epqq.questionid = q.questionid
18 18
         where erq.examid=#{rank.examid} and erq.classid=#{rank.classid}
19 19
         and erq.subjectid=#{rank.subjectid}
20
-        <if test="ranktype==1">order by erq.qorder</if>
21
-        <if test="ranktype==2">order by erq.classscore</if>
20
+        <if test="rank.ranktype==1">order by erq.qorder</if>
21
+        <if test="rank.ranktype==2">order by erq.classscore</if>
22 22
     </select>
23 23
     <!--试卷概况-附件-->
24 24
     <select id="listFjSjGk" resultType="java.util.Map">
@@ -28,8 +28,8 @@
28 28
         from e_rclass_question erq left join e_paper_qtype_question epqq on erq.eptqid = epqq.eptqid
29 29
         where erq.examid=#{rank.examid} and erq.classid=#{rank.classid}
30 30
         and erq.subjectid=#{rank.subjectid}
31
-        <if test="ranktype==1">order by erq.qorder</if>
32
-        <if test="ranktype==2">order by erq.classscore</if>
31
+        <if test="rank.ranktype==1">order by erq.qorder</if>
32
+        <if test="rank.ranktype==2">order by erq.classscore</if>
33 33
     </select>
34 34
     <!--试卷分析-大题分析-->
35 35
     <select id="listType" resultType="java.util.Map">
@@ -55,4 +55,28 @@
55 55
         where erp.examid=#{rank.examid} and erp.classid=#{rank.classid}
56 56
         and erp.subjectid=#{rank.subjectid}
57 57
     </select>
58
+    <!--行为分析-科目-->
59
+    <select id="getSubjectJson" resultType="java.lang.String">
60
+        select ca.subjectjson from e_rclass_action ca
61
+        where ca.examid=#{rank.examid} and ca.actiontype=#{rank.actiontype} and ca.classid=#{rank.classid} limit 1
62
+    </select>
63
+    <!--行为分析-学生-->
64
+    <select id="listXwXs" resultType="java.util.Map">
65
+        select sa.classid,sa.studentid,sa.subjectjson,u.username,u.loginname
66
+        from e_rstudent_action sa left join t_user u on sa.studentid=u.userid
67
+        where sa.examid=#{rank.examid} and sa.actiontype=#{rank.actiontype}
68
+        <if test="rank.classid!=null and rank.classid!=0">
69
+            and sa.classid=#{rank.classid}
70
+        </if>
71
+        <if test="rank.createname!=null and rank.createname!=''">
72
+            and (u.username like '%${rank.createname}%' or u.loginname like '%${rank.createname}%')
73
+        </if>
74
+    </select>
75
+    <!--学生试卷基础信息-->
76
+    <select id="getStuPaperInfo" resultType="java.util.Map">
77
+        select ep.pnum,ep.pscore,ep.ptype,er.score,er.classrank,er.schoolrank,eps.epsid
78
+        from e_rstudent er left join e_paper ep on er.examid = ep.examid and er.subjectid=ep.subjectid
79
+        left join e_paper_student eps on ep.epid = eps.epid and eps.studentid=er.studentid
80
+        where er.examid=#{rank.examid} and er.subjectid=#{rank.subjectid} and er.studentid=#{rank.createid}
81
+    </select>
58 82
 </mapper>

Loading…
Cancel
Save