This commit is contained in:
esacpe
2024-07-17 21:00:42 +08:00
commit b80c560e87
1931 changed files with 163526 additions and 0 deletions

View File

@ -0,0 +1,100 @@
package com.mosty.sjzx.remote;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mosty.base.model.dto.base.GetSsbmDto;
import com.mosty.base.model.dto.base.SysDeptDTO;
import com.mosty.base.feign.service.MostyBaseFeignService;
import com.mosty.base.model.vo.base.DeptInfoVo;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.exception.BusinessException;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* 调用部门信息远程适配层
*
* @author kevin
* @date 2022/7/6 10:37 上午
* @since 1.0.0
*/
@Slf4j
@Service
@AllArgsConstructor
public class TbBaseAdaptRemoteService {
private final MostyBaseFeignService mostyBaseFeignService;
// 根据部门编码查询部门信息
public DeptInfoVo getOrgByOrgcode(String orgCode) {
if (StringUtils.isBlank(orgCode)) {
return null;
}
ResponseResult<DeptInfoVo> responseResult = mostyBaseFeignService.getOrgByOrgcode(orgCode);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("调用部门编码查询部门信息异常 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("调用部门编码查询部门信息异常");
}
return responseResult.getData();
}
// 查询分局下的所有的派出所信息
public List<SysDeptDTO> getPcsByFxjdm(String orgCode) {
if (StringUtils.isBlank(orgCode)) {
return new ArrayList<>();
}
ResponseResult<List<SysDeptDTO>> responseResult = mostyBaseFeignService.getPcsByFxjdm(orgCode);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("查询分局下的所有的派出所信息异常 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("查询分局下的所有的派出所信息异常");
}
return responseResult.getData();
}
// 查询系统配置
public String getValue(String pzj) {
if (StringUtils.isBlank(pzj)) {
return null;
}
ResponseResult<String> responseResult = mostyBaseFeignService.getValue(pzj);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("查询系统配置异常 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("查询系统配置异常");
}
return responseResult.getData();
}
// 获取位置信息
public String getLocation(String jd, String wd) {
String address = "未知位置";
ResponseResult<JSONObject> obj = this.mostyBaseFeignService.getLzAddress(jd, wd);
if (obj != null && obj.getData() != null) {
String city = StringUtils.isNotBlank(obj.getData().getString("state")) ? obj.getData().getString("state") : "";
String region = StringUtils.isNotBlank(obj.getData().getString("region")) ? obj.getData().getString("region") : "";
String district = StringUtils.isNotBlank(obj.getData().getString("district")) ? obj.getData().getString("district") : "";
String suburb = StringUtils.isNotBlank(obj.getData().getString("suburb")) ? obj.getData().getString("suburb") : "";
String town = StringUtils.isNotBlank(obj.getData().getString("town")) ? obj.getData().getString("town") : "";
String road = StringUtils.isNotBlank(obj.getData().getString("road")) ? obj.getData().getString("road") : "";
address = city + region + district + suburb + town + road;
}
return address;
}
// 获取权限查询条件
public String getSsbm(String ssbmdm, String isChild) {
GetSsbmDto dto = new GetSsbmDto(ssbmdm, isChild);
ResponseResult<String> responseResult = mostyBaseFeignService.getSsbm(dto);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("获取权限查询条件异常 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("获取权限查询条件异常");
}
return responseResult.getData();
}
}

View File

