Browse Source

优化预习、作业、考试基础信息关联年份。

数据汇总
tags/正式3.13.3
王宁 1 year ago
parent
commit
b2c1170d76

+ 1
- 1
sapi/src/main/resources/mapper/analyze/SchoolSummaryMapper.xml View File

@@ -99,7 +99,7 @@
99 99
         left join t_class c on c.classid=ggs.classid
100 100
         left join t_director d on g.directorid=d.directorid
101 101
         where d.disabled=0 and g.schoolid=#{sparams.schoolid} and ggs.schoolid=#{sparams.schoolid}
102
-        and c.gradeid=#{sparams.gradeid} and g.year=#{sparams.year}
102
+        and c.gradeid=#{sparams.gradeid} and c.year=#{sparams.year}
103 103
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
104 104
             and g.subjectid=#{sparams.subjectid}
105 105
         </if>

+ 2
- 2
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,@Param("year") Integer year);
41
+    void postExam(@Param("examid") Integer examid, @Param("examcomm") String examcomm);
42 42
 
43 43
     //根据考试id获取考试状态信息
44 44
     EBaseVo getExamStateById(@Param("examid") Integer examid);
@@ -74,7 +74,7 @@ public interface EBaseMapper extends TkMapper<EBase> {
74 74
     void clearExamPdf(@Param("examid") Integer examid);
75 75
 
76 76
     //获取学校当前年份
77
-    Integer getYearBySchoolid(@Param("schoolid") Integer schoolid);
77
+    Integer getYearByUserid(@Param("userid") Integer userid);
78 78
 
79 79
     //获取考试学校id
80 80
     Integer getSchoolidByExamid(@Param("examid") Integer examid);

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

@@ -84,6 +84,8 @@ public class EBaseService {
84 84
                 model.setHashb(1);
85 85
             }
86 86
 
87
+            int year=eBaseMapper.getYearByUserid(model.getCreateid());
88
+            model.setYear(year);
87 89
             eBaseMapper.insertUseGeneratedKeys(model);
88 90
             Integer examid = model.getId();
89 91
 
@@ -257,10 +259,8 @@ public class EBaseService {
257 259
                     }
258 260
                 }).start();
259 261
             }
260
-
261
-            int year=eBaseMapper.getYearBySchoolid(schoolid);
262 262
             //更改考试状态
263
-            eBaseMapper.postExam(examid, examcomm,year);
263
+            eBaseMapper.postExam(examid, examcomm);
264 264
         } catch (Exception e) {
265 265
             log.error("发布考试失败:"+e.getMessage());
266 266
             return 1;

+ 4
- 3
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,`year`=#{year} where examid=#{examid}
60
+        update e_base set examcomm=#{examcomm},examstate=1 where examid=#{examid}
61 61
     </update>
62 62
     <!--考试基本信息-->
63 63
     <select id="findById" resultType="java.util.Map">
@@ -147,8 +147,9 @@
147 147
     </update>
148 148
 
149 149
     <!--获取学校当前年份-->
150
-    <select id="getYearBySchoolid" resultType="java.lang.Integer">
151
-        select `year` from t_school where schoolid=#{schoolid}
150
+    <select id="getYearByUserid" resultType="java.lang.Integer">
151
+        select s.year from t_user u left join t_school s on u.schoolid=s.schoolid
152
+        where u.userid=#{userid}
152 153
     </select>
153 154
 
154 155
     <!--获得发起考试学校id-->

+ 5
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/service/paper/PaperService.java View File

@@ -9,6 +9,7 @@ import com.xhkjedu.sstudy.mapper.paper.*;
9 9
 import com.xhkjedu.sstudy.mapper.paperstudent.PaperClassMapper;
10 10
 import com.xhkjedu.sstudy.mapper.paperstudent.PaperStudentMapper;
11 11
 import com.xhkjedu.sstudy.mapper.subjectbook.TeacherSubjectbookMapper;
12
+import com.xhkjedu.sstudy.mapper.system.SchoolMapper;
12 13
 import com.xhkjedu.sstudy.model.paper.*;
13 14
 import com.xhkjedu.sstudy.model.paperstudent.TPaperClass;
14 15
 import com.xhkjedu.sstudy.model.paperstudent.TPaperStudent;
@@ -67,6 +68,8 @@ public class PaperService {
67 68
 
68 69
     @Resource
69 70
     private TeacherSubjectbookMapper teacherSubjectbookMapper;
71
+    @Resource
72
+    private SchoolMapper schoolMapper;
70 73
 
71 74
     /**
72 75
      * 功能描述  答题卡作业--保存
@@ -208,6 +211,8 @@ public class PaperService {
208 211
         if (directorid != null && (directorid.equals("0") || directorid.equals(""))) {
209 212
             paper.setDirectorid(null);
210 213
         }
214
+        int year = schoolMapper.getYearByUserId(paper.getCreateid());
215
+        paper.setYear(year);
211 216
         paperMapper.insertUseGeneratedKeys(paper);
212 217
         return paper.getId();
213 218
     }

+ 0
- 3
sstudy/src/main/java/com/xhkjedu/sstudy/service/paperstudent/PaperClassService.java View File

@@ -346,9 +346,6 @@ public class PaperClassService {
346 346
                     paperGroupParam.setHashb(hashb);
347 347
                     paperGroupParam.setPaperstate(22);
348 348
 
349
-                    //获取发布作业时学校年份
350
-                    int year = schoolMapper.getYearById(paper.getSchoolid());
351
-                    paperGroupParam.setYear(year);
352 349
                     paperMapper.updatePaperState(paperGroupParam,count);
353 350
                     return new ResultVo(0, "发布成功", count);
354 351
                 } else {

+ 1
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/service/resource/GuideService.java View File

@@ -116,7 +116,7 @@ public class GuideService {
116 116
                     hashb = 1;
117 117
                 }
118 118
                 guide.setHashb(hashb);
119
-                int year = schoolMapper.getYearById(guide.getSchoolid());
119
+                int year = schoolMapper.getYearByUserId(guide.getCreateid());
120 120
                 guide.setYear(year);
121 121
                 guideMapper.insertUseGeneratedKeys(guide);
122 122
                 Integer guideid = guide.getId();//预习id

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

@@ -39,7 +39,7 @@
39 39
     </select>
40 40
     <!-- 修改作业状态 -->
41 41
     <update id="updatePaperState">
42
-        UPDATE t_paper SET paperstate=#{pg.paperstate},hashb=#{pg.hashb},committype=#{pg.committype},timetype=#{pg.timetype},year=#{pg.year}
42
+        UPDATE t_paper SET paperstate=#{pg.paperstate},hashb=#{pg.hashb},committype=#{pg.committype},timetype=#{pg.timetype}
43 43
         <if test="ctypecount==0">,checktype=4</if>
44 44
         WHERE paperid= #{pg.paperid}
45 45
     </update>

Loading…
Cancel
Save