/*
 * 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.finishedGrainSupervision.modular.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.basic.info.modular.orgInfo.entity.OrgInfo;
import com.unis.basic.info.modular.orgInfo.param.OrgInfoIdParam;
import com.unis.basic.info.modular.orgInfo.service.OrgInfoService;
import com.unis.basic.info.modular.storehouseInfo.entity.StorehouseInfo;
import com.unis.basic.info.modular.storehouseInfo.param.StorehouseInfoIdParam;
import com.unis.basic.info.modular.storehouseInfo.service.StorehouseInfoService;
import com.unis.basic.info.modular.unitInfo.param.UnitInfoIdParam;
import com.unis.basic.info.modular.unitInfo.service.UnitInfoService;
import com.unis.basic.info.modular.unitInfo.vo.UnitInfoVO;
import com.unis.common.pojo.CommonResult;
import com.unis.finishedGrainSupervision.modular.entity.vo.DevInputDetailVO;
import com.unis.finishedGrainSupervision.modular.entity.vo.DevInputPageVO;
import com.unis.finishedGrainSupervision.modular.entity.vo.OrgInfoPageVO;
import com.unis.finishedGrainSupervision.modular.entity.vo.StorageDailycheckDetailVO;
import com.unis.finishedGrainSupervision.modular.entity.vo.StorageDailycheckPageVO;
import com.unis.finishedGrainSupervision.modular.entity.vo.StorehousePageVO;
import com.unis.finishedGrainSupervision.modular.entity.vo.UnitPageVO;
import com.unis.finishedGrainSupervision.modular.param.PgBasicReportInfoPageParam;
import com.unis.finishedGrainSupervision.modular.service.DataKcglKcswDefaultCountService;
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;

/**
 * 成品粮储备库区基础信息管理
 *
 * @author TS
 * @date  2024/06/04 15:37
 */
@Api(tags = "成品粮储备库区基础信息管理")
@ApiSupport(author = "UNIS_TEAM", order = 1)
@RestController
@Validated
public class PgBasicReportInfoCountController {

    @Resource
    private DataKcglKcswDefaultCountService dataKcglKcswDefaultCountService;

    @Resource
    private UnitInfoService unitInfoService;

    @Resource
    private OrgInfoService orgInfoService;
    @Resource
    private StorehouseInfoService storehouseInfoService;

    /**
     * 获取成品粮企业信息分页
     *
     * @author
     * @date  2024/06/04 11:37
     */
    @ApiOperationSupport(order = 1)
    @ApiOperation("成品粮储备库区基础信息管理")
    @GetMapping("/finishedGrainSupervision/pgBasicReportInfo/findUnitPage")
    public CommonResult<IPage<UnitPageVO>> findUnitPage(PgBasicReportInfoPageParam pgBasicReportInfoPageParam) {
        return CommonResult.data(dataKcglKcswDefaultCountService.findUnitPage(pgBasicReportInfoPageParam));
    }

    /**
     * 获取成品粮企业信息详情
     *
     * @author Ts
     * @date 2024/06/04 11:37
     */
    @ApiOperationSupport(order = 2)
    @ApiOperation("获取单位信息表详情")
    @GetMapping("/finishedGrainSupervision/pgBasicReportInfo/getUnitDetail")
    public CommonResult<UnitInfoVO> getUnitDetail(@Valid UnitInfoIdParam unitInfoIdParam) {
        return CommonResult.data(unitInfoService.detail(unitInfoIdParam));
    }

    /**
     * 获取成品粮粮库信息分页
     *
     * @author
     * @date  2024/06/04 11:37
     */
    @ApiOperationSupport(order = 3)
    @ApiOperation("获取成品粮粮库信息分页")
    @GetMapping("/finishedGrainSupervision/pgBasicReportInfo/findOrgInfoPage")
    public CommonResult<IPage<OrgInfoPageVO>> findOrgInfoPage(PgBasicReportInfoPageParam pgBasicReportInfoPageParam) {
        return CommonResult.data(dataKcglKcswDefaultCountService.findOrgInfoPage(pgBasicReportInfoPageParam));
    }

