Procházet zdrojové kódy

网关排除依赖

补录成绩
ywx
王宁 před 1 měsícem
rodič
revize
e2c2cbb44f
20 změnil soubory, kde provedl 889 přidání a 30 odebrání
  1. 7
    0
      gateway/pom.xml
  2. 80
    0
      smarking/src/main/java/com/xhkjedu/smarking/controller/exam/SubjectScoreController.java
  3. 20
    15
      smarking/src/main/java/com/xhkjedu/smarking/controller/stupaper/MsPaperStudentQuestionScoreController.java
  4. 144
    0
      smarking/src/main/java/com/xhkjedu/smarking/controller/stupaper/MsPaperStudentScoreController.java
  5. 29
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/exam/SubjectScoreMapper.java
  6. 10
    1
      smarking/src/main/java/com/xhkjedu/smarking/mapper/stupaper/MsPaperStudentMapper.java
  7. 8
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/stupaper/MsPaperStudentQuestionScoreMapper.java
  8. 31
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/stupaper/MsPaperStudentScoreMapper.java
  9. 4
    4
      smarking/src/main/java/com/xhkjedu/smarking/model/stupaper/MsPaperStudentQuestionScore.java
  10. 40
    0
      smarking/src/main/java/com/xhkjedu/smarking/model/stupaper/MsPaperStudentScore.java
  11. 111
    0
      smarking/src/main/java/com/xhkjedu/smarking/service/exam/SubjectScoreService.java
  12. 28
    9
      smarking/src/main/java/com/xhkjedu/smarking/service/stupaper/MsPaperStudentQuestionScoreService.java
  13. 149
    0
      smarking/src/main/java/com/xhkjedu/smarking/service/stupaper/MsPaperStudentScoreService.java
  14. 31
    0
      smarking/src/main/java/com/xhkjedu/smarking/vo/exam/MissExamVo.java
  15. 23
    0
      smarking/src/main/java/com/xhkjedu/smarking/vo/stupaper/PaperStuScoreVo.java
  16. 3
    1
      smarking/src/main/resources/mapper/exam/MsClassStudentMapper.xml
  17. 53
    0
      smarking/src/main/resources/mapper/exam/SubjectScoreMapper.xml
  18. 19
    0
      smarking/src/main/resources/mapper/stupaper/MsPaperStudentMapper.xml
  19. 22
    0
      smarking/src/main/resources/mapper/stupaper/MsPaperStudentQuestionScoreMapper.xml
  20. 77
    0
      smarking/src/main/resources/mapper/stupaper/MsPaperStudentScoreMapper.xml

+ 7
- 0
gateway/pom.xml Zobrazit soubor

@@ -22,7 +22,14 @@
22 22
         <dependency>
23 23
             <groupId>org.springframework.cloud</groupId>
24 24
             <artifactId>spring-cloud-starter-gateway</artifactId>
25
+            <exclusions>
26
+                <exclusion>
27
+                    <groupId>io.netty</groupId>
28
+                    <artifactId>netty-transport-native-epoll</artifactId>
29
+                </exclusion>
30
+            </exclusions>
25 31
         </dependency>
32
+
26 33
         <dependency>
27 34
             <groupId>org.springframework.cloud</groupId>
28 35
             <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>

+ 80
- 0
smarking/src/main/java/com/xhkjedu/smarking/controller/exam/SubjectScoreController.java Zobrazit soubor

@@ -0,0 +1,80 @@
1
+package com.xhkjedu.smarking.controller.exam;
2
+
3
+import com.github.pagehelper.PageHelper;
4
+import com.github.pagehelper.PageInfo;
5
+import com.xhkjedu.smarking.model.exam.MsClassStudent;
6
+import com.xhkjedu.smarking.model.exam.MsExam;
7
+import com.xhkjedu.smarking.service.exam.SubjectScoreService;
8
+import com.xhkjedu.smarking.vo.exam.SCStudentVo;
9
+import com.xhkjedu.utils.N_Utils;
10
+import com.xhkjedu.utils.PageUtil;
11
+import com.xhkjedu.vo.PageResult;
12
+import com.xhkjedu.vo.ResultVo;
13
+import org.springframework.web.bind.annotation.PostMapping;
14
+import org.springframework.web.bind.annotation.RequestBody;
15
+import org.springframework.web.bind.annotation.RequestMapping;
16
+import org.springframework.web.bind.annotation.RestController;
17
+
18
+import javax.annotation.Resource;
19
+import java.util.List;
20
+import java.util.Map;
21
+
22
+/**
23
+ * @Description 阅卷考试表相关操作
24
+ * @Author auto
25
+ * @Date 2024-10-15
26
+ */
27
+@RestController
28
+@RequestMapping("/sscore")
29
+public class SubjectScoreController {
30
+    @Resource
31
+    private SubjectScoreService subjectScoreService;
32
+    /*
33
+     * @Description 成绩管理-科目成绩列表
34
+     * @Date 2024/11/11 15:25:52
35
+     * @Author WN
36
+     * @Param [msExam]
37
+     * @Return com.xhkjedu.vo.ResultVo
38
+     **/
39
+    @PostMapping("/list")
40
+    public ResultVo listExamSubjectScore(@RequestBody MsExam msExam) {
41
+        Integer examid = msExam.getExamid();
42
+        N_Utils.validation(new Object[]{examid, "考试id", 1});
43
+        return new ResultVo(0, "获取成功", subjectScoreService.listExamSubjectScore(examid));
44
+    }
45
+
46
+    /*
47
+     * @Description 成绩管理-缺考学生
48
+     * @Date 2024/11/11 15:56:13
49
+     * @Author WN
50
+     * @Param [cvo]
51
+     * @Return com.xhkjedu.vo.ResultVo
52
+     **/
53
+    @PostMapping("/miss")
54
+    public ResultVo listExamSubjectMiss(@RequestBody MsClassStudent cvo) {
55
+        Integer page = cvo.getPage();
56
+        Integer size = cvo.getPageSize();
57
+        N_Utils.validation(new Object[]{cvo.getExamid(), "考试id", 1,cvo.getSubjectid(), "科目id", 2,page, "显示页码", 1, size, "显示条数", 1});
58
+
59
+        PageHelper.startPage(page, size);
60
+        List<Map<String, Object>> list = subjectScoreService.listExamSubjectScoreByClass(cvo);
61
+        PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
62
+        return new ResultVo(0, "获取成功", pageResult);
63
+    }
64
+
65
+    /*
66
+     * @Description 成绩管理-缺考学生-导出
67
+     * @Date 2024/11/11 15:56:13
68
+     * @Author WN
69
+     * @Param [cvo]
70
+     * @Return com.xhkjedu.vo.ResultVo
71
+     **/
72
+    @PostMapping("/miss_export")
73
+    public ResultVo listExamSubjectMissExport(@RequestBody SCStudentVo cvo) {
74
+        N_Utils.validation(new Object[]{cvo.getExamid(), "考试id", 1});
75
+        if(!N_Utils.isListNotEmpty(cvo.getSubjectids())){
76
+            return new ResultVo(1, "请选择科目");
77
+        }
78
+        return new ResultVo(0, "获取成功", subjectScoreService.listSubjectMissStudentExport(cvo));
79
+    }
80
+}

