package com.njcn.event.controller.majornetwork;

import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.event.pojo.param.UniversalFrontEndParam;
import com.njcn.event.pojo.vo.RStatEventOrgVO;
import com.njcn.event.pojo.vo.RStatOrgVO;
import com.njcn.event.pojo.vo.RStatSubstationVO;
import com.njcn.event.service.majornetwork.StatisticsOfTransientIndicatorssService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
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 java.util.List;

/**
 * 主网-暂态指标统计
 *
 * @author yzh
 * @date 2022/10/10
 */

@RestController
@RequestMapping("/statisticsOfTransientIndicators")
@Api(tags = "主网-暂态指标统计")
@RequiredArgsConstructor
public class StatisticsOfTransientIndicatorsController extends BaseController {

    private final StatisticsOfTransientIndicatorssService statisticsOfTransientIndicatorssService;

    /**
     * 获取区域暂态指标统计
     *
     * @param param 前端传入参数
     * @return 区域暂态指标统计
     */
    @PostMapping("/getRStatOrg")
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @ApiOperation("获取区域暂态指标统计")
    @ApiImplicitParam(name = "param", value = "条件参数", required = true)
    public HttpResult<List<RStatOrgVO>> getRStatOrg(@RequestBody UniversalFrontEndParam param) {
        String methodDescribe = getMethodDescribe("getRStatOrg");
        List<RStatOrgVO> list = statisticsOfTransientIndicatorssService.getRStatOrg(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }

    /**
     * 获取区域暂态指标分类统计表
     *
     * @param param 前端传入参数
     * @return 区域暂态指标分类统计表
     */
    @PostMapping("/getRStatEventOrg")
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @ApiOperation("获取区域暂态指标分类统计表")
    @ApiImplicitParam(name = "param", value = "条件参数", required = true)
    public HttpResult<List<RStatEventOrgVO>> getRStatEventOrg(@RequestBody UniversalFrontEndParam param) {
        String methodDescribe = getMethodDescribe("getRStatEventOrg");
        List<RStatEventOrgVO> list = statisticsOfTransientIndicatorssService.getRStatEventOrg(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }


    /**
     * 获取变电站暂态指标分类统计表
     *
     * @param param 前端传入参数
     * @return 变电站暂态指标分类统计表
     */
    @PostMapping("/getRStatSubstation")
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @ApiOperation("获取变电站暂态指标分类统计表")
    @ApiImplicitParam(name = "param", value = "条件参数", required = true)
    public HttpResult<List<RStatSubstationVO>> getRStatSubstation(@RequestBody UniversalFrontEndParam param) {
        String methodDescribe = getMethodDescribe("getRStatSubstation");
        List<RStatSubstationVO> list = statisticsOfTransientIndicatorssService.getRStatSubstation(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }

}
