package com.hdkj.lt.bf.controller;

import com.alibaba.fastjson.JSON;
import com.hdkj.lt.base.model.response.PageVO;
import com.hdkj.lt.bf.aspect.RequiresCountryPermissions;
import com.hdkj.lt.bf.constants.WholeStationPowerCutConstants;
import com.hdkj.lt.bf.entity.dto.WholeStationPowerCutReqDTO;
import com.hdkj.lt.bf.entity.vo.wholestation.*;
import com.hdkj.lt.bf.service.FhzgWholeStationPowerCutTempService;
import com.hdkj.hussar.ApiResponse;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
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 luorui
 * @date 2025/8/15 10:59
 * <p>
 * 整站停电临时数据查询
 */
@RestController
@RequestMapping("/whole-station-power-cut-temp")
@RequiredArgsConstructor
public class WholeStationPowerCutTempController {


    private final FhzgWholeStationPowerCutTempService fhzgWholeStationPowerCutTempService;

    /**
     * 整站列表查询
     *
     * @author luorui
     * @date 2025/8/15 11:02
     **/
    @PostMapping("/page-list")
    @ApiOperation(value = "故障获取保护定值推荐列表")
    public ApiResponse<PageVO<WholeStationPowerCutVO>> pageList(@RequestBody WholeStationPowerCutReqDTO reqDTO) {
        PageVO<WholeStationPowerCutVO> result = fhzgWholeStationPowerCutTempService.pageList(reqDTO);
        return ApiResponse.success(result);
    }


    /**
     * 查询待转供路线数据
     *
     * @author luorui
     * @date 2025/8/15 11:55
     **/
    @PostMapping("/transfer-path")
    @ApiOperation(value = "查询待转供路线数据")
    public ApiResponse<WholeStationPowerCutTransferPathVO> transferPath(@RequestBody WholeStationPowerCutReqDTO reqDTO) {
        WholeStationPowerCutTransferPathVO result = (WholeStationPowerCutTransferPathVO) fhzgWholeStationPowerCutTempService.getDataById(WholeStationPowerCutConstants.QueryType.TRANSFER_PATH, reqDTO);
        return ApiResponse.success(result);
    }

    /**
     * 查询待转供用户数据
     *
     * @author luorui
     * @date 2025/8/15 11:55
     **/
    @PostMapping("/transfer-user")
    @ApiOperation(value = "查询待转供用户数据")
    public ApiResponse<WholeStationPowerCutTransferUserVO> transferUser(@RequestBody WholeStationPowerCutReqDTO reqDTO) {
        WholeStationPowerCutTransferUserVO result = (WholeStationPowerCutTransferUserVO) fhzgWholeStationPowerCutTempService.getDataById(WholeStationPowerCutConstants.QueryType.TRANSFER_USER, reqDTO);
        return ApiResponse.success(result);
    }

    /**
     * 查询转供方案详情数据
     *
     * @author luorui
     * @date 2025/8/15 11:55
     **/
    @PostMapping("/transfer-scheme")
    @ApiOperation(value = "查询转供方案详情数据")
    public ApiResponse<WholeStationPowerCutSchemeVO> transferScheme(@RequestBody WholeStationPowerCutReqDTO reqDTO) {
        WholeStationPowerCutSchemeVO result = (WholeStationPowerCutSchemeVO) fhzgWholeStationPowerCutTempService.getDataById(WholeStationPowerCutConstants.QueryType.TRANSFER_SCHEME, reqDTO);
        return ApiResponse.success(result);
    }

    /**
     * 查询转供方案评比数据
     *
     * @author luorui
     * @date 2025/8/15 11:55
     **/
    @PostMapping("/transfer-score-list")
    @ApiOperation(value = "查询转供方案评比数据")
    public ApiResponse<WholeStationPowerCutSchemeScoreVO> transferScoreList(@RequestBody WholeStationPowerCutReqDTO reqDTO) {
        WholeStationPowerCutSchemeScoreVO result = (WholeStationPowerCutSchemeScoreVO) fhzgWholeStationPowerCutTempService.getDataById(WholeStationPowerCutConstants.QueryType.TRANSFER_SCORE_LIST, reqDTO);
        return ApiResponse.success(result);
    }
}
