Browse Source

设置考试学生报告排名显示

学生待考列表生成报告后显示未结束的考试
tags/正式版本
雍文秀 2 years ago
parent
commit
242526558e

+ 14
- 0
sexam/src/main/java/com/xhkjedu/sexam/controller/exam/EBaseController.java View File

564
         return new ResultVo(0, "获取缺考详情成功", list);
564
         return new ResultVo(0, "获取缺考详情成功", list);
565
     }
565
     }
566
 
566
 
567
+    /*
568
+     * 设置学生报告排名显示
569
+     * @Param [eBase]
570
+     * @Author ywx
571
+     * @Date 2022/11/14 15:19
572
+     * @return com.xhkjedu.vo.ResultVo
573
+     **/
574
+    @PostMapping("/set_show")
575
+    public ResultVo setShowRank(@RequestBody EBase eBase) {
576
+        N_Utils.validation(new Object[]{eBase.getExamid(), "考试id", 1});
577
+        eBaseService.setShowRank(eBase);
578
+        return new ResultVo(0, "设置成功");
579
+    }
580
+
567
 }
581
 }

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/model/exam/EBase.java View File

36
     //考试状态0未开始1已开始2已结束3已生成报告
36
     //考试状态0未开始1已开始2已结束3已生成报告
37
     private Integer examstate;
37
     private Integer examstate;
38
 
38
 
39
+    //显示排名0不显示1显示
40
+    private Integer showrank;
41
+
39
     //考试公告
42
     //考试公告
40
     private String examcomm;
43
     private String examcomm;
41
 
44
 

+ 7
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/exam/EBaseService.java View File

66
         try {
66
         try {
67
             //考试
67
             //考试
68
             model.setExamstate(0);
68
             model.setExamstate(0);
69
+            model.setShowrank(0);
69
             model.setDeleted(1);
70
             model.setDeleted(1);
70
             model.setReportstate(0);
71
             model.setReportstate(0);
71
             model.setCreatetime(N_Utils.getSecondTimestamp());
72
             model.setCreatetime(N_Utils.getSecondTimestamp());
450
         }
451
         }
451
         return list;
452
         return list;
452
     }
453
     }
454
+
455
+    //设置学生报告排名显示
456
+    public void setShowRank(EBase eBase) {
457
+        if (eBase.getShowrank() == null) eBase.setShowrank(0);
458
+        eBaseMapper.updateByPrimaryKeySelective(eBase);
459
+    }
453
 }
460
 }

+ 1
- 1
sexam/src/main/resources/mapper/exam/EBaseMapper.xml View File

16
     </delete>
16
     </delete>
17
     <!--考试列表-->
17
     <!--考试列表-->
18
     <select id="listAll" resultType="java.util.Map">
18
     <select id="listAll" resultType="java.util.Map">
19
-        select b.examid,b.examname,b.examdate,b.gradeid,b.examtype,b.exammode,b.monitored
19
+        select b.examid,b.examname,b.examdate,b.gradeid,b.examtype,b.exammode,b.monitored,b.showrank
20
         ,b.examstate,u.username createname,group_concat(distinct es.subjectname order by es.esid separator '|')subjectname
20
         ,b.examstate,u.username createname,group_concat(distinct es.subjectname order by es.esid separator '|')subjectname
21
         ,count(distinct case when es.begintime is null or es.begintime='' then es.esid else null end)esnum
21
         ,count(distinct case when es.begintime is null or es.begintime='' then es.esid else null end)esnum
22
         ,min(es.esstate)esstate,min(ifnull(ep.correcttype,0))correcttype
22
         ,min(es.esstate)esstate,min(ifnull(ep.correcttype,0))correcttype

+ 1
- 1
sexam/src/main/resources/mapper/paperstudent/EPaperStudentMapper.xml View File

8
         e.examname,e.gradeid,e.examtype,ep.epid,ep.ptype,eps.sstate
8
         e.examname,e.gradeid,e.examtype,ep.epid,ep.ptype,eps.sstate
9
         from e_paper_student eps left join e_subject es on eps.esid=es.esid
9
         from e_paper_student eps left join e_subject es on eps.esid=es.esid
10
          left join e_paper ep on eps.epid=ep.epid left join e_base e on eps.examid=e.examid
10
          left join e_paper ep on eps.epid=ep.epid left join e_base e on eps.examid=e.examid
11
-        where e.deleted=1 and e.exammode=1 and eps.studentid=#{studentid} and e.examstate=1
11
+        where e.deleted=1 and e.exammode=1 and eps.studentid=#{studentid} and e.examstate>=1 and es.pstate!=2
12
          GROUP BY eps.epsid
12
          GROUP BY eps.epsid
13
         order by UNIX_TIMESTAMP(concat(es.sdate,' ',es.begintime)) desc,es.esid desc
13
         order by UNIX_TIMESTAMP(concat(es.sdate,' ',es.begintime)) desc,es.esid desc
14
     </select>
14
     </select>

Loading…
Cancel
Save