Browse Source

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

wn
王宁 2 months ago
parent
commit
d66e41576f

+ 0
- 57
smarking/src/main/java/com/xhkjedu/smarking/controller/exam/MsClassController.java View File

@@ -1,57 +0,0 @@
1
-package com.xhkjedu.smarking.controller.exam;
2
-
3
-import com.github.pagehelper.PageHelper;
4
-import com.github.pagehelper.PageInfo;
5
-import com.xhkjedu.smarking.model.exam.MsClass;
6
-import com.xhkjedu.smarking.service.exam.MsClassService;
7
-import com.xhkjedu.utils.N_Utils;
8
-import com.xhkjedu.utils.PageUtil;
9
-import com.xhkjedu.vo.PageResult;
10
-import com.xhkjedu.vo.ResultVo;
11
-import org.springframework.web.bind.annotation.*;
12
-
13
-import javax.annotation.Resource;
14
-import java.util.List;
15
-
16
-/**
17
- * @Description 阅卷考试班级表相关操作
18
- * @Author auto
19
- * @Date 2024-10-15
20
- */
21
-@RestController
22
-@RequestMapping("/msClass")
23
-public class MsClassController {
24
-    @Resource
25
-    private MsClassService msClassService;
26
-
27
-    /**
28
-     * @Description 新增
29
-     * @Param [msClass]
30
-     * @Author auto
31
-     * @Date 2024-10-15
32
-     * @return com.xhkjedu.vo.ResultVo
33
-     **/
34
-    @PostMapping("/save")
35
-    public ResultVo save(@RequestBody MsClass msClass) {
36
-        msClassService.add(msClass);
37
-        return new ResultVo(0, "保存成功!");
38
-    }
39
-
40
-    /**
41
-     * @Description 列表
42
-     * @Param [msClass]
43
-     * @Author auto
44
-     * @Date 2024-10-15
45
-     * @return com.xhkjedu.vo.ResultVo
46
-     **/
47
-    @PostMapping("/list")
48
-    public ResultVo queryList(@RequestBody MsClass msClass) {
49
-        Integer page = msClass.getPage();
50
-        Integer size = msClass.getPageSize();
51
-        N_Utils.validation(new Object[]{page, "显示页码", 1, size, "显示条数", 1});
52
-        PageHelper.startPage(page, size);
53
-        List<MsClass> list = msClassService.queryList(msClass);
54
-        PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
55
-        return new ResultVo(0, "查询成功!", pageResult);
56
-    }
57
-}

+ 15
- 7
smarking/src/main/java/com/xhkjedu/smarking/controller/exam/MsClassStudentController.java View File

@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
12 12
 
13 13
 import javax.annotation.Resource;
14 14
 import java.util.List;
15
+import java.util.Map;
15 16
 
16 17
 /**
17 18
  * @Description 阅卷考试学生表相关操作
@@ -25,11 +26,11 @@ public class MsClassStudentController {
25 26
     private MsClassStudentService msClassStudentService;
26 27
 
27 28
     /**
29
+     * @return com.xhkjedu.vo.ResultVo
28 30
      * @Description 新增
29 31
      * @Param [msClassStudent]
30 32
      * @Author auto
31 33
      * @Date 2024-10-15
32
-     * @return com.xhkjedu.vo.ResultVo
33 34
      **/
34 35
     @PostMapping("/save")
35 36
     public ResultVo save(@RequestBody MsClassStudent msClassStudent) {
@@ -38,20 +39,27 @@ public class MsClassStudentController {
38 39
     }
39 40
 
40 41
     /**
42
+     * @return com.xhkjedu.vo.ResultVo
41 43
      * @Description 列表
42 44
      * @Param [msClassStudent]
43 45
      * @Author auto
44 46
      * @Date 2024-10-15
45
-     * @return com.xhkjedu.vo.ResultVo
46 47
      **/
47 48
     @PostMapping("/list")
48 49
     public ResultVo queryList(@RequestBody MsClassStudent msClassStudent) {
50
+        Integer examid = msClassStudent.getExamid();
51
+        Integer schoolid = msClassStudent.getSchoolid();
49 52
         Integer page = msClassStudent.getPage();
50 53
         Integer size = msClassStudent.getPageSize();
51
-        N_Utils.validation(new Object[]{page, "显示页码", 1, size, "显示条数", 1});
52
-        PageHelper.startPage(page, size);
53
-        List<MsClassStudent> list = msClassStudentService.queryList(msClassStudent);
54
-        PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
55
-        return new ResultVo(0, "查询成功!", pageResult);
54
+        N_Utils.validation(new Object[]{examid, "考试id", 1, schoolid, "学校id", 1});
55
+        if (N_Utils.isEmptyInteger(page)) {
56
+            List<Map> list = msClassStudentService.queryList(msClassStudent);
57
+            return new ResultVo(0, "查询成功!", list);
58
+        } else {
59
+            PageHelper.startPage(page, size);
60
+            List<Map> list = msClassStudentService.queryList(msClassStudent);
61
+            PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
62
+            return new ResultVo(0, "查询成功!", pageResult);
63
+        }
56 64
     }
57 65
 }

