package com.njcn.harmonic.controller.upload;

import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.device.pms.pojo.param.gw.TypicalSourceParam;
import com.njcn.device.pms.pojo.vo.gw.TypicalOverIndex;
import com.njcn.device.pms.pojo.vo.gw.TypicalOverStation;
import com.njcn.device.pms.pojo.vo.gw.TypicalSourceEffectiveLine;
import com.njcn.device.pms.pojo.vo.gw.TypicalSourceOnLine;
import com.njcn.harmonic.service.upload.TypicalSourceLoadDownService;
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.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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;

/**
 * @author wr
 * @date 2024/5/16 9:22
 */
@Slf4j
@RestController
@RequestMapping("/IndexAnalysis/TypicalSourceLoad")
@Api(tags = "典型源荷下穿查询")
@RequiredArgsConstructor
public class TypicalSourceLoadDownController {

    private final TypicalSourceLoadDownService typicalSourceLoadDownService;

    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/getOnlineDetail")
    @ApiOperation("查询在线干扰源用户下穿接口")
    @ApiImplicitParam(name = "param", value = "实体参数", required = true)
    public PmsHttpResult<PmsPage<TypicalSourceOnLine>> getOnlineDetail(@RequestBody TypicalSourceParam param) {
        PmsPage<TypicalSourceOnLine> PmsPage = typicalSourceLoadDownService.getOnlineDetail(param);
        return new PmsHttpResult<>(0, PmsPage);
    }

    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/getMonitorDetail")
    @ApiOperation("查询监测有效干扰源用户下穿接口")
    @ApiImplicitParam(name = "param", value = "实体参数", required = true)
    public PmsHttpResult<PmsPage<TypicalSourceOnLine>> getMonitorDetail(@RequestBody TypicalSourceParam param) {
        PmsPage<TypicalSourceOnLine> PmsPage = typicalSourceLoadDownService.getMonitorDetail(param);
        return new PmsHttpResult<>(0, PmsPage);
    }

    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/getValidMonitorList")
    @ApiOperation("获取有效监测点列表下穿接口")
    @ApiImplicitParam(name = "param", value = "实体参数", required = true)
    public PmsHttpResult<PmsPage<TypicalSourceEffectiveLine>> getValidMonitorList(@RequestBody TypicalSourceParam param) {
        PmsPage<TypicalSourceEffectiveLine> PmsPage = typicalSourceLoadDownService.getValidMonitorList(param);
        return new PmsHttpResult<>(0, PmsPage);
    }

    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/getOverStationList")
    @ApiOperation("获取超标电站数据列表下穿接口")
    @ApiImplicitParam(name = "param", value = "实体参数", required = true)
    public PmsHttpResult<PmsPage<TypicalOverStation>> getOverStationList(@RequestBody TypicalSourceParam param) {
        PmsPage<TypicalOverStation> PmsPage = typicalSourceLoadDownService.getOverStationList(param);
        return new PmsHttpResult<>(0, PmsPage);
    }

    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/getOverIndexList")
    @ApiOperation("获取超标指标数据表下穿接口")
    @ApiImplicitParam(name = "param", value = "实体参数", required = true)
    public PmsHttpResult<PmsPage<TypicalOverIndex>> getOverIndexList(@RequestBody TypicalSourceParam param) {
        PmsPage<TypicalOverIndex> PmsPage = typicalSourceLoadDownService.getOverIndexList(param);
        return new PmsHttpResult<>(0, PmsPage);
    }
}
