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.param.StatisticsBizBaseParam;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.device.pms.pojo.vo.ROperatingIndexVO;
import com.njcn.device.pms.pojo.vo.RQualityParameterPollVO;
import com.njcn.device.pms.pojo.vo.RQualityParameterVO;
import com.njcn.device.pms.service.majornetwork.DataQualityStatService;
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/1
 */

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

    private final DataQualityStatService dataQualityStatService;

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