Browse Source

Merge remote-tracking branch 'origin/wn' into ywx

tags/正式3.11.0
雍文秀 1 year ago
parent
commit
1c915601f0

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

54
     @PostMapping("/list_qt")
54
     @PostMapping("/list_qt")
55
     public ResultVo listQuickTeacher(@RequestBody EBase subject) {
55
     public ResultVo listQuickTeacher(@RequestBody EBase subject) {
56
         String username = subject.getCreatename();
56
         String username = subject.getCreatename();
57
-        Integer schoolid = subject.getSchoolid();
58
-        N_Utils.validation(new Object[]{username, "姓名", 2, schoolid, "学校id", 1});
59
-        Map list = eSubjectSearchService.listQuickTeacher(username, schoolid);
57
+        Integer examid = subject.getExamid();
58
+        N_Utils.validation(new Object[]{username, "姓名", 2, examid, "考试id", 1});
59
+        Map list = eSubjectSearchService.listQuickTeacher(username, examid);
60
         return new ResultVo(0, "获取成功", list);
60
         return new ResultVo(0, "获取成功", list);
61
     }
61
     }
62
 
62
 

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

31
     List<CTeacherVo> listTeacherBySchoolId(@Param("schoolid") Integer schoolid);
31
     List<CTeacherVo> listTeacherBySchoolId(@Param("schoolid") Integer schoolid);
32
 
32
 
33
     //学校教师查找
33
     //学校教师查找
34
-    List<Map> listSearchTeacher(@Param("usernames") String[] usernames, @Param("schoolid") Integer schoolid);
34
+    List<Map> listSearchTeacher(@Param("usernames") String[] usernames, @Param("examid") Integer examid);
35
 
35
 
36
     //按班设置教师列表
36
     //按班设置教师列表
37
     List<Map> listClassTeacher(@Param("classids") String classids, @Param("subjectid") String subjectid);
37
     List<Map> listClassTeacher(@Param("classids") String classids, @Param("subjectid") String subjectid);

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

85
             }
85
             }
86
             //关闭引用检测,避免循环给classes赋值出现"$ref":"$[0]"现象
86
             //关闭引用检测,避免循环给classes赋值出现"$ref":"$[0]"现象
87
             String str = JSON.toJSONString(schoolClasses, SerializerFeature.DisableCircularReferenceDetect);
87
             String str = JSON.toJSONString(schoolClasses, SerializerFeature.DisableCircularReferenceDetect);
88
-            s.put("classes", JSON.parseArray(str, Map.class));
88
+            s.put("schools", JSON.parseArray(str, Map.class));
89
         }
89
         }
90
         map.put("subjects", subjects);
90
         map.put("subjects", subjects);
91
         return map;
91
         return map;

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

59
     }
59
     }
60
 
60
 
61
     // 快捷设置
61
     // 快捷设置
62
-    public Map listQuickTeacher(String username, Integer schoolid) {
62
+    public Map listQuickTeacher(String username, Integer examid) {
63
         Map map = new HashMap();
63
         Map map = new HashMap();
64
         String[] usernames = username.split(",");
64
         String[] usernames = username.split(",");
65
-        List<Map> teachers = eClassMapper.listSearchTeacher(usernames, schoolid);
65
+        List<Map> teachers = eClassMapper.listSearchTeacher(usernames, examid);
66
         Map<String, Object> nameMap = teachers.stream().map(t -> t.get("username").toString()).distinct().collect(Collectors.toMap(t -> t, t -> t));
66
         Map<String, Object> nameMap = teachers.stream().map(t -> t.get("username").toString()).distinct().collect(Collectors.toMap(t -> t, t -> t));
67
         StringBuilder sb = new StringBuilder();
67
         StringBuilder sb = new StringBuilder();
68
         for (String name : usernames) {
68
         for (String name : usernames) {

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

13
     <!--考试列表-->
13
     <!--考试列表-->
14
     <select id="listAll" resultType="java.util.Map">
14
     <select id="listAll" resultType="java.util.Map">
15
         select b.examid,b.examname,b.examdate,b.gradeid,b.examtype,b.exammode,b.monitored,b.teashowrank,b.stushowrank
15
         select b.examid,b.examname,b.examdate,b.gradeid,b.examtype,b.exammode,b.monitored,b.teashowrank,b.stushowrank
16
-        ,b.examstate,u.username createname,group_concat(distinct es.subjectname order by es.esid separator '|')subjectname
16
+        ,b.examstate,u.username createname,b.hashb,group_concat(distinct es.subjectname order by es.esid separator '|')subjectname
17
         ,count(distinct case when es.begintime is null or es.begintime='' then es.esid else null end)esnum
17
         ,count(distinct case when es.begintime is null or es.begintime='' then es.esid else null end)esnum
18
         ,min(es.esstate)esstate,min(es.pstate)pstate,min(ifnull(ep.correcttype,0))correcttype
18
         ,min(es.esstate)esstate,min(es.pstate)pstate,min(ifnull(ep.correcttype,0))correcttype
19
         ,(case when b.exammode=1 then (count(distinct es.esid)-count(distinct ei.esid))
19
         ,(case when b.exammode=1 then (count(distinct es.esid)-count(distinct ei.esid))

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

45
     <!--学校教师查找-->
45
     <!--学校教师查找-->
46
     <select id="listSearchTeacher" resultType="java.util.Map">
46
     <select id="listSearchTeacher" resultType="java.util.Map">
47
         select u.userid teacherid,u.username,u.loginname,u.usersex
47
         select u.userid teacherid,u.username,u.loginname,u.usersex
48
-        from t_user u
49
-        where u.schoolid=#{schoolid} and u.usertype=1 and u.userstate=1 and u.username in
48
+        from t_user u left join e_class s on u.schoolid=s.schoolid
49
+        where s.examid=#{examid} and u.usertype=1 and u.userstate=1 and u.username in
50
         <foreach collection="usernames" item="username" open="(" separator="," close=")">
50
         <foreach collection="usernames" item="username" open="(" separator="," close=")">
51
             #{username}
51
             #{username}
52
         </foreach>
52
         </foreach>

Loading…
Cancel
Save