Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/ywx' into wn_j

tags/正式版本
王宁 pirms 2 gadiem
vecāks
revīzija
f0cdc78ea2

+ 15
- 0
sexam/src/main/java/com/xhkjedu/sexam/controller/exam/EBaseController.java Parādīt failu

@@ -388,4 +388,19 @@ public class EBaseController {
388 388
         Map map = eBaseService.getSetState(examid);
389 389
         return new ResultVo(0, "获取考试设置状态成功", map);
390 390
     }
391
+
392
+    /**
393
+     * 获取mac编号
394
+     *
395
+     * @return com.xhkjedu.vo.ResultVo
396
+     * @Param [mac]
397
+     * @Author ywx
398
+     * @Date 2022/8/10 17:40
399
+     **/
400
+    @PostMapping("/get_mn")
401
+    public ResultVo getMacNumber(@RequestBody String mac) {
402
+        N_Utils.validation(new Object[]{mac, "硬件地址", 2});
403
+        String macNumber = eBaseService.getMacNumber(mac);
404
+        return new ResultVo(0, "获取mac编号成功", macNumber);
405
+    }
391 406
 }

+ 3
- 2
sexam/src/main/java/com/xhkjedu/sexam/controller/paper/EPaperCorrectTeacherController.java Parādīt failu

