Bläddra i källkod

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

ywx
王宁 1 månad sedan
förälder
incheckning
bbff40c1e3
15 ändrade filer med 719 tillägg och 42 borttagningar
  1. 1
    1
      smarking/src/main/java/com/xhkjedu/smarking/controller/papercheck/MsPaperCheckTeacherArbitrateController.java
  2. 155
    0
      smarking/src/main/java/com/xhkjedu/smarking/controller/papercheck/MsPaperCheckTeacherProblemController.java
  3. 3
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/papercheck/MsPaperCheckTeacherArbitrateMapper.java
  4. 48
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/papercheck/MsPaperCheckTeacherProblemMapper.java
  5. 40
    0
      smarking/src/main/java/com/xhkjedu/smarking/model/papercheck/MsPaperCheckTeacherProblem.java
  6. 5
    1
      smarking/src/main/java/com/xhkjedu/smarking/model/stupaper/MsPaperStudentBlock.java
  7. 5
    1
      smarking/src/main/java/com/xhkjedu/smarking/model/stupaper/MsPaperStudentQuestion.java
  8. 34
    0
      smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsPaperCheckTeacherArbitrateService.java
  9. 225
    0
      smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsPaperCheckTeacherProblemService.java
  10. 9
    1
      smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsPaperCheckTeacherTaskService.java
  11. 2
    0
      smarking/src/main/java/com/xhkjedu/smarking/vo/papercheck/MsCheckParam.java
  12. 12
    0
      smarking/src/main/resources/mapper/papercheck/MsPaperCheckTeacherArbitrateMapper.xml
  13. 137
    0
      smarking/src/main/resources/mapper/papercheck/MsPaperCheckTeacherProblemMapper.xml
  14. 40
    38
      smarking/src/main/resources/mapper/papercheck/MsPaperCheckTeacherTaskMapper.xml
  15. 3
    0
      smarking/src/main/resources/mapper/stupaper/MsPaperStudentQuestionMapper.xml

+ 1
- 1
smarking/src/main/java/com/xhkjedu/smarking/controller/papercheck/MsPaperCheckTeacherArbitrateController.java Visa fil

@@ -216,7 +216,7 @@ public class MsPaperCheckTeacherArbitrateController {
216 216
     public ResultVo detailHistory(@RequestBody MsCheckParam param) {
217 217
         N_Utils.validation(new Object[]{
218 218
                 param.getMpctaid(), "任务ID", 1
219
-                , param.getMpid(), "批阅设置", 1
219
+                , param.getCorrecttype(), "批阅设置", 1
220 220
         });
221 221
         return new ResultVo(0, "查询成功", msPaperCheckTeacherArbitrateService.detailHistory(param));
222 222
     }

+ 155
- 0
smarking/src/main/java/com/xhkjedu/smarking/controller/papercheck/MsPaperCheckTeacherProblemController.java Visa fil

@@ -0,0 +1,155 @@
1
+package com.xhkjedu.smarking.controller.papercheck;
2
+
3
+import com.github.pagehelper.PageHelper;
4
+import com.github.pagehelper.PageInfo;
5
+import com.xhkjedu.smarking.service.papercheck.MsPaperCheckTeacherProblemService;
6
+import com.xhkjedu.smarking.vo.papercheck.MsCheckParam;
7
+import com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo;
8
+import com.xhkjedu.utils.N_Utils;
9
+import com.xhkjedu.utils.PageUtil;
10
+import com.xhkjedu.vo.PageResult;
11
+import com.xhkjedu.vo.ResultVo;
12
+import org.springframework.web.bind.annotation.*;
13
+
14
+import javax.annotation.Resource;
15
+import java.util.List;
16
+import java.util.Map;
17
+
18
+/**
19
+ * @Description 疑难卷教师任务表相关操作
20
+ * @Author auto
21
+ * @Date 2024-11-21
22
+ */
23
+@RestController
24
+@RequestMapping("/mproblem")
25
+public class MsPaperCheckTeacherProblemController {
26
+    @Resource
27
+    private MsPaperCheckTeacherProblemService msPaperCheckTeacherProblemService;
28
+
29
+    /**
30
+     * @Description 疑难卷列表
31
+     * @Date 2024/11/21 9:59
32
+     * @Author YWX
33
+     * @Param [param]
34
+     * @Return com.xhkjedu.vo.ResultVo
35
+     **/
36
+    @PostMapping("/list_problem")
37
+    public ResultVo listProblem(@RequestBody MsCheckParam param) {
38
+        Integer mpid = param.getMpid();
39
+        N_Utils.validation(new Object[]{mpid, "试卷ID", 1});
40
+        List<Map> list = msPaperCheckTeacherProblemService.listPendingProblem(mpid);
41
+        return new ResultVo(0, "查询成功", list);
42
+    }
43
+
44
+    /**
45
+     * @Description 获取疑难卷任务
46
+     * @Date 2024/11/21 10:12
47
+     * @Author YWX
48
+     * @Param [param]
49
+     * @Return com.xhkjedu.vo.ResultVo
50
+     **/
51
+    @PostMapping("/get_correct_problem")
52
+    public ResultVo getCorrectProblem(@RequestBody MsCheckParam param) {
53
+        N_Utils.validation(new Object[]{param.getHandleid(), "操作人ID", 1, param.getMpid(), "试卷ID", 1});
54
+        return msPaperCheckTeacherProblemService.getCorrectProblem(param);
55
+    }
56
+
57
+    /**
58
+     * @Description 处理疑难卷
59
+     * @Date 2024/11/21 11:17
60
+     * @Author YWX
61
+     * @Param [param]
62
+     * @Return com.xhkjedu.vo.ResultVo
63
+     **/
64
+    @PostMapping("/correct")
65
+    public ResultVo correct(@RequestBody MsPaperCheckVo param) {
66
+        N_Utils.validation(new Object[]{
67
+                param.getHandleid(), "操作人ID", 1
68
+                , param.getMpid(), "试卷ID", 1
69
+                , param.getMblockid(), "题块ID", 1
70
+                , param.getMpsbid(), "任务ID", 1
71
+                , param.getQscore(), "试题分值", 2
72
+        });
73
+        param.setFinalreason(1);
74
+        msPaperCheckTeacherProblemService.correct(param);
75
+        return new ResultVo(0, "处理成功");
76
+    }
77
+
78
+    /**
79
+     * @Description 获取上一份疑难卷
80
+     * @Date 2024/11/21 14:35
81
+     * @Author YWX
82
+     * @Param [param]
83
+     * @Return com.xhkjedu.vo.ResultVo
84
+     **/
85
+    @PostMapping("/get_pre_problem")
86
+    public ResultVo getPreProblem(@RequestBody MsCheckParam param) {
87
+        N_Utils.validation(new Object[]{
88
+                param.getHandleid(), "操作人ID", 1
89
+                , param.getMpid(), "试卷ID", 1
90
+                , param.getMblockid(), "题块ID", 1
91
+                , param.getCorrecttype(), "批阅设置", 1
92
+        });
93
+        return new ResultVo(0, "查询成功", msPaperCheckTeacherProblemService.getPreProblem(param));
94
+    }
95
+
96
+    /**
97
+     * @Description 历史记录列表
98
+     * @Date 2024/11/21 10:55
99
+     * @Author YWX
100
+     * @Param [param]
101
+     * @Return com.xhkjedu.vo.ResultVo
102
+     **/
103
+    @PostMapping("/list_history")
104
+    public ResultVo listHistory(@RequestBody MsCheckParam param) {
105
+        Integer page = param.getPage();
106
+        Integer size = param.getPageSize();
107
+        N_Utils.validation(new Object[]{
108
+                param.getHandleid(), "操作人ID", 1
109
+                , param.getMpid(), "试卷ID", 1
110
+                , param.getMblockid(), "题块ID", 1
111
+                , param.getCorrecttype(), "批阅设置", 1
112
+                , page, "显示页码", 1
113
+                , size, "显示条数", 1
114
+        });
115
+        PageHelper.startPage(page, size);
116
+        List<Map> list = msPaperCheckTeacherProblemService.listHistory(param);
117
+        PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
118
+        return new ResultVo(0, "查询成功", pageResult);
119
+    }
120
+
121
+    /**
122
+     * @Description 历史记录详情
123
+     * @Date 2024/11/21 14:04
124
+     * @Author YWX
125
+     * @Param [param]
126
+     * @Return com.xhkjedu.vo.ResultVo
127
+     **/
128
+    @PostMapping("/detail_history")
129
+    public ResultVo detailHistory(@RequestBody MsCheckParam param) {
130
+        N_Utils.validation(new Object[]{
131
+                param.getMpctpid(), "任务ID", 1
132
+                , param.getCorrecttype(), "批阅设置", 1
133
+        });
134
+        return new ResultVo(0, "查询成功", msPaperCheckTeacherProblemService.detailHistory(param));
135
+    }
136
+
137
+    /**
138
+     * @Description 打回重阅
139
+     * @Date 2024/11/21 15:19
140
+     * @Author YWX
141
+     * @Param [param]
142
+     * @Return com.xhkjedu.vo.ResultVo
143
+     **/
144
+    @PostMapping("/back_correct")
145
+    public ResultVo backCorrect(@RequestBody MsPaperCheckVo param) {
146
+        N_Utils.validation(new Object[]{
147
+                param.getHandleid(), "操作人ID", 1
148
+                , param.getMpid(), "试卷ID", 1
149
+                , param.getMpsbid(), "任务ID", 1
150
+                , param.getCorrecttype(), "批阅设置", 1
151
+        });
152
+        msPaperCheckTeacherProblemService.backCorrect(param);
153
+        return new ResultVo(0, "打回成功");
154
+    }
155
+}

+ 3
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/papercheck/MsPaperCheckTeacherArbitrateMapper.java Visa fil

@@ -48,4 +48,7 @@ public interface MsPaperCheckTeacherArbitrateMapper extends TkMapper<MsPaperChec
48 48
 
49 49
     //初评分
50 50
     List<Map> getScore(@Param("param") MsCheckParam param);
51
+
52
+    //保存或更新单个任务
53
+    void save(@Param("m") MsPaperCheckTeacherArbitrate task);
51 54
 }

