|
|
@@ -2,6 +2,7 @@ package com.xjrsoft.module.schedule.controller;
|
|
|
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.db.Db;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
@@ -13,6 +14,7 @@ import com.xjrsoft.common.model.result.RT;
|
|
|
import com.xjrsoft.common.utils.DatasourceUtil;
|
|
|
import com.xjrsoft.module.base.entity.BaseSemester;
|
|
|
import com.xjrsoft.module.courseTable.service.ICourseTableService;
|
|
|
+import com.xjrsoft.module.evaluate.dto.EvaluateResultSaveDto;
|
|
|
import com.xjrsoft.module.schedule.dto.CourseTableDto;
|
|
|
import com.xjrsoft.module.schedule.entity.CourseReceiveMsg;
|
|
|
import com.xjrsoft.module.schedule.entity.JianyueData;
|
|
|
@@ -28,11 +30,14 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.sql.DataSource;
|
|
|
+import javax.validation.Valid;
|
|
|
import java.time.DayOfWeek;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.Date;
|
|
|
@@ -145,22 +150,40 @@ public class ScheduleController {
|
|
|
public RT<CourseTableVo> courseInfoDay(CourseTableDto dto){
|
|
|
DayOfWeek dayOfWeek = LocalDateTime.now().getDayOfWeek();
|
|
|
dto.setWeekDay(dayOfWeek.getValue());
|
|
|
- // 查询登录者身份
|
|
|
- long loginIdAsLong = StpUtil.getLoginIdAsLong();
|
|
|
- List<BaseStudentSchoolRoll> schoolRolls = baseStudentSchoolRollService.list(
|
|
|
- new QueryWrapper<BaseStudentSchoolRoll>().lambda().eq(BaseStudentSchoolRoll::getUserId, loginIdAsLong)
|
|
|
- );
|
|
|
- if(schoolRolls != null && !schoolRolls.isEmpty()){
|
|
|
- dto.setCourseType("class");
|
|
|
- dto.setClassId(schoolRolls.get(0).getClassId());
|
|
|
- }
|
|
|
- List<BaseTeacher> teachers = baseTeacherService.list(new QueryWrapper<BaseTeacher>().lambda().eq(BaseTeacher::getUserId, loginIdAsLong));
|
|
|
- if(teachers != null && !teachers.isEmpty()){
|
|
|
- dto.setCourseType("teacher");
|
|
|
- dto.setTeacherId(loginIdAsLong);
|
|
|
+ if(ObjectUtil.isNotNull(dto.getStudentId())){
|
|
|
+ List<BaseStudentSchoolRoll> schoolRolls = baseStudentSchoolRollService.list(
|
|
|
+ new QueryWrapper<BaseStudentSchoolRoll>().lambda().eq(BaseStudentSchoolRoll::getUserId, dto.getStudentId())
|
|
|
+ );
|
|
|
+ if(schoolRolls != null && !schoolRolls.isEmpty()){
|
|
|
+ dto.setCourseType("class");
|
|
|
+ dto.setClassId(schoolRolls.get(0).getClassId());
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ // 查询登录者身份
|
|
|
+ long loginIdAsLong = StpUtil.getLoginIdAsLong();
|
|
|
+ List<BaseStudentSchoolRoll> schoolRolls = baseStudentSchoolRollService.list(
|
|
|
+ new QueryWrapper<BaseStudentSchoolRoll>().lambda().eq(BaseStudentSchoolRoll::getUserId, loginIdAsLong)
|
|
|
+ );
|
|
|
+ if(schoolRolls != null && !schoolRolls.isEmpty()){
|
|
|
+ dto.setCourseType("class");
|
|
|
+ dto.setClassId(schoolRolls.get(0).getClassId());
|
|
|
+ }
|
|
|
+ List<BaseTeacher> teachers = baseTeacherService.list(new QueryWrapper<BaseTeacher>().lambda().eq(BaseTeacher::getUserId, loginIdAsLong));
|
|
|
+ if(teachers != null && !teachers.isEmpty()){
|
|
|
+ dto.setCourseType("teacher");
|
|
|
+ dto.setTeacherId(loginIdAsLong);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
CourseTableVo list = courseTableService.getList(dto);
|
|
|
return RT.ok(list);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @GetMapping
|
|
|
+ @ApiOperation(value = "调课顶课OA课表查询")
|
|
|
+ @SaCheckPermission("evaluateobject:detail")
|
|
|
+ public RT<List<CourseTableVo>> courseInfoDay(EvaluateResultSaveDto dto){
|
|
|
+ return RT.ok();
|
|
|
+ }
|
|
|
}
|