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

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.pojo.param.DataQualityDetailsParam;
import com.njcn.device.pms.pojo.vo.PwRStatMeasurementAccountDetailVO;
import com.njcn.device.pms.pojo.vo.PwRStatTargetDetailVO;
import com.njcn.device.pms.service.distribution.PwDataQualityDetailsService;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

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

    private final PwDataQualityDetailsService pwDataQualityDetailsService;

    /**
     * 获取配网数据质量-台账类数据指标核查详情-监测点台账数据质量问题
     *
     * @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("/getPwQualityProblemsOfMonitoringPointAccountData")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("获取配网数据质量-台账类数据指标核查详情-监测点台账数据质量问题")
    @ApiImplicitParam(name = "param", value = "条件参数", required = true)
    public HttpResult<List<PwRStatMeasurementAccountDetailVO>> getPwQualityProblemsOfMonitoringPointAccountData(@RequestBody DataQualityDetailsParam param) {
        String methodDescribe = getMethodDescribe("getPwQualityProblemsOfMonitoringPointAccountData");
        List<PwRStatMeasurementAccountDetailVO> list = pwDataQualityDetailsService.getPwQualityProblemsOfMonitoringPointAccountData(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("/getPwRStatTargetDetail")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("获取配网数据质量-稳态指标类数据质量问题查询")
    @ApiImplicitParam(name = "param", value = "条件参数", required = true)
    public HttpResult<List<PwRStatTargetDetailVO>> getPwRStatTargetDetail(@RequestBody DataQualityDetailsParam param) {
        String methodDescribe = getMethodDescribe("getPwRStatTargetDetail");
        List<PwRStatTargetDetailVO> list = pwDataQualityDetailsService.getPwRStatTargetDetail(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }
}
