| | |
| | | import com.ard.common.core.redis.RedisCache; |
| | | import com.ard.common.exception.ServiceException; |
| | | import com.ard.common.utils.StringUtils; |
| | | import com.ard.data.noflyzone.domain.ArdNoFlyZone; |
| | | import com.ard.data.noflyzone.domain.Vertex; |
| | | import com.ard.data.noflyzone.service.IArdNoFlyZoneService; |
| | | import com.ard.data.noflyzone.utils.NoFlyZoneUtils; |
| | | import com.ard.work.aspect.annotation.CheckControlRight; |
| | | import com.ard.work.aspect.annotation.CheckTakeoffAltitude; |
| | | import com.ard.work.component.forest.TyClient; |
| | |
| | | @Resource |
| | | private IArdDroneInfoService ardDroneService; |
| | | @Resource |
| | | private IArdNoFlyZoneService ardNoFlyZoneService; |
| | | @Resource |
| | | private TyClient tyClient; |
| | | @Autowired |
| | | @Resource |
| | | private RedisCache redisCache; |
| | | |
| | | /** |
| | |
| | | if (!isDroneOnline(boxSn)) { |
| | | throw new ServiceException("无人机离线,无法执行指令, boxSn: " + boxSn); |
| | | } |
| | | // 判断目标点是否经过禁飞区 |
| | | List<ArdNoFlyZone> ardNoFlyZones = ardNoFlyZoneService.selectArdNoFlyZoneList(new ArdNoFlyZone()); |
| | | if (!ardNoFlyZones.isEmpty()) { |
| | | Vertex vertex = new Vertex(flyPointControlDTO.getLongitude(), flyPointControlDTO.getLatitude()); |
| | | boolean inNoFlyZones = NoFlyZoneUtils.isInNoFlyZones(vertex, ardNoFlyZones); |
| | | if (inNoFlyZones) { |
| | | throw new ServiceException("目标点在禁飞区内,无法执行指令, boxSn: " + boxSn); |
| | | } |
| | | } |
| | | |
| | | FlyPointControlCmd flyPointControlCmd = new FlyPointControlCmd(flyPointControlDTO); |
| | | this.sendMessage(ardDroneInfo.getServerId(), flyPointControlCmd); |
| | | return true; |