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,13 +24,8 @@
24 24
         left join t_classroom_paper p on p.paperid=rt.paperid
25 25
         left join t_classroom_paper_student ps on p.paperid=ps.paperid
26 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 29
         <if test="param.begintime!=null and param.begintime!=0">
35 30
             and r.createtime between #{param.begintime} and #{param.endtime}
36 31
         </if>

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

@@ -210,7 +210,7 @@ public class EBaseController {
210 210
         if (exam.getExamstate() != 0) return new ResultVo(0, "发布成功");
211 211
 
212 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 214
         if (code == 1) return new ResultVo(1, "发布考试失败");
215 215
 
216 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,7 +38,7 @@ public interface EBaseMapper extends TkMapper<EBase> {
38 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 43
     //根据考试id获取考试状态信息
44 44
     EBaseVo getExamStateById(@Param("examid") Integer examid);
@@ -72,4 +72,7 @@ public interface EBaseMapper extends TkMapper<EBase> {
72 72
 
73 73
     //清空考试报告
74 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,6 +63,9 @@ public class EBase extends BaseBean {
63 63
     //学校报告地址
64 64
     private String reportschool;
65 65
 
66
+    //发布学年
67
+    private Integer year;
68
+
66 69
     @Transient
67 70
     //班级ids
68 71
     private List<Integer> classids;

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

@@ -221,7 +221,7 @@ public class EBaseService {
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 225
         try {
226 226
             //发布考试,获取考试试卷题量和分值
227 227
             List<EPaper> papers = ePaperMapper.listNumAndScoreByExamId(examid);
@@ -240,8 +240,10 @@ public class EBaseService {
240 240
                     }
241 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 247
         } catch (Exception e) {
246 248
             log.error("发布考试失败:"+e.getMessage());
247 249
             return 1;

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

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

Loading…
Cancel
Save