package com.template.api;

import com.template.model.pojo.SmartAttendance;
import com.template.model.request.askForLeaveRequest;
import com.template.model.result.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;

/**
 * @Author: binguo
 * @Date: 2023/3/30 星期四 17:28
 * @Description: com.video.api
 * @Version: 1.0
 */
@RequestMapping("/api/smartAttendance")
@Api(tags = {"SmartAttendanceControllerAPI"}, value = "考勤")
public interface SmartAttendanceControllerAPI {
    @PostMapping(value = "/insertSmartAttendance")
    @ApiOperation(value = "添加考勤", notes = "添加考勤数据", httpMethod = "POST")
    CommonResult insertSmartAttendance(@Validated @RequestBody SmartAttendance smartApply, BindingResult bindingResult);

    @PostMapping(value = "/updateSmartAttendanceById")
    @ApiOperation(value = "编辑考勤数据", notes = "编辑考勤数据", httpMethod = "POST")
    CommonResult updateSmartAttendanceById(@Validated @RequestBody SmartAttendance ra, BindingResult bindingResult);

    @GetMapping(value = "/queryPageSmartAttendance")
    @ApiOperation(value = "考勤分页数据", notes = "考勤分页数据", httpMethod = "GET")
    CommonResult queryPageSmartAttendances(@RequestParam int currentPage, @RequestParam int pageCount, String name);

    @GetMapping(value = "/deleteSmartAttendanceById")
    @ApiOperation(value = "根据ID删除指定考勤", notes = "根据ID删除指定考勤", httpMethod = "GET")
    CommonResult deleteSmartAttendanceById(@RequestParam int id);

    /**
     * 获取请假记录数据
     */
    @GetMapping(value = "/queryLeaveRecords")
    @ApiOperation(value = "获取请假记录数据", notes = "获取请假记录数据", httpMethod = "GET")
    CommonResult queryLeaveRecords();

    /**
     * 首页班级考勤数据
     * 获取当月
     * 可查询的时间范围不清楚
     */
    @GetMapping(value = "/queryAttendanceList")
    @ApiOperation(value = "首页班级考勤数据", notes = "首页班级考勤数据", httpMethod = "GET")
    CommonResult queryAttendanceList(@RequestParam String date, @RequestParam int classId);


    /**
     * 百胜学生请假接口
     *
     * @param request
     * @param bindingResult
     * @return
     * @throws Exception
     */
    @PostMapping(value = "/askForLeave")
    @ApiOperation(value = "百胜学生请假接口", notes = "百胜学生请假接口", httpMethod = "POST")
    CommonResult askForLeave(@Validated @RequestBody askForLeaveRequest request, BindingResult bindingResult) throws Exception;

    /**
     * 领导驾驶舱——学生个人画像——历史出勤
     *
     * @param userId
     * @param dateTime
     * @return
     */
    @GetMapping(value = "/historicalAttendance")
    @ApiOperation(value = "历史出勤", notes = "历史出勤", httpMethod = "GET")
    CommonResult historicalAttendance(@RequestParam int userId, @RequestParam String dateTime);

    /**
     * 请假管理
     *
     * @param name
     * @param cardNo
     * @param startTime
     * @param endTime
     * @return
     */
    @GetMapping(value = "/askForLeavePage")
    @ApiOperation(value = "请假管理", notes = "请假管理", httpMethod = "GET")
    CommonResult askForLeavePage(@RequestParam int currentPage, @RequestParam int pageCount, String name, String cardNo, String startTime, String endTime, String ifVerification, String classId);

    @GetMapping(value = "/queryPage")
    @ApiOperation(value = "学生考勤记录", notes = "学生考勤记录", httpMethod = "GET")
    CommonResult queryPage(@RequestParam int currentPage, @RequestParam int pageCount, Integer gradeId, Integer classId, String status, String studentNo, String name, String startTime, String endTime);

    @GetMapping(value = "/verification")
    @ApiOperation(value = "核销", notes = "核销", httpMethod = "GET")
    CommonResult verification(@RequestParam String id);

    @GetMapping(value = "/queryPageExport")
    @ApiOperation(value = "学生考勤记录导出", notes = "学生考勤记录导出", httpMethod = "GET")
    void queryPageExport(HttpServletResponse response, Integer gradeId, Integer classId, String status, String studentNo, String name, @RequestParam String startTime, @RequestParam String endTime);


    @GetMapping(value = "/askForLeaveScreenPage")
    @ApiOperation(value = "大屏——请假数据展示", notes = "大屏——请假数据展示", httpMethod = "GET")
    CommonResult askForLeaveScreenPage(@RequestParam int currentPage, @RequestParam int pageCount, String cardNo, String ifVerification);

    /**
     * 领导驾驶舱——考勤管理——学生考勤
     *
     * @param dateTime
     * @return
     */
    @GetMapping(value = "/studentHistoricalAttendance")
    @ApiOperation(value = "学生考勤统计", notes = "学生考勤统计", httpMethod = "GET")
    CommonResult studentHistoricalAttendance(@RequestParam String dateTime);


    /**
     * 领导驾驶舱——考勤管理——班级考勤数据
     *
     * @param dateTime
     * @return
     */
    @GetMapping(value = "/classHistoricalAttendance")
    @ApiOperation(value = "班级考勤统计", notes = "班级考勤统计", httpMethod = "GET")
    CommonResult classHistoricalAttendance(@RequestParam String dateTime, @RequestParam int currentPage, @RequestParam int pageCount, String className);


    @GetMapping(value = "/ackDetail")
    @ApiOperation(value = "个人请假详情", notes = "个人请假详情", httpMethod = "GET")
    CommonResult ackDetail(@RequestParam Integer userId, @RequestParam String dateTime);

}
