浏览代码

学生是否自动批阅

tags/正式3.14.1^0
雍文秀 3 个月前
父节点
当前提交
70754a37dc

+ 15
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/controller/paper/PaperController.java 查看文件

@@ -378,6 +378,21 @@ public class PaperController {
378 378
         return new ResultVo(0, "获取批阅班级列表成功", list);
379 379
     }
380 380
 
381
+    /**
382
+     * @Description 获取批阅班级数量
383
+     * @Date 2024/9/23 10:28
384
+     * @Author YWX
385
+     * @Param [paper]
386
+     * @Return com.xhkjedu.vo.ResultVo
387
+     **/
388
+    @PostMapping("/check_classnum")
389
+    public ResultVo getCheckClassNum(@RequestBody TPaper paper) {
390
+        Integer paperid = paper.getPaperid();
391
+        N_Utils.validation(new Object[]{paperid, "作业id", 1});
392
+        Integer num = paperService.getCheckClassNum(paperid, paper.getCreateid());
393
+        return new ResultVo(0, "获取批阅班级列表成功", num);
394
+    }
395
+
381 396
     /*
382 397
     * @Description 该方法用于重新生成之前的作业报告
383 398
     * @Author WN

+ 3
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/paper/PaperMapper.java 查看文件

@@ -183,4 +183,7 @@ public interface PaperMapper extends TkMapper<TPaper> {
183 183
 
184 184
     //获取已过截止时间作业班级数量
185 185
     int countEndPaperClassById(@Param("paperid") Integer paperid,@Param("stoptime") int stoptime);
186
+
187
+    //获取批阅班级数量
188
+    Integer getCheckClassNum(@Param("paperid") Integer paperid,@Param("checkid") Integer checkid);
186 189
 }

+ 11
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/service/paper/PaperService.java 查看文件

@@ -1463,4 +1463,15 @@ public class PaperService {
1463 1463
         if (num != 0) throw new MissingParametersException("已过截止时间,禁止修改!");
1464 1464
         paperMapper.updateAfterCommit(paper);
1465 1465
     }
1466
+
1467
+    /**
1468
+     * @Description 获取批阅班级数量
1469
+     * @Date 2024/9/23 10:28
1470
+     * @Author YWX
1471
+     * @Param [paperid, createid]
1472
+     * @Return java.lang.Integer
1473
+     **/
1474
+    public Integer getCheckClassNum(Integer paperid, Integer createid) {
1475
+        return paperMapper.getCheckClassNum(paperid, createid);
1476
+    }
1466 1477
 }

+ 1
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/service/paperstudent/PaperClassService.java 查看文件

@@ -446,6 +446,7 @@ public class PaperClassService {
446 446
         ps.setUserscore(0.0);
447 447
         ps.setPsstate(0);
448 448
         ps.setPschecked(0);
449
+        ps.setAutocheck(0);
449 450
         ps.setCosttime(0);
450 451
         paperStudentMapper.insertUseGeneratedKeys(ps);
451 452
         return ps.getId();

+ 12
- 0
sstudy/src/main/resources/mapper/paper/PaperMapper.xml 查看文件

@@ -569,6 +569,18 @@
569 569
     <select id="countEndPaperClassById" resultType="java.lang.Integer">
570 570
         select count(*) from t_paper_class where paperid=#{paperid} and #{stoptime}>=stoptime
571 571
     </select>
572
+    <!--获取批阅班级数量-->
573
+    <select id="getCheckClassNum" resultType="java.lang.Integer">
574
+        select count(distinct ps.classid)
575
+        from t_paper_student ps
576
+        <if test="checkid!=null and checkid!=0">
577
+            left join t_paper_class pg on ps.paperid=pg.paperid and ps.classid=pg.classid
578
+        </if>
579
+        where ps.paperid=#{paperid} and ps.psstate in(1,2,4) and ps.autocheck=0
580
+        <if test="checkid!=null and checkid!=0">
581
+            and pg.checkid=#{checkid}
582
+        </if>
583
+    </select>
572 584
 
573 585
 
574 586
 </mapper>

+ 2
- 0
sstudy/src/main/resources/mapper/paperstudent/PaperStudentMapper.xml 查看文件

@@ -225,6 +225,7 @@
225 225
         group by ps.psid)s left join t_paper_student ps on s.psid=ps.psid
226 226
         set ps.psstate=4,ps.showanswer=1,ps.userscore=s.stuscore,ps.costtime=s.costtime
227 227
         ,ps.pschecked=s.pschecked,ps.stoptime=${stoptime}
228
+        ,ps.autocheck=if(s.pschecked=1,1,0)
228 229
     </update>
229 230
     <!--附件作业自动收卷-自动批改学生未做试题-->
230 231
     <update id="updateStuScantron">
@@ -247,6 +248,7 @@
247 248
         group by ps.psid)s left join t_paper_student ps on s.psid=ps.psid
248 249
         set ps.psstate=4,ps.showanswer=1,ps.userscore=s.stuscore,ps.costtime=s.costtime
249 250
         ,ps.pschecked=s.pschecked,ps.stoptime=${stoptime}
251
+        ,ps.autocheck=if(s.pschecked=1,1,0)
250 252
     </update>
251 253
     <!--要自动收卷的作业班级列表-->
252 254
     <select id="listRollUpPaper" resultType="java.util.Map">

正在加载...
取消
保存