Browse Source

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

ywx
王宁 1 month ago
parent
commit
a6f11a87e6

+ 6
- 0
scommons/src/main/java/com/xhkjedu/exception/ErrorAdivceController.java View File

64
         return new ResultVo(1, "请求参数错误");
64
         return new ResultVo(1, "请求参数错误");
65
     }
65
     }
66
 
66
 
67
+    @ExceptionHandler(ServiceException.class)
68
+    public ResultVo missingParametersException(ServiceException ex) {
69
+        log.error("提示信息:   -------> {}", ex.getMessage());
70
+        return new ResultVo(1, ex.getMessage());
71
+    }
72
+
67
 
73
 
68
 }
74
 }

+ 87
- 0
smarking/src/main/java/com/xhkjedu/smarking/controller/papercheck/MsPaperCheckTeacherTaskController.java View File

120
         return new ResultVo(0, "查询成功", list);
120
         return new ResultVo(0, "查询成功", list);
121
     }
121
     }
122
 
122
 
123
+    /**
124
+     * @Description 教师阅卷-试题列表
125
+     * @Date 2024/11/13 17:59
126
+     * @Author YWX
127
+     * @Param [param]
128
+     * @Return com.xhkjedu.vo.ResultVo
129
+     **/
130
+    @PostMapping("/list_teacher_question")
131
+    public ResultVo listTeacherQuestion(@RequestBody MsCheckParam param) {
132
+        N_Utils.validation(new Object[]{param.getHandleid(), "操作人ID", 1, param.getMpid(), "试卷ID", 1});
133
+        List<Map> list = msPaperCheckTeacherTaskService.listTeacherQuestion(param);
134
+        return new ResultVo(0, "查询成功", list);
135
+    }
136
+
137
+    /**
138
+     * @Description 教师阅卷-班级列表
139
+     * @Date 2024/11/14 9:41
140
+     * @Author YWX
141
+     * @Param [param]
142
+     * @Return com.xhkjedu.vo.ResultVo
143
+     **/
144
+    @PostMapping("/list_teacher_class")
145
+    public ResultVo listTeacherClass(@RequestBody MsCheckParam param) {
146
+        N_Utils.validation(new Object[]{param.getHandleid(), "操作人ID", 1, param.getMpid(), "试卷ID", 1});
147
+        List<Map> list = msPaperCheckTeacherTaskService.listTeacherClass(param);
148
+        return new ResultVo(0, "查询成功", list);
149
+    }
150
+
123
     /**
151
     /**
124
      * @Description 获取待批题块
152
      * @Description 获取待批题块
125
      * @Date 2024/10/31 11:02
153
      * @Date 2024/10/31 11:02
148
                 , param.getMblockid(), "题块ID", 1
176
                 , param.getMblockid(), "题块ID", 1
149
                 , param.getChecktype(), "批阅情况", 1
177
                 , param.getChecktype(), "批阅情况", 1
150
                 , param.getMpsbid(), "学生试题ID", 1
178
                 , param.getMpsbid(), "学生试题ID", 1
179
+                , param.getQscore(), "试题分值", 2
151
         });
180
         });
152
         msPaperCheckTeacherTaskService.correct(param);
181
         msPaperCheckTeacherTaskService.correct(param);
153
         return new ResultVo(0, "保存成功");
182
         return new ResultVo(0, "保存成功");
183
         List<Map> list = msPaperCheckTeacherTaskService.detailByQuestion(mpid, mblockid);
212
         List<Map> list = msPaperCheckTeacherTaskService.detailByQuestion(mpid, mblockid);
184
         return new ResultVo(0, "查询成功", list);
213
         return new ResultVo(0, "查询成功", list);
185
     }
214
     }
215
+
216
+    /**
217
+     * @Description 教师阅卷-上一份
218
+     * @Date 2024/11/14 10:27
219
+     * @Author YWX
220
+     * @Param [param]
221
+     * @Return com.xhkjedu.vo.ResultVo
222
+     **/
223
+    @PostMapping("/get_pre_correct")
224
+    public ResultVo getPreCorrect(@RequestBody MsCheckParam param) {
225
+        N_Utils.validation(new Object[]{
226
+                param.getHandleid(), "操作人ID", 1
227
+                , param.getMpid(), "试卷ID", 1
228
+                , param.getMblockid(), "题块ID", 1
229
+                , param.getTaskorder(), "序号", 1
230
+        });
231
+        return new ResultVo(0, "查询成功", msPaperCheckTeacherTaskService.getPreCorrect(param));
232
+    }
233
+
234
+    /**
235
+     * @Description 教师阅卷-阅卷历史
236
+     * @Date 2024/11/14 14:12
237
+     * @Author YWX
238
+     * @Param [param]
239
+     * @Return com.xhkjedu.vo.ResultVo
240
+     **/
241
+    @PostMapping("/list_correct")
242
+    public ResultVo listCorrect(@RequestBody MsCheckParam param) {
243
+        Integer page = param.getPage();
244
+        Integer size = param.getPageSize();
245
+        N_Utils.validation(new Object[]{
246
+                param.getHandleid(), "操作人ID", 1
247
+                , param.getMpid(), "试卷ID", 1
248
+                , param.getMblockid(), "题块ID", 1
249
+                , page, "显示页码", 1
250
+                , size, "显示条数", 1
251
+        });
252
+        PageHelper.startPage(page, size);
253
+        List<Map> list = msPaperCheckTeacherTaskService.listCorrect(param);
254
+        PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
255
+        return new ResultVo(0, "查询成功", pageResult);
256
+    }
257
+
258
+    /**
259
+     * @Description 教师阅卷-历史详情
260
+     * @Date 2024/11/14 17:32
261
+     * @Author YWX
262
+     * @Param [param]
263
+     * @Return com.xhkjedu.vo.ResultVo
264
+     **/
265
+    @PostMapping("/detail_correct")
266
+    public ResultVo detailCorrect(@RequestBody MsCheckParam param) {
267
+        N_Utils.validation(new Object[]{
268
+                param.getMpcttid(), "任务ID", 1
269
+                , param.getMpid(), "试卷ID", 1
270
+        });
271
+        return new ResultVo(0, "查询成功", msPaperCheckTeacherTaskService.detailCorrect(param));
272
+    }
186
 }
