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.*;
import com.lutao.cloud.oil.pojo.vo.*;
import com.lutao.cloud.oil.service.IBusinessSecurityRiskAssessmentService;
import com.lutao.cloud.oil.service.IBusinessSecurityRiskControlService;
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;

@RestController
@RequestMapping("/security-risk-control")
@Api(value = "安全风险管控",tags = "安全风险管控")
public class SecurityRiskControlController {

    @Resource
    private IBusinessSecurityRiskControlService iBusinessSecurityRiskControlService;
    @Resource
    private IBusinessSecurityRiskAssessmentService iBusinessSecurityRiskAssessmentService;



    @ApiOperation(value = "海洋平台(设施)总体情况",notes = "海洋平台(设施)总体情况")
    @ApiOperationSupport(order = 1)
    @PostMapping("/sea-platform-overall-situation")
    @Inner(value = false)
    public MessageInfo<IPage<SeaPlatformFacilityVO>> seaPlatformOverallSituation(Page page, @RequestBody SelectSeaPlatformFacilityParam param){

        return iBusinessSecurityRiskAssessmentService.querySeaPlatformFacility(param,page);
    }

    @ApiOperation(value = "海上固定式平台人员定员和救生装备情况",notes = "海上固定式平台人员定员和救生装备情况")
    @ApiOperationSupport(order = 2)
    @PostMapping("/platform-equipment-situation")
    public MessageInfo<SeaPlatformPersonAndEquipmentVO> platformEquipmentSituation(@RequestBody BaseParam param){

        return iBusinessSecurityRiskControlService.querySeaPlatformPersonAndEquipment(param);
    }

    @ApiOperation(value = "人员动态管理-平台定员和救生装备情况-列表",notes = "人员动态管理-平台定员和救生装备情况-列表")
    @ApiOperationSupport(order = 12)
    @PostMapping("/person-and-equipment-number-list")
    public MessageInfo<IPage<SeaPlatformEquipmentInfoVO>> personAndEquipmentNumberList(Page page,@RequestBody BaseParam param){

        return iBusinessSecurityRiskControlService.querySeaPlatformEquipmentInfo(page,param);
    }

    @ApiOperation(value = "高风险作业-类型统计",notes = "高风险作业-类型统计")
    @ApiOperationSupport(order = 3)
    @PostMapping("/high-risk-operations-type")
    @Inner(value = false)
    public MessageInfo<HighRiskModelVO> highRiskOperationsType(Page page,@RequestBody BaseParam param){

        return iBusinessSecurityRiskControlService.queryHighRiskModel(page,param);
    }

    @ApiOperation(value = "高风险作业-作业区域统计",notes = "高风险作业-作业区域统计")
    @ApiOperationSupport(order = 4)
    @PostMapping("/high-risk-operations-area")
    @Inner(value = false)
    public MessageInfo<IPage<HighRiskAreaVO>> highRiskOperationsArea(Page page,@RequestBody BaseParam param){

        return iBusinessSecurityRiskControlService.queryHighRiskArea(page,param);
    }

    @ApiOperation(value = "高风险作业-承包商统计",notes = "高风险作业-承包商统计")
    @ApiOperationSupport(order = 5)
    @PostMapping("/high-risk-operations-contractor")
    @Inner(value = false)
    public MessageInfo<ContractorListVO> highRiskOperations(Page page,@RequestBody BaseParam param){

        return iBusinessSecurityRiskControlService.queryContractorList(page,param);
    }


    @ApiOperation(value = "海上平台设施视频监控", notes = "海上平台设施视频监控")
    @ApiOperationSupport(order = 6)
    @PostMapping("/sea-platform-video-monitor")
    public MessageInfo<IPage<SeaPlatformVideoMonitorVO>> seaPlatformVideoMonitor(Page page, @RequestBody BaseParam param){

        return iBusinessSecurityRiskControlService.querySeaPlatformVideoMonitor(page,param);
    }


    @ApiOperation(value = "安全风险管控情况",notes = "安全风险管控情况")
    @ApiOperationSupport(order = 7)
    @PostMapping("/security-risk-control-situation")
    public MessageInfo<RiskControlSituationVO> riskControlSituation(Page page,@RequestBody BaseParam param){

        return iBusinessSecurityRiskControlService.queryRiskControlSituation(page,param);
    }

    @ApiOperation(value = "重大事项报告信息",notes = "重大事项报告信息")
    @ApiOperationSupport(order = 8)
    @PostMapping("/matters-manage")
    public MessageInfo<IPage<ScreenDisplayMattersVO>> mattersManagers(Page page,@RequestBody BaseParam param){

        return iBusinessSecurityRiskControlService.queryMattersManagers(page,param);
    }


    @ApiOperation(value = "应急预案列表",notes = "应急预案列表")
    @ApiOperationSupport(order = 9)
    @PostMapping("/emergency-plan-list")
    public MessageInfo<IPage<EmergencyPlanVO>> emergencyPlanList(Page page,@RequestBody EmergencyPlanParam param){

        return iBusinessSecurityRiskControlService.queryEmergencyPlanList(page,param);
    }

    @ApiOperation(value = "变更情况列表",notes = "变更情况列表")
    @ApiOperationSupport(order = 10)
    @PostMapping("/change-situation-list")
    public MessageInfo<IPage<ChangeInfoVO>> changeSituationList(Page page,@RequestBody ChangeSituationParam param){

        return iBusinessSecurityRiskControlService.queryChangeSituationList(page,param);
    }

    @ApiOperation(value = "备案情况列表",notes = "备案情况列表")
    @ApiOperationSupport(order = 11)
    @PostMapping("/filing-situation-list")
    public MessageInfo<IPage<RecordManageVO>> filingSituationList(Page page,@RequestBody FilingSituationParam param){

        return iBusinessSecurityRiskControlService.queryRecordManageList(page,param);
    }

    @ApiOperation(value = "弃井信息列表",notes = "弃井信息列表")
    @ApiOperationSupport(order = 12)
    @PostMapping("/report-information-list")
    public MessageInfo<IPage<GiveupMineReportVO>> reportInformationList(Page page,@RequestBody ReportInformationParam param){

        return iBusinessSecurityRiskControlService.queryGiveupMineReportList(page,param);
    }

    @ApiOperation(value = "近七日高风险作业趋势",notes = "近七日高风险作业趋势")
    @ApiOperationSupport(order = 13)
    @PostMapping("/high-risk-operations-trend")
    @Inner(value = false)
    public MessageInfo<List<HighRiskOperationsTrendVO>> highRiskOperationsTrend(@RequestBody HighRiskOperationsTrendParam param){

        return iBusinessSecurityRiskControlService.queryHighRiskOperationsTrend(param);
    }

    @ApiOperation(value = "高风险作业-作业详情",notes = "高风险作业-作业详情")
    @ApiOperationSupport(order = 14)
    @PostMapping("/high-risk-operations-detail")
    @Inner(value = false)
    public MessageInfo<IPage<HighRiskOperationsDetailVO>> highRiskOperationsDetail(Page page,@RequestBody WorkDetailParam param){

        return iBusinessSecurityRiskControlService.queryHighRiskOperationsDetail(page,param);
    }

}
