Procházet zdrojové kódy

批阅、仲裁、处理疑难卷更新学生得分

ywx
雍文秀 před 4 týdny
rodič
revize
13abd88f09

+ 3
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/papercheck/MsPaperCheckTeacherProblemMapper.java Zobrazit soubor

@@ -51,4 +51,7 @@ public interface MsPaperCheckTeacherProblemMapper extends TkMapper<MsPaperCheckT
51 51
 
52 52
     //处理疑难卷
53 53
     void correct(@Param("param") MsPaperCheckVo param);
54
+
55
+    //根据题块/试题id获取学生试卷id
56
+    Integer getMpsIdByMpsbid(@Param("mpsbid") Integer mpsbid,@Param("correcttype") Integer correcttype);
54 57
 }

+ 5
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/stupaper/MsPaperStudentMapper.java Zobrazit soubor

@@ -8,6 +8,7 @@ import com.xhkjedu.smarking.model.stupaper.MsPaperStudentScore;
8 8
 import com.xhkjedu.smarking.vo.exam.CStudentVo;
9 9
 import com.xhkjedu.smarking.vo.stupaper.PaperStuExamVo;
10 10
 import org.apache.ibatis.annotations.Param;
11
+import org.springframework.scheduling.annotation.Async;
11 12
 
12 13
 import java.util.List;
13 14
 import java.util.Map;
@@ -83,4 +84,8 @@ public interface MsPaperStudentMapper extends TkMapper<MsPaperStudent> {
83 84
 
84 85
     //删除考试学生信息
85 86
     void deleteByExamId(@Param("examid") Integer examid);
87
+
88
+    @Async("asyncPoolTaskExecutor")
89
+    //更新学生总分
90
+    void updateStudentPaperScoreByMpsId(@Param("mpsid") Integer mpsid);
86 91
 }

+ 3
- 5
smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsPaperCheckService.java Zobrazit soubor

