Bladeren bron

批阅、仲裁、疑难卷

ywx
雍文秀 1 maand geleden
bovenliggende
commit
72493de992

+ 6
- 3
smarking/src/main/java/com/xhkjedu/smarking/controller/papercheck/MsPaperCheckTeacherArbitrateController.java Bestand weergeven

@@ -90,6 +90,7 @@ public class MsPaperCheckTeacherArbitrateController {
90 90
                 , param.getMpid(), "试卷ID", 1
91 91
                 , param.getMblockid(), "题块ID", 1
92 92
                 , param.getCorrecttype(), "批阅设置", 1
93
+                , param.getTaskorder(), "序号", 1
93 94
         });
94 95
         return new ResultVo(0, "查询成功", msPaperCheckTeacherArbitrateService.getPreArbitrate(param));
95 96
     }
@@ -109,6 +110,7 @@ public class MsPaperCheckTeacherArbitrateController {
109 110
                 , param.getMblockid(), "题块ID", 1
110 111
                 , param.getMpsbid(), "任务ID", 1
111 112
                 , param.getQscore(), "试题分值", 2
113
+                , param.getCorrecttype(), "批阅设置", 1
112 114
         });
113 115
         param.setFinalreason(1);
114 116
         msPaperCheckTeacherArbitrateService.arbitrate(param);
@@ -148,7 +150,7 @@ public class MsPaperCheckTeacherArbitrateController {
148 150
         Integer handleid = param.getHandleid();
149 151
         Integer mpid = param.getMpid();
150 152
         N_Utils.validation(new Object[]{handleid, "操作人ID", 1, mpid, "试卷ID", 1});
151
-        List<Map> list = msPaperCheckTeacherArbitrateService.listPendingArbitrate(mpid, handleid);
153
+        List<Map> list = msPaperCheckTeacherArbitrateService.listPendingArbitrate(mpid, handleid, 1);
152 154
         return new ResultVo(0, "查询成功", list);
153 155
     }
154 156
 
@@ -161,9 +163,10 @@ public class MsPaperCheckTeacherArbitrateController {
161 163
      **/
162 164
     @PostMapping("/list_larbitrate")
163 165
     public ResultVo listLeaderArbitrate(@RequestBody MsCheckParam param) {
166
+        Integer handleid = param.getHandleid();
164 167
         Integer mpid = param.getMpid();
165
-        N_Utils.validation(new Object[]{mpid, "试卷ID", 1});
166
-        List<Map> list = msPaperCheckTeacherArbitrateService.listPendingArbitrate(mpid, null);
168
+        N_Utils.validation(new Object[]{handleid, "操作人ID", 1, mpid, "试卷ID", 1});
169
+        List<Map> list = msPaperCheckTeacherArbitrateService.listPendingArbitrate(mpid, handleid, 0);
167 170
         return new ResultVo(0, "查询成功", list);
168 171
     }
169 172
 

+ 2
- 1
smarking/src/main/java/com/xhkjedu/smarking/controller/papercheck/MsPaperCheckTeacherProblemController.java Bestand weergeven

@@ -36,7 +36,7 @@ public class MsPaperCheckTeacherProblemController {
36 36
     @PostMapping("/list_problem")
37 37
     public ResultVo listProblem(@RequestBody MsCheckParam param) {
38 38
         Integer mpid = param.getMpid();
39
-        N_Utils.validation(new Object[]{mpid, "试卷ID", 1});
39
+        N_Utils.validation(new Object[]{param.getHandleid(), "操作人ID", 1, mpid, "试卷ID", 1});
40 40
         List<Map> list = msPaperCheckTeacherProblemService.listPendingProblem(mpid);
41 41
         return new ResultVo(0, "查询成功", list);
42 42
     }
@@ -89,6 +89,7 @@ public class MsPaperCheckTeacherProblemController {
89 89
                 , param.getMpid(), "试卷ID", 1
90 90
                 , param.getMblockid(), "题块ID", 1
91 91
                 , param.getCorrecttype(), "批阅设置", 1
92
+                , param.getTaskorder(), "序号", 1
92 93
         });
93 94
         return new ResultVo(0, "查询成功", msPaperCheckTeacherProblemService.getPreProblem(param));
94 95
     }

+ 8
- 2
smarking/src/main/java/com/xhkjedu/smarking/mapper/papercheck/MsPaperCheckTeacherArbitrateMapper.java Bestand weergeven

@@ -23,7 +23,7 @@ public interface MsPaperCheckTeacherArbitrateMapper extends TkMapper<MsPaperChec
23 23
     List<Map> detailArbitrate(@Param("param") MsCheckParam param);
24 24
 
25 25
     //获取待仲裁任务
26
-    MsPaperCheckVo getCorrectArbitrate(@Param("param") MsCheckParam param);
26
+    Map getCorrectArbitrate(@Param("param") MsCheckParam param);
27 27
 
28 28
     //获取仲裁数量
29 29
     MsPaperCheckTeacher getACheckNum(@Param("param") MsCheckParam param);
@@ -38,7 +38,7 @@ public interface MsPaperCheckTeacherArbitrateMapper extends TkMapper<MsPaperChec
38 38
     List<Map> listQuestionArbitrate(@Param("param") MsCheckParam param);
39 39
 
40 40
     //学科组长-获取待仲裁任务
41
-    MsPaperCheckVo getCorrectLeaderArbitrate(@Param("param") MsCheckParam param);
41
+    Map getCorrectLeaderArbitrate(@Param("param") MsCheckParam param);
42 42
 
43 43
     //仲裁历史
44 44
     List<Map> listArbitrateHistory(@Param("param") MsCheckParam param);
@@ -51,4 +51,10 @@ public interface MsPaperCheckTeacherArbitrateMapper extends TkMapper<MsPaperChec
51 51
 
52 52
     //保存或更新单个任务
53 53
     void save(@Param("m") MsPaperCheckTeacherArbitrate task);
54
+
55
+    //更新仲裁结果
56
+    void correct(@Param("param") MsPaperCheckVo param);
57
+
58
+    //更新仲裁状态
59
+    void updateArbitrateState(@Param("param") MsCheckParam param);
54 60
 }

+ 6
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/papercheck/MsPaperCheckTeacherProblemMapper.java Bestand weergeven

@@ -45,4 +45,10 @@ public interface MsPaperCheckTeacherProblemMapper extends TkMapper<MsPaperCheckT
45 45
 
46 46
     //打回重阅
47 47
     void backCorrect(@Param("param") MsPaperCheckVo param);
48
+
49
+    //更新疑难卷状态
50
+    void updateHasProblem(@Param("param") MsCheckParam param);
51
+
52
+    //处理疑难卷
53
+    void correct(@Param("param") MsPaperCheckVo param);
48 54
 }

+ 4
- 2
smarking/src/main/java/com/xhkjedu/smarking/mapper/papercheck/MsPaperCheckTeacherTaskMapper.java Bestand weergeven

@@ -2,8 +2,7 @@ package com.xhkjedu.smarking.mapper.papercheck;
2 2
 
3 3
 import com.xhkjedu.base.TkMapper;
4 4
 import com.xhkjedu.smarking.model.papercheck.*;
5
-import com.xhkjedu.smarking.vo.papercheck.MsCheckParam;
6
-import com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo;
5
+import com.xhkjedu.smarking.vo.papercheck.*;
7 6
 import org.apache.ibatis.annotations.Param;
8 7
 
9 8
 import java.util.List;
@@ -115,4 +114,7 @@ public interface MsPaperCheckTeacherTaskMapper extends TkMapper<MsPaperCheckTeac
115 114
 
116 115
     //教师阅卷-待仲裁数量
117 116
     Integer getPendingArbitrateNum(@Param("param") MsCheckParam param);
117
+
118
+    //获取批阅结果
119
+    MsCheckVo getCheckResult(@Param("param") MsPaperCheckVo param);
118 120
 }

+ 38
- 42
smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsPaperCheckTeacherArbitrateService.java Bestand weergeven

@@ -2,13 +2,13 @@ package com.xhkjedu.smarking.service.papercheck;
2 2
 
3 3
 import com.xhkjedu.exception.ServiceException;
4 4
 import com.xhkjedu.smarking.mapper.paper.MsPaperMapper;
