Procházet zdrojové kódy

获取分配总数

ywx
雍文秀 před 4 týdny
rodič
revize
0b54fc83ac

+ 1
- 1
smarking/src/main/java/com/xhkjedu/smarking/mapper/papercheck/MsPaperCheckMapper.java Zobrazit soubor

@@ -22,7 +22,7 @@ public interface MsPaperCheckMapper extends TkMapper<MsPaperCheck> {
22 22
     List<Map> listPaperCheck(@Param("mpid") Integer mpid);
23 23
 
24 24
     //获取试卷分配总数
25
-    Map getDispenseNum(@Param("mpid") Integer mpid, @Param("mblockid") Integer mblockid);
25
+    Map getDispenseNum(@Param("mpid") Integer mpid, @Param("mblockid") Integer mblockid,@Param("correcttype") Integer correcttype);
26 26
 
27 27
     //获取题块分配教师列表
28 28
     List<MsPaperCheckTeacher> listTeacherByMBlockId(@Param("mpid") Integer mpid,@Param("mblockid") Integer mblockid);

+ 1
- 4
smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsPaperCheckService.java Zobrazit soubor

@@ -129,9 +129,6 @@ public class MsPaperCheckService {
129 129
             List<MsPaperCheckTeacher> teachers = msPaperCheck.getTeachers();
130 130
             if (N_Utils.isListEmpty(teachers)) throw new ServiceException("请选择阅卷教师");
131 131
             for (MsPaperCheckTeacher teacher : teachers) {
132
-                if (!N_Utils.isTrueInteger(teacher.getTasknum())) {
133
-                    throw new ServiceException("请设置每位教师的阅卷任务数");
134
-                }
135 132
                 teacher.setMpid(mpid);
136 133
                 teacher.setMblockid(mblockid);
137 134
                 teacher.setCreateid(createid);
@@ -170,7 +167,7 @@ public class MsPaperCheckService {
170 167
      **/
171 168
     public Map getDispenseNum(Integer mpid, Integer mblockid) {
172 169
         MsPaperCheck check = msPaperCheckMapper.findByMBlockId(mpid, mblockid);
173
-        Map map = msPaperCheckMapper.getDispenseNum(check.getMpid(), mblockid);
170
+        Map map = msPaperCheckMapper.getDispenseNum(check.getMpid(), mblockid, check.getCorrecttype());
174 171
         if (check.getChecktype().equals(2)) {//双评,每个学生的试卷要批阅两次
175 172
             map.put("signupnum", N_Utils.obj2Int(map.get("signupnum")) * 2);
176 173
             map.put("commitnum", N_Utils.obj2Int(map.get("commitnum")) * 2);

+ 8
- 2
smarking/src/main/resources/mapper/papercheck/MsPaperCheckMapper.xml Zobrazit soubor

@@ -50,8 +50,14 @@
50 50
     <!--获取试卷分配总数-->
51 51
     <select id="getDispenseNum" resultType="java.util.Map">
52 52
         select count(distinct ps.studentid) as signupnum
53
-        ,count(distinct if(psb.stuanswer is not null and psb.stuanswer!='',psb.mpsbid,null)) as commitnum
54
-        from ms_paper_student ps left join ms_paper_student_block psb on ps.mpid = psb.mpid and psb.mblockid = #{mblockid}
53
+        <if test="correcttype!=null and correcttype==3">
54
+            ,(select count(*) from ms_paper_student_block psb where psb.mpid=#{mpid} and psb.mblockid=#{mblockid} and psb.checked!=0) as commitnum
55
+        </if>
56
+        <if test="correcttype!=null and correcttype!=3">
57
+            ,(select count(*) from ms_paper_student_question psb where psb.mpid=#{mpid} and psb.mptqid=#{mblockid} and psb.checked!=0) as commitnum
58
+        </if>
59
+        ,(select count(*) from ms_paper_check_teacher_task t WHERE t.mpid=#{mpid} AND t.mblockid=#{mblockid}) as tasknum
60
+        from ms_paper_student ps
55 61
         where ps.mpid = #{mpid}
56 62
     </select>
57 63
     <!--获取题块分配教师列表-->

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