Browse Source

考试添加年份

tags/正式3.10.0
王宁 1 year ago
parent
commit
f964bff3e9

+ 2
- 7
sapi/src/main/resources/mapper/region/RRoomAnalyzeMapper.xml View File

24
         left join t_classroom_paper p on p.paperid=rt.paperid
24
         left join t_classroom_paper p on p.paperid=rt.paperid
25
         left join t_classroom_paper_student ps on p.paperid=ps.paperid
25
         left join t_classroom_paper_student ps on p.paperid=ps.paperid
26
         left join t_classroom_paper_student_scantron pss on ps.psid=pss.psid
26
         left join t_classroom_paper_student_scantron pss on ps.psid=pss.psid
27
-        where s.schoollevel=#{param.level} and s.schoolstate=1 and r.roomstate=2 and r.endtime is not null
28
-        <if test="param.year!=null and param.year!=0">
29
-            and s.year=#{param.year}
30
-        </if>
31
-        <if test="param.year==null || param.year==0">
32
-            and c.year=s.year
33
-        </if>
27
+        where s.schoollevel=#{param.level} and s.schoolstate=1 and r.roomstate=2
28
+        and r.year=#{param.year} and r.endtime is not null
34
         <if test="param.begintime!=null and param.begintime!=0">
29
         <if test="param.begintime!=null and param.begintime!=0">
35
             and r.createtime between #{param.begintime} and #{param.endtime}
30
             and r.createtime between #{param.begintime} and #{param.endtime}
36
         </if>
31
         </if>

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/controller/exam/EBaseController.java View File

210
         if (exam.getExamstate() != 0) return new ResultVo(0, "发布成功");
210
         if (exam.getExamstate() != 0) return new ResultVo(0, "发布成功");
211
 
211
 
212
         List<UserVo> students = eBaseService.listStuByExamId(examid);//获取考生
212
         List<UserVo> students = eBaseService.listStuByExamId(examid);//获取考生
213
-        Integer code = eBaseService.updateExamStateStart(examid, examcomm, students, exam.getExammode());//发布考试
213
+        Integer code = eBaseService.updateExamStateStart(examid, examcomm, students, exam.getExammode(),schoolid);//发布考试
214
         if (code == 1) return new ResultVo(1, "发布考试失败");
214
         if (code == 1) return new ResultVo(1, "发布考试失败");
215
 
215
 
216
         if (notice == 2 && msg == 2) return new ResultVo(0, "发布成功");
216
         if (notice == 2 && msg == 2) return new ResultVo(0, "发布成功");

+ 4
- 1
sexam/src/main/java/com/xhkjedu/sexam/mapper/exam/EBaseMapper.java View File

38
     String getNameByExamId(@Param("examid") Integer examid);
38
     String getNameByExamId(@Param("examid") Integer examid);
39
 
39
 
40
     //发布考试
40
     //发布考试
41
-    void postExam(@Param("examid") Integer examid, @Param("examcomm") String examcomm);
41
+    void postExam(@Param("examid") Integer examid, @Param("examcomm") String examcomm,@Param("year") Integer year);
42
 
42
 
43
     //根据考试id获取考试状态信息
43
     //根据考试id获取考试状态信息
44
     EBaseVo getExamStateById(@Param("examid") Integer examid);
44
     EBaseVo getExamStateById(@Param("examid") Integer examid);
72
 
72
 
73
     //清空考试报告
73
     //清空考试报告
74
     void clearExamPdf(@Param("examid") Integer examid);
74
     void clearExamPdf(@Param("examid") Integer examid);
75
+
76
+    //获取学校当前年份
77
+    Integer getYearBySchoolid(@Param("schoolid") Integer schoolid);
75
 }
78
 }

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/model/exam/EBase.java View File

63
     //学校报告地址
63
     //学校报告地址
64
     private String reportschool;
64
     private String reportschool;
65
 
65
 
66
+    //发布学年
67
+    private Integer year;
68
+
66
     @Transient
69
     @Transient
67
     //班级ids
70
     //班级ids
68
     private List<Integer> classids;
71
     private List<Integer> classids;

+ 4
- 2
sexam/src/main/java/com/xhkjedu/sexam/service/exam/EBaseService.java View File

221
     }
221
     }
222
 
222
 
223
     //发布考试
223
     //发布考试
224
-    public Integer updateExamStateStart(Integer examid, String examcomm, List<UserVo> students,Integer exammode) {
224
+    public Integer updateExamStateStart(Integer examid, String examcomm, List<UserVo> students,Integer exammode,Integer schoolid) {
225
         try {
225
         try {
226
             //发布考试,获取考试试卷题量和分值
226
             //发布考试,获取考试试卷题量和分值
227
             List<EPaper> papers = ePaperMapper.listNumAndScoreByExamId(examid);
227
             List<EPaper> papers = ePaperMapper.listNumAndScoreByExamId(examid);
240
                     }
240
                     }
241
                 }).start();
241
                 }).start();
242
             }
242
             }
243
+
244
+            int year=eBaseMapper.getYearBySchoolid(schoolid);
243
             //更改考试状态
245
             //更改考试状态
244
-            eBaseMapper.postExam(examid, examcomm);
246
+            eBaseMapper.postExam(examid, examcomm,year);
245
         } catch (Exception e) {
247
         } catch (Exception e) {
246
             log.error("发布考试失败:"+e.getMessage());
248
             log.error("发布考试失败:"+e.getMessage());
247
             return 1;
249
             return 1;

+ 6
- 1
sexam/src/main/resources/mapper/exam/EBaseMapper.xml View File

57
 
57
 
58
     <!--发布考试-->
58
     <!--发布考试-->
59
     <update id="postExam">
59
     <update id="postExam">
60
-        update e_base set examcomm=#{examcomm},examstate=1 where examid=#{examid}
60
+        update e_base set examcomm=#{examcomm},examstate=1,`year`=#{year} where examid=#{examid}
61
     </update>
61
     </update>
62
     <!--考试基本信息-->
62
     <!--考试基本信息-->
63
     <select id="findById" resultType="java.util.Map">
63
     <select id="findById" resultType="java.util.Map">
145
         SET b.reportstate=1,b.reportschool=NULL,c.reportclass=NULL,c.reportstu=NULL,s.reportstu=NULL,ecs.reporturl=NULL
145
         SET b.reportstate=1,b.reportschool=NULL,c.reportclass=NULL,c.reportstu=NULL,s.reportstu=NULL,ecs.reporturl=NULL
146
         WHERE b.examid=#{examid}
146
         WHERE b.examid=#{examid}
147
     </update>
147
     </update>
148
+
149
+    <!--获取学校当前年份-->
150
+    <select id="getYearBySchoolid" resultType="java.lang.Integer">
151
+        select `year` from t_school where schoolid=#{schoolid}
152
+    </select>
148
 </mapper>
153
 </mapper>

Loading…
Cancel
Save