package com.gyee.runeconomy.controller.goodness;

import com.gyee.common.vo.benchmark.ValueVo;
import com.gyee.runeconomy.dto.R;
import com.gyee.runeconomy.dto.ResultMsg;
import com.gyee.runeconomy.service.WtwindDayInfoService;
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.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

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

/**
 * 风机风资源图表
 */
@Controller
@RequestMapping("/goodness")
@Api(value = "风机风资源图表", tags = "风机风资源图表")
public class WindturbineDetailChartController {

    @Resource
    private WtwindDayInfoService wtwindDayInfoService;


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

    public R wtrzdfs(String wtId, String recorddate) {
        Map<String, Object> map = new HashMap<String, Object>();
        List<ValueVo> vos = new ArrayList<ValueVo>();

        wtwindDayInfoService.rzdfs(wtId, recorddate, map, vos);


        if (null != map) {
            return R.data(ResultMsg.ok(map));
        } else {
            return R.data(ResultMsg.error());
        }
    }

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

    public R wtyzdfs(String wtId, String recorddate) {
        Map<String, Object> map = new HashMap<String, Object>();
        List<ValueVo> vos = new ArrayList<ValueVo>();
        wtwindDayInfoService.yzdfs(wtId, recorddate, map, vos);

        if (null != map) {
            return R.data(ResultMsg.ok(map));
        } else {
            return R.data(ResultMsg.error());
        }
    }

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

    public R wtnzdfs(String wtId, String recorddate) {
        Map<String, Object> map = new HashMap<String, Object>();
        List<ValueVo> vos = new ArrayList<ValueVo>();
        wtwindDayInfoService.nzdfs(wtId, recorddate, map, vos);

        if (null != map) {
            return R.data(ResultMsg.ok(map));
        } else {
            return R.data(ResultMsg.error());
        }
    }


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

    public R wtrfxpl(String wtId, String recorddate) {
        Map<String, Object> map = new HashMap<String, Object>();
        List<ValueVo> vos = new ArrayList<ValueVo>();
        wtwindDayInfoService.rfxpl(wtId, recorddate, map, vos);

        if (null != map) {
            return R.data(ResultMsg.ok(map));
        } else {
            return R.data(ResultMsg.error());
        }
    }


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

    public R wtyfxpl(String wtId, String recorddate) {
        Map<String, Object> map = new HashMap<String, Object>();
        List<ValueVo> vos = new ArrayList<ValueVo>();
        wtwindDayInfoService.yfxpl(wtId, recorddate, map, vos);

        if (null != map) {
            return R.data(ResultMsg.ok(map));
        } else {
            return R.data(ResultMsg.error());
        }
    }


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

    public R wtnfxpl(String wtId, String recorddate) {
        Map<String, Object> map = new HashMap<String, Object>();
        List<ValueVo> vos = new ArrayList<ValueVo>();
        wtwindDayInfoService.nfxpl(wtId, recorddate, map, vos);

        if (null != map) {
            return R.data(ResultMsg.ok(map));
        } else {
            return R.data(ResultMsg.error());
        }
    }


}
