/*
 * 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.policy.info.modular.auditRequest.controller;

import com.alibaba.fastjson.JSONObject;
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.emergencySupport.modular.es.entity.EsNetworkEntry;
import com.unis.emergencySupport.modular.es.entity.vo.EsNetworkEntryVO;
import com.unis.emergencySupport.modular.es.param.EsNetworkEntryIdParam;
import com.unis.emergencySupport.modular.es.param.EsNetworkEntryPageParam;
import com.unis.policy.info.modular.auditRequest.param.TFumigationRecordIdParam;
import com.unis.policy.info.modular.auditRequest.entity.TFumigationRecord;
import com.unis.policy.info.modular.auditRequest.param.TFumigationRecordPageParam;
import com.unis.policy.info.modular.auditRequest.param.*;
import com.unis.policy.info.modular.auditRequest.vo.AuditRequestVO;
import com.unis.policy.info.modular.auditRequest.vo.PmApplicationVO;
import com.unis.policy.info.modular.auditRequest.vo.SqrEnterpriseVO;
import com.unis.policy.info.modular.auditRequest.vo.UnitInfoVO;
import com.unis.policy.info.modular.sqrEnterprise.param.SqrEnterpriseIdParam;
import com.unis.projectManagement.modular.pmApplication.entity.PmApplication;
import com.unis.projectManagement.modular.pmApplication.param.PmApplicationIdParam;
import com.unis.projectManagement.modular.pmApplication.param.PmApplicationPageParam;
import com.unis.projectManagement.modular.pmStorageConstruction.entity.PmStorageConstruction;
import com.unis.projectManagement.modular.pmStorageConstruction.param.PmStorageConstructionIdParam;
import com.unis.projectManagement.modular.pmStorageConstruction.param.PmStorageConstructionPageParam;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.unis.common.annotation.CommonLog;
import com.unis.common.pojo.CommonResult;
import com.unis.policy.info.modular.auditRequest.service.AuditRequestService;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * 审核请求控制器
 *
 * @author TS
 * @date 2024/04/18 14:51
 */
@Api(tags = "审核请求控制器")
@ApiSupport(author = "UNIS_TEAM", order = 1)
@RestController
@Validated
public class AuditRequestController {



    @Resource
    private AuditRequestService auditRequestService;

    /**
     * 获取审核请求分页
     *
     * @author TS
     * @date 2024/04/18 14:51
     */
//    @ApiOperationSupport(order = 1)
//    @ApiOperation("获取审核请求分页")
//    @SaCheckPermission("/policy.info/auditRequest/page")
//    @GetMapping("/policy.info/auditRequest/page")
//    public CommonResult<Page<AuditRequest>> page(AuditRequestPageParam auditRequestPageParam) {
//        return CommonResult.data(auditRequestService.page(auditRequestPageParam));
//    }

    /**
     * 进行审核操作
     *
     * @author TS
     * @date 2024/04/18 14:51
     */
    @ApiOperationSupport(order = 2)
    @ApiOperation("进行审核操作")
    @CommonLog("进行审核操作")
//    @SaCheckPermission("/policy.info/auditRequest/audit")
    @PostMapping("/policy.info/auditRequest/audit")
    public CommonResult<String> audit(@RequestBody @Valid AuditRequestAddParam auditRequestAddParam) {
        auditRequestService.audit(auditRequestAddParam);
        return CommonResult.ok();
    }

    /**
     * 进行驳回操作
     *
     * @author TS
     * @date 2024/04/18 14:51
     */
    @ApiOperationSupport(order = 3)
    @ApiOperation("进行驳回操作")
    @CommonLog("进行驳回操作")
//    @SaCheckPermission("/policy.info/auditRequest/reject")
    @PostMapping("/policy.info/auditRequest/reject")
    public CommonResult<String> reject(@RequestBody @Valid AuditRequestAddParam auditRequestAddParam) {
        auditRequestService.reject(auditRequestAddParam);
        return CommonResult.ok();
    }
    /**
     * 进行人才规划审核/驳回操作
     *
     * @author TS
     * @date 2024/04/18 14:51
     */
    @ApiOperationSupport(order = 3)
    @ApiOperation("进行人才规划审核/驳回操作")
    @CommonLog("进行人才规划审核/驳回操作")
//    @SaCheckPermission("/policy.info/auditRequest/auditPersonPlan")
    @PostMapping("/policy.info/auditRequest/auditPersonPlan")
    public CommonResult<String> auditPersonPlan(@RequestBody @Valid AuditRequestAddParam auditRequestAddParam) {
        auditRequestService.auditPersonPlan(auditRequestAddParam);
        return CommonResult.ok();
    }

