package com.ningdatech.carapi.car.rpt.controller;


import com.ningdatech.carapi.car.rpt.manage.RptOtherManage;
import com.ningdatech.carapi.car.rpt.model.dto.RptOtherParamDTO;
import com.ningdatech.carapi.car.rpt.model.vo.*;
import com.ningdatech.carapi.common.util.ExcelDownUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.List;

/**
 * <p>
 * 车辆报警清理分析表 其它报表 前端控制器
 * </p>
 *
 * @author PoffyZhang
 * @since 2022-11-09
 */
@RequestMapping("/api/car-rpt")
@RequiredArgsConstructor
@RestController
@Api(tags = "车辆管理-统计报表")
@Validated
public class RptOtherController {
    private final RptOtherManage rptOtherManage;

    @ApiOperation("专用车辆超速记录")
    @GetMapping("/other-special-overspeed")
    public List<RptOtherSpecialOverspeedVO> otherSpecialOverspeed(
            @Valid @ModelAttribute RptOtherParamDTO param) {
        return rptOtherManage.otherSpecialOverspeed(param);
    }

    @ApiOperation("专用车辆趟次记录")
    @GetMapping("/other-special-trips")
    public List<RptOtherSpecialTripsVO> otherSpecialTrips(
            @Valid @ModelAttribute RptOtherParamDTO param) {
        return rptOtherManage.otherSpecialTrips(param);
    }

    @ApiOperation("企业车辆趟次记录")
    @GetMapping("/other-company-trips")
    public List<RptOtherCompanyTripsVO> otherCompanyTrips(
            @Valid @ModelAttribute RptOtherParamDTO param) {
        return rptOtherManage.otherCompanyTrips(param);
    }

    @ApiOperation("车辆上线情况统计表")
    @GetMapping("/other-online-vehicles")
    public List<RptOtherOnlineVehiclesVO> otherOnlineVehicles(
            @Valid @ModelAttribute RptOtherParamDTO param) {
        return rptOtherManage.otherOnlineVehicles(param);
    }

    @ApiOperation("车辆跨域情况统计表")
    @GetMapping("/other-cross-domain-vehicles")
    public List<RptOtherCrossDomainVehiclesVO> otherCrossDomainVehicles(
            @Valid @ModelAttribute RptOtherParamDTO param) {
        return rptOtherManage.otherCrossDomainVehicles(param);
    }

    @ApiOperation("车辆报警清理情况统计表")
    @GetMapping("/other-alaram-clean-vehicles")
    public List<RptOtherAlarmCleanVehiclesVO> otherAlarmCleanVehicles(
            @Valid @ModelAttribute RptOtherParamDTO param) {
        return rptOtherManage.otherAlarmCleanVehicles(param);
    }

    @ApiOperation("车辆上线情况同比环比分析")
    @GetMapping("/other-online-analysis-vehicles")
    public List<RptOtherOnlineVehiclesAnalysisVO> otherOnlineAnalysisVehicles(
            @Valid @ModelAttribute RptOtherParamDTO param) {
        return rptOtherManage.otherOnlineAnalysisVehicles(param);
    }

    @ApiOperation("车辆跨域情况同比环比分析")
    @GetMapping("/other-cross-domain-analysis-vehicles")
    public List<RptOtherCrossDomainVehiclesAnalysisVO> otherCrossDomainAnalysisVehicles(
            @Valid @ModelAttribute RptOtherParamDTO param) {
        return rptOtherManage.otherCrossDomainAnalysisVehicles(param);
    }

    @ApiOperation("车辆告警情况同比环比分析")
    @GetMapping("/other-alarm-analysis-vehicles")
    public List<RptOtherAlarmCleanVehiclesAnalysisVO> otherAlarmAnalysisVehicles(
            @Valid @ModelAttribute RptOtherParamDTO param) {
        return rptOtherManage.otherAlarmAnalysisVehicles(param);
    }

    @ApiOperation("企业车辆终端安装情况统计")
    @GetMapping("/other-terminal-install")
    public List<RptOtherTerminalInstallVO> otherTerminalInstall(
            @Valid @ModelAttribute RptOtherParamDTO param) {
        return rptOtherManage.otherTerminalInstall(param);
    }