+ 20
- 15
smarking/src/main/java/com/xhkjedu/smarking/controller/stupaper/MsPaperStudentQuestionScoreController.java Zobrazit soubor

@@ -2,16 +2,21 @@ package com.xhkjedu.smarking.controller.stupaper;
2 2
 
3 3
 import com.github.pagehelper.PageHelper;
4 4
 import com.github.pagehelper.PageInfo;
5
+import com.xhkjedu.smarking.model.exam.MsClassStudent;
5 6
 import com.xhkjedu.smarking.model.stupaper.MsPaperStudentQuestionScore;
6 7
 import com.xhkjedu.smarking.service.stupaper.MsPaperStudentQuestionScoreService;
7 8
 import com.xhkjedu.utils.N_Utils;
8 9
 import com.xhkjedu.utils.PageUtil;
9 10
 import com.xhkjedu.vo.PageResult;
10 11
 import com.xhkjedu.vo.ResultVo;
11
-import org.springframework.web.bind.annotation.*;
12
+import org.springframework.web.bind.annotation.PostMapping;
13
+import org.springframework.web.bind.annotation.RequestBody;
14
+import org.springframework.web.bind.annotation.RequestMapping;
15
+import org.springframework.web.bind.annotation.RestController;
12 16
 
13 17
 import javax.annotation.Resource;
14 18
 import java.util.List;
19
+import java.util.Map;
15 20
 
16 21
 /**
17 22
  * @Description 阅卷学生分数修改历史表相关操作
@@ -19,7 +24,7 @@ import java.util.List;
19 24
  * @Date 2024-10-15
20 25
  */
21 26
 @RestController
