Kaynağa Gözat

优化报告看自己学校班级的

tags/正式3.11.0
王宁 1 yıl önce
ebeveyn
işleme
cf9346de4b

+ 4
- 0
sexam/src/main/java/com/xhkjedu/sexam/controller/report/EReportClassController.java Dosyayı Görüntüle

@@ -359,6 +359,8 @@ public class EReportClassController {
359 359
         N_Utils.validation(new Object[]{userid, "用户id", 1
360 360
                 , page, "显示页码", 1, pageSize, "显示条数", 1});
361 361
         PageHelper.startPage(page, pageSize);
362
+        Integer schoolid = eReportClassService.getSchoolidByUserid(paramsVo.getUserid());
363
+        paramsVo.setSchoolid(schoolid);
362 364
         List<Map> list = eReportClassService.listEndExamsForClassTeacher(paramsVo);
363 365
         PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
364 366
         return new ResultVo(0, "获取成功", pageResult);
@@ -455,6 +457,8 @@ public class EReportClassController {
455 457
         N_Utils.validation(new Object[]{userid, "用户id", 1
456 458
                 , page, "显示页码", 1, pageSize, "显示条数", 1});
457 459
         PageHelper.startPage(page, pageSize);
460
+        Integer schoolid = eReportClassService.getSchoolidByUserid(paramsVo.getUserid());
461
+        paramsVo.setSchoolid(schoolid);
458 462
         List<Map> list = eReportClassService.listEndExamsForClass(paramsVo);
459 463
         PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
460 464
         return new ResultVo(0, "获取成功", pageResult);

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/system/UserMapper.java Dosyayı Görüntüle

@@ -33,4 +33,7 @@ public interface UserMapper {
33 33
 
34 34
     //根据用户ids查找用户
35 35
     List<Map> listByUserIds(@Param("userids") String userids);
36
+
37
+    //根据用户id获取用户所属学校id
38
+    Integer getSchoolidByUserid(@Param("userid")Integer userid);
36 39
 }

+ 8
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportClassService.java Dosyayı Görüntüle

@@ -9,6 +9,7 @@ import com.xhkjedu.sexam.mapper.reportclass.ERclassMapper;
9 9
 import com.xhkjedu.sexam.mapper.reportclass.ERclassRankMapper;
10 10
 import com.xhkjedu.sexam.mapper.reportclass.EReportClassMapper;
11 11
 import com.xhkjedu.sexam.mapper.reportstu.ERstudentMapper;
12
+import com.xhkjedu.sexam.mapper.system.UserMapper;
12 13
 import com.xhkjedu.sexam.model.exam.EBase;
13 14
 import com.xhkjedu.sexam.model.reportstu.ERstudent;
14 15
 import com.xhkjedu.sexam.model.reportstu.ERstudentAction;
@@ -50,6 +51,8 @@ public class EReportClassService {
50 51
     private EBaseMapper eBaseMapper;
51 52
     @Resource
52 53
     private ERbaseMapper eRbaseMapper;
54
+    @Resource
55
+    private UserMapper userMapper;
53 56
 
54 57
     //考试概况-学科成绩
55 58
     public List<Map> listXkCj(Integer examid, Integer classid) {
@@ -467,4 +470,9 @@ public class EReportClassService {
467 470
     public Map getReportDkClass(Integer examid, Integer classid, String subjectid) {
468 471
         return eReportClassMapper.getReportDkClass(examid, classid, subjectid);
469 472
     }
473
+
474
+    //获取教师学校id
475
+    public Integer getSchoolidByUserid(Integer userid){
476
+        return userMapper.getSchoolidByUserid(userid);
477
+    }
470 478
 }

+ 2
- 1
sexam/src/main/resources/mapper/report/EReportClassMapper.xml Dosyayı Görüntüle

@@ -153,6 +153,7 @@
153 153
         left join e_class c on e.examid=c.examid
154 154
         left join t_class_teacher ct on c.classid=ct.classid
155 155
         where e.examstate=3 and e.deleted=1 and tp.teacherid=#{paramsVo.userid} and ct.teacherid=#{paramsVo.userid}
156
+          and c.schoolid=#{paramsVo.schoolid}
156 157
         <if test="paramsVo.begindate!=null and paramsVo.begindate!=''">
157 158
             and e.examdate between #{paramsVo.begindate} and #{paramsVo.enddate}
158 159
         </if>
@@ -195,7 +196,7 @@
195 196
         select e.examid,e.examname,e.examdate,e.gradeid,e.examtype,e.exammode,e.monitored
196 197
         from e_base e left join e_class c on e.examid=c.examid
197 198
         left join t_class_teacher ct on c.classid=ct.classid
198
-        where e.examstate=3 and e.deleted=1 and ct.teacherid=#{paramsVo.userid}
199
+        where e.examstate=3 and e.deleted=1 and ct.teacherid=#{paramsVo.userid} and c.schoolid=#{paramsVo.schoolid}
199 200
         <if test="paramsVo.begindate!=null and paramsVo.begindate!=''">
200 201
             and e.examdate between #{paramsVo.begindate} and #{paramsVo.enddate}
201 202
         </if>

+ 5
- 0
sexam/src/main/resources/mapper/system/UserMapper.xml Dosyayı Görüntüle

@@ -64,4 +64,9 @@
64 64
         from t_user u where u.userid in(${userids})
65 65
         order by convert(u.username using gbk),u.userid
66 66
     </select>
67
+
68
+    <!--根据用户id获取用户所属学校id-->
69
+    <select id="getSchoolidByUserid" resultType="java.lang.Integer">
70
+        select schoolid from t_user where userid=#{userid}
71
+    </select>
67 72
 </mapper>

Loading…
İptal
Kaydet