    @ApiOperation("专用车辆超速记录查询导出")
    @GetMapping("/special-vehicles-overSpeed-record-query-export")
    public void specialVehiclesOverSpeedRecordQueryExport(RptOtherParamDTO req, HttpServletResponse response) {
        ExcelDownUtil.downXls(response, req, rptOtherManage::specialVehiclesOverSpeedRecordQueryExport);
    }

    @ApiOperation("专用车辆趟次记录查询导出")
    @GetMapping("/special-vehicles-trips-record-query-export")
    public void specialVehiclesTripsRecordQueryExport(RptOtherParamDTO req, HttpServletResponse response) {
        ExcelDownUtil.downXls(response, req, rptOtherManage::specialVehiclesTripsRecordQueryExport);
    }

    @ApiOperation("企业车辆趟次记录查询导出")
    @GetMapping("/enterprise-vehicles-trips-record-query-export")
    public void enterpriseVehiclesTripsRecordQueryExport(RptOtherParamDTO req, HttpServletResponse response) {
        ExcelDownUtil.downXls(response, req, rptOtherManage::enterpriseVehiclesTripsRecordQueryExport);
    }

    @ApiOperation("车辆上线情况统计报表导出")
    @GetMapping("/vehicles-online-statistics-report-export")
    public void vehiclesOnlineStatisticsReportExport(RptOtherParamDTO req, HttpServletResponse response) {
        ExcelDownUtil.downXls(response, req, rptOtherManage::vehiclesOnlineStatisticsReportExport);
    }

    @ApiOperation("车辆跨域情况统计报表导出")
    @GetMapping("/vehicles-cross-domain-statistics-report-export")
    public void vehiclesCrossDomainStatisticsReportExport(RptOtherParamDTO req, HttpServletResponse response) {
        ExcelDownUtil.downXls(response, req, rptOtherManage::vehiclesCrossDomainStatisticsReportExport);
    }

    @ApiOperation("车辆报警清理统计报表导出")
    @GetMapping("/vehicles-alarm-clear-statistics-report-export")
    public void vehiclesAlarmClearStatisticsReportExport(RptOtherParamDTO req, HttpServletResponse response) {
        ExcelDownUtil.downXls(response, req, rptOtherManage::vehiclesAlarmClearStatisticsReportExport);
    }

    @ApiOperation("车辆上线情况同比/环比分析导出")
    @GetMapping("/vehicles-online-situation-annulus-analysis-report-export")
    public void vehiclesOnlineSituationAnnulusAnalysisReportExport(RptOtherParamDTO req, HttpServletResponse response) {
        ExcelDownUtil.downXls(response, req, rptOtherManage::vehiclesOnlineSituationAnnulusAnalysisReportExport);
    }

    @ApiOperation("车辆报警情况同比/环比分析导出")
    @GetMapping("/vehicles-alarm-situation-annulus-analysis-report-export")
    public void vehiclesAlarmSituationAnnulusAnalysisReportExport(RptOtherParamDTO req, HttpServletResponse response) {
        ExcelDownUtil.downXls(response, req, rptOtherManage::vehiclesAlarmSituationAnnulusAnalysisReportExport);
    }

    @ApiOperation("车辆跨域情况同比/环比分析导出")
    @GetMapping("/vehicles-cross-domain-situation-annulus-analysis-report-export")
    public void vehiclesCrossDomainSituationAnnulusAnalysisReportExport(RptOtherParamDTO req, HttpServletResponse response) {
        ExcelDownUtil.downXls(response, req, rptOtherManage::vehiclesCrossDomainSituationAnnulusAnalysisReportExport);
    }

    @ApiOperation("企业车辆车载终端安装率统计导出")
    @GetMapping("/enterprise-vehicles-car-terminal-installation-rate-report-export")
    public void enterpriseVehiclesCarTerminalInstallationRateReportExport(RptOtherParamDTO req, HttpServletResponse response) {
        ExcelDownUtil.downXls(response, req, rptOtherManage::enterpriseVehiclesCarTerminalInstallationRateReportExport);
    }

    //@ApiOperation("9地区车辆上线情况统计导出")
    //@GetMapping("/nine-areas-vehicles-online-statistics-report-export")
    //public void nineAreasVehiclesOnlineStatisticsReportExport(RptOtherParamDTO req, HttpServletResponse response) {
    //    ExcelDownUtil.downXls(response, req, rptOtherManage::nineAreasVehiclesOnlineStatisticsReportExport);
    //}
}
