Browse Source

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

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

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

3
 import com.github.pagehelper.PageHelper;
3
 import com.github.pagehelper.PageHelper;
4
 import com.github.pagehelper.PageInfo;
4
 import com.github.pagehelper.PageInfo;
5
 import com.xhkjedu.sexam.model.paperstudent.EPsqbatch;
5
 import com.xhkjedu.sexam.model.paperstudent.EPsqbatch;
6
+import com.xhkjedu.sexam.model.paperstudent.EPsqbatchDetail;
6
 import com.xhkjedu.sexam.service.paperstudent.EPsqbatchService;
7
 import com.xhkjedu.sexam.service.paperstudent.EPsqbatchService;
7
 import com.xhkjedu.utils.N_Utils;
8
 import com.xhkjedu.utils.N_Utils;
8
 import com.xhkjedu.utils.PageUtil;
9
 import com.xhkjedu.utils.PageUtil;
18
 import javax.annotation.Resource;
19
 import javax.annotation.Resource;
19
 import java.util.List;
20
 import java.util.List;
20
 import java.util.Map;
21
 import java.util.Map;
22
+import java.util.TreeMap;
21
 
23
 
22
 /**
24
 /**
23
  * @Description 考试补录
25
  * @Description 考试补录
50
         try {
52
         try {
51
             Integer page = ePsqbatch.getPage();
53
             Integer page = ePsqbatch.getPage();
52
             Integer pageSize = ePsqbatch.getPageSize();
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
             PageHelper.startPage(page, pageSize);
57
             PageHelper.startPage(page, pageSize);
55
-            List<Map> rtnlst = ePsqbatchService.listPsqBatchsByExamid(ePsqbatch.getExamid());
58
+            List<Map> rtnlst = ePsqbatchService.listPsqBatchsByExamid(examid);
56
             PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(rtnlst));
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
         }catch (Exception e){
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
             return new ResultVo(0, "获取失败");
85
             return new ResultVo(0, "获取失败");
61
         }
86
         }
62
     }
87
     }

+ 4
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/paperstudent/EPsqbatchMapper.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.paperstudent.EPsqbatch;
4
 import com.xhkjedu.sexam.model.paperstudent.EPsqbatch;
5
+import com.xhkjedu.sexam.model.paperstudent.EPsqbatchDetail;
5
 import org.apache.ibatis.annotations.Param;
6
 import org.apache.ibatis.annotations.Param;
6
 import org.springframework.stereotype.Repository;
7
 import org.springframework.stereotype.Repository;
7
 
8
 
17
     //考试补录成绩批次信息
18
     //考试补录成绩批次信息
18
     List<Map> listPsqBatchsByExamid(@Param("examid")Integer examid);
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 View File

5
 
5
 
6
 import javax.persistence.Id;
6
 import javax.persistence.Id;
7
 import javax.persistence.Table;
7
 import javax.persistence.Table;
8
+import javax.persistence.Transient;
8
 
9
 
9
 /**
10
 /**
10
  * @Description: 考试补录批成绩详情表
11
  * @Description: 考试补录批成绩详情表
27
     private Integer epid;
28
     private Integer epid;
28
     private Integer eptqid;
29
     private Integer eptqid;
29
 
30
 
31
+    //试卷中试题id
32
+    private Integer eptqid;
33
+
30
     //学生试题id
34
     //学生试题id
31
     private Integer epsqid;
35
     private Integer epsqid;
32
 
36
 
37
+    //试题题号
38
+    private String qn;
39
+
33
     //学生原得分
40
     //学生原得分
34
     private Double stuscore;
41
     private Double stuscore;
35
 
42
 
41
 
48
 
42
     //修改时间
49
     //修改时间
43
     private Integer createtime;
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 View File

1
 package com.xhkjedu.sexam.service.paperstudent;
1
 package com.xhkjedu.sexam.service.paperstudent;
2
 
2
 
3
+import com.xhkjedu.sexam.mapper.exam.EBaseMapper;
3
 import com.xhkjedu.sexam.mapper.exam.EClassStudentMapper;
4
 import com.xhkjedu.sexam.mapper.exam.EClassStudentMapper;
4
 import com.xhkjedu.sexam.mapper.paper.EPaperQtypeQuestionMapper;
5
 import com.xhkjedu.sexam.mapper.paper.EPaperQtypeQuestionMapper;
5
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentQuestionMapper;
6
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentQuestionMapper;
39
     private EClassStudentMapper eClassStudentMapper;
40
     private EClassStudentMapper eClassStudentMapper;
40
     @Resource
41
     @Resource
41
     private EPaperStudentQuestionMapper ePaperStudentQuestionMapper;
42
     private EPaperStudentQuestionMapper ePaperStudentQuestionMapper;
43
+    @Resource
44
+    private EBaseMapper eBaseMapper;
42
 
45
 
43
     /**
46
     /**
44
      * @Description 获取考试科目
47
      * @Description 获取考试科目
51
         return ePsqbatchMapper.listSubjectsByExamid(exmaid);
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
      * @Description 考试补录成绩批次信息
63
      * @Description 考试补录成绩批次信息
56
      * @Param [exmaid]
64
      * @Param [exmaid]
104
 
112
 
105
     //保存学生试题
113
     //保存学生试题
106
     @Transactional(rollbackFor = Exception.class)
114
     @Transactional(rollbackFor = Exception.class)
107
-    public void saveEPsqbatchDetail(EPsqbatchStuVo stu, EPsqbatch batch){
115
+    public void saveEPsqbatchDetail(EPsqbatchStuVo stu, EPsqbatch batch) {
108
         try {
116
         try {
109
             int timestamp = N_Utils.getSecondTimestamp();
117
             int timestamp = N_Utils.getSecondTimestamp();
110
             Integer batchId = batch.getId();
118
             Integer batchId = batch.getId();
114
             List<EPsqbatchDetail> details = stu.getDetails();
122
             List<EPsqbatchDetail> details = stu.getDetails();
115
             //获取试卷中所有试题
123
             //获取试卷中所有试题
116
             List<Integer> eptqids = details.stream().map(d -> d.getEptqid()).collect(Collectors.toList());
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
             for (int i = 0; i < details.size(); i++) {
126
             for (int i = 0; i < details.size(); i++) {
119
                 EPsqbatchDetail detail = details.get(i);
127
                 EPsqbatchDetail detail = details.get(i);
120
                 EPaperStudentQuestion question = questions.get(i);
128
                 EPaperStudentQuestion question = questions.get(i);
131
             throw new RuntimeException("保存学生试题失败");
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 View File

12
     <select id="listPsqBatchsByExamid" resultType="java.util.Map">
12
     <select id="listPsqBatchsByExamid" resultType="java.util.Map">
13
         select b.batchid,b.subjectname,b.epid,b.stunum,b.teacherid,b.createtime,u.username teachername
13
         select b.batchid,b.subjectname,b.epid,b.stunum,b.teacherid,b.createtime,u.username teachername
14
         from e_psqbatch b left join t_user u on b.teacherid=u.userid
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
     </select>
16
     </select>
17
 
17
 
18
-    <!---->
18
+    <!--获取补录成绩批次详情-->
19
     <select id="listPsqBatchDetail" resultType="java.util.Map">
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
     </select>
23
     </select>
22
 
24
 
23
 </mapper>
25
 </mapper>

Loading…
Cancel
Save