+ 0
- 40
smarking/src/main/java/com/xhkjedu/smarking/controller/exam/MsSubjectInvigilateController.java View File

@@ -136,26 +136,6 @@ public class MsSubjectInvigilateController {
136 136
         return new ResultVo(0, "删除成功!");
137 137
     }
138 138
 
139
-    /**
140
-     * @Description 教师监考-监控列表
141
-     * @Date 2024/10/18 16:42
142
-     * @Author YWX
143
-     * @Param [subject]
144
-     * @Return com.xhkjedu.vo.ResultVo
145
-     **/
146
-    @PostMapping("/list_jk")
147
-    public ResultVo listJkSubject(@RequestBody MsSubject subject) {
148
-        Integer teacherid = subject.getTeacherid();
149
-        Integer esstate = subject.getEsstate();
150
-        Integer page = subject.getPage();
151
-        Integer pageSize = subject.getPageSize();
152
-        N_Utils.validation(new Object[]{teacherid, "教师id", 1, page, "页码", 1, pageSize, "显示条数", 1});
153
-        PageHelper.startPage(page, pageSize);
154
-        List<Map> list = msSubjectInvigilateService.listJkSubject(0, teacherid, esstate);
155
-        PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
156
-        return new ResultVo(0, "查询成功!", pageResult);
157
-    }
158
-
159 139
     /**
160 140
      * @Description 教师监考-监控列表(兼容集团校)
161 141
      * @Date 2024/10/18 16:48
@@ -191,26 +171,6 @@ public class MsSubjectInvigilateController {
191 171
         return new ResultVo(0, "查询成功!", msSubjectInvigilateService.getJtJkSubjectNum(teacherid));
192 172
     }
193 173
 
194
-    /**
195
-     * @Description 管理员监考-监控列表
196
-     * @Date 2024/10/18 16:55
197
-     * @Author YWX
198
-     * @Param [subject]
199
-     * @Return com.xhkjedu.vo.ResultVo
200
-     **/
201
-    @PostMapping("/list_ejk")
202
-    public ResultVo listExamJkSubject(@RequestBody MsSubject subject) {
203
-        Integer examid = subject.getExamid();
204
-        Integer esstate = subject.getEsstate();
205
-        Integer page = subject.getPage();
206
-        Integer pageSize = subject.getPageSize();
207
-        N_Utils.validation(new Object[]{examid, "考试id", 1, page, "页码", 1, pageSize, "显示条数", 1});
208
-        PageHelper.startPage(page, pageSize);
209
-        List<Map> list = msSubjectInvigilateService.listJkSubject(examid, 0, esstate);
210
-        PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
211
-        return new ResultVo(0, "查询成功!", pageResult);
212
-    }
213
-
214 174
     /**
215 175
      * @Description 管理员监考-监控列表(兼容集团校)
216 176
      * @Date 2024/10/18 16:56

+ 3
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/exam/MsClassStudentMapper.java View File

@@ -24,4 +24,7 @@ public interface MsClassStudentMapper extends TkMapper<MsClassStudent> {
24 24
 
25 25
     //根据考号搜索参加考试学生
26 26
     List<Map> listStudentByExamIdAnExamno(@Param("examid") Integer examid, @Param("examno") String examno,@Param("subjectid") String subjectid);
27
+
28
+    //考生信息列表
29
+    List<Map> listAll(@Param("cs") MsClassStudent msClassStudent);
27 30
 }

+ 3
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/exam/MsSubjectMapper.java View File

@@ -32,4 +32,7 @@ public interface MsSubjectMapper extends TkMapper<MsSubject> {
32 32
     int updatePtstateByMpid(@Param("mpid")Integer mpid,@Param("ptstate")Integer ptstate);
33 33
     //更改科目试卷题块设置状
34 34
     int updatePbstateByMpid(@Param("mpid")Integer mpid,@Param("pbstate")Integer pbstate);
35
+
36
+    //获取考试下所有科目名称
37
+    List<Map<String,String>> listSubjectNameByExamId(@Param("examid") Integer examid);
35 38
 }

+ 8
- 0
smarking/src/main/java/com/xhkjedu/smarking/model/exam/MsClassStudent.java View File

@@ -28,4 +28,12 @@ public class MsClassStudent extends BaseBean {
28 28
     @Transient
29 29
     //考号
30 30
     private String examno;
31
+
32
+    @Transient
33
+    //学校id
34
+    private Integer schoolid;
35
+
36
+    @Transient
37
+    //学生姓名
38
+    private String studentname;
31 39
 }

+ 0
- 41
smarking/src/main/java/com/xhkjedu/smarking/service/exam/MsClassService.java View File

@@ -1,41 +0,0 @@
1
-package com.xhkjedu.smarking.service.exam;
2
-
3
-import com.xhkjedu.smarking.mapper.exam.MsClassMapper;
4
-import com.xhkjedu.smarking.model.exam.MsClass;
5
-import org.springframework.stereotype.Service;
6
-
7
-import javax.annotation.Resource;
8
-import java.util.List;
9
-
10
-/**
11
- * @Description 阅卷考试班级表 服务实现类
12
- * @Author auto
13
- * @Date 2024-10-15
14
- */
15
-@Service
16
-public class MsClassService {
17
-    @Resource
18
-    private MsClassMapper msClassMapper;
19
-
20
-    /**
21
-     * @Description 新增
22
-     * @Param [msClass]
23
-     * @Author auto
24
-     * @Date 2024-10-15
25
-     * @return void
26
-     **/
27
-    public void add(MsClass msClass){
28
-        msClassMapper.insert(msClass);
29
-    }
30
-
31
-    /**
32
-     * @Description 列表
33
-     * @Param [msClass]
34
-     * @Author auto
35
-     * @Date 2024-10-15
36
-     * @return java.util.List<com.xhkjedu.smarking.model.exam.MsClass>
37
-     **/
38
-    public List<MsClass> queryList(MsClass msClass){
39
-        return msClassMapper.selectAll();
40
-    }
41
-}