273
 }

+ 15
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/papercheck/MsPaperCheckTeacherTaskMapper.java View File

44
     //教师阅卷-题块列表
44
     //教师阅卷-题块列表
45
     List<Map> listTeacherBlock(@Param("param") MsCheckParam param);
45
     List<Map> listTeacherBlock(@Param("param") MsCheckParam param);
46
 
46
 
47
+    //教师阅卷-试题列表
48
+    List<Map> listTeacherQuestion(@Param("param") MsCheckParam param);
49
+
50
+    //教师阅卷-班级列表
51
+    List<Map> listTeacherClass(@Param("param") MsCheckParam param);
52
+
47
     //教师阅卷-待批题块列表
53
     //教师阅卷-待批题块列表
48
     List<MsPaperCheck> listBlockCheck(@Param("param") MsCheckParam param);
54
     List<MsPaperCheck> listBlockCheck(@Param("param") MsCheckParam param);
49
 
55
 
81
 
87
 
82
     //教师批阅-批阅试题
88
     //教师批阅-批阅试题
83
     void correct(@Param("param") MsPaperCheckVo param);
89
     void correct(@Param("param") MsPaperCheckVo param);
90
+
91
+    //教师阅卷-上一份
92
+    Map getPreCorrect(@Param("param") MsCheckParam param);
93
+
94
+    //教师阅卷-阅卷历史
95
+    List<Map> listCorrect(@Param("param") MsCheckParam param);
96
+
97
+    //教师阅卷-历史详情
98
+    Map detailCorrect(@Param("param") MsCheckParam param);
84
 }
99
 }

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/model/paper/MsPaperBlockQuestion.java View File

39
     private String mergeqn;
39
     private String mergeqn;
40
     //合并给分点试卷试题分值集合
40
     //合并给分点试卷试题分值集合
41
     private String mergescore;
41
     private String mergescore;
42
+    @Transient
43
+    private String mergestuscore;
42
     //给分步长方式1等间隔2特定分数
44
     //给分步长方式1等间隔2特定分数
43
     private Integer scorestepway;
45
     private Integer scorestepway;
44
     //给分步长内容
46
     //给分步长内容

+ 12
- 0
smarking/src/main/java/com/xhkjedu/smarking/model/papercheck/MsPaperCheckTeacherTask.java View File

21
     private Integer mpid;
21
     private Integer mpid;
22
     //题块/试题/班级ID
22
     //题块/试题/班级ID
23
     private Integer mblockid;
23
     private Integer mblockid;
24
+    //考试试题表id
25
+    private Integer mptqid;
24
     //教师ID
26
     //教师ID
25
     private Integer teacherid;
27
     private Integer teacherid;
26
     //序号
28
     //序号
35
     private Integer checktype;
37
     private Integer checktype;
36
     //创建时间
38
     //创建时间
37
     private Integer createtime;
39
     private Integer createtime;
40
+    //优秀试卷0默认1优秀
41
+    private Integer hasgood;
42
+    //违纪试卷0默认1违纪
43
+    private Integer hasbad;
44
+    //疑难0默认1疑难
45
+    private Integer hasproblem;
46
+    //疑难类型1图形模糊2答题错位3没有图像4图像颠倒5其他问题
47
+    private Integer problemtype;
48
+    //疑难备注
49
+    private String problemcomm;
38
 }
50
 }

+ 115
- 16
smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsPaperCheckTeacherTaskService.java View File

8
 import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentQuestionMapper;
8
 import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentQuestionMapper;
9
 import com.xhkjedu.smarking.mapper.system.UserMapper;
9
 import com.xhkjedu.smarking.mapper.system.UserMapper;
10
 import com.xhkjedu.smarking.model.paper.MsPaperBlockQuestion;
