Browse Source

批阅、仲裁、疑难卷

ywx
雍文秀 1 month ago
parent
commit
72493de992

+ 6
- 3
smarking/src/main/java/com/xhkjedu/smarking/controller/papercheck/MsPaperCheckTeacherArbitrateController.java View File

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

+ 2
- 1
smarking/src/main/java/com/xhkjedu/smarking/controller/papercheck/MsPaperCheckTeacherProblemController.java View File

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

+ 8
- 2
smarking/src/main/java/com/xhkjedu/smarking/mapper/papercheck/MsPaperCheckTeacherArbitrateMapper.java View File

23
     List<Map> detailArbitrate(@Param("param") MsCheckParam param);
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
     MsPaperCheckTeacher getACheckNum(@Param("param") MsCheckParam param);
29
     MsPaperCheckTeacher getACheckNum(@Param("param") MsCheckParam param);
38
     List<Map> listQuestionArbitrate(@Param("param") MsCheckParam param);
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
     List<Map> listArbitrateHistory(@Param("param") MsCheckParam param);
44
     List<Map> listArbitrateHistory(@Param("param") MsCheckParam param);
51
 
51
 
52
     //保存或更新单个任务
52
     //保存或更新单个任务
53
     void save(@Param("m") MsPaperCheckTeacherArbitrate task);
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 View File

45
 
45
 
46
     //打回重阅
46
     //打回重阅
47
     void backCorrect(@Param("param") MsPaperCheckVo param);
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 View File

2
 
2
 
3
 import com.xhkjedu.base.TkMapper;
3
 import com.xhkjedu.base.TkMapper;
4
 import com.xhkjedu.smarking.model.papercheck.*;
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
 import org.apache.ibatis.annotations.Param;
6
 import org.apache.ibatis.annotations.Param;
8
 
7
 
9
 import java.util.List;
8
 import java.util.List;
115
 
114
 
116
     //教师阅卷-待仲裁数量
115
     //教师阅卷-待仲裁数量
117
     Integer getPendingArbitrateNum(@Param("param") MsCheckParam param);
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 View File

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

+ 4
- 0
smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsPaperCheckTeacherProblemService.java View File

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

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

+ 28
- 0
smarking/src/main/java/com/xhkjedu/smarking/vo/papercheck/MsCheckVo.java View File

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 View File

4
     <!--保存或更新单个任务-->
4
     <!--保存或更新单个任务-->
5
     <insert id="save">
5
     <insert id="save">
6
         insert into ms_paper_check_teacher_arbitrate (mpid, mblockid, teacherid, taskorder,checkstate, mpsbid, createtime)
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
         on duplicate key update taskorder=#{m.taskorder},teacherid=#{m.teacherid}
8
         on duplicate key update taskorder=#{m.taskorder},teacherid=#{m.teacherid}
9
     </insert>
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
     <select id="listArbitrate" resultType="java.util.Map">
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
         ,truncate((count(distinct if(psb.arbitratestate=2,psb.mpsbid,null)))*100/count(distinct psb.mpsbid),2) as checkrate
39
         ,truncate((count(distinct if(psb.arbitratestate=2,psb.mpsbid,null)))*100/count(distinct psb.mpsbid),2) as checkrate
15
         from ms_subject s inner join ms_exam e on s.examid = e.examid
40
         from ms_subject s inner join ms_exam e on s.examid = e.examid
16
         inner join ms_paper_check pc on pc.msid = s.msid
41
         inner join ms_paper_check pc on pc.msid = s.msid
20
         <if test="param.checktype==0">having 100>checkrate</if>
45
         <if test="param.checktype==0">having 100>checkrate</if>
21
         <if test="param.checktype==1">having 100=checkrate</if>
46
         <if test="param.checktype==1">having 100=checkrate</if>
22
         union
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
         ,truncate((count(distinct if(psb.arbitratestate=2,psb.mpsqid,null)))*100/count(distinct psb.mpsqid),2) as checkrate
50
         ,truncate((count(distinct if(psb.arbitratestate=2,psb.mpsqid,null)))*100/count(distinct psb.mpsqid),2) as checkrate
26
         from ms_subject s inner join ms_exam e on s.examid = e.examid