    /**
     * 删除审核请求
     *
     * @author TS
     * @date 2024/04/18 14:51
     */
//    @ApiOperationSupport(order = 4)
//    @ApiOperation("删除审核请求")
//    @CommonLog("删除审核请求")
//    @SaCheckPermission("/policy.info/auditRequest/delete")
//    @PostMapping("/policy.info/auditRequest/delete")
//    public CommonResult<String> delete(@RequestBody @Valid @NotEmpty(message = "集合不能为空")
//                                                   CommonValidList<AuditRequestIdParam> auditRequestIdParamList) {
//        auditRequestService.delete(auditRequestIdParamList);
//        return CommonResult.ok();
//    }

    /**
     * 获取审核请求详情
     *
     * @author TS
     * @date 2024/04/18 14:51
     */
    @ApiOperationSupport(order = 5)
    @ApiOperation("获取审核请求详情")
//    @SaCheckPermission("/policy.info/auditRequest/detail")
    @GetMapping("/policy.info/auditRequest/detail")
    public CommonResult<JSONObject> detail(@Valid AuditRequestDetailParam auditRequestDetailParam) {
        return CommonResult.data(auditRequestService.detail(auditRequestDetailParam));
    }


    /*    * 承储资格审批 --审批接口 审批时，做回显数据
     *
     * @author hjc
     * @date  2024/04/18 14:51
     */
    @ApiOperationSupport(order = 7)
    @ApiOperation("承储资格审批-回显数据")
//    @SaCheckPermission("/policy.info/auditRequest/getAudit")
    @GetMapping("/policy.info/auditRequest/getAudit")
    public CommonResult<SqrEnterpriseVO> getAudit(@Valid SqrEnterpriseIdParam enterpriseIdParam) {

        return CommonResult.data(auditRequestService.getAudit(enterpriseIdParam));
    }


    /**
     * 承储资格审批 --点击审批的接口
     *
     * @author hjc
     * @date 2024/04/18 14:51
     */
    @ApiOperationSupport(order = 6)
    @ApiOperation("承储资格审批--审批接口")
//    @SaCheckPermission("/policy.info/auditRequest/eligibilityApproval")
    @GetMapping("/policy.info/auditRequest/eligibilityApproval")
    public CommonResult<String> eligibilityApproval(@Valid AuditRequestStorageAddParam auditRequestStorageAddParam) {
        auditRequestService.eligibilityApproval(auditRequestStorageAddParam);
        return CommonResult.ok();
    }

    /**
     * 承储资格审批--获取详情
     *
     * @author hjc
     * @date 2024/04/18 14:51
     */
    @ApiOperationSupport(order = 7)
    @ApiOperation("承储资格审批--获取详情")
//    @SaCheckPermission("/policy.info/auditRequest/getDetail")
    @GetMapping("/policy.info/auditRequest/getSqrEnterpriseDetail")
    public CommonResult<JSONObject> getSqrEnterpriseDetail(@Valid AuditRequestGetDetailParam auditRequestGetDetailParam) {
        return CommonResult.data(auditRequestService.getSqrEnterpriseDetail(auditRequestGetDetailParam));
    }

    /**
     * 承储资格审批--分页展示列表数据
     *
     * @author hjc
     * @date 2024/04/18 14:51
     */
    @ApiOperationSupport(order = 8)
    @ApiOperation("承储资格审批--分页展示列表数据")
//    @SaCheckPermission("/policy.info/auditRequest/pageSqrEnterprise")
    @GetMapping("/policy.info/auditRequest/pageSqrEnterprise")
    public CommonResult<Page<AuditRequestVO>> pageSqrEnterprise(@Valid AuditRequestPageParam auditRequestPageParam) {
        return CommonResult.data(auditRequestService.pageSqrEnterprise(auditRequestPageParam));
    }


