|
@@ -7,6 +7,7 @@ import com.ym.mec.biz.dal.enums.GroupType;
|
|
import com.ym.mec.biz.dal.page.StudentCourseScheduleRecordQueryInfo;
|
|
import com.ym.mec.biz.dal.page.StudentCourseScheduleRecordQueryInfo;
|
|
import com.ym.mec.biz.service.CourseScheduleService;
|
|
import com.ym.mec.biz.service.CourseScheduleService;
|
|
import com.ym.mec.biz.service.StudentAttendanceService;
|
|
import com.ym.mec.biz.service.StudentAttendanceService;
|
|
|
|
+import com.ym.mec.biz.service.SysUserService;
|
|
import com.ym.mec.common.controller.BaseController;
|
|
import com.ym.mec.common.controller.BaseController;
|
|
import com.ym.mec.util.date.DateUtil;
|
|
import com.ym.mec.util.date.DateUtil;
|
|
import com.yonge.log.model.AuditLogAnnotation;
|
|
import com.yonge.log.model.AuditLogAnnotation;
|
|
@@ -32,12 +33,10 @@ public class StudentCourseScheduleController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private CourseScheduleService scheduleService;
|
|
private CourseScheduleService scheduleService;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private StudentAttendanceService studentAttendanceService;
|
|
private StudentAttendanceService studentAttendanceService;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- private SysUserFeignService sysUserFeignService;
|
|
|
|
|
|
+ private SysUserService sysUserService;
|
|
|
|
|
|
@ApiOperation(value = "根据月份获取乐团在该月有课的日期")
|
|
@ApiOperation(value = "根据月份获取乐团在该月有课的日期")
|
|
@GetMapping("/getCourseScheduleDateByMonth")
|
|
@GetMapping("/getCourseScheduleDateByMonth")
|
|
@@ -69,10 +68,7 @@ public class StudentCourseScheduleController extends BaseController {
|
|
@PostMapping("/leave")
|
|
@PostMapping("/leave")
|
|
@AuditLogAnnotation(operateName = "请假")
|
|
@AuditLogAnnotation(operateName = "请假")
|
|
public Object leave(Long courseScheduleId, String reason) {
|
|
public Object leave(Long courseScheduleId, String reason) {
|
|
- SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
|
- if (user == null) {
|
|
|
|
- return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
|
- }
|
|
|
|
|
|
+ SysUser user = sysUserService.getUser();
|
|
if (user.getTenantId() == null) {
|
|
if (user.getTenantId() == null) {
|
|
return failed("机构信息异常,请联系老师确认机构信息");
|
|
return failed("机构信息异常,请联系老师确认机构信息");
|
|
}
|
|
}
|
|
@@ -95,11 +91,6 @@ public class StudentCourseScheduleController extends BaseController {
|
|
@ApiOperation(value = "获取本周课程规划")
|
|
@ApiOperation(value = "获取本周课程规划")
|
|
@GetMapping("/queryCoursePlan")
|
|
@GetMapping("/queryCoursePlan")
|
|
public Object queryCoursePlan(){
|
|
public Object queryCoursePlan(){
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
|
- if(sysUser == null || sysUser.getId() == null){
|
|
|
|
- return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
Date now = new Date();
|
|
Date now = new Date();
|
|
|
|
|
|
Date startDate = DateUtil.getWeekMondayWithDate(now);
|
|
Date startDate = DateUtil.getWeekMondayWithDate(now);
|
|
@@ -108,7 +99,7 @@ public class StudentCourseScheduleController extends BaseController {
|
|
Date endDate = DateUtil.addDays(startDate, 7);
|
|
Date endDate = DateUtil.addDays(startDate, 7);
|
|
endDate = DateUtil.getLastSecondWithDay(endDate);
|
|
endDate = DateUtil.getLastSecondWithDay(endDate);
|
|
|
|
|
|
- return succeed(scheduleService.queryMusicCoursePlan(sysUser.getId(), startDate, endDate));
|
|
|
|
|
|
+ return succeed(scheduleService.queryMusicCoursePlan(sysUserService.getUserId(), startDate, endDate));
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|