package com.njcn.device.pms.controller.majornetwork;

import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.device.pms.api.TractionStationClient;
import com.njcn.device.pms.pojo.dto.PmsTractionStationDTO;
import com.njcn.device.pms.pojo.param.DataQualityDetailsParam;
import com.njcn.device.pms.pojo.param.PmsTractionStationParam;
import com.njcn.device.pms.pojo.vo.RStatAccountCheckDataVO;
import com.njcn.device.pms.pojo.vo.RStatMeasurementAccountDetailVO;
import com.njcn.device.pms.pojo.vo.RStatTargetDetailVO;
import com.njcn.device.pms.pojo.vo.RStatTractionStationAccountDetailVO;
import com.njcn.device.pms.service.majornetwork.DataQualityDetailsService;
import com.njcn.device.pms.service.majornetwork.ITractionStationService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * TODO 主网数据质量-数据质量核查详情
 *
 * @author yzh
 * @date 2022/11/4
 */
@RestController
@RequestMapping("/dataQualityDetails")
@Api(tags = "主网数据质量-数据质量核查详情")
@RequiredArgsConstructor
public class DataQualityDetailsController extends BaseController {

    private final DataQualityDetailsService dataQualityDetailsService;

    /**
     * 获取主网数据质量-台账类数据指标核查详情-监测点台账数据质量问题
     *
     * @param param 条件参数
     * @return com.njcn.common.pojo.response.HttpResult<java.util.List < com.njcn.event.pojo.vo.RStatAccountCheckDataVO>>
     * @author yzh
     * @date 2022/11/4
     */
    @PostMapping("/getQualityProblemsOfMonitoringPointAccountData")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("获取主网数据质量-台账类数据指标核查详情-监测点台账数据质量问题")
    @ApiImplicitParam(name = "param", value = "条件参数", required = true)
    public HttpResult<List<RStatMeasurementAccountDetailVO>> getQualityProblemsOfMonitoringPointAccountData(@RequestBody DataQualityDetailsParam param) {
        String methodDescribe = getMethodDescribe("getQualityProblemsOfMonitoringPointAccountData");
        List<RStatMeasurementAccountDetailVO> list = dataQualityDetailsService.getQualityProblemsOfMonitoringPointAccountData(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }

    /**
     * 获取主网数据质量-台账类数据指标核查详情-牵引站台账数据质量问题
     *
     * @param param 条件参数
     * @return com.njcn.common.pojo.response.HttpResult<java.util.List < com.njcn.event.pojo.vo.RStatAccountCheckDataVO>>
     * @author yzh
     * @date 2022/11/4
     */
    @PostMapping("/getTractionPlatformAccountDataQualityProblem")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("获取主网数据质量-台账类数据指标核查详情-牵引站台账数据质量问题")
    @ApiImplicitParam(name = "param", value = "条件参数", required = true)
    public HttpResult<List<RStatTractionStationAccountDetailVO>> getTractionPlatformAccountDataQualityProblem(@RequestBody DataQualityDetailsParam param) {
        String methodDescribe = getMethodDescribe("getTractionPlatformAccountDataQualityProblem");
        List<RStatTractionStationAccountDetailVO> list = dataQualityDetailsService.getTractionPlatformAccountDataQualityProblem(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }

    /**
     * 获取主网数据质量-稳态指标类数据质量问题查询
     *
     * @param param 条件参数
     * @return com.njcn.common.pojo.response.HttpResult<java.util.List < com.njcn.event.pojo.vo.RStatMeasurementAccountDetailVO>>
     * @author yzh
     * @date 2022/11/8
     */
    @PostMapping("/getRStatTargetDetail")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("获取主网数据质量-稳态指标类数据质量问题查询")
    @ApiImplicitParam(name = "param", value = "条件参数", required = true)
    public HttpResult<List<RStatTargetDetailVO>> getRStatTargetDetail(@RequestBody DataQualityDetailsParam param) {
        String methodDescribe = getMethodDescribe("getRStatTargetDetail");
        List<RStatTargetDetailVO> list = dataQualityDetailsService.getRStatTargetDetail(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }
}
