Browse Source

课堂模块

tags/正式3.2.0
雍文秀 2 years ago
parent
commit
8ea510d705
35 changed files with 1261 additions and 1211 deletions
  1. 34
    0
      sclass/src/main/java/com/xhkjedu/sclass/config/ScheduledConfig.java
  2. 267
    12
      sclass/src/main/java/com/xhkjedu/sclass/controller/classroom/ClassroomController.java
  3. 0
    282
      sclass/src/main/java/com/xhkjedu/sclass/controller/classroom/RoomController.java
  4. 4
    3
      sclass/src/main/java/com/xhkjedu/sclass/mapper/classroom/ClassroomAskstudentMapper.java
  5. 4
    3
      sclass/src/main/java/com/xhkjedu/sclass/mapper/classroom/ClassroomAskteacherMapper.java
  6. 10
    0
      sclass/src/main/java/com/xhkjedu/sclass/mapper/classroom/ClassroomFileMapper.java
  7. 152
    18
      sclass/src/main/java/com/xhkjedu/sclass/mapper/classroom/ClassroomMapper.java
  8. 4
    3
      sclass/src/main/java/com/xhkjedu/sclass/mapper/classroom/ClassroomPaperFileMapper.java
  9. 3
    3
      sclass/src/main/java/com/xhkjedu/sclass/mapper/classroom/ClassroomPaperMapper.java
  10. 5
    4
      sclass/src/main/java/com/xhkjedu/sclass/mapper/classroom/ClassroomPaperQtypeMapper.java
  11. 5
    4
      sclass/src/main/java/com/xhkjedu/sclass/mapper/classroom/ClassroomPaperScantronMapper.java
  12. 2
    2
      sclass/src/main/java/com/xhkjedu/sclass/mapper/classroom/ClassroomPaperStudentMapper.java
  13. 2
    2
      sclass/src/main/java/com/xhkjedu/sclass/mapper/classroom/ClassroomPaperStudentScantronMapper.java
  14. 12
    1
      sclass/src/main/java/com/xhkjedu/sclass/mapper/classroom/ClassroomSignMapper.java
  15. 0
    16
      sclass/src/main/java/com/xhkjedu/sclass/mapper/room/RoomFileMapper.java
  16. 0
    123
      sclass/src/main/java/com/xhkjedu/sclass/mapper/room/RoomMapper.java
  17. 0
    16
      sclass/src/main/java/com/xhkjedu/sclass/mapper/room/RoomSignMapper.java
  18. 26
    26
      sclass/src/main/java/com/xhkjedu/sclass/service/classroom/ClassroomPaperService.java
  19. 369
    10
      sclass/src/main/java/com/xhkjedu/sclass/service/classroom/ClassroomService.java
  20. 0
    372
      sclass/src/main/java/com/xhkjedu/sclass/service/classroom/RoomService.java
  21. 49
    0
      sclass/src/main/java/com/xhkjedu/sclass/task/UriMapTask.java
  22. 5
    0
      sclass/src/main/resources/application.properties
  23. 1
    1
      sclass/src/main/resources/mapper/classroom/ClassroomAskstudentMapper.xml
  24. 1
    1
      sclass/src/main/resources/mapper/classroom/ClassroomAskteacherMapper.xml
  25. 8
    3
      sclass/src/main/resources/mapper/classroom/ClassroomFileMapper.xml
  26. 283
    7
      sclass/src/main/resources/mapper/classroom/ClassroomMapper.xml
  27. 1
    1
      sclass/src/main/resources/mapper/classroom/ClassroomPaperFileMapper.xml
  28. 4
    3
      sclass/src/main/resources/mapper/classroom/ClassroomPaperQtypeMapper.xml
  29. 2
    2
      sclass/src/main/resources/mapper/classroom/ClassroomPaperScantronMapper.xml
  30. 1
    1
      sclass/src/main/resources/mapper/classroom/ClassroomPaperStudentMapper.xml
  31. 2
    2
      sclass/src/main/resources/mapper/classroom/ClassroomPaperStudentScantronMapper.xml
  32. 5
    0
      sclass/src/main/resources/mapper/classroom/ClassroomSignMapper.xml
  33. 0
    9
      sclass/src/main/resources/mapper/room/RoomFileMapper.xml
  34. 0
    271
      sclass/src/main/resources/mapper/room/RoomMapper.xml
  35. 0
    10
      sclass/src/main/resources/mapper/room/RoomSignMapper.xml

+ 34
- 0
sclass/src/main/java/com/xhkjedu/sclass/config/ScheduledConfig.java View File

@@ -0,0 +1,34 @@
1
+package com.xhkjedu.sclass.config;
2
+
3
+import org.springframework.context.annotation.Bean;
4
+import org.springframework.context.annotation.Condition;
5
+import org.springframework.context.annotation.ConditionContext;
6
+import org.springframework.context.annotation.Conditional;
7
+import org.springframework.context.annotation.Configuration;
8
+import org.springframework.core.type.AnnotatedTypeMetadata;
9
+import org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor;
10
+
11
+/**
12
+ * @author ywx
13
+ * @className ScheduledConfig
14
+ * @description @Scheduled 注解,是被一个叫做 ScheduledAnnotationBeanPostProcessor 的类所拦截的,
15
+ * 所以我们可以根据配置,决定是否创建这个 bean,如果没有这个 bean,@Scheduled 就不会被拦截,那么定时任务肯定不会执行了,
16
+ * 需要注意的是:这种方式,启动类上面的 @EnableScheduling 需要去掉。
17
+ * @date 2021/5/18 9:15
18
+ **/
19
+@Configuration
20
+public class ScheduledConfig {
21
+    @Conditional(ScheduledCondition.class)
22
+    @Bean
23
+    public ScheduledAnnotationBeanPostProcessor processor(){
24
+        return new ScheduledAnnotationBeanPostProcessor();
25
+    }
26
+}
27
+
28
+class ScheduledCondition implements Condition{
29
+
30
+    @Override
31
+    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
32
+        return Boolean.valueOf(context.getEnvironment().getProperty("enable.scheduled"));
33
+    }
34
+}

+ 267
- 12
sclass/src/main/java/com/xhkjedu/sclass/controller/classroom/ClassroomController.java View File

@@ -1,15 +1,34 @@
1 1
 package com.xhkjedu.sclass.controller.classroom;
2 2
 
3
+import com.alibaba.fastjson.JSON;
3 4
 import com.github.pagehelper.PageHelper;
4 5
 import com.github.pagehelper.PageInfo;
5
-import com.xhkjedu.vo.PageResult;
6 6
 import com.xhkjedu.sclass.model.classroom.TClassroom;
7
+import com.xhkjedu.sclass.model.classroom.TClassroomAskstudent;
8
+import com.xhkjedu.sclass.model.classroom.TClassroomAskteacher;
7 9
 import com.xhkjedu.sclass.model.classroom.TClassroomFile;
10
+import com.xhkjedu.sclass.model.classroom.TClassroomPaper;
11
+import com.xhkjedu.sclass.model.classroom.TClassroomPaperStudent;
12
+import com.xhkjedu.sclass.model.classroom.TClassroomSign;
13
+import com.xhkjedu.sclass.model.paperstudent.TPaperStudent;
14
+import com.xhkjedu.sclass.model.paperstudent.TPaperStudentScantron;
15
+import com.xhkjedu.sclass.service.classroom.ClassroomPaperService;
8 16
 import com.xhkjedu.sclass.service.classroom.ClassroomService;
17
+import com.xhkjedu.sclass.vo.classroom.ObjectiveVo;
18
+import com.xhkjedu.sclass.vo.classroom.ReportEQuestionVo;
19
+import com.xhkjedu.sclass.vo.classroom.RoomCorrectCallVo;
20
+import com.xhkjedu.sclass.vo.classroom.RoomCorrectExamVo;
21
+import com.xhkjedu.sclass.vo.classroom.RoomCorrectVo;
22
+import com.xhkjedu.sclass.vo.classroom.RoomVo;
23
+import com.xhkjedu.sclass.vo.classroom.SubjectiveVo;
24
+import com.xhkjedu.sclass.vo.paper.CheckClassVo;
25
+import com.xhkjedu.sclass.vo.paperstudent.StudentVo;
26
+import com.xhkjedu.sclass.vo.room.RoomPVo;
27
+import com.xhkjedu.sclass.vo.room.RoomParamVo;
9 28
 import com.xhkjedu.utils.N_Utils;
10 29
 import com.xhkjedu.utils.PageUtil;
30
+import com.xhkjedu.vo.PageResult;
11 31
 import com.xhkjedu.vo.ResultVo;
12
-import com.xhkjedu.sclass.vo.classroom.RoomVo;
13 32
 import lombok.extern.slf4j.Slf4j;
14 33
 import org.springframework.web.bind.annotation.PostMapping;
15 34
 import org.springframework.web.bind.annotation.RequestBody;
@@ -17,8 +36,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
17 36
 import org.springframework.web.bind.annotation.RestController;
18 37
 
19 38
 import javax.annotation.Resource;
39
+import java.util.ArrayList;
20 40
 import java.util.List;
21 41
 import java.util.Map;
42
+import java.util.stream.Collectors;
22 43
 
23 44
 @RestController
24 45
 @RequestMapping("room")
@@ -27,13 +48,246 @@ public class ClassroomController {
27 48
 
28 49
     @Resource
29 50
     private ClassroomService classroomService;
51
+    @Resource
52
+    private ClassroomPaperService classroomPaperService;
53
+
54
+    /**
55
+     * 保存课堂数据
56
+     *
57
+     * @return com.xhkjedu.sclass.vo.ResultVo
58
+     * @Param [params]
59
+     * @Author ywx
60
+     * @Date 2020/7/14 16:45
61
+     **/
62
+    @PostMapping("/saveclass")
63
+    public ResultVo saveClass(@RequestBody List<RoomPVo> rooms) {
64
+        ResultVo resultVo = new ResultVo();
65
+        resultVo.setCode(1);
66
+        try {
67
+            List<Long> savelst = new ArrayList<>();//用于更新课堂时间参与学生
68
+            List<Integer> classlst = new ArrayList<>();//用于更新班级课堂状态
69
+            for (RoomPVo r : rooms) {
70
+                savelst.add(r.getRoomid());
71
+                List<RoomParamVo> params = r.getParams();
72
+                for (RoomParamVo param : params) {
73
+                    String rtype = param.getRtype();
74
+                    String jsonstr = param.getJsonstr();
75
+                    N_Utils.validation(new Object[]{rtype, "请求类型", 2, jsonstr, "请求json", 2});
76
+                    if (rtype.equals("startclass")) {//课堂--开始
77
+                        TClassroom room = JSON.parseObject(jsonstr, TClassroom.class);
78
+                        classlst.add(room.getClassid());
79
+                        boolean rtn = classroomService.startClass(room);//课堂是否重复请求
80
+                        if (rtn) {
81
+                            break;//课堂重复请求结束循环,执行下个课堂数据
82
+                        }
83
+                    } else if (rtype.equals("stopclass")) {//课堂--结束
84
+                        TClassroom room = JSON.parseObject(jsonstr, TClassroom.class);
85
+                        classroomService.stopClass(room);
86
+                    } else if (rtype.equals("savefile")) {//课堂--保存图片
87
+                        TClassroomFile file = JSON.parseObject(jsonstr, TClassroomFile.class);
88
+                        classroomService.saveFile(file);
89
+                    } else if (rtype.equals("askteacher")) {//互动--发起
90
+                        TClassroomAskteacher teacher = JSON.parseObject(jsonstr, TClassroomAskteacher.class);
91
+                        classroomService.saveWork(teacher);
92
+                    } else if (rtype.equals("askstudent")) {//互动--保存学生作答情况
93
+                        TClassroomAskstudent student = JSON.parseObject(jsonstr, TClassroomAskstudent.class);
94
+                        classroomService.saveStuAnswer(student);
95
+                    } else if (rtype.equals("sign")) {//学生--签到
96
+                        TClassroomSign sign = JSON.parseObject(jsonstr, TClassroomSign.class);
97
+                        classroomService.saveStudentSign(sign);
98
+                    } else if (rtype.equals("paper")) {//堂测--发布
99
+                        TClassroomPaper paper = JSON.parseObject(jsonstr, TClassroomPaper.class);
100
+                        classroomPaperService.saveScantronPaper(paper);
101
+                    } else if (rtype.equals("stupaper")) {//堂测--学生作答详情
102
+                        TClassroomPaperStudent student = JSON.parseObject(jsonstr, TClassroomPaperStudent.class);
103
+                        classroomPaperService.saveStudentScantron(student);
104
+                    }
105
+                }
106
+            }
107
+
108
+            //最后更新课堂中实际上课学生数量
109
+            classroomService.updateBatchRoomRealStunum(savelst);
110
+
111
+            List<Integer> distinctclass = classlst.stream().distinct().collect(Collectors.toList());
112
+            //结束班级
113
+            classroomService.updateBatchRoomState(distinctclass);
114
+            resultVo.setCode(0);
115
+            resultVo.setMsg("保存成功");
116
+        } catch (Exception e) {
117
+            log.error("保存课堂数据失败:" + e.getMessage());
118
+            resultVo.setMsg("保存失败");
119
+        }
120
+        return resultVo;
121
+    }
122
+
123
+    @PostMapping("/list_correct")
124
+    public ResultVo listCorrect(@RequestBody RoomVo room) {
125
+        Long roomid = room.getRoomid();
126
+        N_Utils.validation(new Object[]{roomid, "课堂id", 1});
127
+        RoomCorrectVo correct = classroomService.listCorrect(roomid);
128
+        return new ResultVo(0, "获取批阅信息成功", correct);
129
+    }
130
+
131
+    @PostMapping("/check_students_call")
132
+    public ResultVo listStudentsByAskTid(@RequestBody RoomCorrectCallVo call) {
133
+        Long asktid = call.getAsktid();
134
+        N_Utils.validation(new Object[]{asktid, "互动id", 1});
135
+        CheckClassVo checkVo = classroomService.listStudentsByAskTid(asktid);
136
+        return new ResultVo(0, "获取提问批改学生列表成功", checkVo);
137
+    }
138
+
139
+    @PostMapping("/check_students_exam")
140
+    public ResultVo listStudentsByPaperId(@RequestBody RoomCorrectExamVo exam) {
141
+        Long paperid = exam.getPaperid();
142
+        N_Utils.validation(new Object[]{paperid, "考试id", 1});
143
+        CheckClassVo checkVo = classroomService.listStudentsByPaperId(paperid);
144
+        return new ResultVo(0, "获取考试批改学生列表成功", checkVo);
145
+    }
146
+
147
+    @PostMapping("call_objective")
148
+    public ResultVo callObjective(@RequestBody RoomCorrectCallVo call) {
149
+        try {
150
+            Long asktid = call.getAsktid();
151
+            N_Utils.validation(new Object[]{asktid, "互动id", 1});
152
+            ObjectiveVo objective = classroomService.callObjective(asktid, call.getRealstunum());
153
+            return new ResultVo(0, "获取课堂提问客观题详情成功", objective);
154
+        } catch (Exception e) {
155
+            log.error("获取课堂提问客观题详情失败:" + e.getMessage());
156
+            return new ResultVo(1, "获取课堂提问客观题详情失败");
157
+        }
158
+    }
159
+
160
+    @PostMapping("exam_objective")
161
+    public ResultVo examObjective(@RequestBody ReportEQuestionVo question) {
162
+        try {
163
+            Long pscaid = question.getPscaid();
164
+            N_Utils.validation(new Object[]{pscaid, "答题卡id", 1});
165
+            ObjectiveVo objective = classroomService.examObjective(pscaid, question.getRealstunum());
166
+            return new ResultVo(0, "获取课堂考试客观题详情成功", objective);
167
+        } catch (Exception e) {
168
+            log.error("获取课堂考试客观题详情失败:" + e.getMessage());
169
+            return new ResultVo(1, "获取课堂考试客观题详情失败");
170
+        }
171
+    }
172
+
173
+    @PostMapping("call_subjective")
174
+    public ResultVo callSubjective(@RequestBody RoomCorrectCallVo call) {
175
+        try {
176
+            Long asktid = call.getAsktid();
177
+            N_Utils.validation(new Object[]{asktid, "互动id", 1});
178
+            SubjectiveVo subjective = classroomService.callSubjective(asktid, call.getRealstunum());
179
+            return new ResultVo(0, "获取课堂提问主观题详情成功", subjective);
180
+        } catch (Exception e) {
181
+            log.error("获取课堂提问客观题详情失败:" + e.getMessage());
182
+            return new ResultVo(1, "获取课堂提问主观题详情失败");
183
+        }
184
+    }
185
+
186
+    @PostMapping("exam_subjective")
187
+    public ResultVo examSubjective(@RequestBody ReportEQuestionVo question) {
188
+        try {
189
+            Long pscaid = question.getPscaid();
190
+            N_Utils.validation(new Object[]{pscaid, "答题卡id", 1});
191
+            SubjectiveVo subjective = classroomService.examSubjective(pscaid, question.getRealstunum());
192
+            return new ResultVo(0, "获取课堂考试主观题详情成功", subjective);
193
+        } catch (Exception e) {
194
+            log.error("获取课堂考试客观题详情失败:" + e.getMessage());
195
+            return new ResultVo(1, "获取课堂考试主观题详情失败");
196
+        }
197
+    }
198
+
199
+    @PostMapping("/correct_call")
200
+    public ResultVo correctCall(@RequestBody StudentVo student) {
201
+        Integer psid = student.getPsid();
202
+        Integer pschecked = student.getPschecked();
203
+        N_Utils.validation(new Object[]{psid, "互动学生id", 1, pschecked, "批改结果", 1});
204
+        classroomService.correctCall(psid, pschecked);
205
+        return new ResultVo(0, "批阅成功");
206
+    }
207
+
208
+    @PostMapping("/correct_exam")
209
+    public ResultVo correctExam(@RequestBody TPaperStudent ps) {
210
+        try {
211
+            Integer psid = ps.getPsid();
212
+            Integer checkid = ps.getCreateid();
213
+            String questionResult = ps.getQuestionResult();
214
+            N_Utils.validation(new Object[]{psid, "试卷学生id", 1, checkid, "批改人id", 1});
215
+            int result = classroomPaperService.correctExam(psid, checkid, questionResult);
216
+            if (result > 0) {
217
+                return new ResultVo(0, "批阅成功", 0);
218
+            } else {
219
+                return new ResultVo(0, "批阅完成", 1);
220
+            }
221
+        } catch (Exception e) {
222
+            return new ResultVo(1, "批阅失败");
223
+        }
224
+    }
225
+
226
+    @PostMapping("/list_correct_question")
227
+    public ResultVo listCorrectQuestion(@RequestBody TPaperStudent paperStudent) {
228
+        Integer psid = paperStudent.getPsid();
229
+        N_Utils.validation(new Object[]{psid, "考试学生id", 1});
230
+        //根据考试学生id获取考试是否完成批阅
231
+        /*Integer checked = roomPaperService.getCheckedByPsId(psid);
232
+        if (checked == 1){
233
+            return new ResultVo(1,"考试已结束批阅");
234
+        }*/
235
+        List<Map> paperQuestions = classroomPaperService.listCorrectQuestion(psid);
236
+        return new ResultVo(0, "获取考试学生待批改试题列表成功!", paperQuestions);
237
+    }
238
+
239
+    @PostMapping("/mark_call")
240
+    public ResultVo markCall(@RequestBody StudentVo student) {
241
+        Integer psid = student.getPsid();
242
+        String studentpic = student.getStudentpic();
243
+        N_Utils.validation(new Object[]{psid, "互动学生id", 1, studentpic, "批改结果", 1});
244
+        classroomService.updateStudentpic(psid, studentpic);
245
+        return new ResultVo(0, "保存成功");
246
+    }
247
+
248
+    @PostMapping("/mark_question")
249
+    public ResultVo markQuestion(@RequestBody TPaperStudentScantron ps) {
250
+        Integer pssid = ps.getPssid();
251
+        String useranswer = ps.getUseranswer();
252
+        N_Utils.validation(new Object[]{pssid, "考试学生试题id", 1, useranswer, "批改结果", 2});
253
+        classroomPaperService.updateScantronUseranswer(pssid, useranswer);
254
+        return new ResultVo(0, "保存成功");
255
+    }
256
+
257
+    @PostMapping("list_class_stu")
258
+    public ResultVo listStuClass(@RequestBody TClassroom room) {
259
+        try {
260
+            Integer studentid = room.getStudentid();
261
+            String subjectid = room.getSubjectid();
262
+            Integer page = room.getPage();
263
+            Integer pageSize = room.getPageSize();
264
+            N_Utils.validation(new Object[]{studentid, "学生id", 1, subjectid, "科目id", 2
265
+                    , page, "显示页码", 1, pageSize, "显示条数", 1});
266
+            PageHelper.startPage(page, pageSize);
267
+            List<RoomVo> list = classroomService.listStuClass(room);
268
+            PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
269
+            return new ResultVo(0, "获取学生课堂回顾列表成功", pageResult);
270
+        } catch (Exception e) {
271
+            log.error("获取学生课堂回顾列表失败:" + e.getMessage());
272
+            return new ResultVo(1, "获取学生课堂回顾列表失败");
273
+        }
274
+    }
275
+
276
+    @PostMapping("/report_stu")
277
+    public ResultVo reportStu(@RequestBody TClassroom room) {
278
+        Long roomid = room.getRoomid();
279
+        Integer createid = room.getCreateid();
280
+        N_Utils.validation(new Object[]{roomid, "课堂id", 1, createid, "学生id", 1});
281
+        return classroomService.getReportStu(roomid, createid);
282
+    }
30 283
 
31 284
     /**
32 285
      * 获取课堂回顾列表
286
+     *
287
+     * @return com.xhkjedu.vo.ResultVo
33 288
      * @Param [room]
34 289
      * @Author ywx
35 290
      * @Date 2020/6/15 10:57
36
-     * @return com.xhkjedu.vo.ResultVo
37 291
      **/
38 292
     @PostMapping("list_class_directorid")
39 293
     public ResultVo listClassByDirectorId(@RequestBody TClassroom room) {
@@ -41,41 +295,42 @@ public class ClassroomController {
41 295
             Integer teacherid = room.getTeacherid();
42 296
             Integer page = room.getPage();
43 297
             Integer pageSize = room.getPageSize();
44
-            N_Utils.validation(new Object[]{teacherid,"教师id",1,page,"显示页码",1,pageSize,"显示条数",1});
298
+            N_Utils.validation(new Object[]{teacherid, "教师id", 1, page, "显示页码", 1, pageSize, "显示条数", 1});
45 299
             PageHelper.startPage(page, pageSize);
46 300
             List<RoomVo> list = classroomService.listClassByDirectorId(room);
47 301
             PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
48
-            return new ResultVo(0,"获取课堂回顾列表成功",pageResult);
302
+            return new ResultVo(0, "获取课堂回顾列表成功", pageResult);
49 303
         } catch (Exception e) {
50 304
             log.error("获取课堂回顾列表失败:" + e.getMessage());
51
-            return new ResultVo(1,"获取课堂回顾列表失败");
305
+            return new ResultVo(1, "获取课堂回顾列表失败");
52 306
         }
53 307
     }
54 308
 
55 309
     /**
56 310
      * 课堂回顾详情
311
+     *
312
+     * @return com.xhkjedu.vo.ResultVo
57 313
      * @Param [room]
58 314
      * @Author ywx
59 315
      * @Date 2020/6/26 9:36
60
-     * @return com.xhkjedu.vo.ResultVo
61 316
      **/
62 317
     @PostMapping("/report")
63 318
     public ResultVo report(@RequestBody TClassroom room) {
64
-        N_Utils.validation(new Object[]{room.getRoomid(),"课堂id",1});
319
+        N_Utils.validation(new Object[]{room.getRoomid(), "课堂id", 1});
65 320
         return classroomService.getReport(room.getRoomid());
66 321
     }
67 322
 
68 323
     @PostMapping("/del_file")
69 324
     public ResultVo delFile(@RequestBody TClassroomFile file) {
70
-        N_Utils.validation(new Object[]{file.getRfid(),"课堂图片id",1});
325
+        N_Utils.validation(new Object[]{file.getRfid(), "课堂图片id", 1});
71 326
         classroomService.delFile(file.getRfid());
72
-        return new ResultVo(0,"删除成功");
327
+        return new ResultVo(0, "删除成功");
73 328
     }
74 329
 
75 330
     @PostMapping("/list_student")
76 331
     public ResultVo listStudent(@RequestBody TClassroom room) {
77
-        N_Utils.validation(new Object[]{room.getClassid(),"班级id",1,room.getLsbid(),"教材关联id",2});
332
+        N_Utils.validation(new Object[]{room.getClassid(), "班级id", 1, room.getLsbid(), "教材关联id", 2});
78 333
         List<Map> list = classroomService.listStudent(room.getClassid(), room.getLsbid());
79
-        return new ResultVo(0,"获取班级学生列表成功",list);
334
+        return new ResultVo(0, "获取班级学生列表成功", list);
80 335
     }
81 336
 }

