Browse Source

学生是否自动批阅

tags/正式3.14.1^0
雍文秀 3 months ago
parent
commit
70754a37dc

+ 15
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/controller/paper/PaperController.java View File

378
         return new ResultVo(0, "获取批阅班级列表成功", list);
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
     * @Description 该方法用于重新生成之前的作业报告
397
     * @Description 该方法用于重新生成之前的作业报告
383
     * @Author WN
398
     * @Author WN

+ 3
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/paper/PaperMapper.java View File

183
 
183
 
184
     //获取已过截止时间作业班级数量
184
     //获取已过截止时间作业班级数量
185
     int countEndPaperClassById(@Param("paperid") Integer paperid,@Param("stoptime") int stoptime);
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 View File

1463
         if (num != 0) throw new MissingParametersException("已过截止时间,禁止修改!");
1463
         if (num != 0) throw new MissingParametersException("已过截止时间,禁止修改!");
1464
         paperMapper.updateAfterCommit(paper);
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 View File

446
         ps.setUserscore(0.0);
446
         ps.setUserscore(0.0);
447
         ps.setPsstate(0);
447
         ps.setPsstate(0);
448
         ps.setPschecked(0);
448
         ps.setPschecked(0);
449
+        ps.setAutocheck(0);
449
         ps.setCosttime(0);
450
         ps.setCosttime(0);
450
         paperStudentMapper.insertUseGeneratedKeys(ps);
451
         paperStudentMapper.insertUseGeneratedKeys(ps);
451
         return ps.getId();
452
         return ps.getId();

+ 12
- 0
sstudy/src/main/resources/mapper/paper/PaperMapper.xml View File

569
     <select id="countEndPaperClassById" resultType="java.lang.Integer">
569
     <select id="countEndPaperClassById" resultType="java.lang.Integer">
570
         select count(*) from t_paper_class where paperid=#{paperid} and #{stoptime}>=stoptime
570
         select count(*) from t_paper_class where paperid=#{paperid} and #{stoptime}>=stoptime
571
     </select>
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
 </mapper>
586
 </mapper>

+ 2
- 0
sstudy/src/main/resources/mapper/paperstudent/PaperStudentMapper.xml View File

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

Loading…
Cancel
Save