+ 48
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/papercheck/MsPaperCheckTeacherProblemMapper.java Visa fil

@@ -0,0 +1,48 @@
1
+package com.xhkjedu.smarking.mapper.papercheck;
2
+
3
+import com.xhkjedu.base.TkMapper;
4
+import com.xhkjedu.smarking.model.papercheck.MsPaperCheckTeacher;
5
+import com.xhkjedu.smarking.model.papercheck.MsPaperCheckTeacherProblem;
6
+import com.xhkjedu.smarking.vo.papercheck.MsCheckParam;
7
+import com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo;
8
+import org.apache.ibatis.annotations.Param;
9
+
10
+import java.util.List;
11
+import java.util.Map;
12
+
13
+/**
14
+ * @Description 疑难卷教师任务表 Mapper 接口
15
+ * @Author auto
16
+ * @Date 2024-11-21
17
+ */
18
+public interface MsPaperCheckTeacherProblemMapper extends TkMapper<MsPaperCheckTeacherProblem> {
19
+    //疑难卷题块列表
20
+    List<Map> listBlockProblem(@Param("param") MsCheckParam param);
21
+
22
+    //疑难卷试题列表
23
+    List<Map> listQuestionProblem(@Param("param") MsCheckParam param);
24
+
25
+    //获取疑难卷任务
26
+    Map getCorrectProblem(@Param("param") MsCheckParam param);
27
+
28
+    //获取疑难卷数量
29
+    MsPaperCheckTeacher getPCheckNum(@Param("param") MsCheckParam param);
30
+
31
+    //获取上一份疑难卷
32
+    Map getPreProblem(@Param("param") MsCheckParam param);
33
+
34
+    //历史记录列表
35
+    List<Map> listHistory(@Param("param") MsCheckParam param);
36
+
37
+    //历史记录详情
38
+    Map detailHistory(@Param("param") MsCheckParam param);
39
+
40
+    //保存或更新单个任务
41
+    void save(@Param("m") MsPaperCheckTeacherProblem task);
42
+
43
+    //删除单个任务
44
+    void deleteByMpsbidAndMpid(@Param("mpsbid") Integer mpsbid,@Param("mpid") Integer mpid);
45
+
46
+    //打回重阅
47
+    void backCorrect(@Param("param") MsPaperCheckVo param);
48
+}

+ 40
- 0
smarking/src/main/java/com/xhkjedu/smarking/model/papercheck/MsPaperCheckTeacherProblem.java Visa fil

@@ -0,0 +1,40 @@
1
+package com.xhkjedu.smarking.model.papercheck;
2
+
3
+import com.xhkjedu.model.BaseBean;
4
+import lombok.Data;
5
+
6
+import javax.persistence.Id;
7
+import javax.persistence.Table;
8
+
9
+/**
10
+ * @Description 疑难卷教师任务表
11
+ * @Author auto
12
+ * @Date 2024-11-21
13
+ */
14
+@Data
15
+@Table(name = "ms_paper_check_teacher_problem")
16
+public class MsPaperCheckTeacherProblem extends BaseBean {
17
+    @Id
18
+    //疑难卷教师任务ID
19
+    private Integer mpctpid;
20
+    //试卷ID
21
+    private Integer mpid;
22
+    //题块/试题/班级ID
23
+    private Integer mblockid;
24
+    //教师ID
25
+    private Integer teacherid;
26
+    //序号
27
+    private Integer taskorder;
28
+    //学生题块/试题ID
29
+    private Integer mpsbid;
30
+    //批阅状态1未批改2批改中3已批改
31
+    private Integer checkstate;
32
+    //得分数组
33
+    private String checkscore;
34
+    //创建时间
35
+    private Integer createtime;
36
+    //是否优秀试卷0默认1是
37
+    private Integer hasgood;
38
+    //是否违规试卷0默认1是
39
+    private Integer hasbad;
40
+}

+ 5
- 1
smarking/src/main/java/com/xhkjedu/smarking/model/stupaper/MsPaperStudentBlock.java Visa fil

