|
@@ -1,13 +1,14 @@
|
|
|
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.auth.api.entity.SysUserRole;
|
|
|
import com.ym.mec.biz.dal.dao.EmployeeDao;
|
|
|
+import com.ym.mec.biz.dal.dto.CourseMergeDto;
|
|
|
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.SysUserService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
+import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -33,17 +34,23 @@ public class EducationCourseScheduleController extends BaseController {
|
|
|
@Autowired
|
|
|
private CourseScheduleService scheduleService;
|
|
|
@Autowired
|
|
|
- private SysUserFeignService sysUserFeignService;
|
|
|
+ private SysUserService sysUserService;
|
|
|
@Autowired
|
|
|
private EmployeeDao employeeDao;
|
|
|
+ @Autowired
|
|
|
+ private CourseScheduleService courseScheduleService;
|
|
|
+
|
|
|
+ @ApiOperation(value = "课程合并")
|
|
|
+ @PostMapping(value = "/courseMerge",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
+ public HttpResponseResult courseMerge(CourseMergeDto courseMergeInfo){
|
|
|
+ courseMergeInfo.setOperatorId(sysUserService.getUserId());
|
|
|
+ return courseScheduleService.courseMerge(courseMergeInfo);
|
|
|
+ }
|
|
|
|
|
|
@ApiOperation(value = "根据月份获取乐团在该月有课的日期")
|
|
|
@GetMapping("/getCourseScheduleDateByMonth")
|
|
|
public Object getCourseScheduleDateByMonth(@ApiParam(value = "月份", required = true) @RequestParam Date month,String type) {
|
|
|
- SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
- if (null == user) {
|
|
|
- throw new BizException("请登录");
|
|
|
- }
|
|
|
+ SysUser user = sysUserService.getUser();
|
|
|
Employee employee = employeeDao.get(user.getId());
|
|
|
if(Objects.isNull(employee)){
|
|
|
throw new BizException("员工信息不存在");
|
|
@@ -60,10 +67,7 @@ public class EducationCourseScheduleController extends BaseController {
|
|
|
@ApiOperation(value = "根据日期获取当日排课")
|
|
|
@GetMapping("/getCourseSchedulesWithDate")
|
|
|
public Object getCourseSchedulesWithDate(CourseScheduleQueryInfo queryInfo) {
|
|
|
- SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
- if (null == user) {
|
|
|
- throw new BizException("请登录");
|
|
|
- }
|
|
|
+ SysUser user = sysUserService.getUser();
|
|
|
Employee employee = employeeDao.get(user.getId());
|
|
|
if(Objects.nonNull(employee)){
|
|
|
queryInfo.setOrganIdList(employee.getOrganIdList());
|