package com.ltgk.boat.controller;

import com.ltgk.boat.domain.dto.GetBoatCredentialOverDueListReq;
import com.ltgk.boat.domain.dto.GetBoatEnterOutReq;
import com.ltgk.boat.domain.dto.GetBoatGoSeaReq;
import com.ltgk.boat.domain.dto.GetBoatInsuranceOverDueListReq;
import com.ltgk.boat.domain.vo.*;
import com.ltgk.boat.service.BoatStatisticsService;
import com.ltgk.common.core.controller.BaseController;
import com.ltgk.common.core.domain.AjaxResult;
import com.ltgk.common.core.page.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
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.validation.Valid;
import java.util.List;

/**
 * @Author: wan kun
 * @Description: 大屏一张图 渔船统计
 * @Date: 2025/2/5 9:22
 * @Version: 1.0
 */
@Api(value = "大屏一张图 渔船统计")
@RestController
@Validated
@RequestMapping("/boatStatistics")
public class BoatStatisticsController extends BaseController {
    @Autowired
    private BoatStatisticsService boatStatisticsService;

    /**
     * 渔船统计
     *
     * @return {@link BoatStatisticsVo}
     */
    @PostMapping("/getBoatStatistics")
    @ApiOperation(value = "渔船统计")
    public AjaxResult getBoatStatistics() {
        return boatStatisticsService.getBoatStatistics();
    }

    /**
     * 渔船证书统计
     *
     * @return com.ltgk.common.core.domain.AjaxResult
     * @author Qi ChengBin
     * @date 2025/3/25
     */
    @PostMapping("/getBoatCertificateAndInsuranceStatistics")
    @ApiOperation(value = "渔船证书统计 -- 证书、保险过期")
    public AjaxResult getBoatCertificateAndInsuranceStatistics() {
        return success(boatStatisticsService.getBoatCertificateAndInsuranceStatistics());
    }

    /**
     * 渔船出海作业趋势
     *
     * @param getBoatGoSeaReq
     * @return {@link List<BoatGoSeaVo>}
     */
    @PostMapping("/getBoatGoSea")
    @ApiOperation(value = "渔船出海作业趋势")
    public AjaxResult getBoatGoSea(@RequestBody @Valid GetBoatGoSeaReq getBoatGoSeaReq) {
        return AjaxResult.success(boatStatisticsService.getBoatGoSea(getBoatGoSeaReq));
    }

    /**
     * 渔船保险过期明细
     *
     * @param getBoatInsuranceOverDueListReq
     * @return {@link List<BoatInsuranceOverDueVo>}
     */
    @PostMapping("/getBoatInsuranceOverDueList")
    @ApiOperation(value = "渔船保险过期明细")
    public TableDataInfo getBoatInsuranceOverDueList(@RequestBody @Valid GetBoatInsuranceOverDueListReq getBoatInsuranceOverDueListReq) {
        return getDataTable(boatStatisticsService.getBoatInsuranceOverDueList(getBoatInsuranceOverDueListReq));
    }

    /**
     * 渔船证书过期明细
     *
     * @param getBoatCredentialOverDueListReq
     * @return {@link List<BoatCredentialOverDueVo>}
     */
    @PostMapping("/getBoatCredentialOverDueList")
    @ApiOperation(value = "渔船证书过期明细")
    public TableDataInfo getBoatCredentialOverDueList(@RequestBody @Valid GetBoatCredentialOverDueListReq getBoatCredentialOverDueListReq) {
        return getDataTable(boatStatisticsService.getBoatCredentialOverDueList(getBoatCredentialOverDueListReq));
    }

    /**
     * 渔船大屏进出港
     *
     * @param getBoatEnterOutReq
     * @return {@link List< GetBoatEnterOutVo >}
     */
    @PostMapping("/getBoatEnterOut")
    @ApiOperation(value = "渔船大屏进出港")
    public TableDataInfo getBoatEnterOut(@RequestBody @Valid GetBoatEnterOutReq getBoatEnterOutReq) {
        return getDataTable(boatStatisticsService.getBoatEnterOut(getBoatEnterOutReq));
    }

}
