package com.lutao.cloud.oil.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.lutao.cloud.common.core.util.MessageInfo;
import com.lutao.cloud.common.security.annotation.Inner;
import com.lutao.cloud.oil.pojo.param.BaseParam;
import com.lutao.cloud.oil.pojo.param.EquipTypeParam;
import com.lutao.cloud.oil.pojo.vo.*;
import com.lutao.cloud.oil.service.IBusinessEquipmentInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 专业设备管理
 *
 * @author yx
 * @date 2023/07/28
 */
@Api(value = "专业设备管理",tags = "专业设备管理")
@RestController()
@RequestMapping("/equipment-info")
public class EquipmentInfoController {

    @Resource
    private IBusinessEquipmentInfoService iBusinessEquipmentInfoService;

    @Resource
    private RedisTemplate redisTemplate;

    @ApiOperation(value = "专业设备数量统计",notes = "专业设备数量统计")
    @ApiOperationSupport(order = 1)
    @PostMapping("/equipment-number-statistics")
    @Inner(value = false)
    public MessageInfo<EquipmentStatisticsVO> equipmentNumberStatistics(@RequestBody BaseParam param){

        return iBusinessEquipmentInfoService.getEquipmentNumberStatistics(param);
    }

    @ApiOperation(value = "专业设备分类统计",notes = "专业设备分类统计")
    @ApiOperationSupport(order = 2)
    @PostMapping("/equipment-type-statistics")
    @Inner(value = false)
    public MessageInfo<EquipmentTypeStatisticsVO> equipmentTypeStatistics(Page page,@RequestBody EquipTypeParam param){

        return iBusinessEquipmentInfoService.getEquipmentTypeStatistics(page,param);
    }

    @ApiOperation(value = "专业设备定检和年检数量统计",notes = "专业设备定检和年检数量统计")
    @ApiOperationSupport(order = 3)
    @PostMapping("/equipment-inspect-statistics")
    @Inner(value = false)
    public MessageInfo<EquipmentInspectStatisticsVO> equipmentInspectStatistics(@RequestBody BaseParam param){

        return iBusinessEquipmentInfoService.getEquipmentInspectStatistics(param);
    }

    @ApiOperation(value = "专业设备年检分布",notes = "专业设备年检分布")
    @ApiOperationSupport(order = 4)
    @PostMapping("/equipment-annually-inspect-distribution")
    @Inner(value = false)
    public MessageInfo<List<YearInspectionDistributionVO>>  equipmentAnnuallyInspectDistribution(@RequestBody BaseParam param){

        return iBusinessEquipmentInfoService.getEquipmentAnnuallyInspectDistribution(param);
    }

    @ApiOperation(value = "专业设备定检分布",notes = "专业设备定检分布")
    @ApiOperationSupport(order = 5)
    @PostMapping("/equipment-periodical-inspect-distribution")
    @Inner(value = false)
    public MessageInfo<List<YearInspectionDistributionVO>>  equipmentPeriodicalInspectDistribution(@RequestBody BaseParam param){

        return iBusinessEquipmentInfoService.getEquipmentPeriodicalInspectDistribution(param);
    }

    @ApiOperation(value = "设备类型列表",notes = "设备类型列表")
    @ApiOperationSupport(order = 6)
    @PostMapping("/equipment-type-list")
    @Inner(value = false)
    public MessageInfo<List<EquipTypeNameVO>> equipmentTypeNameList(){

        return iBusinessEquipmentInfoService.getEquipmentTypeNameList();
    }

    @ApiOperation(value = "设备分类饼状图",notes = "设备分类饼状图")
    @ApiOperationSupport(order = 7)
    @PostMapping("/equipment-type-pie-chart")
    @Inner(value = false)
    public MessageInfo<List<EquipmentTypePieVO>> equipmentTypePieChart(@RequestBody BaseParam param){

        return iBusinessEquipmentInfoService.getEquipmentTypePieChart(param);
    }

    @ApiOperation(value = "设备类型年检分布",notes = "设备类型年检分布")
    @ApiOperationSupport(order = 8)
    @PostMapping("/equipment-type-year-inspect")
    @Inner(value = false)
    public MessageInfo<List<EquipTypeInspectVO>> equipmentTypeYearInspect(@RequestBody BaseParam param){

        return iBusinessEquipmentInfoService.getEquipmentTypeYearInspect(param);
    }

    @ApiOperation(value = "设备类型定检分布",notes = "设备类型定检分布")
    @ApiOperationSupport(order = 9)
    @PostMapping("/equipment-type-periodical-inspect")
    @Inner(value = false)
    public MessageInfo<List<EquipTypeInspectVO>> equipmentTypePeriodicalInspect(@RequestBody BaseParam param){

        return iBusinessEquipmentInfoService.getEquipmentTypePeriodicalInspect(param);
    }


}
