package com.ym.mec.web.controller;

import com.ym.mec.biz.service.*;
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.RestController;

import com.ym.mec.common.controller.BaseController;

@RequestMapping("task")
@RestController
public class TaskController extends BaseController {

	@Autowired
	private MusicGroupStudentFeeService musicGroupStudentFeeService;

	@Autowired
	private VipGroupService vipGroupService;

	@Autowired
	private CourseScheduleService courseScheduleService;

	@Autowired
	private TeacherAttendanceService teacherAttendanceService;

	@Autowired
	private CourseScheduleTeacherSalaryService courseScheduleTeacherSalaryService;

	@Autowired
	private StudentCourseHomeworkService studentCourseHomeworkService;
	
	@Autowired
	private CourseHomeworkService courseHomeworkService;

	@Autowired
	private StudentPaymentOrderService studentPaymentOrderService;

	@Autowired
	private TeacherCourseStatisticsService teacherCourseStatisticsService;

	@GetMapping("/refreshPaymentFeeStatus")
	// 刷新付费状态
	public void refreshPaymentFeeStatus() {
		musicGroupStudentFeeService.refreshPaymentFeeStatus();
	}

	@GetMapping("/vipGroupAwardedMonthlyRewards")
	// vip课月度奖励
	public void vipGroupAwardedMonthlyRewards() {
		vipGroupService.awardedMonthlyRewards();
	}

	@GetMapping("/vipGroupTeacherSalarySettlement")
	// vip课课酬结算
	public void vipGroupTeacherSalarySettlement() {
		courseScheduleTeacherSalaryService.teacherSalarySettlement();
	}

	// 乐团课课酬结算
	@GetMapping("/musicGroupTeacherSalarySettlement")
	public void musicGroupTeacherSalarySettlement() {
		courseScheduleTeacherSalaryService.musicGroupTeacherSalarySettlement();
	}

	@GetMapping("/updateCourseScheduleToOverStatus")
	// 更新课程状态至已结束
	public void updateCourseScheduleToOverStatus() {
		courseScheduleService.updateCourseScheduleToOverStatus();
	}

	@GetMapping("/updateVipGroupToFinishedStatus")
	// 更新VIP课程状态至已结束
	public void updateVipGroupToFinishedStatus() {
		vipGroupService.updateVipGroupStatusToFinished();
	}

	@GetMapping("/stopVipGroupWithNoCreate")
	// 取消达到报名时间未达到报名人数的vip课
	public void stopVipGroupWithNoCreate() {
		vipGroupService.stopVipGroupWithNoCreate();
	}

	@GetMapping("/pushNoSignOutMessage")
	// 推送未签退消息提醒
	public void pushNoSignOutMessage() {
		teacherAttendanceService.pushNoSignOutMessage();
	}

	@GetMapping("/studentCoursesScheduleRemind")
	// 学生有课提醒
	public void studentCoursesScheduleRemind() {
		//courseScheduleService.studentCoursesScheduleRemind();
	}

	@GetMapping("/studentSignInRemind")
	// 学生上课提醒
	public void studentSignInRemind() {
		courseScheduleService.studentSignInRemind();
	}

	@GetMapping("/studentHomeworkRemind")
	// 学生作业提醒
	public void studentHomeworkRemind() {
		studentCourseHomeworkService.homeworkRemind();
	}

	@GetMapping("/teacherCoursesScheduleRemind")
	// 老师有课提醒
	public void teacherCoursesScheduleRemind() {
		courseScheduleService.teacherCoursesScheduleRemind();
	}

	@GetMapping("/teacherSignInRemind")
	// 老师上课提醒
	public void teacherSignInRemind() {
		//courseScheduleService.teacherSignInRemind();
	}

	@GetMapping("/homeworkNoReplyRemind")
	// 老师未回复作业提醒
	public void homeworkNoReplyRemind() {
		courseHomeworkService.homeworkNoReplyRemind();
	}

	//查询订单状态
	@GetMapping("/queryOrderStatus")
	public void  queryOrderStatus() throws Exception {
		studentPaymentOrderService.queryOrderStatus();
	}

	//统计老师课酬
	@GetMapping("/teacherCourseStatistic")
	public void  teacherCourseStatisticsService() throws Exception {
		teacherCourseStatisticsService.teacherCourseStatistic();
	}

}
