package com.huatek.busi.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.huatek.busi.constant.ApiConstant;
import com.huatek.busi.entity.EquipmentEvaluateStatus;
import com.huatek.busi.entity.GisEvaluateStatus;
import com.huatek.busi.entity.TransformerEvaluateStatus;
import com.huatek.busi.service.GisEvaluateService;
import com.huatek.busi.service.TransformerEvaluateService;
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.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

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

/**
 * 首页评估结果查询
 * author:mitchell_ma
 */
@Api(tags = {ApiConstant.Tags.BUSI_Evaluation_Status})
@RestController
@RequestMapping("/api/evaluateStatus")
public class EvaluateController {

    @Reference(check = false)
    TransformerEvaluateService transformerEvaluateService;

    @Reference(check = false)
    GisEvaluateService gisEvaluateService;

    /**
     * 变压器评估解雇查询
     */
    @ApiOperation(value = "变压器评估结果查询")
    @GetMapping(value="/selectTransformerEvaluate")
    public Map<String, Object> selectTransformerEvaluate (){
        List<TransformerEvaluateStatus> list = transformerEvaluateService.findEvaluateStatus();
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", list);
    }

    /**
     * GIS评估解雇查询
     */
    @ApiOperation(value = "GIS评估结果查询")
    @GetMapping(value="/selectGisEvaluate")
    public Map<String, Object> selectGisEvaluate (){
        List<GisEvaluateStatus> list = gisEvaluateService.findEvaluateStatus();
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", list);
    }


    /**
     * 设备评估统计
     */
    @ApiOperation(value = "设备评估统计")
    @GetMapping(value="/selectEquipmentEvaluate")
    public Map<String, Object> selectEquipmentEvaluate (){
        List<EquipmentEvaluateStatus> list = transformerEvaluateService.findEquipmentEvaluateStatus();
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", list);
    }

}
