package com.njcn.harmonic.controller.specialanalysis;

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.param.StatisticsBizBaseParam;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.harmonic.pojo.vo.RStatOrgPvVO;
import com.njcn.harmonic.service.specialanalysis.DistributedPvOverviewService;
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 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 yzh
 * @date 2022/11/24
 */

@RestController
@RequestMapping("/distributedPvOverview")
@Slf4j
@Api(tags = "专项分析-分布式光伏")
@RequiredArgsConstructor
public class DistributedPvOverviewController extends BaseController {

    private final DistributedPvOverviewService distributedPvOverviewService;

    /**
     * 按区域获取分布式光伏总览
     *
     * @param param 条件参数
     * @return com.njcn.common.pojo.response.HttpResult<java.util.List < com.njcn.harmonic.pojo.vo.RMpPvPowerDetailVO>>
     * @author yzh
     * @date 2022/11/24
     */
    @PostMapping("/getDistributedPvOverviewArea")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("按区域获取分布式光伏总览")
    @ApiImplicitParam(name = "param", value = "条件参数", required = true)
    public HttpResult<RStatOrgPvVO> getDistributedPvOverviewArea(@RequestBody StatisticsBizBaseParam param) {
        String methodDescribe = getMethodDescribe("getDistributedPvOverviewArea");
        RStatOrgPvVO list = distributedPvOverviewService.getDistributedPvOverviewArea(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }

    /**
     * 按电压等级获取分布式光伏总览
     *
     * @param param 条件参数
     * @return com.njcn.common.pojo.response.HttpResult<java.util.List < com.njcn.harmonic.pojo.vo.RMpPvPowerDetailVO>>
     * @author yzh
     * @date 2022/11/24
     */
    @PostMapping("/getDistributedPvOverviewVoltage")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("按电压等级获取分布式光伏总览")
    @ApiImplicitParam(name = "param", value = "条件参数", required = true)
    public HttpResult<RStatOrgPvVO> getDistributedPvOverviewVoltage(@RequestBody StatisticsBizBaseParam param) {
        String methodDescribe = getMethodDescribe("getDistributedPvOverviewVoltage");
        RStatOrgPvVO list = distributedPvOverviewService.getDistributedPvOverviewVoltage(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }

    /**
     * 按监测点类型获取分布式光伏总览
     *
     * @param param 条件参数
     * @return com.njcn.common.pojo.response.HttpResult<java.util.List < com.njcn.harmonic.pojo.vo.RMpPvPowerDetailVO>>
     * @author yzh
     * @date 2022/11/24
     */
    @PostMapping("/getDistributedPvOverviewLineSort")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("按监测点类型获取分布式光伏总览")
    @ApiImplicitParam(name = "param", value = "条件参数", required = true)
    public HttpResult<RStatOrgPvVO> getDistributedPvOverviewLineSort(@RequestBody StatisticsBizBaseParam param) {
        String methodDescribe = getMethodDescribe("getDistributedPvOverviewLineSort");
        RStatOrgPvVO list = distributedPvOverviewService.getDistributedPvOverviewLineSort(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }

}
