| | |
| | | import com.ard.common.core.redis.RedisCache; |
| | | import com.ard.common.utils.DateUtils; |
| | | import com.ard.work.component.forest.TyClient; |
| | | import com.ard.work.domain.cache.UavTelemetryDataCache; |
| | | import com.ard.work.domain.cache.UavWaylineCache; |
| | | import com.ard.work.domain.dto.telemetry.TelemetryData; |
| | | import com.ard.work.domain.dto.wayline.WaylineInfo; |
| | | import com.ard.work.domain.dto.BoxHistoryDTO; |
| | | import com.ard.work.domain.entity.ArdFlightTask; |
| | | import com.ard.work.domain.receiver.BoxHistoryReceiver; |
| | |
| | | .maxSpeed(boxHistoryReceiver.getMaxSpeed()) |
| | | .build(); |
| | | |
| | | // 从遥测缓存和航线缓存直接获取 flightMode 和 routeId |
| | | // UavWaylineCache 在飞行中持续有效,仅在飞行中 flightMode!=14 时被清除 |
| | | String boxSn = flightTask.getBoxSn(); |
| | | WaylineInfo waylineInfo = UavWaylineCache.get(boxSn); |
| | | if (waylineInfo != null && waylineInfo.getWaylineId() != null) { |
| | | flightTask.setRouteId(waylineInfo.getWaylineId()); |
| | | } |
| | | TelemetryData telemetryData = UavTelemetryDataCache.get(boxSn); |
| | | if (telemetryData != null && telemetryData.getFlightMode() > 0) { |
| | | flightTask.setFlightMode(telemetryData.getFlightMode()); |
| | | } |
| | | |
| | | Long flyUserId = uavControlService.getCurrentController(flightTask.getBoxSn(), "fly"); |
| | | if (flyUserId != null) { |
| | | SysUser flyUser = redisCache.getCacheMapValue(CacheConstants.SYS_USER, flyUserId.toString()); |