+ 0
- 282
sclass/src/main/java/com/xhkjedu/sclass/controller/classroom/RoomController.java View File

@@ -1,282 +0,0 @@
1
-package com.xhkjedu.sclass.controller.classroom;
2
-
3
-import com.alibaba.fastjson.JSON;
4
-import com.github.pagehelper.PageHelper;
5
-import com.github.pagehelper.PageInfo;
6
-import com.xhkjedu.sclass.model.classroom.TClassroom;
7
-import com.xhkjedu.sclass.model.classroom.TClassroomAskstudent;
8
-import com.xhkjedu.sclass.model.classroom.TClassroomAskteacher;
9
-import com.xhkjedu.sclass.model.classroom.TClassroomFile;
10
-import com.xhkjedu.sclass.model.classroom.TClassroomPaper;
11
-import com.xhkjedu.sclass.model.classroom.TClassroomPaperStudent;
12
-import com.xhkjedu.sclass.model.classroom.TClassroomSign;
13
-import com.xhkjedu.sclass.model.paperstudent.TPaperStudent;
14
-import com.xhkjedu.sclass.model.paperstudent.TPaperStudentScantron;
15
-import com.xhkjedu.sclass.service.classroom.RoomPaperService;
16
-import com.xhkjedu.sclass.service.classroom.RoomService;
17
-import com.xhkjedu.sclass.vo.classroom.ObjectiveVo;
18
-import com.xhkjedu.sclass.vo.classroom.ReportEQuestionVo;
19
-import com.xhkjedu.sclass.vo.classroom.RoomCorrectCallVo;
20
-import com.xhkjedu.sclass.vo.classroom.RoomCorrectExamVo;
21
-import com.xhkjedu.sclass.vo.classroom.RoomCorrectVo;
22
-import com.xhkjedu.sclass.vo.classroom.RoomVo;
23
-import com.xhkjedu.sclass.vo.classroom.SubjectiveVo;
24
-import com.xhkjedu.sclass.vo.paper.CheckClassVo;
25
-import com.xhkjedu.sclass.vo.paperstudent.StudentVo;
26
-import com.xhkjedu.sclass.vo.room.RoomPVo;
27
-import com.xhkjedu.sclass.vo.room.RoomParamVo;
28
-import com.xhkjedu.utils.N_Utils;
29
-import com.xhkjedu.utils.PageUtil;
30
-import com.xhkjedu.vo.PageResult;
31
-import com.xhkjedu.vo.ResultVo;
32
-import lombok.extern.slf4j.Slf4j;
33
-import org.springframework.web.bind.annotation.PostMapping;
34
-import org.springframework.web.bind.annotation.RequestBody;
35
-import org.springframework.web.bind.annotation.RequestMapping;
36
-import org.springframework.web.bind.annotation.RestController;
37
-
38
-import javax.annotation.Resource;
39
-import java.util.ArrayList;
40
-import java.util.List;
41
-import java.util.Map;
42
-import java.util.stream.Collectors;
43
-
44
-@RestController
45
-@RequestMapping("croom")
46
-@Slf4j
47
-public class RoomController {
48
-
49
-    @Resource
50
-    private RoomService roomService;
51
-    @Resource
52
-    private RoomPaperService roomPaperService;
53
-
54
-    /**
55
-     * 保存课堂数据
56
-     * @Param [params]
57
-     * @Author ywx
58
-     * @Date 2020/7/14 16:45
59
-     * @return com.xhkjedu.sclass.vo.ResultVo
60
-     **/
61
-    @PostMapping("/saveclass")
62
-    public ResultVo saveClass(@RequestBody List<RoomPVo> rooms) {
63
-        ResultVo resultVo = new ResultVo();
64
-        resultVo.setCode(1);
65
-        try {
66
-            List<Long> savelst = new ArrayList<>();//用于更新课堂时间参与学生
67
-            List<Integer> classlst = new ArrayList<>();//用于更新班级课堂状态
68
-            for (RoomPVo r : rooms) {
69
-                savelst.add(r.getRoomid());
70
-                List<RoomParamVo> params = r.getParams();
71
-                for (RoomParamVo param : params) {
72
-                    String rtype = param.getRtype();
73
-                    String jsonstr = param.getJsonstr();
74
-                    N_Utils.validation(new Object[]{rtype,"请求类型",2,jsonstr,"请求json",2});
75
-                    if (rtype.equals("startclass")){//课堂--开始
76
-                        TClassroom room = JSON.parseObject(jsonstr,TClassroom.class);
77
-                        classlst.add(room.getClassid());
78
-                        boolean rtn = roomService.startClass(room);//课堂是否重复请求
79
-                        if (rtn) {
80
-                            break;//课堂重复请求结束循环,执行下个课堂数据
81
-                        }
82
-                    } else if (rtype.equals("stopclass")){//课堂--结束
83
-                        TClassroom room = JSON.parseObject(jsonstr,TClassroom.class);
84
-                        roomService.stopClass(room);
85
-                    } else if (rtype.equals("savefile")){//课堂--保存图片
86
-                        TClassroomFile file = JSON.parseObject(jsonstr,TClassroomFile.class);
87
-                        roomService.saveFile(file);
88
-                    } else if (rtype.equals("askteacher")){//互动--发起
89
-                        TClassroomAskteacher teacher = JSON.parseObject(jsonstr,TClassroomAskteacher.class);
90
-                        roomService.saveWork(teacher);
91
-                    } else if (rtype.equals("askstudent")){//互动--保存学生作答情况
92
-                        TClassroomAskstudent student = JSON.parseObject(jsonstr,TClassroomAskstudent.class);
93
-                        roomService.saveStuAnswer(student);
94
-                    } else if (rtype.equals("sign")){//学生--签到
95
-                        TClassroomSign sign = JSON.parseObject(jsonstr,TClassroomSign.class);
96
-                        roomService.saveStudentSign(sign);
97
-                    } else if (rtype.equals("paper")){//堂测--发布
98
-                        TClassroomPaper paper = JSON.parseObject(jsonstr,TClassroomPaper.class);
99
-                        roomPaperService.saveScantronPaper(paper);
100
-                    } else if (rtype.equals("stupaper")){//堂测--学生作答详情
101
-                        TClassroomPaperStudent student = JSON.parseObject(jsonstr,TClassroomPaperStudent.class);
102
-                        roomPaperService.saveStudentScantron(student);
103
-                    }
104
-                }
105
-            }
106
-
107
-            //最后更新课堂中实际上课学生数量
108
-            roomService.updateBatchRoomRealStunum(savelst);
109
-
110
-            List<Integer> distinctclass = classlst.stream().distinct().collect(Collectors.toList());
111
-            //结束班级
112
-            roomService.updateBatchRoomState(distinctclass);
113
-            resultVo.setCode(0);
114
-            resultVo.setMsg("保存成功");
115
-        } catch (Exception e) {
116
-            log.error("保存课堂数据失败:"+e.getMessage());
117
-            resultVo.setMsg("保存失败");
118
-        }
119
-        return resultVo;
120
-    }
121
-
122
-    @PostMapping("/list_correct")
123
-    public ResultVo listCorrect(@RequestBody RoomVo room) {
124
-        Long roomid = room.getRoomid();
125
-        N_Utils.validation(new Object[]{roomid,"课堂id",1});
126
-        RoomCorrectVo correct = roomService.listCorrect(roomid);
127
-        return new ResultVo(0,"获取批阅信息成功",correct);
128
-    }
129
-
130
-    @PostMapping("/check_students_call")
131
-    public ResultVo listStudentsByAskTid(@RequestBody RoomCorrectCallVo call) {
132
-        Long asktid = call.getAsktid();
133
-        N_Utils.validation(new Object[]{asktid,"互动id",1});
134
-        CheckClassVo checkVo = roomService.listStudentsByAskTid(asktid);
135
-        return new ResultVo(0,"获取提问批改学生列表成功",checkVo);
136
-    }
137
-
138
-    @PostMapping("/check_students_exam")
139
-    public ResultVo listStudentsByPaperId(@RequestBody RoomCorrectExamVo exam) {
140
-        Long paperid = exam.getPaperid();
141
-        N_Utils.validation(new Object[]{paperid,"考试id",1});
142
-        CheckClassVo checkVo = roomService.listStudentsByPaperId(paperid);
143
-        return new ResultVo(0,"获取考试批改学生列表成功",checkVo);
144
-    }
145
-
146
-    @PostMapping("call_objective")
147
-    public ResultVo callObjective(@RequestBody RoomCorrectCallVo call) {
148
-        try {
149
-            Long asktid = call.getAsktid();
150
-            N_Utils.validation(new Object[]{asktid,"互动id",1});
151
-            ObjectiveVo objective = roomService.callObjective(asktid, call.getRealstunum());
152
-            return new ResultVo(0,"获取课堂提问客观题详情成功",objective);
153
-        } catch (Exception e) {
154
-            log.error("获取课堂提问客观题详情失败:" + e.getMessage());
155
-            return new ResultVo(1,"获取课堂提问客观题详情失败");
156
-        }
157
-    }
158
-
159
-    @PostMapping("exam_objective")
160
-    public ResultVo examObjective(@RequestBody ReportEQuestionVo question) {
161
-        try {
162
-            Long pscaid = question.getPscaid();
163
-            N_Utils.validation(new Object[]{pscaid,"答题卡id",1});
164
-            ObjectiveVo objective = roomService.examObjective(pscaid, question.getRealstunum());
165
-            return new ResultVo(0,"获取课堂考试客观题详情成功",objective);
166
-        } catch (Exception e) {
167
-            log.error("获取课堂考试客观题详情失败:" + e.getMessage());
168
-            return new ResultVo(1,"获取课堂考试客观题详情失败");
169
-        }
170
-    }
171
-
172
-    @PostMapping("call_subjective")
173
-    public ResultVo callSubjective(@RequestBody RoomCorrectCallVo call) {
174
-        try {
175
-            Long asktid = call.getAsktid();
176
-            N_Utils.validation(new Object[]{asktid,"互动id",1});
177
-            SubjectiveVo subjective = roomService.callSubjective(asktid, call.getRealstunum());
178
-            return new ResultVo(0,"获取课堂提问主观题详情成功",subjective);
179
-        } catch (Exception e) {
180
-            log.error("获取课堂提问客观题详情失败:" + e.getMessage());
181
-            return new ResultVo(1,"获取课堂提问主观题详情失败");
182
-        }
183
-    }
184
-
185
-    @PostMapping("exam_subjective")
186
-    public ResultVo examSubjective(@RequestBody ReportEQuestionVo question) {
187
-        try {
188
-            Long pscaid = question.getPscaid();
189
-            N_Utils.validation(new Object[]{pscaid,"答题卡id",1});
190
-            SubjectiveVo subjective = roomService.examSubjective(pscaid, question.getRealstunum());
191
-            return new ResultVo(0,"获取课堂考试主观题详情成功",subjective);
192
-        } catch (Exception e) {
193
-            log.error("获取课堂考试客观题详情失败:" + e.getMessage());
194
-            return new ResultVo(1,"获取课堂考试主观题详情失败");
195
-        }
196
-    }
197
-
198
-    @PostMapping("/correct_call")
199
-    public ResultVo correctCall(@RequestBody StudentVo student) {
200
-        Integer psid = student.getPsid();
201
-        Integer pschecked = student.getPschecked();
202
-        N_Utils.validation(new Object[]{psid,"互动学生id",1,pschecked,"批改结果",1});
203
-        roomService.correctCall(psid, pschecked);
204
-        return new ResultVo(0,"批阅成功");
205
-    }
206
-
207
-    @PostMapping("/correct_exam")
208
-    public ResultVo correctExam(@RequestBody TPaperStudent ps) {
209
-        try {
210
-            Integer psid = ps.getPsid();
211
-            Integer checkid = ps.getCreateid();
212
-            String questionResult = ps.getQuestionResult();
213
-            N_Utils.validation(new Object[]{psid,"试卷学生id",1,checkid,"批改人id",1});
214
-            int result = roomPaperService.correctExam(psid, checkid, questionResult);
215
-            if (result > 0) {
216
-                return new ResultVo(0, "批阅成功",0);
217
-            } else {
218
-                return new ResultVo(0, "批阅完成",1);
219
-            }
220
-        } catch (Exception e) {
221
-            return new ResultVo(1,"批阅失败");
222
-        }
223
-    }
224
-
225
-    @PostMapping("/list_correct_question")
226
-    public ResultVo listCorrectQuestion(@RequestBody TPaperStudent paperStudent) {
227
-        Integer psid = paperStudent.getPsid();
228
-        N_Utils.validation(new Object[]{psid,"考试学生id",1});
229
-        //根据考试学生id获取考试是否完成批阅
230
-        /*Integer checked = roomPaperService.getCheckedByPsId(psid);
231
-        if (checked == 1){
232
-            return new ResultVo(1,"考试已结束批阅");
233
-        }*/
234
-        List<Map> paperQuestions = roomPaperService.listCorrectQuestion(psid);
235
-        return new ResultVo(0,"获取考试学生待批改试题列表成功!",paperQuestions);
236
-    }
237
-
238
-    @PostMapping("/mark_call")
239
-    public ResultVo markCall(@RequestBody StudentVo student) {
240
-        Integer psid = student.getPsid();
241
-        String studentpic = student.getStudentpic();
242
-        N_Utils.validation(new Object[]{psid,"互动学生id",1,studentpic,"批改结果",1});
243
-        roomService.updateStudentpic(psid, studentpic);
244
-        return new ResultVo(0,"保存成功");
245
-    }
246
-
247
-    @PostMapping("/mark_question")
248
-    public ResultVo markQuestion(@RequestBody TPaperStudentScantron ps) {
249
-        Integer pssid = ps.getPssid();
250
-        String useranswer = ps.getUseranswer();
251
-        N_Utils.validation(new Object[]{pssid,"考试学生试题id",1,useranswer,"批改结果",2});
252
-        roomPaperService.updateScantronUseranswer(pssid, useranswer);
253
-        return new ResultVo(0, "保存成功");
254
-    }
255
-
256
-    @PostMapping("list_class_stu")
257
-    public ResultVo listStuClass(@RequestBody TClassroom room) {
258
-        try {
259
-            Integer studentid = room.getStudentid();
260
-            String subjectid = room.getSubjectid();
261
-            Integer page = room.getPage();
262
-            Integer pageSize = room.getPageSize();
263
-            N_Utils.validation(new Object[]{studentid,"学生id",1,subjectid,"科目id",2
264
-                    ,page,"显示页码",1,pageSize,"显示条数",1});
265
-            PageHelper.startPage(page, pageSize);
266
-            List<RoomVo> list = roomService.listStuClass(room);
267
-            PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
268
-            return new ResultVo(0,"获取学生课堂回顾列表成功",pageResult);
269
-        } catch (Exception e) {
270
-            log.error("获取学生课堂回顾列表失败:" + e.getMessage());
271
-            return new ResultVo(1,"获取学生课堂回顾列表失败");
272
-        }
273
-    }
274
-
275
-    @PostMapping("/report_stu")
276
-    public ResultVo reportStu(@RequestBody TClassroom room) {
277
-        Long roomid = room.getRoomid();
278
-        Integer createid = room.getCreateid();
279
-        N_Utils.validation(new Object[]{roomid,"课堂id",1,createid,"学生id",1});
280
-        return roomService.getReportStu(roomid, createid);
281
-    }
282
-}

sclass/src/main/java/com/xhkjedu/sclass/mapper/room/RoomAskstudentMapper.java → sclass/src/main/java/com/xhkjedu/sclass/mapper/classroom/ClassroomAskstudentMapper.java View File

@@ -1,16 +1,17 @@
1
-package com.xhkjedu.sclass.mapper.room;
1
+package com.xhkjedu.sclass.mapper.classroom;
2 2
 
3 3
 import com.xhkjedu.sclass.base.TkMapper;
4 4
 import com.xhkjedu.sclass.model.classroom.TClassroomAskstudent;
5 5
 import org.apache.ibatis.annotations.Param;
6 6
 
