Bug: Fix bug that back wave and job status did not send back to frontend

This commit is contained in:
Bingkun Li 2026-01-31 14:52:18 +08:00
parent d262796fbd
commit 5c28a9c14e
3 changed files with 24 additions and 13 deletions

View File

@ -283,17 +283,23 @@ public class JmJobStatusServiceImpl implements JmJobStatusService {
return;
}
endAirline(jobId, jobVo, uavVo, airlineVo, wsVo, nextAirline == null);
} else if (isBoot == 1 && aStatus == ExecStatusEnum.PROCESSING && overButSending) {
} else if (isBoot == 1 && aStatus == ExecStatusEnum.PROCESSING) {
if (overButSending) {
// 前一航线的图片没传完就开始了新航线
endAirline(jobId, jobVo, uavVo, airlineVo, wsVo, nextAirline == null);
if (nextAirline != null) {
startAirline(nextAirline, wsVo);
}
}
// simpMessageingTemplate.convertAndSend(WebSocketKey.JM_JOB_STATUS, wsVo);
simpMessageingTemplate.convertAndSend(WebSocketKey.JM_JOB_STATUS, curr);
} else {
return;
}
// 4.将更新后的状态推送到前端
simpMessageingTemplate.convertAndSend(WebSocketKey.JM_JOB_STATUS, wsVo);
// simpMessageingTemplate.convertAndSend(WebSocketKey.JM_JOB_STATUS, wsVo);
}
// 开启新航线

View File

@ -83,30 +83,30 @@ public class CacheKey {
/**
* 运动规划响应1秒
*/
public static final String SMP_WAYPOINT_RES = "skyeye:smp:waypoint:";
//public static final String SMP_WAYPOINT_RES = "skyeye:smp:waypoint:";
/**
* 飞行控制响应1秒
*/
public static final String SMP_FLIGHT_RES = "skyeye:smp:flight:";
//public static final String SMP_FLIGHT_RES = "skyeye:smp:flight:";
/**
* 云台控制响应1秒
*/
public static final String SMP_GIMBALMGR_RES = "skyeye:smp:gimbalmgr:";
//public static final String SMP_GIMBALMGR_RES = "skyeye:smp:gimbalmgr:";
/**
* 数据订阅响应1秒
*/
public static final String SMP_SUBSCRIPT_RES = "skyeye:smp:subscript:";
//public static final String SMP_SUBSCRIPT_RES = "skyeye:smp:subscript:";
/**
* 数据订阅回传数据1秒
*/
public static final String SMP_SUBSCRIPT_DATA = "skyeye:smp:subscript:";
//public static final String SMP_SUBSCRIPT_DATA = "skyeye:smp:subscript:";
/**
* 相机视频流响应1秒
*/
public static final String SMP_VIDEO_RES = "skyeye:smp:video:";
//public static final String SMP_VIDEO_RES = "skyeye:smp:video:";
}

View File

@ -3,6 +3,7 @@ package com.zhangy.skyeye.sar.service.impl;
import com.zhangy.skyeye.jm.dto.JmAirlineStatusDTO;
import com.zhangy.skyeye.jm.dto.JmUavStatusDTO;
import com.zhangy.skyeye.jm.entity.JmImage;
import com.zhangy.skyeye.jm.service.JmJobStatusService;
import com.zhangy.skyeye.publics.consts.WebSocketKey;
import com.zhangy.skyeye.sar.context.SarTaskContextProvider;
import com.zhangy.skyeye.sar.dto.JmSarWaveWsDTO;
@ -33,6 +34,9 @@ public class SarBackWsServiceImpl implements ISarBackWsService {
@Autowired
private SarTaskContextProvider taskContextProvider;
@Autowired
private JmJobStatusService jobStatusService;
@Override
public void sendWave(String payloadIp, SarBackWaveFrameDTO frame, byte[] frameData) {
JmSarWaveWsDTO wsVo = loadJobDetail(payloadIp, frame.getChannel(), frameData);
@ -55,7 +59,8 @@ public class SarBackWsServiceImpl implements ISarBackWsService {
* @return
*/
private JmSarWaveWsDTO loadJobDetail(String payloadIp, JmSarWaveWsDTO ws, byte[] frameData) {
JmUavStatusDTO uav = taskContextProvider.getCurrentUav(payloadIp);
// JmUavStatusDTO uav = taskContextProvider.getCurrentUav(payloadIp);
JmUavStatusDTO uav = jobStatusService.getCurrUav(payloadIp);
if (uav == null) { // 如果没有执行中的任务则忽略
log.debug("IP={} 无正在执行的任务,忽略波形推送", payloadIp);
return null;