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.BaseParam;
import com.lutao.cloud.oil.pojo.param.HighRiskCountParam;
import com.lutao.cloud.oil.pojo.param.PersonGoSeaParam;
import com.lutao.cloud.oil.pojo.vo.*;
import com.lutao.cloud.oil.service.*;
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;

@Api(value = "综合展示",tags = "综合展示")
@RestController
@RequestMapping("/screen-display")
public class ScreenDisplayController {

    @Resource
    private PlatformInfoService platformInfoService;

    @Resource
    private IBusinessSecurityRiskAssessmentService iBusinessSecurityRiskAssessmentService;

    @Resource
    private IBusinessEquipmentInfoService iBusinessEquipmentInfoService;

    @Resource
    private IBusinessSecurityRiskControlService iBusinessSecurityRiskControlService;

    @Resource
    private IBusinessPersonnelDynamicsService iBusinessPersonnelDynamicsService;

    @Resource
    private IBusinessPerceptionMonitorAlarmService iBusinessPerceptionMonitorAlarmService;

    @ApiOperation(value = "海上平台（设施）总体情况",notes = "海上平台（设施）总体情况")
    @ApiOperationSupport(order = 1)
    @PostMapping("/sea-platform-overall-situation")
    public MessageInfo<SeaPlatformOverallSituationVO> seaPlatformOverallSituation(@RequestBody BaseParam param){

        return platformInfoService.querySeaPlatformOverallSituation(param);
    }

    @ApiOperation(value = "火灾、可燃气体和有毒有害气体探测报警",notes = "火灾、可燃气体和有毒有害气体探测报警")
    @ApiOperationSupport(order = 2)
    @PostMapping("/detection-alarm")
    public MessageInfo<ScreenDisplayDetectAlarmVO> detectAlarm(@RequestBody BaseParam param){

        return iBusinessPerceptionMonitorAlarmService.queryScreenDisplayDetectAlarm(param);
    }

    @ApiOperation(value = "大屏关键工艺参数检测预警",notes = "大屏关键工艺参数检测预警")
    @ApiOperationSupport(order = 3)
    @PostMapping("/equipment-tag-alarm")
    public MessageInfo<List<ScreenTagAlarmVO>> equipmentTagAlarm(){

        return iBusinessPerceptionMonitorAlarmService.queryScreenTagAlarm();
    }

    @ApiOperation(value = "人员动态管理-平台定员和救生装备情况",notes = "人员动态管理-平台定员和救生装备情况")
    @ApiOperationSupport(order = 4)
    @PostMapping("/person-and-equipment-number")
    public MessageInfo<SeaPlatformPersonAndEquipmentVO> personAndEquipmentNumber(@RequestBody BaseParam param){

        return iBusinessSecurityRiskControlService.querySeaPlatformPersonAndEquipment(param);
    }


    @ApiOperation(value = "人员动态管理-出海作业人员动态",notes = "人员动态管理-出海作业人员动态")
    @ApiOperationSupport(order = 5)
    @PostMapping("/go-sea-person-dynamics")
    public MessageInfo<PersonGoSeaWorkStatusVO> goSeaPersonDynamics(@RequestBody PersonGoSeaParam param){
        return iBusinessPersonnelDynamicsService.queryPersonGoSeaWorkStatus(param);

    }

    @ApiOperation(value = "视频监控",notes = "视频监控")
    @ApiOperationSupport(order = 6)
    @PostMapping("/video-monitor")
    @Inner(value = false)
    public MessageInfo<ScreenDisplayVideoChartVO> videoMonitor(){
        return iBusinessSecurityRiskAssessmentService.queryScreenDisplayVideoChartV2();
    }


    @ApiOperation(value = "海上平台(设施)风险评估和治理情况",notes = "海上平台(设施)风险评估和治理情况")
    @ApiOperationSupport(order = 7)
    @PostMapping("/sea-platform-risk-manage")
    @Inner(value = false)
    public MessageInfo<HiddenDangerRectificationVO> seaPlatformRiskManage(@RequestBody BaseParam param){
        return iBusinessSecurityRiskAssessmentService.queryHiddenDangerRectifyStatus(param);

    }

    @ApiOperation(value = "高风险作业-类型统计",notes = "高风险作业-类型统计")
    @ApiOperationSupport(order = 8)
    @PostMapping("/screen-high-risk-work-type")
    public MessageInfo<HighRiskModelVO> highRiskWork(Page page, @RequestBody BaseParam param){
        return iBusinessSecurityRiskControlService.queryScreenHighRiskModel(page,param);
    }

    @ApiOperation(value = "高风险作业-作业区域统计",notes = "高风险作业-作业区域统计")
    @ApiOperationSupport(order = 4)
    @PostMapping("/screen-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 = 9)
    @PostMapping("/equipment-overall")
    public MessageInfo<ScreenDisplayEquipmentVO> equipmentOverall(Page page,@RequestBody BaseParam param){
        return iBusinessEquipmentInfoService.queryScreenDisplayEquipment(page,param);
    }

    @ApiOperation(value = "地图展示信息",notes = "地图展示信息")
    @ApiOperationSupport(order = 10)
    @PostMapping("/map-display")
    @Inner(value = false)
    public MessageInfo<IPage<MapDisplayVO>> mapDisplay(Page page,@RequestBody BaseParam param){
        return platformInfoService.queryMapDisplay(page,param);
    }

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

        return iBusinessSecurityRiskControlService.queryMattersManagers(page,param);
    }

    @ApiOperation(value = "三家平台数量", notes = "三家平台数量")
    @ApiOperationSupport(order = 12)
    @PostMapping("/platform-number")
    public MessageInfo<List<PlatformInfoCountVO>> platformNumber(@RequestBody BaseParam param) {
        return platformInfoService.queryPlatformNumber(param);
    }

    @ApiOperation(value = "大屏专业设备柱状图",notes = "大屏专业设备柱状图")
    @ApiOperationSupport(order = 13)
    @PostMapping("/equipment-overall-bar")
    public MessageInfo<ScreenDisplayEquipmentBarVO> equipmentOverallBar(@RequestBody BaseParam param){
        return iBusinessEquipmentInfoService.queryScreenDisplayEquipmentBar(param);
    }

    @ApiOperation(value = "高风险作业-按照类型统计图",notes = "高风险作业-按照类型统计图")
    @ApiOperationSupport(order = 14)
    @PostMapping("/screen-high-risk-work-type-bar")
    @Inner(value = false)
    public MessageInfo<HighRiskCountStatisticsVO> highRiskWorkTypeBar(@RequestBody HighRiskCountParam param){
        return iBusinessSecurityRiskControlService.queryHighRiskCountStatistics(param);
    }

    @ApiOperation(value = "高风险作业-按照平台统计图",notes = "高风险作业-按照平台统计图")
    @ApiOperationSupport(order = 1)
    @PostMapping("/screen-high-risk-work-type-by-platform-bar")
    @Inner(value = false)
    public MessageInfo<HighRiskCountStatisticsByPlatformVO> highRiskWorkTypeByPlatformBar(@RequestBody HighRiskCountParam param){
        return iBusinessSecurityRiskControlService.highRiskWorkTypeByPlatformBar(param);
    }
}