22
-@RequestMapping("/msPaperStudentQuestionScore")
27
+@RequestMapping("/mstuqc")
23 28
 public class MsPaperStudentQuestionScoreController {
24 29
     @Resource
25 30
     private MsPaperStudentQuestionScoreService msPaperStudentQuestionScoreService;
@@ -34,24 +39,24 @@ public class MsPaperStudentQuestionScoreController {
34 39
     @PostMapping("/save")
35 40
     public ResultVo save(@RequestBody MsPaperStudentQuestionScore msPaperStudentQuestionScore) {
36 41
         msPaperStudentQuestionScoreService.add(msPaperStudentQuestionScore);
37
-        return new ResultVo(0, "保存成功");
42
+        return new ResultVo(0, "保存成功");
38 43
     }
39 44
 
40
-    /**
41
-     * @Description 列表
42
-     * @Param [msPaperStudentQuestionScore]
43
-     * @Author auto
44
-     * @Date 2024-10-15
45
-     * @return com.xhkjedu.vo.ResultVo
45
+    /*
46
+     * @Description 修改分数-修改历史
47
+     * @Date 2024/11/11 17:57:01
48
+     * @Author WN
49
+     * @Param [cs]
50
+     * @Return com.xhkjedu.vo.ResultVo
46 51
      **/
47 52
     @PostMapping("/list")
48
-    public ResultVo queryList(@RequestBody MsPaperStudentQuestionScore msPaperStudentQuestionScore) {
49
-        Integer page = msPaperStudentQuestionScore.getPage();
50
-        Integer size = msPaperStudentQuestionScore.getPageSize();
51
-        N_Utils.validation(new Object[]{page, "显示页码", 1, size, "显示条数", 1});
53
+    public ResultVo queryList(@RequestBody MsClassStudent cs) {
54
+        Integer page = cs.getPage();
55
+        Integer size = cs.getPageSize();
56
+        N_Utils.validation(new Object[]{page, "显示页码", 1, size, "显示条数", 1,cs.getExamid(),"考试id",1});
52 57
         PageHelper.startPage(page, size);
53
-        List<MsPaperStudentQuestionScore> list = msPaperStudentQuestionScoreService.queryList(msPaperStudentQuestionScore);
58
+        List<Map<String, Object>> list = msPaperStudentQuestionScoreService.listStuQuestionScore(cs);
54 59
         PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
55
-        return new ResultVo(0, "查询成功!", pageResult);
60
+        return new ResultVo(0, "获取成功", pageResult);
56 61
     }
57 62
 }

+ 144
- 0
smarking/src/main/java/com/xhkjedu/smarking/controller/stupaper/MsPaperStudentScoreController.java Zobrazit soubor

@@ -0,0 +1,144 @@
1
+package com.xhkjedu.smarking.controller.stupaper;
2
+
3
+import com.github.pagehelper.PageHelper;
4
+import com.github.pagehelper.PageInfo;
5
+import com.xhkjedu.smarking.model.exam.MsClassStudent;
6
+import com.xhkjedu.smarking.model.stupaper.MsPaperStudentScore;
7
+import com.xhkjedu.smarking.service.stupaper.MsPaperStudentScoreService;
8
+import com.xhkjedu.smarking.vo.stupaper.PaperStuScoreVo;
9
+import com.xhkjedu.utils.N_Utils;
10
+import com.xhkjedu.utils.PageUtil;
11
+import com.xhkjedu.vo.PageResult;
12
+import com.xhkjedu.vo.ResultVo;
13
+import org.springframework.web.bind.annotation.PostMapping;
14
+import org.springframework.web.bind.annotation.RequestBody;
15
+import org.springframework.web.bind.annotation.RequestMapping;
16
+import org.springframework.web.bind.annotation.RestController;
17
+
18
+import javax.annotation.Resource;
19
+import java.util.List;
20
+import java.util.Map;
21
+
22
+/**
23
+ * @Description:补录成绩
24
+ * @Author: WN
25
+ * @Date: 2024/11/12 10:57:15
26
+ **/
27
+@RestController
28
+@RequestMapping("/mstuc")
29
+public class MsPaperStudentScoreController {
30
+    @Resource
31
+    private MsPaperStudentScoreService msPaperStudentScoreService;
32
+
33
+    /*
34
+     * @Description 补录成绩-列表
35
+     * @Date 2024/11/12 11:45:44
36
+     * @Author WN
37
+     * @Param [msPaperStudentScore]
38
+     * @Return com.xhkjedu.vo.ResultVo
39
+     **/
40
+    @PostMapping("/list")
41
+    public ResultVo list(@RequestBody MsPaperStudentScore msPaperStudentScore) {
42
+        N_Utils.validation(new Object[]{msPaperStudentScore.getExamid(), "考试id", 1});
43
+        List<Map<String, Object>> list = msPaperStudentScoreService.listPaperStudentScores(msPaperStudentScore.getExamid());
44
+        return new ResultVo(0, "获取成功",list);
45
+    }
46
+
47
+
48
+    /*
49
+     * @Description 补录成绩-保存单科
50
+     * @Date 2024/11/12 11:00:38
51
+     * @Author WN
52
+     * @Param [msPaperStudentScore]
53
+     * @Return com.xhkjedu.vo.ResultVo
54
+     **/
55
+    @PostMapping("/save")
56
+    public ResultVo save(@RequestBody MsPaperStudentScore msPaperStudentScore) {
57
+        N_Utils.validation(new Object[]{msPaperStudentScore.getMpsid(), "学生试卷id", 1,msPaperStudentScore.getFillscore(),"补录分数",1});
58
+        msPaperStudentScoreService.saveStudentScore(msPaperStudentScore);
59
+        return new ResultVo(0, "保存成功");
60
+    }
61
+
62
+    /*
63
+     * @Description 补录成绩-保存多科目
64
+     * @Date 2024/11/12 11:02:42
65
+     * @Author WN
66
+     * @Param [stuScoreVo]
67
+     * @Return com.xhkjedu.vo.ResultVo
68
+     **/
69
+    @PostMapping("/save_more")
70
+    public ResultVo saveMoreSubject(@RequestBody PaperStuScoreVo stuScoreVo) {
71
+        N_Utils.validation(new Object[]{stuScoreVo.getExamid(), "考试id", 1,stuScoreVo.getStudentid(), "学生id", 1});
72
+        if(N_Utils.isListEmpty(stuScoreVo.getStuscores())){
73
+            return new ResultVo(1, "补录科目不能为空");
74
+        }
75
+        msPaperStudentScoreService.saveBatchStudentScores(stuScoreVo);
76
+        return new ResultVo(0, "保存成功");
77
+    }
78
+
79
+    /*
80
+     * @Description 补录成绩-新增补录-班级学生
81
+     * @Date 2024/11/12 16:29:29
82
+     * @Author WN
83
+     * @Param [classStudent]
84
+     * @Return com.xhkjedu.vo.ResultVo
85
+     **/
86
+    @PostMapping("/stu")
87
+    public ResultVo listClassStudentForScore(@RequestBody MsClassStudent classStudent) {
88
+        Integer examid = classStudent.getExamid();
89
+        Integer classid = classStudent.getClassid();
90
+        N_Utils.validation(new Object[]{examid, "考试id", 1,classid, "班级id", 1});
91
+        List<Map<String, Object>> list = msPaperStudentScoreService.listStudentsForAdd(examid,classid);
92
+        return new ResultVo(0, "获取成功",list);
93
+    }
94
+
95
+    /*
96
+     * @Description 补录成绩-新增补录-学生科目分数
97
+     * @Date 2024/11/12 16:38:29
98
+     * @Author WN
99
+     * @Param [classStudent]
100
+     * @Return com.xhkjedu.vo.ResultVo
101
+     **/
102
+    @PostMapping("/stu_score")
103
+    public ResultVo listStudentSubjectScore(@RequestBody MsClassStudent classStudent) {
104
+        Integer examid = classStudent.getExamid();
105
+        Integer studentid = classStudent.getStudentid();
106
+        N_Utils.validation(new Object[]{examid, "考试id", 1,studentid, "学生id", 1});
107
+        List<Map<String, Object>> list = msPaperStudentScoreService.listStudentSubjectScores(examid,studentid);
108
+        return new ResultVo(0, "获取成功",list);
109
+    }
110
+
111
+    /*
112
+     * @Description 补录成绩-删除
113
+     * @Date 2024/11/12 15:40:59
114
+     * @Author WN
115
+     * @Param [stuScore]
116
+     * @Return com.xhkjedu.vo.ResultVo
117
+     **/
118
+    @PostMapping("/del")
119
+    public ResultVo deleteStuScore(@RequestBody MsPaperStudentScore stuScore) {
120
+        Integer examid = stuScore.getExamid();
121
+        Integer studentid = stuScore.getStudentid();
122
+        N_Utils.validation(new Object[]{examid, "考试id", 1,studentid, "学生id", 1});
123
+        msPaperStudentScoreService.deleteStuScore(examid,studentid);
124
+        return new ResultVo(0, "删除成功");
125
+    }
126
+
127
+    /*
128
+     * @Description 补录成绩-补录历史
129
+     * @Date 2024/11/12 11:33:02
130
+     * @Author WN
131
+     * @Param [stuScoreVo]
132
+     * @Return com.xhkjedu.vo.ResultVo
133
+     **/
134
+    @PostMapping("/list_history")
135
+    public ResultVo listStuScoreHistory(@RequestBody MsClassStudent stuScoreVo) {
136
+        Integer page = stuScoreVo.getPage();
137
+        Integer size = stuScoreVo.getPageSize();
138
+        N_Utils.validation(new Object[]{stuScoreVo.getExamid(), "考试id", 1,page, "显示页码", 1, size, "显示条数", 1});
139
+        PageHelper.startPage(page, size);
140
+        List<Map<String, Object>> list = msPaperStudentScoreService.listStuScoresHistory(stuScoreVo);
141
+        PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
142
+        return new ResultVo(0, "获取成功",pageResult);
143
+    }
144
+}

+ 29
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/exam/SubjectScoreMapper.java Zobrazit soubor

@@ -0,0 +1,29 @@
1
+package com.xhkjedu.smarking.mapper.exam;
2
+
3
+import com.xhkjedu.smarking.model.exam.MsClassStudent;
4
+import com.xhkjedu.smarking.vo.exam.MissExamVo;
5
+import com.xhkjedu.smarking.vo.exam.SCStudentVo;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+import java.util.List;
9
+import java.util.Map;
10
+
11
+/**
12
+ * @Description:成绩管理
13
+ * @Author: WN
14
+ * @Date: 2024/11/11 16:01:10
15
+ **/
16
+public interface SubjectScoreMapper {
17
+    //成绩管理-科目成绩
18
+    List<Map<String,Object>> listExamSubjectScore(@Param("examid") Integer examid);
19
+
20
+    //成绩管理-科目客观题主观题平均分
21
+    List<Map<String,Object>> listSubjectQuestionAvgScore(@Param("examid")Integer examid);
22
+
23
+    //成绩管理-缺考学生
24
+    List<Map<String,Object>> listSubjectMissStudents(@Param("stu") MsClassStudent stu);
25
+
26
+    //成绩管理-缺考学生导出
27
+    List<MissExamVo> listSubjectMissStudentExport(@Param("stu") SCStudentVo stu);
28
+
29
+}

+ 10
- 1
smarking/src/main/java/com/xhkjedu/smarking/mapper/stupaper/MsPaperStudentMapper.java Zobrazit soubor

@@ -4,6 +4,7 @@ import com.xhkjedu.base.TkMapper;
4 4
 import com.xhkjedu.smarking.model.exam.MsClassStudent;
5 5
 import com.xhkjedu.smarking.model.paper.MsPaperQtype;
6 6
 import com.xhkjedu.smarking.model.stupaper.MsPaperStudent;
7
+import com.xhkjedu.smarking.model.stupaper.MsPaperStudentScore;
7 8
 import com.xhkjedu.smarking.vo.exam.CStudentVo;
8 9
 import com.xhkjedu.smarking.vo.stupaper.PaperStuExamVo;
9 10
 import org.apache.ibatis.annotations.Param;
@@ -62,7 +63,7 @@ public interface MsPaperStudentMapper extends TkMapper<MsPaperStudent> {
62 63
     Integer getNumByExamIdAndSubjectIdAndStuId(@Param("student") MsClassStudent student);
63 64
 
64 65
     //学生考试-获取开始考试学生数量
65
-    Integer getStartNumByExamIdExamMode(@Param("examid") Integer examid, Integer exammode);
66
+    Integer getStartNumByExamIdExamMode(@Param("examid") Integer examid,@Param("exammode") Integer exammode);
66 67
     //清空试卷学生信息
67 68
     int deletePaperStuByMpid(@Param("mpid") Integer mpid);
68 69
 
@@ -71,4 +72,12 @@ public interface MsPaperStudentMapper extends TkMapper<MsPaperStudent> {
71 72
     //扫描异常-缺考异常-更改状态
72 73
     int updateBatchStuPaperSstate(@Param("list") List<MsPaperStudent> paperStudents);
73 74
 
75
+    //补录成绩-学生科目成绩
76
+    List<MsPaperStudent> listPaperStudentForFillScore(@Param("examid") Integer examid,@Param("studentid") Integer studentid);
77
+    //补录成绩-补录单科
78
+    int updateStuScoreForFillScore(@Param("psc") MsPaperStudentScore psc);
79
+    //补录成绩-补录多科
80
+    int updateBatchStuScoreForFillScore(@Param("list") List<MsPaperStudentScore> list);
81
+    //补录成绩-清空学生补录分数
82
+    int updateStuScoreForRestoreFillScore(@Param("examid") Integer examid,@Param("studentid") Integer studentid);
74 83
 }

+ 8
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/stupaper/MsPaperStudentQuestionScoreMapper.java Zobrazit soubor

@@ -1,7 +1,12 @@
1 1
 package com.xhkjedu.smarking.mapper.stupaper;
2 2
 
3 3
 import com.xhkjedu.base.TkMapper;
4
+import com.xhkjedu.smarking.model.exam.MsClassStudent;
4 5
 import com.xhkjedu.smarking.model.stupaper.MsPaperStudentQuestionScore;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+import java.util.List;
9
+import java.util.Map;
5 10
 
6 11
 /**
7 12
  * @Description 阅卷学生分数修改历史表 Mapper 接口
@@ -9,4 +14,7 @@ import com.xhkjedu.smarking.model.stupaper.MsPaperStudentQuestionScore;
9 14
  * @Date 2024-10-15
10 15
  */
11 16
 public interface MsPaperStudentQuestionScoreMapper extends TkMapper<MsPaperStudentQuestionScore> {
17
+
18
+    //修改分数-修改记录
19
+    List<Map<String, Object>> listStuQuestionScore(@Param("stu") MsClassStudent stu);
12 20
 }

+ 31
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/stupaper/MsPaperStudentScoreMapper.java Zobrazit soubor

@@ -0,0 +1,31 @@
1
+package com.xhkjedu.smarking.mapper.stupaper;
2
+
3
+import com.xhkjedu.base.TkMapper;
4
+import com.xhkjedu.smarking.model.exam.MsClassStudent;
5
+import com.xhkjedu.smarking.model.stupaper.MsPaperStudentScore;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+import java.util.List;
9
+import java.util.Map;
10
+
11
+/**
12
+ * @Description 阅卷学生补录成绩历史表 Mapper 接口
13
+ * @Author auto
14
+ * @Date 2024-11-11
15
+ */
16
+public interface MsPaperStudentScoreMapper extends TkMapper<MsPaperStudentScore> {
17
+
18
+    //补录成绩-列表
19
+    List<Map<String,Object>> listStuScores(@Param("examid")Integer examid);
20
+
21
+    //补录成绩-补录历史
22
+    List<Map<String,Object>> listStuScoresHistory(@Param("stu")MsClassStudent stu);
23
+
24
+    //补录成绩-删除学生补录成绩
25
+    int deleteStuScoreByExamid(@Param("examid")Integer examid,@Param("studentid")Integer studentid);
26
+
27
+    //补录成绩-新增补录-班级学生
28
+    List<Map<String,Object>> listStudentsForAdd(@Param("examid")Integer examid,@Param("classid")Integer classid);
29
+    //补录成绩-新增补录-学生科目分数
30
+    List<Map<String,Object>> listStudentSubjectScores(@Param("examid")Integer examid,@Param("studentid")Integer studentid);
31
+}

+ 4
- 4
smarking/src/main/java/com/xhkjedu/smarking/model/stupaper/MsPaperStudentQuestionScore.java Zobrazit soubor

@@ -25,14 +25,14 @@ public class MsPaperStudentQuestionScore extends BaseBean {
25 25
     private Integer studentid;
26 26
     //科目id
27 27
     private String subjectid;
28
-    //学生合并试题id
29
-    private Integer mpsqmid;
28
+    //学生试题id
29
+    private Integer mpsqid;
30 30
     //试题题号
31 31
     private String qn;
32
+    //修改前分值
33
+    private Double prescore;
32 34
     //学生原分值
33 35
     private Double stuscore;
34
-    //修改后分值
35
-    private Double upscore;
36 36
     //修改人ID
37 37
     private Integer createid;
38 38
     //修改时间

+ 40
- 0
smarking/src/main/java/com/xhkjedu/smarking/model/stupaper/MsPaperStudentScore.java Zobrazit soubor

@@ -0,0 +1,40 @@
1
+package com.xhkjedu.smarking.model.stupaper;
2
+
3
+import com.xhkjedu.model.BaseBean;
4
+import lombok.Data;
5
+
6
+import javax.persistence.Id;
7
+import javax.persistence.Table;
8
+import javax.persistence.Transient;
9
+
10
+/**
11
+ * @Description 阅卷学生补录成绩历史表
12
+ * @Author auto
13
+ * @Date 2024-11-11
14
+ */
15
+@Data
16
+@Table(name = "ms_paper_student_score")
17
+public class MsPaperStudentScore extends BaseBean {
18
+    @Id
19
+    //补录成绩历史ID
20
+    private Integer mpscoreid;
21
+    //考试id
22
+    private Integer examid;
23
+    //试卷id
24
+    private Integer mpid;
25
+    //科目id
26
+    private String subjectid;
27
+    //学生id
28
+    private Integer studentid;
29
+    //补录前分数
30
+    private Double fillpre;
31
+    //补录分数
32
+    private Double fillscore;
33
+    //创建人ID
34
+    private Integer createid;
35
+    //创建时间
36
+    private Integer createtime;
37
+
38
+    @Transient
39
+    private Integer mpsid;//学生试卷ID
40
+}

+ 111
- 0
smarking/src/main/java/com/xhkjedu/smarking/service/exam/SubjectScoreService.java Zobrazit soubor

@@ -0,0 +1,111 @@
1
+package com.xhkjedu.smarking.service.exam;
2
+
3
+import com.xhkjedu.smarking.mapper.exam.SubjectScoreMapper;
4
+import com.xhkjedu.smarking.model.exam.MsClassStudent;
5
+import com.xhkjedu.smarking.vo.exam.MissExamVo;
6
+import com.xhkjedu.smarking.vo.exam.SCStudentVo;
7
+import com.xhkjedu.utils.N_Utils;
8
+import org.springframework.stereotype.Service;
9
+
10
+import javax.annotation.Resource;
11
+import java.util.ArrayList;
12
+import java.util.LinkedHashMap;
13
+import java.util.List;
14
+import java.util.Map;
15
+import java.util.stream.Collectors;
16
+
17
+/**
18
+ * @Description:成绩管理
19
+ * @Author: WN
20
+ * @Date: 2024/11/11 15:57:31
21
+ **/
22
+@Service
23
+public class SubjectScoreService {
24
+    @Resource
25
+    private SubjectScoreMapper subjectScoreMapper;
26
+
27
+
28
+    /*
29
+     * @Description 成绩管理-科目成绩列表
30
+     * @Date 2024/11/11 15:24:34
31
+     * @Author WN
32
+     * @Param [examid]
33
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
34
+     **/
35
+    public List<Map<String, Object>> listExamSubjectScore(Integer examid){
36
+        //成绩管理-平均分计算:0分参与,缺考不参与
37
+        //科目下成绩信息
38
+        List<Map<String, Object>> list = subjectScoreMapper.listExamSubjectScore(examid);
39
+        //获取不缺考学生的所有成绩情况,计算客观题平均分、主观题平均分
40
+        List<Map<String,Object>> quelist = subjectScoreMapper.listSubjectQuestionAvgScore(examid);
41
+        for(Map<String,Object> map : list){
42
+            Object msid = map.get("msid");
43
+            Map<String,Object> queMap = quelist.stream().filter(q -> q.get("msid").equals(msid)).findFirst().orElse(null);
44
+            double avgobj = 0.0;
45
+            double avgsub = 0.0;
46
+            if(queMap!= null){
47
+                avgobj = (double) queMap.get("avgobj");
48
+                avgsub = (double) queMap.get("avgsub");
49
+            }
50
+            map.put("avgobj", avgobj);
51
+            map.put("avgsub", avgsub);
52
+        }
53
+
54
+        return list;
55
+    }
56
+
57
+    /*
58
+     * @Description 成绩管理-缺考学生
59
+     * @Date 2024/11/11 15:54:50
60
+     * @Author WN
61
+     * @Param [cvo]
62
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
63
+     **/
64
+    public List<Map<String, Object>> listExamSubjectScoreByClass(MsClassStudent cvo){
65
+        return subjectScoreMapper.listSubjectMissStudents(cvo);
66
+    }
67
+
68
+    /*
69
+     * @Description 成绩管理-缺考学生-导出
70
+     * @Date 2024/11/11 16:54:12
71
+     * @Author WN
72
+     * @Param [cvo]
73
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
74
+     **/
75
+    public List<Map<String, Object>> listSubjectMissStudentExport(SCStudentVo cvo){
76
+        List<MissExamVo> missList = subjectScoreMapper.listSubjectMissStudentExport(cvo);
77
+        //获取所有的科目信息
78
+        List<String> sublist = missList.stream().map(MissExamVo::getSubjectname).distinct().collect(Collectors.toList());
79
+        Map<String,List<MissExamVo>> stuMap = missList.stream().collect(Collectors.groupingBy(MissExamVo::getSubjectid));
80
+        List<Map<String, Object>> rtnMap = new ArrayList<>();
81
+
82
+        for(Map.Entry<String,List<MissExamVo>> entry : stuMap.entrySet()){
83
+            Map<String, Object> map = new LinkedHashMap<>();
84
+            List<MissExamVo> stuList = entry.getValue();
85
+            MissExamVo mevo = stuList.get(0);
86
+            map.put("studentid",mevo.getStudentid());
87
+            map.put("studentname",mevo.getStudentname());
88
+            map.put("classname",mevo.getClassname());
89
+            map.put("usersex",mevo.getUsersex());
90
+            map.put("examno",mevo.getExamno());
91
+
92
+            for(String subjectname : sublist){
93
+                MissExamVo subVo = stuList.stream().filter(vo -> vo.getSubjectname().equals(subjectname)).findFirst().orElse(null);
94
+                if(subVo == null){
95
+                    map.put(subjectname,"-");
96
+                }else{
97
+                    String str = "未上传";
98
+                    if(N_Utils.isTrueInteger(subVo.getBatchid())){
99
+                        str = "已上传";
100
+                    }
101
+
102
+                    map.put(subjectname,str);
103
+                }
104
+            }
105
+            rtnMap.add(map);
106
+        }
107
+
108
+        return rtnMap;
109
+    }
110
+
111
+}

+ 28
- 9
smarking/src/main/java/com/xhkjedu/smarking/service/stupaper/MsPaperStudentQuestionScoreService.java Zobrazit soubor

@@ -1,11 +1,17 @@
1 1
 package com.xhkjedu.smarking.service.stupaper;
2 2
 
3
+import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentQuestionMapper;
3 4
 import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentQuestionScoreMapper;
5
+import com.xhkjedu.smarking.model.exam.MsClassStudent;
6
+import com.xhkjedu.smarking.model.stupaper.MsPaperStudentQuestion;
4 7
 import com.xhkjedu.smarking.model.stupaper.MsPaperStudentQuestionScore;
8
+import com.xhkjedu.utils.N_Utils;
5 9
 import org.springframework.stereotype.Service;
10
+import org.springframework.transaction.annotation.Transactional;
6 11
 
7 12
 import javax.annotation.Resource;
8 13
 import java.util.List;
14
+import java.util.Map;
9 15
 
10 16
 /**
11 17
  * @Description 阅卷学生分数修改历史表 服务实现类
@@ -16,6 +22,8 @@ import java.util.List;
16 22
 public class MsPaperStudentQuestionScoreService {
17 23
     @Resource
18 24
     private MsPaperStudentQuestionScoreMapper msPaperStudentQuestionScoreMapper;
25
+    @Resource
26
+    private MsPaperStudentQuestionMapper msPaperStudentQuestionMapper;
19 27
 
20 28
     /**
21 29
      * @Description 新增
@@ -24,18 +32,29 @@ public class MsPaperStudentQuestionScoreService {
24 32
      * @Date 2024-10-15
25 33
      * @return void
26 34
      **/
35
+    @Transactional(rollbackFor = Exception.class)
27 36
     public void add(MsPaperStudentQuestionScore msPaperStudentQuestionScore){
28
-        msPaperStudentQuestionScoreMapper.insert(msPaperStudentQuestionScore);
37
+        //获取学生试卷试题信息
38
+        MsPaperStudentQuestion msPaperStudentQuestion = msPaperStudentQuestionMapper.selectByPrimaryKey(msPaperStudentQuestionScore.getMpsqsid());
39
+        msPaperStudentQuestionScore.setExamid(msPaperStudentQuestion.getExamid());
40
+        msPaperStudentQuestionScore.setMpid(msPaperStudentQuestion.getMpid());
41
+        msPaperStudentQuestionScore.setStudentid(msPaperStudentQuestion.getStudentid());
42
+        msPaperStudentQuestionScore.setQn(msPaperStudentQuestion.getQn());
43
+        msPaperStudentQuestionScore.setPrescore(msPaperStudentQuestion.getStuscore());
44
+        msPaperStudentQuestionScore.setCreatetime(N_Utils.getSecondTimestamp());
45
+        msPaperStudentQuestionScoreMapper.insert(msPaperStudentQuestionScore);//保存修改分数记录
46
+
29 47
     }
30 48
 
31
-    /**
32
-     * @Description 列表
33
-     * @Param [msPaperStudentQuestionScore]
34
-     * @Author auto
35
-     * @Date 2024-10-15
36
-     * @return java.util.List<com.xhkjedu.smarking.model.stupaper.MsPaperStudentQuestionScore>
49
+
50
+    /*
51
+     * @Description 修改分数-修改记录
52
+     * @Date 2024/11/11 17:54:16
53
+     * @Author WN
54
+     * @Param [student]
55
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
37 56
      **/
38
-    public List<MsPaperStudentQuestionScore> queryList(MsPaperStudentQuestionScore msPaperStudentQuestionScore){
39
-        return msPaperStudentQuestionScoreMapper.selectAll();
57
+    public List<Map<String,Object>> listStuQuestionScore(MsClassStudent student){
58
+        return msPaperStudentQuestionScoreMapper.listStuQuestionScore(student);
40 59
     }
41 60
 }

+ 149
- 0
smarking/src/main/java/com/xhkjedu/smarking/service/stupaper/MsPaperStudentScoreService.java Zobrazit soubor

@@ -0,0 +1,149 @@
1
+package com.xhkjedu.smarking.service.stupaper;
2
+
3
+import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentMapper;
4
+import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentScoreMapper;
5
+import com.xhkjedu.smarking.model.exam.MsClassStudent;
6
+import com.xhkjedu.smarking.model.stupaper.MsPaperStudent;
7
+import com.xhkjedu.smarking.model.stupaper.MsPaperStudentScore;
8
+import com.xhkjedu.smarking.vo.stupaper.PaperStuScoreVo;
9
+import com.xhkjedu.utils.N_Utils;
10
+import org.springframework.stereotype.Service;
11
+import org.springframework.transaction.annotation.Transactional;
12
+
13
+import javax.annotation.Resource;
14
+import java.util.ArrayList;
15
+import java.util.List;
16
+import java.util.Map;
17
+
18
+/**
19
+ * @Description:补录成绩
20
+ * @Author: WN
21
+ * @Date: 2024/11/11 17:24:33
22
+ **/
23
+@Service
24
+public class MsPaperStudentScoreService {
25
+    @Resource
26
+    private MsPaperStudentScoreMapper msPaperStudentScoreMapper;
27
+    @Resource
28
+    private MsPaperStudentMapper msPaperStudentMapper;
29
+
30
+    /*
31
+     * @Description 补录成绩-列表
32
+     * @Date 2024/11/12 11:44:54
33
+     * @Author WN
34
+     * @Param [examid]
35
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
36
+     **/
37
+    public List<Map<String,Object>> listPaperStudentScores(Integer examid){
38
+        return msPaperStudentScoreMapper.listStuScores(examid);
39
+    }
40
+
41
+    /*
42
+     * @Description 补录成绩-补录单科
43
+     * @Date 2024/11/12 9:53:21
44
+     * @Author WN
45
+     * @Param [msPaperStudentScore]
46
+     * @Return void
47
+     **/
48
+    @Transactional(rollbackFor = Exception.class)
49
+    public void saveStudentScore(MsPaperStudentScore msPaperStudentScore){
50
+        MsPaperStudent paperStudent = msPaperStudentMapper.selectByPrimaryKey(msPaperStudentScore.getMpsid());
51
+        msPaperStudentScore.setMpid(paperStudent.getMpid());
52
+        msPaperStudentScore.setExamid(paperStudent.getExamid());
53
+        msPaperStudentScore.setSubjectid(paperStudent.getSubjectid());
54
+        msPaperStudentScore.setStudentid(paperStudent.getStudentid());
55
+        msPaperStudentScore.setFillpre(paperStudent.getStuscore());
56
+        msPaperStudentScore.setCreatetime(N_Utils.getSecondTimestamp());
57
+        msPaperStudentScoreMapper.insert(msPaperStudentScore);//保存补录历史
58
+        msPaperStudentMapper.updateStuScoreForFillScore(msPaperStudentScore);//修改学生分数
59
+    }
60
+
61
+    /*
62
+     * @Description 补录成绩-补录多科
63
+     * @Date 2024/11/12 10:20:37
64
+     * @Author WN
65
+     * @Param [list]
66
+     * @Return void
67
+     **/
68
+    @Transactional(rollbackFor = Exception.class)
69
+    public void saveBatchStudentScores(PaperStuScoreVo stuscore){
70
+        //获取考试对应学生所有科目信息
71
+        List<MsPaperStudent> paperStudents = msPaperStudentMapper.listPaperStudentForFillScore(stuscore.getExamid(), stuscore.getStudentid());
72
+
73
+        List<MsPaperStudentScore> list = stuscore.getStuscores();
74
+        List<MsPaperStudentScore> saveScore = new ArrayList<>();
75
+        Integer timestamp = N_Utils.getSecondTimestamp();
76
+        for(MsPaperStudentScore pscore : list){
77
+            //补录分数大于0时保存
78
+            if(pscore.getFillscore()!=null && pscore.getFillscore()>0){
79
+                pscore.setCreateid(stuscore.getCreateid());
80
+                pscore.setCreatetime(timestamp);
81
+                pscore.setExamid(stuscore.getExamid());
82
+                pscore.setStudentid(stuscore.getStudentid());
83
+
84
+                //根据学生试卷ID获取其他信息
85
+                MsPaperStudent paperStudent = paperStudents.stream().filter(ps -> ps.getMpsid().equals(pscore.getMpsid())).findFirst().get();
86
+                pscore.setMpid(paperStudent.getMpid());
87
+                pscore.setSubjectid(paperStudent.getSubjectid());
88
+                pscore.setFillpre(paperStudent.getStuscore());
89
+                saveScore.add(pscore);
90
+            }
91
+        }
92
+
93
+        if(!saveScore.isEmpty()){
94
+            msPaperStudentScoreMapper.insertList(saveScore);//保存补录历史
95
+            msPaperStudentMapper.updateBatchStuScoreForFillScore(saveScore);//修改学生分数
96
+        }
97
+    }
98
+
99
+    /*
100
+     * @Description 补录成绩-删除
101
+     * @Date 2024/11/12 15:39:22
102
+     * @Author WN
103
+     * @Param [examid, studentid]
104
+     * @Return void
105
+     **/
106
+    public void deleteStuScore(Integer examid,Integer studentid){
107
+        //删除学生所有科目补录成绩
108
+        msPaperStudentScoreMapper.deleteStuScoreByExamid(examid,studentid);
109
+        //恢复学生补录成绩
110
+        msPaperStudentMapper.updateStuScoreForRestoreFillScore(examid,studentid);
111
+    }
112
+
113
+    /*
114
+     * @Description 补录成绩-补录记录
115
+     * @Date 2024/11/12 11:31:07
116
+     * @Author WN
117
+     * @Param [classStudent]
118
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
119
+     **/
120
+    public List<Map<String,Object>> listStuScoresHistory(MsClassStudent classStudent){
121
+        return msPaperStudentScoreMapper.listStuScoresHistory(classStudent);
122
+    }
123
+
124
+    /*
125
+     * @Description 补录成绩-新增补录-班级学生
126
+     * @Date 2024/11/12 16:27:16
127
+     * @Author WN
128
+     * @Param [examid, classid]
129
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
130
+     **/
131
+    public List<Map<String,Object>> listStudentsForAdd(Integer examid, Integer classid){
132
+        return msPaperStudentScoreMapper.listStudentsForAdd(examid, classid);
133
+    }
134
+
135
+    /*
136
+     * @Description 补录成绩-新增补录-学生科目分数
137
+     * @Date 2024/11/12 16:34:53
138
+     * @Author WN
139
+     * @Param [examid, studentid]
140
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
141
+     **/
142
+    public List<Map<String,Object>> listStudentSubjectScores(Integer examid, Integer studentid){
143
+        return msPaperStudentScoreMapper.listStudentSubjectScores(examid, studentid);
144
+    }
145
+
146
+    public void saveBatch(){
147
+        //表格中学生在考生管理找不到时:统一成:学生不存在或没有参加本次考试
148
+    }
149
+}

+ 31
- 0
smarking/src/main/java/com/xhkjedu/smarking/vo/exam/MissExamVo.java Zobrazit soubor

@@ -0,0 +1,31 @@
1
+package com.xhkjedu.smarking.vo.exam;
2
+
3
+import lombok.Data;
4
+
5
+/**
6
+ * @Description:缺考学生信息
7
+ * @Author: WN
8
+ * @Date: 2024/11/11 16:17:31
9
+ **/
10
+@Data
11
+public class MissExamVo {
12
+
13
+    private Integer studentid;
14
+
15
+    private String studentname;
16
+
17
+    private Integer usersex;
18
+
19
+    private String classname;
20
+
21
+    private String examno;
22
+
23
+    private String subjectid;
24
+
25
+    private String subjectname;
26
+
27
+    private Integer mpsid;
28
+
29
+    private Integer batchid;
30
+
31
+}

+ 23
- 0
smarking/src/main/java/com/xhkjedu/smarking/vo/stupaper/PaperStuScoreVo.java Zobrazit soubor

@@ -0,0 +1,23 @@
1
+package com.xhkjedu.smarking.vo.stupaper;
2
+
3
+import com.xhkjedu.smarking.model.stupaper.MsPaperStudentScore;
4
+import lombok.Data;
5
+
6
+import java.util.List;
7
+
8
+/**
9
+ * @Description:学生成绩
10
+ * @Author: WN
11
+ * @Date: 2024/11/12 10:40:37
12
+ **/
13
+@Data
14
+public class PaperStuScoreVo {
15
+
16
+    private Integer examid;//考试ID
17
+
18
+    private Integer studentid;// 学生ID
19
+
20
+    private Integer createid;// 创建人ID
21
+
22
+    private List<MsPaperStudentScore> stuscores;//学生考试成绩列表
23
+}

+ 3
- 1
smarking/src/main/resources/mapper/exam/MsClassStudentMapper.xml Zobrazit soubor

@@ -61,7 +61,7 @@
61 61
             and es.subjectid=#{cs.subjectid}
62 62
         </if>
63 63
         <if test="cs.studentname!=null and cs.studentname!=''">
64
-            and (u.username like '%${cs.studentname}%' or u.studentno like '%${cs.studentname}%')
64
+            and (u.username like '%${cs.studentname}%' or u.examno like '%${cs.studentname}%')
65 65
         </if>
66 66
         group by es.studentid,es.subjectid
67 67
         order by es.mcsid desc
@@ -122,4 +122,6 @@
122 122
                         left join ms_paper_student ps on cs.examid=ps.examid and cs.studentid=ps.studentid
123 123
         where c.examid=#{cs.examid} and c.classid=#{cs.classid}
124 124
     </delete>
125
+
126
+
125 127
 </mapper>

+ 53
- 0
smarking/src/main/resources/mapper/exam/SubjectScoreMapper.xml Zobrazit soubor

@@ -0,0 +1,53 @@
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.smarking.mapper.exam.SubjectScoreMapper">
4
+
5
+    <!--成绩管理-科目成绩-->
6
+    <select id="listExamSubjectScore" resultType="java.util.Map">
7
+        select s.msid,s.subjectid,s.subjectname,count(ps.mpsid) stunum,count(if(ps.sstate=3,ps.mpsid,null)) missnum,
8
+        max(if(ps.sstate &lt; 3,ps.stuscore,null)) maxscore,min(if(ps.sstate &lt; 3,ps.stuscore,null)) minscore,
9
+        ROUND(avg(if(ps.sstate &lt; 3,ps.stuscore,null)),2) avgscore
10
+        from ms_subject s left join ms_paper_student ps on s.msid=ps.msid
11
+        where s.examid=#{examid} group by s.subjectid order by s.msid
12
+    </select>
13
+
14
+
15
+    <!--成绩管理-科目客观题主观题平均分-->
16
+    <select id="listSubjectQuestionAvgScore" resultType="java.util.Map">
17
+        select ps.msid,q.subjectid,ROUND(avg(if(q.ctype in (1,2,4,5,6),q.stuscore,null)),2) avgobj,
18
+        ROUND(avg(if(q.ctype in (3,13,14,15),q.stuscore,null)),2) avgsub
19
+        from ms_paper_student_question q
20
+        left join ms_paper_student ps on q.mpsid=ps.mpsid
21
+        where ps.examid=#{examid} and ps.sstate &lt; 3 group by ps.subjectid order by ps.msid
22
+    </select>
23
+
24
+    <!--成绩管理-缺考学生-->
25
+    <select id="listSubjectMissStudents" resultType="java.util.Map">
26
+        select DISTINCT ps.studentid,cs.classid,u.username as studentname,u.usersex,u.examno,ps.batchid from ms_paper_student ps
27
+        left join ms_class_student cs on ps.studentid=cs.studentid
28
+        left join t_user u on cs.studentid=u.userid
29
+        where ps.examid=#{stu.examid} and ps.subjectid=#{stu.subjectid} and ps.sstate=3
30
+        <if test="stu.classid!=null and stu.classid!=0">
31
+            ,and cs.classid=#{stu.classid}
32
+        </if>
33
+        <if test="stu.studentname!=null and stu.studentname!=''">
34
+            and (u.username like concat('%', #{stu.studentname}, '%') or u.examno like concat('%',#{stu.studentname},'%')
35
+        </if>
36
+        order by cs.mcsid
37
+    </select>
38
+
39
+    <!--成绩管理-缺考学生-导出-->
40
+    <select id="listSubjectMissStudentExport" resultType="com.xhkjedu.smarking.vo.exam.MissExamVo">
41
+        select distinct ps.mspid,ps.batchid,ps.studentid,cs.classid,u.username studentname,u.usersex,u.examno,c.classname,ps.subjectid,s.subjectname
42
+        from ms_paper_student ps
43
+        left join ms_class_student cs on ps.studentid=cs.studentid
44
+        left join ms_class c on cs.classid=c.classid and ps.examid=c.examid
45
+        left join t_user u on cs.studentid=u.userid
46
+        left join ms_subject s on ps.subjectid=s.subjectid
47
+        where ps.examid=#{stu.examid} and ps.subjectid in
48
+        <foreach collection="stu.subjectids" item="s" open="(" close=")" separator=",">
49
+            #{s}
50
+        </foreach>
51
+        order by ps.msid,c.classtype,c.classid,c.mcid,cs.mcsid
52
+    </select>
53
+</mapper>

+ 19
- 0
smarking/src/main/resources/mapper/stupaper/MsPaperStudentMapper.xml Zobrazit soubor

@@ -247,5 +247,24 @@
247 247
         </foreach>
248 248
     </update>
249 249
 
250
+    <!--补录成绩-学生科目成绩-->
251
+    <select id="listPaperStudentForFillScore" resultType="com.xhkjedu.smarking.model.stupaper.MsPaperStudent">
252
+        select * from ms_paper_student where examid=#{examid} and studentid=#{studentid}
253
+    </select>
254
+
255
+    <!--补录成绩-补录单科-->
256
+    <update id="updateStuScoreForFillScore">
257
+        update ms_paper_student set stuscore=#{psc.fillscore},stuscoretype=2 where mpsid=#{psc.mpsid}
258
+    </update>
259
+    <!--补录成绩-补录多科-->
260
+    <update id="updateBatchStuScoreForFillScore">
261
+        <foreach collection="list" item="p" separator=";">
262
+            update ms_paper_student set stuscore=#{p.fillscore},stuscoretype=2 where mpsid=#{p.mpsid}
263
+        </foreach>
264
+    </update>
265
+    <!--补录成绩-清空学生补录分数-->
266
+    <update id="updateStuScoreForRestoreFillScore">
267
+        update ms_paper_student set stuscore=0.0,stuscoretype=0 where examid=#{examid} and studentid=#{studentid}
268
+    </update>
250 269
 
251 270
 </mapper>

+ 22
- 0
smarking/src/main/resources/mapper/stupaper/MsPaperStudentQuestionScoreMapper.xml Zobrazit soubor

@@ -1,4 +1,26 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentQuestionScoreMapper">
4
+
5
+    <!--修改分数-修改记录-->
6
+    <select id="listStuQuestionScore" resultType="java.util.Map">
7
+        select distinct q.* ,s.subjectname,u.username as studentname,u.usersex,u.examno,c.classname
8
+        from ms_paper_student_question_score q
9
+        left join ms_subject s on q.examid=s.examid and q.subjectid=s.subjectid
10
+        left join t_user u on q.studentid=u.userid
11
+        left join ms_class_student cs on q.examid=cs.examid and q.subjectid=cs.subjectid and q.studentid=cs.studentid
12
+        left join ms_class c on q.examid=c.examid and q.subjectid=c.subjectid and cs.classid=c.classid
13
+        where q.examid=#{stu.examid}
14
+        <if test="stu.subjectid!=null and stu.stu.subjectid!=''">
15
+            and q.subjectid=#{stu.subjectid}
16
+        </if>
17
+        <if test="stu.classid!=null and stu.classid!=0">
18
+            and cs.classid=#{stu.classid}
19
+        </if>
20
+        <if test="stu.studentname!=null and stu.studentname!=''">
21
+            and (u.username like concat('%', #{stu.studentname}, '%') or u.examno like concat('%',#{stu.studentname},'%')
22
+        </if>
23
+        order by q.createtime desc,c.classtype
24
+    </select>
25
+
4 26
 </mapper>

+ 77
- 0
smarking/src/main/resources/mapper/stupaper/MsPaperStudentScoreMapper.xml Zobrazit soubor

@@ -0,0 +1,77 @@
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.smarking.mapper.stupaper.MsPaperStudentScoreMapper">
4
+
5
+    <!--补录成绩-列表-->
6
+    <resultMap id="stuScoreResult" type="java.util.Map">
7
+        <result column="examid" property="examid" />
8
+        <result column="studentid" property="studentid" />
9
+        <result column="studentname" property="studentname" />
10
+        <result column="examno" property="examno" />
11
+        <result column="classname" property="classname" />
12
+        <collection property="subjects" ofType="java.util.Map" javaType="java.util.ArrayList">
13
+            <result column="mpsid" property="mpsid" />
14
+            <result column="subjectid" property="subjectid" />
15
+            <result column="subjectname" property="subjectname" />
16
+            <result column="stuscore" property="stuscore" />
17
+            <result column="stuscoretype" property="stuscoretype" />
18
+        </collection>
19
+    </resultMap>
20
+    <select id="listStuScores" resultMap="stuScoreResult">
21
+        select ss.studentid,ss.examid,u.username as studentname,u.examno,c.classname,
22
+        ps.mpsid,ps.subjectid,s.subjectname,ps.stuscore,ps.stuscoretype
23
+        from ms_paper_student_score ss
24
+        left join ms_paper_student ps on ss.examid=ps.examid and ss.studentid=ps.studentid
25
+        left join ms_subject s on ss.examid=s.examid and ps.subjectid=s.subjectid
26
+        left join t_user u on ss.studentid=u.userid
27
+        left join ms_class_student cs on ss.examid=cs.examid and ss.studentid=cs.studentid
28
+        left join ms_class c on cs.classid=c.classid
29
+        where ss.examid=#{examid} group by ps.mpsid order by ss.createtime desc,c.classtype
30
+    </select>
31
+
32
+    <!--补录成绩-补录历史-->
33
+    <select id="listStuScoresHistory" resultType="java.util.Map">
34
+        select ss.fillscore,ss.createtime,s.subjectname,ss.studentid,u.username as studentname,
35
+        u.usersex,u.examno,c.classname
36
+        from ms_paper_student_score ss
37
+        left join ms_subject s on ss.examid=s.examid and ss.subjectid=s.subjectid
38
+        left join t_user u on ss.studentid=u.userid
39
+        left join ms_class_student cs on ss.examid=cs.examid and ss.studentid=cs.studentid
40
+        left join ms_class c on cs.classid=c.classid
41
+        where ss.examid=#{stu.examid}
42
+        <if test="stu.subjectid!=null and stu.subjectid!=''">
43
+            and ss.subjectid=#{stu.subjectid}
44
+        </if>
45
+        <if test="stu.classid!=null and stu.classid!=0">
46
+            and cs.classid=#{stu.classid}
47
+        </if>
48
+        <if test="stu.studentname!=null and stu.studentname!=''">
49
+            and (u.username like concat('%', #{stu.studentname}, '%') or u.examno like concat('%',#{stu.studentname},'%')
50
+        </if>
51
+        order by  ss.createtime desc,c.classtype
52
+    </select>
53
+
54
+    <!--补录成绩-删除学生补录成绩-->
55
+    <delete id="deleteStuScoreByExamid">
56
+        delete from ms_paper_student_score where examid=#{examid} and studentid=#{studentid}
57
+    </delete>
58
+
59
+    <!--补录成绩-新增补录-班级学生-->
60
+    <select id="listStudentsForAdd" resultType="java.util.Map">
61
+        select * from (select cs.studentid,cs.mcsid,u.username as studentname,u.examno,
62
+        (select count(*) from ms_paper_student ps where ps.examid=#{examid} and ps.studentid=cs.studentid
63
+        and ps.stuscore=0 and ps.stuscoretype=0) haszero
64
+        from ms_class_student cs
65
+        left join t_user u on cs.studentid=u.userid
66
+        where cs.examid=#{examid} and cs.classid=#{classid} group by cs.studentid order by cs.mcsid ) a order by a.haszero desc,a.mcsid
67
+    </select>
68
+
69
+    <!--补录成绩-新增补录-学生科目分数-->
70
+    <select id="listStudentSubjectScores" resultType="java.util.Map">
71
+        select ps.mpsid,ps.stuscore,ps.stuscoretype,ps.subjectid,s.subjectname
72
+        from ms_paper_student ps left join ms_subject s on ps.examid=s.examid and ps.subjectid=s.subjectid
73
+        where ps.examid=#{examid} and ps.studentid=#{studentid} order by s.msid
74
+    </select>
75
+
76
+
77
+</mapper>

Načítá se…
Zrušit
Uložit