10
 import com.xhkjedu.smarking.model.paper.MsPaperBlockQuestion;
11
-import com.xhkjedu.smarking.model.papercheck.MsPaperCheck;
12
-import com.xhkjedu.smarking.model.papercheck.MsPaperCheckTeacher;
11
+import com.xhkjedu.smarking.model.papercheck.*;
13
 import com.xhkjedu.smarking.model.stupaper.MsPaperStudentBlock;
12
 import com.xhkjedu.smarking.model.stupaper.MsPaperStudentBlock;
14
 import com.xhkjedu.smarking.model.stupaper.MsPaperStudentQuestion;
13
 import com.xhkjedu.smarking.model.stupaper.MsPaperStudentQuestion;
15
 import com.xhkjedu.smarking.utils.MarkingUtil;
14
 import com.xhkjedu.smarking.utils.MarkingUtil;
140
      * @Return java.util.List<java.util.Map>
139
      * @Return java.util.List<java.util.Map>
141
      **/
140
      **/
142
     public List<Map> listTeacherBlock(MsCheckParam param) {
141
     public List<Map> listTeacherBlock(MsCheckParam param) {
143
-        setParam(param);
144
         return msPaperCheckTeacherTaskMapper.listTeacherBlock(param);
142
         return msPaperCheckTeacherTaskMapper.listTeacherBlock(param);
145
     }
143
     }
146
 
144
 