51
         from ms_subject s inner join ms_exam e on s.examid = e.examid
27
         inner join ms_paper_check pc on pc.msid = s.msid
52
         inner join ms_paper_check pc on pc.msid = s.msid
40
             ,count(distinct psb.mpsbid) as totalNum
65
             ,count(distinct psb.mpsbid) as totalNum
41
             ,count(distinct if(psb.arbitratestate=2,psb.mpsbid,null)) as myCheckedNum
66
             ,count(distinct if(psb.arbitratestate=2,psb.mpsbid,null)) as myCheckedNum
42
             ,count(distinct if(psb.arbitratestate=1,psb.mpsbid,null)) as myUncheckedNum
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
             from ms_paper_check pc left join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.mpid = pc.mpid
69
             from ms_paper_check pc left join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.mpid = pc.mpid
44
             inner join ms_paper_block pb on pc.mblockid = pb.mblockid and pb.mpid = pc.mpid
70
             inner join ms_paper_block pb on pc.mblockid = pb.mblockid and pb.mpid = pc.mpid
45
             where pc.mpid=#{param.mpid} and pc.arbitrateid=#{param.handleid} and psb.arbitratestate!=0
71
             where pc.mpid=#{param.mpid} and pc.arbitrateid=#{param.handleid} and psb.arbitratestate!=0
60
         </if>
86
         </if>
61
     </select>
87
     </select>
62
     <!--获取待仲裁任务-->
88
     <!--获取待仲裁任务-->
63
-    <select id="getCorrectArbitrate" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
89
+    <select id="getCorrectArbitrate" resultType="java.util.Map">
64
         <if test="param.correcttype==3">
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
             from ms_paper_check pc inner join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.mpid = pc.mpid
92
             from ms_paper_check pc inner join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.mpid = pc.mpid
67
             where pc.mpid=#{param.mpid} and pc.arbitrateid=#{param.handleid}
93
             where pc.mpid=#{param.mpid} and pc.arbitrateid=#{param.handleid}