5
-import com.xhkjedu.smarking.mapper.papercheck.MsPaperCheckMapper;
6 5
 import com.xhkjedu.smarking.mapper.papercheck.MsPaperCheckTeacherArbitrateMapper;
7 6
 import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentBlockMapper;
8 7
 import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentQuestionMapper;
9 8
 import com.xhkjedu.smarking.model.paper.MsPaper;
10 9
 import com.xhkjedu.smarking.model.paper.MsPaperBlockQuestion;
11
-import com.xhkjedu.smarking.model.papercheck.*;
10
+import com.xhkjedu.smarking.model.papercheck.MsPaperCheckTeacher;
11
+import com.xhkjedu.smarking.model.papercheck.MsPaperCheckTeacherArbitrate;
12 12
 import com.xhkjedu.smarking.model.stupaper.MsPaperStudentBlock;
13 13
 import com.xhkjedu.smarking.model.stupaper.MsPaperStudentQuestion;
14 14
 import com.xhkjedu.smarking.utils.MarkingUtil;
@@ -17,6 +17,7 @@ import com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo;
17 17
 import com.xhkjedu.utils.N_Utils;
18 18
 import com.xhkjedu.vo.ResultVo;
19 19
 import org.springframework.stereotype.Service;
20
+import org.springframework.transaction.annotation.Transactional;
20 21
 
21 22
 import javax.annotation.Resource;
22 23
 import java.util.*;