@@ -65,12 +65,16 @@ public class MsPaperStudentBlock extends BaseBean {
65 65
     private Double arbitratescore;
66 66
     //仲裁状态0默认1待仲裁2仲裁中3已仲裁
67 67
     private Integer arbitratestate;
68
-    //疑难0默认1疑难
68
+    //疑难0默认1疑难2处理中3已处理
69 69
     private Integer hasproblem;
70 70
     //疑难类型1图形模糊2答题错位3没有图像4图像颠倒5其他问题
71 71
     private Integer problemtype;
72 72
     //疑难备注
73 73
     private String problemcomm;
74
+    //疑难卷标记人ID
75
+    private Integer probleid;
76
+    //疑难卷处理人ID
77
+    private Integer problehid;
74 78
     //是否最终批改结果0否1是
75 79
     private Integer hasfinal;
76 80
     //最终批改原因1仲裁2学科组长批

+ 5
- 1
smarking/src/main/java/com/xhkjedu/smarking/model/stupaper/MsPaperStudentQuestion.java Visa fil

@@ -88,12 +88,16 @@ public class MsPaperStudentQuestion extends BaseBean {
88 88
     private Double arbitratescore;
89 89
     //仲裁状态0默认1待仲裁2仲裁中3已仲裁
90 90
     private Integer arbitratestate;
91
-    //疑难0默认1疑难
91
+    //疑难0默认1疑难2处理中3已处理
92 92
     private Integer hasproblem;
93 93
     //疑难类型1图形模糊2答题错位3没有图像4图像颠倒5其他问题
94 94
     private Integer problemtype;
95 95
     //疑难备注
96 96
     private String problemcomm;
97
+    //疑难卷标记人ID
98
+    private Integer probleid;
99
+    //疑难卷处理人ID
100
+    private Integer problehid;
97 101
     //是否最终批改结果0否1是
98 102
     private Integer hasfinal;
99 103
     //最终批改原因1仲裁2学科组长批

+ 34
- 0
smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsPaperCheckTeacherArbitrateService.java Visa fil

@@ -134,6 +134,15 @@ public class MsPaperCheckTeacherArbitrateService {
134 134
         Double qscore = param.getQscore();
135 135
         Double arbitratescore = param.getArbitratescore();
136 136
         Integer finalreason = param.getFinalreason();
137
+        Integer hasgood = param.getHasgood();
138
+        Integer hasbad = param.getHasbad();
139
+        Integer hasproblem = param.getHasproblem();
140
+        Integer problemtype = param.getProblemtype();
141
+        String problemcomm = param.getProblemcomm();
142
+        Integer probleid = null;
143
+        if (hasproblem.equals(1)) {
144
+            probleid = handleid;
145
+        }
137 146
         if (correcttype.equals(3)) {//按题块批阅
138 147
             MsPaperStudentBlock block = msPaperStudentBlockMapper.selectByPrimaryKey(mpsbid);
139 148
             String firstccores = block.getFirstccores();
@@ -210,6 +219,12 @@ public class MsPaperCheckTeacherArbitrateService {
210 219
             psq.setArbitratestate(2);
211 220
             psq.setHasfinal(1);
212 221
             psq.setFinalreason(finalreason);
222
+            psq.setHasgood(hasgood);
223
+            psq.setHasbad(hasbad);
224
+            psq.setHasproblem(hasproblem);
225
+            psq.setProblemtype(problemtype);
226
+            psq.setProblemcomm(problemcomm);
227
+            psq.setProbleid(probleid);
213 228
             msPaperStudentBlockMapper.updateByPrimaryKeySelective(psq);
214 229
             msPaperStudentQuestionMapper.checkByMptqidAndStudentId(studentQuestions, psq);
215 230
         } else if (correcttype.equals(2)) {
@@ -243,6 +258,12 @@ public class MsPaperCheckTeacherArbitrateService {
243 258
             psq.setArbitratestate(2);
244 259
             psq.setHasfinal(1);
245 260
             psq.setFinalreason(finalreason);
261
+            psq.setHasgood(hasgood);
262
+            psq.setHasbad(hasbad);
263
+            psq.setHasproblem(hasproblem);
264
+            psq.setProblemtype(problemtype);
265
+            psq.setProblemcomm(problemcomm);
266
+            psq.setProbleid(probleid);
246 267
             msPaperStudentQuestionMapper.updateByPrimaryKeySelective(psq);
247 268
         }
248 269
     }
@@ -292,6 +313,19 @@ public class MsPaperCheckTeacherArbitrateService {
292 313
             totalNum = teacher.getTasknum();
293 314
             checkedNum = teacher.getCheckednum();
294 315
             sq.setMpid(param.getMpid());
316
+
317
+            //序号
318
+            Integer taskorder = checkedNum + 1;
319
+            sq.setTaskorder(taskorder);
320
+            MsPaperCheckTeacherArbitrate task = new MsPaperCheckTeacherArbitrate();
321
+            task.setMpid(sq.getMpid());
322
+            task.setMblockid(sq.getMblockid());
323
+            task.setTeacherid(param.getHandleid());
324
+            task.setTaskorder(taskorder);
325
+            task.setMpsbid(sq.getMpsbid());
326
+            task.setCheckstate(2);
327
+            task.setCreatetime(N_Utils.getSecondTimestamp());
328
+            msPaperCheckTeacherArbitrateMapper.save(task);
295 329
         }
296 330
         Map map = new HashMap();
297 331
         map.put("sq", sq);

+ 225
- 0
smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsPaperCheckTeacherProblemService.java Visa fil

@@ -0,0 +1,225 @@
1
+package com.xhkjedu.smarking.service.papercheck;
2
+
3
+import com.xhkjedu.exception.ServiceException;
4
+import com.xhkjedu.smarking.mapper.paper.MsPaperMapper;
5
+import com.xhkjedu.smarking.mapper.papercheck.MsPaperCheckTeacherProblemMapper;
6
+import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentBlockMapper;
7
+import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentQuestionMapper;
8
+import com.xhkjedu.smarking.model.paper.MsPaper;
9
+import com.xhkjedu.smarking.model.paper.MsPaperBlockQuestion;
10
+import com.xhkjedu.smarking.model.papercheck.*;
11
+import com.xhkjedu.smarking.model.stupaper.MsPaperStudentBlock;
12
+import com.xhkjedu.smarking.model.stupaper.MsPaperStudentQuestion;
13
+import com.xhkjedu.smarking.utils.MarkingUtil;
14
+import com.xhkjedu.smarking.vo.papercheck.MsCheckParam;
15
+import com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo;
16
+import com.xhkjedu.utils.N_Utils;
17
+import com.xhkjedu.vo.ResultVo;
18
+import org.springframework.stereotype.Service;
19
+import org.springframework.transaction.annotation.Transactional;
20
+
21
+import javax.annotation.Resource;
22
+import java.util.*;
23
+
24
+/**
25
+ * @Description 疑难卷教师任务表 服务实现类
26
+ * @Author auto
27
+ * @Date 2024-11-21
28
+ */
29
+@Service
30
+public class MsPaperCheckTeacherProblemService {
31
+    @Resource
32
+    private MsPaperCheckTeacherProblemMapper msPaperCheckTeacherProblemMapper;
33
+    @Resource
34
+    private MsPaperMapper msPaperMapper;
35
+    @Resource
36
+    private MsPaperStudentBlockMapper msPaperStudentBlockMapper;
37
+    @Resource
38
+    private MsPaperStudentQuestionMapper msPaperStudentQuestionMapper;
39
+
40
+    /**
41
+     * @Description 学科组长-疑难卷列表
42
+     * @Date 2024/11/21 10:01
43
+     * @Author YWX
44
+     * @Param [mpid]
45
+     * @Return java.util.List<java.util.Map>
46
+     **/
47
+    public List<Map> listPendingProblem(Integer mpid) {
48
+        MsCheckParam param = new MsCheckParam();
49
+        param.setMpid(mpid);
50
+        Integer correctType = msPaperMapper.getCorrectTypeByMpId(param.getMpid());
51
+        if (correctType.equals(3)) {
52
+            return msPaperCheckTeacherProblemMapper.listBlockProblem(param);//学科组长-待仲裁题块列表
53
+        } else {
54
+            return msPaperCheckTeacherProblemMapper.listQuestionProblem(param);//学科组长-待仲裁试题列表
55
+        }
56
+    }
57
+
58
+    /**
59
+     * @Description 获取疑难卷任务
60
+     * @Date 2024/11/21 10:19
61
+     * @Author YWX
62
+     * @Param [param]
63
+     * @Return com.xhkjedu.vo.ResultVo
64
+     **/
65
+    public ResultVo getCorrectProblem(MsCheckParam param) {
66
+        Integer mpid = param.getMpid();
67
+        MsPaper paper = msPaperMapper.selectByPrimaryKey(mpid);
68
+        Integer correcttype = paper.getCorrecttype();
69
+        if (!N_Utils.isTrueInteger(correcttype)) {
70
+            throw new ServiceException("该试卷未设置批阅方式");
71
+        }
72
+        param.setCorrecttype(correcttype);
73
+        param.setSubjectid(paper.getSubjectid());
74
+        Map sq = msPaperCheckTeacherProblemMapper.getCorrectProblem(param);
75
+
76
+        Integer totalNum = 0;
77
+        Integer checkedNum = 0;
78
+        if (sq != null) {
79
+            sq.put("correcttype", correcttype);
80
+            Integer mblockid = N_Utils.obj2Int(sq.get("mblockid"));
81
+            param.setMblockid(mblockid);
82
+            MsPaperCheckTeacher teacher = msPaperCheckTeacherProblemMapper.getPCheckNum(param);
83
+            totalNum = teacher.getTasknum();
84
+            checkedNum = teacher.getCheckednum();
85
+            sq.put("mpid", mpid);
86
+
87
+            //序号
88
+            Integer taskorder = checkedNum + 1;
89
+            sq.put("taskorder", taskorder);
90
+            MsPaperCheckTeacherProblem task = new MsPaperCheckTeacherProblem();
91
+            task.setMpid(mpid);
92
+            task.setMblockid(mblockid);
93
+            task.setTeacherid(param.getHandleid());
94
+            task.setTaskorder(taskorder);
95
+            task.setMpsbid(N_Utils.obj2Int(sq.get("mpsbid")));
96
+            task.setCheckstate(2);
97
+            task.setCreatetime(N_Utils.getSecondTimestamp());
98
+            msPaperCheckTeacherProblemMapper.save(task);
99
+        }
100
+        Map map = new HashMap();
101
+        map.put("sq", sq);
102
+        map.put("totalNum", totalNum);
103
+        map.put("checkedNum", checkedNum);
104
+        String msg = "获取成功";
105
+        return new ResultVo(0, msg, map);
106
+    }
107
+
108
+    /**
109
+     * @Description 处理疑难卷
110
+     * @Date 2024/11/21 11:17
111
+     * @Author YWX
112
+     * @Param [param]
113
+     * @Return void
114
+     **/
115
+    public void correct(MsPaperCheckVo param) {
116
+        Integer correcttype = msPaperMapper.getCorrectTypeByMpId(param.getMpid());
117
+        Integer mpsbid = param.getMpsbid();
118
+        Integer handleid = param.getHandleid();
119
+        Double qscore = param.getQscore();
120
+        Double arbitratescore = param.getArbitratescore();
121
+        Integer hasgood = param.getHasgood();
122
+        Integer hasbad = param.getHasbad();
123
+        if (correcttype.equals(3)) {//按题块批阅
124
+            List<MsPaperBlockQuestion> questions = param.getQuestions();
125
+            List<MsPaperStudentQuestion> studentQuestions = new ArrayList<>();
126
+            for (MsPaperBlockQuestion question : questions) {
127
+                Double stuscore = question.getStuscore();
128
+                if (N_Utils.isTrueInteger(question.getMptqid())) {
129
+                    MsPaperStudentQuestion studentQuestion = new MsPaperStudentQuestion();
130
+                    studentQuestion.setMptqid(question.getMptqid());
131
+                    studentQuestion.setStuscore(stuscore);
132
+                    studentQuestions.add(studentQuestion);
133
+                } else {
134
+                    String[] mptqids = question.getMergeqid().split(",");
135
+                    String[] mergestuscore = question.getMergestuscore().split(",");
136
+                    double[] scores = new double[mergestuscore.length];
137
+                    int last = mergestuscore.length - 1;
138
+                    double score = 0;
139
+                    for (int i = 0; i < mergestuscore.length; i++) {
140
+                        scores[i] = MarkingUtil.mul(MarkingUtil.div(mergestuscore[i], qscore), stuscore);
141
+                        score = MarkingUtil.add(score, scores[i]);
142
+                        if (i == last) {
143
+                            scores[i] = MarkingUtil.sub(stuscore, score);
144
+                        }
145
+                    }
146
+                    for (int i = 0; i < mptqids.length; i++) {
147
+                        MsPaperStudentQuestion studentQuestion = new MsPaperStudentQuestion();
148
+                        studentQuestion.setMptqid(N_Utils.obj2Int(mptqids[i]));
149
+                        studentQuestion.setStuscore(scores[i]);
150
+                        studentQuestion.setArbitratescore(scores[i]);
151
+                        studentQuestions.add(studentQuestion);
152
+                    }
153
+                }
154
+            }
155
+
156
+            //更处理结果
157
+            MsPaperStudentBlock psq = new MsPaperStudentBlock();
158
+            psq.setMpsbid(mpsbid);
159
+            psq.setChecked(3);
160
+            psq.setHasgood(hasgood);
161
+            psq.setHasbad(hasbad);
162
+            psq.setHasproblem(3);
163
+            psq.setProblehid(handleid);
164
+            msPaperStudentBlockMapper.updateByPrimaryKeySelective(psq);
165
+            msPaperStudentQuestionMapper.checkByMptqidAndStudentId(studentQuestions, psq);
166
+        } else {
167
+            //更新处理结果
168
+            MsPaperStudentQuestion psq = new MsPaperStudentQuestion();
169
+            psq.setMpsqid(mpsbid);
170
+            psq.setChecked(3);
171
+            psq.setStuscore(arbitratescore);
172
+            psq.setHasgood(hasgood);
173
+            psq.setHasbad(hasbad);
174
+            psq.setHasproblem(3);
175
+            psq.setProblehid(handleid);
176
+            msPaperStudentQuestionMapper.updateByPrimaryKeySelective(psq);
177
+        }
178
+    }
179
+
180
+    /**
181
+     * @Description 获取上一份疑难卷
182
+     * @Date 2024/11/21 14:35
183
+     * @Author YWX
184
+     * @Param [param]
185
+     * @Return java.util.Map
186
+     **/
187
+    public Map getPreProblem(MsCheckParam param) {
188
+        return msPaperCheckTeacherProblemMapper.getPreProblem(param);
189
+    }
190
+
191
+    /**
192
+     * @Description 历史记录列表
193
+     * @Date 2024/11/21 11:00
194
+     * @Author YWX
195
+     * @Param [param]
196
+     * @Return java.util.List<java.util.Map>
197
+     **/
198
+    public List<Map> listHistory(MsCheckParam param) {
199
+        return msPaperCheckTeacherProblemMapper.listHistory(param);
200
+    }
201
+
202
+    /**
203
+     * @Description 历史记录详情
204
+     * @Date 2024/11/21 14:04
205
+     * @Author YWX
206
+     * @Param [param]
207
+     * @Return java.util.Map
208
+     **/
209
+    public Map detailHistory(MsCheckParam param) {
210
+        return msPaperCheckTeacherProblemMapper.detailHistory(param);
211
+    }
212
+
213
+    /**
214
+     * @Description 打回重阅
215
+     * @Date 2024/11/21 15:19
216
+     * @Author YWX
217
+     * @Param [param]
218
+     * @Return void
219
+     **/
220
+    @Transactional(rollbackFor = Exception.class)
221
+    public void backCorrect(MsPaperCheckVo param) {
222
+        msPaperCheckTeacherProblemMapper.backCorrect(param);//打回重阅
223
+        msPaperCheckTeacherProblemMapper.deleteByMpsbidAndMpid(param.getMpsbid(), param.getMpid());//删除单个任务
224
+    }
225
+}

+ 9
- 1
smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsPaperCheckTeacherTaskService.java Visa fil

@@ -382,6 +382,11 @@ public class MsPaperCheckTeacherTaskService {
382 382
         Integer hasproblem = param.getHasproblem();
383 383
         Integer problemtype = param.getProblemtype();
384 384
         String problemcomm = param.getProblemcomm();
385
+        Integer handleid = param.getHandleid();
386
+        Integer probleid = null;
387
+        if (hasproblem.equals(1)) {
388
+            probleid = handleid;
389
+        }
385 390
         Double qscore = param.getQscore();
386 391
         List<MsPaperBlockQuestion> questions = param.getQuestions();
387 392
         int checked = 2;
@@ -406,6 +411,7 @@ public class MsPaperCheckTeacherTaskService {
406 411
                 block.setHasproblem(hasproblem);
407 412
                 block.setProblemtype(problemtype);
408 413
                 block.setProblemcomm(problemcomm);
414
+                block.setProbleid(probleid);
409 415
                 msPaperStudentBlockMapper.updateByPrimaryKeySelective(block);
410 416
                 block.setStudentid(param.getStudentid());
411 417
                 block.setMblockid(param.getMblockid());
@@ -454,11 +460,11 @@ public class MsPaperCheckTeacherTaskService {
454 460
                 question.setHasproblem(hasproblem);
455 461
                 question.setProblemtype(problemtype);
456 462
                 question.setProblemcomm(problemcomm);
463
+                question.setProbleid(probleid);
457 464
                 question.setStuscore(firstccore);
458 465
                 msPaperStudentQuestionMapper.updateByPrimaryKeySelective(question);
459 466
             }
460 467
         } else {//双评
461
-            Integer handleid = param.getHandleid();
462 468
             Integer firstcid = param.getFirstcid();
463 469
             Integer secondcid = param.getSecondcid();
464 470
             Integer firstcime = param.getFirstcime();
@@ -589,6 +595,7 @@ public class MsPaperCheckTeacherTaskService {
589 595
                 block.setHasproblem(hasproblem);
590 596
                 block.setProblemtype(problemtype);
591 597
                 block.setProblemcomm(problemcomm);
598
+                block.setProbleid(probleid);
592 599
                 block.setStudentid(param.getStudentid());
593 600
                 block.setMblockid(param.getMblockid());
594 601
                 block.setArbitratestate(arbitratestate);
@@ -613,6 +620,7 @@ public class MsPaperCheckTeacherTaskService {
613 620
                 question.setHasproblem(hasproblem);
614 621
                 question.setProblemtype(problemtype);
615 622
                 question.setProblemcomm(problemcomm);
623
+                question.setProbleid(probleid);
616 624
                 question.setStuscore(endscore);
617 625
                 question.setMpsqid(mpsbid);
618 626
                 question.setArbitratestate(arbitratestate);

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/vo/papercheck/MsCheckParam.java Visa fil

@@ -42,4 +42,6 @@ public class MsCheckParam extends BaseBean {
42 42
     private String subjectid;
43 43
     //阅卷仲裁教师任务ID
44 44
     private Integer mpctaid;
45
+    //疑难卷教师任务ID
46
+    private Integer mpctpid;
45 47
 }

+ 12
- 0
smarking/src/main/resources/mapper/papercheck/MsPaperCheckTeacherArbitrateMapper.xml Visa fil

@@ -1,6 +1,12 @@
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.papercheck.MsPaperCheckTeacherArbitrateMapper">
4
+    <!--保存或更新单个任务-->
5
+    <insert id="save">
6
+        insert into ms_paper_check_teacher_arbitrate (mpid, mblockid, teacherid, taskorder,checkstate, mpsbid, createtime)
7
+        values (#{m.mpid},#{m.mblockid},#{m.teacherid},#{m.taskorder},#{m.mpsbid},#{m.checkstate},#{m.createtime})
8
+        on duplicate key update taskorder=#{m.taskorder},teacherid=#{m.teacherid}
9
+    </insert>
4 10
     <!--教师阅卷-待/已仲裁列表-->
5 11
     <select id="listArbitrate" resultType="java.util.Map">
6 12
         select s.msid,s.subjectname,s.sdate,s.begintime,s.endtime,e.examname,e.gradeid,e.examtype
@@ -111,6 +117,12 @@
111 117
         <result property="hidefirstscore" column="hidefirstscore"/>
112 118
         <collection property="questions" select="listQuestion" column="mblockid"/>
113 119
     </resultMap>
120
+    <select id="listQuestion" resultType="java.util.Map">
121
+        select pbq.mbqid,pbq.mptqid,pbq.mbqtype,pbq.bqscore,pbq.bqorder,pbq.bqn
122
+        ,pbq.mergeqid,pbq.mergeqn,pbq.mergescore,pbq.scorestepway,pbq.scorestep
123
+        from ms_paper_block_question pbq where pbq.mblockid=#{mblockid}
124
+        order by pbq.bqn
125
+    </select>
114 126
     <select id="listBlockArbitrate" resultMap="arbitrateBlockResultMap">
115 127
         select pb.blockname,pb.blockorder,pb.bqnum
116 128
         ,pc.mblockid,pc.hidefirstscore

+ 137
- 0
smarking/src/main/resources/mapper/papercheck/MsPaperCheckTeacherProblemMapper.xml Visa fil

@@ -0,0 +1,137 @@
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.papercheck.MsPaperCheckTeacherProblemMapper">
4
+    <!--保存或更新单个任务-->
5
+    <insert id="save">
6
+        insert into ms_paper_check_teacher_problem (mpid, mblockid, teacherid, taskorder,checkstate, mpsbid, createtime)
7
+        values (#{m.mpid},#{m.mblockid},#{m.teacherid},#{m.taskorder},#{m.mpsbid},#{m.checkstate},#{m.createtime})
8
+        on duplicate key update taskorder=#{m.taskorder},teacherid=#{m.teacherid}
9
+    </insert>
10
+    <!--删除单个任务-->
11
+    <delete id="deleteByMpsbidAndMpid">
12
+        delete from ms_paper_check_teacher_problem where mpsbid=#{mpsbid} and mpid=#{mpid}
13
+    </delete>
14
+    <!--疑难卷题块列表-->
15
+    <resultMap id="arbitrateBlockResultMap" type="java.util.Map">
16
+        <result property="mblockid" column="mblockid"/>
17
+        <result property="blockname" column="blockname"/>
18
+        <result property="blockorder" column="blockorder"/>
19
+        <result property="bqnum" column="bqnum"/>
20
+        <result property="hidefirstscore" column="hidefirstscore"/>
21
+        <collection property="questions" select="listQuestion" column="mblockid"/>
22
+    </resultMap>
23
+    <select id="listQuestion" resultType="java.util.Map">
24
+        select pbq.mbqid,pbq.mptqid,pbq.mbqtype,pbq.bqscore,pbq.bqorder,pbq.bqn
25
+        ,pbq.mergeqid,pbq.mergeqn,pbq.mergescore,pbq.scorestepway,pbq.scorestep
26
+        from ms_paper_block_question pbq where pbq.mblockid=#{mblockid}
27
+        order by pbq.bqn
28
+    </select>
29
+    <select id="listBlockProblem" resultMap="arbitrateBlockResultMap">
30
+        select pb.mblockid,pb.blockname,pb.blockorder,pb.bqnum
31
+        from ms_paper_student_block psb inner join ms_paper_block pb on psb.mblockid = pb.mblockid
32
+        where psb.mpid=#{param.mpid} and psb.hasproblem=1
33
+        group by pb.mblockid
34
+        order by pb.blockorder
35
+    </select>
36
+    <!--疑难卷试题列表-->
37
+    <select id="listQuestionProblem" resultType="java.util.Map">
38
+        select psb.qorder,psb.qn,psb.qscore
39
+        from ms_paper_student_question psb
40
+        where psb.mpid=#{param.mpid} and psb.hasproblem=1
41
+        group by psb.mptqid
42
+        order by psb.mptqid
43
+    </select>
44
+    <!--获取疑难卷任务-->
45
+    <select id="getCorrectLeaderProblem" resultType="java.util.Map">
46
+        <if test="param.correcttype==3">
47
+            select psb.mblockid,psb.stuanswer,psb.mpsbid
48
+            from ms_paper_student_block psb
49
+            where psb.mpid=#{param.mpid}
50
+            and (psb.hasproblem=1 or (psb.hasproblem=2 and psb.problehid=#{param.handleid}))
51
+            order by psb.mpsbid limit 1
52
+        </if>
53
+        <if test="param.correcttype==2">
54
+            select psb.mpsqid as mblockid,psb.stuanswer,psb.mpsqid as mpsbid,psb.answertype
55
+            from ms_paper_student_question psb
56
+            where psb.mpid=#{param.mpid}
57
+            and (psb.hasproblem=1 or (psb.hasproblem=2 and psb.problehid=#{param.handleid}))
58
+            order by psb.mpsqid limit 1
59
+        </if>
60
+    </select>
61
+    <!--获取疑难卷数量-->
62
+    <select id="getPCheckNum" resultType="com.xhkjedu.smarking.model.papercheck.MsPaperCheckTeacher">
63
+        <if test="param.correcttype==3">
64
+            select count(psb.mpsbid) as tasknum
65
+            ,count(if(psb.hasproblem=3 and psb.problehid=#{param.handleid},psb.mpsbid,null)) as checkednum
66
+            from ms_paper_student_block psb
67
+            where psb.mpid=#{param.mpid} and psb.hasproblem in(1,2,3)
68
+        </if>
69
+        <if test="param.correcttype==2">
70
+            select count(psb.mpsqid) as tasknum
71
+            ,count(if(psb.hasproblem=3 and psb.problehid=#{param.handleid},psb.mpsqid,null)) as checkednum
72
+            from ms_paper_student_question psb
73
+            where psb.mpid=#{param.mpid} and psb.hasproblem in(1,2,3)
74
+        </if>
75
+    </select>
76
+    <!--获取上一份疑难卷-->
77
+    <select id="getPreProblem" resultType="java.util.Map">
78
+        select psq.stuanswer,psq.hasproblem,psq.problemtype,psq.problemcomm
79
+        ,pctp.mpid,pctp.mblockid,pctp.mpsbid,pctp.taskorder,pctp.checkscore
80
+        ,u.username as studentname,u.examno,u2.username as teachername
81
+        from ms_paper_check_teacher_problem pctp
82
+        <if test="param.correcttype==3">
83
+            inner join ms_paper_student_block psq on mpcta.mpsbid=psq.mpsbid
84
+        </if>
85
+        <if test="param.correcttype==2">
86
+            inner join ms_paper_student_question psq on pctp.mpsbid=psq.mpsqid
87
+        </if>
88
+        inner join t_user u on psq.studentid = u.userid
89
+        inner join t_user u2 on psq.probleid = u2.userid
90
+        where pctp.mpid=#{param.mpid} and pctp.teacherid=#{param.handleid} and pctp.mblockid=#{param.mblockid} and pctp.checkstate=3
91
+        and #{param.mpsbid}>pctp.mpsbid
92
+        order by pctp.mpsbid desc limit 1
93
+    </select>
94
+    <!--历史记录列表-->
95
+    <select id="listHistory" resultType="java.util.Map">
96
+        select pctp.mpctpid,pctp.mpsbid,pctp.checkscore,pctp.taskorder
97
+        ,(case when pctp.hasgood=1 then '优' when pctp.hasbad=1 then '违' else '' end) as comm
98
+        from ms_paper_check_teacher_problem pctp
99
+        where pctp.mpid=#{param.mpid} and pctp.teacherid=#{param.handleid} and pctp.mblockid=#{param.mblockid} and pctp.checkstate=3
100
+        <if test="param.taskorder!=null and param.taskorder!=0">
101
+            and pctp.taskorder=#{param.taskorder}
102
+        </if>
103
+        order by pctp.mpsbid desc
104
+    </select>
105
+    <!--历史记录详情-->
106
+    <select id="detailHistory" resultType="java.util.Map">
107
+        select psq.stuanswer,psq.hasproblem,psq.problemtype,psq.problemcomm
108
+        ,pctp.mpid,pctp.mblockid,pctp.mpsbid,pctp.taskorder,pctp.checkscore
109
+        ,u.username as studentname,u.examno,u2.username as teachername
110
+        from ms_paper_check_teacher_problem pctp
111
+        <if test="param.correcttype==3">
112
+            inner join ms_paper_student_block psq on mpcta.mpsbid=psq.mpsbid
113
+        </if>
114
+        <if test="param.correcttype==2">
115
+            inner join ms_paper_student_question psq on pctp.mpsbid=psq.mpsqid
116
+        </if>
117
+        inner join t_user u on psq.studentid = u.userid
118
+        inner join t_user u2 on psq.probleid = u2.userid
119
+        where pctp.mpctpid=#{param.mpctpid}
120
+    </select>
121
+    <!--打回重阅-->
122
+    <select id="backCorrect">
123
+        update ms_paper_check_teacher_task pctt
124
+        <if test="param.correcttype==3">
125
+            inner join ms_paper_student_block psb on pctt.mpsbid=psb.mpsbid
126
+            inner join ms_paper_student_question psq on psb.mblockid=psq.mblockid
127
+        </if>
128
+        <if test="param.correcttype==2">
129
+            inner join ms_paper_student_question psq on pctt.mpsbid=psq.mpsqid
130
+        </if>
131
+        set pctt.checkstate=1,psq.checked=1,psq.hasproblem=0,psq.problemtype=0,psq.problemcomm='',psq.firstcime=null,psq.secondctime=null
132
+        <if test="param.correcttype==3">
133
+            ,psb.checked=1,psb.hasproblem=0,psb.problemtype=0,psb.problemcomm='',psb.firstcime=null,psb.secondctime=null
134
+        </if>
135
+        where pctt.mpid=#{param.mpid} and pctt.mpsbid=#{param.mpsbid}
136
+    </select>
137
+</mapper>

+ 40
- 38
smarking/src/main/resources/mapper/papercheck/MsPaperCheckTeacherTaskMapper.xml Visa fil

@@ -6,14 +6,14 @@
6 6
         <foreach collection ="tasks" item="s" index= "index" separator =";">
7 7
             insert into ms_paper_check_teacher_task (mpid, mblockid, teacherid, taskorder, mpsbid, checktype, createtime)
8 8
             values (#{s.mpid},#{s.mblockid},#{s.teacherid},#{s.taskorder},#{s.mpsbid},#{s.checktype},#{s.createtime})
9
-            on duplicate key update taskorder=#{s.taskorder},checktype=#{s.checktype}
9
+            on duplicate key update taskorder=#{s.taskorder},teacherid=#{s.teacherid}
10 10
         </foreach>
11 11
     </insert>
12 12
     <!--保存或更新单个任务-->
13 13
     <insert id="save">
14 14
         insert into ms_paper_check_teacher_task (mpid, mblockid, teacherid, taskorder, mpsbid, checktype, createtime)
15 15
         values (#{s.mpid},#{s.mblockid},#{s.teacherid},#{s.taskorder},#{s.mpsbid},#{s.checktype},#{s.createtime})
16
-        on duplicate key update taskorder=#{s.taskorder},checktype=#{s.checktype}
16
+        on duplicate key update taskorder=#{s.taskorder},teacherid=#{s.teacherid}
17 17
     </insert>
18 18
     <!--批量更新任务信息-->
19 19
     <update id="batchUpdate">
@@ -194,51 +194,52 @@
194 194
     </select>
195 195
     <!--教师阅卷-待/已阅卷列表-->
196 196
     <select id="listCorrect" resultType="java.util.Map">
197
-        select s.msid,s.subjectname,s.sdate,s.begintime,s.endtime,e.examname,e.gradeid,e.examtype
198
-        ,pc.mpid,pc.checktype,pc.dispenseway,pc.numtype
197
+        select s.msid,s.subjectname,s.sdate,s.begintime,s.endtime,e.examname,e.gradeid,e.examtype,e.exammode
198
+        ,pc.mpid,pc.checktype,pc.dispenseway,pc.numtype,pc.correcttype
199 199
         ,truncate((count(distinct if(psb.firstcid = #{param.handleid} and psb.firstcime>0,psb.mpsbid,null))
200 200
         +count(distinct if(pc.checktype=2 and psb.secondcid = #{param.handleid} and psb.secondctime>0,psb.mpsbid,null))
201
-        )*100/count(distinct psb.mpsbid)*pc.checktype,2) as checkrate
201
+        )*100/count(distinct psb.mpsbid),2) as checkrate
202 202
         from ms_subject s inner join ms_exam e on s.examid = e.examid
203 203
         inner join ms_paper_check pc on pc.msid = s.msid
204 204
         inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid=pc.mpid
205
-        inner join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.mpid = pc.mpid and psb.checked!=0
205
+        inner join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.mpid = pc.mpid
206 206
         where e.schoolid=#{param.schoolid} and s.checkstate=1 and e.deleted=1 and pc.dispenseway=2 and pc.correcttype=3
207
+        and (psb.checked=1 or (psb.checked in(2,3) and (psb.firstcid=#{param.handleid} or psb.secondcid=#{param.handleid})))
207 208
         group by s.msid
208 209
         <if test="param.checktype==0">having 100>checkrate</if>
209 210
         <if test="param.checktype==1">having 100=checkrate</if>
210 211
         union
211
-        select s.msid,s.subjectname,s.sdate,s.begintime,s.endtime,e.examname,e.gradeid,e.examtype
212
-        ,pc.mpid,pc.checktype,pc.dispenseway,pc.numtype
213
-        ,truncate((count(distinct if(psb.firstcid = #{param.handleid} and psb.firstcime>0,psb.mpsqid,null))
214
-        +count(distinct if(pc.checktype=2 and psb.secondcid = #{param.handleid} and psb.secondctime>0,psb.mpsqid,null))
215
-        )*100/count(distinct psb.mpsqid)*pc.checktype,2) as checkrate
212
+        select s.msid,s.subjectname,s.sdate,s.begintime,s.endtime,e.examname,e.gradeid,e.examtype,e.exammode
213
+        ,pc.mpid,pc.checktype,pc.dispenseway,pc.numtype,pc.correcttype
214
+        ,truncate((count(distinct if(psb.firstcime>0 or psb.secondctime>0,psb.mpsqid,null))
215
+        )*100/count(distinct psb.mpsqid),2) as checkrate
216 216
         from ms_subject s inner join ms_exam e on s.examid = e.examid
217 217
         inner join ms_paper_check pc on pc.msid = s.msid
218 218
         inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid=pc.mpid
219
-        inner join ms_paper_student_question psb on psb.mptqid = pc.mblockid and psb.mpid = pc.mpid and psb.checked!=0
219
+        inner join ms_paper_student_question psb on psb.mptqid = pc.mblockid and psb.mpid = pc.mpid
220 220
         where e.schoolid=#{param.schoolid} and s.checkstate=1 and e.deleted=1 and pc.dispenseway=2 and pc.correcttype=2
221
+        and (psb.checked=1 or (psb.checked in(2,3) and (psb.firstcid=#{param.handleid} or psb.secondcid=#{param.handleid})))
221 222
         group by s.msid
222 223
         <if test="param.checktype==0">having 100>checkrate</if>
223 224
         <if test="param.checktype==1">having 100=checkrate</if>
224 225
         union
225
-        select s.msid,s.subjectname,s.sdate,s.begintime,s.endtime,e.examname,e.gradeid,e.examtype
226
-        ,pc.mpid,pc.checktype,pc.dispenseway,pc.numtype
227
-        ,truncate((count(distinct if(psb.firstcid = #{param.handleid} and psb.firstcime>0,psb.mpsqid,null))
228
-        +count(distinct if(pc.checktype=2 and psb.secondcid = #{param.handleid} and psb.secondctime>0,psb.mpsqid,null))
229
-        )*100/count(distinct psb.mpsqid)*pc.checktype,2) as checkrate
226
+        select s.msid,s.subjectname,s.sdate,s.begintime,s.endtime,e.examname,e.gradeid,e.examtype,e.exammode
227
+        ,pc.mpid,pc.checktype,pc.dispenseway,pc.numtype,pc.correcttype
228
+        ,truncate((count(distinct if(psb.firstcime>0 or psb.secondctime>0,psb.mpsqid,null))
229
+        )*100/count(distinct psb.mpsqid),2) as checkrate
230 230
         from ms_subject s inner join ms_exam e on s.examid = e.examid
231 231
         inner join ms_paper_check pc on pc.msid = s.msid
232 232
         inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid=pc.mpid
233 233
         inner join ms_class_student cs on cs.examid = e.examid and cs.subjectid = s.subjectid and cs.classid = pct.mblockid
234
-        inner join ms_paper_student_question psb on psb.studentid = cs.studentid and psb.mpid = pc.mpid and psb.checked!=0
234
+        inner join ms_paper_student_question psb on psb.studentid = cs.studentid and psb.mpid = pc.mpid
235 235
         where e.schoolid=#{param.schoolid} and s.checkstate=1 and e.deleted=1 and pc.dispenseway=2 and pc.correcttype=1
236
+        and (psb.checked=1 or (psb.checked in(2,3) and (psb.firstcid=#{param.handleid} or psb.secondcid=#{param.handleid})))
236 237
         group by s.msid
237 238
         <if test="param.checktype==0">having 100>checkrate</if>
238 239
         <if test="param.checktype==1">having 100=checkrate</if>
239 240
         union
240
-        select s.msid,s.subjectname,s.sdate,s.begintime,s.endtime,e.examname,e.gradeid,e.examtype
241
-        ,pc.mpid,pc.checktype,pc.dispenseway,pc.numtype
241
+        select s.msid,s.subjectname,s.sdate,s.begintime,s.endtime,e.examname,e.gradeid,e.examtype,e.exammode
242
+        ,pc.mpid,pc.checktype,pc.dispenseway,pc.numtype,pc.correcttype
242 243
         ,truncate((count(distinct if(pctt.checkstate=3,pctt.mpcttid,null)))*100/count(distinct pctt.mpcttid),2) as checkrate
243 244
         from ms_subject s inner join ms_exam e on s.examid = e.examid
244 245
         inner join ms_paper_check pc on pc.msid = s.msid
@@ -255,13 +256,14 @@
255 256
         <if test="param.correcttype==3">
256 257
             select pb.blockname,pb.blockorder,pb.bqnum
257 258
             ,pc.mblockid,pc.checktype,pc.dispenseway,pc.numtype
258
-            ,count(distinct psb.mpsbid)*pc.checktype as totalNum
259
-            ,count(distinct if(psb.firstcime is not null,psb.mpsbid,null))+count(distinct if(psb.secondctime is not null,psb.mpsbid,null)) as totalCheckedNum
260
-            ,count(distinct if(psb.firstcime is null,psb.mpsbid,null))+count(distinct if(pc.checktype=2 and psb.secondctime is null,psb.mpsbid,null)) as totalUncheckedNum
259
+            ,count(distinct psb.mpsbid) as totalNum
260
+            ,count(distinct if(psb.checked=3,psb.mpsbid,null)) as totalCheckedNum
261
+            ,count(distinct if(psb.checked in(1,2),psb.mpsbid,null)) as totalUncheckedNum
261 262
             ,count(distinct if((psb.firstcime is not null and psb.firstcid=#{param.handleid}) or (psb.secondctime is not null and psb.secondcid=#{param.handleid}),psb.mpsbid,null)) as myCheckedNum
262 263
             ,count(distinct if(((psb.firstcime is null and psb.firstcid=#{param.handleid})
263
-            or (psb.secondctime is null and psb.secondcid=#{param.handleid}) or pc.dispenseway=2) and psb.checked in(1,2)
264
+            or (psb.secondctime is null and psb.secondcid=#{param.handleid}) or psb.checked=1)
264 265
             ,psb.mpsbid,null)) as myUncheckedNum
266
+            ,(select group_concat(pbbq.bqn separator '、') from ms_paper_block_question pbbq where pbbq.mblockid = pb.mblockid) as bqn
265 267
             from ms_paper_check pc left join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.mpid = pc.mpid
266 268
             and (psb.firstcid = #{param.handleid} or psb.secondcid = #{param.handleid} or pc.dispenseway=2)
267 269
             inner join ms_paper_block pb on pc.mblockid = pb.mblockid and pb.mpid = pc.mpid
@@ -273,12 +275,12 @@
273 275
         <if test="param.correcttype==2">
274 276
             select pb.qorder,pb.qn
275 277
             ,pc.mblockid,pc.checktype,pc.dispenseway,pc.numtype
276
-            ,count(distinct psb.mpsqid)*pc.checktype as totalNum
277
-            ,count(distinct if(psb.firstcime>0,psb.mpsqid,null))+count(distinct if(psb.secondctime>0,psb.mpsqid,null)) as totalCheckedNum
278
-            ,count(distinct if(psb.firstcime is null,psb.mpsqid,null))+count(distinct if(pc.checktype=2 and psb.secondctime is null,psb.mpsqid,null)) as totalUncheckedNum
278
+            ,count(distinct psb.mpsqid) as totalNum
279
+            ,count(distinct if(psb.checked=3,psb.mpsqid,null)) as totalCheckedNum
280
+            ,count(distinct if(psb.checked in(1,2),psb.mpsqid,null)) as totalUncheckedNum
279 281
             ,count(distinct if((psb.firstcime>0 and psb.firstcid=#{param.handleid}) or (psb.secondctime>0 and psb.secondcid=#{param.handleid}),psb.mpsqid,null)) as myCheckedNum
280 282
             ,count(distinct if(((psb.firstcime is null and psb.firstcid=#{param.handleid})
281
-            or (psb.secondctime is null and psb.secondcid=#{param.handleid}) or pc.dispenseway=2) and psb.checked in(1,2)
283
+            or (psb.secondctime is null and psb.secondcid=#{param.handleid}) or psb.checked=1)
282 284
             ,psb.mpsqid,null)) as myUncheckedNum
283 285
             from ms_paper_check pc left join ms_paper_student_question psb on psb.mptqid = pc.mblockid and psb.mpid = pc.mpid
284 286
             and (psb.firstcid = #{param.handleid} or psb.secondcid = #{param.handleid} or pc.dispenseway=2) and psb.answered=1
@@ -292,17 +294,17 @@
292 294
             select c.classname,c.classtype
293 295
             ,pc.mblockid,pc.checktype,pc.dispenseway,pc.numtype
294 296
             ,count(distinct psb.mpsqid)*pc.checktype as totalNum
295
-            ,count(distinct if(psb.firstcime is not null,psb.mpsqid,null))+count(distinct if(psb.secondctime is not null,psb.mpsqid,null)) as totalCheckedNum
296
-            ,count(distinct if(psb.firstcime is null,psb.mpsqid,null))+count(distinct if(pc.checktype=2 and psb.secondctime is null,psb.mpsqid,null)) as totalUncheckedNum
297
+            ,count(distinct if(psb.checked=3,psb.mpsqid,null)) as totalCheckedNum
298
+            ,count(distinct if(psb.checked in(1,2),psb.mpsqid,null)) as totalUncheckedNum
297 299
             ,count(distinct if((psb.firstcime is not null and psb.firstcid=#{param.handleid}) or (psb.secondctime is not null and psb.secondcid=#{param.handleid}),psb.mpsqid,null)) as myCheckedNum
298 300
             ,count(distinct if(((psb.firstcime is null and psb.firstcid=#{param.handleid})
299
-            or (psb.secondctime is null and psb.secondcid=#{param.handleid}) or pc.dispenseway=2) and psb.checked in(1,2)
301
+            or (psb.secondctime is null and psb.secondcid=#{param.handleid}) or psb.checked=1)
300 302
             ,psb.mpsqid,null)) as myUncheckedNum
301 303
             from ms_paper_check pc inner join ms_class c on pc.mblockid = c.classid
302 304
             inner join ms_class_student cs on c.examid=cs.examid and c.subjectid=cs.subjectid and pc.mblockid=cs.classid
303 305
             inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid=pc.mpid and pct.teacherid = #{param.handleid}
304 306
             left join ms_paper_student_question psb on psb.mpid = pc.mpid and psb.studentid=cs.studentid and psb.answered=1 and psb.ctype in(3,13,14,15)
305
-            and (psb.firstcid = #{param.handleid} or psb.secondcid = #{param.handleid} or pc.dispenseway=2)
307
+            and (psb.firstcid = #{param.handleid} or psb.secondcid = #{param.handleid} or psb.checked=1)
306 308
             where pc.mpid=#{param.mpid} and c.subjectid=#{param.subjectid}
307 309
             group by c.classid
308 310
             order by c.mcid
@@ -576,23 +578,23 @@
576 578
         </if>
577 579
         <if test="param.dispenseway!=null and param.dispenseway==2">
578 580
             <if test="param.correcttype==3">
579
-                select count(psb.mpsbid*#{param.checktype}) as tasknum
581
+                select count(psb.mpsbid) as tasknum
580 582
                 ,count(if(pctt.checkstate=3,1,null)) as checkednum
581 583
                 from ms_paper_student_block psb left join ms_paper_check_teacher_task pctt on psb.mpid=pctt.mpid and pctt.teacherid=#{param.teacherid} and psb.mpsbid=pctt.mpsbid
582
-                where psb.mpid=#{param.mpid} and psb.mblockid=#{param.mblockid}
584
+                where psb.mpid=#{param.mpid} and psb.mblockid=#{param.mblockid} and psb.checked!=0
583 585
             </if>
584 586
             <if test="param.correcttype==2">
585
-                select count(psb.mpsqid*#{param.checktype}) as tasknum
587
+                select count(psb.mpsqid) as tasknum
586 588
                 ,count(if(pctt.checkstate=3,1,null)) as checkednum
587 589
                 from ms_paper_student_question psb left join ms_paper_check_teacher_task pctt on psb.mpid=pctt.mpid and pctt.teacherid=#{param.teacherid} and psb.mpsqid=pctt.mpsbid
588
-                where psb.mpid=#{param.mpid} and psb.mptqid=#{param.mblockid}
590
+                where psb.mpid=#{param.mpid} and psb.mptqid=#{param.mblockid} and psb.checked!=0
589 591
             </if>
590 592
             <if test="param.correcttype==1">
591
-                select count(psb.mpsqid*#{param.checktype}) as tasknum
593
+                select count(psb.mpsqid) as tasknum
592 594
                 ,count(if(pctt.checkstate=3,1,null)) as checkednum
593 595
                 from ms_paper_student_question psb left join ms_paper_check_teacher_task pctt on psb.mpid=pctt.mpid and pctt.teacherid=#{param.teacherid} and psb.mpsqid=pctt.mpsbid
594 596
                 inner join ms_class_student cs on psb.examid=cs.examid and psb.subjectid=cs.subjectid and psb.studentid=cs.studentid
595
-                where psb.mpid=#{param.mpid} and psb.mptqid=#{param.mptqid} and cs.classid=#{param.mblockid}
597
+                where psb.mpid=#{param.mpid} and psb.mptqid=#{param.mptqid} and cs.classid=#{param.mblockid} and psb.checked!=0
596 598
             </if>
597 599
         </if>
598 600
     </select>

+ 3
- 0
smarking/src/main/resources/mapper/stupaper/MsPaperStudentQuestionMapper.xml Visa fil

@@ -200,6 +200,9 @@
200 200
         <if test="block.problemcomm!=null and block.problemcomm!=''">
201 201
            ,problemcomm=#{block.problemcomm}
202 202
         </if>
203
+        <if test="block.probleid!=null and block.probleid!=0">
204
+            ,probleid=#{block.probleid}
205
+        </if>
203 206
         <if test="block.hasfinal!=null and block.hasfinal!=0">
204 207
            ,hasfinal=#{block.hasfinal}
205 208
         </if>

Laddar…
Avbryt
Spara