package com.mosty.base.manager.remote;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mosty.base.feign.service.MostyBaseFeignService;
import com.mosty.base.feign.service.MostyHczxFeignService;
import com.mosty.base.model.dto.base.GetSsbmDto;
import com.mosty.base.model.dto.base.SysMessageInfoInsertDto;
import com.mosty.base.model.vo.base.DeptInfoVo;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.exception.BusinessException;
import com.mosty.common.core.business.entity.vo.SysUserDeptVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;


@Slf4j
@Service
@AllArgsConstructor
public class TbHczxAdaptRemoteService {

    // 部门信息
    private final MostyHczxFeignService mostyHczxFeignService;

    // 查询部门的盘查人员的数量
    public Integer getSjpcr(String ssbmdm, String time) {
        ResponseResult<Integer> responseResult = mostyHczxFeignService.getSjpcr(ssbmdm, time);
        if (responseResult == null || !responseResult.isSuccess()) {
            log.error("查询部门的盘查人员的数量 异常responseResult = {}", JSON.toJSONString(responseResult));
            throw new BusinessException("查询部门的盘查人员的数量！");
        }
        return responseResult.getData();
    }

    // 查询部门的盘查车辆的数量
    public Integer getSjpcc(String ssbmdm, String time) {
        ResponseResult<Integer> responseResult = mostyHczxFeignService.getSjpcc(ssbmdm, time);
        if (responseResult == null || !responseResult.isSuccess()) {
            log.error("查询部门的盘查车辆的数量 异常responseResult = {}", JSON.toJSONString(responseResult));
            throw new BusinessException("查询部门的盘查车辆的数量！");
        }
        return responseResult.getData();
    }
    // 查询部门的盘查物品的数量
    public Integer getPcWptj(String ssbmdm, String time) {
        ResponseResult<Integer> responseResult = mostyHczxFeignService.getPcWptj(ssbmdm, time);
        if (responseResult == null || !responseResult.isSuccess()) {
            log.error("查询部门的盘查车辆的数量 异常responseResult = {}", JSON.toJSONString(responseResult));
            throw new BusinessException("查询部门的盘查车辆的数量！");
        }
        return responseResult.getData();
    }



}
