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

Loading…
Cancel
Save