Przeglądaj źródła

行政直播导入时状态

tags/正式3.13.5
王宁 10 miesięcy temu
rodzic
commit
37403080ea

+ 16
- 4
slive/src/main/java/com/xhkjedu/slive/service/xz/XzService.java Wyświetl plik

@@ -755,7 +755,10 @@ public class XzService {
755 755
             xzMapper.updateSaveState(xzid, 1);//修改保存状态
756 756
             List<XzKjVo> kjs = xzKjMapper.listXzKjByXzId(xzid);//获取行政直播课节详情
757 757
             Integer noTimeKjNum = kjs.stream().filter(k -> k.getBegintime() == null).collect(Collectors.toList()).size();
758
-            if (noTimeKjNum != 0) return new ResultVo(1, "请设置课节时间");
758
+            if (noTimeKjNum != 0) {
759
+                xzMapper.updateSaveState(xzid, 0);
760
+                return new ResultVo(1, "请设置课节时间");
761
+            }
759 762
 
760 763
             //根据行政直播id获取该学校当前年份指定年级下的行政班和提高班
761 764
             Integer gradeid = xz.getGradeid();
@@ -765,7 +768,10 @@ public class XzService {
765 768
             String classids = classlst.stream().map((XzClassVo::getClassid)).map(String::valueOf).collect(Collectors.joining(","
766 769
             ));
767 770
             List<CTeacherVo> teachers = classTeacherMapper.listTeacherByClassIds(classids);//获取班级教师
768
-            if (!N_Utils.isListNotEmpty(teachers)) return new ResultVo(1, "请设置班级任教老师");
771
+            if (!N_Utils.isListNotEmpty(teachers)) {
772
+                xzMapper.updateSaveState(xzid, 0);
773
+                return new ResultVo(1, "请设置班级任教老师");
774
+            }
769 775
 
770 776
             String teacherids =
771 777
                     teachers.stream().map((CTeacherVo::getTeacherid)).map(String::valueOf).collect(Collectors.joining(","));
@@ -793,9 +799,15 @@ public class XzService {
793 799
 
794 800
             Map<String, Object> map = PoiUtils.readKb(file, xz, classTeacherMap, userNameSet, kjs);
795 801
             Integer code = (Integer) map.get("code");
796
-            if (code != 0) return new ResultVo(1, map.get("msg").toString());
802
+            if (code != 0) {
803
+                xzMapper.updateSaveState(xzid, 0);
804
+                return new ResultVo(1, map.get("msg").toString());
805
+            }
797 806
             LinkedHashMap<String, List<String>> errMsg = (LinkedHashMap<String, List<String>>) map.get("errMsg");
798
-            if (errMsg.size() != 0) return new ResultVo(1, null, errMsg);
807
+            if (errMsg.size() != 0) {
808
+                xzMapper.updateSaveState(xzid, 0);
809
+                return new ResultVo(1, null, errMsg);
810
+            }
799 811
 
800 812
             List<LCourse> kjTeas = (List<LCourse>) map.get("kjTeas");
801 813
             if (N_Utils.isListEmpty(kjTeas)) return new ResultVo(0, "导入课表成功");

Ładowanie…
Anuluj
Zapisz