145
+    /**
146
+     * @Description 教师阅卷-试题列表
147
+     * @Date 2024/11/13 17:59
148
+     * @Author YWX
149
+     * @Param [param]
150
+     * @Return java.util.List<java.util.Map>
151
+     **/
152
+    public List<Map> listTeacherQuestion(MsCheckParam param) {
153
+        Integer correcttype = msPaperMapper.getCorrectTypeByMpId(param.getMpid());
154
+        param.setCorrecttype(correcttype);
155
+        return msPaperCheckTeacherTaskMapper.listTeacherQuestion(param);
156
+    }
157
+
158
+    /**
159
+     * @Description 教师阅卷-班级列表
160
+     * @Date 2024/11/14 9:41
161
+     * @Author YWX
162
+     * @Param [param]
163
+     * @Return java.util.List<java.util.Map>
164
+     **/
165
+    public List<Map> listTeacherClass(MsCheckParam param) {
166
+        return msPaperCheckTeacherTaskMapper.listTeacherClass(param);
167
+    }
168
+
147
     /**
169
     /**
148
      * @Description 获取待批题块
170
      * @Description 获取待批题块
149
      * @Date 2024/10/31 11:01
171
      * @Date 2024/10/31 11:01
206
             MsPaperCheckTeacher teacher = msPaperCheckTeacherTaskMapper.getCheckNum(paperCheck);
228
             MsPaperCheckTeacher teacher = msPaperCheckTeacherTaskMapper.getCheckNum(paperCheck);
207
             totalNum = teacher.getTasknum();
229
             totalNum = teacher.getTasknum();
208
             checkedNum = teacher.getCheckednum();
230
             checkedNum = teacher.getCheckednum();
209
-            if (!dispenseway.equals(2)) {
210
-                //更新教师阅卷任务状态
211
-                msPaperCheckTeacherTaskMapper.updateCheckStatus(sq.getMpid(), sq.getMpsbid(), handleid, 2);
212
-            }
213
             Integer checktype = sq.getChecktype();
231
             Integer checktype = sq.getChecktype();
214
             Integer firstcid = sq.getFirstcid();
232
             Integer firstcid = sq.getFirstcid();
215
             if (!N_Utils.isTrueInteger(checktype)) {
233
             if (!N_Utils.isTrueInteger(checktype)) {
221
                     checktype = 1;
239
                     checktype = 1;
222
                 }
240
                 }
223
             }
241
             }
242
+            if (!dispenseway.equals(2)) {
243
+                //更新教师阅卷任务状态
244
+                msPaperCheckTeacherTaskMapper.updateCheckStatus(sq.getMpid(), sq.getMpsbid(), handleid, 2);
245
+            } else {
246
+                //序号
247
+                Integer taskorder = checkedNum + 1;
248
+                sq.setTaskorder(taskorder);
249
+                MsPaperCheckTeacherTask task = new MsPaperCheckTeacherTask();
250
+                task.setMpid(sq.getMpid());
251
+                task.setMblockid(sq.getMblockid());
252
+                task.setMptqid(sq.getMptqid());
253
+                task.setTeacherid(handleid);
254
+                task.setTaskorder(taskorder);
255
+                task.setMpsbid(sq.getMpsbid());
256
+                task.setCheckstate(2);
257
+                task.setChecktype(checktype);
258
+                task.setCreatetime(N_Utils.getSecondTimestamp());
259
+                msPaperCheckTeacherTaskMapper.insertSelective(task);
260
+            }
224
             if (correcttype.equals(3)) {//按题块批阅
261
             if (correcttype.equals(3)) {//按题块批阅
225
                 MsPaperStudentBlock block = new MsPaperStudentBlock();
262
                 MsPaperStudentBlock block = new MsPaperStudentBlock();
226
                 block.setMpsbid(sq.getMpsbid());
263
                 block.setMpsbid(sq.getMpsbid());
313
         List<MsPaperBlockQuestion> questions = param.getQuestions();
350
         List<MsPaperBlockQuestion> questions = param.getQuestions();
314
         int checked = 1;
351
         int checked = 1;
315
         Double firstccore = param.getFirstccore();
352
         Double firstccore = param.getFirstccore();
353
+        String checkscore;
316
         if (checktype.equals(1)) {//单评
354
         if (checktype.equals(1)) {//单评
317
             if (hasproblem.equals(0)) {
355
             if (hasproblem.equals(0)) {
318
                 checked = 2;
356
                 checked = 2;
319
             }
357
             }
320
             if (correcttype.equals(3)) {//按题块批阅
358
             if (correcttype.equals(3)) {//按题块批阅
359
+                checkscore = questions.stream().map(MsPaperBlockQuestion::getMergescore).collect(Collectors.joining(";"));
321
                 //题块批阅信息
360
                 //题块批阅信息
322
                 MsPaperStudentBlock block = new MsPaperStudentBlock();
361
                 MsPaperStudentBlock block = new MsPaperStudentBlock();
323
                 block.setMpsbid(mpsbid);
362
                 block.setMpsbid(mpsbid);
344
                         studentQuestions.add(studentQuestion);
383
                         studentQuestions.add(studentQuestion);
345
                     } else {
384
                     } else {
346
                         String[] mptqids = question.getMergeqid().split(",");
385
                         String[] mptqids = question.getMergeqid().split(",");
347
-                        String[] mergescores = question.getMergescore().split(",");
348
-                        double[] scores = new double[mergescores.length];
349
-                        int last = mergescores.length - 1;
386
+                        String[] mergestuscore = question.getMergestuscore().split(",");
387
+                        double[] scores = new double[mergestuscore.length];
388
+                        int last = mergestuscore.length - 1;
350
                         double score = 0;
389
                         double score = 0;
351
-                        for (int i = 0; i < mergescores.length; i++) {
352
-                            scores[i] = MarkingUtil.mul(MarkingUtil.div(mergescores[i], qscore), stuscore);
390
+                        for (int i = 0; i < mergestuscore.length; i++) {
391
+                            scores[i] = MarkingUtil.mul(MarkingUtil.div(mergestuscore[i], qscore), stuscore);
353
                             score = MarkingUtil.add(score, scores[i]);
392
                             score = MarkingUtil.add(score, scores[i]);
354
                             if (i == last) {
393
                             if (i == last) {
355
                                 scores[i] = MarkingUtil.sub(stuscore, score);
394
                                 scores[i] = MarkingUtil.sub(stuscore, score);
366
                 }
405
                 }
367
                 msPaperStudentQuestionMapper.checkByMptqidAndStudentId(studentQuestions, block);//更新学生单题批阅信息
406
                 msPaperStudentQuestionMapper.checkByMptqidAndStudentId(studentQuestions, block);//更新学生单题批阅信息
368
             } else {//按试题批阅
407
             } else {//按试题批阅
408
+                checkscore = firstccore.toString();
369
                 MsPaperStudentQuestion question = new MsPaperStudentQuestion();
409
                 MsPaperStudentQuestion question = new MsPaperStudentQuestion();
370
                 question.setMpsqid(mpsbid);
410
                 question.setMpsqid(mpsbid);
371
                 question.setChecked(checked);
411
                 question.setChecked(checked);
408
                 } else if (scoreway.equals(1)) {
448
                 } else if (scoreway.equals(1)) {
409
                     double addScore = MarkingUtil.add(firstccore, secondcscore);
449
                     double addScore = MarkingUtil.add(firstccore, secondcscore);
410
                     endscore = getUserScore(finalscore, addScore, roundvalue);
450
                     endscore = getUserScore(finalscore, addScore, roundvalue);
451
+                    if (endscore.compareTo(qscore) > 0) {
452
+                        endscore = qscore;
453
+                    }
411
                 }
454
                 }
412
             }
455
             }
413
             if (correcttype.equals(3)) {//按题块批阅
456
             if (correcttype.equals(3)) {//按题块批阅
435
                 for (int j = 0; j < questions.size(); j++) {
478
                 for (int j = 0; j < questions.size(); j++) {
436
                     MsPaperBlockQuestion question = questions.get(j);
479
                     MsPaperBlockQuestion question = questions.get(j);
437
                     Double stuscore = question.getStuscore();
480
                     Double stuscore = question.getStuscore();
481
+                    Double bqscore = question.getBqscore();
438
                     if (N_Utils.isTrueInteger(question.getMptqid())) {
482
                     if (N_Utils.isTrueInteger(question.getMptqid())) {
439
                         MsPaperStudentQuestion studentQuestion = new MsPaperStudentQuestion();
483
                         MsPaperStudentQuestion studentQuestion = new MsPaperStudentQuestion();
440
                         studentQuestion.setMptqid(question.getMptqid());
484
                         studentQuestion.setMptqid(question.getMptqid());
454
                             } else if (scoreway.equals(2)) {
498
                             } else if (scoreway.equals(2)) {
455
                                 double addScore = MarkingUtil.add(stuscore, cores[j]);
499
                                 double addScore = MarkingUtil.add(stuscore, cores[j]);
456
                                 endscore = getUserScore(finalscore, addScore, roundvalue);
500
                                 endscore = getUserScore(finalscore, addScore, roundvalue);
501
+                                if (endscore.compareTo(bqscore) > 0) {
502
+                                    endscore = bqscore;
503
+                                }
457
                                 studentQuestion.setStuscore(endscore);
504
                                 studentQuestion.setStuscore(endscore);
458
                             }
505
                             }
459
                         }
506
                         }
461
                     } else {
508
                     } else {
462
                         String[] mptqids = question.getMergeqid().split(",");
509
                         String[] mptqids = question.getMergeqid().split(",");
463
                         String[] mergescores = question.getMergescore().split(",");
510
                         String[] mergescores = question.getMergescore().split(",");
464
-                        double[] scores = new double[mergescores.length];
465
-                        int last = mergescores.length - 1;
511
+                        String[] mergestuscore = question.getMergestuscore().split(",");
512
+                        double[] scores = new double[mergestuscore.length];
513
+                        int last = mergestuscore.length - 1;
466
                         double score = 0;
514
                         double score = 0;
467
-                        for (int i = 0; i < mergescores.length; i++) {
468
-                            scores[i] = MarkingUtil.mul(MarkingUtil.div(mergescores[i], qscore), stuscore);
515
+                        for (int i = 0; i < mergestuscore.length; i++) {
516
+                            scores[i] = MarkingUtil.mul(MarkingUtil.div(mergestuscore[i], qscore), stuscore);
469
                             score = MarkingUtil.add(score, scores[i]);
517
                             score = MarkingUtil.add(score, scores[i]);
470
                             if (i == last) {
518
                             if (i == last) {
471
                                 scores[i] = MarkingUtil.sub(stuscore, score);
519
                                 scores[i] = MarkingUtil.sub(stuscore, score);
491
                                 } else if (scoreway.equals(2)) {
539
                                 } else if (scoreway.equals(2)) {
492
                                     double addScore = MarkingUtil.add(scores[i], cores2[i]);
540
                                     double addScore = MarkingUtil.add(scores[i], cores2[i]);
493
                                     endscore = getUserScore(finalscore, addScore, roundvalue);
541
                                     endscore = getUserScore(finalscore, addScore, roundvalue);
542
+                                    double mqscore = Double.parseDouble(mergescores[i]);
543
+                                    if (endscore.compareTo(mqscore) > 0) {
544
+                                        endscore = mqscore;
545
+                                    }
494
                                     studentQuestion.setStuscore(endscore);
546
                                     studentQuestion.setStuscore(endscore);
495
                                 }
547
                                 }
496
                             }
548
                             }
510
                 msPaperStudentBlockMapper.updateByPrimaryKeySelective(block);
562
                 msPaperStudentBlockMapper.updateByPrimaryKeySelective(block);
511
 
563
 
512
                 msPaperStudentQuestionMapper.checkByMptqidAndStudentId(studentQuestions, block);//更新学生单题批阅信息
564
                 msPaperStudentQuestionMapper.checkByMptqidAndStudentId(studentQuestions, block);//更新学生单题批阅信息
565
+                checkscore = stuscores;
513
             } else {//按试题批阅
566
             } else {//按试题批阅
514
                 MsPaperStudentQuestion question = new MsPaperStudentQuestion();
567
                 MsPaperStudentQuestion question = new MsPaperStudentQuestion();
515
                 question.setChecked(checked);
568
                 question.setChecked(checked);
516
                 if (type.equals(1)) {
569
                 if (type.equals(1)) {
517
                     question.setFirstcime(N_Utils.getSecondTimestamp());
570
                     question.setFirstcime(N_Utils.getSecondTimestamp());
518
                     question.setFirstccore(firstccore);
571
                     question.setFirstccore(firstccore);
572
+                    checkscore = firstccore.toString();
519
                 } else {
573
                 } else {
520
                     question.setSecondctime(N_Utils.getSecondTimestamp());
574
                     question.setSecondctime(N_Utils.getSecondTimestamp());
521
                     question.setSecondcscore(secondcscore);
575
                     question.setSecondcscore(secondcscore);
576
+                    checkscore = secondcscore.toString();
522
                 }
577
                 }
523
                 question.setHasgood(hasgood);
578
                 question.setHasgood(hasgood);
524
                 question.setHasbad(hasbad);
579
                 question.setHasbad(hasbad);
529
                 question.setMpsqid(mpsbid);
584
                 question.setMpsqid(mpsbid);
530
             }
585
             }
531
         }
586
         }
587
+        param.setHasproblem(hasproblem);
588
+        param.setProblemtype(problemtype);
589
+        param.setProblemcomm(problemcomm);
590
+        param.setCheckscore(checkscore);
532
         msPaperCheckTeacherTaskMapper.correct(param);
591
         msPaperCheckTeacherTaskMapper.correct(param);
533
     }
592
     }
534
 
593
 
544
         }
603
         }
545
         return score;
604
         return score;
546
     }
605
     }
606
+
607
+    /**
608
+     * @Description 教师阅卷-上一份
609
+     * @Date 2024/11/14 10:35
610
+     * @Author YWX
611
+     * @Param [param]
612
+     * @Return java.util.Map
613
+     **/
614
+    public Map getPreCorrect(MsCheckParam param) {
615
+        Integer correcttype = msPaperMapper.getCorrectTypeByMpId(param.getMpid());
616
+        if (correcttype.equals(1) && !N_Utils.isTrueInteger(param.getMptqid())) {
617
+            throw new ServiceException("考试试题表id不能为空");
618
+        }
619
+        param.setCorrecttype(correcttype);
620
+        return msPaperCheckTeacherTaskMapper.getPreCorrect(param);
621
+    }
622
+
623
+    /**
624
+     * @Description 教师阅卷-阅卷历史
625
+     * @Date 2024/11/14 14:13
626
+     * @Author YWX
627
+     * @Param [param]
628
+     * @Return java.util.List<java.util.Map>
629
+     **/
630
+    public List<Map> listCorrect(MsCheckParam param) {
631
+        return msPaperCheckTeacherTaskMapper.listCorrect(param);
632
+    }
633
+
634
+    /**
635
+     * @Description 教师阅卷-历史详情
636
+     * @Date 2024/11/14 17:33
637
+     * @Author YWX
638
+     * @Param [param]
639
+     * @Return java.util.Map
640
+     **/
641
+    public Map detailCorrect(MsCheckParam param) {
642
+        Integer correcttype = msPaperMapper.getCorrectTypeByMpId(param.getMpid());
643
+        param.setCorrecttype(correcttype);
644
+        return msPaperCheckTeacherTaskMapper.detailCorrect(param);
645
+    }
547
 }
