Browse Source

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

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

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

388
         Map map = eBaseService.getSetState(examid);
388
         Map map = eBaseService.getSetState(examid);
389
         return new ResultVo(0, "获取考试设置状态成功", map);
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 View File

99
     public ResultVo getPreQuestion(@RequestBody EPTeacherVo vo) {
99
     public ResultVo getPreQuestion(@RequestBody EPTeacherVo vo) {
100
         Integer eptqid = vo.getEptqid();
100
         Integer eptqid = vo.getEptqid();
101
         Integer teacherid = vo.getTeacherid();
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 View File

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 View File

25
     void updateCheckQuestionById(@Param("epsqid") Integer epsqid, @Param("teacherid") Integer teacherid);
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
     List<Map> listRecord(@Param("eptqid") Integer eptqid, @Param("teacherid") Integer teacherid);
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 View File

2
 
2
 
3
 import com.xhkjedu.sexam.base.TkMapper;
3
 import com.xhkjedu.sexam.base.TkMapper;
4
 import com.xhkjedu.sexam.model.report.ERrank;
4
 import com.xhkjedu.sexam.model.report.ERrank;
5
+import org.apache.ibatis.annotations.Param;
5
 
6
 
6
 public interface ERrankMapper extends TkMapper<ERrank> {
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 View File

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 View File

28
     //分值下线
28
     //分值下线
29
     private Double minscore;
29
     private Double minscore;
30
 
30
 
31
-    //浮动值
31
+    //临界名次和分值
32
+    private Integer linescore;
33
+
34
+    //浮动名次和分值
32
     private Integer floatscore;
35
     private Integer floatscore;
33
 
36
 
34
     //创建人id
37
     //创建人id

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

1
 package com.xhkjedu.sexam.service.exam;
1
 package com.xhkjedu.sexam.service.exam;
2
 
2
 
3
+import com.xhkjedu.sexam.mapper.exam.EBaseMacMapper;
3
 import com.xhkjedu.sexam.mapper.exam.EBaseMapper;
4
 import com.xhkjedu.sexam.mapper.exam.EBaseMapper;
4
 import com.xhkjedu.sexam.mapper.exam.EClassMapper;
5
 import com.xhkjedu.sexam.mapper.exam.EClassMapper;
5
 import com.xhkjedu.sexam.mapper.exam.EClassStudentMapper;
6
 import com.xhkjedu.sexam.mapper.exam.EClassStudentMapper;
8
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentMapper;
9
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentMapper;
9
 import com.xhkjedu.sexam.mapper.system.UserMapper;
10
 import com.xhkjedu.sexam.mapper.system.UserMapper;
10
 import com.xhkjedu.sexam.model.exam.EBase;
11
 import com.xhkjedu.sexam.model.exam.EBase;
12
+import com.xhkjedu.sexam.model.exam.EBaseMac;
11
 import com.xhkjedu.sexam.model.exam.EClass;
13
 import com.xhkjedu.sexam.model.exam.EClass;
12
 import com.xhkjedu.sexam.model.exam.EClassStudent;
14
 import com.xhkjedu.sexam.model.exam.EClassStudent;
13
 import com.xhkjedu.sexam.model.exam.ESubject;
15
 import com.xhkjedu.sexam.model.exam.ESubject;
45
     private UserMapper userMapper;
47
     private UserMapper userMapper;
46
     @Resource
48
     @Resource
47
     private EPaperStudentMapper ePaperStudentMapper;
49
     private EPaperStudentMapper ePaperStudentMapper;
50
+    @Resource
51
+    private EBaseMacMapper eBaseMacMapper;
48
 
52
 
49
     /**
53
     /**
50
      * 发起考试
54
      * 发起考试
295
         b.setExamcomm(examcomm);
299
         b.setExamcomm(examcomm);
296
         eBaseMapper.updateByPrimaryKeySelective(b);
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 View File

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 View File

19
     private Integer tjnum;//提交人数
19
     private Integer tjnum;//提交人数
20
     private Integer pynum;//批阅人数
20
     private Integer pynum;//批阅人数
21
     private Integer wpynum;//我批阅人数
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 View File

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 View File

49
     </select>
49
     </select>
50
     <!--随机获取一条待批阅试题-->
50
     <!--随机获取一条待批阅试题-->
51
     <select id="getCorrectQuestion" resultType="com.xhkjedu.sexam.vo.paper.EPaperSQuestionVo">
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
         from e_paper_student_question psq where psq.eptqid=#{eptqid}
53
         from e_paper_student_question psq where psq.eptqid=#{eptqid}
54
         and psq.answered=1 and (psq.checked=0 or (psq.checked=1 and psq.checkid=#{teacherid}))
54
         and psq.answered=1 and (psq.checked=0 or (psq.checked=1 and psq.checkid=#{teacherid}))
55
         <if test="classids!=null and classids!=''">
55
         <if test="classids!=null and classids!=''">
68
         update e_paper_student_question set checked=1,checkid=#{teacherid} where epsqid=#{epsqid}
68
         update e_paper_student_question set checked=1,checkid=#{teacherid} where epsqid=#{epsqid}
69
     </update>
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
         from e_paper_student_question psq where psq.eptqid=#{eptqid} and psq.checked=2 and psq.checkid=#{teacherid}
73
         from e_paper_student_question psq where psq.eptqid=#{eptqid} and psq.checked=2 and psq.checkid=#{teacherid}
74
         order by psq.checktime desc limit 1
74
         order by psq.checktime desc limit 1
75
     </select>
75
     </select>

+ 1
- 1
sexam/src/main/resources/mapper/paper/EPaperCorrectquestionMapper.xml View File

14
     <!--获取主观题题号-->
14
     <!--获取主观题题号-->
15
     <select id="listQnByEpId" resultType="java.util.Map">
15
     <select id="listQnByEpId" resultType="java.util.Map">
16
         select q.qn,q.qorder,q.eptqid
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
     </select>
18
     </select>
19
 </mapper>
19
 </mapper>

Loading…
Cancel
Save