Browse Source

考试管理集团校相关内容处理

tags/正式3.11.0
王宁 1 year ago
parent
commit
ad228d6616
21 changed files with 192 additions and 24 deletions
  1. 19
    3
      sexam/src/main/java/com/xhkjedu/sexam/controller/exam/EBaseController.java
  2. 7
    8
      sexam/src/main/java/com/xhkjedu/sexam/controller/paper/EPaperCorrectclassController.java
  3. 3
    0
      sexam/src/main/java/com/xhkjedu/sexam/mapper/exam/EBaseMapper.java
  4. 6
    0
      sexam/src/main/java/com/xhkjedu/sexam/mapper/exam/EClassMapper.java
  5. 3
    0
      sexam/src/main/java/com/xhkjedu/sexam/mapper/paper/EPaperMapper.java
  6. 1
    1
      sexam/src/main/java/com/xhkjedu/sexam/mapper/paperstudent/EPaperStudentMapper.java
  7. 3
    0
      sexam/src/main/java/com/xhkjedu/sexam/model/exam/EClass.java
  8. 3
    0
      sexam/src/main/java/com/xhkjedu/sexam/model/exam/EClassStudent.java
  9. 20
    4
      sexam/src/main/java/com/xhkjedu/sexam/service/exam/EBaseService.java
  10. 14
    4
      sexam/src/main/java/com/xhkjedu/sexam/service/exam/ESubjectInvigilateService.java
  11. 18
    0
      sexam/src/main/java/com/xhkjedu/sexam/service/paper/EPaperCorrectclassService.java
  12. 2
    0
      sexam/src/main/java/com/xhkjedu/sexam/vo/paper/EPaperVo.java
  13. 6
    1
      sexam/src/main/resources/mapper/exam/EBaseMapper.xml
  14. 25
    1
      sexam/src/main/resources/mapper/exam/EClassMapper.xml
  15. 2
    1
      sexam/src/main/resources/mapper/exam/EClassStudentMapper.xml
  16. 6
    0
      sexam/src/main/resources/mapper/paper/EPaperMapper.xml
  17. 1
    1
      sexam/src/main/resources/mapper/paperstudent/EPaperStudentMapper.xml
  18. 15
    0
      suser/src/main/java/com/xhkjedu/suser/controller/gradeclass/ClassController.java
  19. 3
    0
      suser/src/main/java/com/xhkjedu/suser/mapper/gradeclass/ClassMapper.java
  20. 11
    0
      suser/src/main/java/com/xhkjedu/suser/service/gradeclass/ClassService.java
  21. 24
    0
      suser/src/main/resources/mapper/gradeclass/ClassMapper.xml

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

314
     @PostMapping("/list_stu")
314
     @PostMapping("/list_stu")