    /**
     * 承储资格企业--分页展示列表数据
     *
     * @author hjc
     * @date 2024/04/18 14:51
     */
    @ApiOperationSupport(order = 9)
    @ApiOperation("承储资格企业--分页展示列表数据")
//    @SaCheckPermission("/policy.info/auditRequest/pageSqrEnterprise")
    @GetMapping("/policy.info/auditRequest/pageEnterprise")
    public CommonResult<Page<AuditRequestVO>> pageEnterprise(@Valid AuditRequestPageParam auditRequestPageParam) {
        return CommonResult.data(auditRequestService.pageEnterprise(auditRequestPageParam));
    }


    /**
     * 承储资格企业--查看详情
     *
     * @author hjc
     * @date 2024/04/18 14:51
     */
    @ApiOperationSupport(order = 10)
    @ApiOperation("承储资格企业--查看详情")
//    @SaCheckPermission("/policy.info/auditRequest/pageSqrEnterprise")
    @GetMapping("/policy.info/auditRequest/enterpriseInfo")
    public CommonResult<SqrEnterpriseVO> enterpriseInfo(String id) {
        return CommonResult.data(auditRequestService.enterpriseInfo(id));
    }


    /**
     * 承储资格延续申请--分页查询
     *
     * @author hjc
     * @date 2024/04/18 14:51
     */
    @ApiOperationSupport(order = 11)
    @ApiOperation("承储资格延续申请审批--分页查询")
//    @SaCheckPermission("/policy.info/auditRequest/pageSqrEnterprise")
    @GetMapping("/policy.info/auditRequest/continuationPage")
    public CommonResult<Page<AuditRequestVO>> continuationPage(@Valid AuditRequestPageParam auditRequestPageParam) {
        return CommonResult.data(auditRequestService.continuationPage(auditRequestPageParam));
    }


    /**
     * 补发证书审批--分页查询
     *
     * @author hjc
     * @date 2024/04/18 14:51
     */
    @ApiOperationSupport(order = 12)
    @ApiOperation("补发证书审批--分页查询")
//    @SaCheckPermission("/policy.info/auditRequest/pageSqrEnterprise")
    @GetMapping("/policy.info/auditRequest/reissuePage")
    public CommonResult<Page<AuditRequestVO>> reissuePage(@Valid AuditRequestPageParam auditRequestPageParam) {
        return CommonResult.data(auditRequestService.reissuePage(auditRequestPageParam));
    }


    /**
     * 补发证书审批--查看详情
     *
     * @author hjc
     * @date 2024/04/18 14:51
     */
    @ApiOperationSupport(order = 13)
    @ApiOperation("补发证书审批--查看详情")
//    @SaCheckPermission("/policy.info/auditRequest/pageSqrEnterprise")
    @GetMapping("/policy.info/auditRequest/reissueInfo")
    public CommonResult<UnitInfoVO> reissueInfo(String id) {
        return CommonResult.data(auditRequestService.reissueInfo(id));
    }

    /**
     * 补发证书审批--审核
     *
     * @author hjc
     * @date 2024/04/18 14:51
     */
    @ApiOperationSupport(order = 14)
    @ApiOperation("补发证书审批--审核")
//    @SaCheckPermission("/policy.info/auditRequest/reissueAudit")
    @GetMapping("/policy.info/auditRequest/reissueAudit")
    public CommonResult<String> reissueAudit(@Valid AuditRequestStorageAddParam auditRequestStorageAddParam) {
        auditRequestService.reissueAudit(auditRequestStorageAddParam);
        return CommonResult.ok();
    }


    /**
     * 信息变更审批--分页
     *
     * @author hjc
     * @date 2024/04/18 14:51
     */
    @ApiOperationSupport(order = 15)
    @ApiOperation("信息变更审批--分页")
//    @SaCheckPermission("/policy.info/auditRequest/infoChangesPage")
    @GetMapping("/policy.info/auditRequest/infoChangesPage")
    public CommonResult<Page<AuditRequestVO>> infoChangesPage(@Valid AuditRequestPageParam auditRequestPageParam) {
        return CommonResult.data(auditRequestService.infoChangesPage(auditRequestPageParam));
    }