646
 }

+ 6
- 0
smarking/src/main/java/com/xhkjedu/smarking/vo/papercheck/MsCheckParam.java View File

32
     private Integer dispenseway;
32
     private Integer dispenseway;
33
     //考试试题表id
33
     //考试试题表id
34
     private Integer mptqid;
34
     private Integer mptqid;
35
+    //批阅设置:1按班设置2按题设置3按题块设置
36
+    private Integer correcttype;
37
+    //序号
38
+    private Integer taskorder;
39
+    //阅卷批阅教师任务ID
40
+    private Integer mpcttid;
35
 }
41
 }

+ 4
- 0
smarking/src/main/java/com/xhkjedu/smarking/vo/papercheck/MsPaperCheckVo.java View File

16
     private Integer mpid;
16
     private Integer mpid;
17
     //题块ID
17
     //题块ID
18
     private Integer mblockid;
18
     private Integer mblockid;
19
+    //考试试题表id
20
+    private Integer mptqid;
19
     //阅卷试卷学生题块ID
21
     //阅卷试卷学生题块ID
20
     private Integer mpsbid;
22
     private Integer mpsbid;
21
     //阅卷试卷学生合并后试题ID
23
     //阅卷试卷学生合并后试题ID
71
     private Integer hasbad;
73
     private Integer hasbad;
