浏览代码

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

ywx
王宁 1 个月前
父节点
当前提交
f36b741c66

+ 36
- 0
smarking/src/main/java/com/xhkjedu/smarking/controller/exam/MsSubjectController.java 查看文件

@@ -184,4 +184,40 @@ public class MsSubjectController {
184 184
         msSubjectService.updateCheckState(msid, handleid, 2);
185 185
         return new ResultVo(0, "停止成功");
186 186
     }
187
+
188
+    /**
189
+     * @Description 考试科目选择列表
190
+     * @Date 2024/12/3 11:27
191
+     * @Author YWX
192
+     * @Param [msSubject]
193
+     * @Return com.xhkjedu.vo.ResultVo
194
+     **/
195
+    @PostMapping("/list_sel")
196
+    public ResultVo listForSel(@RequestBody MsSubject msSubject) {
197
+        Integer examid = msSubject.getExamid();
198
+        Integer handleid = msSubject.getHandleid();
199
+        N_Utils.validation(new Object[]{
200
+                examid, "考试id", 1
201
+                , handleid, "操作人id", 1
202
+        });
203
+        return new ResultVo(0, "获取成功", msSubjectService.listForSel(examid, handleid));
204
+    }
205
+
206
+    /**
207
+     * @Description 单科设置信息
208
+     * @Date 2024/12/3 17:56
209
+     * @Author YWX
210
+     * @Param [msSubject]
211
+     * @Return com.xhkjedu.vo.ResultVo
212
+     **/
213
+    @PostMapping("/get_set")
214
+    public ResultVo getSet(@RequestBody MsSubject msSubject) {
215
+        Integer examid = msSubject.getExamid();
216
+        String subjectid = msSubject.getSubjectid();
217
+        N_Utils.validation(new Object[]{
218
+                examid, "考试id", 1
219
+                , subjectid, "科目id", 2
220
+        });
221
+        return new ResultVo(0, "获取成功", msSubjectService.getSet(examid, subjectid));
222
+    }
187 223
 }

+ 3
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/exam/MsSubjectMapper.java 查看文件

@@ -68,4 +68,7 @@ public interface MsSubjectMapper extends TkMapper<MsSubject> {
68 68
 
69 69
     //修改试卷结构后更改后续操作状态
70 70
     int updatePaperFollowup(@Param("mpid")Integer mpid);
71
+
72
+    //单科设置信息
73
+    Map getSet(@Param("examid") Integer examid,@Param("subjectid") String subjectid);
71 74
 }

+ 31
- 3
smarking/src/main/java/com/xhkjedu/smarking/service/exam/MsSubjectService.java 查看文件

@@ -3,15 +3,14 @@ package com.xhkjedu.smarking.service.exam;
3 3
 import com.xhkjedu.exception.ServiceException;
4 4
 import com.xhkjedu.smarking.mapper.exam.MsSubjectMapper;
5 5
 import com.xhkjedu.smarking.mapper.papercheck.MsPaperCheckMapper;
6
+import com.xhkjedu.smarking.mapper.system.UserMapper;
6 7
 import com.xhkjedu.smarking.model.exam.MsSubject;
7 8
 import com.xhkjedu.utils.N_Utils;
8 9
 import org.springframework.stereotype.Service;
9 10
 import org.springframework.transaction.annotation.Transactional;
10 11
 
11 12
 import javax.annotation.Resource;
12
-import java.util.HashMap;
13
-import java.util.List;
14
-import java.util.Map;
13
+import java.util.*;
15 14
 
16 15
 /**
17 16
  * @Description 阅卷考试科目表 服务实现类
@@ -24,6 +23,8 @@ public class MsSubjectService {
24 23
     private MsSubjectMapper msSubjectMapper;
25 24
     @Resource
26 25
     private MsPaperCheckMapper msPaperCheckMapper;
26
+    @Resource
27
+    private UserMapper userMapper;
27 28
 
28 29
 
29 30
     /**
@@ -112,4 +113,31 @@ public class MsSubjectService {
112 113
 
113 114
         msPaperCheckMapper.updateCheckStateByMsId(msid, checkstate);//更新题块阅卷状态
114 115
     }
116
+
117
+    /**
118
+     * @Description 考试科目选择列表
119
+     * @Date 2024/12/3 11:26
120
+     * @Author YWX
121
+     * @Param [examid, handleid]
122
+     * @Return java.lang.Object
123
+     **/
124
+    public Object listForSel(Integer examid, Integer handleid) {
125
+        Integer usertype = userMapper.getUsertypeByUserid(handleid);
126
+        if (usertype.equals(0)) {
127
+            return msSubjectMapper.listSubjectNameByExamId(examid);
128
+        } else {
129
+            return new ArrayList<>();
130
+        }
131
+    }
132
+
133
+    /**
134
+     * @Description 单科设置信息
135
+     * @Date 2024/12/3 17:56
136
+     * @Author YWX
137
+     * @Param [examid, subjectid]
138
+     * @Return java.util.Map
139
+     **/
140
+    public Map getSet(Integer examid, String subjectid) {
141
+        return msSubjectMapper.getSet(examid, subjectid);
142
+    }
115 143
 }

+ 18
- 0
smarking/src/main/resources/mapper/exam/MsSubjectMapper.xml 查看文件

@@ -131,6 +131,24 @@
131 131
         from ms_subject s left join t_user u on s.teacherid=u.userid
132 132
         where examid=#{examid}
133 133
     </select>
134
+    <!--单科设置信息-->
135
+    <select id="getSet" resultType="java.util.Map">
136
+        select s.msid,s.subjectid,s.subjectname,s.sdate,s.begintime,s.endtime,s.pstate,s.checkset,s.checkstate,s.invigilatestate
137
+        ,count(distinct if(ps.batchid is not null,ps.mpsid,null)) as scannum
138
+        ,count(distinct pb.mblockid) as blocknum
139
+        ,count(distinct if(tb.localcoor is null or tb.localcoor='',tb.mblockid,null)) as wkxnum
140
+        ,count(distinct if(pc.dispenseway!=0,pc.mblockid,null)) as ysznum
141
+        ,count(distinct if(pb.blocktype=2,pb.mblockid,null))-count(distinct if(pc.dispenseway!=0,pc.mblockid,null)) as wsznum
142
+        ,count(distinct if(psb.arbitratestate in(1,2),psb.mpsbid,null)) as arbitratenum
143
+        ,count(distinct if(psb.hasproblem in(1,2),psb.mpsbid,null)) as problemnum
144
+        from ms_subject s left join ms_paper_student ps on s.msid = ps.msid
145
+        left join ms_paper_block pb on pb.mpid = ps.mpid
146
+        left join ms_template t on t.mpid=ps.mpid
147
+        left join ms_template_block tb on tb.mtid=t.mtid
148
+        left join ms_paper_check pc on pc.mpid=ps.mpid
149
+        left join ms_paper_student_block psb on psb.mpsid=ps.mpsid and psb.mblockid=pb.mblockid
150
+        where s.examid=#{examid} and s.subjectid=#{subjectid}
151
+    </select>
134 152
     <!--定时任务-科目结束考试-->
135 153
     <update id="updateEndSubject">
136 154
         update ms_subject ms

正在加载...
取消
保存