Browse Source

课表导入

tags/正式3.3.0
雍文秀 2 years ago
parent
commit
65a5868c22
1 changed files with 9 additions and 5 deletions
  1. 9
    5
      slive/src/main/java/com/xhkjedu/slive/utils/PoiUtils.java

+ 9
- 5
slive/src/main/java/com/xhkjedu/slive/utils/PoiUtils.java View File

@@ -178,8 +178,11 @@ public class PoiUtils {
178 178
             String fileName = file.getOriginalFilename();
179 179
             Workbook work = getWorkbook(in, fileName);
180 180
             List<LCourse> kjTeas = new ArrayList<>();//行政直播课课节下班级和教师
181
+            Integer timestamp = N_Utils.getSecondTimestamp();
181 182
             //要删除的行政直播id
182
-            List<Integer> delCourseIds = kjs.stream().filter(c -> c.getCourseid() != null && c.getSectionstate() == 0)
183
+            List<Integer> delCourseIds = kjs.stream().filter(c -> c.getCourseid() != null && c.getSectionstate() == 0
184
+                            && new Integer(N_Utils.getDataToTimestamp(c.getSectiondate() + c.getBegintime()
185
+                            , "yyyy-MM-ddHH:mm")).compareTo(timestamp) == 1)
183 186
                     .map(XzKjVo::getCourseid).collect(Collectors.toList());
184 187
             Sheet sheet;// 分表数据
185 188
             Row row;// 行数据
@@ -245,7 +248,9 @@ public class PoiUtils {
245 248
                             kj = kjs.stream().filter(k -> k.getKjorder() == kjorder
246 249
                                     && sectiondate.equals(k.getSectiondate())).findFirst().orElse(null);
247 250
                             Integer sectionstate = kj == null ? null : kj.getSectionstate();
248
-                            if (sectionstate == null || sectionstate == 0) {//已经开始或结束的课不处理
251
+                            String begintime = sectiondate + " " + t.getBegintime();
252
+                            Integer beginTimestamp = N_Utils.getDataToTimestamp(begintime, "yyyy-MM-dd HH:mm");
253
+                            if (beginTimestamp.compareTo(timestamp) == 1 && (sectionstate == null || sectionstate == 0)) {//已经开始或结束的课不处理
249 254
                                 t.setBegindate(sectiondate);
250 255
                                 t.setEnddate(sectiondate);
251 256
                                 kjTeas.add(t);
@@ -253,9 +258,8 @@ public class PoiUtils {
253 258
                             List<String> meetDates = LiveUtil.getDaysForMeetDates(sectiondate, enddate);
254 259
                             for (int m = 1; m < meetDates.size(); m++) {
255 260
                                 String date = meetDates.get(m);
256
-                                String begintime = date + " " + t.getBegintime();
257
-                                Integer beginTimestamp = N_Utils.getDataToTimestamp(begintime, "yyyy-MM-dd HH:mm");
258
-                                Integer timestamp = N_Utils.getSecondTimestamp();
261
+                                begintime = date + " " + t.getBegintime();
262
+                                beginTimestamp = N_Utils.getDataToTimestamp(begintime, "yyyy-MM-dd HH:mm");
259 263
                                 if (beginTimestamp.compareTo(timestamp) != 1) continue;//如果课节开始时间不大于当前时间不处理
260 264
 
261 265
                                 LCourse t2 = new LCourse();

Loading…
Cancel
Save