|
@@ -0,0 +1,71 @@
|
|
|
+package com.ym.mec.web.controller.education;
|
|
|
+
|
|
|
+import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
+import com.ym.mec.auth.api.entity.SysUser;
|
|
|
+import com.ym.mec.biz.dal.dao.EmployeeDao;
|
|
|
+import com.ym.mec.biz.dal.entity.Employee;
|
|
|
+import com.ym.mec.biz.dal.page.CourseScheduleQueryInfo;
|
|
|
+import com.ym.mec.biz.service.CourseScheduleService;
|
|
|
+import com.ym.mec.biz.service.SysConfigService;
|
|
|
+import com.ym.mec.common.controller.BaseController;
|
|
|
+import com.ym.mec.common.exception.BizException;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.util.Date;
|
|
|
+import java.util.Objects;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Author Joburgess
|
|
|
+ * @Date 2020/1/8
|
|
|
+ */
|
|
|
+
|
|
|
+@RestController
|
|
|
+@RequestMapping("educationCourseSchedule")
|
|
|
+@Api(tags = "教务端课程计划服务")
|
|
|
+public class EducationCourseScheduleController extends BaseController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CourseScheduleService scheduleService;
|
|
|
+ @Autowired
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
+ @Autowired
|
|
|
+ private SysConfigService sysConfigService;
|
|
|
+ @Autowired
|
|
|
+ private EmployeeDao employeeDao;
|
|
|
+
|
|
|
+ @ApiOperation(value = "根据月份获取乐团在该月有课的日期")
|
|
|
+ @GetMapping("/getCourseScheduleDateByMonth")
|
|
|
+ public Object getCourseScheduleDateByMonth(@ApiParam(value = "月份", required = true) @RequestParam Date month) {
|
|
|
+ SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
+ if (null == user) {
|
|
|
+ throw new BizException("请登录");
|
|
|
+ }
|
|
|
+ Employee employee = employeeDao.get(user.getId());
|
|
|
+ if(Objects.isNull(employee)){
|
|
|
+ throw new BizException("员工信息不存在");
|
|
|
+ }
|
|
|
+ return succeed(scheduleService.getCourseScheduleDates(month,employee.getOrganIdList()));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "根据日期获取当日排课")
|
|
|
+ @GetMapping("/getCourseSchedulesWithDate")
|
|
|
+ public Object getCourseSchedulesWithDate(CourseScheduleQueryInfo queryInfo) {
|
|
|
+ SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
+ if (null == user) {
|
|
|
+ throw new BizException("请登录");
|
|
|
+ }
|
|
|
+ Employee employee = employeeDao.get(user.getId());
|
|
|
+ if(Objects.isNull(employee)){
|
|
|
+ throw new BizException("员工信息不存在");
|
|
|
+ }
|
|
|
+ queryInfo.setOrganIdList(employee.getOrganIdList());
|
|
|
+ return succeed(scheduleService.getCourseSchedulesWithDateByEdu(queryInfo));
|
|
|
+ }
|
|
|
+}
|