|
@@ -1,21 +1,28 @@
|
|
|
package com.ym.mec.student.controller;
|
|
|
|
|
|
-import com.ym.mec.biz.dal.dto.ClassDateAdjustDto;
|
|
|
-import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
|
|
|
-import com.ym.mec.biz.dal.page.StudentCourseScheduleRecordQueryInfo;
|
|
|
-import com.ym.mec.biz.service.CourseScheduleService;
|
|
|
-import com.ym.mec.biz.service.StudentAttendanceService;
|
|
|
-import com.ym.mec.common.controller.BaseController;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.http.MediaType;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.http.HttpStatus;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
+import com.ym.mec.auth.api.entity.SysUser;
|
|
|
+import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
|
|
|
+import com.ym.mec.biz.dal.page.StudentCourseScheduleRecordQueryInfo;
|
|
|
+import com.ym.mec.biz.service.CourseScheduleService;
|
|
|
+import com.ym.mec.biz.service.StudentAttendanceService;
|
|
|
+import com.ym.mec.common.controller.BaseController;
|
|
|
+
|
|
|
/**
|
|
|
* @Author Joburgess
|
|
|
* @Date 2019/9/24
|
|
@@ -25,49 +32,50 @@ import java.util.Date;
|
|
|
@RestController
|
|
|
public class StudentCourseScheduleController extends BaseController {
|
|
|
|
|
|
- @Autowired
|
|
|
- private CourseScheduleService scheduleService;
|
|
|
- @Autowired
|
|
|
- private StudentAttendanceService studentAttendanceService;
|
|
|
+ @Autowired
|
|
|
+ private CourseScheduleService scheduleService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private StudentAttendanceService studentAttendanceService;
|
|
|
|
|
|
- @ApiOperation(value = "根据月份获取乐团在该月有课的日期")
|
|
|
- @GetMapping("/getCourseScheduleDateByMonth")
|
|
|
- public Object getCourseScheduleDateByMonth(@ApiParam(value = "月份", required = true) @RequestParam Date month,
|
|
|
- @ApiParam(value = "未上课", required = true) Integer isAttend) {
|
|
|
- return succeed(scheduleService.getCourseScheduleDateByStudent(month,isAttend));
|
|
|
- }
|
|
|
+ @Autowired
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
|
|
|
- @ApiOperation(value = "根据日期获取当日排课")
|
|
|
- @GetMapping("/getCourseSchedulesWithDate")
|
|
|
- public Object getCourseSchedulesWithDate(@ApiParam(value = "日期", required = true) Date date){
|
|
|
- return succeed(scheduleService.getStudentCourseSchedulesWithDate(date));
|
|
|
- }
|
|
|
+ @ApiOperation(value = "根据月份获取乐团在该月有课的日期")
|
|
|
+ @GetMapping("/getCourseScheduleDateByMonth")
|
|
|
+ public Object getCourseScheduleDateByMonth(@ApiParam(value = "月份", required = true) @RequestParam Date month,
|
|
|
+ @ApiParam(value = "未上课", required = true) Integer isAttend) {
|
|
|
+ return succeed(scheduleService.getCourseScheduleDateByStudent(month, isAttend));
|
|
|
+ }
|
|
|
|
|
|
- @ApiOperation(value = "课时调整")
|
|
|
- @PostMapping(value = "/classStartDateAdjust",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
- public Object classStartDateAdjust(ClassDateAdjustDto classDateAdjustDto){
|
|
|
- scheduleService.classStartDateAdjust(classDateAdjustDto);
|
|
|
- return succeed();
|
|
|
- }
|
|
|
+ @ApiOperation(value = "根据日期获取当日排课")
|
|
|
+ @GetMapping("/getCourseSchedulesWithDate")
|
|
|
+ public Object getCourseSchedulesWithDate(@ApiParam(value = "日期", required = true) Date date) {
|
|
|
+ return succeed(scheduleService.getStudentCourseSchedulesWithDate(date));
|
|
|
+ }
|
|
|
|
|
|
- @ApiOperation(value = "课时交换")
|
|
|
- @GetMapping(value = "/courseSwap",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
- public Object courseSwap(Long courseScheduleId1,Long courseScheduleId2){
|
|
|
- scheduleService.courseSwap(courseScheduleId1,courseScheduleId2);
|
|
|
- return succeed();
|
|
|
- }
|
|
|
+ @ApiOperation(value = "上课记录")
|
|
|
+ @GetMapping(value = "/findStudentCourseScheduleRecords")
|
|
|
+ public Object findStudentCourseScheduleRecords(StudentCourseScheduleRecordQueryInfo queryInfo) {
|
|
|
+ return succeed(scheduleService.findStudentCourseScheduleRecords(queryInfo));
|
|
|
+ }
|
|
|
|
|
|
- @ApiOperation(value = "上课记录")
|
|
|
- @GetMapping(value = "/findStudentCourseScheduleRecords")
|
|
|
- public Object findStudentCourseScheduleRecords(StudentCourseScheduleRecordQueryInfo queryInfo){
|
|
|
- return succeed(scheduleService.findStudentCourseScheduleRecords(queryInfo));
|
|
|
- }
|
|
|
+ @ApiModelProperty(value = "课程投诉")
|
|
|
+ @PostMapping("/courseScheduleCommplaint")
|
|
|
+ public Object courseScheduleCommplaint(CourseScheduleComplaints courseScheduleComplaints) {
|
|
|
+ scheduleService.courseScheduleCommplaint(courseScheduleComplaints);
|
|
|
+ return succeed();
|
|
|
+ }
|
|
|
|
|
|
- @ApiModelProperty(value = "课程投诉")
|
|
|
- @PostMapping("/courseScheduleCommplaint")
|
|
|
- public Object courseScheduleCommplaint(CourseScheduleComplaints courseScheduleComplaints){
|
|
|
- scheduleService.courseScheduleCommplaint(courseScheduleComplaints);
|
|
|
- return succeed();
|
|
|
- }
|
|
|
+ @ApiModelProperty(value = "请假")
|
|
|
+ @PostMapping("/leave")
|
|
|
+ public Object leave(long courseScheduleId, String reason) {
|
|
|
+ SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
+ if (user == null) {
|
|
|
+ return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
+ }
|
|
|
+ studentAttendanceService.leave(user.getId(), courseScheduleId, reason);
|
|
|
+ return succeed();
|
|
|
+ }
|
|
|
|
|
|
}
|