    /**
     * 获取成品粮粮库信息详情
     *
     * @author Ts
     * @date 2024/06/04 11:37
     */
    @ApiOperationSupport(order = 4)
    @ApiOperation("获取成品粮粮库信息详情")
    @GetMapping("/finishedGrainSupervision/pgBasicReportInfo/getOrgDetail")
    public CommonResult<OrgInfo> detail(@Valid OrgInfoIdParam orgInfoIdParam) {
        return CommonResult.data(orgInfoService.detail(orgInfoIdParam));
    }

    /**
     * 获取成品粮仓房信息分页
     *
     * @author TS
     * @date  2024/06/04 11:37
     */
    @ApiOperationSupport(order = 5)
    @ApiOperation("获取成品粮仓房信息分页")
    @GetMapping("/finishedGrainSupervision/pgBasicReportInfo/finStorehousePage")
    public CommonResult<IPage<StorehousePageVO>> findStorehousePage(PgBasicReportInfoPageParam pgBasicReportInfoPageParam) {
        return CommonResult.data(dataKcglKcswDefaultCountService.findStorehousePage(pgBasicReportInfoPageParam));
    }

    /**
     * 获取成品粮仓房信息详情
     *
     * @author Ts
     * @date  2024/06/04 11:37
     */
    @ApiOperationSupport(order = 6)
    @ApiOperation("获取成品粮仓房信息详情")
    @GetMapping("/finishedGrainSupervision/pgBasicReportInfo/getStorehouseDetail")
    public CommonResult<StorehouseInfo> getStorehouseDetail(@Valid StorehouseInfoIdParam storehouseInfoIdParam) {
        return CommonResult.data(storehouseInfoService.detail(storehouseInfoIdParam));
    }

    /**
     * 获取设备信息分页
     *
     * @author TS
     * @date  2024/06/04 11:37
     */
    @ApiOperationSupport(order = 7)
    @ApiOperation("获取设备信息分页")
    @GetMapping("/finishedGrainSupervision/pgBasicReportInfo/finDevInputPage")
    public CommonResult<IPage<DevInputPageVO>> findDevInputPage(PgBasicReportInfoPageParam pgBasicReportInfoPageParam) {
        return CommonResult.data(dataKcglKcswDefaultCountService.findDevInputPage(pgBasicReportInfoPageParam));
    }
    /**
     * 获取设备信息详情
     *
     * @author Ts
     * @date  2024/06/04 20:37
     */
    @ApiOperationSupport(order = 8)
    @ApiOperation("获取设备信息详情")
    @GetMapping("/finishedGrainSupervision/pgBasicReportInfo/getDevInputDetail")
    public CommonResult<DevInputDetailVO> getDevInputDetail(@RequestParam("id") @NotBlank(message="id不能为空") String  id) {
        return CommonResult.data(dataKcglKcswDefaultCountService.getDevInputDetail(id));
    }
    /**
     * 获取日常检查信息分页
     *
     * @author TS
     * @date  2024/06/07 11:37
     */
    @ApiOperationSupport(order = 9)
    @ApiOperation("获取日常检查信息分页")
    @GetMapping("/finishedGrainSupervision/pgBasicReportInfo/finDailycheckPage")
    public CommonResult<IPage<StorageDailycheckPageVO>> findDailycheckPage(PgBasicReportInfoPageParam pgBasicReportInfoPageParam) {
        return CommonResult.data(dataKcglKcswDefaultCountService.finDailycheckPage(pgBasicReportInfoPageParam));
    }
    /**
     * 获取日常检查信息详情
     *
     * @author Ts
     * @date  2024/06/07 15:37
     */
    @ApiOperationSupport(order = 10)
    @ApiOperation("获取日常检查信息详情")
    @GetMapping("/finishedGrainSupervision/pgBasicReportInfo/getDailycheckDetail")
    public CommonResult<StorageDailycheckDetailVO> getDailycheckDetail(@RequestParam("id") @NotBlank(message="id不能为空") String  id) {
        return CommonResult.data(dataKcglKcswDefaultCountService.getDailycheckDetail(id));
    }

}
