Sfoglia il codice sorgente

补录成绩

tags/正式版本
王宁 2 anni fa
parent
commit
7f438ca03b

+ 29
- 4
sexam/src/main/java/com/xhkjedu/sexam/controller/paperstudent/EPsqbatchController.java Vedi File

@@ -3,6 +3,7 @@ package com.xhkjedu.sexam.controller.paperstudent;
3 3
 import com.github.pagehelper.PageHelper;
4 4
 import com.github.pagehelper.PageInfo;
5 5
 import com.xhkjedu.sexam.model.paperstudent.EPsqbatch;
6
+import com.xhkjedu.sexam.model.paperstudent.EPsqbatchDetail;
6 7
 import com.xhkjedu.sexam.service.paperstudent.EPsqbatchService;
7 8
 import com.xhkjedu.utils.N_Utils;
8 9
 import com.xhkjedu.utils.PageUtil;
@@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
17 18
 import javax.annotation.Resource;
18 19
 import java.util.List;
19 20
 import java.util.Map;
21
+import java.util.TreeMap;
20 22
 
21 23
 /**
22 24
  * @Description 考试补录
@@ -49,13 +51,36 @@ public class EPsqbatchController {
49 51
         try {
50 52
             Integer page = ePsqbatch.getPage();
51 53
             Integer pageSize = ePsqbatch.getPageSize();
52
-            N_Utils.validation(new Object[]{ePsqbatch.getExamid(), "考试id", 1,page,"当前页",1,pageSize,"每页条数",1});
54
+            Integer examid= ePsqbatch.getExamid();
55
+            N_Utils.validation(new Object[]{examid, "考试id", 1,page,"当前页",1,pageSize,"每页条数",1});
53 56
             PageHelper.startPage(page, pageSize);
54
-            List<Map> rtnlst = ePsqbatchService.listPsqBatchsByExamid(ePsqbatch.getExamid());
57
+            List<Map> rtnlst = ePsqbatchService.listPsqBatchsByExamid(examid);
55 58
             PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(rtnlst));
56
-            return new ResultVo(0, "成功获取补录成绩信息",pageResult);
59
+            Map map = ePsqbatchService.getExamInfo(examid);
60
+            Map rtnmap = new TreeMap();
61
+            rtnmap.put("total",pageResult.getTotal());
62
+            rtnmap.put("list",pageResult.getList());
63
+            rtnmap.put("exam",map);
64
+            return new ResultVo(0, "成功获取补录成绩信息",rtnmap);
57 65
         }catch (Exception e){
58
-            log.error("获取获取补录成绩出错:" + e.getMessage());
66
+            log.error("获取获取补录成绩信息出错:" + e.getMessage());
67
+            return new ResultVo(0, "获取失败");
68
+        }
69
+    }
70
+
71
+    //补录成绩详情
72
+    @PostMapping("/detail")
73
+    public ResultVo listPsqBatchDetail(@RequestBody EPsqbatchDetail ePsqbatchDetail) {
74
+        try {
75
+            Integer page = ePsqbatchDetail.getPage();
76
+            Integer pageSize = ePsqbatchDetail.getPageSize();
77
+            N_Utils.validation(new Object[]{ePsqbatchDetail.getBatchid(), "补录批次id", 1,page,"当前页",1,pageSize,"每页条数",1});
78
+            PageHelper.startPage(page, pageSize);
79
+            List<Map> rtnlst = ePsqbatchService.listPsqBatchDetail(ePsqbatchDetail);
80
+            PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(rtnlst));
81
+            return new ResultVo(0, "成功获取补录成绩详细信息",pageResult);
82
+        }catch (Exception e){
83
+            log.error("获取获取补录成绩详细信息出错:" + e.getMessage());
59 84
             return new ResultVo(0, "获取失败");
60 85
         }
61 86
     }

+ 4
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/paperstudent/EPsqbatchMapper.java Vedi File

@@ -2,6 +2,7 @@ package com.xhkjedu.sexam.mapper.paperstudent;
2 2
 
3 3
 import com.xhkjedu.sexam.base.TkMapper;
4 4
 import com.xhkjedu.sexam.model.paperstudent.EPsqbatch;
5
+import com.xhkjedu.sexam.model.paperstudent.EPsqbatchDetail;
5 6
 import org.apache.ibatis.annotations.Param;
6 7
 import org.springframework.stereotype.Repository;
7 8
 
@@ -17,4 +18,7 @@ public interface EPsqbatchMapper extends TkMapper<EPsqbatch> {
17 18
     //考试补录成绩批次信息
18 19
     List<Map> listPsqBatchsByExamid(@Param("examid")Integer examid);
19 20
 
21
+    //获取补录成绩批次详情
22
+    List<Map> listPsqBatchDetail(@Param("ed") EPsqbatchDetail ed);
23
+
20 24
 }

+ 10
- 0
sexam/src/main/java/com/xhkjedu/sexam/model/paperstudent/EPsqbatchDetail.java Vedi File

@@ -5,6 +5,7 @@ import lombok.Data;
5 5
 
6 6
 import javax.persistence.Id;
7 7
 import javax.persistence.Table;
8
+import javax.persistence.Transient;
8 9
 
9 10
 /**
10 11
  * @Description: 考试补录批成绩详情表
@@ -26,9 +27,15 @@ public class EPsqbatchDetail extends BaseBean {
26 27
     //试卷id
27 28
     private Integer epid;
28 29
 
30
+    //试卷中试题id
31
+    private Integer eptqid;
32
+
29 33
     //学生试题id
30 34
     private Integer epsqid;
31 35
 
36
+    //试题题号
37
+    private String qn;
38
+
32 39
     //学生原得分
33 40
     private Double stuscore;
34 41
 
@@ -40,4 +47,7 @@ public class EPsqbatchDetail extends BaseBean {
40 47
 
41 48
     //修改时间
42 49
     private Integer createtime;
50
+
51
+    @Transient
52
+    private String username;//用户姓名
43 53
 }

+ 20
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/paperstudent/EPsqbatchService.java Vedi File

@@ -1,6 +1,8 @@
1 1
 package com.xhkjedu.sexam.service.paperstudent;
2 2
 
3
+import com.xhkjedu.sexam.mapper.exam.EBaseMapper;
3 4
 import com.xhkjedu.sexam.mapper.paperstudent.EPsqbatchMapper;
5
+import com.xhkjedu.sexam.model.paperstudent.EPsqbatchDetail;
4 6
 import lombok.extern.slf4j.Slf4j;
5 7
 import org.springframework.stereotype.Service;
6 8
 
@@ -18,6 +20,8 @@ import java.util.Map;
18 20
 public class EPsqbatchService {
19 21
     @Resource
20 22
     private EPsqbatchMapper ePsqbatchMapper;
23
+    @Resource
24
+    private EBaseMapper eBaseMapper;
21 25
 
22 26
     /**
23 27
      * @Description 获取考试科目
@@ -30,6 +34,11 @@ public class EPsqbatchService {
30 34
         return ePsqbatchMapper.listSubjectsByExamid(exmaid);
31 35
     }
32 36
 
37
+    //考试基本信息
38
+    public Map getExamInfo(Integer examid){
39
+        return eBaseMapper.findById(examid);
40
+    }
41
+
33 42
     /**
34 43
      * @Description 考试补录成绩批次信息
35 44
      * @Param [exmaid]
@@ -40,4 +49,15 @@ public class EPsqbatchService {
40 49
     public List<Map> listPsqBatchsByExamid(Integer exmaid){
41 50
         return ePsqbatchMapper.listPsqBatchsByExamid(exmaid);
42 51
     }
52
+
53
+    /**
54
+     * @Description 补录成绩批次详情
55
+     * @Param [ePsqbatchDetail]
56
+     * @Return java.util.List<java.util.Map>
57
+     * @Author wn
58
+     * @Date 2022/11/21 15:29
59
+     **/
60
+    public List<Map> listPsqBatchDetail(EPsqbatchDetail ePsqbatchDetail){
61
+        return ePsqbatchMapper.listPsqBatchDetail(ePsqbatchDetail);
62
+    }
43 63
 }

+ 5
- 3
sexam/src/main/resources/mapper/paperstudent/EPsqBatchMapper.xml Vedi File

@@ -12,12 +12,14 @@
12 12
     <select id="listPsqBatchsByExamid" resultType="java.util.Map">
13 13
         select b.batchid,b.subjectname,b.epid,b.stunum,b.teacherid,b.createtime,u.username teachername
14 14
         from e_psqbatch b left join t_user u on b.teacherid=u.userid
15
-        where b.examid=1 order by b.batchid desc
15
+        where b.examid=#{examid} order by b.batchid desc
16 16
     </select>
17 17
 
18
-    <!---->
18
+    <!--获取补录成绩批次详情-->
19 19
     <select id="listPsqBatchDetail" resultType="java.util.Map">
20
-
20
+        select d.detailid,d.studentid,d.eptqid,d.qn,d.stuscore,d.newscore,d.createtime,
21
+        u.username,u.loginname from e_psqbatch_detail d left join t_user u on d.studentid=u.userid
22
+        where d.batchid=#{ed.batchid} order by studentid,d.eptqid
21 23
     </select>
22 24
 
23 25
 </mapper>

Loading…
Annulla
Salva