/*
 * 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.financialSupervision.modular.fsEnterpriseBalanceStatistic.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.unis.biz.modular.user.param.BizUserExportParam;
import com.unis.common.annotation.CommonLog;
import com.unis.financialSupervision.modular.fsEnterpriseBalanceStatistic.entity.VO.CostBalanceVO;
import com.unis.financialSupervision.modular.fsEnterpriseBalanceStatistic.entity.VO.FsEnterpriseBalanceStatisticVO;
import com.unis.financialSupervision.modular.fsEnterpriseBalanceStatistic.entity.VO.UnitAndOrgTreeVO;
import com.unis.financialSupervision.modular.fsEnterpriseBalanceStatistic.param.CostBalanceParam;
import com.unis.financialSupervision.modular.fsEnterpriseBalanceStatistic.param.FsEnterpriseBalanceStatisticWarinPageParam;
import com.unis.policy.info.modular.alPolicyFileReport.param.AlPolicyFileReportPageParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import com.unis.common.pojo.CommonResult;
import com.unis.financialSupervision.modular.fsEnterpriseBalanceStatistic.entity.FsEnterpriseBalanceStatistic;
import com.unis.financialSupervision.modular.fsEnterpriseBalanceStatistic.param.FsEnterpriseBalanceStatisticPageParam;
import com.unis.financialSupervision.modular.fsEnterpriseBalanceStatistic.service.FsEnterpriseBalanceStatisticService;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * 财务监管-企业收支结余统计表控制器
 *
 * @author TS
 * @date  2024/06/26 11:23
 */
@Api(tags = "财务监管-企业收支结余统计表控制器")
@ApiSupport(author = "UNIS_TEAM", order = 1)
@RestController
@Validated
public class FsEnterpriseBalanceStatisticController {

    @Resource
    private FsEnterpriseBalanceStatisticService fsEnterpriseBalanceStatisticService;
    /**
     * 获取企业和库区树
     *
     * @author TS
     * @date  2024/06/26 16:23
     */
    @ApiOperationSupport(order =1)
    @ApiOperation("获取企业和库区树")
    @GetMapping("/financialSupervision/fsEnterpriseBalanceStatistic/getUnitAndOgrTree")
    public CommonResult<UnitAndOrgTreeVO> getUnitAndOgrTree() {
        return CommonResult.data(fsEnterpriseBalanceStatisticService.getUnitAndOgrTree());
    }
    /**
     * 获取财务监管-企业收支结余统计表查询
     *
     * @author TS
     * @date  2024/06/26 11:23
     */
    @ApiOperationSupport(order = 2)
    @ApiOperation("获取财务监管-企业收支结余统计表查询")
    @GetMapping("/financialSupervision/fsEnterpriseBalanceStatistic/getList")
    public CommonResult<List<FsEnterpriseBalanceStatisticVO>> getList(@Valid FsEnterpriseBalanceStatisticPageParam fsEnterpriseBalanceStatisticPageParam) {
        return CommonResult.data(fsEnterpriseBalanceStatisticService.getList(fsEnterpriseBalanceStatisticPageParam));
    }

    /**
     * 获取财务监管-企业收支结余统计风险预警自定义分页
     *
     * @author TS
     * @date  2024/06/26 15:02
     */
    @ApiOperationSupport(order = 3)
    @ApiOperation("获取财务监管-企业收支结余统计风险预警自定义分页")
    @GetMapping("/financialSupervision/fsEnterpriseBalanceStatistic/findWarPage")
    public CommonResult<IPage<FsEnterpriseBalanceStatisticVO>> findWarPage(FsEnterpriseBalanceStatisticWarinPageParam fsEnterpriseBalanceStatisticWarinPageParam) {
        return CommonResult.data(fsEnterpriseBalanceStatisticService.findWarPage(fsEnterpriseBalanceStatisticWarinPageParam));
    }

    /**
     * 获取财务监管-企业收支结余统计图表
     *
     * @author TS
     * @date  2024/06/26 11:23
     */
    @ApiOperationSupport(order = 4)
    @ApiOperation("获取财务监管-企业收支结余统计表查询")
    @GetMapping("/financialSupervision/fsEnterpriseBalanceStatistic/getCostBalanceList")
    public CommonResult<List<CostBalanceVO>> getCostBalanceList(@Valid CostBalanceParam costBalanceParam) {
        return CommonResult.data(fsEnterpriseBalanceStatisticService.getCostBalanceList(costBalanceParam));
    }

    /**
     * 省级粮油费用补贴收支结余情况表导出
     *
     * @author TS
     * @date 2024/6/27 19:00
     */
    @ApiOperationSupport(order = 5)
    @ApiOperation("省级粮油费用补贴收支结余情况表导出")
    @CommonLog("省级粮油费用补贴收支结余情况表导出")
    @GetMapping(value = "/financialSupervision/fsEnterpriseBalanceStatistic/export", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
    public void exportUser(@Valid FsEnterpriseBalanceStatisticPageParam fsEnterpriseBalanceStatisticPageParam, HttpServletResponse response) throws IOException {
        fsEnterpriseBalanceStatisticService.exportData(fsEnterpriseBalanceStatisticPageParam, response);
    }

}
