|
|
@ -25,6 +25,7 @@ import org.dromara.sample.manage.model.enums.DeviceFirmwareStatusEnum; |
|
|
import org.dromara.sample.manage.model.param.DeviceQueryParam; |
|
|
import org.dromara.sample.manage.model.param.DeviceQueryParam; |
|
|
import org.dromara.sample.manage.service.*; |
|
|
import org.dromara.sample.manage.service.*; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
import org.dromara.sample.media.service.IMediaService; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.messaging.MessageHeaders; |
|
|
import org.springframework.messaging.MessageHeaders; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
@ -68,6 +69,9 @@ public class SDKDeviceService extends AbstractDeviceService { |
|
|
@Autowired |
|
|
@Autowired |
|
|
private IDeviceQrtzService deviceQrtzService; |
|
|
private IDeviceQrtzService deviceQrtzService; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private IMediaService mediaService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public TopicStatusResponse<MqttReply> updateTopoOnline(TopicStatusRequest<UpdateTopo> request, MessageHeaders headers) { |
|
|
public TopicStatusResponse<MqttReply> updateTopoOnline(TopicStatusRequest<UpdateTopo> request, MessageHeaders headers) { |
|
|
@ -149,6 +153,7 @@ public class SDKDeviceService extends AbstractDeviceService { |
|
|
@Override |
|
|
@Override |
|
|
public void osdDock(TopicOsdRequest<OsdDock> request, MessageHeaders headers) { |
|
|
public void osdDock(TopicOsdRequest<OsdDock> request, MessageHeaders headers) { |
|
|
String from = request.getFrom(); |
|
|
String from = request.getFrom(); |
|
|
|
|
|
|
|
|
Optional<DeviceDTO> deviceOpt = deviceRedisService.getDeviceOnline(from); |
|
|
Optional<DeviceDTO> deviceOpt = deviceRedisService.getDeviceOnline(from); |
|
|
if (deviceOpt.isEmpty() || !StringUtils.hasText(deviceOpt.get().getWorkspaceId())) { |
|
|
if (deviceOpt.isEmpty() || !StringUtils.hasText(deviceOpt.get().getWorkspaceId())) { |
|
|
deviceOpt = deviceService.getDeviceBySn(from); |
|
|
deviceOpt = deviceService.getDeviceBySn(from); |
|
|
@ -162,6 +167,7 @@ public class SDKDeviceService extends AbstractDeviceService { |
|
|
if(request.getData().getMediaFileDetail() != null){ |
|
|
if(request.getData().getMediaFileDetail() != null){ |
|
|
RedisOpsUtils.hashSet("updateMediaFileDetail",from,request.getData().getMediaFileDetail().getRemainUpload()); |
|
|
RedisOpsUtils.hashSet("updateMediaFileDetail",from,request.getData().getMediaFileDetail().getRemainUpload()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
DeviceDTO device = deviceOpt.get(); |
|
|
DeviceDTO device = deviceOpt.get(); |
|
|
if(request.getData().getLatitude() != null && request.getData().getLongitude() != null |
|
|
if(request.getData().getLatitude() != null && request.getData().getLongitude() != null |
|
|
&& ((deviceOpt.get().getLatitude() == null && deviceOpt.get().getLongitude() == null)) || (request.getData().getLatitude() != deviceOpt.get().getLatitude() && request.getData().getLongitude() != deviceOpt.get().getLongitude())){ |
|
|
&& ((deviceOpt.get().getLatitude() == null && deviceOpt.get().getLongitude() == null)) || (request.getData().getLatitude() != deviceOpt.get().getLatitude() && request.getData().getLongitude() != deviceOpt.get().getLongitude())){ |
|
|
@ -180,7 +186,9 @@ public class SDKDeviceService extends AbstractDeviceService { |
|
|
&& request.getData().getDroneChargeState().getCapacityPercent() >= 80 && (remainUpload != null && remainUpload == 0)){ |
|
|
&& request.getData().getDroneChargeState().getCapacityPercent() >= 80 && (remainUpload != null && remainUpload == 0)){ |
|
|
deviceQrtzService.getDeviceQrtzFileEntity(device); |
|
|
deviceQrtzService.getDeviceQrtzFileEntity(device); |
|
|
} |
|
|
} |
|
|
|
|
|
if(!request.getData().getSubDevice().getDeviceOnlineStatus() && request.getData().getModeCode() == DockModeCodeEnum.IDLE){ |
|
|
|
|
|
mediaService.delMediaCount(from); |
|
|
|
|
|
} |
|
|
deviceRedisService.setDeviceOnline(device); |
|
|
deviceRedisService.setDeviceOnline(device); |
|
|
fillDockOsd(from, request.getData()); |
|
|
fillDockOsd(from, request.getData()); |
|
|
|
|
|
|
|
|
|