/*
 * Copyright [2022] [https://www.xiaonuo.vip]
 *
 * Snowy采用APACHE LICENSE 2.0开源协议，您在使用过程中，需要注意以下几点：
 *
 * 1.请不要删除和修改根目录下的LICENSE文件。
 * 2.请不要删除和修改Snowy源码头部的版权声明。
 * 3.本项目代码可免费商业使用，商业使用请保留源码和相关描述文件的项目出处，作者声明等。
 * 4.分发源码时候，请注明软件出处 https://www.xiaonuo.vip
 * 5.不可二次分发开源参与同类竞品，如有想法可联系团队xiaonuobase@qq.com商议合作。
 * 6.若您的项目无法满足以上几点，需要更多功能代码，获取Snowy商业授权许可，请在官网购买授权，地址为 https://www.xiaonuo.vip
 */
package com.unis.rotationPlan.info.modular.rpBiweeklyReport.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.unis.common.pojo.CommonResult;
import com.unis.rotationPlan.info.modular.rpBiweeklyReport.param.RpBiweeklyReportDetailPageParam;
import com.unis.rotationPlan.info.modular.rpBiweeklyReport.param.RpBiweeklyReportIdParam;
import com.unis.rotationPlan.info.modular.rpBiweeklyReport.param.RpBiweeklyReportPageParam;
import com.unis.rotationPlan.info.modular.rpBiweeklyReport.service.RpBiweeklyReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.util.List;
import java.util.Map;

/**
 * 轮换计划-轮换半月报表控制器
 *
 * @author TS
 * @date  2024/05/09 19:15
 */
@Api(tags = "轮换计划-轮换半月报表控制器")
@ApiSupport(author = "UNIS_TEAM", order = 1)
@RestController
@Validated
public class RpBiweeklyReportController {

    @Resource
    private RpBiweeklyReportService rpBiweeklyReportService;

    /**
     * 获取轮换计划-轮换半月报表分页
     *
     * @author TS
     * @date  2024/05/09 19:15
     */
//    @ApiOperationSupport(order = 1)
//    @ApiOperation("获取轮换计划-轮换半月报表分页")
//    @SaCheckPermission("/rotationPlan.info/rpBiweeklyReport/page")
//    @GetMapping("/rotationPlan.info/rpBiweeklyReport/page")
//    public CommonResult<Page<RpBiweeklyReport>> page(RpBiweeklyReportPageParam rpBiweeklyReportPageParam) {
//        return CommonResult.data(rpBiweeklyReportService.page(rpBiweeklyReportPageParam));
//    }
    /**
     * 获取轮换计划-轮换半月报表自定义分页
     *
     * @author TS
     * @date  2024/05/09 19:15
     */
    @ApiOperationSupport(order = 1)
    @ApiOperation("获取轮换计划-轮换半月报表自定义分页")
//    @SaCheckPermission("/rotationPlan.info/rpBiweeklyReport/findPage")
    @GetMapping("/rotationPlan.info/rpBiweeklyReport/findPage")
    public CommonResult<IPage<Map<String,Object>>> findPage(RpBiweeklyReportPageParam rpBiweeklyReportPageParam) {
        return CommonResult.data(rpBiweeklyReportService.findPage(rpBiweeklyReportPageParam));
    }
    /**
     * 获取计划进度管控自定义分页
     *
     * @author TS
     * @date  2024/05/09 19:15
     */
    @ApiOperationSupport(order = 2)
    @ApiOperation("获取计划进度管控自定义分页")
//    @SaCheckPermission("/rotationPlan.info/rpBiweeklyReport/findPage")
    @GetMapping("/rotationPlan.info/rpBiweeklyReport/findPlanPage")
    public CommonResult<IPage<Map<String,Object>>> findPlanPage(@Valid RpBiweeklyReportPageParam rpBiweeklyReportPageParam) {
        return CommonResult.data(rpBiweeklyReportService.findPlanPage(rpBiweeklyReportPageParam));
    }
    /**
     * 获取计划进度管控详情分页
     *
     * @author TS
     * @date  2024/05/09 19:15
     */
    @ApiOperationSupport(order = 4)
    @ApiOperation("获取计划进度管控详情分页")
//    @SaCheckPermission("/rotationPlan.info/rpBiweeklyReport/findPlanDetailPage")
    @GetMapping("/rotationPlan.info/rpBiweeklyReport/findPlanDetailPage")
    public CommonResult<IPage<Map<String,Object>>> findPlanDetailPage(@Valid RpBiweeklyReportDetailPageParam rpBiweeklyReportDetailPageParam) {
        return CommonResult.data(rpBiweeklyReportService.findPlanDetailPage(rpBiweeklyReportDetailPageParam));
    }

    /**
     * 获取轮换计划-轮换半月报表详情
     *
     * @author TS
     * @date  2024/05/09 19:15
     */
    @ApiOperationSupport(order = 3)
    @ApiOperation("获取轮换计划-轮换半月报表详情")
//    @SaCheckPermission("/rotationPlan.info/rpBiweeklyReport/getDetail")
    @GetMapping("/rotationPlan.info/rpBiweeklyReport/getDetail")
    public CommonResult<List<Map<String,Object>>> getDetail(@Valid RpBiweeklyReportIdParam rpBiweeklyReportIdParam) {
        return CommonResult.data(rpBiweeklyReportService.getDetail(rpBiweeklyReportIdParam));
    }
    /**
     * 获取计划进度管控详情
     *
     * @author TS
     * @date  2024/05/09 19:15
     */
    @ApiOperationSupport(order = 4)
    @ApiOperation("获取计划进度管控详情")
//    @SaCheckPermission("/rotationPlan.info/rpBiweeklyReport/getPlanDetail")
    @GetMapping("/rotationPlan.info/rpBiweeklyReport/getPlanDetail")
    public CommonResult<List<Map<String,Object>>> getPlanDetail(@RequestParam @NotBlank(message="轮换年度不能为空")String rotationYear) {
        return CommonResult.data(rpBiweeklyReportService.getPlanDetail(rotationYear));
    }
}
