ard-route/src/main/java/com/ard/route/service/impl/ArdRouteInfoServiceImpl.java
@@ -13,6 +13,7 @@ import com.ard.data.noflyzone.utils.NoFlyZoneUtils; import com.ard.oss.model.MinioUploadResult; import com.ard.oss.service.impl.OssServiceContext; import com.ard.route.domain.CoordinatePointReq; import com.ard.route.domain.UavRouteReq; import com.ard.route.domain.route.ArdRouteInfo; import com.ard.route.domain.vo.KmzResultVo; @@ -96,6 +97,8 @@ } catch (IOException e) { throw new RuntimeException(e); } Integer droneType = subStringDroneType(ardRouteInfo.getAircraft()); ardRouteInfo.getUavRouteReq().setDroneType(droneType); ardRouteInfo.setRouteData(routeData); KmzResultVo kmzResult = routeService.buildKmz(ardRouteInfo.getUavRouteReq(), ardRouteInfo.getName()); ardRouteInfo.setPath(kmzResult.getPath()); @@ -217,6 +220,9 @@ throw new ControlException("方法参数中未找到有效经纬度字段,无法判断禁飞区!"); } List<ArdNoFlyZone> ardNoFlyZones = ardNoFlyZoneService.selectArdNoFlyZoneList(new ArdNoFlyZone()); if (!ardNoFlyZones.isEmpty()) { Vertex vertex = new Vertex(longitude, latitude); // boolean inNoFlyZones = NoFlyZoneUtils.isPointInPolygon(vertex, ardNoFlyZones); @@ -236,4 +242,8 @@ ardRouteInfoMapper.insertArdRouteInfo(ardRouteInfo); } private void verifyNoFlyZone(CoordinatePointReq a,CoordinatePointReq b){ } } ard-route/src/main/java/com/ard/route/util/ToolUtils.java
@@ -120,4 +120,13 @@ return url.substring(kmzIndex + 5); // +5 是为了跳过 "/kmz/" } /** * 截取字符串 * 参数: "0-89-0" */ public static Integer subStringDroneType(String str) { String[] parts = str.split("-"); return Integer.valueOf(parts[1]); } } ard-route/src/main/resources/mapper/ArdRouteInfoMapper.xml
@@ -59,7 +59,7 @@ <if test="id != null">id,</if> <if test="name != null">name,</if> <if test="path != null">path,</if> <if test="GroupId != null">group_id,</if> <if test="groupId != null">group_id,</if> <if test="type != null">type,</if> <if test="aircraft != null">aircraft,</if> <if test="payload != null">payload,</if> @@ -74,7 +74,7 @@ <if test="id != null">#{id},</if> <if test="name != null">#{name},</if> <if test="path != null">#{path},</if> <if test="GroupId != null">#{GroupId},</if> <if test="groupId != null">#{groupId},</if> <if test="type != null">#{type},</if> <if test="aircraft != null">#{aircraft},</if> <if test="payload != null">#{payload},</if> @@ -92,6 +92,7 @@ <trim prefix="SET" suffixOverrides=","> <if test="name != null">name = #{name},</if> <if test="path != null">path = #{path},</if> <if test="groupId != null">group_id = #{groupId},</if> <if test="type != null">type = #{type},</if> <if test="aircraft != null">aircraft = #{aircraft},</if> <if test="payload != null">payload = #{payload},</if>