Kaynağa Gözat

调整排课工具相关内容

dzx 1 yıl önce
ebeveyn
işleme
8465f3ddc8

+ 4 - 1
src/main/java/com/xjrsoft/module/courseTable/service/impl/CourseTableServiceImpl.java

@@ -1,5 +1,6 @@
 package com.xjrsoft.module.courseTable.service.impl;
 
+import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.date.DateField;
 import cn.hutool.core.date.DateTime;
@@ -217,7 +218,6 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
             long days = between.toDays();
             int weeks = (int) Math.ceil((double) days / 7);
             if (dto.getWeek() == null) {
-
                 for (int i = 0; i < weeks; i++) {
                     LocalDateTime startDate = startDateTime.plusDays(i * 6).withHour(0).withMinute(0).withSecond(0).withNano(0);
                     LocalDateTime endDate = startDateTime.plusDays((i + 1) * 6).withHour(23).withMinute(59).withSecond(59).withNano(9999);
@@ -250,6 +250,9 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
                 tableVo.setTeacherName(xjrUser.getName());
             }
         }
+        if(dto.getStartDate() != null && dto.getEndDate() != null){
+            dto.setTeacherId(StpUtil.getLoginIdAsLong());
+        }
         List<CourseDetailVo> list = courseTableMapper.getList(dto);
         tableVo.setCourseList(list);
         tableVo.setClassHour(list.size());