package com.mosty.base.manager.remote;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.base.feign.service.MostyYjzlFeignService;
import com.mosty.base.model.dto.yjzl.TbYjxxDTO;
import com.mosty.base.model.dto.yjzl.TbZlxxInsertDto;
import com.mosty.base.model.entity.yjzl.TbYjxx;
import com.mosty.base.model.query.yjzl.TbYjxxQuery;
import com.mosty.base.model.query.yjzl.TbZlxxQuery;
import com.mosty.base.model.vo.yjzl.TbZlxxVo;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.exception.BusinessException;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
@AllArgsConstructor
public class TbYjzlAdaptRrmoteService {

    private final MostyYjzlFeignService mostyYjzlFeignService;

    // 查询犯罪预测数量
    public Integer getFzyjCount(String ssbmdm, String time, String sfxl) {
        ResponseResult<Integer> responseResult = mostyYjzlFeignService.getFzyjCount(ssbmdm, time, sfxl);
        if (responseResult == null || !responseResult.isSuccess()) {
            log.error("查询犯罪预测数量 异常Result = {}", JSON.toJSONString(responseResult));
            throw new BusinessException("查询犯罪预测数量 异常!");
        }
        return responseResult.getData();
    }

    // 查询指令的数量
    public Integer getZlCount(String ssbmdm, String time, String zlzxzt) {
        ResponseResult<Integer> responseResult = mostyYjzlFeignService.getZlCount(ssbmdm, time, zlzxzt);
        if (responseResult == null || !responseResult.isSuccess()) {
            log.error("查询指令的数量 异常Result = {}", JSON.toJSONString(responseResult));
            throw new BusinessException("查询指令的数量 异常!");
        }
        return responseResult.getData();
    }
}