@@ -146,10 +146,8 @@ public class MsPaperCheckService {
146 146
 
147 147
     //设置一个题块的批卷任务
148 148
     public void setBlockTask(Integer mpid, Integer mblockid) {
149
-        new Thread(() -> {
150
-            MsPaperCheck check = msPaperCheckMapper.findByMBlockId(mpid, mblockid);
151
-            msBlockCheckService.setOneBlockTask(check);//设置一个题块的批卷任务
152
-        }).start();
149
+        MsPaperCheck check = msPaperCheckMapper.findByMBlockId(mpid, mblockid);
150
+        msBlockCheckService.setOneBlockTask(check);//设置一个题块的批卷任务
153 151
     }
154 152
 
155 153
     /**
@@ -218,7 +216,7 @@ public class MsPaperCheckService {
218 216
             tasks.add(task);
219 217
         }
220 218
         tasknum = taskIds.size();
221
-        msPaperCheckTeacherTaskMapper.batchUpdate(tasks);//批量更新任务信息
219
+        if(N_Utils.isListNotEmpty(tasks)) msPaperCheckTeacherTaskMapper.batchUpdate(tasks);//批量更新任务信息
222 220
         msPaperCheckTeacherMapper.updateTaskNum(mblockid, teacherid, tasknum, addTeacherId);//更新批阅教师任务数量
223 221
         return taskorder;
224 222
     }

+ 9
- 3
smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsPaperCheckTeacherArbitrateService.java Zobrazit soubor

@@ -3,8 +3,7 @@ package com.xhkjedu.smarking.service.papercheck;
3 3
 import com.xhkjedu.exception.ServiceException;
4 4
 import com.xhkjedu.smarking.mapper.paper.MsPaperMapper;
5 5
 import com.xhkjedu.smarking.mapper.papercheck.MsPaperCheckTeacherArbitrateMapper;
6
-import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentBlockMapper;
7
-import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentQuestionMapper;
6
+import com.xhkjedu.smarking.mapper.stupaper.*;
8 7
 import com.xhkjedu.smarking.model.paper.MsPaper;
9 8
 import com.xhkjedu.smarking.model.paper.MsPaperBlockQuestion;
10 9
 import com.xhkjedu.smarking.model.papercheck.MsPaperCheckTeacher;
@@ -37,6 +36,8 @@ public class MsPaperCheckTeacherArbitrateService {
37 36
     private MsPaperStudentBlockMapper msPaperStudentBlockMapper;
38 37
     @Resource
39 38
     private MsPaperStudentQuestionMapper msPaperStudentQuestionMapper;
39
+    @Resource
40
+    private MsPaperStudentMapper msPaperStudentMapper;
40 41
 
41 42
     /**
42 43
      * @Description 教师阅卷-待/已仲裁列表
@@ -143,8 +144,10 @@ public class MsPaperCheckTeacherArbitrateService {
143 144
         Integer finalreason = param.getFinalreason();
144 145
         Integer hasgood = param.getHasgood();
145 146
         Integer hasbad = param.getHasbad();
147
+        Integer mpsid;
146 148
         if (correcttype.equals(3)) {//按题块批阅
147 149
             MsPaperStudentBlock block = msPaperStudentBlockMapper.selectByPrimaryKey(mpsbid);
150
+            mpsid = block.getMpsid();
148 151
             String firstccores = block.getFirstccores();
149 152
             String secondcscores = block.getSecondcscores();
150 153
             Double firstccore = block.getFirstccore();
@@ -223,8 +226,9 @@ public class MsPaperCheckTeacherArbitrateService {
223 226
             psq.setHasbad(hasbad);
224 227
             msPaperStudentBlockMapper.updateByPrimaryKeySelective(psq);
225 228
             msPaperStudentQuestionMapper.checkByMptqidAndStudentId(studentQuestions, psq);
226
-        } else if (correcttype.equals(2)) {
229
+        } else {
227 230
             MsPaperStudentQuestion question = msPaperStudentQuestionMapper.selectByPrimaryKey(mpsbid);
231
+            mpsid = question.getMpsid();
228 232
             Double firstccore = question.getFirstccore();
229 233
             Double secondcscore = question.getSecondcscore();
230 234
             double scoreDiff1 = MarkingUtil.scoreDiff(firstccore, arbitratescore);
@@ -259,6 +263,8 @@ public class MsPaperCheckTeacherArbitrateService {
259 263
             msPaperStudentQuestionMapper.updateByPrimaryKeySelective(psq);
260 264
         }
261 265
         msPaperCheckTeacherArbitrateMapper.correct(param);
266
+
267
+        msPaperStudentMapper.updateStudentPaperScoreByMpsId(mpsid);//更新学生总分
262 268
     }
263 269
 
264 270
     /**

+ 6
- 2
smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsPaperCheckTeacherProblemService.java Zobrazit soubor

@@ -3,8 +3,7 @@ package com.xhkjedu.smarking.service.papercheck;
3 3
 import com.xhkjedu.exception.ServiceException;
4 4
 import com.xhkjedu.smarking.mapper.paper.MsPaperMapper;
5 5
 import com.xhkjedu.smarking.mapper.papercheck.MsPaperCheckTeacherProblemMapper;
6
-import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentBlockMapper;
7
-import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentQuestionMapper;
6
+import com.xhkjedu.smarking.mapper.stupaper.*;
8 7
 import com.xhkjedu.smarking.model.paper.MsPaper;
9 8
 import com.xhkjedu.smarking.model.paper.MsPaperBlockQuestion;
10 9
 import com.xhkjedu.smarking.model.papercheck.*;
@@ -36,6 +35,8 @@ public class MsPaperCheckTeacherProblemService {
36 35
     private MsPaperStudentBlockMapper msPaperStudentBlockMapper;
37 36
     @Resource
38 37
     private MsPaperStudentQuestionMapper msPaperStudentQuestionMapper;
38
+    @Resource
39
+    private MsPaperStudentMapper msPaperStudentMapper;
39 40
 
40 41
     /**
41 42
      * @Description 学科组长-疑难卷列表
@@ -179,6 +180,9 @@ public class MsPaperCheckTeacherProblemService {
179 180
             msPaperStudentQuestionMapper.updateByPrimaryKeySelective(psq);
180 181
         }
181 182
         msPaperCheckTeacherProblemMapper.correct(param);
183
+
184
+        Integer mpsid = msPaperCheckTeacherProblemMapper.getMpsIdByMpsbid(mpsbid, correcttype);
185
+        msPaperStudentMapper.updateStudentPaperScoreByMpsId(mpsid);//更新学生总分
182 186
     }
183 187
 
184 188
     /**

+ 9
- 5
smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsPaperCheckTeacherTaskService.java Zobrazit soubor

@@ -4,8 +4,7 @@ import com.xhkjedu.exception.ServiceException;
4 4
 import com.xhkjedu.smarking.mapper.paper.MsPaperMapper;
5 5
 import com.xhkjedu.smarking.mapper.papercheck.MsPaperCheckMapper;
6 6
 import com.xhkjedu.smarking.mapper.papercheck.MsPaperCheckTeacherTaskMapper;
7
-import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentBlockMapper;
8
-import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentQuestionMapper;
7
+import com.xhkjedu.smarking.mapper.stupaper.*;
9 8
 import com.xhkjedu.smarking.mapper.system.UserMapper;
10 9
 import com.xhkjedu.smarking.model.paper.MsPaper;
11 10
 import com.xhkjedu.smarking.model.paper.MsPaperBlockQuestion;
@@ -43,6 +42,8 @@ public class MsPaperCheckTeacherTaskService {
43 42
     private MsPaperStudentBlockMapper msPaperStudentBlockMapper;
44 43
     @Resource
45 44
     private MsPaperStudentQuestionMapper msPaperStudentQuestionMapper;
45
+    @Resource
46
+    private MsPaperStudentMapper msPaperStudentMapper;
46 47
 
47 48
 
48 49
     /**
@@ -396,6 +397,8 @@ public class MsPaperCheckTeacherTaskService {
396 397
         String checkscore;
397 398
         //仲裁状态0默认1待仲裁2已仲裁
398 399
         Integer arbitratestate = null;
400
+        MsCheckVo result = msPaperCheckTeacherTaskMapper.getCheckResult(param);
401
+        Integer mpsid = result.getMpsid();
399 402
         if (checktype.equals(1)) {//单评
400 403
             if (hasproblem.equals(0)) {
401 404
                 checked = 3;
@@ -415,7 +418,7 @@ public class MsPaperCheckTeacherTaskService {
415 418
                 block.setProblemcomm(problemcomm);
416 419
                 block.setProbleid(probleid);
417 420
                 msPaperStudentBlockMapper.updateByPrimaryKeySelective(block);
418
-                block.setStudentid(param.getStudentid());
421
+                block.setMpsid(mpsid);
419 422
                 block.setMblockid(param.getMblockid());
420 423
 
421 424
                 List<MsPaperStudentQuestion> studentQuestions = new ArrayList<>();
@@ -467,7 +470,6 @@ public class MsPaperCheckTeacherTaskService {
467 470
                 msPaperStudentQuestionMapper.updateByPrimaryKeySelective(question);
468 471
             }
469 472
         } else {//双评
470
-            MsCheckVo result = msPaperCheckTeacherTaskMapper.getCheckResult(param);
471 473
             Integer firstcime = result.getFirstcime();
472 474
             Integer secondcime = result.getSecondctime();
473 475
             Double firstccore = result.getFirstccore();
@@ -599,7 +601,7 @@ public class MsPaperCheckTeacherTaskService {
599 601
                 block.setProblemtype(problemtype);
600 602
                 block.setProblemcomm(problemcomm);
601 603
                 block.setProbleid(probleid);
602
-                block.setStudentid(param.getStudentid());
604
+                block.setMpsid(mpsid);
603 605
                 block.setMblockid(param.getMblockid());
604 606
                 block.setArbitratestate(arbitratestate);
605 607
                 msPaperStudentBlockMapper.updateByPrimaryKeySelective(block);
@@ -634,6 +636,8 @@ public class MsPaperCheckTeacherTaskService {
634 636
         param.setProblemcomm(problemcomm);
635 637
         param.setCheckscore(checkscore);
636 638
         msPaperCheckTeacherTaskMapper.correct(param);
639
+
640
+        if (checked == 3) msPaperStudentMapper.updateStudentPaperScoreByMpsId(mpsid);//更新学生总分
637 641
     }
638 642
 
639 643
     //最终得分计算

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/vo/papercheck/MsCheckVo.java Zobrazit soubor

@@ -9,6 +9,8 @@ import lombok.Data;
9 9
  **/
10 10
 @Data
11 11
 public class MsCheckVo {
12
+    //试卷学生id
13
+    private Integer mpsid;
12 14
     //单评批改人
13 15
     private Integer firstcid;
14 16
     //单评批改时间

+ 9
- 0
smarking/src/main/resources/mapper/papercheck/MsPaperCheckTeacherProblemMapper.xml Zobrazit soubor

@@ -171,4 +171,13 @@
171 171
         </if>
172 172
         where pctt.mpid=#{param.mpid} and pctt.mpsbid=#{param.mpsbid}
173 173
     </select>
174
+    <!--根据题块/试题id获取学生试卷id-->
175
+    <select id="getMpsIdByMpsbid" resultType="java.lang.Integer">
176
+        <if test="param.correcttype==3">
177
+            select mpsid from ms_paper_student_block where mpsbid=#{mpsbid}
178
+        </if>
179
+        <if test="param.correcttype!=3">
180
+            select mpsid from ms_paper_student_question where mpsqid=#{mpsbid}
181
+        </if>
182
+    </select>
174 183
 </mapper>

+ 2
- 1
smarking/src/main/resources/mapper/papercheck/MsPaperCheckTeacherTaskMapper.xml Zobrazit soubor

@@ -64,7 +64,7 @@
64 64
     <select id="getTaskIdsByMBlockIdAndTeacherId" resultType="java.lang.Integer">
65 65
         select mpcttid
66 66
         from ms_paper_check_teacher_task
67
-        where mblockid = #{mblockId} and teacherid = #{teacherId} and checkstate != 3
67
+        where mblockid = #{mblockid} and teacherid = #{teacherid} and checkstate != 3
68 68
         order by taskorder desc limit #{tasknum}
69 69
     </select>
70 70
     <!--阅卷进度-按题块-->
@@ -704,6 +704,7 @@
704 704
     <!--获取批阅结果-->
705 705
     <select id="getCheckResult" resultType="com.xhkjedu.smarking.vo.papercheck.MsCheckVo">
706 706
         select psq.firstcid,psq.firstcime,psq.firstccore,psq.firstccores,psq.secondcid,psq.secondctime,psq.secondcscore,psq.secondcscores
707
+        ,psq.mpsid
707 708
         <if test="param.correcttype==3">
708 709
             from ms_paper_student_block psq
709 710
             where psq.mpsbid=#{param.mpsbid}

+ 10
- 10
smarking/src/main/resources/mapper/stupaper/MsPaperStudentBlockMapper.xml Zobrazit soubor

@@ -8,7 +8,7 @@
8 8
         on b.mpsid=q.mpsid and b.mblockid=q.mblockid
9 9
         set b.stuanswer=null,b.converted=0,b.checked=0,b.hasgood=0,b.hasbad=0,b.firstcid=null,b.firstcime=null,b.firstccore=0,
10 10
             b.secondcid=null,b.secondctime=null,b.secondcscore=0,b.arbitrateid=null,b.arbitratetime=null,b.arbitratescore=0,
11
-            b.hasproblem=0,b.problemtype=0,b.problemcomm=null,,b.hasfinal=0,b.finalreason=0,
11
+            b.hasproblem=0,b.problemtype=0,b.problemcomm=null,b.hasfinal=0,b.finalreason=0,
12 12
             q.answered=0,q.answertype=0,q.stuanswer=null,q.converted=0,q.answertime=0,q.stuscore=0,
13 13
             q.checked=0,q.firstcid=null,q.firstcime=null,q.firstccore=0,q.secondcid=null,q.secondctime=null,q.secondcscore=0,
14 14
             q.arbitrateid=null,q.arbitratetime=null,q.arbitratescore=0,q.hasgood=0,
@@ -21,7 +21,7 @@
21 21
         on b.mpsid=q.mpsid and b.mblockid=q.mblockid
22 22
             set b.stuanswer=null,b.converted=0,b.checked=0,b.hasgood=0,b.hasbad=0,b.firstcid=null,b.firstcime=null,b.firstccore=0,
23 23
                 b.secondcid=null,b.secondctime=null,b.secondcscore=0,b.arbitrateid=null,b.arbitratetime=null,b.arbitratescore=0,
24
-                b.hasproblem=0,b.problemtype=0,b.problemcomm=null,,b.hasfinal=0,b.finalreason=0,
24
+                b.hasproblem=0,b.problemtype=0,b.problemcomm=null,b.hasfinal=0,b.finalreason=0,
25 25
                 q.answered=0,q.answertype=0,q.stuanswer=null,q.converted=0,q.answertime=0,q.stuscore=0,
26 26
                 q.checked=0,q.firstcid=null,q.firstcime=null,q.firstccore=0,q.secondcid=null,q.secondctime=null,q.secondcscore=0,
27 27
                 q.arbitrateid=null,q.arbitratetime=null,q.arbitratescore=0,q.hasgood=0,
@@ -53,12 +53,12 @@
53 53
         </collection>
54 54
     </resultMap>
55 55
     <select id="listPaperStuBlockQuestions" resultMap="stuBlockQuestions">
56
-        select distinct b.mpsbid,b.mpsid,b.mpid,b.mblockid,b.stuanswer,pb.blocktype,q.mpsqid,q.mpsid,q.mptqid,q.qn,q.qorder,
56
+        select distinct b.mpsbid,b.mpsid,b.mpid,b.mblockid,b.stuanswer,pb.blocktype,q.mpsqid,q.mptqid,q.qn,q.qorder,
57 57
                         q.qscore,q.ctype,tq.qanswer,tq.loseoption,tq.scoreset,p.answered
58 58
         from ms_paper_student_question q left join ms_paper_student_block b
59
-        on b.mpsid=q.mpsid and b.mpsbid=q.mpsbid
59
+        on b.mpsid=q.mpsid and b.mblockid=q.mblockid
60 60
         left join ms_paper_block pb on pb.mblockid=b.mblockid
61
-        left join ms_paper_block_question pbq on q.mbqid=pbq.mbqid
61
+        left join ms_paper_block_question pbq on q.mptqid=pbq.mptqid
62 62
         left join ms_paper_qtype_question tq on pbq.mptqid=tq.mptqid
63 63
         left join ms_paper p on p.mpid=b.mpid
64 64
         where b.mpsid = #{mpsid}
@@ -75,18 +75,18 @@
75 75
         update ms_paper_student_block
76 76
         <trim prefix="set" suffixOverrides=",">
77 77
             <trim prefix="firstcid = case mpsbid" suffix="end,">
78
-                <foreach collection="merges" item="m" separator="when">
79
-                    ${m.mpsbid} then ifnull(${m.firstcid},firstcid)
78
+                <foreach collection="list" item="m" separator=" ">
79
+                    when #{m.mpsbid} then ifnull(#{m.firstcid},firstcid)
80 80
                 </foreach>
81 81
             </trim>
82 82
             <trim prefix="secondcid = case mpsbid" suffix="end,">
83
-                <foreach collection="merges" item="m" separator="when">
84
-                    ${m.mpsbid} then ifnull(${m.secondcid},secondcid)
83
+                <foreach collection="list" item="m" separator=" ">
84
+                    when #{m.mpsbid} then ifnull(#{m.secondcid},secondcid)
85 85
                 </foreach>
86 86
             </trim>
87 87
         </trim>
88 88
         where mpsbid in
89
-        <foreach collection="merges" item="m" open="(" separator="," close=")">
89
+        <foreach collection="list" item="m" open="(" separator="," close=")">
90 90
             #{m.mpsbid}
91 91
         </foreach>
92 92
     </update>

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

@@ -269,5 +269,10 @@
269 269
     <update id="updateStuScoreForRestoreFillScore">
270 270
         update ms_paper_student set stuscore=0.0,stuscoretype=0 where examid=#{examid} and studentid=#{studentid}
271 271
     </update>
272
+    <!--更新学生总分-->
273
+    <update id="updateStudentPaperScoreByMpsId">
274
+        update ms_paper_student set stuscore=(select sum(ifnull(q.stuscore,0)) from ms_paper_student_question q where q.mpsid=#{mpsid})
275
+        where mpsid=#{mpsid}
276
+    </update>
272 277
 
273 278
 </mapper>

+ 5
- 5
smarking/src/main/resources/mapper/stupaper/MsPaperStudentQuestionMapper.xml Zobrazit soubor

@@ -93,13 +93,13 @@
93 93
         update ms_paper_student_question
94 94
         <trim prefix="set" suffixOverrides=",">
95 95
             <trim prefix="firstcid = case mpsqid" suffix="end,">
96
-                <foreach collection="list" item="m" separator="when">
97
-                    ${m.mpsbid} then ifnull(${m.firstcid},firstcid)
96
+                <foreach collection="list" item="m" separator=" ">
97
+                    when #{m.mpsbid} then ifnull(#{m.firstcid},firstcid)
98 98
                 </foreach>
99 99
             </trim>
100 100
             <trim prefix="secondcid = case mpsqid" suffix="end,">
101
-                <foreach collection="list" item="m" separator="when">
102
-                    ${m.mpsbid} then ifnull(${m.secondcid},secondcid)
101
+                <foreach collection="list" item="m" separator=" ">
102
+                    when #{m.mpsbid} then ifnull(#{m.secondcid},secondcid)
103 103
                 </foreach>
104 104
             </trim>
105 105
         </trim>
@@ -208,7 +208,7 @@
208 208
         <if test="block.checked!=null and block.checked!=0">
209 209
             ,checked=#{block.checked}
210 210
         </if>
211
-        where mblockid=#{block.mblockid} and studentid=#{block.studentid} and mptqid in
211
+        where mblockid=#{block.mblockid} and mpsid=#{block.mpsid} and mptqid in
212 212
         <foreach collection="list" item="q" separator="," open="(" close=")">#{q.mptqid}</foreach>
213 213
     </update>
214 214
 

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