315
     public ResultVo listStu(@RequestBody EClassStudent cs) {
315
     public ResultVo listStu(@RequestBody EClassStudent cs) {
316
         Integer examid = cs.getExamid();
316
         Integer examid = cs.getExamid();
317
+        Integer schoolid = cs.getSchoolid();
317
         Integer page = cs.getPage();
318
         Integer page = cs.getPage();
318
         Integer pageSize = cs.getPageSize();
319
         Integer pageSize = cs.getPageSize();
319
-        N_Utils.validation(new Object[]{examid, "考试id", 1});
320
+        N_Utils.validation(new Object[]{examid, "考试id", 1,schoolid,"学校id",1});
320
         if (N_Utils.isEmptyInteger(page)) {
321
         if (N_Utils.isEmptyInteger(page)) {
321
             List<Map> list = eBaseService.listStu(cs);
322
             List<Map> list = eBaseService.listStu(cs);
322
             return new ResultVo(0, "获取考试学生成功", list);
323
             return new ResultVo(0, "获取考试学生成功", list);
510
     @PostMapping("/list_qkd")
511
     @PostMapping("/list_qkd")
511
     public ResultVo listQkDetail(@RequestBody EPaperVo vo) {
512
     public ResultVo listQkDetail(@RequestBody EPaperVo vo) {
512
         Integer epid = vo.getEpid();
513
         Integer epid = vo.getEpid();
513
-        N_Utils.validation(new Object[]{epid, "试卷id", 1});
514
-        List<Map> list = eBaseService.listQkDetail(epid);
514
+        Integer schoolid = vo.getSchoolid();
515
+        N_Utils.validation(new Object[]{epid, "试卷id", 1,schoolid,"学校id",1});
516
+        List<Map> list = eBaseService.listQkDetail(epid,schoolid);
515
         return new ResultVo(0, "获取缺考详情成功", list);
517
         return new ResultVo(0, "获取缺考详情成功", list);
516
     }
518
     }
517
 
519
 
529
         return new ResultVo(0, "设置成功");
531
         return new ResultVo(0, "设置成功");
530
     }
532
     }
531
 
533
 
534
+    /*
535
+     * @Description 获取考试关联学校
536
+     * @Date 2023/8/29 14:17:16
537
+     * @Author WN
538
+     * @Param [eBase]
539
+     * @Return com.xhkjedu.vo.ResultVo
540
+     **/
541
+    @PostMapping("/list_school")
542
+    public ResultVo listExamSchool(@RequestBody EBase eBase) {
543
+        N_Utils.validation(new Object[]{eBase.getExamid(), "考试id", 1});
544
+        List<Map> list = eBaseService.listSchoolsByExamid(eBase.getExamid());
545
+        return new ResultVo(0, "获取考试关联学校成功",list);
546
+    }
547
+
532
     /*
548
     /*
533
      * 处理班级试题作答详情和满分
549
      * 处理班级试题作答详情和满分
534
      * @Param []
550
      * @Param []

+ 7
- 8
sexam/src/main/java/com/xhkjedu/sexam/controller/paper/EPaperCorrectclassController.java View File

87
         return new ResultVo(0, "设置成功");
87
         return new ResultVo(0, "设置成功");
88
     }
88
     }
89
 
89
 
90
-    /**
91
-     * 查看批阅人
92
-     *
93
-     * @return com.xhkjedu.vo.ResultVo
90
+    /*
91
+     * @Description 批阅人--学校班级批阅人(兼容集团校)
92
+     * @Date 2023/8/29 15:32:44
93
+     * @Author WN
94
      * @Param [vo]
94
      * @Param [vo]
95
-     * @Author ywx
96
-     * @Date 2022/7/20 11:02
95
+     * @Return com.xhkjedu.vo.ResultVo
97
      **/
96
      **/
98
     @PostMapping("/detail")
97
     @PostMapping("/detail")
99
-    public ResultVo detail(@RequestBody EPClassVo vo) {
98
+    public ResultVo listSchoolClassCorrect(@RequestBody EPClassVo vo) {
100
         Integer epid = vo.getEpid();
99
         Integer epid = vo.getEpid();
101
         N_Utils.validation(new Object[]{epid, "试卷id", 1});
100
         N_Utils.validation(new Object[]{epid, "试卷id", 1});
102
-        List<Map> list = ePaperCorrectclassService.listByEpId(epid);
101
+        List<Map> list = ePaperCorrectclassService.listClassCorrectByEpId(epid);
103
         return new ResultVo(0, "获取成功", list);
102
         return new ResultVo(0, "获取成功", list);
104
     }
103
     }
105
 
104
 

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/exam/EBaseMapper.java View File

75
 
75
 
76
     //获取学校当前年份
76
     //获取学校当前年份
77
     Integer getYearBySchoolid(@Param("schoolid") Integer schoolid);
77
     Integer getYearBySchoolid(@Param("schoolid") Integer schoolid);
78
+
79
+    //获取考试学校id
80
+    Integer getSchoolidByExamid(@Param("examid") Integer examid);
78
 }
81
 }

+ 6
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/exam/EClassMapper.java View File

47
 
47
 
48
     //批量更新班级pdf报告地址
48
     //批量更新班级pdf报告地址
49
     void updateBatchReportpath(@Param("list")List<EClass> list);
49
     void updateBatchReportpath(@Param("list")List<EClass> list);
