package com.tofly.xrtygis.custom.controller.analyze;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tofly.common.core.entity.ResultRespone;
import com.tofly.xrtygis.entity.dto.AnalyzeDto;
import com.tofly.xrtygis.service.AnalyzeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@AllArgsConstructor
@Api(tags = "分区计量--统计分析")
@RequestMapping("/analyze")
public class AnalyzeController {

    private final AnalyzeService analyzeService;

    @GetMapping("/getLeakageAnalysis")
    @ApiOperation("处漏效率指标分析")
    public ResultRespone getParamInfo(Page page, AnalyzeDto dto){
        return ResultRespone.success(analyzeService.getLeakageAnalysis(page,dto));
    }
    @GetMapping("/getLeakageAnalysisView")
    @ApiOperation("处漏效率指标分析-图形统计")
    public ResultRespone getLeakageAnalysisView(AnalyzeDto dto){
        return ResultRespone.success(analyzeService.getLeakageAnalysisView(dto));
    }
    @GetMapping("/getLinePatrolRate")
    @ApiOperation("巡线完成率分析")
    public ResultRespone getLinePatrolRate(Page page,AnalyzeDto dto){
        return ResultRespone.success(analyzeService.getLinePatrolCompletionRateVo(page,dto));
    }
    @GetMapping("/getLineEfficiencyIndicator")
    @ApiOperation("巡线效率指标分析")
    public ResultRespone getLineEfficiencyIndicator(Page page,AnalyzeDto dto){
        return ResultRespone.success(analyzeService.getLineEfficiencyIndicator(page,dto));
    }

    @GetMapping("/getScadaStatisticsApp")
    @ApiOperation("app-获取scada总览信息")
    public ResultRespone getScadaStatisticsApp(){
        return ResultRespone.success(analyzeService.getScadaStatisticsApp());
    }

}