    /**
     * 信息变更审批--审核
     *
     * @author hjc
     * @date 2024/04/18 14:51
     */
    @ApiOperationSupport(order = 16)
    @ApiOperation("信息变更审批--审核")
//    @SaCheckPermission("/policy.info/auditRequest/getDetail")
    @GetMapping("/policy.info/auditRequest/infoChangesAudit")
    public CommonResult<String> infoChangesAudit(@Valid AuditRequestStorageAddParam auditRequestGetDetailParam) {
        auditRequestService.infoChangesAudit(auditRequestGetDetailParam);
        return CommonResult.ok();
    }

    /**
     * 获取熏蒸备案分页
     *
     * @author hjc
     * @date  2024/05/18 15:59
     */
    @ApiOperationSupport(order = 17)
    @ApiOperation("获取熏蒸备案分页")
    //@SaCheckPermission("/basic.info/tFumigationRecord/page")
    @GetMapping("/policy.info/auditRequest/tFumigationRecordPage")
    public CommonResult<Page<TFumigationRecord>> tFumigationRecordPage(TFumigationRecordPageParam tFumigationRecordPageParam) {
        return CommonResult.data(auditRequestService.tFumigationRecordPage(tFumigationRecordPageParam));
    }

    /**
     * 获取熏蒸备案详情
     *
     * @author hjc
     * @date  2024/05/18 15:59
     */
    @ApiOperationSupport(order = 18)
    @ApiOperation("获取熏蒸备案详情")
    //@SaCheckPermission("/basic.info/tFumigationRecord/detail")
    @GetMapping("/policy.info/auditRequest/getTFumigationRecordDetail")
    public CommonResult<TFumigationRecord> getTFumigationRecordDetail(@Valid TFumigationRecordIdParam tFumigationRecordIdParam) {
        return CommonResult.data(auditRequestService.gettFumigationRecordDetail(tFumigationRecordIdParam));
    }

    /**
     * 审核熏蒸备案
     *
     * @author hjc
     * @date  2024/05/18 15:59
     */
    @ApiOperationSupport(order = 19)
    @ApiOperation("审核熏蒸备案")
    //@SaCheckPermission("/basic.info/tFumigationRecord/delete")
    @PostMapping("/policy.info/auditRequest/auditTFumigationRecordById")
    public CommonResult<String> auditTFumigationRecordById(@Valid TFumigationRecordAuditParam param) {
        auditRequestService.auditTFumigationRecordById(param);
        return CommonResult.ok();
    }


    /**
     * 获取应急保障-应急供应网点管理-应急网点审批分页
     * @param esNetworkEntryPageParam
     * @return
     */
    @ApiOperationSupport(order = 20)
    @ApiOperation("获取应急保障-应急供应网点管理-应急网点审批分页")
    @GetMapping("/policy.info/auditRequest/esNetworkEntryPage")
    public CommonResult<Page<EsNetworkEntry>> page(EsNetworkEntryPageParam esNetworkEntryPageParam) {
        return CommonResult.data(auditRequestService.esNetworkEntryPage(esNetworkEntryPageParam));
    }


    /**
     * 获取应急保障-应急供应网点管理-应急网点审批表详情
     *
     * @author ZeroLiYi
     * @date  2024/05/28 09:21
     */
    @ApiOperationSupport(order = 21)
    @ApiOperation("获取应急保障-应急供应网点管理-应急网点审批表详情")
    @GetMapping("/policy.info/auditRequest/esNetworkEntryDetail")
    public CommonResult<EsNetworkEntryVO> esNetworkEntryDetail(@Valid EsNetworkEntryIdParam esNetworkEntryIdParam) {
        return CommonResult.data(auditRequestService.selectesNetworkEntryDetail(esNetworkEntryIdParam));
    }