72
     //学生ID
74
     //学生ID
73
     private Integer studentid;
75
     private Integer studentid;
76
+    //序号
77
+    private Integer taskorder;
74
     //题块试题列表
78
     //题块试题列表
75
     private List<MsPaperBlockQuestion> questions;
79
     private List<MsPaperBlockQuestion> questions;
76
 }
80
 }

+ 90
- 5
smarking/src/main/resources/mapper/papercheck/MsPaperCheckTeacherTaskMapper.xml View File

38
     <!--教师批阅-批阅试题-->
38
     <!--教师批阅-批阅试题-->
39
     <update id="correct">
39
     <update id="correct">
40
         update ms_paper_check_teacher_task
40
         update ms_paper_check_teacher_task
41
-        set checkstate = 3,checkscore = #{checkscore}
42
-        where mpid=#{mpid} and mpsbid=#{mpsbid} and teacherid=#{teacherid}
41
+        set checkstate = 3,checkscore = #{param.checkscore}
42
+        <if test="param.hasgood!=null and param.hasgood!=0">
43
+            ,hasgood=#{param.hasgood}
44
+        </if>
45
+        <if test="param.hasbad!=null and param.hasbad!=0">
46
+            ,hasbad=#{param.hasbad},problemtype=#{param.problemtype}
47
+        </if>
48
+        <if test="param.problemcomm!=null and param.problemcomm!=''">
49
+            ,problemcomm=#{param.problemcomm}
50
+        </if>
51
+        where mpid=#{param.mpid} and mpsbid=#{param.mpsbid} and teacherid=#{param.handleid}
43
     </update>