@ -0,0 +1,70 @@
package com.mosty.sjzx.remote;
import com.alibaba.fastjson.JSON;
import com.mosty.base.feign.service.MostyJcglFeignService;
import com.mosty.base.model.dto.jcgl.TbJcglKfdDto;
import com.mosty.base.model.dto.jcgl.TbJcglPzfzDto;
import com.mosty.base.model.dto.jcgl.TbJcglXfllVo;
import com.mosty.base.model.dto.jcgl.TbJcglXfqyDto;
import com.mosty.base.model.entity.jcgl.TbJcglJwz;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.exception.BusinessException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @author dw
* @since 2022/7/23
* 外部调用基础管理接口
**/
@Service
@Slf4j
public class TbJcglAdaptRemoteService {
@Resource
private MostyJcglFeignService mostyJcglFeignService;
// 查询配置分值
public List<TbJcglPzfzDto> getFzList() {
ResponseResult<List<TbJcglPzfzDto>> responseResult = mostyJcglFeignService.getFzList();
if (responseResult == null || !responseResult.isSuccess()) {
log.error("查询配置分值失败 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("查询配置分值失败");
}
return responseResult.getData();
}
// 添加计算出来的必巡点的数据
public void createdBxd(List<Map<String, Object>> rList) {
ResponseResult<Void> responseResult = mostyJcglFeignService.createdBxd(rList);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("添加计算出来的必巡点的数据失败 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("添加计算出来的必巡点的数据失败");
}
}
// 查询所有快反点数据
public List<TbJcglKfdDto> getListKfdAll() {
ResponseResult<List<TbJcglKfdDto>> responseResult = mostyJcglFeignService.getListKfdAll();
if (responseResult == null || !responseResult.isSuccess()) {
log.error("查询所有快反点数据失败 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("查询所有快反点数据失败");
}
return responseResult.getData();
}
// 查询所有巡防区数据
public List<TbJcglXfqyDto> getListXfqyAll() {
ResponseResult<List<TbJcglXfqyDto>> responseResult = mostyJcglFeignService.getListXfqyAll();
if (responseResult == null || !responseResult.isSuccess()) {
log.error("查询所有巡防区数据失败 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("查询所有巡防区数据失败");
}
return responseResult.getData();
}
}

View File

@ -0,0 +1,23 @@
package com.mosty.sjzx.remote;
import com.alibaba.fastjson.JSON;
import com.mosty.base.feign.service.MostyLzotherFeignService;
import com.mosty.base.model.dto.sjzx.TbJqDTO;
import com.mosty.base.model.entity.lzother.VJcxx;
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.ArrayList;
import java.util.List;
@Slf4j
@Service
@AllArgsConstructor
public class TbLzotherAdaptRemoteService {
private final MostyLzotherFeignService mostyLzotherFeignService;
}

View File

@ -0,0 +1,65 @@
package com.mosty.sjzx.remote;
import com.alibaba.fastjson.JSON;
import com.mosty.base.feign.service.MostyQwzxFeignService;
import com.mosty.base.model.dto.qwzx.TbQwXfbbQueryByJlDto;
import com.mosty.base.model.entity.qwzx.TbQwXfbb;
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 TbQwzxAdaptRemoteService {
private final MostyQwzxFeignService mostyQwzxFeignService;
// 根据设备ID查询该设备所在的巡组
public List<TbQwXfbb> getBbList(String sbid) {
ResponseResult<List<TbQwXfbb>> responseResult = mostyQwzxFeignService.getBbList(sbid);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("获取巡组信息 失败 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("获取巡组信息异常!");
}
return responseResult.getData();
}
// 查询报备信息
public TbQwXfbb getBbxxInfo(String id) {
ResponseResult<TbQwXfbb> responseResult = mostyQwzxFeignService.getBbxxInfo(id);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("查询报备信息 失败 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("查询报备信息异常!");
}
return responseResult.getData();
}
// 查询范围内的最近的巡组信息
public TbQwXfbb getBbxxByJi(TbQwXfbbQueryByJlDto dto) {
ResponseResult<TbQwXfbb> responseResult = mostyQwzxFeignService.getBbxxByJi(dto);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("查询范围内的最近的巡组信息 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("查询范围内的最近的巡组信息异常!");
}
return responseResult.getData();
}
// 根据巡区获取报备id
public List<TbQwXfbb> getBbidByXq(String xqid) {
ResponseResult<List<TbQwXfbb>> responseResult = mostyQwzxFeignService.getBbidByXq(xqid);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("查询范围内的最近的巡组信息 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("查询范围内的最近的巡组信息异常!");
}
return responseResult.getData();
}
}

View File

@ -0,0 +1,34 @@
package com.mosty.sjzx.remote;
import com.alibaba.fastjson.JSON;
import com.mosty.base.feign.service.MostyRzzxFeignService;
import com.mosty.common.base.domain.ResponseResult;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Slf4j
@Service
@AllArgsConstructor
public class TbRzSpbfAdaptRemoteService {
private final MostyRzzxFeignService mostyRzzxFeignService;
/**
* 修改视频结束时间
* @param lyId 内容
* @return
*/
public Boolean updateLyId(String lyId) {
ResponseResult<Boolean> responseResult = mostyRzzxFeignService.updateLyId(lyId);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("修改失败Result = {}", JSON.toJSONString(responseResult));
return null;
}
return responseResult.getData();
}
}

View File

@ -0,0 +1,36 @@
package com.mosty.sjzx.remote;
import com.alibaba.fastjson.JSON;
import com.mosty.base.model.dto.sjzx.TbJqDTO;
import com.mosty.base.feign.service.MostySjzxFeignService;
import com.mosty.common.base.domain.ResponseResult;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@Service
@AllArgsConstructor
public class TbSjzxAdaptRemoteService {
private final MostySjzxFeignService mostySjzxFeignService;
/**
* 查询预警数据
* @param nr 内容
* @return
*/
public List<TbJqDTO> selectVigilant(String nr) {
ResponseResult<List<TbJqDTO>> responseResult = mostySjzxFeignService.selectVigilant(nr);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("查询预警数据异常Result = {}", JSON.toJSONString(responseResult));
return new ArrayList<>();
}
return responseResult.getData();
}
}

View File

@ -0,0 +1,43 @@
package com.mosty.sjzx.remote;
import com.alibaba.fastjson.JSON;
import com.mosty.base.feign.service.MostyWebSocketFeignService;
import com.mosty.base.model.dto.websocket.WebSocketObject;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.exception.BusinessException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* @author dw
* @since 2022/7/23
* websocket外部调用基础管理接口
**/
@Service
@Slf4j
public class TbWebSocketAdaptRemoteService {
@Resource
private MostyWebSocketFeignService mostyWebSocketFeignService;
// 发送websocket信息
public void sendMessage(WebSocketObject obj) {
ResponseResult<Void> responseResult = this.mostyWebSocketFeignService.sendMessage(obj);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("发送websocket信息异常 Result = {}", JSON.toJSONString(responseResult));
throw new BusinessException("发送websocket信息异常");
}
}
// 发送websocket信息
public void sendBbMessage(WebSocketObject obj) {
ResponseResult<Void> responseResult = this.mostyWebSocketFeignService.sendBbMessage(obj);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("发送websocket信息异常 Result = {}", JSON.toJSONString(responseResult));
throw new BusinessException("发送websocket信息异常");
}
}
}