50
+
51
+    //获取考试关联的学校信息
52
+    List<Map> listSchoolsByExamid(@Param("schoolid") Integer schoolid, @Param("examid") Integer examid);
53
+
54
+    //获取考试关联的学校班级信息
55
+    List<Map> listSchoolClassByExamid(@Param("schoolid") Integer schoolid, @Param("examid") Integer examid);
50
 }
56
 }

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/paper/EPaperMapper.java View File

71
 
71
 
72
     //根据试卷id获取考试状态
72
     //根据试卷id获取考试状态
73
     Integer getExamStateByEpId(@Param("epid") Integer epid);
73
     Integer getExamStateByEpId(@Param("epid") Integer epid);
74
+
75
+    //获取试卷关联考试及发起学校id
76
+    Map getExamSchoolidByEpId(@Param("epid") Integer epid);
74
 }
77
 }

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/mapper/paperstudent/EPaperStudentMapper.java View File

104
     Map getExamStateSubjectStateByEpsid(@Param("epsid") Integer epsid);
104
     Map getExamStateSubjectStateByEpsid(@Param("epsid") Integer epsid);
105
 
105
 
106
     //缺考详情
106
     //缺考详情
107
-    List<Map> listQkDetail(@Param("epid") Integer epid);
107
+    List<Map> listQkDetail(@Param("epid") Integer epid,@Param("schoolid") Integer schoolid);
108
 
108
 
109
     //当天进行中考试列表
109
     //当天进行中考试列表
110
     List<Map> listExam(@Param("strtime") String strtime);
110
     List<Map> listExam(@Param("strtime") String strtime);

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

30
 
30
 
31
     //班级学生报告地址
31
     //班级学生报告地址
32
     private String reportstu;
32
     private String reportstu;
33
+
34
+    //学校id
35
+    private Integer schoolid;
33
 }
36
 }

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

32
 
32
 
33
     @Transient
33
     @Transient
34
     private String examno;//考号
34
     private String examno;//考号
35
+
36
+    @Transient
37
+    private Integer schoolid;//学校id
35
 }
38
 }

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

97
         if(model.getExammode() == 2) {//线下考试必须有考号
97
         if(model.getExammode() == 2) {//线下考试必须有考号
98
             Integer num = eClassStudentMapper.getNoExamNoNumByClassIds(classids);//根据班级ids获取没有考号学生数量
98
             Integer num = eClassStudentMapper.getNoExamNoNumByClassIds(classids);//根据班级ids获取没有考号学生数量
99
             if (num != 0) return new ResultVo(1, "有学生未设置考号,请先设置");
99
             if (num != 0) return new ResultVo(1, "有学生未设置考号,请先设置");
100
+            //验证选择学校的准考证号是否一致
100
         }
101
         }
101
         List<EClassStudent> students = eClassStudentMapper.listByClassIds(classids);
102
         List<EClassStudent> students = eClassStudentMapper.listByClassIds(classids);
102
         int stuNum = students.stream().distinct().collect(Collectors.toList()).size();
103
         int stuNum = students.stream().distinct().collect(Collectors.toList()).size();
355
     //获取考试和班级信息
356
     //获取考试和班级信息
356
     public Map getExamAndClass(Integer examid) {
357
     public Map getExamAndClass(Integer examid) {
357
         Map map = eBaseMapper.findById2(examid);
358
         Map map = eBaseMapper.findById2(examid);
358
-        List<Map> classes = eClassMapper.listByExamId(examid);
359
-        map.put("classes", classes);
359
+        Integer schoolid = Integer.parseInt(map.get("schoolid").toString());
360
+        List<Map> schools = eClassMapper.listSchoolClassByExamid(schoolid,examid);
361
+        map.put("schools", schools);
360
         return map;
362
         return map;
361
     }
363
     }
362
 
364
 
509
     }
511
     }
510
 
512
 
511
     //缺考详情
513
     //缺考详情