@@ -99,8 +99,9 @@ public class EPaperCorrectTeacherController {
99 99
     public ResultVo getPreQuestion(@RequestBody EPTeacherVo vo) {
100 100
         Integer eptqid = vo.getEptqid();
101 101
         Integer teacherid = vo.getTeacherid();
102
-        N_Utils.validation(new Object[]{eptqid, "试卷试题id", 1, teacherid, "教师id", 1});
103
-        return correctTeacherService.getPreQuestion(eptqid, teacherid);
102
+        Integer esid = vo.getEsid();
103
+        N_Utils.validation(new Object[]{eptqid, "试卷试题id", 1, teacherid, "教师id", 1, esid, "考试科目id", 1});
104
+        return correctTeacherService.getPreQuestion(eptqid, teacherid, esid);
104 105
     }
105 106
 
106 107
     /**

+ 10
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/exam/EBaseMacMapper.java Parādīt failu

@@ -0,0 +1,10 @@
1
+package com.xhkjedu.sexam.mapper.exam;
2
+
3
+import com.xhkjedu.sexam.base.TkMapper;
4
+import com.xhkjedu.sexam.model.exam.EBaseMac;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+public interface EBaseMacMapper extends TkMapper<EBaseMac> {
8
+    //根据mac获取主键
9
+    Integer getIdByMac(@Param("mac") String mac);
10
+}

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/mapper/paper/EPaperCorrectTeacherMapper.java Parādīt failu

@@ -25,7 +25,7 @@ public interface EPaperCorrectTeacherMapper {
25 25
     void updateCheckQuestionById(@Param("epsqid") Integer epsqid, @Param("teacherid") Integer teacherid);
26 26
 
27 27
     //获取上一份批阅试题
28
-    Map getPreQuestion(@Param("eptqid") Integer eptqid, @Param("teacherid") Integer teacherid);
28
+    EPaperSQuestionVo getPreQuestion(@Param("eptqid") Integer eptqid, @Param("teacherid") Integer teacherid);
29 29
 
30 30
     //阅卷记录
31 31
     List<Map> listRecord(@Param("eptqid") Integer eptqid, @Param("teacherid") Integer teacherid);

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/report/ERrankMapper.java Parādīt failu

@@ -2,6 +2,9 @@ package com.xhkjedu.sexam.mapper.report;
2 2
 
3 3
 import com.xhkjedu.sexam.base.TkMapper;
4 4
 import com.xhkjedu.sexam.model.report.ERrank;
5
+import org.apache.ibatis.annotations.Param;
5 6
 
6 7
 public interface ERrankMapper extends TkMapper<ERrank> {
8
+    //获取考试报告等级
9
+    ERrank getByRank(@Param("rank") ERrank rank);
7 10
 }

+ 18
- 0
sexam/src/main/java/com/xhkjedu/sexam/model/exam/EBaseMac.java Parādīt failu

@@ -0,0 +1,18 @@
1
+package com.xhkjedu.sexam.model.exam;
2
+
3
+import com.xhkjedu.sexam.model.BaseBean;
4
+import lombok.Data;
5
+
6
+import javax.persistence.Id;
7
+import javax.persistence.Table;
8
+
9
+@Table(name = "e_base_mac")
10
+@Data
11
+public class EBaseMac extends BaseBean {
12
+    @Id
13
+    //考试扫描设备表
14
+    private Integer ebmid;
15
+
16
+    //硬件地址
17
+    private String mac;
18
+}

+ 4
- 1
sexam/src/main/java/com/xhkjedu/sexam/model/report/ERrank.java Parādīt failu

@@ -28,7 +28,10 @@ public class ERrank extends BaseBean {
28 28
     //分值下线
29 29
     private Double minscore;
30 30
 
31
-    //浮动值
31
+    //临界名次和分值
32
+    private Integer linescore;
33
+
34
+    //浮动名次和分值
32 35
     private Integer floatscore;
33 36
 
34 37
     //创建人id

+ 17
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/exam/EBaseService.java Parādīt failu

@@ -1,5 +1,6 @@
1 1
 package com.xhkjedu.sexam.service.exam;
2 2
 
3
+import com.xhkjedu.sexam.mapper.exam.EBaseMacMapper;
3 4
 import com.xhkjedu.sexam.mapper.exam.EBaseMapper;
4 5
 import com.xhkjedu.sexam.mapper.exam.EClassMapper;
5 6
 import com.xhkjedu.sexam.mapper.exam.EClassStudentMapper;
@@ -8,6 +9,7 @@ import com.xhkjedu.sexam.mapper.paper.EPaperMapper;
8 9
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentMapper;
9 10
 import com.xhkjedu.sexam.mapper.system.UserMapper;
10 11
 import com.xhkjedu.sexam.model.exam.EBase;
12
+import com.xhkjedu.sexam.model.exam.EBaseMac;
11 13
 import com.xhkjedu.sexam.model.exam.EClass;
12 14
 import com.xhkjedu.sexam.model.exam.EClassStudent;
13 15
 import com.xhkjedu.sexam.model.exam.ESubject;
@@ -45,6 +47,8 @@ public class EBaseService {
45 47
     private UserMapper userMapper;
46 48
     @Resource
47 49
     private EPaperStudentMapper ePaperStudentMapper;
50
+    @Resource
51
+    private EBaseMacMapper eBaseMacMapper;
48 52
 
49 53
     /**
50 54
      * 发起考试
@@ -295,4 +299,17 @@ public class EBaseService {
295 299
         b.setExamcomm(examcomm);
296 300
         eBaseMapper.updateByPrimaryKeySelective(b);
297 301
     }
302
+
303
+    //获取mac编号
304
+    public String getMacNumber(String mac) {
305
+        String macCode = "PC-";
306
+        Integer ebmid = eBaseMacMapper.getIdByMac(mac);//根据mac获取主键
307
+        if (ebmid == null) {
308
+            EBaseMac bm = new EBaseMac();
309
+            bm.setMac(mac);
310
+            eBaseMacMapper.insertUseGeneratedKeys(bm);
311
+            ebmid = bm.getId();
312
+        }
313
+        return macCode + ebmid;
314
+    }
298 315
 }

+ 14
- 4
sexam/src/main/java/com/xhkjedu/sexam/service/paper/EPaperCorrectTeacherService.java Parādīt failu

@@ -65,10 +65,20 @@ public class EPaperCorrectTeacherService {
65 65
     }
66 66
 
67 67
     //获取上一份批阅试题
68
-    public ResultVo getPreQuestion(Integer epid, Integer teacherid) {
69
-        Map q = correctTeacherMapper.getPreQuestion(epid, teacherid);
70
-        if (q == null) return new ResultVo(1, "您还没有批阅记录");
71
-        return new ResultVo(0, "获取成功", q);
68
+    public ResultVo getPreQuestion(Integer eptqid, Integer teacherid, Integer esid) {
69
+        EPaperSQuestionVo sq = correctTeacherMapper.getPreQuestion(eptqid, teacherid);
70
+        if (sq == null) return new ResultVo(1, "您还没有批阅记录");
71
+        Map map = correctTeacherMapper.getExamNameByEsId(esid);//根据考试科目id获取考试名称
72
+        //试题批阅情况
73
+        EPaperSQuestionVo q = correctTeacherMapper.getCheckQuestion(eptqid, teacherid);
74
+        Integer tjnum = q.getTjnum();
75
+        Integer pynum = q.getPynum();
76
+        map.put("sq", sq);//学生待批试题
77
+        map.put("tjnum", tjnum);//提交人数
78
+        map.put("pynum", pynum);//批阅人数
79
+        map.put("wpynum", q.getWpynum());//我批阅人数
80
+        map.put("pyrate", N_Utils.getIntegerDivideAndMulitiply(pynum, tjnum));//批阅进度
81
+        return new ResultVo(0, "获取成功", map);
72 82
     }
73 83
 
74 84
     //阅卷记录

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/vo/paper/EPaperSQuestionVo.java Parādīt failu

@@ -19,4 +19,7 @@ public class EPaperSQuestionVo {
19 19
     private Integer tjnum;//提交人数
20 20
     private Integer pynum;//批阅人数
21 21
     private Integer wpynum;//我批阅人数
22
+    private Double stuscore;//学生得分
23
+    private Integer good;//优秀试卷0默认1优秀
24
+    private Integer bad;//违纪试卷0默认1违纪
22 25
 }

+ 8
- 0
sexam/src/main/resources/mapper/exam/EBaseMacMapper.xml Parādīt failu

@@ -0,0 +1,8 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.xhkjedu.sexam.mapper.exam.EBaseMacMapper">
4
+    <!--根据mac获取主键-->
5
+    <select id="getIdByMac" resultType="java.lang.Integer">
6
+        select ebmid from e_base_mac where mac=#{mac} limit 1
7
+    </select>
8
+</mapper>

+ 3
- 3
sexam/src/main/resources/mapper/paper/EPaperCorrectTeacherMapper.xml Parādīt failu

@@ -49,7 +49,7 @@
49 49
     </select>
50 50
     <!--随机获取一条待批阅试题-->
51 51
     <select id="getCorrectQuestion" resultType="com.xhkjedu.sexam.vo.paper.EPaperSQuestionVo">
52
-        select psq.epsqid,psq.stuanswer,psq.qn,psq.eptqid,psq.qscore,psq.epsid
52
+        select psq.epsqid,psq.stuanswer,psq.qn,psq.eptqid,psq.qscore,psq.stuscore,psq.good,psq.bad,psq.epsid
53 53
         from e_paper_student_question psq where psq.eptqid=#{eptqid}
54 54
         and psq.answered=1 and (psq.checked=0 or (psq.checked=1 and psq.checkid=#{teacherid}))
55 55
         <if test="classids!=null and classids!=''">
@@ -68,8 +68,8 @@
68 68
         update e_paper_student_question set checked=1,checkid=#{teacherid} where epsqid=#{epsqid}
69 69
     </update>
70 70
     <!--获取上一份批阅试题-->
71
-    <select id="getPreQuestion" resultType="java.util.Map">
72
-        select psq.epsqid,psq.stuanswer,psq.qn,psq.qorder,psq.qscore,psq.stuscore,psq.good,psq.bad,psq.epsid
71
+    <select id="getPreQuestion" resultType="com.xhkjedu.sexam.vo.paper.EPaperSQuestionVo">
72
+        select psq.epsqid,psq.stuanswer,psq.qn,psq.eptqid,psq.qscore,psq.stuscore,psq.good,psq.bad,psq.epsid
73 73
         from e_paper_student_question psq where psq.eptqid=#{eptqid} and psq.checked=2 and psq.checkid=#{teacherid}
74 74
         order by psq.checktime desc limit 1
75 75
     </select>

+ 1
- 1
sexam/src/main/resources/mapper/paper/EPaperCorrectquestionMapper.xml Parādīt failu

@@ -14,6 +14,6 @@
14 14
     <!--获取主观题题号-->
15 15
     <select id="listQnByEpId" resultType="java.util.Map">
16 16
         select q.qn,q.qorder,q.eptqid
17
-        from e_paper_qtype_question q where q.epid=#{epid} and q.ctype in(3,14,15) order by q.qorder
17
+        from e_paper_qtype_question q where q.epid=#{epid} and q.ctype in(3,13,14,15) order by q.qorder
18 18
     </select>
19 19
 </mapper>

Notiek ielāde…
Atcelt
Saglabāt