Selaa lähdekoodia

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

# Conflicts:
#	sexam/src/main/java/com/xhkjedu/sexam/service/paperstudent/EPsqbatchService.java
tags/正式版本
雍文秀 2 vuotta sitten
vanhempi
commit
80ec7dca91

+ 29
- 4
sexam/src/main/java/com/xhkjedu/sexam/controller/paperstudent/EPsqbatchController.java Näytä tiedosto

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

+ 4
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/paperstudent/EPsqbatchMapper.java Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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: 考试补录批成绩详情表
@@ -27,9 +28,15 @@ public class EPsqbatchDetail extends BaseBean {
27 28
     private Integer epid;
28 29
     private Integer eptqid;
29 30
 
31
+    //试卷中试题id
32
+    private Integer eptqid;
33
+
30 34
     //学生试题id
31 35
     private Integer epsqid;
32 36
 
37
+    //试题题号
38
+    private String qn;
39
+
33 40
     //学生原得分
34 41
     private Double stuscore;
35 42
 
@@ -41,4 +48,7 @@ public class EPsqbatchDetail extends BaseBean {
41 48
 
42 49
     //修改时间
43 50
     private Integer createtime;
51
+
52
+    @Transient
53
+    private String username;//用户姓名
44 54
 }

+ 21
- 2
sexam/src/main/java/com/xhkjedu/sexam/service/paperstudent/EPsqbatchService.java Näytä tiedosto

@@ -1,5 +1,6 @@
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.exam.EClassStudentMapper;
4 5
 import com.xhkjedu.sexam.mapper.paper.EPaperQtypeQuestionMapper;
5 6
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentQuestionMapper;
@@ -39,6 +40,8 @@ public class EPsqbatchService {
39 40
     private EClassStudentMapper eClassStudentMapper;
40 41
     @Resource
41 42
     private EPaperStudentQuestionMapper ePaperStudentQuestionMapper;
43
+    @Resource
44
+    private EBaseMapper eBaseMapper;
42 45
 
43 46
     /**
44 47
      * @Description 获取考试科目
@@ -51,6 +54,11 @@ public class EPsqbatchService {
51 54
         return ePsqbatchMapper.listSubjectsByExamid(exmaid);
52 55
     }
53 56
 
57
+    //考试基本信息
58
+    public Map getExamInfo(Integer examid){
59
+        return eBaseMapper.findById(examid);
60
+    }
61
+
54 62
     /**
55 63
      * @Description 考试补录成绩批次信息
56 64
      * @Param [exmaid]
@@ -104,7 +112,7 @@ public class EPsqbatchService {
104 112
 
105 113
     //保存学生试题
106 114
     @Transactional(rollbackFor = Exception.class)
107
-    public void saveEPsqbatchDetail(EPsqbatchStuVo stu, EPsqbatch batch){
115
+    public void saveEPsqbatchDetail(EPsqbatchStuVo stu, EPsqbatch batch) {
108 116
         try {
109 117
             int timestamp = N_Utils.getSecondTimestamp();
110 118
             Integer batchId = batch.getId();
@@ -114,7 +122,7 @@ public class EPsqbatchService {
114 122
             List<EPsqbatchDetail> details = stu.getDetails();
115 123
             //获取试卷中所有试题
116 124
             List<Integer> eptqids = details.stream().map(d -> d.getEptqid()).collect(Collectors.toList());
117
-            List<EPaperStudentQuestion> questions = ePaperStudentQuestionMapper.listQuestionByStu(studentid,eptqids);
125
+            List<EPaperStudentQuestion> questions = ePaperStudentQuestionMapper.listQuestionByStu(studentid, eptqids);
118 126
             for (int i = 0; i < details.size(); i++) {
119 127
                 EPsqbatchDetail detail = details.get(i);
120 128
                 EPaperStudentQuestion question = questions.get(i);
@@ -131,4 +139,15 @@ public class EPsqbatchService {
131 139
             throw new RuntimeException("保存学生试题失败");
132 140
         }
133 141
     }
142
+
143
+    /**
144
+     * @Description 补录成绩批次详情
145
+     * @Param [ePsqbatchDetail]
146
+     * @Return java.util.List<java.util.Map>
147
+     * @Author wn
148
+     * @Date 2022/11/21 15:29
149
+     **/
150
+    public List<Map> listPsqBatchDetail(EPsqbatchDetail ePsqbatchDetail){
151
+        return ePsqbatchMapper.listPsqBatchDetail(ePsqbatchDetail);
152
+    }
134 153
 }

+ 5
- 3
sexam/src/main/resources/mapper/paperstudent/EPsqBatchMapper.xml Näytä tiedosto

@@ -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…
Peruuta
Tallenna