+ 18
- 6
smarking/src/main/java/com/xhkjedu/smarking/service/exam/MsClassStudentService.java View File

@@ -1,11 +1,12 @@
1 1
 package com.xhkjedu.smarking.service.exam;
2 2
 
3 3
 import com.xhkjedu.smarking.mapper.exam.MsClassStudentMapper;
4
+import com.xhkjedu.smarking.mapper.exam.MsSubjectMapper;
4 5
 import com.xhkjedu.smarking.model.exam.MsClassStudent;
5 6
 import org.springframework.stereotype.Service;
6 7
 
7 8
 import javax.annotation.Resource;
8
-import java.util.List;
9
+import java.util.*;
9 10
 
10 11
 /**
11 12
  * @Description 阅卷考试学生表 服务实现类
@@ -16,26 +17,37 @@ import java.util.List;
16 17
 public class MsClassStudentService {
17 18
     @Resource
18 19
     private MsClassStudentMapper msClassStudentMapper;
20
+    @Resource
21
+    private MsSubjectMapper msSubjectMapper;
19 22
 
20 23
     /**
24
+     * @return void
21 25
      * @Description 新增
22 26
      * @Param [msClassStudent]
23 27
      * @Author auto
24 28
      * @Date 2024-10-15
25
-     * @return void
26 29
      **/
