liusuyi
2025-11-10 341a180fde86a2cadefa79e8468b51bbb587aae5
ard-work/src/main/java/com/ard/work/service/impl/TyServiceImpl.java
@@ -4,6 +4,10 @@
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;
@@ -78,8 +82,10 @@
    @Resource
    private IArdDroneInfoService ardDroneService;
    @Resource
    private IArdNoFlyZoneService ardNoFlyZoneService;
    @Resource
    private TyClient tyClient;
    @Autowired
    @Resource
    private RedisCache redisCache;
    /**
@@ -670,6 +676,16 @@
        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;