package jnpf.attendance;


import io.swagger.v3.oas.annotations.Operation;
import jnpf.attendance.dto.*;
import jnpf.attendance.fallback.FtbStatisticsApiFallback;
import jnpf.base.ActionResult;
import jnpf.model.attendance.dto.DayStatisticsDto;
import jnpf.model.attendance.dto.SalaryAttendanceSupportDto;
import jnpf.model.attendance.vo.attendance.AttendanceCustomizeTableVo;
import jnpf.model.attendance.vo.attendance.DayStatisticsPageListVo;
import jnpf.model.attendance.vo.attendance.DayStatisticsVo;
import jnpf.model.attendance.vo.attendance.SalaryAttendanceSupportVo;
import jnpf.util.NoDataSourceBind;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.Date;
import java.util.List;
import java.util.Map;

@FeignClient(name = "jnpf-ftb", fallbackFactory = FtbStatisticsApiFallback.class, path = "/attendance/statistics")
public interface FtbStatisticsApi {

    @Operation(summary = "用户日统计数据初始化")
    @GetMapping(value = "/userDayStatisticsInit")
    ActionResult<Boolean> userDayStatisticsInit(@RequestParam(value = "tenantId") String tenantId);

    @Operation(summary = "个人考勤日报通知")
    @GetMapping(value = "/dayStatisticsNotice")
    ActionResult<Boolean> dayStatisticsNotice(@RequestParam(value = "tenantId") String tenantId);

    @NoDataSourceBind
    @Operation(summary = "个人统计月报通知")
    @GetMapping(value = "/monthStatisticsNotice")
    ActionResult<Boolean> monthStatisticsNotice(@RequestParam(value = "tenantId") String tenantId);

    @NoDataSourceBind
    @Operation(summary = "团队统计月报通知")
    @GetMapping(value = "/teamMonthStatisticsNotice")
    ActionResult<Boolean> teamMonthStatisticsNotice(@RequestParam(value = "tenantId") String tenantId);

    @Operation(summary = "连续未排班通知")
    @GetMapping(value = "/consentUnscheduledNotice")
    void consentUnscheduledNotice(@RequestParam(value = "tenantId") String tenantId);

    @Operation(summary = "考勤封账-自动封账定时器")
    @PutMapping(value = "/autoSealTimer")
    ActionResult<Boolean> autoSealTimer(@RequestParam(value = "tenantId") String tenantId);

    @Operation(summary = "计算考勤组平均工时(实际出勤工时)")
    @PostMapping(value = "/countAttendanceAvgHours")
    List<AttendanceCountAvgHoursVo> countAttendanceAvgHours(@Valid @RequestBody AttendanceCountAvgHoursDto dto);

    @Operation(summary = "获取多考勤组月度统计数据")
    @PostMapping(value = "/getAttendanceAvgHoursDetails")
    ActionResult<MonthStatsDetailsVo> getAttendanceAvgHoursDetails(@Valid @RequestBody MonthStatsDetailsDto dto);

    @Operation(summary = "获取多考勤组月度人均工时折线图")
    @PostMapping(value = "/getAttendanceMonthPerCapita")
    ActionResult<List<MonthStatsPerCapitaVo>> getAttendanceMonthPerCapita(@Valid @RequestBody MonthStatsDetailsDto dto);

    @Operation(summary = "获取多考勤组月度日常情况")
    @PostMapping(value = "/getAttendanceDailySituation")
    ActionResult<List<MonthStatsDailySituationVo>> getAttendanceDailySituation(@Valid @RequestBody MonthStatsDetailsDto dto);

    @Operation(summary = "获取多考勤组月度考勤工时排行")
    @PostMapping(value = "/getAttendanceHoursRanking")
    ActionResult<List<MonthStatsHoursRankingVo>> getAttendanceHoursRanking(@Valid @RequestBody MonthStatsDetailsDto dto);

    @Operation(summary = "获取多考勤组月度全勤情况")
    @PostMapping(value = "/getAttendanceFullSituation")
    ActionResult<List<MonthStatsFullSituationVo>> getAttendanceFullSituation(@Valid @RequestBody MonthStatsDetailsDto dto);

    @Operation(summary = "获取多考勤组月度异常情况")
    @PostMapping(value = "/getAttendanceAbnormalCondition")
    ActionResult<MonthStatsAbnormalConditionVo> getAttendanceAbnormalCondition(@Valid @RequestBody MonthStatsDetailsDto dto);

    @Operation(summary = "获取多考勤组月度加班情况")
    @PostMapping(value = "/getAttendanceOvertimeSituation")
    ActionResult<List<MonthStatsOvertimeSituationVo>> getAttendanceOvertimeSituation(@Valid @RequestBody MonthStatsDetailsDto dto);

    @Operation(summary = "薪酬考勤数据支持")
    @PostMapping(value = "/salaryAttendanceSupport")
    Map<String, SalaryAttendanceSupportVo> salaryAttendanceSupport(@Valid @RequestBody SalaryAttendanceSupportDto dto);

    @Operation(summary = "考勤统计数据日度列表表头（薪酬）")
    @PostMapping(value = "/attendanceDayStaTable")
    List<AttendanceCustomizeTableVo> attendanceDayStaTable();

    @Operation(summary = "考勤统计数据日度列表")
    @PostMapping(value = "/attendanceDayStaList")
    List<DayStatisticsPageListVo> attendanceDayStaList(@Valid @RequestBody SalaryAttendanceSupportDto dto);

    @Operation(summary = "获取日出勤信息")
    @NoDataSourceBind
    @PostMapping(value = "/getAttendanceDayStaList")
    List<DayStatisticsVo> getAttendanceDayStaList(@Valid @RequestBody DayStatisticsDto dto);

    @Operation(summary = "获取各维度出勤人数")
    @PostMapping(value = "/getDimensionsAttendanceCountMap")
    Map<String, List<DateDimensionsRangeVo>> getDimensionsAttendanceCountMap(@Valid @RequestBody DimensionsAttendanceCountDto dto);

    @Operation(summary = "获取各维度出勤人数")
    @PostMapping(value = "/getDimensionsAttendanceDayCountMap")
    Map<String, Map<Date, Integer>> getDimensionsAttendanceDayCountMap(@Valid @RequestBody DimensionsAttendanceDayCountDto dto);
}
