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.PwRDnOperatingVO;
import com.njcn.device.pms.pojo.vo.PwRQualityParameterVO;
import com.njcn.device.pms.pojo.vo.RQualityParameterPollVO;
import com.njcn.device.pms.service.distribution.PwDataQualityStatService;
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/4
 */

@RestController
@RequestMapping("/pwDataQualityStat")
@Api(tags = "配网数据质量-数据质量统计")
@RequiredArgsConstructor
public class PwDataQualityStatController extends BaseController {

    private final PwDataQualityStatService pwDataQualityStatService;

    /**
     * 获取配网数据质量-台账数据质量统计
     *
     * @param param 条件参数
     * @return com.njcn.common.pojo.response.HttpResult<java.util.List < com.njcn.event.pojo.vo.RQualityParameterVO>>
     * @author yzh
     * @date 2022/11/4
     */
    @PostMapping("/getPwLedgerDataQualityStat")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("获取配网数据质量-台账数据质量统计")
    @ApiImplicitParam(name = "param", value = "条件参数", required = true)
    public HttpResult<List<PwRQualityParameterVO>> getPwLedgerDataQualityStat(@RequestBody StatisticsBizBaseParam param) {
        String methodDescribe = getMethodDescribe("getPwLedgerDataQualityStat");
        List<PwRQualityParameterVO> list = pwDataQualityStatService.getPwLedgerDataQualityStat(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.ROperatingIndexVO>>
     * @author yzh
     * @date 2022/11/4
     */
    @PostMapping("/getPwMonitoringIndexDataQualityStat")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("获取配网数据质量-监测指标数据质量统计")
    @ApiImplicitParam(name = "param", value = "条件参数", required = true)
    public HttpResult<List<PwRDnOperatingVO>> getPwMonitoringIndexDataQualityStat(@RequestBody StatisticsBizBaseParam param) {
        String methodDescribe = getMethodDescribe("getPwMonitoringIndexDataQualityStat");
        List<PwRDnOperatingVO> list = pwDataQualityStatService.getPwMonitoringIndexDataQualityStat(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.RQualityParameterPollVO>>
     * @author yzh
     * @date 2022/11/7
     */
    @PostMapping("/getPwSummaryStatOfMonitoringIndexDataQualityProblems")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("获取配网数据质量-监测指标数据质量问题汇总统计")
    @ApiImplicitParam(name = "param", value = "条件参数", required = true)
    public HttpResult<List<RQualityParameterPollVO>> getPwSummaryStatOfMonitoringIndexDataQualityProblems(@RequestBody StatisticsBizBaseParam param) {
        String methodDescribe = getMethodDescribe("getPwSummaryStatOfMonitoringIndexDataQualityProblems");
        List<RQualityParameterPollVO> list = pwDataQualityStatService.getPwSummaryStatOfMonitoringIndexDataQualityProblems(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }
}