    /**
     * 应急保障-应急供应网点管理-应急网点详情审批
     *
     * @author ZeroLiYi
     * @date  2024/05/28 09:21
     */
    @ApiOperationSupport(order = 22)
    @ApiOperation( "应急保障-应急供应网点管理-应急网点详情审批")
    @GetMapping("/policy.info/auditRequest/esNetworkEntryRequest")
    public CommonResult<String> esNetworkEntryRequest(@Valid AuditRequestEditParam auditRequestEditParam) {
        auditRequestService.esNetworkEntryRequest(auditRequestEditParam);
        return CommonResult.ok();
    }



    /**
     * 项目管理-审批分页
     *
     * @author hjc
     * @date 2024/05/27 17:26
     */
    @ApiOperationSupport(order = 20)
    @ApiOperation("项目管理-审批分页")
    //@SaCheckPermission("/policy.info/auditRequest/approvalPage")
    @GetMapping("/policy.info/auditRequest/approvalPage")
    public CommonResult<Page<PmApplicationVO>> approvalPage(PmApplicationByStatusPageParam pmApplicationPageParam) {
        return CommonResult.data(auditRequestService.approvalPage(pmApplicationPageParam));
    }

    /**
     * 项目管理-详情
     *
     * @author hjc
     * @date  2024/05/18 15:59
     */
    @ApiOperationSupport(order = 21)
    @ApiOperation("项目管理-详情")
    //@SaCheckPermission("/basic.info/tFumigationRecord/detail")
    @GetMapping("/policy.info/auditRequest/getPmApplicationDetail")
    public CommonResult<PmApplicationVO> getPmApplicationDetail(@Valid PmApplicationIdParam pmApplicationIdParam) {
        return CommonResult.data(auditRequestService.getPmApplicationDetail(pmApplicationIdParam));
    }

    /**
     * 项目管理-审核
     *
     * @author hjc
     * @date  2024/05/18 15:59
     */
    @ApiOperationSupport(order = 22)
    @ApiOperation("项目管理-审核")
    //@SaCheckPermission("/basic.info/tFumigationRecord/delete")
    @PostMapping("/policy.info/auditRequest/auditPmApplicationById")
    public CommonResult<String> auditPmApplicationById(@RequestBody @Valid PmApplicationParam param) {
        auditRequestService.auditPmApplicationById(param);
        return CommonResult.ok();
    }


    /**
     * 获取仓储设施投资-仓储设施建设审批分页
     *
     * @author hjc
     * @date  2024/05/30 15:58
     */
    @ApiOperationSupport(order = 23)
    @ApiOperation("仓储设施建设审批-分页")
    //@SaCheckPermission("/projectManagement/pmStorageConstruction/page")
    @GetMapping("/policy.info/auditRequest/pmStorageConstructionPage")
    public CommonResult<Page<PmStorageConstruction>> pmStorageConstructionPage(PmStorageConstructionPageParam pmStorageConstructionPageParam) {
        return CommonResult.data(auditRequestService.pmStorageConstructionPage(pmStorageConstructionPageParam));
    }


    /**
     * 获取仓储设施投资-仓储设施建设审批详情
     *
     * @author hjc
     * @date  2024/05/30 15:58
     */
    @ApiOperationSupport(order = 24)
    @ApiOperation("仓储设施建设审批-详情")
    //@SaCheckPermission("/projectManagement/pmStorageConstruction/page")
    @GetMapping("/policy.info/auditRequest/getPmStorageConstruction")
    public CommonResult<JSONObject> getPmStorageConstruction(PmStorageConstructionIdParam param) {
        return CommonResult.data(auditRequestService.getPmStorageConstruction(param));
    }


    /**
     * 仓储设施建设审批-审核
     *
     * @author hjc
     * @date  2024/05/18 15:59
     */
    @ApiOperationSupport(order = 25)
    @ApiOperation("仓储设施建设审批-审核")
    //@SaCheckPermission("/basic.info/tFumigationRecord/delete")
    @PostMapping("/policy.info/auditRequest/auditPmStorageConstructionById")
    public CommonResult<String> auditPmStorageConstructionById(@RequestBody @Valid PmStorageConstructionAuditParam param) {
        auditRequestService.auditPmStorageConstructionById(param);
        return CommonResult.ok();
    }

}