52
     </update>
44
     <!--删除教师阅卷任务-->
53
     <!--删除教师阅卷任务-->
45
     <delete id="deleteByMpsbids">
54
     <delete id="deleteByMpsbids">
240
         group by pb.mblockid
249
         group by pb.mblockid
241
         order by pb.blockorder
250
         order by pb.blockorder
242
     </select>
251
     </select>
252
+    <!--教师阅卷-试题列表-->
253
+    <select id="listTeacherQuestion" resultType="java.util.Map">
254
+        <if test="param.correcttype==1">
255
+            select pb.mptqid as mblockid,pb.qorder,pb.qn,pb.qscore
256
+            from ms_paper_qtype_question pb
257
+            where pb.mpid=#{param.mpid} and pb.ctype in(3,13,14,15)
258
+            group by pb.mptqid
259
+            order by pb.qorder,pb.qn
260
+        </if>
261
+        <if test="param.correcttype==2">
262
+            select pct.mblockid,pb.qorder,pb.qn,pb.qscore
263
+            from ms_paper_qtype_question pb inner join ms_paper_check_teacher pct on pb.mptqid = pct.mblockid
264
+            and pct.teacherid = #{param.handleid}
265
+            where pb.mpid=#{param.mpid}
266
+            group by pb.mptqid
267
+            order by pb.qorder,pb.qn
268
+        </if>
269
+    </select>
270
+    <!--教师阅卷-班级列表-->
271
+    <select id="listTeacherClass" resultType="java.util.Map">
272
+        select pct.mblockid,c.classname,c.classtype
273
+        from ms_paper_check_teacher pct inner join ms_paper p on pct.mpid = p.mpid
274
+        inner join ms_class c on pct.mblockid = c.classid and c.examid = p.examid and c.subjectid = p.subjectid
275
+        where pct.mpid=#{param.mpid} and pct.teacherid = #{param.handleid}
276
+        order by c.mcid
277
+    </select>
243
     <!--教师阅卷-待批题块列表-->
278
     <!--教师阅卷-待批题块列表-->
244
     <select id="listBlockCheck" resultType="com.xhkjedu.smarking.model.papercheck.MsPaperCheck">
279
     <select id="listBlockCheck" resultType="com.xhkjedu.smarking.model.papercheck.MsPaperCheck">
245
         select pc.mblockid,pc.checktype,pc.hidefirstscore,pc.scoreway,pc.finalscore,pc.roundvalue,pc.dispenseway,pc.numtype
280
         select pc.mblockid,pc.checktype,pc.hidefirstscore,pc.scoreway,pc.finalscore,pc.roundvalue,pc.dispenseway,pc.numtype
253
     <!--教师阅卷-按题块-获取待批试题-->
288
     <!--教师阅卷-按题块-获取待批试题-->
254
     <select id="getCorrectBlock" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
289
     <select id="getCorrectBlock" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
255
         <if test="param.dispenseway!=null and param.dispenseway!=2">
290
         <if test="param.dispenseway!=null and param.dispenseway!=2">
256
-            select pctt.mblockid,pctt.mpsbid,pctt.checktype,psb.stuanswer,psb.checked
291
+            select pctt.mblockid,pctt.mpsbid,pctt.checktype,pctt.taskorder,psb.stuanswer,psb.checked
257
             ,psb.firstcid,psb.firstcime,psb.secondcid,psb.secondctime,psb.studentid
292
             ,psb.firstcid,psb.firstcime,psb.secondcid,psb.secondctime,psb.studentid
258
             ,psb.firstccore,psb.secondcscore,psb.firstccores,psb.secondcscores
293
             ,psb.firstccore,psb.secondcscore,psb.firstccores,psb.secondcscores
259
             from ms_paper_student_block psb inner join ms_paper_check_teacher_task pctt on psb.mpsbid = pctt.mpsbid and psb.mpid=pctt.mpid
294
             from ms_paper_student_block psb inner join ms_paper_check_teacher_task pctt on psb.mpsbid = pctt.mpsbid and psb.mpid=pctt.mpid
344
     <!--教师阅卷-按试题-获取待批试题-->
379
     <!--教师阅卷-按试题-获取待批试题-->
345
     <select id="getCorrectQuestion" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
380
     <select id="getCorrectQuestion" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
346
         <if test="param.dispenseway!=null and param.dispenseway!=2">
381
         <if test="param.dispenseway!=null and param.dispenseway!=2">
347
-            select pctt.mblockid,pctt.mpsbid,pctt.checktype,psb.stuanswer,psb.checked
382
+            select pctt.mblockid,pctt.mpsbid,pctt.checktype,pctt.taskorder,psb.stuanswer,psb.checked
348
             ,psb.firstcid,psb.firstcime,psb.secondcid,psb.secondctime
383
             ,psb.firstcid,psb.firstcime,psb.secondcid,psb.secondctime
349
             ,psb.firstccore,psb.secondcscore
