|  | @@ -1,8 +1,14 @@
 | 
	
		
			
				|  |  | -package com.ym.mec.web.controller;
 | 
	
		
			
				|  |  | +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;
 | 
	
	
		
			
				|  | @@ -13,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestParam;
 | 
	
		
			
				|  |  |  import org.springframework.web.bind.annotation.RestController;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import java.util.Date;
 | 
	
		
			
				|  |  | +import java.util.Objects;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  /**
 | 
	
		
			
				|  |  |   * @Author Joburgess
 | 
	
	
		
			
				|  | @@ -26,17 +33,39 @@ 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) {
 | 
	
		
			
				|  |  | -        return succeed(scheduleService.getCourseScheduleDates(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));
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  }
 |