|
@@ -5,8 +5,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.google.common.collect.Lists;
|
|
|
-import com.ym.mec.common.security.AuthUser;
|
|
|
-import com.ym.mec.common.security.SecurityUtils;
|
|
|
import com.ym.mec.education.base.BaseResponse;
|
|
|
import com.ym.mec.education.base.PageResponse;
|
|
|
import com.ym.mec.education.entity.*;
|
|
@@ -24,7 +22,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
-
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -320,22 +317,14 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherMapper, Teacher> impl
|
|
|
|
|
|
@Override
|
|
|
public PageResponse dailySchedule(TeacherReq req) {
|
|
|
- AuthUser user = SecurityUtils.getUser();
|
|
|
- Optional<AuthUser> optional = Optional.ofNullable(user);
|
|
|
Page<TeacherDailyScheduleResp> pageResult = new Page<>();
|
|
|
- Integer userId;
|
|
|
- if (optional.isPresent()) {
|
|
|
- userId = optional.get().getUserId();
|
|
|
- } else {
|
|
|
- if (Objects.isNull(req.getUserId())) {
|
|
|
- return PageResponse.errorParam();
|
|
|
- }
|
|
|
- userId = req.getUserId();
|
|
|
+ if (Objects.isNull(req.getUserId())) {
|
|
|
+ return PageResponse.errorParam();
|
|
|
}
|
|
|
List<TeacherDailyScheduleResp> list = Lists.newArrayList();
|
|
|
Page<CourseSchedule> courseSchedulePage = new Page<>(req.getPageNo(), req.getPageSize());
|
|
|
QueryWrapper<CourseSchedule> courseScheduleQueryWrapper = new QueryWrapper<>();
|
|
|
- courseScheduleQueryWrapper.lambda().eq(CourseSchedule::getTeacherId, userId)
|
|
|
+ courseScheduleQueryWrapper.lambda().eq(CourseSchedule::getTeacherId, req.getUserId())
|
|
|
.eq(Objects.isNull(req.getDate()), CourseSchedule::getClassDate, req.getDate());
|
|
|
IPage<CourseSchedule> page = courseScheduleService.page(courseSchedulePage, courseScheduleQueryWrapper);
|
|
|
BeanUtils.copyProperties(page, pageResult);
|