27
-    public void add(MsClassStudent msClassStudent){
30
+    public void add(MsClassStudent msClassStudent) {
28 31
         msClassStudentMapper.insert(msClassStudent);
29 32
     }
30 33
 
31 34
     /**
35
+     * @return java.util.List<com.xhkjedu.smarking.model.exam.MsClassStudent>
32 36
      * @Description 列表
33 37
      * @Param [msClassStudent]
34 38
      * @Author auto
35 39
      * @Date 2024-10-15
36
-     * @return java.util.List<com.xhkjedu.smarking.model.exam.MsClassStudent>
37 40
      **/
38
-    public List<MsClassStudent> queryList(MsClassStudent msClassStudent){
39
-        return msClassStudentMapper.selectAll();
41
+    public List<Map> queryList(MsClassStudent msClassStudent) {
42
+        List<Map<String, String>> subjects = msSubjectMapper.listSubjectNameByExamId(msClassStudent.getExamid());
43
+        Map<String, String> subjectMap = new HashMap<>();
44
+        for (Map<String, String> subject : subjects) {
45
+            subjectMap.put(subject.get("subjectid"), subject.get("subjectname"));
46
+        }
47
+        List<Map> list = msClassStudentMapper.listAll(msClassStudent);
48
+        for (Map map : list) {
49
+            map.put("subjectname", subjectMap.get(map.get("subjectid")));
50
+        }
51
+        return list;
40 52
     }
41 53
 }

+ 0
- 18
smarking/src/main/java/com/xhkjedu/smarking/service/exam/MsSubjectInvigilateService.java View File

@@ -157,24 +157,6 @@ public class MsSubjectInvigilateService {
157 157
         msSubjectInvigilateMapper.delByMsId(msid);
158 158
     }
159 159
 
160
-    /**
161
-     * @Description 教师监考-监控列表
162
-     * @Date 2024/10/18 16:15
163
-     * @Author YWX
164
-     * @Param [examid, teacherid, esstate]
165
-     * @Return java.util.List<java.util.Map>
166
-     **/
167
-    public List<Map> listJkSubject(int examid, Integer teacherid, Integer esstate) {
168
-        int timestamp = N_Utils.getSecondTimestamp();
169
-        String strtime = N_Utils.getStrtimeTimestamp(timestamp, "yyyy-MM-dd HH:mm:ss");
170
-        List<Map> list = msSubjectInvigilateMapper.listJkSubject(examid, teacherid, esstate, strtime);
171
-        for (Map map : list) {
172
-            List<Map> classList = setClassList(map);
173
-            map.put("classList", classList);
174
-        }
175
-        return list;
176
-    }
177
-
178 160
     private List<Map> setClassList(Map map) {
179 161
         List<Map> classes = JSON.parseArray(map.get("classnames").toString(), Map.class);
180 162
         List<Map> classList = new ArrayList<>();

+ 1
- 1
smarking/src/main/java/com/xhkjedu/smarking/service/exam/MsSubjectService.java View File

@@ -35,7 +35,7 @@ public class MsSubjectService {
35 35
 
36 36
     public void updateById(MsSubject msSubject) {
37 37
         msSubject.setHandletime(N_Utils.getSecondTimestamp());
38
-        msSubjectMapper.updateByPrimaryKey(msSubject);
38
+        msSubjectMapper.updateByPrimaryKeySelective(msSubject);
39 39
     }
40 40
 
41 41
     /**

+ 10
- 1
smarking/src/main/resources/mapper/exam/MsClassMapper.xml View File

@@ -18,7 +18,16 @@
18 18
         order by c.classtype,c.classorder,mc.mcid
19 19
     </select>
20 20
     <!--考试关联学校班级-->
21
-    <select id="listSchoolClassByExamId" resultType="java.util.Map">
21
+    <resultMap id="schoolClass" type="java.util.Map">
22
+        <result property="schoolid" column="schoolid" />
23
+        <result property="schoolname" column="schoolname" />
24
+        <collection property="classes" ofType="java.util.Map" javaType="java.util.List" >
25
+            <result property="classid" column="classid" />
26
+            <result property="classname" column="classname" />
27
+            <result property="classnum" column="classnum" />
28
+        </collection>
29
+    </resultMap>
30
+    <select id="listSchoolClassByExamId" resultMap="schoolClass">
22 31
         select c.schoolid,s.schoolname,ts.classid,ts.classname
23 32
         ,(select count(*) from ms_class_student cs where cs.examid=c.examid and cs.classid=c.classid) as classnum
24 33
         from ms_class c left join t_school s on c.schoolid=s.schoolid

+ 17
- 0
smarking/src/main/resources/mapper/exam/MsClassStudentMapper.xml View File

@@ -38,5 +38,22 @@
38 38
         and u.usertype=2 and u.examno like concat('%', #{examno}, '%')
39 39
         group by s.studentid
40 40
     </select>
41
+    <!--考生信息列表-->
42
+    <select id="listAll" resultType="java.util.Map">
43
+        select es.mcsid,es.classid,es.subjectid,u.username,u.examno,u.usersex,ec.classname
44
+        from ms_class_student es left join t_user u on es.studentid = u.userid
45
+        left join ms_class ec on es.classid=ec.classid and es.examid=ec.examid and es.subjectid=ec.subjectid
46
+        where es.examid=#{cs.examid} and ec.schoolid=#{cs.schoolid}
47
+        <if test="cs.classid!=null and cs.classid!=0">
48
+            and es.classid=#{cs.classid}
49
+        </if>
50
+        <if test="cs.subjectid!=null and cs.subjectid!='' and cs.subjectid!='0'">
51
+            and es.subjectid=#{cs.subjectid}
52
+        </if>
53
+        <if test="cs.studentname!=null and cs.studentname!=''">
54
+            and (u.username like '%${cs.studentname}%' or u.studentno like '%${cs.studentname}%')
55
+        </if>
56
+        order by es.mcsid desc
57
+    </select>
41 58
 
42 59
 </mapper>

+ 4
- 0
smarking/src/main/resources/mapper/exam/MsSubjectMapper.xml View File

@@ -43,6 +43,10 @@
43 43
         from ms_subject s left join ms_exam e on s.examid=e.examid
44 44
         where s.examid=#{examid} and s.leaderid=#{leaderid} order by s.msid
45 45
     </select>
46
+    <!--获取考试下所有科目名称-->
47
+    <select id="listSubjectNameByExamId" resultType="java.util.Map">
48
+        select subjectid,subjectname from ms_subject where examid=#{examid}
49
+    </select>
46 50
 
47 51
     <!--更改科目试卷模板设置状态-->
48 52
     <update id="updatePtstateByMpid">

Loading…
Cancel
Save