512
-    public List<Map> listQkDetail(Integer epid) {
513
-        List<Map> list = ePaperStudentMapper.listQkDetail(epid);
514
+    public List<Map> listQkDetail(Integer epid,Integer schoolid) {
515
+        List<Map> list = ePaperStudentMapper.listQkDetail(epid,schoolid);
514
         for (Map c : list) {
516
         for (Map c : list) {
515
             List<Map> students=new ArrayList<>();
517
             List<Map> students=new ArrayList<>();
516
             String userids = c.get("userids").toString();
518
             String userids = c.get("userids").toString();
541
     public Integer getReportState(Integer examid) {
543
     public Integer getReportState(Integer examid) {
542
         return eBaseMapper.getReportState(examid);
544
         return eBaseMapper.getReportState(examid);
543
     }
545
     }
546
+
547
+
548
+    /*
549
+     * @Description 获取考试关联学校
550
+     * @Date 2023/8/29 14:17:29
551
+     * @Author WN
552
+     * @Param [examid]
553
+     * @Return java.util.List<java.util.Map>
554
+     **/
555
+    public List<Map> listSchoolsByExamid(Integer examid) {
556
+        //获取考试信息
557
+        Integer schoolid = eBaseMapper.getSchoolidByExamid(examid);
558
+        return eClassMapper.listSchoolsByExamid(schoolid,examid);
559
+    }
544
 }
560
 }

+ 14
- 4
sexam/src/main/java/com/xhkjedu/sexam/service/exam/ESubjectInvigilateService.java View File

90
         return map;
90
         return map;
91
     }
91
     }
92
 
92
 
93
-    //监考人查看
93
+    /*
94
+     * @Description 监考查看
95
+     * @Date 2023/8/29 15:54:57
96
+     * @Author WN
97
+     * @Param [esid 考试科目id]
98
+     * @Return java.util.Map
99
+     **/
94
     public Map listByEsId(Integer esid) {
100
     public Map listByEsId(Integer esid) {
101
+        //获取考试科目关联考试id
102
+        Map examMap = eSubjectMapper.getESubjectByEsId(esid);
103
+        Integer examId = Integer.parseInt(examMap.get("examid").toString());
104
+        Integer schoolId = Integer.parseInt(examMap.get("schoolId").toString());
95
         Map map = new HashMap();
105
         Map map = new HashMap();
96
-        Integer examId = eSubjectMapper.getExamIdByEsId(esid);//根据考试科目id获取考试id
97
-        List<Map> list = eClassMapper.listByExamId(examId);//考试班级
106
+        List<Map> list = eClassMapper.listSchoolClassByExamid(schoolId,examId);//考试班级
98
         List<Map> users = eSubjectInvigilateMapper.listByEsId(esid);//考试监考人
107
         List<Map> users = eSubjectInvigilateMapper.listByEsId(esid);//考试监考人
99
-        map.put("classes", list);
108
+        map.put("schools", list);
100
         map.put("teachers", users);
109
         map.put("teachers", users);
101
         return map;
110
         return map;
102
     }
111
     }
103
 
112
 
113
+
104
     //监考人删除
114
     //监考人删除
105
     public void delByEsId(Integer esid) {
115
     public void delByEsId(Integer esid) {
106
         eSubjectInvigilateMapper.delByEsId(esid);//删除考试科目监考教师
116
         eSubjectInvigilateMapper.delByEsId(esid);//删除考试科目监考教师

+ 18
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/paper/EPaperCorrectclassService.java View File

54
         return list;
54
         return list;
55
     }
55
     }
56
 
56
 
57
+    //查看批阅人--学校班级
58
+    public List<Map> listClassCorrectByEpId(Integer epid) {
59
+        Map examinfo = ePaperMapper.getExamSchoolidByEpId(epid);
60
+        Integer examId = Integer.parseInt(examinfo.get("examid").toString());
61
+        Integer schoolId = Integer.parseInt(examinfo.get("schoolid").toString());
62
+
63
+        List<Map> list = eClassMapper.listSchoolClassByExamid(schoolId,examId);//考试班级
64
+        List<Map> users = ePaperCorrectclassMapper.listByEpId(epid);//试卷批阅人
65
+        for (Map map : list) {
66
+            List<Map> classes = (List<Map>) map.get("classes");
67
+            for(Map classMap : classes){
68
+                List<Map> teachers = users.stream().filter(u -> u.get("classid").equals(map.get("classid"))).collect(Collectors.toList());
69
+                classMap.put("teachers", teachers);
70
+            }
71
+        }
72
+        return list;
73
+    }
74
+
57
     //根据试卷id获取考试科目基本信息
