Browse Source

学生课堂回顾列表

tags/正式3.3.0
雍文秀 2 years ago
parent
commit
8ca68edda6

+ 21
- 22
sclass/src/main/java/com/xhkjedu/sclass/controller/classroom/ClassroomController.java View File

146
 
146
 
147
     @PostMapping("call_objective")
147
     @PostMapping("call_objective")
148
     public ResultVo callObjective(@RequestBody RoomCorrectCallVo call) {
148
     public ResultVo callObjective(@RequestBody RoomCorrectCallVo call) {
149
+        Long asktid = call.getAsktid();
150
+        N_Utils.validation(new Object[]{asktid, "互动id", 1});
149
         try {
151
         try {
150
-            Long asktid = call.getAsktid();
151
-            N_Utils.validation(new Object[]{asktid, "互动id", 1});
152
             ObjectiveVo objective = classroomService.callObjective(asktid, call.getRealstunum());
152
             ObjectiveVo objective = classroomService.callObjective(asktid, call.getRealstunum());
153
             return new ResultVo(0, "获取课堂提问客观题详情成功", objective);
153
             return new ResultVo(0, "获取课堂提问客观题详情成功", objective);
154
         } catch (Exception e) {
154
         } catch (Exception e) {
159
 
159
 
160
     @PostMapping("exam_objective")
160
     @PostMapping("exam_objective")
161
     public ResultVo examObjective(@RequestBody ReportEQuestionVo question) {
161
     public ResultVo examObjective(@RequestBody ReportEQuestionVo question) {
162
+        Long pscaid = question.getPscaid();
163
+        N_Utils.validation(new Object[]{pscaid, "答题卡id", 1});
162
         try {
164
         try {
163
-            Long pscaid = question.getPscaid();
164
-            N_Utils.validation(new Object[]{pscaid, "答题卡id", 1});
165
             ObjectiveVo objective = classroomService.examObjective(pscaid, question.getRealstunum());
165
             ObjectiveVo objective = classroomService.examObjective(pscaid, question.getRealstunum());
166
             return new ResultVo(0, "获取课堂考试客观题详情成功", objective);
166
             return new ResultVo(0, "获取课堂考试客观题详情成功", objective);
167
         } catch (Exception e) {
167
         } catch (Exception e) {
172
 
172
 
173
     @PostMapping("call_subjective")
173
     @PostMapping("call_subjective")
174
     public ResultVo callSubjective(@RequestBody RoomCorrectCallVo call) {
174
     public ResultVo callSubjective(@RequestBody RoomCorrectCallVo call) {
175
+        Long asktid = call.getAsktid();
176
+        N_Utils.validation(new Object[]{asktid, "互动id", 1});
175
         try {
177
         try {
176
-            Long asktid = call.getAsktid();
177
-            N_Utils.validation(new Object[]{asktid, "互动id", 1});
178
             SubjectiveVo subjective = classroomService.callSubjective(asktid, call.getRealstunum());
178
             SubjectiveVo subjective = classroomService.callSubjective(asktid, call.getRealstunum());
179
             return new ResultVo(0, "获取课堂提问主观题详情成功", subjective);
179
             return new ResultVo(0, "获取课堂提问主观题详情成功", subjective);
180
         } catch (Exception e) {
180
         } catch (Exception e) {
185
 
185
 
186
     @PostMapping("exam_subjective")
186
     @PostMapping("exam_subjective")
187
     public ResultVo examSubjective(@RequestBody ReportEQuestionVo question) {
187
     public ResultVo examSubjective(@RequestBody ReportEQuestionVo question) {
188
+        Long pscaid = question.getPscaid();
189
+        N_Utils.validation(new Object[]{pscaid, "答题卡id", 1});
188
         try {
190
         try {
189
-            Long pscaid = question.getPscaid();
190
-            N_Utils.validation(new Object[]{pscaid, "答题卡id", 1});
191
             SubjectiveVo subjective = classroomService.examSubjective(pscaid, question.getRealstunum());
191
             SubjectiveVo subjective = classroomService.examSubjective(pscaid, question.getRealstunum());
192
             return new ResultVo(0, "获取课堂考试主观题详情成功", subjective);
192
             return new ResultVo(0, "获取课堂考试主观题详情成功", subjective);
193
         } catch (Exception e) {
193
         } catch (Exception e) {
207
 
207
 
208
     @PostMapping("/correct_exam")
208
     @PostMapping("/correct_exam")
209
     public ResultVo correctExam(@RequestBody TPaperStudent ps) {
209
     public ResultVo correctExam(@RequestBody TPaperStudent ps) {
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});
210
         try {
214
         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);
215
             int result = classroomPaperService.correctExam(psid, checkid, questionResult);
216
             if (result > 0) {
216
             if (result > 0) {
217
                 return new ResultVo(0, "批阅成功", 0);
217
                 return new ResultVo(0, "批阅成功", 0);
257
     //学生app 课堂回顾列表
257
     //学生app 课堂回顾列表
258
     @PostMapping("list_class_stu")
258
     @PostMapping("list_class_stu")
259
     public ResultVo listStuClass(@RequestBody TClassroom room) {
259
     public ResultVo listStuClass(@RequestBody TClassroom room) {
260
+        Integer studentid = room.getStudentid();
261
+        Integer page = room.getPage();
262
+        Integer pageSize = room.getPageSize();
263
+        N_Utils.validation(new Object[]{studentid, "学生id", 1
264
+                , page, "显示页码", 1, pageSize, "显示条数", 1});
260
         try {
265
         try {
261
-            Integer studentid = room.getStudentid();
262
-            String subjectid = room.getSubjectid();
263
-            Integer page = room.getPage();
264
-            Integer pageSize = room.getPageSize();
265
-            N_Utils.validation(new Object[]{studentid, "学生id", 1, subjectid, "科目id", 2
266
-                    , page, "显示页码", 1, pageSize, "显示条数", 1});
267
             PageHelper.startPage(page, pageSize);
266
             PageHelper.startPage(page, pageSize);
268
             List<Map> list = classroomService.listStuClass(room);
267
             List<Map> list = classroomService.listStuClass(room);
269
             PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
268
             PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
292
      **/
291
      **/
293
     @PostMapping("list_class_directorid")
292
     @PostMapping("list_class_directorid")
294
     public ResultVo listClassByDirectorId(@RequestBody TClassroom room) {
293
     public ResultVo listClassByDirectorId(@RequestBody TClassroom room) {
294
+        Integer teacherid = room.getTeacherid();
295
+        Integer page = room.getPage();
296
+        Integer pageSize = room.getPageSize();
297
+        N_Utils.validation(new Object[]{teacherid, "教师id", 1, page, "显示页码", 1, pageSize, "显示条数", 1});
295
         try {
298
         try {
296
-            Integer teacherid = room.getTeacherid();
297
-            Integer page = room.getPage();
298
-            Integer pageSize = room.getPageSize();
299
-            N_Utils.validation(new Object[]{teacherid, "教师id", 1, page, "显示页码", 1, pageSize, "显示条数", 1});
300
             PageHelper.startPage(page, pageSize);
299
             PageHelper.startPage(page, pageSize);
301
             List<Map> list = classroomService.listClassByDirectorId(room);
300
             List<Map> list = classroomService.listClassByDirectorId(room);
302
             PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
301
             PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));

+ 17
- 4
sclass/src/main/resources/mapper/classroom/ClassroomMapper.xml View File

177
     <select id="listStuClass" resultMap="classRooms">
177
     <select id="listStuClass" resultMap="classRooms">
178
         select r.roomid,r.roomname,r.classid,r.roomstate,r.directorid,r.createtime,r.endtime,r.realstunum,u.username createname
178
         select r.roomid,r.roomname,r.classid,r.roomstate,r.directorid,r.createtime,r.endtime,r.realstunum,u.username createname
179
         ,(select d.directorname from t_director d where d.directorid=r.directorid)directorname
179
         ,(select d.directorname from t_director d where d.directorid=r.directorid)directorname
180
+        ,g.gradeid,g.classname
180
         from t_classroom r left join t_user u on r.teacherid=u.userid
181
         from t_classroom r left join t_user u on r.teacherid=u.userid
181
         left join t_subject_book sb on r.lsbid=sb.lsbid
182
         left join t_subject_book sb on r.lsbid=sb.lsbid
182
         left join t_class_student cs on r.classid=cs.classid
183
         left join t_class_student cs on r.classid=cs.classid
183
-        where cs.studentid=#{room.studentid} and sb.subjectid=#{room.subjectid}
184
+        LEFT JOIN t_class g ON r.classid=g.classid
185
+        where cs.studentid=#{room.studentid}
186
+        <if test="room.subjectid!=null and room.subjectid!='0'.toString() and room.subjectid!=''">
187
+            and sb.subjectid=#{room.subjectid}
188
+        </if>
184
         <if test="room.lsbid!=null and room.lsbid!='0'.toString() and room.lsbid!=''">
189
         <if test="room.lsbid!=null and room.lsbid!='0'.toString() and room.lsbid!=''">
185
           and r.lsbid=#{room.lsbid}
190
           and r.lsbid=#{room.lsbid}
186
         </if>
191
         </if>
187
         <if test="room.directorid!=null and room.directorid!='0'.toString() and room.directorid!=''">
192
         <if test="room.directorid!=null and room.directorid!='0'.toString() and room.directorid!=''">
188
           and r.directorid=#{room.directorid}
193
           and r.directorid=#{room.directorid}
189
         </if>
194
         </if>
195
+        <if test="room.createtime!=null and room.createtime!=0">
196
+            AND UNIX_TIMESTAMP(FROM_UNIXTIME(r.createtime,'%Y%m%d'))>=#{room.createtime}
197
+        </if>
198
+        <if test="room.endtime!=null and room.endtime!=0">
199
+            AND UNIX_TIMESTAMP(FROM_UNIXTIME(r.createtime,'%Y%m%d'))&lt;=#{room.endtime}
200
+        </if>
190
         order by r.createtime desc
201
         order by r.createtime desc
191
     </select>
202
     </select>
192
     <!--学生课堂回顾详情-->
203
     <!--学生课堂回顾详情-->
333
             c.directorid=#{room.directorid}
344
             c.directorid=#{room.directorid}
334
         </if>
345
         </if>
335
         <if test="room.classid!=null and room.classid!=0">AND c.classid=#{room.classid}</if>
346
         <if test="room.classid!=null and room.classid!=0">AND c.classid=#{room.classid}</if>
336
-        <if test="room.createtime!=null and room.createtime!=0">AND
337
-            UNIX_TIMESTAMP(FROM_UNIXTIME(c.createtime,'%Y%m%d'))>=#{room.createtime}
347
+        <if test="room.createtime!=null and room.createtime!=0">
348
+            AND UNIX_TIMESTAMP(FROM_UNIXTIME(c.createtime,'%Y%m%d'))>=#{room.createtime}
349
+        </if>
350
+        <if test="room.endtime!=null and room.endtime!=0">
351
+            AND UNIX_TIMESTAMP(FROM_UNIXTIME(c.createtime,'%Y%m%d'))&lt;=#{room.endtime}
338
         </if>
352
         </if>
339
-        <if test="room.endtime!=null and room.endtime!=0">AND UNIX_TIMESTAMP(FROM_UNIXTIME(c.createtime,'%Y%m%d'))&lt;=#{room.endtime}</if>
340
         ORDER BY c.createtime DESC
353
         ORDER BY c.createtime DESC
341
     </select>
354
     </select>
342
     <select id="listAskTeachersForRoom" resultType="com.xhkjedu.sclass.vo.classroom.RoomAskTeacherVo">
355
     <select id="listAskTeachersForRoom" resultType="com.xhkjedu.sclass.vo.classroom.RoomAskTeacherVo">

Loading…
Cancel
Save