package com.huatek.busi.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.huatek.busi.constant.ApiConstant;
import com.huatek.busi.entity.ParameterMake;
import com.huatek.busi.service.ParameterMakeService;
import com.huatek.busi.vo.ParameterMakeVo;
import com.huatek.busi.vo.ParameterResultVo;
import com.huatek.torch.frame.tools.ConstantUtil;
import com.huatek.torch.frame.tools.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * author mitchell_ma
 * date 2021-11-29
 */
@Api(tags = {ApiConstant.Tags.PARAMETERMAKE})
@RestController
@RequestMapping("/api/parameterMake")
public class ParameterMakeController {

    @Reference(check = false)
    ParameterMakeService parameterMakeService;



//    @ApiOperation(value = "從緩存表查出絕對、相對增長率")
//    @GetMapping(value = "selectTransformerParameterMakeRateCache")
//    public Map<String,Object> selectTransformerParameterMakeRateCache(@RequestParam String markId){
//        ParameterMakeVo parameterMakeVo = parameterMakeService.findTransformerParameterMakeRateCache(markId);
//        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "",parameterMakeVo );
//    }


    @ApiOperation(value = "/变压器打标字段相对、绝对增长率计算并插入缓存表")
    @GetMapping(value = "selectTransformerParameterMakeRate")
    public Map<String,Object> selectTransformerParameterMakeRate(){
        List<ParameterMakeVo> list = parameterMakeService.insertTransformerParameterMake();
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "",list );
    }


    @ApiOperation(value = "/Gis打标字段相对、绝对增长率计算并插入缓存表")
    @GetMapping(value = "selectGisParameterMakeRate")
    public Map<String,Object> selectGisParameterMakeRate(){
        List<ParameterMakeVo> list = parameterMakeService.insertGisParameterMake();
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "",list );
    }

    @ApiOperation(value = "/开关柜打标字段相对、绝对增长率计算并插入缓存表")
    @GetMapping(value = "selectSwitchgearParameterMakeRate")
    public Map<String,Object> selectSwitchgearParameterMakeRate(){
        List<ParameterMakeVo> list = parameterMakeService.insertSwitchgearParameterMake();
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "",list );
    }

    @ApiOperation(value = "/避雷器打标字段相对、绝对增长率计算并插入缓存表")
    @GetMapping(value = "selectArresterParameterMakeRate")
    public Map<String,Object> selectArresterParameterMakeRate(){
        List<ParameterMakeVo> list = parameterMakeService.insertArresterParameterMake();
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "",list );
    }

    @ApiOperation(value = "/电缆打标字段相对、绝对增长率计算并插入缓存表")
    @GetMapping(value = "selectCableParameterMakeRate")
    public Map<String,Object> selectCableParameterMakeRate(){
        List<ParameterMakeVo> list = parameterMakeService.insertCableParameterMake();
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "",list );
    }


    @ApiOperation(value = "/发电机打标字段相对、绝对增长率计算并插入缓存表")
    @GetMapping(value = "selectGeneratorParameterMakeRate")
    public Map<String,Object> selectGeneratorParameterMakeRate(){
        List<ParameterMakeVo> list = parameterMakeService.insertGeneratorParameterMake();
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "",list );
    }












    //------------------------------------------------------------------------------------------------

//    @ApiOperation(value = "/变压器值比较")
//    @GetMapping(value = "selectTransformerParameterMake")
//    public Map<String,Object> selectParameterMake(){
//        List<ParameterResultVo> list = parameterMakeService.findTransformerParameterMake();
//        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "",list );
//    }
//
//    @ApiOperation(value = "/从缓存读取增长、偏差率")
//    @GetMapping(value = "selectTransformerParameterRate")
//    public Map<String,Object> selectTransformerParameterRate(@RequestParam String refId){
//        List<ParameterResultVo> list = parameterMakeService.findTransformerParameterRate(refId);
//        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "",list );
//    }
//
//
//    @ApiOperation(value = "/报告变压器打标值")
//    @GetMapping(value = "selectTransformerParameterValue")
//    public Map<String,Object> selectParameterValue(){
//        List<ParameterMake> list = parameterMakeService.findTransformerParameterValue();
//        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "",list );
//    }
//
//
//    @ApiOperation(value = "/Gis值比较")
//    @GetMapping(value = "selectGisParameterMake")
//    public Map<String,Object> selectGisParameterMake(){
//        List<ParameterResultVo> list = parameterMakeService.findGisParameterMake();
//        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "",list );
//    }
//
//    @ApiOperation(value = "/报告Gis打标值")
//    @GetMapping(value = "selectGisParameterValue")
//    public Map<String,Object> selectGisParameterValue(){
//        List<ParameterMake> list = parameterMakeService.findGisParameterValue();
//        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "",list );
//    }



}