75
     //根据试卷id获取考试科目基本信息
58
     public Map getESubjectByEpId(Integer epid) {
76
     public Map getESubjectByEpId(Integer epid) {
59
         return ePaperMapper.getESubjectByEpId(epid);
77
         return ePaperMapper.getESubjectByEpId(epid);

+ 2
- 0
sexam/src/main/java/com/xhkjedu/sexam/vo/paper/EPaperVo.java View File

24
     private List<Map> teachers;//阅卷教师
24
     private List<Map> teachers;//阅卷教师
25
     private Integer correcttype;//批阅类型
25
     private Integer correcttype;//批阅类型
26
     private String correctJson;//阅卷json
26
     private String correctJson;//阅卷json
27
+
28
+    private Integer schoolid;//学校id
27
 }
29
 }

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

67
     </select>
67
     </select>
68
     <!--考试基本信息(带考试人数)-->
68
     <!--考试基本信息(带考试人数)-->
69
     <select id="findById2" resultType="java.util.Map">
69
     <select id="findById2" resultType="java.util.Map">
70
-        select b.examid,b.examname,b.examdate,b.examtype,b.gradeid,b.exammode,b.monitored,b.examstate,b.examcomm
70
+        select b.examid,b.examname,b.examdate,b.examtype,b.gradeid,b.exammode,b.monitored,b.examstate,b.examcomm,b.schoolid
71
         ,teashowrank,stushowrank
71
         ,teashowrank,stushowrank
72
         ,(select sum(c.classnum) from e_class c where c.examid=b.examid)examnum
72
         ,(select sum(c.classnum) from e_class c where c.examid=b.examid)examnum
73
         from e_base b where b.examid=#{examid}
73
         from e_base b where b.examid=#{examid}
150
     <select id="getYearBySchoolid" resultType="java.lang.Integer">
150
     <select id="getYearBySchoolid" resultType="java.lang.Integer">
151
         select `year` from t_school where schoolid=#{schoolid}
151
         select `year` from t_school where schoolid=#{schoolid}
152
     </select>
152
     </select>
153
+
154
+    <!--获得发起考试学校id-->
155
+    <select id="getSchoolidByExamid" resultType="java.lang.Integer">
156
+        select schoolid from e_base where examid=#{examid}
157
+    </select>
153
 </mapper>
158
 </mapper>

+ 25
- 1
sexam/src/main/resources/mapper/exam/EClassMapper.xml View File

3
 <mapper namespace="com.xhkjedu.sexam.mapper.exam.EClassMapper">
3
 <mapper namespace="com.xhkjedu.sexam.mapper.exam.EClassMapper">
4
     <!--获取班级基本信息列表-->
4
     <!--获取班级基本信息列表-->
5
     <select id="listByClassIds" resultType="com.xhkjedu.sexam.model.exam.EClass">
5
     <select id="listByClassIds" resultType="com.xhkjedu.sexam.model.exam.EClass">
6
-        select classid,classname,classnum from t_class
6
+        select classid,classname,classnum,schoolid from t_class
7
         where classid in
7
         where classid in
8
         <foreach collection="classids" item="classid" index="index" open="(" separator="," close=")">
8
         <foreach collection="classids" item="classid" index="index" open="(" separator="," close=")">
9
             ${classid}
9
             ${classid}
139
             classid=#{item.classid} and examid=#{item.examid}
139
             classid=#{item.classid} and examid=#{item.examid}
140
         </foreach>
140
         </foreach>
141
     </update>
141
     </update>