@@ -31,8 +32,6 @@ public class MsPaperCheckTeacherArbitrateService {
31 32
     @Resource
32 33
     private MsPaperCheckTeacherArbitrateMapper msPaperCheckTeacherArbitrateMapper;
33 34
     @Resource
34
-    private MsPaperCheckMapper msPaperCheckMapper;
35
-    @Resource
36 35
     private MsPaperMapper msPaperMapper;
37 36
     @Resource
38 37
     private MsPaperStudentBlockMapper msPaperStudentBlockMapper;
@@ -71,34 +70,42 @@ public class MsPaperCheckTeacherArbitrateService {
71 70
      * @Param [param]
72 71
      * @Return com.xhkjedu.vo.ResultVo
73 72
      **/
73
+    @Transactional(rollbackFor = Exception.class)
74 74
     public ResultVo getCorrectArbitrate(MsCheckParam param) {
75
-        MsPaper paper = msPaperMapper.selectByPrimaryKey(param.getMpid());
75
+        Integer mpid = param.getMpid();
76
+        MsPaper paper = msPaperMapper.selectByPrimaryKey(mpid);
76 77
         Integer correcttype = paper.getCorrecttype();
77 78
         if (!N_Utils.isTrueInteger(correcttype)) {
78 79
             throw new ServiceException("该试卷未设置批阅方式");
79 80
         }
80 81
         param.setCorrecttype(correcttype);
81 82
         param.setSubjectid(paper.getSubjectid());
82
-        MsPaperCheckVo sq = msPaperCheckTeacherArbitrateMapper.getCorrectArbitrate(param);
83
+        Map sq = msPaperCheckTeacherArbitrateMapper.getCorrectArbitrate(param);
83 84
 
84 85
         Integer totalNum = 0;
85 86
         Integer checkedNum = 0;
86 87
         if (sq != null) {
87
-            param.setMblockid(sq.getMblockid());
88
+            Integer mblockid = N_Utils.obj2Int(sq.get("mblockid"));
89
+            param.setMblockid(mblockid);
88 90
             MsPaperCheckTeacher teacher = msPaperCheckTeacherArbitrateMapper.getACheckNum(param);
89 91
             totalNum = teacher.getTasknum();
90 92
             checkedNum = teacher.getCheckednum();
91
-            sq.setMpid(param.getMpid());
92 93
 
94
+            msPaperCheckTeacherArbitrateMapper.updateArbitrateState(param);
95
+
96
+            //序号
97
+            Integer taskorder = checkedNum + 1;
98
+            sq.put("taskorder", taskorder);
93 99
             MsPaperCheckTeacherArbitrate arbitrate = new MsPaperCheckTeacherArbitrate();
94
-            arbitrate.setMpid(param.getMpid());
95
-            arbitrate.setMblockid(sq.getMblockid());
100
+            arbitrate.setMpid(mpid);
101
+            arbitrate.setMblockid(mblockid);
96 102
             arbitrate.setTeacherid(param.getHandleid());
97
-            arbitrate.setMblockid(sq.getMblockid());
98
-            arbitrate.setTaskorder(checkedNum + 1);
103
+            Integer mpsbid = N_Utils.obj2Int(sq.get("mpsbid"));
104
+            arbitrate.setMpsbid(mpsbid);
105
+            arbitrate.setTaskorder(taskorder);
99 106
             arbitrate.setCheckstate(2);
100 107
             arbitrate.setCreatetime(N_Utils.getSecondTimestamp());
101
-            msPaperCheckTeacherArbitrateMapper.insertSelective(arbitrate);
108
+            msPaperCheckTeacherArbitrateMapper.save(arbitrate);
102 109
         }
103 110
         Map map = new HashMap();
104 111
         map.put("sq", sq);
@@ -126,9 +133,9 @@ public class MsPaperCheckTeacherArbitrateService {
126 133
      * @Param [param]
127 134
      * @Return void
128 135
      **/
136
+    @Transactional(rollbackFor = Exception.class)
129 137
     public void arbitrate(MsPaperCheckVo param) {
130
-        MsPaperCheck check = msPaperCheckMapper.findByMBlockId(param.getMpid(), param.getMblockid());
131
-        Integer correcttype = check.getCorrecttype();
138
+        Integer correcttype = param.getCorrecttype();
132 139
         Integer mpsbid = param.getMpsbid();
133 140
         Integer handleid = param.getHandleid();
134 141
         Double qscore = param.getQscore();
@@ -136,13 +143,6 @@ public class MsPaperCheckTeacherArbitrateService {
136 143
         Integer finalreason = param.getFinalreason();
137 144
         Integer hasgood = param.getHasgood();
138 145
         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
-        }
146 146
         if (correcttype.equals(3)) {//按题块批阅
147 147
             MsPaperStudentBlock block = msPaperStudentBlockMapper.selectByPrimaryKey(mpsbid);
148 148
             String firstccores = block.getFirstccores();
@@ -216,15 +216,11 @@ public class MsPaperCheckTeacherArbitrateService {
216 216
             psq.setArbitrateid(handleid);
217 217
             psq.setArbitratetime(N_Utils.getSecondTimestamp());
218 218
             psq.setArbitratescore(arbitratescore);
219
-            psq.setArbitratestate(2);
219
+            psq.setArbitratestate(3);
220 220
             psq.setHasfinal(1);
221 221
             psq.setFinalreason(finalreason);
222 222
             psq.setHasgood(hasgood);
223 223
             psq.setHasbad(hasbad);
224
-            psq.setHasproblem(hasproblem);
225
-            psq.setProblemtype(problemtype);
226
-            psq.setProblemcomm(problemcomm);
227
-            psq.setProbleid(probleid);
228 224
             msPaperStudentBlockMapper.updateByPrimaryKeySelective(psq);
229 225
             msPaperStudentQuestionMapper.checkByMptqidAndStudentId(studentQuestions, psq);
230 226
         } else if (correcttype.equals(2)) {
@@ -255,17 +251,14 @@ public class MsPaperCheckTeacherArbitrateService {
255 251
             psq.setArbitratetime(N_Utils.getSecondTimestamp());
256 252
             psq.setArbitratescore(arbitratescore);
257 253
             psq.setStuscore(finalScore);
258
-            psq.setArbitratestate(2);
254
+            psq.setArbitratestate(3);
259 255
             psq.setHasfinal(1);
260 256
             psq.setFinalreason(finalreason);
261 257
             psq.setHasgood(hasgood);
262 258
             psq.setHasbad(hasbad);
263
-            psq.setHasproblem(hasproblem);
264
-            psq.setProblemtype(problemtype);
265
-            psq.setProblemcomm(problemcomm);
266
-            psq.setProbleid(probleid);
267 259
             msPaperStudentQuestionMapper.updateByPrimaryKeySelective(psq);
268 260
         }
261
+        msPaperCheckTeacherArbitrateMapper.correct(param);
269 262
     }
270 263
 
271 264
     /**
@@ -275,10 +268,11 @@ public class MsPaperCheckTeacherArbitrateService {
275 268
      * @Param [mpid, handleid]
276 269
      * @Return java.util.List<java.util.Map>
277 270
      **/
278
-    public List<Map> listPendingArbitrate(Integer mpid, Integer handleid) {
271
+    public List<Map> listPendingArbitrate(Integer mpid, Integer handleid, Integer usertype) {
279 272
         MsCheckParam param = new MsCheckParam();
280 273
         param.setMpid(mpid);
281 274
         param.setHandleid(handleid);
275
+        param.setUsertype(usertype);
282 276
         Integer correctType = msPaperMapper.getCorrectTypeByMpId(param.getMpid());
283 277
         if (correctType.equals(3)) {
284 278
             return msPaperCheckTeacherArbitrateMapper.listBlockArbitrate(param);//学科组长-待仲裁题块列表
@@ -294,35 +288,37 @@ public class MsPaperCheckTeacherArbitrateService {
294 288
      * @Param [param]
295 289
      * @Return com.xhkjedu.vo.ResultVo
296 290
      **/
291
+    @Transactional(rollbackFor = Exception.class)
297 292
     public ResultVo getCorrectLeaderArbitrate(MsCheckParam param) {
298
-        MsPaper paper = msPaperMapper.selectByPrimaryKey(param.getMpid());
293
+        Integer mpid = param.getMpid();
294
+        MsPaper paper = msPaperMapper.selectByPrimaryKey(mpid);
299 295
         Integer correcttype = paper.getCorrecttype();
300 296
         if (!N_Utils.isTrueInteger(correcttype)) {
301 297
             throw new ServiceException("该试卷未设置批阅方式");
302 298
         }
303 299
         param.setCorrecttype(correcttype);
304 300
         param.setSubjectid(paper.getSubjectid());
305
-        MsPaperCheckVo sq = msPaperCheckTeacherArbitrateMapper.getCorrectLeaderArbitrate(param);
301
+        Map sq = msPaperCheckTeacherArbitrateMapper.getCorrectLeaderArbitrate(param);
306 302
 
307 303
         Integer totalNum = 0;
308 304
         Integer checkedNum = 0;
309 305
         if (sq != null) {
310
-            sq.setCorrecttype(correcttype);
311
-            param.setMblockid(sq.getMblockid());
306
+            Integer mblockid = N_Utils.obj2Int(sq.get("mblockid"));
307
+            param.setMblockid(mblockid);
312 308
             MsPaperCheckTeacher teacher = msPaperCheckTeacherArbitrateMapper.getACheckNum(param);
313 309
             totalNum = teacher.getTasknum();
314 310
             checkedNum = teacher.getCheckednum();
315
-            sq.setMpid(param.getMpid());
311
+            msPaperCheckTeacherArbitrateMapper.updateArbitrateState(param);
316 312
 
317 313
             //序号
318 314
             Integer taskorder = checkedNum + 1;
319
-            sq.setTaskorder(taskorder);
315
+            sq.put("taskorder", taskorder);
320 316
             MsPaperCheckTeacherArbitrate task = new MsPaperCheckTeacherArbitrate();
321
-            task.setMpid(sq.getMpid());
322
-            task.setMblockid(sq.getMblockid());
317
+            task.setMpid(mpid);
318
+            task.setMblockid(mblockid);
323 319
             task.setTeacherid(param.getHandleid());
324 320
             task.setTaskorder(taskorder);
325
-            task.setMpsbid(sq.getMpsbid());
321
+            task.setMpsbid(N_Utils.obj2Int(sq.get("mpsbid")));
326 322
             task.setCheckstate(2);
327 323
             task.setCreatetime(N_Utils.getSecondTimestamp());
328 324
             msPaperCheckTeacherArbitrateMapper.save(task);

+ 4
- 0
smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsPaperCheckTeacherProblemService.java Bestand weergeven

@@ -62,6 +62,7 @@ public class MsPaperCheckTeacherProblemService {
62 62
      * @Param [param]
63 63
      * @Return com.xhkjedu.vo.ResultVo
64 64
      **/
65
+    @Transactional(rollbackFor = Exception.class)
65 66
     public ResultVo getCorrectProblem(MsCheckParam param) {
66 67
         Integer mpid = param.getMpid();
67 68
         MsPaper paper = msPaperMapper.selectByPrimaryKey(mpid);
@@ -83,6 +84,7 @@ public class MsPaperCheckTeacherProblemService {
83 84
             totalNum = teacher.getTasknum();
84 85
             checkedNum = teacher.getCheckednum();
85 86
             sq.put("mpid", mpid);
87
+            msPaperCheckTeacherProblemMapper.updateHasProblem(param);
86 88
 
87 89
             //序号
88 90
             Integer taskorder = checkedNum + 1;
@@ -112,6 +114,7 @@ public class MsPaperCheckTeacherProblemService {
112 114
      * @Param [param]
113 115
      * @Return void
114 116
      **/
117
+    @Transactional(rollbackFor = Exception.class)
115 118
     public void correct(MsPaperCheckVo param) {
116 119
         Integer correcttype = msPaperMapper.getCorrectTypeByMpId(param.getMpid());
117 120
         Integer mpsbid = param.getMpsbid();
@@ -175,6 +178,7 @@ public class MsPaperCheckTeacherProblemService {
175 178
             psq.setProblehid(handleid);
176 179
             msPaperStudentQuestionMapper.updateByPrimaryKeySelective(psq);
177 180
         }
181
+        msPaperCheckTeacherProblemMapper.correct(param);
178 182
     }
179 183
 
180 184
     /**

+ 28
- 26
smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsPaperCheckTeacherTaskService.java Bestand weergeven

@@ -13,12 +13,12 @@ import com.xhkjedu.smarking.model.papercheck.*;
13 13
 import com.xhkjedu.smarking.model.stupaper.MsPaperStudentBlock;
14 14
 import com.xhkjedu.smarking.model.stupaper.MsPaperStudentQuestion;
15 15
 import com.xhkjedu.smarking.utils.MarkingUtil;
16
-import com.xhkjedu.smarking.vo.papercheck.MsCheckParam;
17
-import com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo;
16
+import com.xhkjedu.smarking.vo.papercheck.*;
18 17
 import com.xhkjedu.utils.N_Utils;
19 18
 import com.xhkjedu.vo.ResultVo;
20 19
 import com.xhkjedu.vo.system.UserVo;
21 20
 import org.springframework.stereotype.Service;
21
+import org.springframework.transaction.annotation.Transactional;
22 22
 
23 23
 import javax.annotation.Resource;
24 24
 import java.util.*;
@@ -176,6 +176,7 @@ public class MsPaperCheckTeacherTaskService {
176 176
      * @Param [param]
177 177
      * @Return java.util.Map
178 178
      **/
179
+    @Transactional(rollbackFor = Exception.class)
179 180
     public ResultVo getCorrectBlock(MsCheckParam param) {
180 181
         Integer correcttype = msPaperMapper.getCorrectTypeByMpId(param.getMpid());
181 182
         if (!N_Utils.isTrueInteger(correcttype)) {
@@ -365,6 +366,7 @@ public class MsPaperCheckTeacherTaskService {
365 366
      * @Param [param]
366 367
      * @Return void
367 368
      **/
369
+    @Transactional(rollbackFor = Exception.class)
368 370
     public void correct(MsPaperCheckVo param) {
369 371
         MsPaperCheck check = msPaperCheckMapper.findByMBlockId(param.getMpid(), param.getMblockid());
370 372
         if (check == null) {
@@ -390,7 +392,7 @@ public class MsPaperCheckTeacherTaskService {
390 392
         Double qscore = param.getQscore();
391 393
         List<MsPaperBlockQuestion> questions = param.getQuestions();
392 394
         int checked = 2;
393
-        Double firstccore = param.getFirstccore();
395
+        Double arbitratescore = param.getArbitratescore();
394 396
         String checkscore;
395 397
         //仲裁状态0默认1待仲裁2已仲裁
396 398
         Integer arbitratestate = null;
@@ -405,7 +407,7 @@ public class MsPaperCheckTeacherTaskService {
405 407
                 block.setMpsbid(mpsbid);
406 408
                 block.setChecked(checked);
407 409
                 block.setFirstcime(N_Utils.getSecondTimestamp());
408
-                block.setFirstccore(firstccore);
410
+                block.setFirstccore(arbitratescore);
409 411
                 block.setHasgood(hasgood);
410 412
                 block.setHasbad(hasbad);
411 413
                 block.setHasproblem(hasproblem);
@@ -449,31 +451,36 @@ public class MsPaperCheckTeacherTaskService {
449 451
                 }
450 452
                 msPaperStudentQuestionMapper.checkByMptqidAndStudentId(studentQuestions, block);//更新学生单题批阅信息
451 453
             } else {//按试题批阅
452
-                checkscore = firstccore.toString();
454
+                checkscore = arbitratescore.toString();
453 455
                 MsPaperStudentQuestion question = new MsPaperStudentQuestion();
454 456
                 question.setMpsqid(mpsbid);
455 457
                 question.setChecked(checked);
456 458
                 question.setFirstcime(N_Utils.getSecondTimestamp());
457
-                question.setFirstccore(firstccore);
459
+                question.setFirstccore(arbitratescore);
458 460
                 question.setHasgood(hasgood);
459 461
                 question.setHasbad(hasbad);
460 462
                 question.setHasproblem(hasproblem);
461 463
                 question.setProblemtype(problemtype);
462 464
                 question.setProblemcomm(problemcomm);
463 465
                 question.setProbleid(probleid);
464
-                question.setStuscore(firstccore);
466
+                question.setStuscore(arbitratescore);
465 467
                 msPaperStudentQuestionMapper.updateByPrimaryKeySelective(question);
466 468
             }
467 469
         } else {//双评
468
-            Integer firstcid = param.getFirstcid();
469
-            Integer secondcid = param.getSecondcid();
470
-            Integer firstcime = param.getFirstcime();
471
-            Integer secondcime = param.getSecondctime();
472
-            Double secondcscore = param.getSecondcscore();
470
+            MsCheckVo result = msPaperCheckTeacherTaskMapper.getCheckResult(param);
471
+            Integer firstcime = result.getFirstcime();
472
+            Integer secondcime = result.getSecondctime();
473
+            Double firstccore = result.getFirstccore();
474
+            Double secondcscore = result.getSecondcscore();
473 475
             Integer type = param.getChecktype();//批阅情况1一评2二评
476
+            if (type.equals(1)) {
477
+                firstccore = arbitratescore;
478
+            } else {
479
+                secondcscore = arbitratescore;
480
+            }
474 481
             boolean corrected = false;
475
-            if ((handleid.equals(firstcid) && N_Utils.isTrueInteger(secondcime))
476
-                    || (handleid.equals(secondcid) && N_Utils.isTrueInteger(firstcime))) {
482
+            if ((type.equals(1) && N_Utils.isTrueInteger(secondcime))
483
+                    || (type.equals(2) && N_Utils.isTrueInteger(firstcime))) {
477 484
                 checked = 3;
478 485
                 corrected = true;
479 486
             }
@@ -500,20 +507,16 @@ public class MsPaperCheckTeacherTaskService {
500 507
                 MsPaperStudentBlock block = new MsPaperStudentBlock();
501 508
                 block.setMpsbid(mpsbid);
502 509
                 String stuscores = questions.stream().map(MsPaperBlockQuestion::getMergescore).collect(Collectors.joining(";"));
510
+                String[] cores;
503 511
                 if (type.equals(1)) {
504 512
                     block.setFirstcime(N_Utils.getSecondTimestamp());
505
-                    block.setFirstccore(firstccore);
513
+                    block.setFirstccore(arbitratescore);
506 514
                     block.setFirstccores(stuscores);
515
+                    cores = param.getSecondcscores().split(";");
507 516
                 } else {
508 517
                     block.setSecondctime(N_Utils.getSecondTimestamp());
509
-                    block.setSecondcscore(secondcscore);
518
+                    block.setSecondcscore(arbitratescore);
510 519
                     block.setSecondcscores(stuscores);
511
-                }
512
-
513
-                String[] cores;
514
-                if (type.equals(1)) {
515
-                    cores = param.getSecondcscores().split(";");
516
-                } else {
517 520
                     cores = param.getFirstccores().split(";");
518 521
                 }
519 522
                 List<MsPaperStudentQuestion> studentQuestions = new ArrayList<>();
@@ -606,14 +609,13 @@ public class MsPaperCheckTeacherTaskService {
606 609
             } else {//按试题批阅
607 610
                 MsPaperStudentQuestion question = new MsPaperStudentQuestion();
608 611
                 question.setChecked(checked);
612
+                checkscore = arbitratescore.toString();
609 613
                 if (type.equals(1)) {
610 614
                     question.setFirstcime(N_Utils.getSecondTimestamp());
611
-                    question.setFirstccore(firstccore);
612
-                    checkscore = firstccore.toString();
615
+                    question.setFirstccore(arbitratescore);
613 616
                 } else {
614 617
                     question.setSecondctime(N_Utils.getSecondTimestamp());
615
-                    question.setSecondcscore(secondcscore);
616
-                    checkscore = secondcscore.toString();
618
+                    question.setSecondcscore(arbitratescore);
617 619
                 }
618 620
                 question.setHasgood(hasgood);
619 621
                 question.setHasbad(hasbad);

+ 28
- 0
smarking/src/main/java/com/xhkjedu/smarking/vo/papercheck/MsCheckVo.java Bestand weergeven

@@ -0,0 +1,28 @@
1
+package com.xhkjedu.smarking.vo.papercheck;
2
+
3
+import lombok.Data;
4
+
5
+/**
6
+ * @Description 批阅结果VO
7
+ * @Author YWX
8
+ * @Date 2024/11/22 16:12
9
+ **/
10
+@Data
11
+public class MsCheckVo {
12
+    //单评批改人
13
+    private Integer firstcid;
14
+    //单评批改时间
15
+    private Integer firstcime;
16
+    //单评批改分值
17
+    private Double firstccore;
18
+    //单评批改分值数组
19
+    private String firstccores;
20
+    //复评批改人
21
+    private Integer secondcid;
22
+    //复评批改时间
23
+    private Integer secondctime;
24
+    //复评批改分值
25
+    private Double secondcscore;
26
+    //复评批改分值数组
27
+    private String secondcscores;
28
+}

+ 58
- 32
smarking/src/main/resources/mapper/papercheck/MsPaperCheckTeacherArbitrateMapper.xml Bestand weergeven

@@ -4,13 +4,38 @@
4 4
     <!--保存或更新单个任务-->
5 5
     <insert id="save">
6 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})
7
+        values (#{m.mpid},#{m.mblockid},#{m.teacherid},#{m.taskorder},#{m.checkstate},#{m.mpsbid},#{m.createtime})
8 8
         on duplicate key update taskorder=#{m.taskorder},teacherid=#{m.teacherid}
9 9
     </insert>
10
+    <!--更新仲裁结果-->
11
+    <update id="correct">
12
+        update ms_paper_check_teacher_arbitrate
13
+        set checkstate=3,checkscore=#{param.arbitratescore}
14
+        <if test="param.hasgood!=null and param.hasgood!=0">
15
+            ,hasgood=#{param.hasgood}
16
+        </if>
17
+        <if test="param.hasbad!=null and param.hasbad!=0">
18
+            ,hasbad=#{param.hasbad},problemtype=#{param.problemtype}
19
+        </if>
20
+        where mpid=#{param.mpid} and mpsbid=#{param.mpsbid} and teacherid=#{param.handleid}
21
+    </update>
22
+    <!--更新仲裁状态-->
23
+    <update id="updateArbitrateState">
24
+        <if test="param.correcttype==3">
25
+            update ms_paper_student_block pb inner join ms_paper_student_question psq on pb.mpsbid=psq.mpsbid
26
+            set pb.arbitrateid=#{param.handleid},pb.arbitratestate=2,psq.arbitrateid=#{param.handleid},psq.arbitratestate=2
27
+            where pb.mpsbid=#{param.mpsbid}
28
+        </if>
29
+        <if test="param.correcttype==2">
30
+            update ms_paper_student_question psq
31
+            set psq.arbitrateid=#{param.handleid},psq.arbitratestate=2
32
+            where psq.mpsqid=#{param.mpsbid}
33
+        </if>
34
+    </update>
10 35
     <!--教师阅卷-待/已仲裁列表-->
11 36
     <select id="listArbitrate" resultType="java.util.Map">
12
-        select s.msid,s.subjectname,s.sdate,s.begintime,s.endtime,e.examname,e.gradeid,e.examtype
13
-        ,pc.mpid,pc.checktype,pc.dispenseway,pc.numtype
37
+        select s.msid,s.subjectname,s.sdate,s.begintime,s.endtime,e.examname,e.gradeid,e.examtype,e.exammode
38
+        ,pc.mpid,pc.checktype,pc.dispenseway,pc.numtype,pc.correcttype
14 39
         ,truncate((count(distinct if(psb.arbitratestate=2,psb.mpsbid,null)))*100/count(distinct psb.mpsbid),2) as checkrate
15 40
         from ms_subject s inner join ms_exam e on s.examid = e.examid
16 41
         inner join ms_paper_check pc on pc.msid = s.msid
@@ -20,8 +45,8 @@
20 45
         <if test="param.checktype==0">having 100>checkrate</if>
21 46
         <if test="param.checktype==1">having 100=checkrate</if>
22 47
         union
23
-        select s.msid,s.subjectname,s.sdate,s.begintime,s.endtime,e.examname,e.gradeid,e.examtype
24
-        ,pc.mpid,pc.checktype,pc.dispenseway,pc.numtype
48
+        select s.msid,s.subjectname,s.sdate,s.begintime,s.endtime,e.examname,e.gradeid,e.examtype,e.exammode
49
+        ,pc.mpid,pc.checktype,pc.dispenseway,pc.numtype,pc.correcttype
25 50
         ,truncate((count(distinct if(psb.arbitratestate=2,psb.mpsqid,null)))*100/count(distinct psb.mpsqid),2) as checkrate
26 51
         from ms_subject s inner join ms_exam e on s.examid = e.examid
27 52
         inner join ms_paper_check pc on pc.msid = s.msid
@@ -40,6 +65,7 @@
40 65
             ,count(distinct psb.mpsbid) as totalNum
41 66
             ,count(distinct if(psb.arbitratestate=2,psb.mpsbid,null)) as myCheckedNum
42 67
             ,count(distinct if(psb.arbitratestate=1,psb.mpsbid,null)) as myUncheckedNum
68
+            ,(select group_concat(pbbq.bqn separator '、') from ms_paper_block_question pbbq where pbbq.mblockid = pb.mblockid) as bqn
43 69
             from ms_paper_check pc left join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.mpid = pc.mpid
44 70
             inner join ms_paper_block pb on pc.mblockid = pb.mblockid and pb.mpid = pc.mpid
45 71
             where pc.mpid=#{param.mpid} and pc.arbitrateid=#{param.handleid} and psb.arbitratestate!=0
@@ -60,17 +86,17 @@
60 86
         </if>
61 87
     </select>
62 88
     <!--获取待仲裁任务-->
63
-    <select id="getCorrectArbitrate" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
89
+    <select id="getCorrectArbitrate" resultType="java.util.Map">
64 90
         <if test="param.correcttype==3">
65
-            select pc.mblockid,pc.correcttype,psb.stuanswer,psb.mpsbid
91
+            select pc.mpid,pc.mblockid,pc.correcttype,psb.stuanswer,psb.mpsbid,psb.arbitratescore,2 as answertype
66 92
             from ms_paper_check pc inner join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.mpid = pc.mpid
67 93
             where pc.mpid=#{param.mpid} and pc.arbitrateid=#{param.handleid}
68 94
             and (psb.arbitratestate=1 or (psb.arbitratestate=2 and psb.arbitrateid=#{param.handleid}))
69 95
             order by psb.mpsbid limit 1
70 96
         </if>
71 97
         <if test="param.correcttype==2">
72
-            select pc.mblockid,pc.correcttype,psb.stuanswer,psb.mpsqid as mpsbid,psb.answertype
73
-            from ms_paper_check pc inner join ms_paper_student_question psb on psb.mblockid = pc.mptqid and psb.mpid = pc.mpid
98
+            select pc.mpid,pc.mblockid,pc.correcttype,psb.stuanswer,psb.mpsqid as mpsbid,psb.arbitratescore,psb.answertype
99
+            from ms_paper_check pc inner join ms_paper_student_question psb on psb.mptqid = pc.mblockid and psb.mpid = pc.mpid
74 100
             where pc.mpid=#{param.mpid} and pc.arbitrateid=#{param.handleid}
75 101
             and (psb.arbitratestate=1 or (psb.arbitratestate=2 and psb.arbitrateid=#{param.handleid}))
76 102
             order by psb.mpsqid limit 1
@@ -94,18 +120,18 @@
94 120
     <!--教师阅卷-待仲裁-上一份-->
95 121
     <select id="getPreArbitrate" resultType="java.util.Map">
96 122
         <if test="param.correcttype==3">
97
-            select psb.mblockid,#{param.correcttype} as correcttype,psb.stuanswer,psb.mpsbid,psb.arbitratescore
98
-            from ms_paper_student_block psb
99
-            where psb.mpid=#{param.mpid} and psb.arbitrateid=#{param.handleid} and psb.mblockid=#{param.mblockid}
100
-            and psb.arbitratestate=3 and #{param.mpsbid}>psb.mpsbid
101
-            order by psb.mpsbid desc limit 1
123
+            select pcta.mpid,pcta.mblockid,#{param.correcttype} as correcttype,pcta.taskorder,psb.stuanswer,psb.mpsbid,psb.arbitratescore,2 as answertype
124
+            from ms_paper_student_block psb inner join ms_paper_check_teacher_arbitrate pcta on pcta.mpid=psb.mpid and pcta.mpsbid=psb.mpsbid
125
+            where pcta.mpid=#{param.mpid} and pcta.teacherid=#{param.handleid} and pcta.mblockid=#{param.mblockid}
126
+            and pcta.checkstate=3 and #{param.taskorder}>pcta.taskorder
127
+            order by pcta.taskorder desc limit 1
102 128
         </if>
103 129
         <if test="param.correcttype==2">
104
-            select psb.mptqid as mblockid,#{param.correcttype} as correcttype,psb.stuanswer,psb.mpsqid as mpsbid,psb.arbitratescore,psb.answertype
105
-            from ms_paper_student_question psb
106
-            where psb.mpid=#{param.mpid} and psb.arbitrateid=#{param.handleid} and psb.mptqid=#{param.mblockid}
107
-            and psb.arbitratestate=3 and #{param.mpsqid}>psb.mpsqid
108
-            order by psb.mpsqid desc limit 1
130
+            select pcta.mpid,pcta.mblockid,#{param.correcttype} as correcttype,pcta.taskorder,psb.stuanswer,pcta.mpsbid,psb.arbitratescore,psb.answertype
131
+            from ms_paper_student_question psb inner join ms_paper_check_teacher_arbitrate pcta on pcta.mpid=psb.mpid and pcta.mpsbid=psb.mpsqid
132
+            where pcta.mpid=#{param.mpid} and pcta.teacherid=#{param.handleid} and pcta.mblockid=#{param.mblockid}
133
+            and pcta.checkstate=3 and #{param.taskorder}>pcta.taskorder
134
+            order by pcta.taskorder desc limit 1
109 135
         </if>
110 136
     </select>
111 137
     <!--待仲裁题块列表-->
@@ -128,8 +154,8 @@
128 154
         ,pc.mblockid,pc.hidefirstscore
129 155
         from ms_paper_check pc left join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.mpid = pc.mpid
130 156
         inner join ms_paper_block pb on pc.mblockid = pb.mblockid and pb.mpid = pc.mpid
131
-        where pc.mpid=#{param.mpid} and psb.arbitratestate=1
132
-        <if test="param.handleid!=null and param.handleid!=0">
157
+        where pc.mpid=#{param.mpid} and (psb.arbitratestate=1 or psb.arbitratestate=2 and psb.arbitrateid=#{param.handleid})
158
+        <if test="param.usertype!=null and param.usertype==1">
133 159
             and pc.arbitrateid=#{param.handleid}
134 160
         </if>
135 161
         group by pb.mblockid
@@ -140,23 +166,23 @@
140 166
         select psb.qorder,psb.qn,psb.qscore
141 167
         ,pc.mblockid,pc.hidefirstscore
142 168
         from ms_paper_check pc left join ms_paper_student_question psb on psb.mptqid = pc.mblockid and psb.mpid = pc.mpid
143
-        where pc.mpid=#{param.mpid} and psb.arbitratestate=1
144
-        <if test="param.handleid!=null and param.handleid!=0">
169
+        where pc.mpid=#{param.mpid} and (psb.arbitratestate=1 or psb.arbitratestate=2 and psb.arbitrateid=#{param.handleid})
170
+        <if test="param.usertype!=null and param.usertype==1">
145 171
             and pc.arbitrateid=#{param.handleid}
146 172
         </if>
147 173
         group by psb.mptqid
148 174
         order by psb.mptqid
149 175
     </select>
150 176
     <!--学科组长-获取待仲裁任务-->
151
-    <select id="getCorrectLeaderArbitrate" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
177
+    <select id="getCorrectLeaderArbitrate" resultType="java.util.Map">
152 178
         <if test="param.correcttype==3">
153
-            select psb.mblockid,psb.stuanswer,psb.mpsbid
179
+            select psb.mpid,psb.mblockid,#{param.correcttype} as correcttype,psb.stuanswer,psb.mpsbid,psb.arbitratescore,2 as answertype
154 180
             from ms_paper_student_block psb
155 181
             where psb.mpid=#{param.mpid} and (psb.arbitratestate=1 or (psb.arbitratestate=2 and psb.arbitrateid=#{param.handleid}))
156 182
             order by psb.mpsbid limit 1
157 183
         </if>
158 184
         <if test="param.correcttype==2">
159
-            select psb.mpsqid as mblockid,psb.stuanswer,psb.mpsqid as mpsbid,psb.answertype
185
+            select psb.mpid,psb.mpsqid as mblockid,#{param.correcttype} as correcttype,psb.stuanswer,psb.mpsqid as mpsbid,psb.arbitratescore,psb.answertype
160 186
             from ms_paper_student_question psb
161 187
             where psb.mpid=#{param.mpid} and (psb.arbitratestate=1 or (psb.arbitratestate=2 and psb.arbitrateid=#{param.handleid}))
162 188
             order by psb.mpsqid limit 1
@@ -175,16 +201,16 @@
175 201
     </select>
176 202
     <!--仲裁历史详情-->
177 203
     <select id="detailHistory" resultType="java.util.Map">
178
-        select psq.stuanswer,mpcta.checkscore,mpcta.hasproblem,mpcta.problemtype,mpcta.problemcomm
179
-        ,mpcta.mpid,mpcta.mblockid,mpcta.mpsbid,mpcta.mptqid,mpcta.taskorder
180
-        from ms_paper_check_teacher_arbitrate mpcta
204
+        select pcta.mpid,pcta.mblockid,#{param.correcttype} as correcttype,pcta.taskorder,psq.stuanswer,pcta.mpsbid,psq.arbitratescore
205
+        ,if(#{param.correcttype}=3,2,psq.answertype) as answertype
206
+        from ms_paper_check_teacher_arbitrate pcta
181 207
         <if test="param.correcttype==3">
182
-            inner join ms_paper_student_block psq on mpcta.mpsbid=psq.mpsbid
208
+            inner join ms_paper_student_block psq on pcta.mpsbid=psq.mpsbid
183 209
         </if>
184 210
         <if test="param.correcttype==2">
185
-            inner join ms_paper_student_question psq on mpcta.mpsbid=psq.mpsqid
211
+            inner join ms_paper_student_question psq on pcta.mpsbid=psq.mpsqid
186 212
         </if>
187
-        where mpcta.mpctaid=#{param.mpctaid}
213
+        where pcta.mpctaid=#{param.mpctaid}
188 214
     </select>
189 215
     <!--初评分-->
190 216
     <select id="getScore" resultType="java.util.Map">

+ 51
- 14
smarking/src/main/resources/mapper/papercheck/MsPaperCheckTeacherProblemMapper.xml Bestand weergeven

@@ -4,9 +4,34 @@
4 4
     <!--保存或更新单个任务-->
5 5
     <insert id="save">
6 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})
7
+        values (#{m.mpid},#{m.mblockid},#{m.teacherid},#{m.taskorder},#{m.checkstate},#{m.mpsbid},#{m.createtime})
8 8
         on duplicate key update taskorder=#{m.taskorder},teacherid=#{m.teacherid}
9 9
     </insert>
10
+    <!--更新疑难卷状态-->
11
+    <update id="updateHasProblem">
12
+        <if test="param.correcttype==3">
13
+            update ms_paper_student_block pb inner join ms_paper_student_question psq on pb.mpsbid=psq.mpsbid
14
+            set pb.problehid=#{param.handleid},pb.hasproblem=2,psq.problehid=#{param.handleid},psq.hasproblem=2
15
+            where pb.mpsbid=#{param.mpsbid}
16
+        </if>
17
+        <if test="param.correcttype==2">
18
+            update ms_paper_student_question psq
19
+            set psq.problehid=#{param.handleid},psq.hasproblem=2
20
+            where psq.mpsqid=#{param.mpsbid}
21
+        </if>
22
+    </update>
23
+    <!--处理疑难卷-->
24
+    <update id="correct">
25
+        update ms_paper_check_teacher_problem
26
+        set checkstate=3,checkscore=#{param.arbitratescore}
27
+        <if test="param.hasgood!=null and param.hasgood!=0">
28
+            ,hasgood=#{param.hasgood}
29
+        </if>
30
+        <if test="param.hasbad!=null and param.hasbad!=0">
31
+            ,hasbad=#{param.hasbad},problemtype=#{param.problemtype}
32
+        </if>
33
+        where mpid=#{param.mpid} and mpsbid=#{param.mpsbid} and teacherid=#{param.handleid}
34
+    </update>
10 35
     <!--删除单个任务-->
11 36
     <delete id="deleteByMpsbidAndMpid">
12 37
         delete from ms_paper_check_teacher_problem where mpsbid=#{mpsbid} and mpid=#{mpid}
@@ -29,32 +54,42 @@
29 54
     <select id="listBlockProblem" resultMap="arbitrateBlockResultMap">
30 55
         select pb.mblockid,pb.blockname,pb.blockorder,pb.bqnum
31 56
         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
57
+        where psb.mpid=#{param.mpid} and (psb.hasproblem=1 or (psb.hasproblem=2 and psb.problehid=#{param.handleid}))
33 58
         group by pb.mblockid
34 59
         order by pb.blockorder
35 60
     </select>
36 61
     <!--疑难卷试题列表-->
37 62
     <select id="listQuestionProblem" resultType="java.util.Map">
38
-        select psb.qorder,psb.qn,psb.qscore
63
+        select psb.mptqid as mblockid,psb.qorder,psb.qn,psb.qscore
39 64
         from ms_paper_student_question psb
40
-        where psb.mpid=#{param.mpid} and psb.hasproblem=1
65
+        where psb.mpid=#{param.mpid} and (psb.hasproblem=1 or (psb.hasproblem=2 and psb.problehid=#{param.handleid}))
41 66
         group by psb.mptqid
42 67
         order by psb.mptqid
43 68
     </select>
44 69
     <!--获取疑难卷任务-->
45
-    <select id="getCorrectLeaderProblem" resultType="java.util.Map">
70
+    <select id="getCorrectProblem" resultType="java.util.Map">
71
+        select psb.stuanswer,psb.hasproblem,psb.problemtype,psb.problemcomm
72
+        <if test="param.correcttype==3">
73
+            ,psb.mblockid,psb.mpsbid,2 as answertype
74
+        </if>
75
+        <if test="param.correcttype!=3">
76
+            ,psb.mptqid as mblockid,psb.mpsqid as mpsbid,psb.answertype
77
+        </if>
78
+        ,u.username as studentname,u.examno,u2.username as teachername
46 79
         <if test="param.correcttype==3">
47
-            select psb.mblockid,psb.stuanswer,psb.mpsbid
48 80
             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}))
81
+        </if>
82
+        <if test="param.correcttype!=3">
83
+            from ms_paper_student_question psb
84
+        </if>
85
+        inner join t_user u on psb.studentid = u.userid
86
+        inner join t_user u2 on psb.probleid = u2.userid
87
+        where psb.mpid=#{param.mpid}
88
+        and (psb.hasproblem=1 or (psb.hasproblem=2 and psb.problehid=#{param.handleid}))
89
+        <if test="param.correcttype==3">
51 90
             order by psb.mpsbid limit 1
52 91
         </if>
53 92
         <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 93
             order by psb.mpsqid limit 1
59 94
         </if>
60 95
     </select>
@@ -77,6 +112,7 @@
77 112
     <select id="getPreProblem" resultType="java.util.Map">
78 113
         select psq.stuanswer,psq.hasproblem,psq.problemtype,psq.problemcomm
79 114
         ,pctp.mpid,pctp.mblockid,pctp.mpsbid,pctp.taskorder,pctp.checkscore
115
+        ,if(#{param.correcttype}=3,2,psq.answertype) as answertype
80 116
         ,u.username as studentname,u.examno,u2.username as teachername
81 117
         from ms_paper_check_teacher_problem pctp
82 118
         <if test="param.correcttype==3">
@@ -88,8 +124,8 @@
88 124
         inner join t_user u on psq.studentid = u.userid
89 125
         inner join t_user u2 on psq.probleid = u2.userid
90 126
         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
127
+        and #{param.taskorder}>pctp.taskorder
128
+        order by pctp.taskorder desc limit 1
93 129
     </select>
94 130
     <!--历史记录列表-->
95 131
     <select id="listHistory" resultType="java.util.Map">
@@ -106,6 +142,7 @@
106 142
     <select id="detailHistory" resultType="java.util.Map">
107 143
         select psq.stuanswer,psq.hasproblem,psq.problemtype,psq.problemcomm
108 144
         ,pctp.mpid,pctp.mblockid,pctp.mpsbid,pctp.taskorder,pctp.checkscore
145
+        ,if(#{param.correcttype}=3,2,psq.answertype) as answertype
109 146
         ,u.username as studentname,u.examno,u2.username as teachername
110 147
         from ms_paper_check_teacher_problem pctp
111 148
         <if test="param.correcttype==3">

+ 73
- 53
smarking/src/main/resources/mapper/papercheck/MsPaperCheckTeacherTaskMapper.xml Bestand weergeven

@@ -371,30 +371,30 @@
371 371
     <!--教师阅卷-按题块-获取待批试题-->
372 372
     <select id="getCorrectBlock" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
373 373
         <if test="param.dispenseway!=null and param.dispenseway!=2">
374
-            select pctt.mblockid,pctt.mpsbid,pctt.checktype,pctt.taskorder,psb.stuanswer,psb.checked
375
-            ,psb.firstcid,psb.firstcime,psb.secondcid,psb.secondctime,psb.studentid
376
-            ,psb.firstccore,psb.secondcscore,psb.firstccores,psb.secondcscores
377
-            from ms_paper_student_block psb inner join ms_paper_check_teacher_task pctt on psb.mpsbid = pctt.mpsbid and psb.mpid=pctt.mpid
374
+            select psq.stuanswer,psq.hasgood,psq.hasbad,psq.hasproblem,psq.problemtype,psq.problemcomm
375
+            ,2 as answertype
376
+            ,pctt.mpid,pctt.mblockid,pctt.mpsbid,pctt.mptqid
377
+            from ms_paper_student_block psq inner join ms_paper_check_teacher_task pctt on psq.mpsbid = pctt.mpsbid and psq.mpid=pctt.mpid
378 378
             where pctt.mpid=#{param.mpid} and pctt.mblockid = #{param.mblockid} and pctt.teacherid = #{param.teacherid}
379
-            and pctt.checkstate!=3 and psb.hasproblem=0
379
+            and pctt.checkstate!=3 and psq.hasproblem=0
380 380
             order by field(pctt.checkstate,2,1,3),pctt.taskorder
381 381
             limit 1
382 382
         </if>
383 383
         <if test="param.dispenseway!=null and param.dispenseway==2">
384
-            select psb.mblockid,psb.mpsbid,psb.answertype,psb.stuanswer,psb.qscore,psb.checked
385
-            ,psb.firstcid,psb.firstcime,psb.secondcid,psb.secondctime,psb.studentid
386
-            ,psb.firstccore,psb.secondcscore,psb.firstccores,psb.secondcscores
387
-            from ms_paper_student_block psb
388
-            where psb.mpid=#{param.mpid} and psb.mblockid = #{param.mblockid}
389
-            and (psb.checked=1 or (psb.checked=2 and ((psb.firstcid=#{param.teacherid} and psb.firstcime is null)
384
+            select psq.stuanswer,psq.hasgood,psq.hasbad,psq.hasproblem,psq.problemtype,psq.problemcomm
385
+            ,2 as answertype
386
+            ,psq.mblockid,psq.mpsbid
387
+            from ms_paper_student_block psq
388
+            where psq.mpid=#{param.mpid} and psq.mblockid = #{param.mblockid}
389
+            and (psq.checked=1 or (psq.checked=2 and ((psq.firstcid=#{param.teacherid} and psq.firstcime is null)
390 390
             <if test="param.checktype==2">
391
-                or (psb.secondcid=#{param.teacherid} and psb.secondctime is null)
392
-                or (psb.firstcid!=#{param.teacherid} and psb.secondcid is null)
393
-                or (psb.secondcid!=#{param.teacherid} and psb.firstcid is null)
391
+                or (psq.secondcid=#{param.teacherid} and psq.secondctime is null)
392
+                or (psq.firstcid!=#{param.teacherid} and psq.secondcid is null)
393
+                or (psq.secondcid!=#{param.teacherid} and psq.firstcid is null)
394 394
             </if>
395 395
             )))
396
-            and psb.hasproblem=0
397
-            order by field(psb.checked,2,1,3)
396
+            and psq.hasproblem=0
397
+            order by field(psq.checked,2,1,3)
398 398
             limit 1
399 399
         </if>
400 400
     </select>
@@ -502,30 +502,30 @@
502 502
     <!--教师阅卷-按试题-获取待批试题-->
503 503
     <select id="getCorrectQuestion" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
504 504
         <if test="param.dispenseway!=null and param.dispenseway!=2">
505
-            select pctt.mblockid,pctt.mpsbid,pctt.checktype,pctt.taskorder,psb.stuanswer,psb.checked
506
-            ,psb.firstcid,psb.firstcime,psb.secondcid,psb.secondctime
507
-            ,psb.firstccore,psb.secondcscore
508
-            from ms_paper_student_question psb inner join ms_paper_check_teacher_task pctt on psb.mpsqid = pctt.mpsbid and psb.mpid=pctt.mpid
505
+            select psq.stuanswer,psq.hasgood,psq.hasbad,psq.hasproblem,psq.problemtype,psq.problemcomm
506
+            ,psq.answertype
507
+            ,pctt.mpid,pctt.mblockid,pctt.mpsbid,pctt.mptqid
508
+            from ms_paper_student_question psq inner join ms_paper_check_teacher_task pctt on psq.mpsqid = pctt.mpsbid and psq.mpid=pctt.mpid
509 509
             where pctt.mpid=#{param.mpid} and pctt.mblockid = #{param.mblockid} and pctt.teacherid = #{param.teacherid}
510
-            and pctt.checkstate!=3 and psb.hasproblem=0
510
+            and pctt.checkstate!=3 and psq.hasproblem=0
511 511
             order by field(pctt.checkstate,2,1,3),pctt.taskorder
512 512
             limit 1
513 513
         </if>
514 514
         <if test="param.dispenseway!=null and param.dispenseway==2">
515
-            select psb.mptqid as mblockid,psb.mpsqid as mpsbid,psb.answertype,psb.stuanswer,psb.qscore,psb.checked
516
-            ,psb.firstcid,psb.firstcime,psb.secondcid,psb.secondctime
517
-            ,psb.firstccore,psb.secondcscore
518
-            from ms_paper_student_question psb
519
-            where psb.mpid=#{param.mpid} and psb.mptqid = #{param.mblockid}
520
-            and (psb.checked=1 or (psb.checked=2 and ((psb.firstcid=#{param.teacherid} and psb.firstcime is null)
515
+            select psq.stuanswer,psq.hasgood,psq.hasbad,psq.hasproblem,psq.problemtype,psq.problemcomm
516
+            ,psq.answertype
517
+            ,psq.mptqid as mblockid,psq.mpsqid as mpsbid,psq.mptqid
518
+            from ms_paper_student_question psq
519
+            where psq.mpid=#{param.mpid} and psq.mptqid = #{param.mblockid}
520
+            and (psq.checked=1 or (psq.checked=2 and ((psq.firstcid=#{param.teacherid} and psq.firstcime is null)
521 521
             <if test="param.checktype==2">
522
-                or (psb.secondcid=#{param.teacherid} and psb.secondctime is null)
523
-                or (psb.firstcid!=#{param.teacherid} and psb.secondcid is null)
524
-                or (psb.secondcid!=#{param.teacherid} and psb.firstcid is null)
522
+                or (psq.secondcid=#{param.teacherid} and psq.secondctime is null)
523
+                or (psq.firstcid!=#{param.teacherid} and psq.secondcid is null)
524
+                or (psq.secondcid!=#{param.teacherid} and psq.firstcid is null)
525 525
             </if>
526 526
             )))
527
-            and psb.hasproblem=0
528
-            order by field(psb.checked,2,1,3)
527
+            and psq.hasproblem=0
528
+            order by field(psq.checked,2,1,3)
529 529
             limit 1
530 530
         </if>
531 531
     </select>
@@ -542,30 +542,31 @@
542 542
     <!--教师阅卷-按班级-获取待批试题-->
543 543
     <select id="getCorrectClassQuestion" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
544 544
         <if test="param.dispenseway!=null and param.dispenseway!=2">
545
-            select pctt.mblockid,pctt.mpsbid,pctt.checktype,pctt.taskorder,psb.stuanswer,psb.checked
546
-            ,psb.firstcid,psb.firstcime,psb.secondcid,psb.secondctime,psb.mptqid
547
-            ,psb.firstccore,psb.secondcscore
548
-            from ms_paper_student_question psb inner join ms_paper_check_teacher_task pctt on psb.mpsqid = pctt.mpsbid and psb.mpid=pctt.mpid
545
+            select psq.stuanswer,psq.hasgood,psq.hasbad,psq.hasproblem,psq.problemtype,psq.problemcomm
546
+            ,psq.answertype
547
+            ,pctt.mpid,pctt.mblockid,pctt.mpsbid,pctt.mptqid
548
+            from ms_paper_student_question psq inner join ms_paper_check_teacher_task pctt on psq.mpsqid = pctt.mpsbid and psq.mpid=pctt.mpid
549 549
             where pctt.mpid=#{param.mpid} and pctt.mblockid = #{param.mblockid} and pctt.teacherid = #{param.teacherid}
550
-            and pctt.checkstate!=3 and psb.hasproblem=0
550
+            and pctt.checkstate!=3 and psq.hasproblem=0
551 551
             order by field(pctt.checkstate,2,1,3),pctt.taskorder
552 552
             limit 1
553 553
         </if>
554 554
         <if test="param.dispenseway!=null and param.dispenseway==2">
555
-            select c.classid as mblockid,psb.mpsqid as mpsbid,psb.answertype,psb.stuanswer,psb.qscore,psb.checked
556
-            ,psb.firstcid,psb.firstcime,psb.secondcid,psb.secondctime,psb.mptqid
557
-            ,psb.firstccore,psb.secondcscore
558
-            from ms_paper_student_question psb inner join ms_class c on psb.mpid=c.mpid
559
-            where psb.mpid=#{param.mpid} and c.classid = #{param.mblockid}
560
-            and (psb.checked=1 or (psb.checked=2 and ((psb.firstcid=#{param.teacherid} and psb.firstcime is null)
555
+            select psq.stuanswer,psq.hasgood,psq.hasbad,psq.hasproblem,psq.problemtype,psq.problemcomm
556
+            ,psq.answertype
557
+            ,c.classid as mblockid,psq.mpsqid as mpsbid,psq.mptqid
558
+            from ms_paper_student_question psq inner join ms_class c on c.examid=psq.examid and c.subjectid=psq.subjectid
559
+            inner join ms_class_student cs on cs.examid=psq.examid and cs.subjectid=psq.subjectid and cs.studentid=psq.studentid
560
+            where psq.mpid=#{param.mpid} and c.classid = #{param.mblockid}
561
+            and (psq.checked=1 or (psq.checked=2 and ((psq.firstcid=#{param.teacherid} and psq.firstcime is null)
561 562
             <if test="param.checktype==2">
562
-                or (psb.secondcid=#{param.teacherid} and psb.secondctime is null)
563
-                or (psb.firstcid!=#{param.teacherid} and psb.secondcid is null)
564
-                or (psb.secondcid!=#{param.teacherid} and psb.firstcid is null)
563
+                or (psq.secondcid=#{param.teacherid} and psq.secondctime is null)
564
+                or (psq.firstcid!=#{param.teacherid} and psq.secondcid is null)
565
+                or (psq.secondcid!=#{param.teacherid} and psq.firstcid is null)
565 566
             </if>
566 567
             )))
567
-            and psb.hasproblem=0
568
-            order by field(psb.checked,2,1,3),psb.mptqid
568
+            and psq.hasproblem=0
569
+            order by field(psq.checked,2,1,3),psq.mptqid
569 570
             limit 1
570 571
         </if>
571 572
     </select>
@@ -600,13 +601,14 @@
600 601
     </select>
601 602
     <!--教师阅卷-上一份-->
602 603
     <select id="getPreCorrect" resultType="java.util.Map">
603
-        select psq.stuanswer
604
+        select psq.stuanswer,psq.hasgood,psq.hasbad,psq.hasproblem,psq.problemtype,psq.problemcomm
604 605
         <if test="param.correcttype==3">
605
-             ,if(pctt.checktype=1,psq.firstccores,psq.secondcscores) as stuscore
606
+            ,2 as answertype
606 607
         </if>
607 608
         <if test="param.correcttype!=3">
608
-            ,if(pctt.checktype=1,psq.firstccore,psq.secondcscore) as stuscore
609
+            ,psq.answertype
609 610
         </if>
611
+        ,pctt.mpid,pctt.mblockid,pctt.mpsbid,pctt.mptqid,pctt.taskorder,pctt.checkscore,pctt.checktype
610 612
         from ms_paper_check_teacher_task pctt
611 613
         <if test="param.correcttype==3">
612 614
             inner join ms_paper_student_block psq on pctt.mpsbid=psq.mpsbid
@@ -638,8 +640,14 @@
638 640
     </select>
639 641
     <!--教师阅卷-历史详情-->
640 642
     <select id="detailHistory" resultType="java.util.Map">
641
-        select psq.stuanswer,pctt.checkscore,pctt.hasproblem,pctt.problemtype,pctt.problemcomm
642
-        ,pctt.mpid,pctt.mblockid,pctt.mpsbid,pctt.mptqid,pctt.taskorder
643
+        select psq.stuanswer,psq.hasgood,psq.hasbad,psq.hasproblem,psq.problemtype,psq.problemcomm
644
+        <if test="param.correcttype==3">
645
+             ,2 as answertype
646
+        </if>
647
+        <if test="param.correcttype!=3">
648
+            ,psq.answertype
649
+        </if>
650
+        ,pctt.mpid,pctt.mblockid,pctt.mpsbid,pctt.mptqid,pctt.taskorder,pctt.checkscore,pctt.checktype
643 651
         from ms_paper_check_teacher_task pctt
644 652
         <if test="param.correcttype==3">
645 653
             inner join ms_paper_student_block psq on pctt.mpsbid=psq.mpsbid
@@ -693,4 +701,16 @@
693 701
         from ms_paper_check pc
694 702
         where pc.checkstate=1 and pc.arbitrateid = #{param.handleid}) as a
695 703
     </select>
704
+    <!--获取批阅结果-->
705
+    <select id="getCheckResult" resultType="com.xhkjedu.smarking.vo.papercheck.MsCheckVo">
706
+        select psq.firstcid,psq.firstcime,psq.firstccore,psq.firstccores,psq.secondcid,psq.secondctime,psq.secondcscore,psq.secondcscores
707
+        <if test="param.correcttype==3">
708
+            from ms_paper_student_block psq
709
+            where psq.mpsbid=#{param.mpsbid}
710
+        </if>
711
+        <if test="param.correcttype!=3">
712
+            from ms_paper_student_block psq
713
+            where psq.mpsqid=#{param.mpsbid}
714
+        </if>
715
+    </select>
696 716
 </mapper>

Laden…
Annuleren
Opslaan