package com.njcn.harmonic.controller.upload;

import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.harmonic.pojo.param.upload.DimBusBarParam;
import com.njcn.harmonic.pojo.vo.upload.DimBusBarVO;
import com.njcn.harmonic.service.upload.IEvaluationDataService;
import com.njcn.web.controller.BaseController;
import com.njcn.web.pojo.dto.PmsHttpResult;
import com.njcn.web.pojo.dto.PmsPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * pqs
 *
 * @author cdf
 * @date 2024/5/10
 */
@Slf4j
@RestController
@RequestMapping("/IndexAnalysis/BenchmarkLevelEva")
@Api(tags = "基准水平下穿查询")
@AllArgsConstructor
public class EvaluationDownController extends BaseController {

    private final IEvaluationDataService evaluationDataService;

    /**
     * 接收总部基准水平评估在运母线数量详情下穿接口
     * @author cdf
     * @date 2024/5/9
     */
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/getBaseEvaOnlineBusDetail")
    @ApiOperation("国网上送-在运母线数量详情下穿接口")
    @ApiImplicitParam(name = "param", value = "实体参数", required = true)
    public PmsHttpResult<PmsPage<DimBusBarVO>> getBaseEvaOnlineBusDetail(@RequestBody DimBusBarParam param) {
        String methodDescribe = getMethodDescribe("getBaseEvaOnlineBusDetail");
        PmsPage<DimBusBarVO> page = evaluationDataService.getBaseEvaOnlineBusDetail(param);
        return new PmsHttpResult<>(0, page);
    }


    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/getBaseEvaMonitorBusDetail")
    @ApiOperation("国网上送-监测母线列表详情下穿接口")
    @ApiImplicitParam(name = "param", value = "实体参数", required = true)
    public PmsHttpResult<PmsPage<DimBusBarVO>> getBaseEvaMonitorBusDetail(@RequestBody DimBusBarParam param) {
        String methodDescribe = getMethodDescribe("getBaseEvaMonitorBusDetail");
        PmsPage<DimBusBarVO> page = evaluationDataService.getBaseEvaMonitorBusDetail(param);
        return new PmsHttpResult<>(0, page);
    }


    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/getBusListByVoltageLevel")
    @ApiOperation("国网上送-根据交流均值查询母线详情下穿接口")
    @ApiImplicitParam(name = "param", value = "实体参数", required = true)
    public PmsHttpResult<PmsPage<DimBusBarVO>> getBusListByVoltageLevel(@RequestBody DimBusBarParam param) {
        String methodDescribe = getMethodDescribe("getBusListByVoltageLevel");
        PmsPage<DimBusBarVO> page = evaluationDataService.getBusListByVoltageLevel(param);
        return new PmsHttpResult<>(0, page);
    }

    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/getMonitorListByBus")
    @ApiOperation("国网上送-监测母线下有效监测点详情下穿接口")
    @ApiImplicitParam(name = "param", value = "实体参数", required = true)
    public PmsHttpResult<PmsPage<DimBusBarVO.DimBusBarEffectMonitorVO>> getMonitorListByBus(@RequestBody DimBusBarParam param) {
        String methodDescribe = getMethodDescribe("getMonitorListByBus");
        PmsPage<DimBusBarVO.DimBusBarEffectMonitorVO> page = evaluationDataService.getMonitorListByBus(param);
        return new PmsHttpResult<>(0, page);
    }

    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/getBaseEvaBusMonitorList")
    @ApiOperation("国网上送-电压等级母线监测点列表详情下穿接口")
    @ApiImplicitParam(name = "param", value = "实体参数", required = true)
    public PmsHttpResult<PmsPage<DimBusBarVO.DimBusBarMonitorVO>> getBaseEvaBusMonitorList(@RequestBody DimBusBarParam param) {
        String methodDescribe = getMethodDescribe("getBaseEvaBusMonitorList");
        PmsPage<DimBusBarVO.DimBusBarMonitorVO> page = evaluationDataService.getBaseEvaBusMonitorList(param);
        return new PmsHttpResult<>(0, page);
    }

    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/getBusAvgListByMonitorId")
    @ApiOperation("国网上送-根据母线id查询均值列表详情下穿接口")
    @ApiImplicitParam(name = "param", value = "实体参数", required = true)
    public PmsHttpResult<PmsPage<DimBusBarVO.DimBusBarMonitorAvgVO>> getBusAvgListByMonitorId(@RequestBody DimBusBarParam param) {
        String methodDescribe = getMethodDescribe("getBusAvgListByMonitorId");
        PmsPage<DimBusBarVO.DimBusBarMonitorAvgVO> page = evaluationDataService.getBusAvgListByMonitorId(param);
        return new PmsHttpResult<>(0, page);
    }

    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @GetMapping("/test")
    @ApiOperation("国网上送-测试")
    public PmsHttpResult<PmsPage<DimBusBarVO.DimBusBarMonitorVoltageVO>> test() {
        String methodDescribe = getMethodDescribe("test");
        return new PmsHttpResult<>(0, new PmsPage<>());
    }



}