384
             ,psb.firstccore,psb.secondcscore
350
             from ms_paper_student_question psb inner join ms_paper_check_teacher_task pctt on psb.mpsqid = pctt.mpsbid and psb.mpid=pctt.mpid
385
             from ms_paper_student_question psb inner join ms_paper_check_teacher_task pctt on psb.mpsqid = pctt.mpsbid and psb.mpid=pctt.mpid
382
     <!--教师阅卷-按班级-获取待批试题-->
417
     <!--教师阅卷-按班级-获取待批试题-->
383
     <select id="getCorrectClassQuestion" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
418
     <select id="getCorrectClassQuestion" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
384
         <if test="param.dispenseway!=null and param.dispenseway!=2">
419
         <if test="param.dispenseway!=null and param.dispenseway!=2">
385
-            select pctt.mblockid,pctt.mpsbid,pctt.checktype,psb.stuanswer,psb.checked
420
+            select pctt.mblockid,pctt.mpsbid,pctt.checktype,pctt.taskorder,psb.stuanswer,psb.checked
386
             ,psb.firstcid,psb.firstcime,psb.secondcid,psb.secondctime,psb.mptqid
421
             ,psb.firstcid,psb.firstcime,psb.secondcid,psb.secondctime,psb.mptqid
387
             ,psb.firstccore,psb.secondcscore
422
             ,psb.firstccore,psb.secondcscore
388
             from ms_paper_student_question psb inner join ms_paper_check_teacher_task pctt on psb.mpsqid = pctt.mpsbid and psb.mpid=pctt.mpid
423
             from ms_paper_student_question psb inner join ms_paper_check_teacher_task pctt on psb.mpsqid = pctt.mpsbid and psb.mpid=pctt.mpid
436
             </if>
471
             </if>
437
         </if>
472
         </if>
438
     </select>
473
     </select>
474
+    <!--教师阅卷-上一份-->
475
+    <select id="getPreCorrect" resultType="java.util.Map">
476
+        select psq.stuanswer
477
+        <if test="param.correcttype==3">
478
+             ,if(pctt.checktype=1,psq.firstccores,psq.secondcscores) as stuscore
479
+        </if>
480
+        <if test="param.correcttype!=3">
481
+            ,if(pctt.checktype=1,psq.firstccore,psq.secondcscore) as stuscore
482
+        </if>
483
+        from ms_paper_check_teacher_task pctt
484
+        <if test="param.correcttype==3">
485
+            inner join ms_paper_student_block psq on pctt.mpsbid=psq.mpsbid
486
+        </if>
487
+        <if test="param.correcttype!=3">
488
+            inner join ms_paper_student_question psq on pctt.mpsbid=psq.mpsqid
489
+        </if>
490
+        where pctt.mpid=#{param.mpid} and pctt.mblockid=#{param.mblockid} and pctt.teacherid=#{param.handleid}
491
+        and pctt.checkstate=3 and #{param.taskorder}>pctt.taskorder
492
+        <if test="param.mptqid!=null and param.mptqid!=0">
493
+            and pctt.mptqid=#{param.mptqid}
494
+        </if>
495
+        order by pctt.taskorder desc limit 1
496
+    </select>
497
+    <!--教师阅卷-阅卷历史-->
498
+    <select id="listCorrect" resultType="java.util.Map">
499
+        select pctt.mpcttid,pctt.taskorder,pctt.checkscore
500
+        ,(case when pctt.hasgood=1 then '优' when pctt.hasbad=1 then '违' when pctt.hasproblem=1 then '疑' else '' end) as comm
501
+        from ms_paper_check_teacher_task pctt
502
+        where pctt.mpid=#{param.mpid} and pctt.mblockid = #{param.mblockid} and pctt.teacherid = #{param.handleid}
503
+        and pctt.checkstate=3
504
+        <if test="param.mptqid!=null and param.mptqid!=0">
505
+            and pctt.mptqid=#{param.mptqid}
506
+        </if>
507
+        <if test="param.taskorder!=null and param.taskorder!=0">
508
+            and pctt.taskorder=#{param.taskorder}
509
+        </if>
510
+        order by pctt.taskorder desc
511
+    </select>
512
+    <!--教师阅卷-历史详情-->
513
+    <select id="detailCorrect" resultType="java.util.Map">
514
+        select psq.stuanswer,pctt.checkscore,pctt.hasproblem,pctt.problemtype,pctt.problemcomm
515
+        ,pctt.mpid,pctt.mblockid,pctt.mpsbid,pctt.mptqid,pctt.taskorder
516
+        from ms_paper_check_teacher_task pctt
517
+        <if test="param.correcttype==3">
518
+            inner join ms_paper_student_block psq on pctt.mpsbid=psq.mpsbid
519
+        </if>
520
+        <if test="param.correcttype!=3">
521
+            inner join ms_paper_student_question psq on pctt.mpsbid=psq.mpsqid
522
+        </if>
523
+    </select>
439
 </mapper>
524
 </mapper>

Loading…
Cancel
Save