package com.mosty.hczx.remote;

import com.alibaba.fastjson.JSON;
import com.mosty.base.feign.service.MostyLzotherFeignService;
import com.mosty.base.feign.service.MostyYszxFeignService;
import com.mosty.base.model.dto.yszx.TbYsRyDto;
import com.mosty.base.model.entity.lzother.TAlarmBkxxRy;
import com.mosty.base.model.entity.lzother.TAlarmCkxx;
import com.mosty.base.model.entity.lzother.TAlarmZtry;
import com.mosty.base.model.entity.lzother.VJcxx;
import com.mosty.base.model.vo.yszx.TbYsRyBqUpdateDto;
import com.mosty.base.model.vo.yszx.TbYsRyDhUpdateDto;
import com.mosty.base.model.vo.yszx.TbYsRyVo;
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;

@Slf4j
@Service
@AllArgsConstructor
public class TbLzotherAdapRemoteService {

    private final MostyLzotherFeignService mostyLzotherFeignService;


    // 查询在逃人员信息
    public TAlarmZtry selectBySfzh(String sfzh) {
        ResponseResult<TAlarmZtry> responseResult = this.mostyLzotherFeignService.selectBySfzh(sfzh);
        if (responseResult == null || !responseResult.isSuccess()) {
            log.error("查询警情类别类型细类中文异常Result = {}", JSON.toJSONString(responseResult));
            throw new BusinessException("查询警情类别类型细类中文异常");
        }
        return responseResult.getData();
    }


    // 查询常控人员信息
    public TAlarmCkxx selectCkBySfzh(String sfzh) {
        ResponseResult<TAlarmCkxx> responseResult = this.mostyLzotherFeignService.selectCkBySfzh(sfzh);
        if (responseResult == null || !responseResult.isSuccess()) {
            log.error("查询警情类别类型细类中文异常Result = {}", JSON.toJSONString(responseResult));
            throw new BusinessException("查询警情类别类型细类中文异常");
        }
        return responseResult.getData();
    }


    // 查询布控人员信息
    public TAlarmBkxxRy selectBkBySfzh(String sfzh) {
        ResponseResult<TAlarmBkxxRy> responseResult = this.mostyLzotherFeignService.selectBkBySfzh(sfzh);
        if (responseResult == null || !responseResult.isSuccess()) {
            log.error("查询警情类别类型细类中文异常Result = {}", JSON.toJSONString(responseResult));
            throw new BusinessException("查询警情类别类型细类中文异常");
        }
        return responseResult.getData();
    }


}
