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.param.StatisticsBizBaseParam;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.device.pms.pojo.vo.PwRStatAccountCheckDataVO;
import com.njcn.device.pms.pojo.vo.RStatTargetCheckDataVO;
import com.njcn.device.pms.service.distribution.PwDataQualityCheckService;
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;

/**
 * 配网数据质量-数据质量核查
 *
 * @author yzh
 * @date 2022/11/2
 */
@RestController
@RequestMapping("/pwDataQualityCheck")
@Api(tags = "配网数据质量-数据质量核查")
@RequiredArgsConstructor
public class PwDataQualityCheckController extends BaseController {

    private final PwDataQualityCheckService pwDataQualityCheckService;

    /**
     * 获取配网数据质量-台帐类数据质量核查
     *
     * @param param 条件参数
     * @return com.njcn.common.pojo.response.HttpResult<java.util.List < com.njcn.event.pojo.vo.RStatAccountCheckDataVO>>
     * @author yzh
     * @date 2022/11/2
     */
    @PostMapping("/getPwQualityCheckOfAccountData")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("获取配网数据质量-台帐类数据质量核查")
    @ApiImplicitParam(name = "param", value = "条件参数", required = true)
    public HttpResult<List<PwRStatAccountCheckDataVO>> getPwQualityCheckOfAccountData(@RequestBody StatisticsBizBaseParam param) {
        String methodDescribe = getMethodDescribe("getPwQualityCheckOfAccountData");
        List<PwRStatAccountCheckDataVO> list = pwDataQualityCheckService.getPwQualityCheckOfAccountData(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.RStatTargetCheckDataVO>>
     * @author yzh
     * @date 2022/11/2
     */
    @PostMapping("/getPwMonitoringIndexDataQualityVerification")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("获取配网数据质量-监测指标数据质量核查")
    @ApiImplicitParam(name = "param", value = "条件参数", required = true)
    public HttpResult<List<RStatTargetCheckDataVO>> getPwMonitoringIndexDataQualityVerification(@RequestBody StatisticsBizBaseParam param) {
        String methodDescribe = getMethodDescribe("getPwMonitoringIndexDataQualityVerification");
        List<RStatTargetCheckDataVO> list = pwDataQualityCheckService.getPwMonitoringIndexDataQualityVerification(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }
}



