浏览代码

学生课堂回顾列表

tags/正式3.3.0
雍文秀 2 年前
父节点
当前提交
8ca68edda6

+ 21
- 22
sclass/src/main/java/com/xhkjedu/sclass/controller/classroom/ClassroomController.java 查看文件

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

+ 17
- 4
sclass/src/main/resources/mapper/classroom/ClassroomMapper.xml 查看文件

@@ -177,16 +177,27 @@
177 177
     <select id="listStuClass" resultMap="classRooms">
178 178
         select r.roomid,r.roomname,r.classid,r.roomstate,r.directorid,r.createtime,r.endtime,r.realstunum,u.username createname
179 179
         ,(select d.directorname from t_director d where d.directorid=r.directorid)directorname
180
+        ,g.gradeid,g.classname
180 181
         from t_classroom r left join t_user u on r.teacherid=u.userid
181 182
         left join t_subject_book sb on r.lsbid=sb.lsbid
182 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 189
         <if test="room.lsbid!=null and room.lsbid!='0'.toString() and room.lsbid!=''">
185 190
           and r.lsbid=#{room.lsbid}
186 191
         </if>
187 192
         <if test="room.directorid!=null and room.directorid!='0'.toString() and room.directorid!=''">
188 193
           and r.directorid=#{room.directorid}
189 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 201
         order by r.createtime desc
191 202
     </select>
192 203
     <!--学生课堂回顾详情-->
@@ -333,10 +344,12 @@
333 344
             c.directorid=#{room.directorid}
334 345
         </if>
335 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 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 353
         ORDER BY c.createtime DESC
341 354
     </select>
342 355
     <select id="listAskTeachersForRoom" resultType="com.xhkjedu.sclass.vo.classroom.RoomAskTeacherVo">

正在加载...
取消
保存