142
+
143
+    <!--获取考试管理的学校信息-->
144
+    <select id="listSchoolsByExamid" resultType="java.util.Map">
145
+        select c.schoolid,s.schoolname from e_class c
146
+        left join t_school s on c.schoolid=s.schoolid
147
+        where c.examid=#{examid} group by s.schoolid order by #{schoolid},c.schoolid
148
+    </select>
149
+
150
+    <resultMap id="schoolClass" type="java.util.Map">
151
+        <result property="schoolid" column="schoolid" />
152
+        <result property="schoolname" column="schoolname" />
153
+        <collection property="classes" ofType="java.util.Map" javaType="java.util.List" >
154
+            <result property="classid" column="classid" />
155
+            <result property="classname" column="classname" />
156
+            <result property="classnum" column="classnum" />
157
+        </collection>
158
+    </resultMap>
159
+    <!--考试关联学校班级-->
160
+    <select id="listSchoolClassByExamid" resultMap="schoolClass">
161
+        select c.schoolid,s.schoolname,ts.classid,ts.classname,c.classnum from e_class c
162
+        left join t_school s on c.schoolid=s.schoolid
163
+        left join t_class ts on c.classid=ts.classid
164
+        where c.examid=#{examid} order by #{schoolid},c.schoolid,ts.classorder
165
+    </select>
142
 </mapper>
166
 </mapper>

+ 2
- 1
sexam/src/main/resources/mapper/exam/EClassStudentMapper.xml View File

13
     <select id="listByExamId" resultType="java.util.Map">
13
     <select id="listByExamId" resultType="java.util.Map">
14
         select es.ecsid,es.classid,u.username,u.studentno,u.usersex
14
         select es.ecsid,es.classid,u.username,u.studentno,u.usersex
15
         from e_class_student es left join t_user u on es.studentid = u.userid
15
         from e_class_student es left join t_user u on es.studentid = u.userid
16
-        where es.examid=#{cs.examid}
16
+        left join e_class ec on es.classid=ec.classid and es.examid=ec.examid
17
+        where es.examid=#{cs.examid} and ec.schoolid=#{cs.schoolid}
17
         <if test="cs.classid!=null and cs.classid!=0">
18
         <if test="cs.classid!=null and cs.classid!=0">
18
             and es.classid=#{cs.classid}
19
             and es.classid=#{cs.classid}
19
         </if>
20
         </if>

+ 6
- 0
sexam/src/main/resources/mapper/paper/EPaperMapper.xml View File

143
     <select id="getExamStateByEpId" resultType="java.lang.Integer">
143
     <select id="getExamStateByEpId" resultType="java.lang.Integer">
144
         select eb.examstate from e_paper ep left join e_base eb on ep.examid = eb.examid where ep.epid=#{epid}
144
         select eb.examstate from e_paper ep left join e_base eb on ep.examid = eb.examid where ep.epid=#{epid}
145
     </select>
145
     </select>
146
+
147
+    <!--获取试卷关联考试及发起学校id-->
148
+    <select id="getExamSchoolidByEpId" resultType="java.util.Map">
149
+        select p.examid,e.schoolid from e_paper p
150
+        left join e_base e on p.examid=e.examid where p.epid=#{epid} limit 1
151
+    </select>
146
 </mapper>
152
 </mapper>

+ 1
- 1
sexam/src/main/resources/mapper/paperstudent/EPaperStudentMapper.xml View File

362
         ,truncate(count(distinct case when eps.sstate=3 then eps.epsid else null end)*100/count(*),2)qkrate
362
         ,truncate(count(distinct case when eps.sstate=3 then eps.epsid else null end)*100/count(*),2)qkrate
363
         from e_paper_student eps left join e_class ec on eps.examid=ec.examid and eps.classid=ec.classid
363
         from e_paper_student eps left join e_class ec on eps.examid=ec.examid and eps.classid=ec.classid
364
         left join t_class c on ec.classid=c.classid
364
         left join t_class c on ec.classid=c.classid
365
-        where eps.epid=#{epid} group by eps.classid order by c.classtype,c.classorder,ec.ecid
365
+        where eps.epid=#{epid} and ec.schoolid=#{schoolid} group by eps.classid order by c.classtype,c.classorder,ec.ecid
366
     </select>
366
     </select>
367
     <!--当天进行中考试列表-->
367
     <!--当天进行中考试列表-->
368
     <select id="listExam" resultType="java.util.Map">
368
     <select id="listExam" resultType="java.util.Map">

+ 15
- 0
suser/src/main/java/com/xhkjedu/suser/controller/gradeclass/ClassController.java View File

