Merge branch 'main' of http://182.92.203.107:3000/libingkun/skyeyesystem
This commit is contained in:
commit
bb705ee956
10
README.md
10
README.md
@ -93,7 +93,15 @@ redis-server.exe --service-uninstall
|
|||||||
# 启动前端
|
# 启动前端
|
||||||
## 1. 在frontend目录中执行
|
## 1. 在frontend目录中执行
|
||||||
```
|
```
|
||||||
#npm install
|
npm install
|
||||||
|
|
||||||
|
npm install --save-dev cross-env
|
||||||
|
|
||||||
|
npx update-browserslist-db@latest
|
||||||
|
|
||||||
|
在 package.json
|
||||||
|
"serve": "cross-env NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve",
|
||||||
|
|
||||||
```
|
```
|
||||||
## 2. 拷贝resource目录中的dt-sdk到node-modules目录
|
## 2. 拷贝resource目录中的dt-sdk到node-modules目录
|
||||||
## 3. 编译前端代码
|
## 3. 编译前端代码
|
||||||
|
|||||||
@ -12,6 +12,11 @@
|
|||||||
<artifactId>skyeye-service-manager</artifactId>
|
<artifactId>skyeye-service-manager</artifactId>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.fastjson2</groupId>
|
||||||
|
<artifactId>fastjson2</artifactId>
|
||||||
|
<version>2.0.60</version>
|
||||||
|
</dependency>
|
||||||
<!-- 扩展工具包 -->
|
<!-- 扩展工具包 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.zhangy</groupId>
|
<groupId>com.zhangy</groupId>
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package com.zhangy.skyeye.jm.service.impl;
|
package com.zhangy.skyeye.jm.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.zhangy.skyeye.common.extend.exception.ServiceException;
|
import com.zhangy.skyeye.common.extend.exception.ServiceException;
|
||||||
import com.zhangy.skyeye.common.extend.util.ObjectUtil;
|
import com.zhangy.skyeye.common.extend.util.ObjectUtil;
|
||||||
import com.zhangy.skyeye.device.consts.PayloadTypeEnum;
|
import com.zhangy.skyeye.device.consts.PayloadTypeEnum;
|
||||||
@ -18,14 +19,17 @@ import com.zhangy.skyeye.py.service.IPyAirlineService;
|
|||||||
import com.zhangy.skyeye.sar.consts.SarImageModeEnum;
|
import com.zhangy.skyeye.sar.consts.SarImageModeEnum;
|
||||||
import com.zhangy.skyeye.sar.dto.SarFlightPlanDTO;
|
import com.zhangy.skyeye.sar.dto.SarFlightPlanDTO;
|
||||||
import com.zhangy.skyeye.sar.util.SpotlightPlanner;
|
import com.zhangy.skyeye.sar.util.SpotlightPlanner;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 航线规划
|
* 航线规划
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class JmAirlinePlanServiceImpl implements JmAirlinePlanService {
|
public class JmAirlinePlanServiceImpl implements JmAirlinePlanService {
|
||||||
|
|
||||||
@ -38,6 +42,8 @@ public class JmAirlinePlanServiceImpl implements JmAirlinePlanService {
|
|||||||
@Override
|
@Override
|
||||||
public Map<Long, List<JmAirline>> plan(JmJobModeEnum jobMode, SarImageModeEnum imageMode, Integer targetType,
|
public Map<Long, List<JmAirline>> plan(JmJobModeEnum jobMode, SarImageModeEnum imageMode, Integer targetType,
|
||||||
List<JmJobUav> uavList, List<List<JmJobPoint>> pointList) {
|
List<JmJobUav> uavList, List<List<JmJobPoint>> pointList) {
|
||||||
|
log.info("航线规划参数:{}||{}||{}||{}|{}", jobMode, imageMode, targetType,
|
||||||
|
JSON.toJSONString(uavList), JSON.toJSONString(pointList));
|
||||||
checkParam(jobMode, imageMode, targetType);
|
checkParam(jobMode, imageMode, targetType);
|
||||||
// 非航线模式需要调算法生成航线,需要从缓存取sar坐标
|
// 非航线模式需要调算法生成航线,需要从缓存取sar坐标
|
||||||
Map<Long, List<JmAirline>> airlineGroup = null;
|
Map<Long, List<JmAirline>> airlineGroup = null;
|
||||||
@ -56,8 +62,6 @@ public class JmAirlinePlanServiceImpl implements JmAirlinePlanService {
|
|||||||
*
|
*
|
||||||
* @param jobMode
|
* @param jobMode
|
||||||
* @param imageMode
|
* @param imageMode
|
||||||
* @param uavList
|
|
||||||
* @param pointList
|
|
||||||
*/
|
*/
|
||||||
private void checkParam(JmJobModeEnum jobMode, SarImageModeEnum imageMode, Integer targetType) {
|
private void checkParam(JmJobModeEnum jobMode, SarImageModeEnum imageMode, Integer targetType) {
|
||||||
if (imageMode == SarImageModeEnum.JS) {
|
if (imageMode == SarImageModeEnum.JS) {
|
||||||
@ -109,7 +113,6 @@ public class JmAirlinePlanServiceImpl implements JmAirlinePlanService {
|
|||||||
*
|
*
|
||||||
* @param uav 无人机
|
* @param uav 无人机
|
||||||
* @param home 起飞点
|
* @param home 起飞点
|
||||||
* @param point 目标点
|
|
||||||
* @return 航线
|
* @return 航线
|
||||||
*/
|
*/
|
||||||
public JmAirline planJs(JmJobUav uav, JmJobPoint home, JmJobPoint target) {
|
public JmAirline planJs(JmJobUav uav, JmJobPoint home, JmJobPoint target) {
|
||||||
@ -162,54 +165,79 @@ public class JmAirlinePlanServiceImpl implements JmAirlinePlanService {
|
|||||||
* 转为航线算法参数
|
* 转为航线算法参数
|
||||||
*/
|
*/
|
||||||
private PyAirlineParamDTO toKtkxParam(List<List<JmJobPoint>> pointList, List<JmJobUav> uavList) {
|
private PyAirlineParamDTO toKtkxParam(List<List<JmJobPoint>> pointList, List<JmJobUav> uavList) {
|
||||||
List<PyAirlineTargetDTO> pyPointList = new ArrayList<>();
|
log.info("开始转换 PyAirlineParamDTO,pointList 大小: {}, uavList 大小: {}",
|
||||||
|
pointList.size(), uavList.size());
|
||||||
|
// 所有无人机共享相同的目标点集(扁平化所有区域的点)
|
||||||
|
List<JmJobPoint> allPoints = pointList.stream()
|
||||||
|
.flatMap(List::stream)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
// 转换为 Python 需要的 double[][] 坐标格式(经度在前,纬度在后)
|
||||||
|
double[][] coords = allPoints.stream()
|
||||||
|
.map(p -> new double[]{p.getLongitude(), p.getLatitude()})
|
||||||
|
.toArray(double[][]::new);
|
||||||
|
log.info("提取到 {} 个目标点坐标", coords.length);
|
||||||
|
|
||||||
|
List<PyAirlineTargetDTO> pyTargets = new ArrayList<>();
|
||||||
List<PyAirlineUavDTO> pyUavList = new ArrayList<>();
|
List<PyAirlineUavDTO> pyUavList = new ArrayList<>();
|
||||||
for (int i = 0; i < uavList.size(); i++) {
|
for (int i = 0; i < uavList.size(); i++) {
|
||||||
JmJobUav u = uavList.get(i);
|
JmJobUav uav = uavList.get(i);
|
||||||
// 区域
|
// 1. 为当前无人机创建目标(共享坐标,但 target id 不同)
|
||||||
List<JmJobPoint> points = pointList.get(i);
|
pyTargets.add(new PyAirlineTargetDTO(i, coords));
|
||||||
double[][] coords = points.stream()
|
// 2. 获取 SAR 载荷(必须存在,否则抛异常)
|
||||||
.map(point -> new double[] { point.getLongitude(), point.getLatitude() })
|
JmJobPayload sarPayload = findSarPayload(uav);
|
||||||
.toArray(double[][]::new);
|
String sarIp = sarPayload.getIp(); // 已在 findSarPayload 中设置
|
||||||
pyPointList.add(new PyAirlineTargetDTO(i, coords));
|
// 3. 获取载荷最新状态(用于起始位置)
|
||||||
|
JmSarStatusDTO status = payloadService.getLastStatus(sarIp);
|
||||||
|
if (status == null) {
|
||||||
|
throw ServiceException.errorLog("无法获取 SAR载荷的最新状态");
|
||||||
|
}
|
||||||
|
// 4. 如果起飞高度为空,则使用载荷当前高度
|
||||||
|
if (uav.getStartAltitude() == null) {
|
||||||
|
uav.setStartAltitude((double) status.getAltitude());
|
||||||
|
log.info("无人机 {} 起飞高度为空,已使用载荷当前高度: {}", uav.getUavId(), uav.getStartAltitude());
|
||||||
|
}
|
||||||
|
// 5. 构建 Python UAV DTO
|
||||||
|
PyAirlineUavDTO pyUav = BeanUtil.copyProperties(uav, PyAirlineUavDTO.class);
|
||||||
|
pyUav.setId(uav.getUavId());
|
||||||
|
pyUav.setStartCoord(new double[]{status.getLongitude(), status.getLatitude()});
|
||||||
|
pyUav.setEndCoord(new double[]{status.getLongitude(), status.getLatitude()}); // 目前起终点相同
|
||||||
|
pyUav.setConstraint(uav.getHeight());
|
||||||
|
// 6. 构建 Payload DTO
|
||||||
|
PyAirlinePayloadDTO payloadDto = BeanUtil.copyProperties(sarPayload, PyAirlinePayloadDTO.class);
|
||||||
|
payloadDto.setType(PayloadTypeEnum.SAR.getCode());
|
||||||
|
pyUav.setPayload(payloadDto);
|
||||||
|
pyUavList.add(pyUav);
|
||||||
|
}
|
||||||
|
// 转换为数组(Python 端需要数组格式)
|
||||||
|
PyAirlineTargetDTO[] targetListArray = pyTargets.toArray(new PyAirlineTargetDTO[0]);
|
||||||
|
PyAirlineUavDTO[] uavListArray = pyUavList.toArray(new PyAirlineUavDTO[0]);
|
||||||
|
PyAirlineParamDTO param = new PyAirlineParamDTO();
|
||||||
|
param.setTargets(targetListArray);
|
||||||
|
param.setUavs(uavListArray);
|
||||||
|
log.info("转换完成,生成 PyAirlineParamDTO:{} 个目标组,{} 架无人机",
|
||||||
|
targetListArray.length, uavListArray.length);
|
||||||
|
return param;
|
||||||
|
}
|
||||||
|
|
||||||
// 载荷
|
/**
|
||||||
JmJobPayload sar = u.getPayloadList()
|
* 从无人机载荷列表中查找 SAR 类型载荷,并设置 IP
|
||||||
.stream()
|
* @param uav 无人机对象
|
||||||
.filter(jp -> {
|
* @return SAR 载荷
|
||||||
Long payloadId = jp.getPayloadId();
|
* @throws ServiceException 如果没有找到 SAR 载荷
|
||||||
SkyeyePayload p = payloadService.getOne(payloadId);
|
*/
|
||||||
if (p != null && p.getType().equals(PayloadTypeEnum.SAR.getCode())) {
|
private JmJobPayload findSarPayload(JmJobUav uav) {
|
||||||
jp.setIp(p.getIp());
|
return uav.getPayloadList().stream()
|
||||||
|
.filter(payload -> {
|
||||||
|
Long payloadId = payload.getPayloadId();
|
||||||
|
SkyeyePayload skyeyePayload = payloadService.getOne(payloadId);
|
||||||
|
if (skyeyePayload != null && PayloadTypeEnum.SAR.getCode().equals(skyeyePayload.getType())) {
|
||||||
|
payload.setIp(skyeyePayload.getIp());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
})
|
})
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.orElseThrow( () -> ServiceException.errorLog("存在无人机缺少sar类型载荷"));
|
.orElseThrow(() -> ServiceException.errorLog(
|
||||||
|
"存在无人机缺少sar类型载荷"));
|
||||||
PyAirlineUavDTO uav = BeanUtil.copyProperties(u, PyAirlineUavDTO.class);
|
|
||||||
JmSarStatusDTO statusDTO = payloadService.getLastStatus(sar.getIp());
|
|
||||||
double startLon = statusDTO.getLongitude();
|
|
||||||
double startLat = statusDTO.getLatitude();
|
|
||||||
if (u.getStartAltitude() == null) {
|
|
||||||
u.setStartAltitude((double) statusDTO.getAltitude());
|
|
||||||
}
|
|
||||||
uav.setId(u.getUavId());
|
|
||||||
uav.setStartCoord(new double[] {startLon, startLat});
|
|
||||||
uav.setEndCoord(new double[] {startLon, startLat});
|
|
||||||
uav.setConstraint(u.getHeight());
|
|
||||||
PyAirlinePayloadDTO payload = BeanUtil.copyProperties(sar, PyAirlinePayloadDTO.class);
|
|
||||||
payload.setType(PayloadTypeEnum.SAR.getCode());
|
|
||||||
uav.setPayload(payload);
|
|
||||||
pyUavList.add(uav);
|
|
||||||
}
|
|
||||||
PyAirlineUavDTO[] uavs = pyUavList.toArray(new PyAirlineUavDTO[pyUavList.size()]);
|
|
||||||
PyAirlineTargetDTO[] targets = pyPointList.toArray(new PyAirlineTargetDTO[pyPointList.size()]);
|
|
||||||
|
|
||||||
PyAirlineParamDTO param = new PyAirlineParamDTO();
|
|
||||||
param.setTargets(targets);
|
|
||||||
param.setUavs(uavs);
|
|
||||||
return param;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.zhangy.skyeye.jm.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.zhangy.skyeye.common.extend.enums.EnumUtil;
|
import com.zhangy.skyeye.common.extend.enums.EnumUtil;
|
||||||
@ -36,10 +37,6 @@ import com.zhangy.skyeye.sar.enums.SarIMUStatusEnum;
|
|||||||
import com.zhangy.skyeye.sar.service.ISarControlService;
|
import com.zhangy.skyeye.sar.service.ISarControlService;
|
||||||
import com.zhangy.skyeye.sar.service.ISarMtiPointService;
|
import com.zhangy.skyeye.sar.service.ISarMtiPointService;
|
||||||
import com.zhangy.skyeye.sar.service.ISarMtiTrailService;
|
import com.zhangy.skyeye.sar.service.ISarMtiTrailService;
|
||||||
//import com.zhangy.skyeye.smp.dto.SmpSubscriptResDTO;
|
|
||||||
//import com.zhangy.skyeye.smp.dto.SmpWayPointDTO;
|
|
||||||
//import com.zhangy.skyeye.smp.service.ISmpSubscriptService;
|
|
||||||
//import com.zhangy.skyeye.smp.service.ISmpWayPointService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -69,33 +66,20 @@ public class JmJobServiceImpl implements JmJobService {
|
|||||||
private JmJobStatusService jobStatusService;
|
private JmJobStatusService jobStatusService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private JmJobExecService jmJobExecService;
|
private JmJobExecService jmJobExecService;
|
||||||
|
|
||||||
// @Autowired
|
|
||||||
// private ISmpWayPointService smpWayPointService;
|
|
||||||
// @Autowired
|
|
||||||
// private ISmpSubscriptService smpSubscriptService;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISarControlService sarControlService;
|
private ISarControlService sarControlService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISarMtiPointService sarMtiPointService;
|
private ISarMtiPointService sarMtiPointService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISarMtiTrailService sarMtiTrailService;
|
private ISarMtiTrailService sarMtiTrailService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IPayloadService payloadService;
|
private IPayloadService payloadService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IUavService uavService;
|
private IUavService uavService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysFileTypeService fileTypeService;
|
private SysFileTypeService fileTypeService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IPyAirlineService ktkxService;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private QuartzService quartzService;
|
private QuartzService quartzService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private JmAirlinePlanService jmAirlinePlanService;
|
private JmAirlinePlanService jmAirlinePlanService;
|
||||||
|
|
||||||
@ -114,8 +98,7 @@ public class JmJobServiceImpl implements JmJobService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<JmJobDTO> selectExecJobs(JmJobQueryDTO param)
|
public List<JmJobDTO> selectExecJobs(JmJobQueryDTO param) {
|
||||||
{
|
|
||||||
List<JmJobDTO> list = jobMapper.selectExecJobs(param);
|
List<JmJobDTO> list = jobMapper.selectExecJobs(param);
|
||||||
loadDetail(param.getUavId(), list);
|
loadDetail(param.getUavId(), list);
|
||||||
return list;
|
return list;
|
||||||
@ -165,6 +148,7 @@ public class JmJobServiceImpl implements JmJobService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public JmJobDTO save(JmJobModeEnum jobMode, JmJobDTO e) {
|
public JmJobDTO save(JmJobModeEnum jobMode, JmJobDTO e) {
|
||||||
|
log.info("保存任务参数:{}||{}", JSON.toJSONString(jobMode), JSON.toJSONString(e));
|
||||||
SarImageModeEnum imageMode = EnumUtil.parseEx(SarImageModeEnum.class, e.getImageMode());
|
SarImageModeEnum imageMode = EnumUtil.parseEx(SarImageModeEnum.class, e.getImageMode());
|
||||||
// 非航线模式需要调算法生成航线,需要从缓存取sar坐标
|
// 非航线模式需要调算法生成航线,需要从缓存取sar坐标
|
||||||
Map<Long, List<JmAirline>> airlineGroup = jmAirlinePlanService.plan(jobMode, imageMode, e.getTargetType(),
|
Map<Long, List<JmAirline>> airlineGroup = jmAirlinePlanService.plan(jobMode, imageMode, e.getTargetType(),
|
||||||
@ -375,6 +359,7 @@ public class JmJobServiceImpl implements JmJobService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 起飞 kmz
|
* 起飞 kmz
|
||||||
|
*
|
||||||
* @param job
|
* @param job
|
||||||
*/
|
*/
|
||||||
private void startKmz(JmJobDTO job) {
|
private void startKmz(JmJobDTO job) {
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import lombok.Setter;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.alibaba.fastjson2.*;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.ConnectException;
|
import java.net.ConnectException;
|
||||||
@ -37,6 +38,9 @@ public class PyAirlineServiceImpl implements IPyAirlineService {
|
|||||||
@Value("${skyeye.py.ktkxUrl}")
|
@Value("${skyeye.py.ktkxUrl}")
|
||||||
private String url;
|
private String url;
|
||||||
|
|
||||||
|
@Value("${skyeye.java.ktkxUrl}")
|
||||||
|
private String javaUrl;
|
||||||
|
|
||||||
// 判断是否为空,并剔除无需执行任务的无人机
|
// 判断是否为空,并剔除无需执行任务的无人机
|
||||||
private boolean checkEmpty(Map<Long, PyAirlineDTO[]> uavMap) {
|
private boolean checkEmpty(Map<Long, PyAirlineDTO[]> uavMap) {
|
||||||
if (uavMap == null || uavMap.size() == 0) {
|
if (uavMap == null || uavMap.size() == 0) {
|
||||||
@ -72,7 +76,17 @@ public class PyAirlineServiceImpl implements IPyAirlineService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<Long, List<JmAirline>> getAirline(PyAirlineParamDTO param) {
|
public Map<Long, List<JmAirline>> getAirline(PyAirlineParamDTO param) {
|
||||||
HttpResponse<String> httpResponse = null;
|
log.info("请求航线规划算法服务参数:{}", JSON.toJSONString(param));
|
||||||
|
// HttpResponse<String> post;
|
||||||
|
// try {
|
||||||
|
// post = HttpUtil.post(javaUrl, null, param);
|
||||||
|
// } catch (IOException e) {
|
||||||
|
// throw new RuntimeException(e);
|
||||||
|
// }
|
||||||
|
// PyAirlineResponse pyAirlineResponse;
|
||||||
|
// pyAirlineResponse = JsonUtil.parse(post.body(), PyAirlineResponse.class);
|
||||||
|
// log.info("请求航线规划算法服务响应:{}",JSON.toJSONString(pyAirlineResponse));
|
||||||
|
HttpResponse<String> httpResponse;
|
||||||
try {
|
try {
|
||||||
httpResponse = HttpUtil.post(url, null, param);
|
httpResponse = HttpUtil.post(url, null, param);
|
||||||
} catch (ConnectException ex) {
|
} catch (ConnectException ex) {
|
||||||
@ -82,17 +96,19 @@ public class PyAirlineServiceImpl implements IPyAirlineService {
|
|||||||
}
|
}
|
||||||
PyAirlineResponse response;
|
PyAirlineResponse response;
|
||||||
response = JsonUtil.parse(httpResponse.body(), PyAirlineResponse.class);
|
response = JsonUtil.parse(httpResponse.body(), PyAirlineResponse.class);
|
||||||
|
log.info("请求航线规划算法服务响应:{}", JSON.toJSONString(response));
|
||||||
int responseCode = httpResponse.statusCode();
|
int responseCode = httpResponse.statusCode();
|
||||||
if (responseCode >= 400) {
|
if (responseCode >= 400) {
|
||||||
log.warn("调用航线规划算法错误["+ responseCode + "]:" + response.getMessage() + ",参数:" + JsonUtil.toString(param));
|
log.warn("调用航线规划算法错误[{}]:{},参数:{}", responseCode, response.getMessage(), JsonUtil.toString(param));
|
||||||
throw ServiceException.noLog("调用航线规划算法错误[" + responseCode + "]:" + response.getMessage());
|
throw ServiceException.noLog("调用航线规划算法错误[" + responseCode + "]:" + response.getMessage());
|
||||||
}
|
}
|
||||||
Map<Long, PyAirlineDTO[]> uavMap = response.getData();
|
Map<Long, PyAirlineDTO[]> uavMap = response.getData();
|
||||||
|
log.info("航线规划算法结果:{}", JSON.toJSONString(uavMap));
|
||||||
if (checkEmpty(uavMap)) {
|
if (checkEmpty(uavMap)) {
|
||||||
if ("success".endsWith(response.getMessage())) {
|
if ("success".endsWith(response.getMessage())) {
|
||||||
throw ServiceException.noLog("无法生成航线,可能飞行区域超过25平方公里");
|
throw ServiceException.noLog("无法生成航线,可能飞行区域超过25平方公里");
|
||||||
}
|
}
|
||||||
log.warn("调用航线规划算法未返回数据["+ responseCode + "]:" + response.getMessage() + ",参数:" + JsonUtil.toString(param));
|
log.warn("调用航线规划算法未返回数据[{}]:{},参数:{}", responseCode, response.getMessage(), JsonUtil.toString(param));
|
||||||
throw ServiceException.noLog("调用航线规划算法未返回数据[" + responseCode + "]:" + response.getMessage());
|
throw ServiceException.noLog("调用航线规划算法未返回数据[" + responseCode + "]:" + response.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -84,6 +84,8 @@ skyeye:
|
|||||||
py:
|
py:
|
||||||
ktkxUrl: http://127.0.0.1:18090/ktkx/UavPlanning/SAR
|
ktkxUrl: http://127.0.0.1:18090/ktkx/UavPlanning/SAR
|
||||||
detectUrl: http://127.0.0.1:18091/ktkx/detect/cpu/SARCoord
|
detectUrl: http://127.0.0.1:18091/ktkx/detect/cpu/SARCoord
|
||||||
|
java:
|
||||||
|
ktkxUrl: http://127.0.0.1:9117/ktkx/UavPlanning/SAR
|
||||||
weather:
|
weather:
|
||||||
cityCode: 101120201
|
cityCode: 101120201
|
||||||
|
|
||||||
|
|||||||
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
<select id="selectList" resultType="com.zhangy.skyeye.jm.dto.JmJobDTO">
|
<select id="selectList" resultType="com.zhangy.skyeye.jm.dto.JmJobDTO">
|
||||||
<include refid="selectSql"/>
|
<include refid="selectSql"/>
|
||||||
where 1 = 1
|
where j.status != 1
|
||||||
<if test="type != null and type == 1">
|
<if test="type != null and type == 1">
|
||||||
and j.status in ('1', '3')
|
and j.status in ('1', '3')
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
BIN
backend/dt-una-lezhixing-dev.zip
Normal file
BIN
backend/dt-una-lezhixing-dev.zip
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user