View File

@ -0,0 +1,32 @@
package com.mosty.sjzx.remote;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.base.model.dto.yjzl.TbYjxxDTO;
import com.mosty.base.feign.service.MostyYjzlFeignService;
import com.mosty.base.model.query.yjzl.TbYjxxQuery;
import com.mosty.common.base.domain.ResponseResult;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Slf4j
@Service
@AllArgsConstructor
public class TbYjxxAdaptRemoteService {
private final MostyYjzlFeignService mostyYjzlFeignService;
// 查询预警信息
public Object getPageList(TbYjxxQuery dto) {
ResponseResult<IPage<TbYjxxDTO>> responseResult = mostyYjzlFeignService.getPageList(dto);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("查询预警信息异常Result = {}", JSON.toJSONString(responseResult));
return null;
}
return responseResult.getData();
}
}

View File

@ -0,0 +1,76 @@
package com.mosty.sjzx.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.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Slf4j
@Service
@AllArgsConstructor
public class TbYjzlAdaptRrmoteService {
private final MostyYjzlFeignService mostyYjzlFeignService;
// 查询指令
public Object selectInstructList(TbZlxxQuery dto) {
ResponseResult<List<TbZlxxVo>> responseResult = mostyYjzlFeignService.selectInstructList(dto);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("查询指令异常Result = {}", JSON.toJSONString(responseResult));
return null;
}
return responseResult.getData();
}
// 查询预警信息
public Object getPageList(TbYjxxQuery dto) {
ResponseResult<IPage<TbYjxxDTO>> responseResult = mostyYjzlFeignService.getPageList(dto);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("查询预警信息异常 Result = {}", JSON.toJSONString(responseResult));
throw new BusinessException("查询预警信息异常");
}
return responseResult.getData();
}
// 查询预警信息
public List<TbYjxx> getYjxx30Day(TbYjxxQuery dto) {
ResponseResult<List<TbYjxx>> responseResult = mostyYjzlFeignService.getYjxx30Day(dto);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("查询预警信息异常 Result = {}", JSON.toJSONString(responseResult));
throw new BusinessException("查询预警信息异常");
}
return responseResult.getData();
}
// 添加指令信息
public void addZl(TbZlxxInsertDto dto) {
ResponseResult<Void> responseResult = mostyYjzlFeignService.addZl(dto);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("查询预警信息异常 Result = {}", JSON.toJSONString(responseResult));
throw new BusinessException("查询预警信息异常");
}
}
// 警情转换成指令
public void andJqZl(String ssbmid,String jqid,String bbids,String zlxflx) {
ResponseResult<Void> responseResult = mostyYjzlFeignService.andJqZl(ssbmid,jqid,bbids,zlxflx);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("警情转换成指令异常 Result = {}", JSON.toJSONString(responseResult));
throw new BusinessException("警情转换成指令异常");
}
}
}

View File

@ -0,0 +1,47 @@
package com.mosty.sjzx.remote;
import com.alibaba.fastjson.JSON;
import com.mosty.base.feign.service.MostyYszxFeignService;
import com.mosty.base.model.vo.yszx.TbYsDlQuery;
import com.mosty.base.model.vo.yszx.TbYsGajgQuery;
import com.mosty.common.base.domain.ResponseResult;
//import com.mosty.yszx.bean.vo.TbYsDlVo;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* Created by 张海军 on 2022/7/14 19:50
*
* @ClassName this.tbYsDlRemoteService
*/
@Slf4j
@Service
@AllArgsConstructor
public class TbYszxAdapRemoteService {
private final MostyYszxFeignService mostyYszxFeignService;
// 查询地理要素
public Object queryAll( TbYsDlQuery dto) {
ResponseResult responseResult = this.mostyYszxFeignService.queryAll(dto);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("查询地理要素异常Result = {}", JSON.toJSONString(responseResult));
return null;
}
return responseResult.getData();
}
// 查询公安机关要素
public Object getGajgAll( TbYsGajgQuery dto) {
ResponseResult responseResult = this.mostyYszxFeignService.getGajgAll(dto);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("查询公安机关要素异常Result = {}", JSON.toJSONString(responseResult));
return null;
}
return responseResult.getData();
}
}