1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- package com.ym.mec.education.controller;
- import com.ym.mec.auth.api.client.SysUserFeignService;
- import com.ym.mec.auth.api.entity.SysUser;
- import com.ym.mec.biz.dal.dto.ClassDateAdjustDto;
- import com.ym.mec.biz.dal.entity.CourseSchedule;
- import com.ym.mec.biz.service.CourseScheduleService;
- import com.ym.mec.common.exception.BizException;
- import com.ym.mec.education.base.BaseResponse;
- import com.ym.mec.education.base.PageResponse;
- import com.ym.mec.education.req.ClassGroupReq;
- import com.ym.mec.education.req.CourseScheduleReq;
- import com.ym.mec.education.resp.CourseScheduleResp;
- import com.ym.mec.education.service.ICourseScheduleService;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import lombok.extern.slf4j.Slf4j;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.validation.annotation.Validated;
- import org.springframework.web.bind.annotation.*;
- import java.util.ArrayList;
- import java.util.List;
- import java.util.Objects;
- /**
- * @program: mec
- * @description: 课表
- * @author: xw
- * @create: 2019-09-26 21:04
- */
- @RestController
- @RequestMapping("api/courseSchedule")
- @Api(tags = "课表")
- @Slf4j
- public class CourseScheduleController {
- @Autowired
- private ICourseScheduleService courseScheduleService;
- @Autowired
- private CourseScheduleService scheduleService;
- @Autowired
- private SysUserFeignService sysUserFeignService;
- @PostMapping("/list")
- @ApiOperation("课表列表")
- public PageResponse list(@RequestBody @Validated ClassGroupReq classGroupReq) {
- return courseScheduleService.getPage(classGroupReq);
- }
- @PostMapping("/info")
- @ApiOperation("点名详情-头信息")
- public BaseResponse<CourseScheduleResp> getInfo(@RequestBody CourseScheduleReq courseScheduleReq) {
- return courseScheduleService.getInfo(courseScheduleReq);
- }
- @PostMapping("/statisticsInfo")
- @ApiOperation("历史考勤统计-头信息")
- public BaseResponse getStatisticsInfo(@RequestBody ClassGroupReq classGroupReq) {
- return courseScheduleService.getStatisticsInfo(classGroupReq);
- }
- @PostMapping("/courseInfo")
- @ApiOperation("课程详情-头信息")
- public BaseResponse<CourseScheduleResp> courseInfo(@RequestBody CourseScheduleReq courseScheduleReq) {
- return courseScheduleService.courseInfo(courseScheduleReq);
- }
- public Object getCourseScheduleDateByMonth(@ApiParam(value = "月份", required = true) @RequestParam Date month) {
- SysUser user = sysUserFeignService.queryUserInfo();
- if (null == user) {
- throw new BizException("请登录");
- }
- }
- @ApiOperation(value = "课时调整")
- @PostMapping(value = "/classStartDateAdjust")
- public Object classStartDateAdjust(ClassDateAdjustDto classDateAdjustDto){
- if(Objects.isNull(classDateAdjustDto.getId())){
- return BaseResponse.errorParam();
- }
- List<CourseSchedule> courseSchedules=new ArrayList<>();
- courseSchedules.add(classDateAdjustDto);
- scheduleService.courseAdjust(courseSchedules);
- return BaseResponse.success(null);
- }
- @ApiOperation(value = "课时交换")
- @GetMapping(value = "/courseSwap")
- public Object courseSwap(Long courseScheduleId1,Long courseScheduleId2){
- if(Objects.isNull(courseScheduleId1)||Objects.isNull(courseScheduleId2)){
- return BaseResponse.errorParam();
- }
- scheduleService.courseSwap(courseScheduleId1,courseScheduleId2);
- return BaseResponse.success(null);
- }
- }
|