7
-public interface RoomAskstudentMapper extends TkMapper<TClassroomAskstudent> {
7
+public interface ClassroomAskstudentMapper extends TkMapper<TClassroomAskstudent> {
8 8
     /**
9 9
      * 保存学生作答情况
10
+     *
11
+     * @return java.lang.Integer
10 12
      * @Param [student]
11 13
      * @Author ywx
12 14
      * @Date 2020/7/14 14:04
13
-     * @return java.lang.Integer
14 15
      **/
15 16
     Integer save(@Param("r") TClassroomAskstudent student);
16 17
 

sclass/src/main/java/com/xhkjedu/sclass/mapper/room/RoomAskteacherMapper.java → sclass/src/main/java/com/xhkjedu/sclass/mapper/classroom/ClassroomAskteacherMapper.java View File

@@ -1,16 +1,17 @@
1
-package com.xhkjedu.sclass.mapper.room;
1
+package com.xhkjedu.sclass.mapper.classroom;
2 2
 
3 3
 import com.xhkjedu.sclass.base.TkMapper;
4 4
 import com.xhkjedu.sclass.model.classroom.TClassroomAskteacher;
5 5
 import org.apache.ibatis.annotations.Param;
6 6
 
7
-public interface RoomAskteacherMapper extends TkMapper<TClassroomAskteacher> {
7
+public interface ClassroomAskteacherMapper extends TkMapper<TClassroomAskteacher> {
8 8
     /**
9 9
      * 保存教师互动信息
10
+     *
11
+     * @return java.lang.Integer
10 12
      * @Param [teacher]
11 13
      * @Author ywx
12 14
      * @Date 2020/7/14 14:10
13
-     * @return java.lang.Integer
14 15
      **/
15 16
     Integer save(@Param("r") TClassroomAskteacher teacher);
16 17
 }

+ 10
- 0
sclass/src/main/java/com/xhkjedu/sclass/mapper/classroom/ClassroomFileMapper.java View File

@@ -2,6 +2,16 @@ package com.xhkjedu.sclass.mapper.classroom;
2 2
 
3 3
 import com.xhkjedu.sclass.base.TkMapper;
4 4
 import com.xhkjedu.sclass.model.classroom.TClassroomFile;
5
+import org.apache.ibatis.annotations.Param;
5 6
 
6 7
 public interface ClassroomFileMapper extends TkMapper<TClassroomFile> {
8
+    /**
9
+     * 保存课堂图片信息
10
+     *
11
+     * @return java.lang.Integer
12
+     * @Param [file]
13
+     * @Author ywx
14
+     * @Date 2020/7/14 13:57
15
+     **/
16
+    Integer save(@Param("r") TClassroomFile file);
7 17
 }

+ 152
- 18
sclass/src/main/java/com/xhkjedu/sclass/mapper/classroom/ClassroomMapper.java View File

@@ -3,123 +3,257 @@ package com.xhkjedu.sclass.mapper.classroom;
3 3
 import com.xhkjedu.sclass.base.TkMapper;
4 4
 import com.xhkjedu.sclass.model.classroom.TClassroom;
5 5
 import com.xhkjedu.sclass.model.classroom.TClassroomFile;
6
+import com.xhkjedu.sclass.vo.classroom.ObjectiveVo;
6 7
 import com.xhkjedu.sclass.vo.classroom.ReportEQuestionVo;
7 8
 import com.xhkjedu.sclass.vo.classroom.ReportExamVo;
8 9
 import com.xhkjedu.sclass.vo.classroom.ReportRoomVo;
10
+import com.xhkjedu.sclass.vo.classroom.RoomCorrectVo;
9 11
 import com.xhkjedu.sclass.vo.classroom.RoomVo;
12
+import com.xhkjedu.sclass.vo.classroom.SubjectiveVo;
13
+import com.xhkjedu.sclass.vo.paper.CheckClassVo;
10 14
 import org.apache.ibatis.annotations.Param;
11 15
 
12 16
 import java.util.List;
13 17
 import java.util.Map;
14 18
 
15 19
 public interface ClassroomMapper extends TkMapper<TClassroom> {
20
+    /**
21
+     * 保存课堂
22
+     *
23
+     * @return java.lang.Integer
24
+     * @Param [r]
25
+     * @Author ywx
26
+     * @Date 2020/7/14 14:48
27
+     **/
28
+    Integer save(@Param("r") TClassroom room);
29
+
30
+    /**
31
+     * 获取班级学生id集合
32
+     *
33
+     * @return java.util.List<java.lang.Integer>
34
+     * @Param [roomid]
35
+     * @Author ywx
36
+     * @Date 2020/7/14 17:01
37
+     **/
38
+    List<Integer> listStudentId(@Param("roomid") Long roomid);
39
+
40
+    /**
41
+     * 获取批阅信息
42
+     *
43
+     * @return com.xhkjedu.sclass.vo.classroom.RoomCorrectVo
44
+     * @Param [roomid]
45
+     * @Author ywx
46
+     * @Date 2020/9/9 15:38
47
+     **/
48
+    RoomCorrectVo listCorrect(Long roomid);
49
+
50
+    /**
51
+     * 获取提问批改学生列表
52
+     *
53
+     * @return com.xhkjedu.sclass.vo.paper.CheckClassVo
54
+     * @Param [asktid]
55
+     * @Author ywx
56
+     * @Date 2020/9/9 16:39
57
+     **/
58
+    CheckClassVo listStudentsByAskTid(Long asktid);
59
+
60
+    /**
61
+     * 获取考试批改学生列表
62
+     *
63
+     * @return com.xhkjedu.sclass.vo.paper.CheckClassVo
64
+     * @Param [paperid]
65
+     * @Author ywx
66
+     * @Date 2020/9/9 17:12
67
+     **/
68
+    CheckClassVo listStudentsByPaperId(Long paperid);
69
+
70
+    /**
71
+     * 获取课堂提问客观题详情
72
+     *
73
+     * @return com.xhkjedu.sclass.vo.classroom.ObjectiveVo
74
+     * @Param [asktid]
75
+     * @Author ywx
76
+     * @Date 2020/9/10 11:12
77
+     **/
78
+    ObjectiveVo callObjective(Long asktid, Integer realstunum);
79
+
80
+    /**
81
+     * 获取课堂考试客观题详情
82
+     *
83
+     * @return com.xhkjedu.sclass.vo.classroom.ObjectiveVo
84
+     * @Param [pscaid]
85
+     * @Author ywx
86
+     * @Date 2020/9/10 11:21
87
+     **/
88
+    ObjectiveVo examObjective(Long pscaid, Integer realstunum);
89
+
90
+    /**
91
+     * 获取课堂提问主客观题详情
92
+     *
93
+     * @return com.xhkjedu.sclass.vo.classroom.SubjectiveVo
94
+     * @Param [asktid]
95
+     * @Author ywx
96
+     * @Date 2020/9/10 14:01
97
+     **/
98
+    SubjectiveVo callSubjective(Long asktid, Integer realstunum);
99
+
100
+    /**
101
+     * 获取课堂考试主客观题详情
102
+     *
103
+     * @return com.xhkjedu.sclass.vo.classroom.SubjectiveVo
104
+     * @Param [pscaid]
105
+     * @Author ywx
106
+     * @Date 2020/9/10 14:24
107
+     **/
108
+    SubjectiveVo examSubjective(Long pscaid, Integer realstunum);
109
+
110
+    /**
111
+     * 课堂提问批阅
112
+     *
113
+     * @return void
114
+     * @Param [asksid, radiocorrect]
115
+     * @Author ywx
116
+     * @Date 2020/9/10 15:08
117
+     **/
118
+    void correctCall(Integer asksid, Integer radiocorrect);
119
+
120
+    /**
121
+     * 学生课堂回顾列表
122
+     *
123
+     * @return java.util.List<com.xhkjedu.sclass.vo.classroom.RoomVo>
124
+     * @Param [room]
125
+     * @Author ywx
126
+     * @Date 2020/9/14 16:32
127
+     **/
128
+    List<RoomVo> listStuClass(@Param("room") TClassroom room);
129
+
130
+    /**
131
+     * 学生课堂回顾详情
132
+     *
133
+     * @return com.xhkjedu.sclass.vo.classroom.ReportRoomStuVo
134
+     * @Param [roomid, studentid]
135
+     * @Author ywx
136
+     * @Date 2020/9/14 16:57
137
+     **/
138
+    Map getReportStu(Long roomid, Integer studentid);
16 139
 
17 140
     /**
18 141
      * 结束课堂
142
+     *
143
+     * @return java.lang.Integer
19 144
      * @Param [room]
20 145
      * @Author ywx
21 146
      * @Date 2020/6/15 9:07
22
-     * @return java.lang.Integer
23 147
      **/
24 148
     Integer endClass(@Param("room") TClassroom room);
25 149
 
26 150
     /**
27 151
      * 获取教师指定章节下上过的课堂历史
152
+     *
153
+     * @return java.util.List<com.xhkjedu.vo.classroom.RoomVo>
28 154
      * @Param [room]
29 155
      * @Author ywx
30 156
      * @Date 2020/6/15 9:18
31
-     * @return java.util.List<com.xhkjedu.vo.classroom.RoomVo>
32 157
      **/
33 158
     List<RoomVo> listClassByDirectorId(@Param("room") TClassroom room);
34 159
 
35 160
     /**
36
-     *功能描述  批量更新班级实际签到学生数量
161
+     * 功能描述  批量更新班级实际签到学生数量
162
+     *
163
+     * @param * @param roomidlist
164
+     * @return void
37 165
      * @author WN
38 166
      * @date 2020/8/14
39
-     * @param  * @param roomidlist
40
-     * @return void
41 167
      */
42 168
     void updateBatchRoomRealStunum(List<Long> roomidlist);
43 169
 
44
-
45 170
     /**
46 171
      * 根据班级id获取学生数量
172
+     *
173
+     * @return java.lang.Integer
47 174
      * @Param [classid]
48 175
      * @Author ywx
49 176
      * @Date 2020/6/15 9:08
50
-     * @return java.lang.Integer
51 177
      **/
52 178
     Integer getStudentNumById(@Param("classid") Integer classid);
53 179
 
54 180
     /**
55 181
      * 课堂回顾详情
182
+     *
183
+     * @return com.xhkjedu.vo.classroom.ReportRoomVo
56 184
      * @Param [roomid]
57 185
      * @Author ywx
58 186
      * @Date 2020/6/26 9:36
59
-     * @return com.xhkjedu.vo.classroom.ReportRoomVo
60 187
      **/
61 188
     ReportRoomVo getReport(Long roomid);
62 189
 
63 190
     /**
64 191
      * 课堂提问列表
192
+     *
193
+     * @return java.util.List<com.xhkjedu.vo.classroom.ReportQuestionVo>
65 194
      * @Param [roomid]
66 195
      * @Author ywx
67 196
      * @Date 2020/6/26 9:53
68
-     * @return java.util.List<com.xhkjedu.vo.classroom.ReportQuestionVo>
69 197
      **/
70 198
     List<Map> listQuestionReport(Long roomid);
71 199
 
72 200
     /**
73 201
      * 课堂点名列表
202
+     *
203
+     * @return java.util.List<com.xhkjedu.vo.classroom.ReportStudentVo>
74 204
      * @Param [roomid]
75 205
      * @Author ywx
76 206
      * @Date 2020/6/26 10:06
77
-     * @return java.util.List<com.xhkjedu.vo.classroom.ReportStudentVo>
78 207
      **/
79 208
     List<Map> listCallReport(Long roomid);
80 209
 
81 210
     /**
82 211
      * 课堂抢答列表
212
+     *
213
+     * @return java.util.List<com.xhkjedu.vo.classroom.ReportStudentVo>
83 214
      * @Param [roomid]
84 215
      * @Author ywx
85 216
      * @Date 2020/6/26 10:16
86
-     * @return java.util.List<com.xhkjedu.vo.classroom.ReportStudentVo>
87 217
      **/
88 218
     List<Map> listAskReport(Long roomid);
89 219
 
90 220
     /**
91 221
      * 课堂截图列表
222
+     *
223
+     * @return java.util.List<com.xhkjedu.model.classroom.TClassroomFile>
92 224
      * @Param [roomid]
93 225
      * @Author ywx
94 226
      * @Date 2020/6/26 10:24
95
-     * @return java.util.List<com.xhkjedu.model.classroom.TClassroomFile>
96 227
      **/
97 228
     List<TClassroomFile> listFileReport(Long roomid);
98 229
 
99 230
     /**
100 231
      * 课堂考试列表
101
-     * @Param [paperid,classid]
232
+     *
233
+     * @return java.util.List<com.xhkjedu.vo.classroom.ReportEQuestionVo>
234
+     * @Param [paperid, classid]
102 235
      * @Author ywx
103 236
      * @Date 2020/6/26 10:34
104
-     * @return java.util.List<com.xhkjedu.vo.classroom.ReportEQuestionVo>
105 237
      **/
106 238
     List<ReportEQuestionVo> listExamReport(Long paperid, Integer classid);
107 239
 
108 240
     /**
109
-     *功能描述  批量结束之前班级的课堂状态
241
+     * 功能描述  批量结束之前班级的课堂状态
242
+     *
243
+     * @param * @param classidlist
244
+     * @return void
110 245
      * @author WN
111 246
      * @date 2020/8/14
112
-     * @param  * @param classidlist
113
-     * @return void
114 247
      */
115 248
     void updateBatchRoomState(List<Integer> classidlist);
116 249
 
117 250
     /**
118 251
      * 获取课堂考试列表
252
+     *
253
+     * @return java.util.List<com.xhkjedu.vo.classroom.ReportExamVo>
119 254
      * @Param [roomid]
120 255
      * @Author ywx
121 256
      * @Date 2020/9/10 9:35
122
-     * @return java.util.List<com.xhkjedu.vo.classroom.ReportExamVo>
123 257
      **/
124 258
     List<ReportExamVo> listPaper(Long roomid);
125 259
 

sclass/src/main/java/com/xhkjedu/sclass/mapper/room/RoomPaperFileMapper.java → sclass/src/main/java/com/xhkjedu/sclass/mapper/classroom/ClassroomPaperFileMapper.java View File

@@ -1,4 +1,4 @@
1
-package com.xhkjedu.sclass.mapper.room;
1
+package com.xhkjedu.sclass.mapper.classroom;
2 2
 
3 3
 import com.xhkjedu.sclass.base.TkMapper;
4 4
 import com.xhkjedu.sclass.model.classroom.TClassroomPaperFile;
@@ -11,7 +11,8 @@ import java.util.List;
11 11
  * @description
12 12
  * @date 2020/7/15 8:36
13 13
  **/
14
-public interface RoomPaperFileMapper extends TkMapper<TClassroomPaperFile> {
15
-    List<TClassroomPaperFile> listObjsByPaperid(Long paperid,Integer qctype);
14
+public interface ClassroomPaperFileMapper extends TkMapper<TClassroomPaperFile> {
15
+    List<TClassroomPaperFile> listObjsByPaperid(Long paperid, Integer qctype);
16
+
16 17
     List<String> listFilepath(Long paperid);
17 18
 }

sclass/src/main/java/com/xhkjedu/sclass/mapper/room/RoomPaperMapper.java → sclass/src/main/java/com/xhkjedu/sclass/mapper/classroom/ClassroomPaperMapper.java View File

@@ -1,4 +1,4 @@
1
-package com.xhkjedu.sclass.mapper.room;
1
+package com.xhkjedu.sclass.mapper.classroom;
2 2
 
3 3
 import com.xhkjedu.sclass.base.TkMapper;
4 4
 import com.xhkjedu.sclass.model.classroom.TClassroomPaper;
@@ -6,8 +6,8 @@ import com.xhkjedu.sclass.model.classroom.TClassroomPaper;
6 6
 /**
7 7
  * @author ywx
8 8
  * @classname RoomPaperMapper
9
- * @description 
9
+ * @description
10 10
  * @date 2020/7/15 8:18
11 11
  **/
12
-public interface RoomPaperMapper extends TkMapper<TClassroomPaper> {
12
+public interface ClassroomPaperMapper extends TkMapper<TClassroomPaper> {
13 13
 }

sclass/src/main/java/com/xhkjedu/sclass/mapper/room/RoomPaperQtypeMapper.java → sclass/src/main/java/com/xhkjedu/sclass/mapper/classroom/ClassroomPaperQtypeMapper.java View File

@@ -1,4 +1,4 @@
1
-package com.xhkjedu.sclass.mapper.room;
1
+package com.xhkjedu.sclass.mapper.classroom;
2 2
 
3 3
 import com.xhkjedu.sclass.base.TkMapper;
4 4
 import com.xhkjedu.sclass.model.classroom.TClassroomPaperQtype;
@@ -9,16 +9,17 @@ import java.util.List;
9 9
 /**
10 10
  * @author ywx
11 11
  * @classname RoomPaperQtypeMapper
12
- * @description 
12
+ * @description
13 13
  * @date 2020/7/15 8:36
14 14
  **/
15
-public interface RoomPaperQtypeMapper extends TkMapper<TClassroomPaperQtype> {
15
+public interface ClassroomPaperQtypeMapper extends TkMapper<TClassroomPaperQtype> {
16 16
     /**
17 17
      * 保存答题卡题型
18
+     *
19
+     * @return java.lang.Integer
18 20
      * @Param [qtypes]
19 21
      * @Author ywx
20 22
      * @Date 2020/7/15 16:42
21
-     * @return java.lang.Integer
22 23
      **/
23 24
     Integer batchSave(@Param("list") List<TClassroomPaperQtype> qtypes);
24 25
 }

sclass/src/main/java/com/xhkjedu/sclass/mapper/room/RoomPaperScantronMapper.java → sclass/src/main/java/com/xhkjedu/sclass/mapper/classroom/ClassroomPaperScantronMapper.java View File

@@ -1,4 +1,4 @@
1
-package com.xhkjedu.sclass.mapper.room;
1
+package com.xhkjedu.sclass.mapper.classroom;
2 2
 
3 3
 import com.xhkjedu.sclass.base.TkMapper;
4 4
 import com.xhkjedu.sclass.model.classroom.TClassroomPaperScantron;
@@ -8,16 +8,17 @@ import java.util.List;
8 8
 /**
9 9
  * @author ywx
10 10
  * @classname RoomPaperScantronMapper
11
- * @description 
11
+ * @description
12 12
  * @date 2020/7/15 8:36
13 13
  **/
14
-public interface RoomPaperScantronMapper extends TkMapper<TClassroomPaperScantron> {
14
+public interface ClassroomPaperScantronMapper extends TkMapper<TClassroomPaperScantron> {
15 15
     /**
16 16
      * 保存答题卡题型下试题
17
+     *
18
+     * @return java.lang.Integer
17 19
      * @Param [savescan]
18 20
      * @Author ywx
19 21
      * @Date 2020/7/15 16:46
20
-     * @return java.lang.Integer
21 22
      **/
22 23
     Integer batchSave(List<TClassroomPaperScantron> savescan);
23 24
 }

sclass/src/main/java/com/xhkjedu/sclass/mapper/room/RoomPaperStudentMapper.java → sclass/src/main/java/com/xhkjedu/sclass/mapper/classroom/ClassroomPaperStudentMapper.java View File

@@ -1,4 +1,4 @@
1
-package com.xhkjedu.sclass.mapper.room;
1
+package com.xhkjedu.sclass.mapper.classroom;
2 2
 
3 3
 import com.xhkjedu.sclass.base.TkMapper;
4 4
 import com.xhkjedu.sclass.model.classroom.TClassroomPaperStudent;
@@ -9,7 +9,7 @@ import com.xhkjedu.sclass.model.classroom.TClassroomPaperStudent;
9 9
  * @description
10 10
  * @date 2020/7/15 16:06
11 11
  **/
12
-public interface RoomPaperStudentMapper extends TkMapper<TClassroomPaperStudent> {
12
+public interface ClassroomPaperStudentMapper extends TkMapper<TClassroomPaperStudent> {
13 13
     //获取考试学生信息
14 14
     TClassroomPaperStudent findById(Integer psid);
15 15
 

sclass/src/main/java/com/xhkjedu/sclass/mapper/room/RoomPaperStudentScantronMapper.java → sclass/src/main/java/com/xhkjedu/sclass/mapper/classroom/ClassroomPaperStudentScantronMapper.java View File

@@ -1,4 +1,4 @@
1
-package com.xhkjedu.sclass.mapper.room;
1
+package com.xhkjedu.sclass.mapper.classroom;
2 2
 
3 3
 import com.xhkjedu.sclass.base.TkMapper;
4 4
 import com.xhkjedu.sclass.model.classroom.TClassroomPaperStudentScantron;
@@ -14,7 +14,7 @@ import java.util.Map;
14 14
  * @description
15 15
  * @date 2020/7/15 8:37
16 16
  **/
17
-public interface RoomPaperStudentScantronMapper extends TkMapper<TClassroomPaperStudentScantron> {
17
+public interface ClassroomPaperStudentScantronMapper extends TkMapper<TClassroomPaperStudentScantron> {
18 18
     //批量更新试题批改信息
19 19
     void updateScantronQuestionBatch(@Param("list") List<TPaperStudentScantron> psslist);
20 20
 

+ 12
- 1
sclass/src/main/java/com/xhkjedu/sclass/mapper/classroom/ClassroomSignMapper.java View File

@@ -11,10 +11,21 @@ public interface ClassroomSignMapper extends TkMapper<TClassroomSign> {
11 11
 
12 12
     /**
13 13
      * 获取课堂学生列表
14
+     *
15
+     * @return java.util.List<com.xhkjedu.vo.classroom.StudentSignVo>
14 16
      * @Param [roomid]
15 17
      * @Author ywx
16 18
      * @Date 2020/9/8 10:19
17
-     * @return java.util.List<com.xhkjedu.vo.classroom.StudentSignVo>
18 19
      **/
19 20
     List<Map> listStudent(@Param("roomid") Long roomid);
21
+
22
+    /**
23
+     * 保存学生签到信息
24
+     *
25
+     * @return java.lang.Integer
26
+     * @Param [sign]
27
+     * @Author ywx
28
+     * @Date 2020/7/14 14:13
29
+     **/
30
+    Integer save(@Param("r") TClassroomSign sign);
20 31
 }

+ 0
- 16
sclass/src/main/java/com/xhkjedu/sclass/mapper/room/RoomFileMapper.java View File

@@ -1,16 +0,0 @@
1
-package com.xhkjedu.sclass.mapper.room;
2
-
3
-import com.xhkjedu.sclass.base.TkMapper;
4
-import com.xhkjedu.sclass.model.classroom.TClassroomFile;
5
-import org.apache.ibatis.annotations.Param;
6
-
7
-public interface RoomFileMapper extends TkMapper<TClassroomFile> {
8
-    /**
9
-     * 保存课堂图片信息
10
-     * @Param [file]
11
-     * @Author ywx
12
-     * @Date 2020/7/14 13:57
13
-     * @return java.lang.Integer
14
-     **/
15
-    Integer save(@Param("r") TClassroomFile file);
16
-}

+ 0
- 123
sclass/src/main/java/com/xhkjedu/sclass/mapper/room/RoomMapper.java View File

@@ -1,123 +0,0 @@
1
-package com.xhkjedu.sclass.mapper.room;
2
-
3
-import com.xhkjedu.sclass.base.TkMapper;
4
-import com.xhkjedu.sclass.model.classroom.TClassroom;
5
-import com.xhkjedu.sclass.vo.classroom.ObjectiveVo;
6
-import com.xhkjedu.sclass.vo.classroom.RoomCorrectVo;
7
-import com.xhkjedu.sclass.vo.classroom.RoomVo;
8
-import com.xhkjedu.sclass.vo.classroom.SubjectiveVo;
9
-import com.xhkjedu.sclass.vo.paper.CheckClassVo;
10
-import org.apache.ibatis.annotations.Param;
11
-
12
-import java.util.List;
13
-import java.util.Map;
14
-
15
-public interface RoomMapper extends TkMapper<TClassroom> {
16
-    /**
17
-     * 保存课堂
18
-     * @Param [r]
19
-     * @Author ywx
20
-     * @Date 2020/7/14 14:48
21
-     * @return java.lang.Integer
22
-     **/
23
-    Integer save(@Param("r") TClassroom room);
24
-
25
-    /**
26
-     * 获取班级学生id集合
27
-     * @Param [roomid]
28
-     * @Author ywx
29
-     * @Date 2020/7/14 17:01
30
-     * @return java.util.List<java.lang.Integer>
31
-     **/
32
-    List<Integer> listStudentId(@Param("roomid") Long roomid);
33
-
34
-    /**
35
-     * 获取批阅信息
36
-     * @Param [roomid]
37
-     * @Author ywx
38
-     * @Date 2020/9/9 15:38
39
-     * @return com.xhkjedu.sclass.vo.classroom.RoomCorrectVo
40
-     **/
41
-    RoomCorrectVo listCorrect(Long roomid);
42
-
43
-    /**
44
-     * 获取提问批改学生列表
45
-     * @Param [asktid]
46
-     * @Author ywx
47
-     * @Date 2020/9/9 16:39
48
-     * @return com.xhkjedu.sclass.vo.paper.CheckClassVo
49
-     **/
50
-    CheckClassVo listStudentsByAskTid(Long asktid);
51
-
52
-    /**
53
-     * 获取考试批改学生列表
54
-     * @Param [paperid]
55
-     * @Author ywx
56
-     * @Date 2020/9/9 17:12
57
-     * @return com.xhkjedu.sclass.vo.paper.CheckClassVo
58
-     **/
59
-    CheckClassVo listStudentsByPaperId(Long paperid);
60
-
61
-    /**
62
-     * 获取课堂提问客观题详情
63
-     * @Param [asktid]
64
-     * @Author ywx
65
-     * @Date 2020/9/10 11:12
66
-     * @return com.xhkjedu.sclass.vo.classroom.ObjectiveVo
67
-     **/
68
-    ObjectiveVo callObjective(Long asktid, Integer realstunum);
69
-
70
-    /**
71
-     * 获取课堂考试客观题详情
72
-     * @Param [pscaid]
73
-     * @Author ywx
74
-     * @Date 2020/9/10 11:21
75
-     * @return com.xhkjedu.sclass.vo.classroom.ObjectiveVo
76
-     **/
77
-    ObjectiveVo examObjective(Long pscaid, Integer realstunum);
78
-
79
-    /**
80
-     * 获取课堂提问主客观题详情
81
-     * @Param [asktid]
82
-     * @Author ywx
83
-     * @Date 2020/9/10 14:01
84
-     * @return com.xhkjedu.sclass.vo.classroom.SubjectiveVo
85
-     **/
86
-    SubjectiveVo callSubjective(Long asktid, Integer realstunum);
87
-
88
-    /**
89
-     * 获取课堂考试主客观题详情
90
-     * @Param [pscaid]
91
-     * @Author ywx
92
-     * @Date 2020/9/10 14:24
93
-     * @return com.xhkjedu.sclass.vo.classroom.SubjectiveVo
94
-     **/
95
-    SubjectiveVo examSubjective(Long pscaid, Integer realstunum);
96
-
97
-    /**
98
-     * 课堂提问批阅
99
-     * @Param [asksid, radiocorrect]
100
-     * @Author ywx
101
-     * @Date 2020/9/10 15:08
102
-     * @return void
103
-     **/
104
-    void correctCall(Integer asksid, Integer radiocorrect);
105
-
106
-    /**
107
-     * 学生课堂回顾列表
108
-     * @Param [room]
109
-     * @Author ywx
110
-     * @Date 2020/9/14 16:32
111
-     * @return java.util.List<com.xhkjedu.sclass.vo.classroom.RoomVo>
112
-     **/
113
-    List<RoomVo> listStuClass(@Param("room") TClassroom room);
114
-
115
-    /**
116
-     * 学生课堂回顾详情
117
-     * @Param [roomid, studentid]
118
-     * @Author ywx
119
-     * @Date 2020/9/14 16:57
120
-     * @return com.xhkjedu.sclass.vo.classroom.ReportRoomStuVo
121
-     **/
122
-    Map getReportStu(Long roomid, Integer studentid);
123
-}

+ 0
- 16
sclass/src/main/java/com/xhkjedu/sclass/mapper/room/RoomSignMapper.java View File

@@ -1,16 +0,0 @@
1
-package com.xhkjedu.sclass.mapper.room;
2
-
3
-import com.xhkjedu.sclass.base.TkMapper;
4
-import com.xhkjedu.sclass.model.classroom.TClassroomSign;
5
-import org.apache.ibatis.annotations.Param;
6
-
7
-public interface RoomSignMapper extends TkMapper<TClassroomSign> {
8
-    /**
9
-     * 保存学生签到信息
10
-     * @Param [sign]
11
-     * @Author ywx
12
-     * @Date 2020/7/14 14:13
13
-     * @return java.lang.Integer
14
-     **/
15
-    Integer save(@Param("r") TClassroomSign sign);
16
-}

sclass/src/main/java/com/xhkjedu/sclass/service/classroom/RoomPaperService.java → sclass/src/main/java/com/xhkjedu/sclass/service/classroom/ClassroomPaperService.java View File

@@ -1,12 +1,12 @@
1 1
 package com.xhkjedu.sclass.service.classroom;
2 2
 
3 3
 import com.alibaba.fastjson.JSON;
4
-import com.xhkjedu.sclass.mapper.room.RoomPaperFileMapper;
5
-import com.xhkjedu.sclass.mapper.room.RoomPaperMapper;
6
-import com.xhkjedu.sclass.mapper.room.RoomPaperQtypeMapper;
7
-import com.xhkjedu.sclass.mapper.room.RoomPaperScantronMapper;
8
-import com.xhkjedu.sclass.mapper.room.RoomPaperStudentMapper;
9
-import com.xhkjedu.sclass.mapper.room.RoomPaperStudentScantronMapper;
4
+import com.xhkjedu.sclass.mapper.classroom.ClassroomPaperFileMapper;
5
+import com.xhkjedu.sclass.mapper.classroom.ClassroomPaperMapper;
6
+import com.xhkjedu.sclass.mapper.classroom.ClassroomPaperQtypeMapper;
7
+import com.xhkjedu.sclass.mapper.classroom.ClassroomPaperScantronMapper;
8
+import com.xhkjedu.sclass.mapper.classroom.ClassroomPaperStudentMapper;
9
+import com.xhkjedu.sclass.mapper.classroom.ClassroomPaperStudentScantronMapper;
10 10
 import com.xhkjedu.sclass.model.classroom.TClassroomPaper;
11 11
 import com.xhkjedu.sclass.model.classroom.TClassroomPaperFile;
12 12
 import com.xhkjedu.sclass.model.classroom.TClassroomPaperQtype;
@@ -34,19 +34,19 @@ import java.util.stream.Collectors;
34 34
  **/
35 35
 @Slf4j
36 36
 @Service
37
-public class RoomPaperService {
37
+public class ClassroomPaperService {
38 38
     @Resource
39
-    private RoomPaperMapper roomPaperMapper;
39
+    private ClassroomPaperMapper classroomPaperMapper;
40 40
     @Resource
41
-    private RoomPaperFileMapper roomPaperFileMapper;
41
+    private ClassroomPaperFileMapper classroomPaperFileMapper;
42 42
     @Resource
43
-    private RoomPaperQtypeMapper roomPaperQtypeMapper;
43
+    private ClassroomPaperQtypeMapper classroomPaperQtypeMapper;
44 44
     @Resource
45
-    private RoomPaperScantronMapper roomPaperScantronMapper;
45
+    private ClassroomPaperScantronMapper classroomPaperScantronMapper;
46 46
     @Resource
47
-    private RoomPaperStudentMapper roomPaperStudentMapper;
47
+    private ClassroomPaperStudentMapper classroomPaperStudentMapper;
48 48
     @Resource
49
-    private RoomPaperStudentScantronMapper roomPaperStudentScantronMapper;
49
+    private ClassroomPaperStudentScantronMapper classroomPaperStudentScantronMapper;
50 50
 
51 51
     /**
52 52
      * 答题卡作业--保存
@@ -71,7 +71,7 @@ public class RoomPaperService {
71 71
             if (directorid != null && (directorid.equals("0") || directorid.equals(""))) {
72 72
                 paper.setDirectorid(null);
73 73
             }
74
-            roomPaperMapper.insertSelective(paper);//保存作业
74
+            classroomPaperMapper.insertSelective(paper);//保存作业
75 75
 
76 76
             //保存作业关联信息
77 77
             List<TClassroomPaperFile> lst = paper.getPfiles();
@@ -98,7 +98,7 @@ public class RoomPaperService {
98 98
             pf.setSchoolid(paper.getSchoolid());
99 99
             pf.setPaperid(paper.getPaperid());
100 100
         }
101
-        roomPaperFileMapper.insertList(lst);
101
+        classroomPaperFileMapper.insertList(lst);
102 102
     }
103 103
 
104 104
     //课堂考试--保存答题卡-题型-试题
@@ -131,9 +131,9 @@ public class RoomPaperService {
131 131
         }
132 132
 
133 133
         //保存答题卡题型
134
-        roomPaperQtypeMapper.batchSave(qtypes);
134
+        classroomPaperQtypeMapper.batchSave(qtypes);
135 135
         //保存答题卡题型下试题
136
-        roomPaperScantronMapper.batchSave(savescan);
136
+        classroomPaperScantronMapper.batchSave(savescan);
137 137
     }
138 138
 
139 139
     /**
@@ -146,7 +146,7 @@ public class RoomPaperService {
146 146
     @Transactional(rollbackFor = Exception.class)
147 147
     public void saveStudentScantron(TClassroomPaperStudent student) {
148 148
         try {
149
-            roomPaperStudentMapper.insertUseGeneratedKeys(student);
149
+            classroomPaperStudentMapper.insertUseGeneratedKeys(student);
150 150
             Integer psid = student.getId();
151 151
             List<TClassroomPaperStudentScantron> scantrons = student.getScantrons();
152 152
             int qorder = 1;//试题序号
@@ -155,7 +155,7 @@ public class RoomPaperService {
155 155
                 s.setQorder(qorder);
156 156
                 qorder++;
157 157
             }
158
-            roomPaperStudentScantronMapper.insertList(scantrons);
158
+            classroomPaperStudentScantronMapper.insertList(scantrons);
159 159
         } catch (Exception e) {
160 160
             log.error("保存学生作答详情失败:"+e.getMessage());
161 161
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -165,7 +165,7 @@ public class RoomPaperService {
165 165
     @Transactional(rollbackFor = Exception.class)
166 166
     public int correctExam(Integer psid, Integer checkid, String questionResult) throws Exception {
167 167
         try {
168
-            TClassroomPaperStudent ps = roomPaperStudentMapper.findById(psid);
168
+            TClassroomPaperStudent ps = classroomPaperStudentMapper.findById(psid);
169 169
             Long paperid = ps.getPaperid();
170 170
             Integer classid = ps.getClassid();
171 171
             List<TPaperStudentScantron> psslist = JSON.parseArray(questionResult, TPaperStudentScantron.class);
@@ -178,13 +178,13 @@ public class RoomPaperService {
178 178
                 }
179 179
 
180 180
                 //批量更新试题批改信息
181
-                roomPaperStudentScantronMapper.updateScantronQuestionBatch(psslist);
181
+                classroomPaperStudentScantronMapper.updateScantronQuestionBatch(psslist);
182 182
             }
183 183
             //更新用户得分
184
-            roomPaperStudentMapper.updateScantronStuScore(psid);
184
+            classroomPaperStudentMapper.updateScantronStuScore(psid);
185 185
             //判断该作业该班级时候已经批改完成
186 186
             //查询如果为0,则证明本作业本班级截止当前时间已经提交作业学生全部批改完成
187
-            Integer notCorrect = roomPaperStudentMapper.getNotCorrect(paperid, classid);
187
+            Integer notCorrect = classroomPaperStudentMapper.getNotCorrect(paperid, classid);
188 188
             return notCorrect;
189 189
         } catch (Exception e) {
190 190
             log.error("课堂考试批阅失败:"+e.getMessage());
@@ -201,7 +201,7 @@ public class RoomPaperService {
201 201
      * @return java.lang.Integer
202 202
      **/
203 203
     public Integer getCheckedByPsId(Integer psid) {
204
-        return roomPaperStudentMapper.getCheckedByPsId(psid);
204
+        return classroomPaperStudentMapper.getCheckedByPsId(psid);
205 205
     }
206 206
 
207 207
     /**
@@ -212,7 +212,7 @@ public class RoomPaperService {
212 212
      * @return java.util.List<com.xhkjedu.vo.paperstudent.PaperStudentScantronVo>
213 213
      **/
214 214
     public List<Map> listCorrectQuestion(Integer psid) {
215
-        return roomPaperStudentScantronMapper.listCorrectQuestion(psid);
215
+        return classroomPaperStudentScantronMapper.listCorrectQuestion(psid);
216 216
     }
217 217
 
218 218
     /**
@@ -223,6 +223,6 @@ public class RoomPaperService {
223 223
      * @return void
224 224
      **/
225 225
     public void updateScantronUseranswer(Integer pssid, String useranswer) {
226
-        roomPaperStudentScantronMapper.updateScantronUseranswer(pssid, useranswer);
226
+        classroomPaperStudentScantronMapper.updateScantronUseranswer(pssid, useranswer);
227 227
     }
228 228
 }

+ 369
- 10
sclass/src/main/java/com/xhkjedu/sclass/service/classroom/ClassroomService.java View File

@@ -1,19 +1,35 @@
1 1
 package com.xhkjedu.sclass.service.classroom;
2 2
 
3
+import com.xhkjedu.sclass.mapper.classroom.ClassroomActivestudentMapper;
4
+import com.xhkjedu.sclass.mapper.classroom.ClassroomAskstudentMapper;
5
+import com.xhkjedu.sclass.mapper.classroom.ClassroomAskteacherMapper;
3 6
 import com.xhkjedu.sclass.mapper.classroom.ClassroomFileMapper;
4 7
 import com.xhkjedu.sclass.mapper.classroom.ClassroomMapper;
8
+import com.xhkjedu.sclass.mapper.classroom.ClassroomPaperFileMapper;
5 9
 import com.xhkjedu.sclass.mapper.classroom.ClassroomSignMapper;
6
-import com.xhkjedu.sclass.mapper.room.RoomPaperFileMapper;
7 10
 import com.xhkjedu.sclass.model.classroom.TClassroom;
11
+import com.xhkjedu.sclass.model.classroom.TClassroomAskstudent;
12
+import com.xhkjedu.sclass.model.classroom.TClassroomAskteacher;
8 13
 import com.xhkjedu.sclass.model.classroom.TClassroomFile;
14
+import com.xhkjedu.sclass.model.classroom.TClassroomPaperFile;
15
+import com.xhkjedu.sclass.model.classroom.TClassroomSign;
16
+import com.xhkjedu.sclass.vo.classroom.ObjectiveVo;
9 17
 import com.xhkjedu.sclass.vo.classroom.ReportEQuestionVo;
10 18
 import com.xhkjedu.sclass.vo.classroom.ReportExamVo;
11 19
 import com.xhkjedu.sclass.vo.classroom.ReportRoomVo;
20
+import com.xhkjedu.sclass.vo.classroom.RoomCorrectCallVo;
21
+import com.xhkjedu.sclass.vo.classroom.RoomCorrectExamVo;
22
+import com.xhkjedu.sclass.vo.classroom.RoomCorrectVo;
12 23
 import com.xhkjedu.sclass.vo.classroom.RoomVo;
24
+import com.xhkjedu.sclass.vo.classroom.SubjectiveVo;
25
+import com.xhkjedu.sclass.vo.paper.CheckClassVo;
13 26
 import com.xhkjedu.utils.N_Utils;
14 27
 import com.xhkjedu.vo.ResultVo;
15 28
 import lombok.extern.slf4j.Slf4j;
29
+import org.springframework.dao.DuplicateKeyException;
16 30
 import org.springframework.stereotype.Service;
31
+import org.springframework.transaction.annotation.Transactional;
32
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
17 33
 
18 34
 import javax.annotation.Resource;
19 35
 import java.util.List;
@@ -22,21 +38,363 @@ import java.util.Map;
22 38
 @Slf4j
23 39
 @Service
24 40
 public class ClassroomService {
41
+    @Resource
42
+    private ClassroomAskteacherMapper classroomAskteacherMapper;
43
+    @Resource
44
+    private ClassroomActivestudentMapper classroomActivestudentMapper;
45
+    @Resource
46
+    private ClassroomAskstudentMapper classroomAskstudentMapper;
25 47
     @Resource
26 48
     private ClassroomMapper classroomMapper;
27 49
     @Resource
28
-    private ClassroomSignMapper classroomSignMapper;
50
+    private ClassroomPaperFileMapper classroomPaperFileMapper;
29 51
     @Resource
30
-    private RoomPaperFileMapper roomPaperFileMapper;
52
+    private ClassroomSignMapper classroomSignMapper;
31 53
     @Resource
32 54
     private ClassroomFileMapper classroomFileMapper;
33 55
 
56
+    /**
57
+     * 开始课堂
58
+     *
59
+     * @return void
60
+     * @Param [room]
61
+     * @Author ywx
62
+     * @Date 2020/7/14 17:17
63
+     **/
64
+    @Transactional(rollbackFor = Exception.class)
65
+    public boolean startClass(TClassroom room) {
66
+        boolean rtn = false;//课堂是否重复请求
67
+        try {
68
+            room.setRoomstate(1);
69
+            Integer num = classroomMapper.getStudentNumById(room.getClassid());//根据班级id获取学生数量
70
+            room.setClassnum(num);
71
+            classroomMapper.save(room);
72
+            classroomActivestudentMapper.saveStuActive(room.getRoomid(), room.getClassid(), room.getSchoolid());
73
+        } catch (Exception e) {
74
+            if (e instanceof DuplicateKeyException) {
75
+                rtn = true;
76
+                log.error("接口重复请求,课堂id:" + room.getRoomid() + ",课堂名称:" + room.getRoomname());
77
+            } else {
78
+                log.error("开始课堂失败:" + e.getMessage());
79
+            }
80
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
81
+        }
82
+        return rtn;
83
+    }
84
+
85
+    /**
86
+     * 结束课堂
87
+     *
88
+     * @return void
89
+     * @Param [room]
90
+     * @Author ywx
91
+     * @Date 2020/7/14 17:17
92
+     **/
93
+    @Transactional(rollbackFor = Exception.class)
94
+    public void stopClass(TClassroom room) {
95
+        try {
96
+            Long roomid = room.getRoomid();
97
+            if (N_Utils.isEmptyInteger(room.getEndtime())) {//异常结束:结束时间=开始时间+45分钟
98
+                TClassroom tClassroom = classroomMapper.selectByPrimaryKey(roomid);
99
+                room.setEndtime(tClassroom.getCreatetime() + 60 * 45);
100
+            }
101
+            classroomMapper.endClass(room);//结束课堂
102
+            classroomActivestudentMapper.updateActiveRank(roomid);//更新活跃值排名
103
+        } catch (Exception e) {
104
+            log.error("结束课堂失败:" + e.getMessage());
105
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
106
+        }
107
+    }
108
+
109
+    /**
110
+     * 保存学生签到信息
111
+     *
112
+     * @return void
113
+     * @Param [sign]
114
+     * @Author ywx
115
+     * @Date 2020/7/14 16:32
116
+     **/
117
+    @Transactional(rollbackFor = Exception.class)
118
+    public void saveStudentSign(TClassroomSign sign) {
119
+        try {
120
+            Long roomid = sign.getRoomid();
121
+            Integer userid = sign.getUserid();
122
+            List<Integer> studentids = classroomMapper.listStudentId(roomid);//获取班级学生id集合
123
+            if (N_Utils.numInList(userid, studentids)) {//签到学生是本课堂所在班级学生,添加签到信息
124
+                classroomSignMapper.save(sign);
125
+                //如果一个学生退出课堂再进来数据就不对了,最后计算
126
+                //classroomMapper.updateRealStuNum(sign.getRoomid());//更新班级实际签到学生数量
127
+                classroomActivestudentMapper.updateActiveNum(roomid, userid);//更新学生活跃值
128
+            }
129
+        } catch (Exception e) {
130
+            log.error("保存学生签到信息失败:" + e.getMessage());
131
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
132
+        }
133
+    }
134
+
135
+    /**
136
+     * 功能描述 最后更新课堂名称
137
+     *
138
+     * @param * @param roomlist
139
+     * @return void
140
+     * @author WN
141
+     * @date 2020/8/14
142
+     */
143
+    public void updateBatchRoomRealStunum(List<Long> roomlist) {
144
+        classroomMapper.updateBatchRoomRealStunum(roomlist);
145
+    }
146
+
147
+    /**
148
+     * 互动发起
149
+     *
150
+     * @return void
151
+     * @Param [teacher]
152
+     * @Author ywx
153
+     * @Date 2020/6/15 9:58
154
+     **/
155
+    public void saveWork(TClassroomAskteacher teacher) {
156
+        try {
157
+            if (teacher.getPaperid() == null) {
158
+                teacher.setPaperid(0L);
159
+            }
160
+            if (teacher.getRadionum() == null) {
161
+                teacher.setRadionum(0);
162
+            }
163
+            classroomAskteacherMapper.save(teacher);
164
+        } catch (Exception e) {
165
+            log.error("互动发起失败:" + e.getMessage());
166
+        }
167
+    }
168
+
169
+    /**
170
+     * 保存学生作答情况
171
+     *
172
+     * @return void
173
+     * @Param [student]
174
+     * @Author ywx
175
+     * @Date 2020/7/14 16:34
176
+     **/
177
+    @Transactional(rollbackFor = Exception.class)
178
+    public void saveStuAnswer(TClassroomAskstudent student) {
179
+        try {
180
+            if (student.getStudentradio() == null) {
181
+                student.setStudentradio("");
182
+            }
183
+            if (student.getStudentpic() == null) {
184
+                student.setStudentpic("");
185
+            }
186
+            if (student.getRadiocorrect() == null) {
187
+                student.setRadiocorrect(0);
188
+            }
189
+            if (student.getStudentselected() == null) {
190
+                student.setStudentselected(0);
191
+            }
192
+            classroomAskstudentMapper.save(student);
193
+            //保存成功更新学生活跃值
194
+            classroomActivestudentMapper.updateActiveNum(student.getRoomid(), student.getStudentid());
195
+        } catch (Exception e) {
196
+            log.error("保存学生作答情况失败:" + e.getMessage());
197
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
198
+        }
199
+    }
200
+
201
+    /**
202
+     * 保存课堂图片
203
+     *
204
+     * @return void
205
+     * @Param [file]
206
+     * @Author ywx
207
+     * @Date 2020/7/14 16:42
208
+     **/
209
+    public void saveFile(TClassroomFile file) {
210
+        try {
211
+            classroomFileMapper.save(file);
212
+        } catch (Exception e) {
213
+            log.error("批量保存课堂图片失败:" + e.getMessage());
214
+        }
215
+    }
216
+
217
+    /**
218
+     * 功能描述 批量结束班级之前的课堂
219
+     *
220
+     * @param * @param classidlist
221
+     * @return void
222
+     * @author WN
223
+     * @date 2020/8/14
224
+     */
225
+    public void updateBatchRoomState(List<Integer> classidlist) {
226
+        classroomMapper.updateBatchRoomState(classidlist);
227
+    }
228
+
229
+    /**
230
+     * 获取批阅信息
231
+     *
232
+     * @return com.xhkjedu.sclass.vo.classroom.RoomCorrectVo
233
+     * @Param [roomid]
234
+     * @Author ywx
235
+     * @Date 2020/9/9 15:37
236
+     **/
237
+    public RoomCorrectVo listCorrect(Long roomid) {
238
+        RoomCorrectVo correct = classroomMapper.listCorrect(roomid);
239
+        List<RoomCorrectCallVo> calls = correct.getCalls();
240
+        if (N_Utils.isListNotEmpty(calls)) {
241
+            for (RoomCorrectCallVo call : calls) {
242
+                call.setCorrectrate(N_Utils.getIntegerDivideAndMulitiply(call.getCorrectnum(), call.getStunum()));
243
+            }
244
+        }
245
+        List<RoomCorrectExamVo> exams = correct.getExams();
246
+        if (N_Utils.isListNotEmpty(exams)) {
247
+            for (RoomCorrectExamVo exam : exams) {
248
+                exam.setCorrectrate(N_Utils.getIntegerDivideAndMulitiply(exam.getCorrectnum(), exam.getStunum()));
249
+            }
250
+        }
251
+        return correct;
252
+    }
253
+
254
+    /**
255
+     * 获取提问批改学生列表
256
+     *
257
+     * @return com.xhkjedu.sclass.vo.paper.CheckClassVo
258
+     * @Param [asktid]
259
+     * @Author ywx
260
+     * @Date 2020/9/9 16:38
261
+     **/
262
+    public CheckClassVo listStudentsByAskTid(Long asktid) {
263
+        CheckClassVo classVo = classroomMapper.listStudentsByAskTid(asktid);
264
+        return getCheckClassVo(classVo);
265
+    }
266
+
267
+    /**
268
+     * 计算未提交数、批阅进度
269
+     *
270
+     * @return com.xhkjedu.sclass.vo.paper.CheckClassVo
271
+     * @Param [classVo]
272
+     * @Author ywx
273
+     * @Date 2020/9/10 8:56
274
+     **/
275
+    private CheckClassVo getCheckClassVo(CheckClassVo classVo) {
276
+        Integer ytjnum = classVo.getYtjnum();
277
+        classVo.setWtjnum(classVo.getClassnum() - ytjnum);
278
+        if (!N_Utils.isEmptyInteger(ytjnum)) {
279
+            double scale = N_Utils.getIntegerDivideAndMulitiply(classVo.getYpynum(), ytjnum);
280
+            classVo.setScale(scale);
281
+        } else {
282
+            classVo.setScale(0);
283
+        }
284
+        return classVo;
285
+    }
286
+
287
+    /**
288
+     * 获取考试批改学生列表
289
+     *
290
+     * @return com.xhkjedu.sclass.vo.paper.CheckClassVo
291
+     * @Param [paperid]
292
+     * @Author ywx
293
+     * @Date 2020/9/9 17:12
294
+     **/
295
+    public CheckClassVo listStudentsByPaperId(Long paperid) {
296
+        CheckClassVo classVo = classroomMapper.listStudentsByPaperId(paperid);
297
+        List<TClassroomPaperFile> files = classroomPaperFileMapper.listObjsByPaperid(paperid, 3);
298
+        classVo.setFiles(files);
299
+        return getCheckClassVo(classVo);
300
+    }
301
+
302
+    /**
303
+     * 获取课堂提问客观题详情
304
+     *
305
+     * @return com.xhkjedu.sclass.vo.classroom.ObjectiveVo
306
+     * @Param [asktid]
307
+     * @Author ywx
308
+     * @Date 2020/9/10 11:12
309
+     **/
310
+    public ObjectiveVo callObjective(Long asktid, Integer realstunum) {
311
+        return classroomMapper.callObjective(asktid, realstunum);
312
+    }
313
+
314
+    /**
315
+     * 获取课堂考试客观题详情
316
+     *
317
+     * @return com.xhkjedu.sclass.vo.classroom.ObjectiveVo
318
+     * @Param [pscaid]
319
+     * @Author ywx
320
+     * @Date 2020/9/10 11:21
321
+     **/
322
+    public ObjectiveVo examObjective(Long pscaid, Integer realstunum) {
323
+        return classroomMapper.examObjective(pscaid, realstunum);
324
+    }
325
+
326
+    /**
327
+     * 获取课堂提问主客观题详情
328
+     *
329
+     * @return com.xhkjedu.sclass.vo.classroom.SubjectiveVo
330
+     * @Param [asktid]
331
+     * @Author ywx
332
+     * @Date 2020/9/10 14:01
333
+     **/
334
+    public SubjectiveVo callSubjective(Long asktid, Integer realstunum) {
335
+        return classroomMapper.callSubjective(asktid, realstunum);
336
+    }
337
+
338
+    /**
339
+     * 获取课堂考试主客观题详情
340
+     *
341
+     * @return com.xhkjedu.sclass.vo.classroom.SubjectiveVo
342
+     * @Param [pscaid]
343
+     * @Author ywx
344
+     * @Date 2020/9/10 14:25
345
+     **/
346
+    public SubjectiveVo examSubjective(Long pscaid, Integer realstunum) {
347
+        return classroomMapper.examSubjective(pscaid, realstunum);
348
+    }
349
+
350
+    /**
351
+     * 课堂提问批阅
352
+     *
353
+     * @return void
354
+     * @Param [asksid, radiocorrect]
355
+     * @Author ywx
356
+     * @Date 2020/9/10 15:08
357
+     **/
358
+    public void correctCall(Integer asksid, Integer radiocorrect) {
359
+        classroomMapper.correctCall(asksid, radiocorrect);
360
+    }
361
+
362
+    /**
363
+     * 修改学生作答记录(教师添加批注)
364
+     *
365
+     * @return void
366
+     * @Param [asksid, studentpic]
367
+     * @Author ywx
368
+     * @Date 2020/9/11 15:08
369
+     **/
370
+    public void updateStudentpic(Integer asksid, String studentpic) {
371
+        classroomAskstudentMapper.updateStudentpic(asksid, studentpic);
372
+    }
373
+
374
+    /**
375
+     * 学生课堂回顾列表
376
+     *
377
+     * @return java.util.List<com.xhkjedu.sclass.vo.classroom.RoomVo>
378
+     * @Param [room]
379
+     * @Author ywx
380
+     * @Date 2020/9/14 16:32
381
+     **/
382
+    public List<RoomVo> listStuClass(TClassroom room) {
383
+        return classroomMapper.listStuClass(room);
384
+    }
385
+
386
+    public ResultVo getReportStu(Long roomid, Integer studentid) {
387
+        Map room = classroomMapper.getReportStu(roomid, studentid);
388
+        return new ResultVo(0, "获取学生课堂回顾详情成功", room);
389
+    }
390
+
34 391
     /**
35 392
      * 获取教师指定章节下上过的课堂历史
393
+     *
394
+     * @return java.util.List<com.xhkjedu.sclass.vo.classroom.RoomVo>
36 395
      * @Param [room]
37 396
      * @Author ywx
38 397
      * @Date 2020/6/15 9:19
39
-     * @return java.util.List<com.xhkjedu.sclass.vo.classroom.RoomVo>
40 398
      **/
41 399
     public List<RoomVo> listClassByDirectorId(TClassroom room) {
42 400
         return classroomMapper.listClassByDirectorId(room);
@@ -44,10 +402,11 @@ public class ClassroomService {
44 402
 
45 403
     /**
46 404
      * 课堂回顾详情
405
+     *
406
+     * @return com.xhkjedu.sclass.vo.ResultVo
47 407
      * @Param [roomid]
48 408
      * @Author ywx
49 409
      * @Date 2020/6/26 9:36
50
-     * @return com.xhkjedu.sclass.vo.ResultVo
51 410
      **/
52 411
     public ResultVo getReport(Long roomid) {
53 412
         ReportRoomVo room = classroomMapper.getReport(roomid);
@@ -60,14 +419,14 @@ public class ClassroomService {
60 419
         List<ReportExamVo> exams = classroomMapper.listPaper(roomid);
61 420
         for (ReportExamVo exam : exams) {
62 421
             realstunum = exam.getYtjnum();
63
-            List<String> paperfiles = roomPaperFileMapper.listFilepath(exam.getPaperid());
422
+            List<String> paperfiles = classroomPaperFileMapper.listFilepath(exam.getPaperid());
64 423
             exam.setPaperfiles(paperfiles);
65 424
 
66
-            List<ReportEQuestionVo> equestions = classroomMapper.listExamReport(exam.getPaperid(),exam.getClassid());
425
+            List<ReportEQuestionVo> equestions = classroomMapper.listExamReport(exam.getPaperid(), exam.getClassid());
67 426
             for (ReportEQuestionVo equestion : equestions) {
68
-                Double correctrate = N_Utils.getDoubleDivideAndMulitiply(equestion.getCorrectrate(),realstunum);
427
+                Double correctrate = N_Utils.getDoubleDivideAndMulitiply(equestion.getCorrectrate(), realstunum);
69 428
                 equestion.setCorrectrate(correctrate);
70
-                equestion.setCommitrate(N_Utils.getDoubleDivideAndMulitiply(equestion.getCommitrate(),realstunum));
429
+                equestion.setCommitrate(N_Utils.getDoubleDivideAndMulitiply(equestion.getCommitrate(), realstunum));
71 430
             }
72 431
             exam.setQuestions(equestions);
73 432
         }
@@ -88,7 +447,7 @@ public class ClassroomService {
88 447
         //课堂学生列表
89 448
         List<Map> students = classroomSignMapper.listStudent(roomid);
90 449
         room.setStudents(students);
91
-        return new ResultVo(0, "获取课堂回顾详情成功",room);
450
+        return new ResultVo(0, "获取课堂回顾详情成功", room);
92 451
     }
93 452
 
94 453
     //删除课堂图片

+ 0
- 372
sclass/src/main/java/com/xhkjedu/sclass/service/classroom/RoomService.java View File

@@ -1,372 +0,0 @@
1
-package com.xhkjedu.sclass.service.classroom;
2
-
3
-import com.xhkjedu.sclass.mapper.classroom.ClassroomActivestudentMapper;
4
-import com.xhkjedu.sclass.mapper.classroom.ClassroomMapper;
5
-import com.xhkjedu.sclass.mapper.room.RoomAskstudentMapper;
6
-import com.xhkjedu.sclass.mapper.room.RoomAskteacherMapper;
7
-import com.xhkjedu.sclass.mapper.room.RoomFileMapper;
8
-import com.xhkjedu.sclass.mapper.room.RoomMapper;
9
-import com.xhkjedu.sclass.mapper.room.RoomPaperFileMapper;
10
-import com.xhkjedu.sclass.mapper.room.RoomSignMapper;
11
-import com.xhkjedu.sclass.model.classroom.TClassroom;
12
-import com.xhkjedu.sclass.model.classroom.TClassroomAskstudent;
13
-import com.xhkjedu.sclass.model.classroom.TClassroomAskteacher;
14
-import com.xhkjedu.sclass.model.classroom.TClassroomFile;
15
-import com.xhkjedu.sclass.model.classroom.TClassroomPaperFile;
16
-import com.xhkjedu.sclass.model.classroom.TClassroomSign;
17
-import com.xhkjedu.utils.N_Utils;
18
-import com.xhkjedu.vo.ResultVo;
19
-import com.xhkjedu.sclass.vo.classroom.ObjectiveVo;
20
-import com.xhkjedu.sclass.vo.classroom.RoomCorrectCallVo;
21
-import com.xhkjedu.sclass.vo.classroom.RoomCorrectExamVo;
22
-import com.xhkjedu.sclass.vo.classroom.RoomCorrectVo;
23
-import com.xhkjedu.sclass.vo.classroom.RoomVo;
24
-import com.xhkjedu.sclass.vo.classroom.SubjectiveVo;
25
-import com.xhkjedu.sclass.vo.paper.CheckClassVo;
26
-import lombok.extern.slf4j.Slf4j;
27
-import org.springframework.dao.DuplicateKeyException;
28
-import org.springframework.stereotype.Service;
29
-import org.springframework.transaction.annotation.Transactional;
30
-import org.springframework.transaction.interceptor.TransactionAspectSupport;
31
-
32
-import javax.annotation.Resource;
33
-import java.util.List;
34
-import java.util.Map;
35
-
36
-@Slf4j
37
-@Service
38
-public class RoomService {
39
-    @Resource
40
-    private ClassroomMapper classroomMapper;
41
-    @Resource
42
-    private RoomAskteacherMapper roomAskteacherMapper;
43
-    @Resource
44
-    private ClassroomActivestudentMapper classroomActivestudentMapper;
45
-    @Resource
46
-    private RoomAskstudentMapper roomAskstudentMapper;
47
-    @Resource
48
-    private RoomSignMapper roomSignMapper;
49
-    @Resource
50
-    private RoomFileMapper roomFileMapper;
51
-    @Resource
52
-    private RoomMapper roomMapper;
53
-    @Resource
54
-    private RoomPaperFileMapper roomPaperFileMapper;
55
-
56
-    /**
57
-     * 开始课堂
58
-     * @Param [room]
59
-     * @Author ywx
60
-     * @Date 2020/7/14 17:17
61
-     * @return void
62
-     **/
63
-    @Transactional(rollbackFor = Exception.class)
64
-    public boolean startClass(TClassroom room) {
65
-        boolean rtn = false;//课堂是否重复请求
66
-        try {
67
-            room.setRoomstate(1);
68
-            Integer num = classroomMapper.getStudentNumById(room.getClassid());//根据班级id获取学生数量
69
-            room.setClassnum(num);
70
-            roomMapper.save(room);
71
-            classroomActivestudentMapper.saveStuActive(room.getRoomid(),room.getClassid(),room.getSchoolid());
72
-        } catch (Exception e) {
73
-            if (e instanceof DuplicateKeyException) {
74
-                rtn = true;
75
-                log.error("接口重复请求,课堂id:" + room.getRoomid()+",课堂名称:"+room.getRoomname());
76
-            } else {
77
-                log.error("开始课堂失败:" + e.getMessage());
78
-            }
79
-            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
80
-        }
81
-        return rtn;
82
-    }
83
-
84
-    /**
85
-     * 结束课堂
86
-     * @Param [room]
87
-     * @Author ywx
88
-     * @Date 2020/7/14 17:17
89
-     * @return void
90
-     **/
91
-    @Transactional(rollbackFor = Exception.class)
92
-    public void stopClass(TClassroom room) {
93
-        try {
94
-            Long roomid = room.getRoomid();
95
-            if (N_Utils.isEmptyInteger(room.getEndtime())) {//异常结束:结束时间=开始时间+45分钟
96
-                TClassroom tClassroom = roomMapper.selectByPrimaryKey(roomid);
97
-                room.setEndtime(tClassroom.getCreatetime() + 60 * 45);
98
-            }
99
-            classroomMapper.endClass(room);//结束课堂
100
-            classroomActivestudentMapper.updateActiveRank(roomid);//更新活跃值排名
101
-        } catch (Exception e) {
102
-            log.error("结束课堂失败:" + e.getMessage());
103
-            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
104
-        }
105
-    }
106
-
107
-    /**
108
-     * 保存学生签到信息
109
-     * @Param [sign]
110
-     * @Author ywx
111
-     * @Date 2020/7/14 16:32
112
-     * @return void
113
-     **/
114
-    @Transactional(rollbackFor = Exception.class)
115
-    public void saveStudentSign(TClassroomSign sign) {
116
-        try {
117
-            Long roomid = sign.getRoomid();
118
-            Integer userid = sign.getUserid();
119
-            List<Integer> studentids = roomMapper.listStudentId(roomid);//获取班级学生id集合
120
-            if (N_Utils.numInList(userid, studentids)) {//签到学生是本课堂所在班级学生,添加签到信息
121
-                roomSignMapper.save(sign);
122
-                //如果一个学生退出课堂再进来数据就不对了,最后计算
123
-                //classroomMapper.updateRealStuNum(sign.getRoomid());//更新班级实际签到学生数量
124
-                classroomActivestudentMapper.updateActiveNum(roomid,userid);//更新学生活跃值
125
-            }
126
-        } catch (Exception e) {
127
-            log.error("保存学生签到信息失败:" + e.getMessage());
128
-            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
129
-        }
130
-    }
131
-
132
-
133
-    /**
134
-     *功能描述 最后更新课堂名称
135
-     * @author WN
136
-     * @date 2020/8/14
137
-     * @param  * @param roomlist
138
-     * @return void
139
-     */
140
-    public void updateBatchRoomRealStunum(List<Long> roomlist){
141
-        classroomMapper.updateBatchRoomRealStunum(roomlist);
142
-    }
143
-
144
-    /**
145
-     * 互动发起
146
-     * @Param [teacher]
147
-     * @Author ywx
148
-     * @Date 2020/6/15 9:58
149
-     * @return void
150
-     **/
151
-    public void saveWork(TClassroomAskteacher teacher) {
152
-        try {
153
-            if (teacher.getPaperid() == null){
154
-                teacher.setPaperid(0L);
155
-            }
156
-            if (teacher.getRadionum() == null){
157
-                teacher.setRadionum(0);
158
-            }
159
-            roomAskteacherMapper.save(teacher);
160
-        } catch (Exception e) {
161
-            log.error("互动发起失败:" + e.getMessage());
162
-        }
163
-    }
164
-
165
-    /**
166
-     * 保存学生作答情况
167
-     * @Param [student]
168
-     * @Author ywx
169
-     * @Date 2020/7/14 16:34
170
-     * @return void
171
-     **/
172
-    @Transactional(rollbackFor = Exception.class)
173
-    public void saveStuAnswer(TClassroomAskstudent student) {
174
-        try {
175
-            if (student.getStudentradio() == null){
176
-                student.setStudentradio("");
177
-            }
178
-            if (student.getStudentpic() == null){
179
-                student.setStudentpic("");
180
-            }
181
-            if (student.getRadiocorrect() == null){
182
-                student.setRadiocorrect(0);
183
-            }
184
-            if (student.getStudentselected() == null){
185
-                student.setStudentselected(0);
186
-            }
187
-            roomAskstudentMapper.save(student);
188
-            //保存成功更新学生活跃值
189
-            classroomActivestudentMapper.updateActiveNum(student.getRoomid(),student.getStudentid());
190
-        } catch (Exception e) {
191
-            log.error("保存学生作答情况失败:" + e.getMessage());
192
-            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
193
-        }
194
-    }
195
-
196
-    /**
197
-     * 保存课堂图片
198
-     * @Param [file]
199
-     * @Author ywx
200
-     * @Date 2020/7/14 16:42
201
-     * @return void
202
-     **/
203
-    public void saveFile(TClassroomFile file) {
204
-        try {
205
-            roomFileMapper.save(file);
206
-        } catch (Exception e) {
207
-            log.error("批量保存课堂图片失败:"+e.getMessage());
208
-        }
209
-    }
210
-
211
-    /**
212
-     *功能描述 批量结束班级之前的课堂
213
-     * @author WN
214
-     * @date 2020/8/14
215
-     * @param  * @param classidlist
216
-     * @return void
217
-     */
218
-    public void updateBatchRoomState(List<Integer> classidlist){
219
-        classroomMapper.updateBatchRoomState(classidlist);
220
-    }
221
-
222
-    /**
223
-     * 获取批阅信息
224
-     * @Param [roomid]
225
-     * @Author ywx
226
-     * @Date 2020/9/9 15:37
227
-     * @return com.xhkjedu.sclass.vo.classroom.RoomCorrectVo
228
-     **/
229
-    public RoomCorrectVo listCorrect(Long roomid) {
230
-        RoomCorrectVo correct = roomMapper.listCorrect(roomid);
231
-        List<RoomCorrectCallVo> calls = correct.getCalls();
232
-        if (N_Utils.isListNotEmpty(calls)){
233
-            for (RoomCorrectCallVo call : calls) {
234
-                call.setCorrectrate(N_Utils.getIntegerDivideAndMulitiply(call.getCorrectnum(),call.getStunum()));
235
-            }
236
-        }
237
-        List<RoomCorrectExamVo> exams = correct.getExams();
238
-        if (N_Utils.isListNotEmpty(exams)){
239
-            for (RoomCorrectExamVo exam : exams) {
240
-                exam.setCorrectrate(N_Utils.getIntegerDivideAndMulitiply(exam.getCorrectnum(),exam.getStunum()));
241
-            }
242
-        }
243
-        return correct;
244
-    }
245
-
246
-    /**
247
-     * 获取提问批改学生列表
248
-     * @Param [asktid]
249
-     * @Author ywx
250
-     * @Date 2020/9/9 16:38
251
-     * @return com.xhkjedu.sclass.vo.paper.CheckClassVo
252
-     **/
253
-    public CheckClassVo listStudentsByAskTid(Long asktid) {
254
-        CheckClassVo classVo = roomMapper.listStudentsByAskTid(asktid);
255
-        return getCheckClassVo(classVo);
256
-    }
257
-
258
-    /**
259
-     * 计算未提交数、批阅进度
260
-     * @Param [classVo]
261
-     * @Author ywx
262
-     * @Date 2020/9/10 8:56
263
-     * @return com.xhkjedu.sclass.vo.paper.CheckClassVo
264
-     **/
265
-    private CheckClassVo getCheckClassVo(CheckClassVo classVo) {
266
-        Integer ytjnum = classVo.getYtjnum();
267
-        classVo.setWtjnum(classVo.getClassnum() - ytjnum);
268
-        if (!N_Utils.isEmptyInteger(ytjnum)) {
269
-            double scale = N_Utils.getIntegerDivideAndMulitiply(classVo.getYpynum(), ytjnum);
270
-            classVo.setScale(scale);
271
-        } else {
272
-            classVo.setScale(0);
273
-        }
274
-        return classVo;
275
-    }
276
-
277
-    /**
278
-     * 获取考试批改学生列表
279
-     * @Param [paperid]
280
-     * @Author ywx
281
-     * @Date 2020/9/9 17:12
282
-     * @return com.xhkjedu.sclass.vo.paper.CheckClassVo
283
-     **/
284
-    public CheckClassVo listStudentsByPaperId(Long paperid) {
285
-        CheckClassVo classVo = roomMapper.listStudentsByPaperId(paperid);
286
-        List<TClassroomPaperFile> files = roomPaperFileMapper.listObjsByPaperid(paperid , 3);
287
-        classVo.setFiles(files);
288
-        return getCheckClassVo(classVo);
289
-    }
290
-
291
-    /**
292
-     * 获取课堂提问客观题详情
293
-     * @Param [asktid]
294
-     * @Author ywx
295
-     * @Date 2020/9/10 11:12
296
-     * @return com.xhkjedu.sclass.vo.classroom.ObjectiveVo
297
-     **/
298
-    public ObjectiveVo callObjective(Long asktid, Integer realstunum) {
299
-        return roomMapper.callObjective(asktid, realstunum);
300
-    }
301
-
302
-    /**
303
-     * 获取课堂考试客观题详情
304
-     * @Param [pscaid]
305
-     * @Author ywx
306
-     * @Date 2020/9/10 11:21
307
-     * @return com.xhkjedu.sclass.vo.classroom.ObjectiveVo
308
-     **/
309
-    public ObjectiveVo examObjective(Long pscaid, Integer realstunum) {
310
-        return roomMapper.examObjective(pscaid, realstunum);
311
-    }
312
-
313
-    /**
314
-     * 获取课堂提问主客观题详情
315
-     * @Param [asktid]
316
-     * @Author ywx
317
-     * @Date 2020/9/10 14:01
318
-     * @return com.xhkjedu.sclass.vo.classroom.SubjectiveVo
319
-     **/
320
-    public SubjectiveVo callSubjective(Long asktid, Integer realstunum) {
321
-        return roomMapper.callSubjective(asktid, realstunum);
322
-    }
323
-
324
-    /**
325
-     * 获取课堂考试主客观题详情
326
-     * @Param [pscaid]
327
-     * @Author ywx
328
-     * @Date 2020/9/10 14:25
329
-     * @return com.xhkjedu.sclass.vo.classroom.SubjectiveVo
330
-     **/
331
-    public SubjectiveVo examSubjective(Long pscaid, Integer realstunum) {
332
-        return roomMapper.examSubjective(pscaid, realstunum);
333
-    }
334
-
335
-    /**
336
-     * 课堂提问批阅
337
-     * @Param [asksid, radiocorrect]
338
-     * @Author ywx
339
-     * @Date 2020/9/10 15:08
340
-     * @return void
341
-     **/
342
-    public void correctCall(Integer asksid, Integer radiocorrect) {
343
-        roomMapper.correctCall(asksid,radiocorrect);
344
-    }
345
-
346
-    /**
347
-     * 修改学生作答记录(教师添加批注)
348
-     * @Param [asksid, studentpic]
349
-     * @Author ywx
350
-     * @Date 2020/9/11 15:08
351
-     * @return void
352
-     **/
353
-    public void updateStudentpic(Integer asksid, String studentpic) {
354
-        roomAskstudentMapper.updateStudentpic(asksid, studentpic);
355
-    }
356
-
357
-    /**
358
-     * 学生课堂回顾列表
359
-     * @Param [room]
360
-     * @Author ywx
361
-     * @Date 2020/9/14 16:32
362
-     * @return java.util.List<com.xhkjedu.sclass.vo.classroom.RoomVo>
363
-     **/
364
-    public List<RoomVo> listStuClass(TClassroom room) {
365
-        return roomMapper.listStuClass(room);
366
-    }
367
-
368
-    public ResultVo getReportStu(Long roomid, Integer studentid) {
369
-        Map room = roomMapper.getReportStu(roomid, studentid);
370
-        return new ResultVo(0, "获取学生课堂回顾详情成功",room);
371
-    }
372
-}

+ 49
- 0
sclass/src/main/java/com/xhkjedu/sclass/task/UriMapTask.java View File

@@ -0,0 +1,49 @@
1
+package com.xhkjedu.sclass.task;
2
+
3
+import com.xhkjedu.sclass.utils.ClassUtil;
4
+import org.springframework.scheduling.annotation.Scheduled;
5
+import org.springframework.stereotype.Component;
6
+
7
+import java.util.concurrent.ConcurrentHashMap;
8
+
9
+/**
10
+ * @author ywx
11
+ * @classname ReadTask
12
+ * @description 阅读定时任务
13
+ * CronTrigger配置完整格式为: [秒] [分] [小时] [日] [月] [周] [年]
14
+ * 说明    必填    值                  允许的通配符
15
+ * 秒        是    0-59                , - * /
16
+ * 分        是    0-59                , - * /
17
+ * 时        是    0-23                , - * /
18
+ * 日        是    1-31                , - * ? / L W
19
+ * 月        是    1-12或JAN-DEC       , - * /
20
+ * 周        是    1-7或SUN-SAT        , - * ? / L W
21
+ * 年        否    empty 或1970-2099   , - * /
22
+ * , 表示指定多个值,例如在周字段上设置 "MON,WED,FRI" 表示周一,周三和周五触发
23
+ * - 表示区间。例如 在小时上设置 "10-12",表示 10,11,12点都会触发。
24
+ * * 表示所有值. 例如:在分的字段上设置 "*",表示每一分钟都会触发
25
+ * ? 表示不指定值。使用的场景为不需要关心当前设置这个字段的值。每月的10号触发一个操作,但不关心是周几,具体设置为 0 0 0 10 * ?
26
+ * / 用于递增触发。如在秒上面设置"5/15" 表示从5秒开始,每增15秒触发(5,20,35,50)
27
+ * L 表示最后的意思。在日字段设置上,表示当月的最后一天(依据当前月份,如果是二月还会依据是否是润年[leap]),
28
+ * 在周字段上表示星期六,相当于"7"或"SAT(不区分大小写)"。
29
+ * 如果在"L"前加上数字,则表示该数据的最后一个。例如在周字段上设置"6L"这样的格式,则表示“本月最后一个星期五"
30
+ * W 表示离指定日期的最近那个工作日(周一至周五). 例如在日字段上设置"15W",表示离每月15号最近的那个工作日触发。
31
+ * 如果15号正好是周六,则找最近的周五(14号)触发, 如果15号是周未,则找最近的下周一(16号)触发.
32
+ * 如果15号正好在工作日(周一至周五),则就在该天触发。(注,"W"前只能设置具体的数字,不允许区间"-").
33
+ * @date 2020/9/1 9:36
34
+ **/
35
+@Component
36
+public class UriMapTask {
37
+
38
+    /**
39
+     * 每隔3s清除一下请求地址map
40
+     * @Param []
41
+     * @Author ywx
42
+     * @Date 2020/11/9 12:30
43
+     * @return void
44
+     **/
45
+    @Scheduled(cron = "${cron.deleteUriMap}")
46
+    public void deleteUriMap() {
47
+        ClassUtil.uriMap = new ConcurrentHashMap<>();
48
+    }
49
+}

+ 5
- 0
sclass/src/main/resources/application.properties View File

@@ -52,3 +52,8 @@ spring.redis.jedis.pool.max-active=60000
52 52
 redisdatatime=604800
53 53
 #secretKey必须为24位
54 54
 secretKey=nanhuakaizhangjianwangni
55
+#定时任务
56
+#每隔3s清除一下请求地址map
57
+cron.deleteUriMap=0/3 * * * * ?
58
+#默认为false,不开启定时任务
59
+enable.scheduled=false

sclass/src/main/resources/mapper/room/RoomAskstudentMapper.xml → sclass/src/main/resources/mapper/classroom/ClassroomAskstudentMapper.xml View File

@@ -1,6 +1,6 @@
1 1
 <?xml version="1.0" encoding="UTF-8" ?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
-<mapper namespace="com.xhkjedu.sclass.mapper.room.RoomAskstudentMapper">
3
+<mapper namespace="com.xhkjedu.sclass.mapper.classroom.ClassroomAskstudentMapper">
4 4
     <!--保存学生作答情况-->
5 5
     <insert id="save">
6 6
         insert into t_classroom_askstudent

sclass/src/main/resources/mapper/room/RoomAskteacherMapper.xml → sclass/src/main/resources/mapper/classroom/ClassroomAskteacherMapper.xml View File

@@ -1,6 +1,6 @@
1 1
 <?xml version="1.0" encoding="UTF-8" ?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
-<mapper namespace="com.xhkjedu.sclass.mapper.room.RoomAskteacherMapper">
3
+<mapper namespace="com.xhkjedu.sclass.mapper.classroom.ClassroomAskteacherMapper">
4 4
     <!--保存教师互动信息-->
5 5
     <insert id="save">
6 6
         insert into t_classroom_askteacher

+ 8
- 3
sclass/src/main/resources/mapper/classroom/ClassroomFileMapper.xml View File

@@ -2,7 +2,12 @@
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.xhkjedu.sclass.mapper.classroom.ClassroomFileMapper">
4 4
     <!--获取课堂图片列表-->
5
-    <select id="listFile" resultType="com.xhkjedu.sclass.model.classroom.TClassroomFile">
6
-        SELECT * FROM t_classroom_file WHERE roomid=#{roomid} ORDER BY rfid
7
-    </select>
5
+    <!--<select id="listFile" resultType="com.xhkjedu.sclass.model.classroom.TClassroomFile">-->
6
+    <!--    SELECT * FROM t_classroom_file WHERE roomid=#{roomid} ORDER BY rfid-->
7
+    <!--</select>-->
8
+    <!--保存课堂图片信息-->
9
+    <insert id="save">
10
+        insert into t_classroom_file(roomid,rfpath,rftype,createid,createtime,schoolid)
11
+        values (#{r.roomid},#{r.rfpath},#{r.rftype},#{r.createid},#{r.createtime},#{r.schoolid})
12
+    </insert>
8 13
 </mapper>

+ 283
- 7
sclass/src/main/resources/mapper/classroom/ClassroomMapper.xml View File

@@ -1,6 +1,274 @@
1 1
 <?xml version="1.0" encoding="UTF-8" ?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.xhkjedu.sclass.mapper.classroom.ClassroomMapper">
4
+    <!--保存课堂-->
5
+    <insert id="save">
6
+        insert into t_classroom(roomid,roomname,classid,roomstate,lsbid,teacherid,directorid
7
+        ,directortype,classnum,endtime,createid,createtime,schoolid)
8
+        values
9
+        (#{r.roomid},#{r.roomname},#{r.classid},#{r.roomstate},#{r.lsbid},#{r.teacherid},#{r.directorid}
10
+        ,#{r.directortype},#{r.classnum},#{r.endtime},#{r.teacherid},#{r.createtime},#{r.schoolid})
11
+    </insert>
12
+    <!--获取班级学生id集合-->
13
+    <select id="listStudentId" resultType="java.lang.Integer">
14
+        select cs.studentid from t_class_student cs
15
+        left join t_classroom r on cs.classid=r.classid
16
+        where r.roomid=#{roomid};
17
+    </select>
18
+    <!--获取批阅信息-->
19
+    <resultMap id="correctResult" type="com.xhkjedu.sclass.vo.classroom.RoomCorrectVo">
20
+        <result property="roomid" column="roomid"></result>
21
+        <result property="roomname" column="roomname"></result>
22
+        <result property="createtime" column="createtime"></result>
23
+        <result property="endtime" column="endtime"></result>
24
+        <result property="classname" column="classname"></result>
25
+        <result property="gradeid" column="gradeid"></result>
26
+        <result property="teachername" column="teachername"></result>
27
+        <collection property="calls" ofType="com.xhkjedu.sclass.vo.classroom.RoomCorrectCallVo"
28
+                    select="listCall" column="{roomid=roomid,realstunum=realstunum}">
29
+        </collection>
30
+        <collection property="exams" ofType="com.xhkjedu.sclass.vo.classroom.RoomCorrectExamVo"
31
+                    select="listExam" column="{roomid=roomid,realstunum=realstunum}">
32
+        </collection>
33
+    </resultMap>
34
+    <select id="listCall" resultType="com.xhkjedu.sclass.vo.classroom.RoomCorrectCallVo">
35
+        select s.asktid,count(*)commitnum,count(*) stunum
36
+        ,sum(case when s.radiocorrect!=0 then 1 else 0 end)correctnum
37
+        from t_classroom_askstudent s left join t_classroom_askteacher rt on s.asktid=rt.asktid
38
+        where rt.roomid=#{roomid} and rt.asktype between 32 and 33
39
+        group by s.asktid
40
+    </select>
41
+    <select id="listExam" resultType="com.xhkjedu.sclass.vo.classroom.RoomCorrectExamVo">
42
+        select s.paperid,p.papername,count(*)commitnum,count(*) stunum
43
+        ,sum(case when s.pschecked!=0 then 1 else 0 end)correctnum
44
+        from t_classroom_paper_student s left join t_classroom_paper p on s.paperid=p.paperid
45
+        left join t_classroom_askteacher rt on s.paperid=rt.paperid
46
+        where rt.roomid=#{roomid} and rt.asktype=40
47
+        group by s.paperid
48
+    </select>
49
+    <select id="listCorrect" resultMap="correctResult">
50
+        select r.roomid,r.roomname,r.createtime,r.endtime,r.realstunum
51
+        ,c.classname,c.gradeid
52
+        ,(select u.username  from t_user u where u.userid=r.createid)teachername
53
+        from t_classroom r left join t_class c on r.classid=c.classid
54
+        where r.roomid=#{roomid}
55
+    </select>
56
+
57
+    <!--获取提问批改学生列表-->
58
+    <resultMap id="checkResult" type="com.xhkjedu.sclass.vo.paper.CheckClassVo">
59
+        <result property="classid" column="classid"></result>
60
+        <result property="classnum" column="classnum"></result>
61
+        <result property="ytjnum" column="ytjnum"></result>
62
+        <result property="ypynum" column="ypynum"></result>
63
+        <result property="teacherpic" column="teacherpic"></result>
64
+        <collection property="students" ofType="com.xhkjedu.sclass.vo.paperstudent.StudentVo">
65
+            <result property="psid" column="psid"></result>
66
+            <result property="studentid" column="studentid"></result>
67
+            <result property="studentname" column="studentname"></result>
68
+            <result property="pschecked" column="pschecked"></result>
69
+            <result property="studentpic" column="studentpic"></result>
70
+        </collection>
71
+    </resultMap>
72
+    <select id="listStudentsByAskTid" resultMap="checkResult">
73
+        select rs.classid,rs.asksid psid,rs.studentid,u.username studentname,rs.radiocorrect pschecked,rs.studentpic,rt.teacherpic
74
+        ,count(rs2.asksid)ytjnum,count(rs2.asksid)classnum
75
+        ,sum(case when rs2.radiocorrect!=0 then 1 else 0 end)ypynum
76
+        from t_classroom_askstudent rs left join t_user u on rs.studentid=u.userid
77
+        left join t_classroom_askteacher rt on rs.asktid=rt.asktid
78
+        left join t_classroom_askstudent rs2 on rs2.asktid=rs.asktid
79
+        where rs.asktid=#{asktid}
80
+        group by rs.asksid
81
+    </select>
82
+    <!--获取考试批改学生列表-->
83
+    <select id="listStudentsByPaperId" resultMap="checkResult">
84
+        select ps.classid,ps.paperid,ps.psid,ps.studentid,u.username studentname,ps.pschecked
85
+        ,count(ps2.psid)ytjnum,count(ps2.psid)classnum
86
+        ,sum(case when ps2.pschecked=1 then 1 else 0 end)ypynum
87
+        from t_classroom_paper_student ps left join t_user u on ps.studentid=u.userid
88
+        left join t_classroom_paper_student ps2 on ps2.paperid=ps.paperid
89
+        where ps.paperid=#{paperid}
90
+        group by ps.psid
91
+    </select>
92
+
93
+    <resultMap id="objectiveResult" type="com.xhkjedu.sclass.vo.classroom.ObjectiveVo">
94
+        <result property="typename" column="typename"></result>
95
+        <result property="answer" column="answer"></result>
96
+        <result property="correctrate" column="correctrate"></result>
97
+        <result property="psorder" column="psorder"></result>
98
+        <result property="psscore" column="psscore"></result>
99
+        <result property="avgscore" column="avgscore"></result>
100
+        <result property="maxscore" column="maxscore"></result>
101
+        <collection property="answers" ofType="com.xhkjedu.sclass.vo.classroom.ObjectiveAnswerVo">
102
+            <result property="section" column="section"></result>
103
+            <result property="stunum" column="stunum"></result>
104
+            <result property="stuscore" column="stuscore"></result>
105
+            <result property="stuname" column="stuname"></result>
106
+        </collection>
107
+    </resultMap>
108
+    <!--客观题详情-->
109
+    <select id="callObjective" resultMap="objectiveResult">
110
+        select (case rt.asktype when 30 then '判断题' when 31 then '选择题' when 32 then '简答题' else '画图题' end )typename
111
+        ,rt.radioanswer answer,rs.studentradio section,count(*)stunum
112
+        ,group_concat(u.username order by convert(u.username using gbk) separator '  ')stuname
113
+        ,truncate((select sum(case when rs2.radiocorrect=1 then 1 else 0 end)*100/
114
+        count(*) from t_classroom_askstudent rs2 where rs2.asktid=rt.asktid),2)correctrate
115
+        from t_classroom_askstudent rs right join t_classroom_askteacher rt on rs.asktid=rt.asktid
116
+        left join t_user u on rs.studentid=u.userid
117
+        where rt.asktid=#{asktid}
118
+        group by rs.studentradio
119
+    </select>
120
+    <!--2020.11.16修改,125行添加left-->
121
+    <select id="examObjective" resultMap="objectiveResult">
122
+        select ps.ctypename typename,ps.psanswer answer,ps.psorder,ps.psscore
123
+        ,pss.useranswer section,count(*)stunum,pss.stuscore,a.avgscore,a.maxscore
124
+        ,group_concat(u.username order by convert(u.username using gbk) separator '  ')stuname
125
+        from t_classroom_paper_scantron ps left join t_classroom_paper_student_scantron pss on ps.pscaid=pss.pscaid
126
+        left join (select truncate(sum(pss2.stuscore)/(select count(ps2.psid)
127
+        from t_classroom_paper_student ps2 where ps2.paperid=pss2.paperid),2)avgscore
128
+        ,max(pss2.stuscore)maxscore,pss2.pscaid
129
+        FROM t_classroom_paper_student_scantron pss2 WHERE pss2.pscaid=#{pscaid})a on ps.pscaid=a.pscaid
130
+        left join t_user u on pss.studentid=u.userid
131
+        where ps.pscaid=#{pscaid}
132
+        group by pss.useranswer
133
+    </select>
134
+
135
+    <resultMap id="subjectiveResult" type="com.xhkjedu.sclass.vo.classroom.SubjectiveVo">
136
+        <result property="typename" column="typename"></result>
137
+        <result property="correctrate" column="correctrate"></result>
138
+        <result property="psorder" column="psorder"></result>
139
+        <result property="psscore" column="psscore"></result>
140
+        <result property="avgscore" column="avgscore"></result>
141
+        <result property="maxscore" column="maxscore"></result>
142
+        <collection property="answers" ofType="java.util.Map">
143
+            <result property="useranswer" column="useranswer"></result>
144
+            <result property="checked" column="checked"></result>
145
+            <result property="stuscore" column="stuscore"></result>
146
+            <result property="stuname" column="stuname"></result>
147
+        </collection>
148
+    </resultMap>
149
+    <!--主观题详情-->
150
+    <select id="callSubjective" resultMap="subjectiveResult">
151
+        select (case rt.asktype when 30 then '判断题' when 31 then '选择题' when 32 then '简答题' else '画图题' end )typename
152
+        ,rs.studentpic useranswer,rs.radiocorrect checked,u.username stuname
153
+        ,(select ifnull(truncate(sum(case when s.radiocorrect=1 then 1 else 0 end)*100/count(*),2),0)
154
+        from t_classroom_askstudent s where s.asktid=rt.asktid)correctrate
155
+        from t_classroom_askstudent rs right join t_classroom_askteacher rt on rs.asktid=rt.asktid
156
+        left join t_user u on rs.studentid=u.userid
157
+        where rt.asktid=#{asktid}
158
+    </select>
159
+    <select id="examSubjective" resultMap="subjectiveResult">
160
+        select ps.ctypename typename,ps.psorder,ps.psscore,a.avgscore,a.maxscore
161
+        ,pss.useranswer,pss.checked,pss.stuscore,u.username stuname
162
+        from t_classroom_paper_scantron ps left join t_classroom_paper_student_scantron pss on ps.pscaid=pss.pscaid
163
+        left join t_user u on pss.studentid=u.userid
164
+        left join(select truncate(sum(pss1.stuscore)/(select count(ps2.psid)
165
+        from t_classroom_paper_student ps2 where ps2.paperid=pss1.paperid),2)avgscore
166
+        ,max(pss1.stuscore)maxscore,pss1.pscaid
167
+        from t_classroom_paper_student_scantron pss1 where pss1.pscaid=#{pscaid})a on pss.pscaid=a.pscaid
168
+        where ps.pscaid=#{pscaid}
169
+    </select>
170
+
171
+    <!--课堂提问批阅-->
172
+    <update id="correctCall">
173
+        update t_classroom_askstudent set radiocorrect=#{radiocorrect} where asksid=#{asksid}
174
+    </update>
175
+    <!--学生课堂回顾列表-->
176
+    <select id="listStuClass" resultType="com.xhkjedu.sclass.vo.classroom.RoomVo">
177
+        select r.roomid,r.roomname,r.classid,r.roomstate,r.directorid,r.createtime,r.endtime,r.realstunum,u.username createname
178
+        ,(select d.directorname from t_director d where d.directorid=r.directorid)directorname
179
+        from t_classroom r left join t_user u on r.teacherid=u.userid
180
+        left join t_subject_book sb on r.lsbid=sb.lsbid
181
+        left join t_class_student cs on r.classid=cs.classid
182
+        where cs.studentid=#{room.studentid} and sb.subjectid=#{room.subjectid}
183
+        <if test="room.directorid!=null and room.directorid!='0'.toString() and room.directorid!=''">and r.directorid=#{room.directorid}</if>
184
+        order by r.createtime desc
185
+    </select>
186
+    <!--学生课堂回顾详情-->
187
+    <resultMap id="stuRoomResult" type="java.util.Map">
188
+        <result property="roomid" column="roomid"></result>
189
+        <result property="roomname" column="roomname"></result>
190
+        <result property="createtime" column="createtime"></result>
191
+        <result property="endtime" column="endtime"></result>
192
+        <result property="classnum" column="classnum"></result>
193
+        <result property="realstunum" column="realstunum"></result>
194
+        <collection property="questions" ofType="java.util.Map"
195
+                    select="listStuCall" column="{roomid=roomid,studentid=studentid}">
196
+        </collection>
197
+        <collection property="exams" ofType="java.util.Map"
198
+                    select="listStuExam" column="{roomid=roomid,studentid=studentid,realstunum=realstunum}">
199
+        </collection>
200
+        <collection property="asks" ofType="java.util.Map"
201
+                    select="listStuAsk" column="{roomid=roomid,studentid=studentid}">
202
+        </collection>
203
+        <collection property="files" ofType="com.xhkjedu.sclass.model.classroom.TClassroomFile"
204
+                    select="listFile" column="{roomid=roomid}">
205
+        </collection>
206
+    </resultMap>
207
+    <select id="listFile" resultType="com.xhkjedu.sclass.model.classroom.TClassroomFile">
208
+        select * from t_classroom_file where roomid=#{roomid}
209
+    </select>
210
+    <select id="getReportStu" resultMap="stuRoomResult">
211
+        select r.roomid,r.roomname,r.endtime,r.createtime,r.classnum,r.realstunum,#{studentid} studentid
212
+        from t_classroom r where r.roomid=#{roomid} limit 1
213
+    </select>
214
+    <select id="listStuCall" resultType="java.util.Map">
215
+        select rt.asktype,rt.teacherpic,rt.radioanswer,ifnull(s.createtime,0)createtime,s.radiocorrect
216
+        ,(case when rt.asktype between 32 and 33 then s.studentpic else s.studentradio end)useranswer
217
+        ,(select ifnull(truncate(sum(case when s1.radiocorrect=1 then 1 else 0 end)*100/count(*),2),0)
218
+        from t_classroom_askstudent s1 where s1.asktid=rt.asktid)correctrate
219
+        from t_classroom_askstudent s right join t_classroom_askteacher rt on s.asktid=rt.asktid and s.studentid=#{studentid}
220
+        where rt.roomid=#{roomid} and rt.asktype between 30 and 33
221
+        group by rt.asktid
222
+    </select>
223
+    <select id="listStuAsk" resultType="java.util.Map">
224
+        select a.asktype,a.fqnum,a.cynum,truncate(a.cynum*100/a.fqnum,2)cyrate
225
+        from(select rt.asktype,count(distinct rt.asktid)fqnum,(select count(*) from t_classroom_askstudent s1
226
+        left join t_classroom_askteacher rt1 on s1.asktid=rt1.asktid
227
+        where rt1.roomid=rt.roomid and rt1.asktype=rt.asktype and s1.studentid=#{studentid})cynum
228
+        from t_classroom_askstudent s right join t_classroom_askteacher rt on s.asktid=rt.asktid
229
+        where rt.roomid=#{roomid} and rt.asktype between 20 and 21
230
+        group by rt.asktype)a
231
+    </select>
232
+    <resultMap id="stuExamResult" type="java.util.Map">
233
+        <result property="paperid" column="paperid"></result>
234
+        <result property="papername" column="papername"></result>
235
+        <result property="papernum" column="papernum"></result>
236
+        <result property="paperscore" column="paperscore"></result>
237
+        <result property="avgscore" column="avgscore"></result>
238
+        <result property="maxscore" column="maxscore"></result>
239
+        <result property="scorerate" column="scorerate"></result>
240
+        <result property="stuscore" column="stuscore"></result>
241
+        <collection property="files" ofType="java.lang.String"
242
+                    select="listStuEFile" column="{paperid=paperid}">
243
+        </collection>
244
+        <collection property="questions" ofType="java.util.Map"
245
+                    select="listStuEQuestion" column="{paperid=paperid,studentid=studentid,realstunum=realstunum}">
246
+        </collection>
247
+    </resultMap>
248
+    <select id="listStuEFile" resultType="java.lang.String">
249
+        select filepath from t_classroom_paper_file where paperid=#{paperid} order by fileorder
250
+    </select>
251
+    <select id="listStuExam" resultMap="stuExamResult">
252
+        select p.paperid,p.papername,p.papernum,p.paperscore
253
+        ,(select ifnull(truncate(sum(s.stuscore)/(count(s.psid)*s.paperscore),2),0))avgscore
254
+        ,(select ifnull(max(s.stuscore),0))maxscore
255
+        ,ifnull(truncate(s1.stuscore*100/p.paperscore,2),0)scorerate,ifnull(s1.stuscore,0)stuscore,s1.psid
256
+        ,#{studentid} studentid,count(s.psid) realstunum
257
+        from t_classroom_paper p right join t_classroom_askteacher rt on p.paperid=rt.paperid
258
+        left join t_classroom_paper_student s on s.paperid=p.paperid
259
+        left join t_classroom_paper_student s1 on s1.paperid=rt.paperid and s1.studentid=#{studentid}
260
+        where rt.roomid=#{roomid} and rt.asktype=40 and p.paperid is not null
261
+        group by p.paperid
262
+    </select>
263
+    <select id="listStuEQuestion" resultType="java.util.Map">
264
+        select
265
+        ps.pscaid,ps.psorder,ps.ctypename,ps.ctype,ps.psscore,ps.psanswer,ifnull(pss.stuscore,0)stuscore,pss.useranswer
266
+        ,ifnull(truncate(pss.stuscore*100/pss.qscore,2),0)scorerate
267
+        ,ifnull(truncate(sum(pss1.stuscore)/#{realstunum},2),0)avgscore,ifnull(max(pss1.stuscore),0)maxscore
268
+        from t_classroom_paper_scantron ps left join t_classroom_paper_student_scantron pss1 on ps.pscaid=pss1.pscaid
269
+        left join t_classroom_paper_student_scantron pss on ps.pscaid=pss.pscaid and pss.studentid=#{studentid}
270
+        where ps.paperid=#{paperid} group by ps.pscaid
271
+    </select>
4 272
     <!--结束课堂-->
5 273
     <update id="endClass">
6 274
         UPDATE t_classroom SET roomstate=2,endtime=#{room.endtime} where roomid=#{room.roomid};
@@ -17,7 +285,9 @@
17 285
     </select>
18 286
     <!--获取教师指定章节下上过的课堂历史-->
19 287
     <select id="listClassByDirectorId" resultType="com.xhkjedu.sclass.vo.classroom.RoomVo">
20
-        SELECT c.roomid,c.roomname,c.classid,g.classname,g.gradeid,c.roomstate,c.createtime,c.endtime,c.realstunum,d.directorname,u.username createname
288
+        SELECT
289
+        c.roomid,c.roomname,c.classid,g.classname,g.gradeid,c.roomstate,c.createtime,c.endtime,c.realstunum,d.directorname,u.username
290
+        createname
21 291
         ,(select count(rs.asksid)+count(ps.psid) from t_classroom_askteacher rt
22 292
         left join t_classroom_askstudent rs on rt.asktid=rs.asktid and rs.radiocorrect=0
23 293
         left join t_classroom_paper_student ps on rt.paperid=ps.paperid and ps.pschecked!=1
@@ -26,15 +296,20 @@
26 296
         left join t_director d on c.directorid=d.directorid
27 297
         left join t_user u on c.teacherid=u.userid
28 298
         WHERE c.teacherid=#{room.teacherid} and c.lsbid=#{room.lsbid}
29
-        <if test="room.directorid!=null and room.directorid!='0'.toString() and room.directorid!=''">AND c.directorid=#{room.directorid}</if>
299
+        <if test="room.directorid!=null and room.directorid!='0'.toString() and room.directorid!=''">AND
300
+            c.directorid=#{room.directorid}
301
+        </if>
30 302
         <if test="room.classid!=null and room.classid!=0">AND c.classid=#{room.classid}</if>
31
-        <if test="room.createtime!=null and room.createtime!=0">AND UNIX_TIMESTAMP(FROM_UNIXTIME(c.createtime,'%Y%m%d'))>=#{room.createtime}</if>
303
+        <if test="room.createtime!=null and room.createtime!=0">AND
304
+            UNIX_TIMESTAMP(FROM_UNIXTIME(c.createtime,'%Y%m%d'))>=#{room.createtime}
305
+        </if>
32 306
         <if test="room.endtime!=null and room.endtime!=0">AND UNIX_TIMESTAMP(FROM_UNIXTIME(c.createtime,'%Y%m%d'))&lt;=#{room.endtime}</if>
33 307
         ORDER BY c.createtime DESC
34 308
     </select>
35 309
     <!--更新班级实际签到学生数量-->
36 310
     <update id="updateBatchRoomRealStunum" parameterType="java.util.List">
37
-        UPDATE t_classroom c SET c.realstunum=(SELECT COUNT(DISTINCT s.userid) FROM t_classroom_sign s WHERE s.roomid=c.roomid )
311
+        UPDATE t_classroom c SET c.realstunum=(SELECT COUNT(DISTINCT s.userid) FROM t_classroom_sign s WHERE
312
+        s.roomid=c.roomid )
38 313
         WHERE
39 314
         <foreach collection="list" item="roomid" index="index" separator="or">
40 315
             c.roomid=#{roomid}
@@ -60,7 +335,8 @@
60 335
     <select id="listQuestionReport" resultType="java.util.Map">
61 336
         select ct.asktype,ct.teacherpic,ct.asktid,ct.radioanswer
62 337
         ,(case when count(cs.asksid)=0 then 0 else 100 end)commitrate
63
-        ,ifnull(truncate(sum(case when cs.radiocorrect=1 and cs.classid=c.classid then 1 else 0 end)*100/count(cs.asksid),2),0)correctrate
338
+        ,ifnull(truncate(sum(case when cs.radiocorrect=1 and cs.classid=c.classid then 1 else 0
339
+        end)*100/count(cs.asksid),2),0)correctrate
64 340
         from t_classroom_askteacher ct left join t_classroom_askstudent cs on ct.asktid = cs.asktid
65 341
         left join t_classroom c on ct.roomid=c.roomid and cs.classid=c.classid
66 342
         where ct.roomid=#{roomid} and ct.asktype between 30 and 33
@@ -102,9 +378,9 @@
102 378
     </select>
103 379
     <!--获取课堂考试列表-->
104 380
     <select id="listPaper" resultType="com.xhkjedu.sclass.vo.classroom.ReportExamVo">
105
-      SELECT p.paperid,p.papername,c.classid,truncate(SUM(ps.stuscore)*100/(p.paperscore*COUNT(ps.psid)),2)scorerate
381
+        SELECT p.paperid,p.papername,c.classid,truncate(SUM(ps.stuscore)*100/(p.paperscore*COUNT(ps.psid)),2)scorerate
106 382
         ,truncate(SUM(ps.stuscore)/COUNT(ps.psid),2)avgscore,MAX(ps.stuscore)maxscore,COUNT(ps.psid)ytjnum,0 wjtnum
107
-        FROM  t_classroom_paper p
383
+        FROM t_classroom_paper p
108 384
         LEFT JOIN t_classroom_paper_student ps ON p.paperid=ps.paperid
109 385
         LEFT JOIN t_classroom_askteacher rt ON p.paperid=rt.paperid
110 386
         LEFT JOIN t_classroom c ON rt.roomid=c.roomid

sclass/src/main/resources/mapper/room/RoomPaperFileMapper.xml → sclass/src/main/resources/mapper/classroom/ClassroomPaperFileMapper.xml View File

@@ -1,6 +1,6 @@
1 1
 <?xml version="1.0" encoding="UTF-8" ?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
-<mapper namespace="com.xhkjedu.sclass.mapper.room.RoomPaperFileMapper">
3
+<mapper namespace="com.xhkjedu.sclass.mapper.classroom.ClassroomPaperFileMapper">
4 4
     <!-- 根据作业id获取作业附件 -->
5 5
     <select id="listObjsByPaperid" resultType="com.xhkjedu.sclass.model.classroom.TClassroomPaperFile">
6 6
         SELECT pfid,paperid,filepath,fileclass,fileorder,createtime

sclass/src/main/resources/mapper/room/RoomPaperQtypeMapper.xml → sclass/src/main/resources/mapper/classroom/ClassroomPaperQtypeMapper.xml View File

@@ -1,11 +1,12 @@
1 1
 <?xml version="1.0" encoding="UTF-8" ?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
-<mapper namespace="com.xhkjedu.sclass.mapper.room.RoomPaperQtypeMapper">
3
+<mapper namespace="com.xhkjedu.sclass.mapper.classroom.ClassroomPaperQtypeMapper">
4 4
     <!--保存答题卡题型-->
5 5
     <insert id="batchSave">
6
-        insert into t_classroom_paper_qtype(pqtypeid,paperid,ctype,ctypename,pqorder,pqscore,pqnum,createid,createtime,schoolid)
6
+        insert into
7
+        t_classroom_paper_qtype(pqtypeid,paperid,ctype,ctypename,pqorder,pqscore,pqnum,createid,createtime,schoolid)
7 8
         values
8
-        <foreach collection ="list" item="r" index= "index" separator =",">
9
+        <foreach collection="list" item="r" index="index" separator=",">
9 10
             (#{r.pqtypeid},#{r.paperid},#{r.ctype},#{r.ctypename},#{r.pqorder},#{r.pqscore},#{r.pqnum}
10 11
             ,#{r.createid},#{r.createtime},#{r.schoolid})
11 12
         </foreach>

sclass/src/main/resources/mapper/room/RoomPaperScantronMapper.xml → sclass/src/main/resources/mapper/classroom/ClassroomPaperScantronMapper.xml View File

@@ -1,12 +1,12 @@
1 1
 <?xml version="1.0" encoding="UTF-8" ?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
-<mapper namespace="com.xhkjedu.sclass.mapper.room.RoomPaperScantronMapper">
3
+<mapper namespace="com.xhkjedu.sclass.mapper.classroom.ClassroomPaperScantronMapper">
4 4
     <!--保存答题卡题型下试题-->
5 5
     <insert id="batchSave">
6 6
         insert into t_classroom_paper_scantron(pscaid,paperid,pqtypeid,ctype,ctypename,psorder,psscore
7 7
         ,createid,createtime,schoolid,psanswer)
8 8
         values
9
-        <foreach collection ="list" item="r" index= "index" separator =",">
9
+        <foreach collection="list" item="r" index="index" separator=",">
10 10
             (#{r.pscaid},#{r.paperid},#{r.pqtypeid},#{r.ctype},#{r.ctypename},#{r.psorder},#{r.psscore}
11 11
             ,#{r.createid},#{r.createtime},#{r.schoolid},#{r.psanswer})
12 12
         </foreach>

sclass/src/main/resources/mapper/room/RoomPaperStudentMapper.xml → sclass/src/main/resources/mapper/classroom/ClassroomPaperStudentMapper.xml View File

@@ -1,6 +1,6 @@
1 1
 <?xml version="1.0" encoding="UTF-8" ?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
-<mapper namespace="com.xhkjedu.sclass.mapper.room.RoomPaperStudentMapper">
3
+<mapper namespace="com.xhkjedu.sclass.mapper.classroom.ClassroomPaperStudentMapper">
4 4
     <!--获取考试学生信息-->
5 5
     <select id="findById" resultType="com.xhkjedu.sclass.model.classroom.TClassroomPaperStudent">
6 6
         select s.*,p.subjectid,p.papername from t_classroom_paper_student s

sclass/src/main/resources/mapper/room/RoomPaperStudentScantronMapper.xml → sclass/src/main/resources/mapper/classroom/ClassroomPaperStudentScantronMapper.xml View File

@@ -1,12 +1,12 @@
1 1
 <?xml version="1.0" encoding="UTF-8" ?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
-<mapper namespace="com.xhkjedu.sclass.mapper.room.RoomPaperStudentScantronMapper">
3
+<mapper namespace="com.xhkjedu.sclass.mapper.classroom.ClassroomPaperStudentScantronMapper">
4 4
     <!--批量更新试题批改信息-->
5 5
     <update id="updateScantronQuestionBatch" parameterType="java.util.List">
6 6
         UPDATE t_classroom_paper_student_scantron
7 7
         <trim prefix="set" suffixOverrides=",">
8 8
             <trim prefix="stuscore = CASE " suffix="END,">
9
-                <foreach collection="list" index="index" item="item" >
9
+                <foreach collection="list" index="index" item="item">
10 10
                     when pssid = #{item.pssid} then #{item.stuscore}
11 11
                 </foreach>
12 12
             </trim>

+ 5
- 0
sclass/src/main/resources/mapper/classroom/ClassroomSignMapper.xml View File

@@ -15,5 +15,10 @@
15 15
         where r.roomid=#{roomid} and cs.userid is null group by s.studentid)a
16 16
         order by convert(a.studentname using gbk)
17 17
     </select>
18
+    <!--保存学生签到信息-->
19
+    <insert id="save">
20
+        insert into t_classroom_sign(roomid,userid,createtime,schoolid)
21
+        values (#{r.roomid},#{r.userid},#{r.createtime},#{r.schoolid})
22
+    </insert>
18 23
 </mapper>
19 24
 

+ 0
- 9
sclass/src/main/resources/mapper/room/RoomFileMapper.xml View File

@@ -1,9 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8" ?>
2
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
-<mapper namespace="com.xhkjedu.sclass.mapper.room.RoomFileMapper">
4
-    <!--保存课堂图片信息-->
5
-    <insert id="save">
6
-        insert into t_classroom_file(roomid,rfpath,rftype,createid,createtime,schoolid)
7
-        values (#{r.roomid},#{r.rfpath},#{r.rftype},#{r.createid},#{r.createtime},#{r.schoolid})
8
-    </insert>
9
-</mapper>

+ 0
- 271
sclass/src/main/resources/mapper/room/RoomMapper.xml View File

@@ -1,271 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8" ?>
2
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
-<mapper namespace="com.xhkjedu.sclass.mapper.room.RoomMapper">
4
-    <!--保存课堂-->
5
-    <insert id="save">
6
-        insert into t_classroom(roomid,roomname,classid,roomstate,lsbid,teacherid,directorid
7
-        ,directortype,classnum,endtime,createid,createtime,schoolid)
8
-        values
9
-        (#{r.roomid},#{r.roomname},#{r.classid},#{r.roomstate},#{r.lsbid},#{r.teacherid},#{r.directorid}
10
-        ,#{r.directortype},#{r.classnum},#{r.endtime},#{r.teacherid},#{r.createtime},#{r.schoolid})
11
-    </insert>
12
-    <!--获取班级学生id集合-->
13
-    <select id="listStudentId" resultType="java.lang.Integer">
14
-        select cs.studentid from t_class_student cs
15
-        left join t_classroom r on cs.classid=r.classid
16
-        where r.roomid=#{roomid};
17
-    </select>
18
-    <!--获取批阅信息-->
19
-    <resultMap id="correctResult" type="com.xhkjedu.sclass.vo.classroom.RoomCorrectVo">
20
-        <result property="roomid" column="roomid"></result>
21
-        <result property="roomname" column="roomname"></result>
22
-        <result property="createtime" column="createtime"></result>
23
-        <result property="endtime" column="endtime"></result>
24
-        <result property="classname" column="classname"></result>
25
-        <result property="gradeid" column="gradeid"></result>
26
-        <result property="teachername" column="teachername"></result>
27
-        <collection property="calls" ofType="com.xhkjedu.sclass.vo.classroom.RoomCorrectCallVo"
28
-                    select="listCall" column="{roomid=roomid,realstunum=realstunum}">
29
-        </collection>
30
-        <collection property="exams" ofType="com.xhkjedu.sclass.vo.classroom.RoomCorrectExamVo"
31
-                    select="listExam" column="{roomid=roomid,realstunum=realstunum}">
32
-        </collection>
33
-    </resultMap>
34
-    <select id="listCall" resultType="com.xhkjedu.sclass.vo.classroom.RoomCorrectCallVo">
35
-        select s.asktid,count(*)commitnum,count(*) stunum
36
-        ,sum(case when s.radiocorrect!=0 then 1 else 0 end)correctnum
37
-        from t_classroom_askstudent s left join t_classroom_askteacher rt on s.asktid=rt.asktid
38
-        where rt.roomid=#{roomid} and rt.asktype between 32 and 33
39
-        group by s.asktid
40
-    </select>
41
-    <select id="listExam" resultType="com.xhkjedu.sclass.vo.classroom.RoomCorrectExamVo">
42
-        select s.paperid,p.papername,count(*)commitnum,count(*) stunum
43
-        ,sum(case when s.pschecked!=0 then 1 else 0 end)correctnum
44
-        from t_classroom_paper_student s left join t_classroom_paper p on s.paperid=p.paperid
45
-        left join t_classroom_askteacher rt on s.paperid=rt.paperid
46
-        where rt.roomid=#{roomid} and rt.asktype=40
47
-        group by s.paperid
48
-    </select>
49
-    <select id="listCorrect" resultMap="correctResult">
50
-        select r.roomid,r.roomname,r.createtime,r.endtime,r.realstunum
51
-        ,c.classname,c.gradeid
52
-        ,(select u.username  from t_user u where u.userid=r.createid)teachername
53
-        from t_classroom r left join t_class c on r.classid=c.classid
54
-        where r.roomid=#{roomid}
55
-    </select>
56
-
57
-    <!--获取提问批改学生列表-->
58
-    <resultMap id="checkResult" type="com.xhkjedu.sclass.vo.paper.CheckClassVo">
59
-        <result property="classid" column="classid"></result>
60
-        <result property="classnum" column="classnum"></result>
61
-        <result property="ytjnum" column="ytjnum"></result>
62
-        <result property="ypynum" column="ypynum"></result>
63
-        <result property="teacherpic" column="teacherpic"></result>
64
-        <collection property="students" ofType="com.xhkjedu.sclass.vo.paperstudent.StudentVo">
65
-            <result property="psid" column="psid"></result>
66
-            <result property="studentid" column="studentid"></result>
67
-            <result property="studentname" column="studentname"></result>
68
-            <result property="pschecked" column="pschecked"></result>
69
-            <result property="studentpic" column="studentpic"></result>
70
-        </collection>
71
-    </resultMap>
72
-    <select id="listStudentsByAskTid" resultMap="checkResult">
73
-        select rs.classid,rs.asksid psid,rs.studentid,u.username studentname,rs.radiocorrect pschecked,rs.studentpic,rt.teacherpic
74
-        ,count(rs2.asksid)ytjnum,count(rs2.asksid)classnum
75
-        ,sum(case when rs2.radiocorrect!=0 then 1 else 0 end)ypynum
76
-        from t_classroom_askstudent rs left join t_user u on rs.studentid=u.userid
77
-        left join t_classroom_askteacher rt on rs.asktid=rt.asktid
78
-        left join t_classroom_askstudent rs2 on rs2.asktid=rs.asktid
79
-        where rs.asktid=#{asktid}
80
-        group by rs.asksid
81
-    </select>
82
-    <!--获取考试批改学生列表-->
83
-    <select id="listStudentsByPaperId" resultMap="checkResult">
84
-        select ps.classid,ps.paperid,ps.psid,ps.studentid,u.username studentname,ps.pschecked
85
-        ,count(ps2.psid)ytjnum,count(ps2.psid)classnum
86
-        ,sum(case when ps2.pschecked=1 then 1 else 0 end)ypynum
87
-        from t_classroom_paper_student ps left join t_user u on ps.studentid=u.userid
88
-        left join t_classroom_paper_student ps2 on ps2.paperid=ps.paperid
89
-        where ps.paperid=#{paperid}
90
-        group by ps.psid
91
-    </select>
92
-
93
-    <resultMap id="objectiveResult" type="com.xhkjedu.sclass.vo.classroom.ObjectiveVo">
94
-        <result property="typename" column="typename"></result>
95
-        <result property="answer" column="answer"></result>
96
-        <result property="correctrate" column="correctrate"></result>
97
-        <result property="psorder" column="psorder"></result>
98
-        <result property="psscore" column="psscore"></result>
99
-        <result property="avgscore" column="avgscore"></result>
100
-        <result property="maxscore" column="maxscore"></result>
101
-        <collection property="answers" ofType="com.xhkjedu.sclass.vo.classroom.ObjectiveAnswerVo">
102
-            <result property="section" column="section"></result>
103
-            <result property="stunum" column="stunum"></result>
104
-            <result property="stuscore" column="stuscore"></result>
105
-            <result property="stuname" column="stuname"></result>
106
-        </collection>
107
-    </resultMap>
108
-    <!--客观题详情-->
109
-    <select id="callObjective" resultMap="objectiveResult">
110
-        select (case rt.asktype when 30 then '判断题' when 31 then '选择题' when 32 then '简答题' else '画图题' end )typename
111
-        ,rt.radioanswer answer,rs.studentradio section,count(*)stunum
112
-        ,group_concat(u.username order by convert(u.username using gbk) separator '  ')stuname
113
-        ,truncate((select sum(case when rs2.radiocorrect=1 then 1 else 0 end)*100/
114
-        count(*) from t_classroom_askstudent rs2 where rs2.asktid=rt.asktid),2)correctrate
115
-        from t_classroom_askstudent rs right join t_classroom_askteacher rt on rs.asktid=rt.asktid
116
-        left join t_user u on rs.studentid=u.userid
117
-        where rt.asktid=#{asktid}
118
-        group by rs.studentradio
119
-    </select>
120
-    <!--2020.11.16修改,125行添加left-->
121
-    <select id="examObjective" resultMap="objectiveResult">
122
-        select ps.ctypename typename,ps.psanswer answer,ps.psorder,ps.psscore
123
-        ,pss.useranswer section,count(*)stunum,pss.stuscore,a.avgscore,a.maxscore
124
-        ,group_concat(u.username order by convert(u.username using gbk) separator '  ')stuname
125
-        from t_classroom_paper_scantron ps left join t_classroom_paper_student_scantron pss on ps.pscaid=pss.pscaid
126
-        left join (select truncate(sum(pss2.stuscore)/(select count(ps2.psid)
127
-        from t_classroom_paper_student ps2 where ps2.paperid=pss2.paperid),2)avgscore
128
-        ,max(pss2.stuscore)maxscore,pss2.pscaid
129
-        FROM t_classroom_paper_student_scantron pss2 WHERE pss2.pscaid=#{pscaid})a on ps.pscaid=a.pscaid
130
-        left join t_user u on pss.studentid=u.userid
131
-        where ps.pscaid=#{pscaid}
132
-        group by pss.useranswer
133
-    </select>
134
-
135
-    <resultMap id="subjectiveResult" type="com.xhkjedu.sclass.vo.classroom.SubjectiveVo">
136
-        <result property="typename" column="typename"></result>
137
-        <result property="correctrate" column="correctrate"></result>
138
-        <result property="psorder" column="psorder"></result>
139
-        <result property="psscore" column="psscore"></result>
140
-        <result property="avgscore" column="avgscore"></result>
141
-        <result property="maxscore" column="maxscore"></result>
142
-        <collection property="answers" ofType="java.util.Map">
143
-            <result property="useranswer" column="useranswer"></result>
144
-            <result property="checked" column="checked"></result>
145
-            <result property="stuscore" column="stuscore"></result>
146
-            <result property="stuname" column="stuname"></result>
147
-        </collection>
148
-    </resultMap>
149
-    <!--主观题详情-->
150
-    <select id="callSubjective" resultMap="subjectiveResult">
151
-        select (case rt.asktype when 30 then '判断题' when 31 then '选择题' when 32 then '简答题' else '画图题' end )typename
152
-        ,rs.studentpic useranswer,rs.radiocorrect checked,u.username stuname
153
-        ,(select ifnull(truncate(sum(case when s.radiocorrect=1 then 1 else 0 end)*100/count(*),2),0)
154
-        from t_classroom_askstudent s where s.asktid=rt.asktid)correctrate
155
-        from t_classroom_askstudent rs right join t_classroom_askteacher rt on rs.asktid=rt.asktid
156
-        left join t_user u on rs.studentid=u.userid
157
-        where rt.asktid=#{asktid}
158
-    </select>
159
-    <select id="examSubjective" resultMap="subjectiveResult">
160
-        select ps.ctypename typename,ps.psorder,ps.psscore,a.avgscore,a.maxscore
161
-        ,pss.useranswer,pss.checked,pss.stuscore,u.username stuname
162
-        from t_classroom_paper_scantron ps left join t_classroom_paper_student_scantron pss on ps.pscaid=pss.pscaid
163
-        left join t_user u on pss.studentid=u.userid
164
-        left join(select truncate(sum(pss1.stuscore)/(select count(ps2.psid)
165
-        from t_classroom_paper_student ps2 where ps2.paperid=pss1.paperid),2)avgscore
166
-        ,max(pss1.stuscore)maxscore,pss1.pscaid
167
-        from t_classroom_paper_student_scantron pss1 where pss1.pscaid=#{pscaid})a on pss.pscaid=a.pscaid
168
-        where ps.pscaid=#{pscaid}
169
-    </select>
170
-
171
-    <!--课堂提问批阅-->
172
-    <update id="correctCall">
173
-        update t_classroom_askstudent set radiocorrect=#{radiocorrect} where asksid=#{asksid}
174
-    </update>
175
-    <!--学生课堂回顾列表-->
176
-    <select id="listStuClass" resultType="com.xhkjedu.sclass.vo.classroom.RoomVo">
177
-        select r.roomid,r.roomname,r.classid,r.roomstate,r.directorid,r.createtime,r.endtime,r.realstunum,u.username createname
178
-        ,(select d.directorname from t_director d where d.directorid=r.directorid)directorname
179
-        from t_classroom r left join t_user u on r.teacherid=u.userid
180
-        left join t_subject_book sb on r.lsbid=sb.lsbid
181
-        left join t_class_student cs on r.classid=cs.classid
182
-        where cs.studentid=#{room.studentid} and sb.subjectid=#{room.subjectid}
183
-        <if test="room.directorid!=null and room.directorid!='0'.toString() and room.directorid!=''">and r.directorid=#{room.directorid}</if>
184
-        order by r.createtime desc
185
-    </select>
186
-    <!--学生课堂回顾详情-->
187
-    <resultMap id="stuRoomResult" type="java.util.Map">
188
-        <result property="roomid" column="roomid"></result>
189
-        <result property="roomname" column="roomname"></result>
190
-        <result property="createtime" column="createtime"></result>
191
-        <result property="endtime" column="endtime"></result>
192
-        <result property="classnum" column="classnum"></result>
193
-        <result property="realstunum" column="realstunum"></result>
194
-        <collection property="questions" ofType="java.util.Map"
195
-                    select="listStuCall" column="{roomid=roomid,studentid=studentid}">
196
-        </collection>
197
-        <collection property="exams" ofType="java.util.Map"
198
-                    select="listStuExam" column="{roomid=roomid,studentid=studentid,realstunum=realstunum}">
199
-        </collection>
200
-        <collection property="asks" ofType="java.util.Map"
201
-                    select="listStuAsk" column="{roomid=roomid,studentid=studentid}">
202
-        </collection>
203
-        <collection property="files" ofType="com.xhkjedu.sclass.model.classroom.TClassroomFile"
204
-                    select="listFile" column="{roomid=roomid}">
205
-        </collection>
206
-    </resultMap>
207
-    <select id="listFile" resultType="com.xhkjedu.sclass.model.classroom.TClassroomFile">
208
-        select * from t_classroom_file where roomid=#{roomid}
209
-    </select>
210
-    <select id="getReportStu" resultMap="stuRoomResult">
211
-        select r.roomid,r.roomname,r.endtime,r.createtime,r.classnum,r.realstunum,#{studentid} studentid
212
-        from t_classroom r where r.roomid=#{roomid} limit 1
213
-    </select>
214
-    <select id="listStuCall" resultType="java.util.Map">
215
-        select rt.asktype,rt.teacherpic,rt.radioanswer,ifnull(s.createtime,0)createtime,s.radiocorrect
216
-        ,(case when rt.asktype between 32 and 33 then s.studentpic else s.studentradio end)useranswer
217
-        ,(select ifnull(truncate(sum(case when s1.radiocorrect=1 then 1 else 0 end)*100/count(*),2),0)
218
-        from t_classroom_askstudent s1 where s1.asktid=rt.asktid)correctrate
219
-        from t_classroom_askstudent s right join t_classroom_askteacher rt on s.asktid=rt.asktid and s.studentid=#{studentid}
220
-        where rt.roomid=#{roomid} and rt.asktype between 30 and 33
221
-        group by rt.asktid
222
-    </select>
223
-    <select id="listStuAsk" resultType="java.util.Map">
224
-        select a.asktype,a.fqnum,a.cynum,truncate(a.cynum*100/a.fqnum,2)cyrate
225
-        from(select rt.asktype,count(distinct rt.asktid)fqnum,(select count(*) from t_classroom_askstudent s1
226
-        left join t_classroom_askteacher rt1 on s1.asktid=rt1.asktid
227
-        where rt1.roomid=rt.roomid and rt1.asktype=rt.asktype and s1.studentid=#{studentid})cynum
228
-        from t_classroom_askstudent s right join t_classroom_askteacher rt on s.asktid=rt.asktid
229
-        where rt.roomid=#{roomid} and rt.asktype between 20 and 21
230
-        group by rt.asktype)a
231
-    </select>
232
-    <resultMap id="stuExamResult" type="java.util.Map">
233
-        <result property="paperid" column="paperid"></result>
234
-        <result property="papername" column="papername"></result>
235
-        <result property="papernum" column="papernum"></result>
236
-        <result property="paperscore" column="paperscore"></result>
237
-        <result property="avgscore" column="avgscore"></result>
238
-        <result property="maxscore" column="maxscore"></result>
239
-        <result property="scorerate" column="scorerate"></result>
240
-        <result property="stuscore" column="stuscore"></result>
241
-        <collection property="files" ofType="java.lang.String"
242
-                    select="listStuEFile" column="{paperid=paperid}">
243
-        </collection>
244
-        <collection property="questions" ofType="java.util.Map"
245
-                    select="listStuEQuestion" column="{paperid=paperid,studentid=studentid,realstunum=realstunum}">
246
-        </collection>
247
-    </resultMap>
248
-    <select id="listStuEFile" resultType="java.lang.String">
249
-        select filepath from t_classroom_paper_file where paperid=#{paperid} order by fileorder
250
-    </select>
251
-    <select id="listStuExam" resultMap="stuExamResult">
252
-        select p.paperid,p.papername,p.papernum,p.paperscore
253
-        ,(select ifnull(truncate(sum(s.stuscore)/(count(s.psid)*s.paperscore),2),0))avgscore
254
-        ,(select ifnull(max(s.stuscore),0))maxscore
255
-        ,ifnull(truncate(s1.stuscore*100/p.paperscore,2),0)scorerate,ifnull(s1.stuscore,0)stuscore,s1.psid
256
-        ,#{studentid} studentid,count(s.psid) realstunum
257
-        from t_classroom_paper p right join t_classroom_askteacher rt on p.paperid=rt.paperid
258
-        left join t_classroom_paper_student s on s.paperid=p.paperid
259
-        left join t_classroom_paper_student s1 on s1.paperid=rt.paperid and s1.studentid=#{studentid}
260
-        where rt.roomid=#{roomid} and rt.asktype=40 and p.paperid is not null
261
-        group by p.paperid
262
-    </select>
263
-    <select id="listStuEQuestion" resultType="java.util.Map">
264
-        select ps.pscaid,ps.psorder,ps.ctypename,ps.ctype,ps.psscore,ps.psanswer,ifnull(pss.stuscore,0)stuscore,pss.useranswer
265
-        ,ifnull(truncate(pss.stuscore*100/pss.qscore,2),0)scorerate
266
-        ,ifnull(truncate(sum(pss1.stuscore)/#{realstunum},2),0)avgscore,ifnull(max(pss1.stuscore),0)maxscore
267
-        from t_classroom_paper_scantron ps left join t_classroom_paper_student_scantron pss1 on ps.pscaid=pss1.pscaid
268
-        left join t_classroom_paper_student_scantron pss on ps.pscaid=pss.pscaid and pss.studentid=#{studentid}
269
-        where ps.paperid=#{paperid} group by ps.pscaid
270
-    </select>
271
-</mapper>

+ 0
- 10
sclass/src/main/resources/mapper/room/RoomSignMapper.xml View File

@@ -1,10 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8" ?>
2
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
-<mapper namespace="com.xhkjedu.sclass.mapper.room.RoomSignMapper">
4
-    <!--保存学生签到信息-->
5
-    <insert id="save">
6
-        insert into t_classroom_sign(roomid,userid,createtime,schoolid)
7
-        values (#{r.roomid},#{r.userid},#{r.createtime},#{r.schoolid})
8
-    </insert>
9
-</mapper>
10
-

Loading…
Cancel
Save