68
             and (psb.arbitratestate=1 or (psb.arbitratestate=2 and psb.arbitrateid=#{param.handleid}))
94
             and (psb.arbitratestate=1 or (psb.arbitratestate=2 and psb.arbitrateid=#{param.handleid}))
69
             order by psb.mpsbid limit 1
95
             order by psb.mpsbid limit 1
70
         </if>
96
         </if>
71
         <if test="param.correcttype==2">
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
             where pc.mpid=#{param.mpid} and pc.arbitrateid=#{param.handleid}
100
             where pc.mpid=#{param.mpid} and pc.arbitrateid=#{param.handleid}
75
             and (psb.arbitratestate=1 or (psb.arbitratestate=2 and psb.arbitrateid=#{param.handleid}))
101
             and (psb.arbitratestate=1 or (psb.arbitratestate=2 and psb.arbitrateid=#{param.handleid}))
76
             order by psb.mpsqid limit 1
102
             order by psb.mpsqid limit 1
94
     <!--教师阅卷-待仲裁-上一份-->
120
     <!--教师阅卷-待仲裁-上一份-->
95
     <select id="getPreArbitrate" resultType="java.util.Map">
121
     <select id="getPreArbitrate" resultType="java.util.Map">
96
         <if test="param.correcttype==3">
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
         </if>
128
         </if>
103
         <if test="param.correcttype==2">
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
         </if>
135
         </if>
110
     </select>
136
     </select>
111
     <!--待仲裁题块列表-->
137
     <!--待仲裁题块列表-->
128
         ,pc.mblockid,pc.hidefirstscore
154
         ,pc.mblockid,pc.hidefirstscore
129
         from ms_paper_check pc left join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.mpid = pc.mpid
155
         from ms_paper_check pc left join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.mpid = pc.mpid
130
         inner join ms_paper_block pb on pc.mblockid = pb.mblockid and pb.mpid = pc.mpid
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
             and pc.arbitrateid=#{param.handleid}
159
             and pc.arbitrateid=#{param.handleid}
134
         </if>
160
         </if>
135
         group by pb.mblockid
161
         group by pb.mblockid
140
         select psb.qorder,psb.qn,psb.qscore
166
         select psb.qorder,psb.qn,psb.qscore
141
         ,pc.mblockid,pc.hidefirstscore
167
         ,pc.mblockid,pc.hidefirstscore
142
         from ms_paper_check pc left join ms_paper_student_question psb on psb.mptqid = pc.mblockid and psb.mpid = pc.mpid
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
             and pc.arbitrateid=#{param.handleid}
171
             and pc.arbitrateid=#{param.handleid}
146
         </if>
172
         </if>
147
         group by psb.mptqid
173
         group by psb.mptqid
148
         order by psb.mptqid
174
         order by psb.mptqid
149
     </select>
175
     </select>
150
     <!--学科组长-获取待仲裁任务-->
176
     <!--学科组长-获取待仲裁任务-->
151
-    <select id="getCorrectLeaderArbitrate" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
177
+    <select id="getCorrectLeaderArbitrate" resultType="java.util.Map">
152
         <if test="param.correcttype==3">
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
             from ms_paper_student_block psb
180
             from ms_paper_student_block psb
155
             where psb.mpid=#{param.mpid} and (psb.arbitratestate=1 or (psb.arbitratestate=2 and psb.arbitrateid=#{param.handleid}))
181
             where psb.mpid=#{param.mpid} and (psb.arbitratestate=1 or (psb.arbitratestate=2 and psb.arbitrateid=#{param.handleid}))
156
             order by psb.mpsbid limit 1
182
             order by psb.mpsbid limit 1
157
         </if>
183
         </if>
158
         <if test="param.correcttype==2">
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
             from ms_paper_student_question psb
186
             from ms_paper_student_question psb
161
             where psb.mpid=#{param.mpid} and (psb.arbitratestate=1 or (psb.arbitratestate=2 and psb.arbitrateid=#{param.handleid}))
187
             where psb.mpid=#{param.mpid} and (psb.arbitratestate=1 or (psb.arbitratestate=2 and psb.arbitrateid=#{param.handleid}))
162
             order by psb.mpsqid limit 1
188
             order by psb.mpsqid limit 1
175
     </select>
201
     </select>
176
     <!--仲裁历史详情-->
202
     <!--仲裁历史详情-->
177
     <select id="detailHistory" resultType="java.util.Map">
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
         <if test="param.correcttype==3">
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
         </if>
209
         </if>
184
         <if test="param.correcttype==2">
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
         </if>
212
         </if>
187
-        where mpcta.mpctaid=#{param.mpctaid}
213
+        where pcta.mpctaid=#{param.mpctaid}
188
     </select>
214
     </select>
189
     <!--初评分-->
215
     <!--初评分-->
190
     <select id="getScore" resultType="java.util.Map">
216
     <select id="getScore" resultType="java.util.Map">

+ 51
- 14
smarking/src/main/resources/mapper/papercheck/MsPaperCheckTeacherProblemMapper.xml View File

4
     <!--保存或更新单个任务-->
4
     <!--保存或更新单个任务-->
5
     <insert id="save">
5
     <insert id="save">
6
         insert into ms_paper_check_teacher_problem (mpid, mblockid, teacherid, taskorder,checkstate, mpsbid, createtime)
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
         on duplicate key update taskorder=#{m.taskorder},teacherid=#{m.teacherid}
8
         on duplicate key update taskorder=#{m.taskorder},teacherid=#{m.teacherid}
9
     </insert>
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
     <delete id="deleteByMpsbidAndMpid">
36
     <delete id="deleteByMpsbidAndMpid">
12
         delete from ms_paper_check_teacher_problem where mpsbid=#{mpsbid} and mpid=#{mpid}
37
         delete from ms_paper_check_teacher_problem where mpsbid=#{mpsbid} and mpid=#{mpid}
29
     <select id="listBlockProblem" resultMap="arbitrateBlockResultMap">
54
     <select id="listBlockProblem" resultMap="arbitrateBlockResultMap">
30
         select pb.mblockid,pb.blockname,pb.blockorder,pb.bqnum
55
         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
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
         group by pb.mblockid
58
         group by pb.mblockid
34
         order by pb.blockorder
59
         order by pb.blockorder
35
     </select>
60
     </select>
36
     <!--疑难卷试题列表-->
61
     <!--疑难卷试题列表-->
37
     <select id="listQuestionProblem" resultType="java.util.Map">
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
         from ms_paper_student_question psb
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
         group by psb.mptqid
66
         group by psb.mptqid
42
         order by psb.mptqid
67
         order by psb.mptqid
43
     </select>
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
         <if test="param.correcttype==3">
79
         <if test="param.correcttype==3">
47
-            select psb.mblockid,psb.stuanswer,psb.mpsbid
48
             from ms_paper_student_block psb
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
             order by psb.mpsbid limit 1
90
             order by psb.mpsbid limit 1
52
         </if>
91
         </if>
53
         <if test="param.correcttype==2">
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
             order by psb.mpsqid limit 1
93
             order by psb.mpsqid limit 1
59
         </if>
94
         </if>
60
     </select>
95
     </select>
77
     <select id="getPreProblem" resultType="java.util.Map">
112
     <select id="getPreProblem" resultType="java.util.Map">
78
         select psq.stuanswer,psq.hasproblem,psq.problemtype,psq.problemcomm
113
         select psq.stuanswer,psq.hasproblem,psq.problemtype,psq.problemcomm
79
         ,pctp.mpid,pctp.mblockid,pctp.mpsbid,pctp.taskorder,pctp.checkscore
114
         ,pctp.mpid,pctp.mblockid,pctp.mpsbid,pctp.taskorder,pctp.checkscore
115
+        ,if(#{param.correcttype}=3,2,psq.answertype) as answertype
80
         ,u.username as studentname,u.examno,u2.username as teachername
116
         ,u.username as studentname,u.examno,u2.username as teachername
81
         from ms_paper_check_teacher_problem pctp
117
         from ms_paper_check_teacher_problem pctp
82
         <if test="param.correcttype==3">
118
         <if test="param.correcttype==3">
88
         inner join t_user u on psq.studentid = u.userid
124
         inner join t_user u on psq.studentid = u.userid
89
         inner join t_user u2 on psq.probleid = u2.userid
125
         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
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
     </select>
129
     </select>
94
     <!--历史记录列表-->
130
     <!--历史记录列表-->
95
     <select id="listHistory" resultType="java.util.Map">
131
     <select id="listHistory" resultType="java.util.Map">
106
     <select id="detailHistory" resultType="java.util.Map">
142
     <select id="detailHistory" resultType="java.util.Map">
107
         select psq.stuanswer,psq.hasproblem,psq.problemtype,psq.problemcomm
143
         select psq.stuanswer,psq.hasproblem,psq.problemtype,psq.problemcomm
108
         ,pctp.mpid,pctp.mblockid,pctp.mpsbid,pctp.taskorder,pctp.checkscore
144
         ,pctp.mpid,pctp.mblockid,pctp.mpsbid,pctp.taskorder,pctp.checkscore
145
+        ,if(#{param.correcttype}=3,2,psq.answertype) as answertype
109
         ,u.username as studentname,u.examno,u2.username as teachername
146
         ,u.username as studentname,u.examno,u2.username as teachername
110
         from ms_paper_check_teacher_problem pctp
147
         from ms_paper_check_teacher_problem pctp
111
         <if test="param.correcttype==3">
148
         <if test="param.correcttype==3">

+ 73
- 53
smarking/src/main/resources/mapper/papercheck/MsPaperCheckTeacherTaskMapper.xml View File

371
     <!--教师阅卷-按题块-获取待批试题-->
371
     <!--教师阅卷-按题块-获取待批试题-->
372
     <select id="getCorrectBlock" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
372
     <select id="getCorrectBlock" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
373
         <if test="param.dispenseway!=null and param.dispenseway!=2">
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
             where pctt.mpid=#{param.mpid} and pctt.mblockid = #{param.mblockid} and pctt.teacherid = #{param.teacherid}
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
             order by field(pctt.checkstate,2,1,3),pctt.taskorder
380
             order by field(pctt.checkstate,2,1,3),pctt.taskorder
381
             limit 1
381
             limit 1
382
         </if>
382
         </if>
383
         <if test="param.dispenseway!=null and param.dispenseway==2">
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
             <if test="param.checktype==2">
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
             </if>
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
             limit 1
398
             limit 1
399
         </if>
399
         </if>
400
     </select>
400
     </select>
502
     <!--教师阅卷-按试题-获取待批试题-->
502
     <!--教师阅卷-按试题-获取待批试题-->
503
     <select id="getCorrectQuestion" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
503
     <select id="getCorrectQuestion" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
504
         <if test="param.dispenseway!=null and param.dispenseway!=2">
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
             where pctt.mpid=#{param.mpid} and pctt.mblockid = #{param.mblockid} and pctt.teacherid = #{param.teacherid}
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
             order by field(pctt.checkstate,2,1,3),pctt.taskorder
511
             order by field(pctt.checkstate,2,1,3),pctt.taskorder
512
             limit 1
512
             limit 1
513
         </if>
513
         </if>
514
         <if test="param.dispenseway!=null and param.dispenseway==2">
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
             <if test="param.checktype==2">
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
             </if>
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
             limit 1
529
             limit 1
530
         </if>
530
         </if>
531
     </select>
531
     </select>
542
     <!--教师阅卷-按班级-获取待批试题-->
542
     <!--教师阅卷-按班级-获取待批试题-->
543
     <select id="getCorrectClassQuestion" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
543
     <select id="getCorrectClassQuestion" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
544
         <if test="param.dispenseway!=null and param.dispenseway!=2">
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
             where pctt.mpid=#{param.mpid} and pctt.mblockid = #{param.mblockid} and pctt.teacherid = #{param.teacherid}
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
             order by field(pctt.checkstate,2,1,3),pctt.taskorder
551
             order by field(pctt.checkstate,2,1,3),pctt.taskorder
552
             limit 1
552
             limit 1
553
         </if>
553
         </if>
554
         <if test="param.dispenseway!=null and param.dispenseway==2">
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
             <if test="param.checktype==2">
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
             </if>
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
             limit 1
570
             limit 1
570
         </if>
571
         </if>
571
     </select>
572
     </select>
600
     </select>
601
     </select>
601
     <!--教师阅卷-上一份-->
602
     <!--教师阅卷-上一份-->
602
     <select id="getPreCorrect" resultType="java.util.Map">
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
         <if test="param.correcttype==3">
605
         <if test="param.correcttype==3">
605
-             ,if(pctt.checktype=1,psq.firstccores,psq.secondcscores) as stuscore
606
+            ,2 as answertype
606
         </if>
607
         </if>
607
         <if test="param.correcttype!=3">
608
         <if test="param.correcttype!=3">
608
-            ,if(pctt.checktype=1,psq.firstccore,psq.secondcscore) as stuscore
609
+            ,psq.answertype
609
         </if>
610
         </if>
611
+        ,pctt.mpid,pctt.mblockid,pctt.mpsbid,pctt.mptqid,pctt.taskorder,pctt.checkscore,pctt.checktype
610
         from ms_paper_check_teacher_task pctt
612
         from ms_paper_check_teacher_task pctt
611
         <if test="param.correcttype==3">
613
         <if test="param.correcttype==3">
612
             inner join ms_paper_student_block psq on pctt.mpsbid=psq.mpsbid
614
             inner join ms_paper_student_block psq on pctt.mpsbid=psq.mpsbid
638
     </select>
640
     </select>
639
     <!--教师阅卷-历史详情-->
641
     <!--教师阅卷-历史详情-->
640
     <select id="detailHistory" resultType="java.util.Map">
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
         from ms_paper_check_teacher_task pctt
651
         from ms_paper_check_teacher_task pctt
644
         <if test="param.correcttype==3">
652
         <if test="param.correcttype==3">
645
             inner join ms_paper_student_block psq on pctt.mpsbid=psq.mpsbid
653
             inner join ms_paper_student_block psq on pctt.mpsbid=psq.mpsbid
693
         from ms_paper_check pc
701
         from ms_paper_check pc
694
         where pc.checkstate=1 and pc.arbitrateid = #{param.handleid}) as a
702
         where pc.checkstate=1 and pc.arbitrateid = #{param.handleid}) as a
695
     </select>
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
 </mapper>
716
 </mapper>

Loading…
Cancel
Save