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.pojo.param.RStatZwAlarmCountWParam;
import com.njcn.device.pms.pojo.vo.ProblemMonitorDetailVO;
import com.njcn.device.pms.pojo.vo.RStatZwAlarmCountWVO;
import com.njcn.device.pms.service.majornetwork.RStatZwAlarmCountWService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
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;

/**
 * @Title RStatZwAlarmCountWController
 * @Package com.njcn.device.pms.controller
 * @Author jianghaifei
 * @Date 2022-10-09 08:56
 * @Version V1.0
 */
@RestController
@Api(tags = "主网-告警统计(周)")
@RequiredArgsConstructor
@RequestMapping("/rStatZwAlarmCount")
public class RStatZwAlarmCountWController extends BaseController {

    private final RStatZwAlarmCountWService rStatZwAlarmCountWService;


    /***
     * 查询所有告警统计(周)
     * @author jianghaifei
     * @date 2022-10-09 15:23
     * @param
     * @return com.njcn.common.pojo.response.HttpResult<java.util.List<com.njcn.device.pms.pojo.vo.RStatZwAlarmCountWVO>>
     */
    @PostMapping("getAllRStatZwAlarmCountList")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("根据条件查询所有告警统计(周)")
    public HttpResult<List<RStatZwAlarmCountWVO>> getAllRStatZwAlarmCountList(@RequestBody RStatZwAlarmCountWParam rStatZwAlarmCountWParam) {
        String methodDescribe = getMethodDescribe("getAllRStatZwAlarmCountList");
        List<RStatZwAlarmCountWVO> list = rStatZwAlarmCountWService.getAllRStatZwAlarmCountWList(rStatZwAlarmCountWParam);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }

    /***
     * 查询问题严重的监测点信息
     * @author jianghaifei
     * @date 2022-10-13 16:34
     * @param 
     * @return com.njcn.common.pojo.response.HttpResult<java.util.List<com.njcn.device.pms.pojo.vo.RStatZwAlarmCountWVO>>
     */
    @PostMapping("getProblemMonitorDetailList")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("查询问题严重的监测点信息")
    public HttpResult<List<ProblemMonitorDetailVO>> getProblemMonitorDetailList(@RequestBody RStatZwAlarmCountWParam rStatZwAlarmCountWParam) {
        String methodDescribe = getMethodDescribe("getProblemMonitorDetailList");
        List<ProblemMonitorDetailVO> list = rStatZwAlarmCountWService.getProblemMonitorDetailList(rStatZwAlarmCountWParam);

        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }
}
