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.RMpDevAbnormalManageParam;
import com.njcn.device.pms.pojo.param.RMpDevSolveDetailParam;
import com.njcn.device.pms.pojo.vo.RMpDevSolveDetailVO;
import com.njcn.device.pms.pojo.vo.RMpDevSolveVO;
import com.njcn.device.pms.service.majornetwork.RMpDevSolveDetailService;
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 RMpDevSolveDetailController
 * @Package com.njcn.device.pms.controller.majornetwork
 * @Author jianghaifei
 * @Date 2022-11-14 19:44
 * @Version V1.0
 */
@RestController
@Api(tags = "终端异常管理")
@RequiredArgsConstructor
@RequestMapping("/rMpDevSolveDetail")
public class RMpDevSolveDetailController extends BaseController {

    private final RMpDevSolveDetailService rMpDevSolveDetailService;

    /***
     * 
     * @author jianghaifei
     * @date 2022-11-17 16:04
     * @param rMpDevAbnormalManageParam
     * @return com.njcn.common.pojo.response.HttpResult<java.util.List<com.njcn.device.pms.pojo.vo.RMpDevSolveVO>>
     */
    @PostMapping("/getOrgRMpDevSolveList")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("单位-终端消缺统计")
    public HttpResult<List<RMpDevSolveVO>> getOrgRMpDevSolveList(@RequestBody RMpDevAbnormalManageParam rMpDevAbnormalManageParam) {
        String methodDescribe = getMethodDescribe("getOrgRMpDevSolveList");
        List<RMpDevSolveVO> list = rMpDevSolveDetailService.getOrgRMpDevSolveList(rMpDevAbnormalManageParam);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }

    /***
     * 
     * @author jianghaifei
     * @date 2022-11-17 16:04
     * @param rMpDevAbnormalManageParam
     * @return com.njcn.common.pojo.response.HttpResult<java.util.List<com.njcn.device.pms.pojo.vo.RMpDevSolveVO>>
     */
    @PostMapping("/getManufactureRMpDevSolveList")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("厂商-终端消缺统计")
    public HttpResult<List<RMpDevSolveVO>> getManufactureRMpDevSolveList(@RequestBody RMpDevAbnormalManageParam rMpDevAbnormalManageParam) {
        String methodDescribe = getMethodDescribe("getManufactureRMpDevSolveList");
        List<RMpDevSolveVO> list = rMpDevSolveDetailService.getManufactureRMpDevSolveList(rMpDevAbnormalManageParam);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }

    /***
     * 
     * @author jianghaifei
     * @date 2022-11-17 16:04
     * @param rMpDevAbnormalManageParam
     * @return com.njcn.common.pojo.response.HttpResult<java.util.List<com.njcn.device.pms.pojo.vo.RMpDevSolveVO>>
     */
    @PostMapping("/getTypeRMpDevSolveList")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("故障类型-终端消缺统计")
    public HttpResult<List<RMpDevSolveVO>> getTypeRMpDevSolveList(@RequestBody RMpDevAbnormalManageParam rMpDevAbnormalManageParam) {
        String methodDescribe = getMethodDescribe("getTypeRMpDevSolveList");
        List<RMpDevSolveVO> list = rMpDevSolveDetailService.getTypeRMpDevSolveList(rMpDevAbnormalManageParam);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }

    /***
     * 
     * @author jianghaifei
     * @date 2022-11-17 16:04
     * @param rMpDevSolveDetailParam
     * @return com.njcn.common.pojo.response.HttpResult<java.util.List<com.njcn.device.pms.pojo.vo.RMpDevSolveDetailVO>>
     */
    @PostMapping("/getRMpDevSolveDetailList")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("终端异常清单")
    public HttpResult<List<RMpDevSolveDetailVO>> getRMpDevSolveDetailList(@RequestBody RMpDevSolveDetailParam rMpDevSolveDetailParam) {
        String methodDescribe = getMethodDescribe("getRMpDevSolveDetailList");
        List<RMpDevSolveDetailVO> list = rMpDevSolveDetailService.getRMpDevSolveDetailList(rMpDevSolveDetailParam);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }
}
