Browse Source

管城学校分支课堂优化

wn_class0926
王宁 4 months ago
parent
commit
04e7bfa2b7

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

@@ -167,7 +167,7 @@ public class ClassroomController {
167 167
                 }
168 168
             });
169 169
         });
170
-        return classroomService.batchSaveClass(startclassList, stopclassList, savefileList
170
+        return classroomService.batchSaveClass(rooms,startclassList, stopclassList, savefileList
171 171
                 , askteacherList, askstudentList, signList
172 172
                 , paperList, nodename, stupaperList, paperFileList, paperQtypeList, paperScantronList);
173 173
     }
@@ -287,7 +287,7 @@ public class ClassroomController {
287 287
                 stupaperList.add(student);
288 288
             }
289 289
         }
290
-        return classroomService.saveClass(startclass, stopclass, savefileList
290
+        return classroomService.saveClass(r,startclass, stopclass, savefileList
291 291
                 , askteacherList, askstudentList, signList
292 292
                 , paperList, nodename, stupaperList, paperFileList, paperQtypeList, paperScantronList);
293 293
     }

+ 9
- 5
sclass/src/main/java/com/xhkjedu/sclass/service/classroom/ClassroomService.java View File

@@ -6,6 +6,7 @@ import com.xhkjedu.sclass.model.classroom.*;
6 6
 import com.xhkjedu.sclass.utils.ArithUtil;
7 7
 import com.xhkjedu.sclass.vo.classroom.*;
8 8
 import com.xhkjedu.sclass.vo.paper.CheckClassVo;
9
+import com.xhkjedu.sclass.vo.room.RoomPVo;
9 10
 import com.xhkjedu.sclass.vo.room.RoomParamVo;
10 11
 import com.xhkjedu.utils.N_Utils;
11 12
 import com.xhkjedu.vo.ResultVo;
@@ -544,11 +545,11 @@ public class ClassroomService {
544 545
      * @Date 2022/6/28 16:51
545 546
      **/
546 547
     @Transactional(rollbackFor = Exception.class)
547
-    public ResultVo batchSaveClass(List<TClassroom> startclassList, List<TClassroom> stopclassList
548
+    public ResultVo batchSaveClass(List<RoomPVo> rooms,List<TClassroom> startclassList, List<TClassroom> stopclassList
548 549
             , List<TClassroomFile> savefileList
549 550
             , List<TClassroomAskteacher> askteacherList, List<TClassroomAskstudent> askstudentList
550 551
             , List<TClassroomSign> signList
551
-            , List<TClassroomPaper> paperList,String nodename, List<TClassroomPaperStudent> stupaperList
552
+            , List<TClassroomPaper> paperList, String nodename, List<TClassroomPaperStudent> stupaperList
552 553
             , List<TClassroomPaperFile> paperFileList, List<TClassroomPaperQtype> paperQtypeList
553 554
             , List<TClassroomPaperScantron> paperScantronList) {
554 555
         ResultVo resultVo = new ResultVo();
@@ -596,8 +597,9 @@ public class ClassroomService {
596 597
             resultVo.setMsg("保存成功");
597 598
         } catch (Exception e) {
598 599
             log.error("批量保存课堂数据失败:" + e.getMessage());
600
+            log.error(JSON.toJSONString(rooms));
599 601
             resultVo.setMsg("保存失败");
600
-            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
602
+            throw new RuntimeException("保存失败");
601 603
         }
602 604
         return resultVo;
603 605
     }
@@ -727,7 +729,8 @@ public class ClassroomService {
727 729
      * @Author ywx
728 730
      * @Date 2022/6/30 11:12
729 731
      **/
730
-    public ResultVo saveClass(TClassroom startclass, TClassroom stopclass, List<TClassroomFile> savefileList
732
+    @Transactional(rollbackFor = Exception.class)
733
+    public ResultVo saveClass(RoomPVo r,TClassroom startclass, TClassroom stopclass, List<TClassroomFile> savefileList
731 734
             , List<TClassroomAskteacher> askteacherList, List<TClassroomAskstudent> askstudentList, List<TClassroomSign> signList
732 735
             , List<TClassroomPaper> paperList, String nodename
733 736
             , List<TClassroomPaperStudent> stupaperList, List<TClassroomPaperFile> paperFileList
@@ -775,8 +778,9 @@ public class ClassroomService {
775 778
             resultVo.setMsg("保存成功");
776 779
         } catch (Exception e) {
777 780
             log.error("批量保存课堂数据失败:" + e.getMessage());
781
+            log.error(JSON.toJSONString(r));
778 782
             resultVo.setMsg("保存失败");
779
-            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
783
+            throw new RuntimeException("保存失败");
780 784
         }
781 785
         return resultVo;
782 786
     }

Loading…
Cancel
Save