85
         List<Map> list = classService.listTeacherSubject(classid);
85
         List<Map> list = classService.listTeacherSubject(classid);
86
         return new ResultVo(0, "获取任教老师科目列表成功", list);
86
         return new ResultVo(0, "获取任教老师科目列表成功", list);
87
     }
87
     }
88
+
89
+    /*
90
+     * @Description 伙伴学校班级
91
+     * @Date 2023/8/29 10:55:01
92
+     * @Author WN
93
+     * @Param [tClass]
94
+     * @Return com.xhkjedu.vo.ResultVo
95
+     **/
96
+    @PostMapping("/list_classjtc")
97
+    public ResultVo listSchoolAndClass(@RequestBody TClass tClass) {
98
+        Integer schoolid = tClass.getSchoolid();
99
+        N_Utils.validation(new Object[]{schoolid, "学校id", 1});
100
+        List<Map> list = classService.listSchoolAndClass(schoolid);
101
+        return new ResultVo(0, "获取伙伴学校班级成功", list);
102
+    }
88
 }
103
 }

+ 3
- 0
suser/src/main/java/com/xhkjedu/suser/mapper/gradeclass/ClassMapper.java View File

41
 
41
 
42
     //获取班级信息
42
     //获取班级信息
43
     List<ClassVo> listByIds(@Param("classids") List<Integer> classids);
43
     List<ClassVo> listByIds(@Param("classids") List<Integer> classids);
44
+
45
+    //获取伙伴学校及伙伴学校班级
46
+    List<Map> listSchoolAndClass(@Param("schoolid")Integer schoolid);
44
 }
47
 }

+ 11
- 0
suser/src/main/java/com/xhkjedu/suser/service/gradeclass/ClassService.java View File

79
     public List<Map> listTeacherSubject(Integer classid){
79
     public List<Map> listTeacherSubject(Integer classid){
80
         return classMapper.listTeacherSubject(classid);
80
         return classMapper.listTeacherSubject(classid);
81
     }
81
     }
82
+
83
+    /*
84
+     * @Description 获取伙伴学校及伙伴学校班级
85
+     * @Date 2023/8/29 10:49:57
86
+     * @Author WN
87
+     * @Param [schoolid]
88
+     * @Return java.util.List<java.util.Map>
89
+     **/
90
+    public List<Map> listSchoolAndClass(Integer schoolid) {
91
+        return classMapper.listSchoolAndClass(schoolid);
92
+    }
82
 }
93
 }

+ 24
- 0
suser/src/main/resources/mapper/gradeclass/ClassMapper.xml View File

97
         </foreach>
97
         </foreach>
98
         group by c.classid
98
         group by c.classid
99
     </select>
99
     </select>
100
+
101
+    <resultMap id="schoolClass" type="java.util.Map">
102
+        <result property="schoolid" column="schoolid"/>
103
+        <result property="schoolname" column="schoolname"/>
104
+        <collection property="classes" ofType="java.util.Map" javaType="java.util.List">
105
+            <result property="schoolid" column="schoolid"/>
106
+            <result property="classid" column="classid"/>
107
+            <result property="classname" column="classname"/>
108
+            <result property="gradeid" column="gradeid"/>
109
+            <result property="classtype" column="classtype"/>
110
+        </collection>
111
+    </resultMap>
112
+    <!--获取伙伴学校及伙伴学校班级-->
113
+    <select id="listSchoolAndClass" resultMap="schoolClass">
114
+        select s.schoolid,s.schoolname
115
+        ,c.classid,c.classname,c.classnum,c.gradeid,c.classtype
116
+        from t_school_friend sf left join t_school s on sf.fschoolid = s.schoolid
117
+        left join t_class c on s.schoolid=c.schoolid
118
+        where sf.schoolid=#{schoolid}
119
+        and c.year=s.year and c.classstate=1 and c.schoolid=s.schoolid
120
+        and c.classtype in(1,2) and c.classnum>0
121
+        group by c.classid
122
+        order by c.schoolid,c.gradeid,c.classtype,c.classorder,c.classid
123
+    </select>
100
 </mapper>
124
 </mapper>

Loading…
Cancel
Save