package com.lutao.cloud.oil.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
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.PersonCertificateParam;
import com.lutao.cloud.oil.pojo.param.PersonGoSeaParam;
import com.lutao.cloud.oil.pojo.param.RecentPeopleLineChartParam;
import com.lutao.cloud.oil.pojo.vo.*;
import com.lutao.cloud.oil.service.IBusinessPersonnelDynamicsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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/25
 */
@RestController
@RequestMapping("/personnel-dynamics")
@Api(value = "人员动态",tags = "人员动态")
public class PersonnelDynamicsController {

    @Resource
    private IBusinessPersonnelDynamicsService iBusinessPersonnelDynamicsService;



    @ApiOperation(value = "出海作业人员动态情况",notes = "出海作业人员动态作业情况")
    @ApiOperationSupport(order = 1)
    @PostMapping("/person-go-sea-work-status")
    @Inner(value = false)
    public MessageInfo<PersonGoSeaWorkStatusVO> personGoSeaWorkStatus(@RequestBody PersonGoSeaParam personGoSeaParam){
        return iBusinessPersonnelDynamicsService.queryPersonGoSeaWorkStatus(personGoSeaParam);
    }

    @ApiOperation(value = "出海人员分类统计",notes = "出海人员分类统计")
    @ApiOperationSupport(order = 2)
    @PostMapping("/person-go-sea-classify-statistics")
    @Inner(value = false)
    public MessageInfo<PersonGoSeaWorkStatusVO> personGoSeaClassifyStatistics(@RequestBody PersonGoSeaParam personGoSeaParam){
        return iBusinessPersonnelDynamicsService.queryPersonGoSeaWorkStatus(personGoSeaParam);

    }

    @ApiOperation(value = "五四小证到期预警",notes = "五四小证到期预警")
    @ApiOperationSupport(order = 3)
    @PostMapping("/certificate-expire-warning")
    @Inner(value = false)
    public MessageInfo<CertificateExpireWarningVO> certificateExpireWarning(@RequestBody PersonCertificateParam personCertificateParam){

        return iBusinessPersonnelDynamicsService.queryCertificateExpireWarning(personCertificateParam);
    }


    @ApiOperation(value = "出海人员详细信息",notes = "出海人员详细信息")
    @ApiOperationSupport(order = 4)
    @PostMapping("/person-go-sea-detail-information")
    @Inner(value = false)
    public MessageInfo<IPage<PersonGoSeaDetailInformationVO>> personGoSeaDetailInformation(Page page,@RequestBody PersonGoSeaParam personGoSeaParam){
        return iBusinessPersonnelDynamicsService.queryPersonGoSeaDetailInformationPage(page,personGoSeaParam);
    }

    @ApiOperation(value = "五小证到期预警下钻列表",notes = "五小证到期预警下钻列表")
    @ApiOperationSupport(order = 5)
    @PostMapping("/certificate-expire-warning-page")
    @Inner(value = false)
    public MessageInfo<IPage<PersonCertificateVO>> certificateExpireWarningPage(Page page, @RequestBody PersonCertificateParam param){

        return iBusinessPersonnelDynamicsService.queryCertificateExpireWarningPage(page,param);
    }

    @ApiOperation(value = "当日在平台人员信息",notes = "当日在平台人员信息")
    @ApiOperationSupport(order = 6)
    @PostMapping("/person-today-platform-information")
    @Inner(value = false)
    public MessageInfo<IPage<PersonTodayPlatformInformationVO>> personTodayPlatformInformation(Page page, @RequestBody PersonGoSeaParam personGoSeaParam){
        return iBusinessPersonnelDynamicsService.queryPersonTodayPlatformInformationPage(page,personGoSeaParam);
    }

    @ApiOperation(value = "在平台人数排名列表",notes = "在平台人数排名列表")
    @ApiOperationSupport(order = 7)
    @PostMapping("/person-platform-rank-list")
    @Inner(value = false)
    public MessageInfo<IPage<PersonPlatformRankVO>> personPlatformRankList(Page page, @RequestBody PersonGoSeaParam personGoSeaParam){
        return iBusinessPersonnelDynamicsService.queryPersonPlatformRankPage(page,personGoSeaParam);
    }

    @ApiOperation(value = "近期在平台人数折线图",notes = "近期在平台人数折线图")
    @ApiOperationSupport(order = 8)
    @PostMapping("/recent-people-line-chart")
    @Inner(value = false)
    public MessageInfo<List<RecentPeopleLineChartVO>> recentPeopleLineChart(@RequestBody RecentPeopleLineChartParam param){
        return iBusinessPersonnelDynamicsService.queryRecentPeopleLineChart(param);
    }


}
