package com.gyee.frame.controller.goodness;

import com.gyee.frame.common.conf.AjaxStatus;
import com.gyee.frame.common.domain.AjaxResult;
import com.gyee.frame.service.*;
import com.gyee.frame.service.goodness.WindturbinegoodnessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * 风场风资源图表
 */
@Controller
@RequestMapping("/goodness")
@Api(value = "风场风资源图表", tags = "风场风资源图表")
public class WindpowerDetailChartController {
    @Resource
    private WindturbinegoodnessService windturbinegoodnessService;
    @Resource
    private InputoroutputspeedtotalService inputoroutputspeedtotalServicenegoodnessService;
    @Resource
    private WarningRecordsService warningRecordsService;
    @Resource
    private Brownoutsevent2Service brownoutsevent2Service;
    @Resource
    private Shutdownevent2Service shutdownevent2Service;
    @Resource
    private WarningInfoDayService warningInfoDayService;
    @Resource
    private WindturbineanalysisdayService windturbineanalysisdayService;
    @Resource
    private WindturbineinfodayService windturbineinfodayService;
    @Resource
    private WindturbinecurvefittingService windturbinecurvefittingService;
    @Resource
    private WindturbinethewindinfoService windturbinethewindinfoService;
    @Resource
    private WindpowerstationthewindinfoService windpowerstationthewindinfoService;

    private String jfplday;
    private String jfplmonth;
    private String jfplyear;


    /*
     * 风场日最大风速
     */
    @PostMapping("/wprzdfs")
    @ResponseBody
    @ApiOperation(value = "风场日最大风速", notes = "风场日最大风速")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "recorddate", value = "日期", required = true, dataType = "string", paramType = "query")})

    public AjaxResult wprzdfs(String wpId, String recorddate) {

        Map<String, Object> map = new HashMap<String, Object>();

        map = windpowerstationthewindinfoService.wprzdfs(wpId, recorddate);


        if (map != null) {
            return AjaxResult.successData(AjaxStatus.success.code, map);
        } else {
            return AjaxResult.successData(AjaxStatus.success.code, map);
        }
    }

    /*
     * 风场月最大风速
     */
    @PostMapping("/wpyzdfs")
    @ResponseBody
    @ApiOperation(value = "风场月最大风速", notes = "风场月最大风速")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "recorddate", value = "日期", required = true, dataType = "string", paramType = "query")})

    public AjaxResult wpyzdfs(String wpId, String recorddate) {

        Map<String, Object> map = new HashMap<String, Object>();

        map = windpowerstationthewindinfoService.wpyzdfs(wpId, recorddate);


        if (map != null) {
            return AjaxResult.successData(AjaxStatus.success.code, map);
        } else {
            return AjaxResult.successData(AjaxStatus.success.code, map);
        }
    }


    /*
     * 风场年最大风速
     */
    @PostMapping("/wpnzdfs")
    @ResponseBody
    @ApiOperation(value = "风场年最大风速", notes = "风场年最大风速")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "recorddate", value = "日期", required = true, dataType = "string", paramType = "query")})

    public AjaxResult wpnzdfs(String wpId, String recorddate) {

        Map<String, Object> map = new HashMap<String, Object>();

        map = windpowerstationthewindinfoService.wpnzdfs(wpId, recorddate);


        if (map != null) {
            return AjaxResult.successData(AjaxStatus.success.code, map);
        } else {
            return AjaxResult.successData(AjaxStatus.success.code, map);
        }
    }


    /*
     * 风场日风向频率
     */
    @PostMapping("/wprfxpl")
    @ResponseBody
    @ApiOperation(value = "风场日风向频率", notes = "风场日风向频率")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "recorddate", value = "日期", required = true, dataType = "string", paramType = "query")})

    public AjaxResult wprfxpl(String wpId, String recorddate) {
        Map<String, Object> map = new HashMap<String, Object>();

        map = windpowerstationthewindinfoService.wprfxpl(wpId, recorddate);


        if (map != null) {
            return AjaxResult.successData(AjaxStatus.success.code, map);
        } else {
            return AjaxResult.successData(AjaxStatus.success.code, map);
        }
    }


    /*
     * 风场月风向频率
     */
    @PostMapping("/wpyfxpl")
    @ResponseBody
    @ApiOperation(value = "风场月风向频率", notes = "风场月风向频率")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "recorddate", value = "日期", required = true, dataType = "string", paramType = "query")})

    public AjaxResult wpyfxpl(String wpId, String recorddate) {
        Map<String, Object> map = new HashMap<String, Object>();


        map = windpowerstationthewindinfoService.wpyfxpl(wpId, recorddate);


        if (map != null) {
            return AjaxResult.successData(AjaxStatus.success.code, map);
        } else {
            return AjaxResult.successData(AjaxStatus.success.code, map);
        }
    }

    /*
     * 风场年风向频率
     */
    @PostMapping("/wpnfxpl")
    @ResponseBody
    @ApiOperation(value = "风场年风向频率", notes = "风场年风向频率")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "recorddate", value = "日期", required = true, dataType = "string", paramType = "query")})

    public AjaxResult wpnfxpl(String wpId, String recorddate) {
        Map<String, Object> map = new HashMap<String, Object>();


        map = windpowerstationthewindinfoService.wpnfxpl(wpId, recorddate);


        if (map != null) {
            return AjaxResult.successData(AjaxStatus.success.code, map);
        } else {
            return AjaxResult.successData(AjaxStatus.success.code, map);
        }

}




}
