From 057e3d582707acd2baea12e3bd6a96bf26d93fd7 Mon Sep 17 00:00:00 2001
From: Xiajijian <1176061145@qq.com>
Date: Sun, 28 Dec 2025 09:39:14 +0800
Subject: [PATCH] 1. 优化航线代码业务逻辑。

---
 ard-route/src/main/java/com/ard/route/util/RouteFileUtils.java |  213 ++++++++++++++++++++++++++++------------------------
 1 files changed, 115 insertions(+), 98 deletions(-)

diff --git a/ard-route/src/main/java/com/ard/route/util/RouteFileUtils.java b/ard-route/src/main/java/com/ard/route/util/RouteFileUtils.java
index 647c430..ceeb180 100644
--- a/ard-route/src/main/java/com/ard/route/util/RouteFileUtils.java
+++ b/ard-route/src/main/java/com/ard/route/util/RouteFileUtils.java
@@ -3,8 +3,8 @@
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
-import com.ard.route.domain.*;
-import com.ard.route.domain.kml.*;
+import com.ard.route.domain.djuav.*;
+import com.ard.route.domain.djuav.kml.*;
 import com.ard.route.enums.kml.*;
 import com.ard.route.constant.FileTypeConstants;
 import com.thoughtworks.xstream.XStream;
@@ -21,21 +21,12 @@
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipOutputStream;
 
+import static com.ard.route.util.ToolUtils.XML_HEADER;
+
 /**
  * 航线文件操作工具类
  */
 public class RouteFileUtils {
-
-    /**
-     * XML 头部
-     */
-    private static final String XML_HEADER = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
-
-    /**
-     * 生成的本地 kmz 文件存储路径
-     */
-    private static final String LOCAL_KMZ_FILE_PATH = "file" + File.separator + "kmz" + File.separator;
-
 
     /**
      * kml文件解析
@@ -45,12 +36,19 @@
      */
     public static KmlInfo parseKml(InputStream inputStream) {
         XStream xStream = new XStream();
-        xStream.allowTypes(new Class[]{KmlInfo.class, KmlAction.class, KmlWayLineCoordinateSysParam.class, KmlPoint.class});
+        xStream.allowTypes(new Class[]{
+                KmlInfo.class,
+                KmlAction.class,
+                KmlWayLineCoordinateSysParam.class,
+                KmlPoint.class,
+                KmlActionGroup.class
+        });
         xStream.alias("kml", KmlInfo.class);
         xStream.processAnnotations(KmlInfo.class);
         xStream.autodetectAnnotations(true);
         xStream.ignoreUnknownElements();
         xStream.addImplicitCollection(KmlActionGroup.class, "action");
+        xStream.addImplicitCollection(KmlPlacemark.class, "actionGroup");
         return (KmlInfo) xStream.fromXML(inputStream);
     }
 
@@ -62,10 +60,11 @@
      * @param wpmlInfo wpml 文件信息
      * @return 本地文件路径
      */
-    public static String buildKmz(String fileName, KmlInfo kmlInfo, KmlInfo wpmlInfo, String kmzFilePath) {
+    public static String buildKmzA(String fileName, KmlInfo kmlInfo, KmlInfo wpmlInfo, String kmzFilePath) {
         XStream xStream = new XStream(new DomDriver());
         xStream.processAnnotations(KmlInfo.class);
         xStream.addImplicitCollection(KmlActionGroup.class, "action");
+        xStream.addImplicitCollection(KmlPlacemark.class, "actionGroup");
 
         String kml = XML_HEADER + xStream.toXML(kmlInfo);
         String wpml = XML_HEADER + xStream.toXML(wpmlInfo);
@@ -100,7 +99,6 @@
         zipOutputStream.closeEntry(); // 关闭条目
     }
 
-
     public static KmlInfo buildKml(KmlParams kmlParams) {
         KmlInfo kmlInfo = new KmlInfo();
         kmlInfo.setDocument(buildKmlDocument(FileTypeConstants.KML, kmlParams));
@@ -116,7 +114,7 @@
     public static KmlDocument buildKmlDocument(String fileType, KmlParams kmlParams) {
         KmlDocument kmlDocument = new KmlDocument();
         if (StringUtils.equals(fileType, FileTypeConstants.KML)) {
-            kmlDocument.setAuthor("Cleaner");
+            kmlDocument.setAuthor("Ard-Creator");
             kmlDocument.setCreateTime(String.valueOf(DateUtil.current()));
             kmlDocument.setUpdateTime(String.valueOf(DateUtil.current()));
         }
@@ -127,7 +125,11 @@
 
     public static KmlMissionConfig buildKmlMissionConfig(KmlParams kmlParams) {
         KmlMissionConfig kmlMissionConfig = new KmlMissionConfig();
-        kmlMissionConfig.setFlyToWayLineMode(FlyToWaylineModeEnums.SAFELY.getValue());
+        if (kmlParams.getFlyToWaylineMode() != null){
+            kmlMissionConfig.setFlyToWayLineMode(kmlParams.getFlyToWaylineMode());
+        }else {
+            kmlMissionConfig.setFlyToWayLineMode(FlyToWaylineModeEnums.SAFELY.getValue());
+        }
         kmlMissionConfig.setFinishAction(kmlParams.getFinishAction());
         if (StringUtils.isNotBlank(kmlParams.getExitOnRcLostAction())) {
             kmlMissionConfig.setExitOnRCLost(ExitOnRCLostEnums.EXECUTE_LOST_ACTION.getValue());
@@ -136,7 +138,11 @@
             kmlMissionConfig.setExitOnRCLost(ExitOnRCLostEnums.GO_CONTINUE.getValue());
         }
         kmlMissionConfig.setTakeOffSecurityHeight("20");
-        kmlMissionConfig.setGlobalTransitionalSpeed("15");
+        if (kmlParams.getGlobalTransitionalSpeed() != null){
+            kmlMissionConfig.setGlobalTransitionalSpeed(String.valueOf(kmlParams.getGlobalTransitionalSpeed()));
+        }else {
+            kmlMissionConfig.setGlobalTransitionalSpeed("15");
+        }
         kmlMissionConfig.setGlobalRTHHeight("100");
         kmlMissionConfig.setTakeOffRefPoint(kmlParams.getTakeOffRefPoint());
         kmlMissionConfig.setDroneInfo(buildKmlDroneInfo(kmlParams.getDroneType(), kmlParams.getSubDroneType()));
@@ -149,7 +155,8 @@
         kmlDroneInfo.setDroneEnumValue(String.valueOf(droneType));
         if (Objects.equals(droneType, DroneEnumValueEnums.M30_M30T.getValue()) ||
                 Objects.equals(droneType, DroneEnumValueEnums.M3D_M3TD.getValue()) ||
-                Objects.equals(droneType, DroneEnumValueEnums.M3E_M3T_M3M.getValue())) {
+                Objects.equals(droneType, DroneEnumValueEnums.M3E_M3T_M3M.getValue())||
+                Objects.equals(droneType, DroneEnumValueEnums.MATRICE_4D.getValue())) {
             kmlDroneInfo.setDroneSubEnumValue(String.valueOf(subDroneType));
         }
         return kmlDroneInfo;
@@ -160,9 +167,7 @@
         kmlPayloadInfo.setPayloadEnumValue(String.valueOf(payloadType));
         kmlPayloadInfo.setPayloadPositionIndex(String.valueOf(payloadPosition));
         return kmlPayloadInfo;
-
     }
-
 
     public static KmlFolder buildKmlFolder(String fileType, KmlParams kmlParams) {
         KmlFolder kmlFolder = new KmlFolder();
@@ -170,13 +175,18 @@
         kmlFolder.setAutoFlightSpeed(String.valueOf(kmlParams.getAutoFlightSpeed()));
         if (StringUtils.equals(fileType, FileTypeConstants.KML)) {
             kmlFolder.setTemplateType(kmlParams.getTemplateType());
-            kmlFolder.setWaylineCoordinateSysParam(buildKmlWayLineCoordinateSysParam(TemplateTypeEnums.WAYPOINT.getValue()));
+            kmlFolder.setWaylineCoordinateSysParam(buildKmlWayLineCoordinateSysParam(kmlParams.getTemplateType(), HeightModeEnums.RELATIVE_TO_START_POINT.getValue(),
+                    String.valueOf(kmlParams.getGlobalHeight())));
             kmlFolder.setPayloadParam(buildKmlPayloadParam(kmlParams));
         }
         if (StringUtils.equals(fileType, FileTypeConstants.WPML)) {
             kmlFolder.setWaylineId("0");
             kmlFolder.setExecuteHeightMode(ExecuteHeightModeEnums.RELATIVE_TO_START_POINT.getValue());
-            // TODO 航线初始动作
+            if (CollectionUtil.isNotEmpty(kmlParams.getStartActionList())) {
+                KmlActionGroup kmlActionGroup = new KmlActionGroup();
+                kmlActionGroup.setAction(getKmlActionList(kmlParams.getStartActionList(), kmlParams));
+                kmlFolder.setStartActionGroup(kmlActionGroup);
+            }
         }
         // 航点类型模板航线配置
         if (StringUtils.equals(kmlFolder.getTemplateType(), TemplateTypeEnums.WAYPOINT.getValue())) {
@@ -217,12 +227,6 @@
                 if (CollectionUtil.isNotEmpty(routePointList)) {
                     List<KmlPlacemark> kmlPlacemarkList = new ArrayList<>();
                     for (RoutePointInfo routePointInfo : routePointList) {
-//                        ActionTriggerReq actionTriggerReq = new ActionTriggerReq();
-//                        actionTriggerReq.setActionTriggerType(StringUtils.equals(kmlParams.getMappingTypeReq().getShootType(), ShootTypeEnums.TIME.getValue()) ?
-//                                ActionTriggerTypeEnums.MULTIPLE_TIMING.getValue() :
-//                                ActionTriggerTypeEnums.MULTIPLE_DISTANCE.getValue());
-//                        actionTriggerReq.setActionTriggerParam(2.0);
-//                        RoutePointInfo.setActionTriggerReq(actionTriggerReq);
                         kmlPlacemarkList.add(buildKmlPlacemark(routePointInfo, kmlParams, fileType));
                     }
                     kmlFolder.setPlacemarkList(kmlPlacemarkList);
@@ -232,18 +236,56 @@
         return kmlFolder;
     }
 
+    /**
+     * 构建航点动作
+     *
+     * @param actionList 航点动作列表
+     * @param kmlParams
+     * @return
+     */
+    private static List<KmlAction> getKmlActionList(List<PointActionReq> actionList, KmlParams kmlParams) {
+        List<KmlAction> kmlActionList = new ArrayList<>();
+        for (PointActionReq pointActionReq : actionList) {
+            if (ObjectUtil.isNotNull(pointActionReq.getHoverTime())) {
+                kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.HOVER.getValue(), pointActionReq, kmlParams));
+            } else if (ObjectUtil.isNotNull(pointActionReq.getAircraftHeading())) {
+                kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.ROTATE_YAW.getValue(), pointActionReq, kmlParams));
+            } else if (ObjectUtil.isNotNull(pointActionReq.getTakePhotoType()) && ObjectUtil.equals(pointActionReq.getTakePhotoType(), 0)) {
+                kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.TAKE_PHOTO.getValue(), pointActionReq, kmlParams));
+            } else if ((ObjectUtil.isNotNull(pointActionReq.getGimbalYawRotateAngle())) || (ObjectUtil.isNotNull(pointActionReq.getGimbalPitchRotateAngle()))) {
+                kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.GIMBAL_ROTATE.getValue(), pointActionReq, kmlParams));
+            } else if (ObjectUtil.isNotNull(pointActionReq.getZoom())) {
+                kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.ZOOM.getValue(), pointActionReq, kmlParams));
+            } else if (ObjectUtil.isNotNull(pointActionReq.getTakePhotoType()) && ObjectUtil.equals(pointActionReq.getTakePhotoType(), 1)) {
+                kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.PANO_SHOT.getValue(), pointActionReq, kmlParams));
+            } else if (ObjectUtil.isNotNull(pointActionReq.getStartRecord()) && pointActionReq.getStartRecord()) {
+                kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.START_RECORD.getValue(), pointActionReq, kmlParams));
+            } else if (ObjectUtil.isNotNull(pointActionReq.getStopRecord()) && pointActionReq.getStopRecord()) {
+                kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.STOP_RECORD.getValue(), pointActionReq, kmlParams));
+            }
+        }
+        return kmlActionList;
+    }
 
-    public static KmlWayLineCoordinateSysParam buildKmlWayLineCoordinateSysParam(String templateType) {
+    /**
+     * 构造坐标系参数信息
+     *
+     * @param templateType 航线模板类型
+     * @param heightMode   高度模式
+     * @param height       高度
+     * @return 坐标系参数信息
+     */
+    public static KmlWayLineCoordinateSysParam buildKmlWayLineCoordinateSysParam(String templateType, String heightMode, String height) {
         KmlWayLineCoordinateSysParam kmlWayLineCoordinateSysParam = new KmlWayLineCoordinateSysParam();
         kmlWayLineCoordinateSysParam.setCoordinateMode("WGS84");
-        kmlWayLineCoordinateSysParam.setHeightMode(HeightModeEnums.RELATIVE_TO_START_POINT.getValue());
+        kmlWayLineCoordinateSysParam.setHeightMode(heightMode);
         kmlWayLineCoordinateSysParam.setPositioningType(PositioningTypeEnums.GPS.getValue());
         if (StringUtils.equals(templateType, TemplateTypeEnums.MAPPING2D.getValue()) ||
                 StringUtils.equals(templateType, TemplateTypeEnums.MAPPING3D.getValue()) ||
                 StringUtils.equals(templateType, TemplateTypeEnums.MAPPING_STRIP.getValue())) {
-            kmlWayLineCoordinateSysParam.setGlobalShootHeight("50");
+            kmlWayLineCoordinateSysParam.setGlobalShootHeight(height);
             kmlWayLineCoordinateSysParam.setSurfaceFollowModeEnable("1");
-            kmlWayLineCoordinateSysParam.setSurfaceRelativeHeight("100");
+            kmlWayLineCoordinateSysParam.setSurfaceRelativeHeight(height);
         }
         return kmlWayLineCoordinateSysParam;
     }
@@ -262,7 +304,6 @@
         // 0: 不上色 1: 真彩上色
         kmlPayloadParam.setModelColoringEnable("1");
         kmlPayloadParam.setImageFormat(kmlParams.getImageFormat());
-
         return kmlPayloadParam;
     }
 
@@ -277,7 +318,6 @@
         }
         kmlGlobalWaypointHeadingParam.setWaypointHeadingPathMode(WaypointHeadingPathModeEnums.FOLLOW_BAD_ARC.getValue());
         return kmlGlobalWaypointHeadingParam;
-
     }
 
     public static KmlPlacemark buildKmlPlacemark(RoutePointInfo routePointInfo, KmlParams kmlParams, String fileType) {
@@ -295,8 +335,14 @@
                 kmlPlacemark.setGimbalPitchAngle(String.valueOf(routePointInfo.getGimbalPitchAngle()));
             }
         }
-        if (CollectionUtil.isNotEmpty(routePointInfo.getActions())) {
-            kmlPlacemark.setActionGroup(buildKmlActionGroup(routePointInfo, kmlParams));
+        if (CollectionUtil.isNotEmpty(routePointInfo.getActionGroupList())) {
+            List<KmlActionGroup> kmlActionGroupList = new ArrayList<>();
+            for (ActionGroupReq actionGroupReq : routePointInfo.getActionGroupList()) {
+                if (ObjectUtil.isNotEmpty(actionGroupReq.getActions())){
+                    kmlActionGroupList.add(buildKmlActionGroup(actionGroupReq, kmlParams));
+                }
+            }
+            kmlPlacemark.setActionGroup(kmlActionGroupList);
         }
         return kmlPlacemark;
     }
@@ -320,22 +366,16 @@
 
     private static KmlOverlap buildKmlOverlap(String collectionMethod, String lensType, Integer overlapH, Integer overlapW) {
         KmlOverlap overlap = new KmlOverlap();
-        if (StringUtils.equals(collectionMethod, CollectionMethodEnums.ORTHO.getValue())) {
-            if (StringUtils.equals(lensType, LensTypeEnums.LIDAR.getValue())) {
-                overlap.setOrthoLidarOverlapH(String.valueOf(overlapH));
-                overlap.setOrthoLidarOverlapW(String.valueOf(overlapW));
-            } else {
-                overlap.setOrthoCameraOverlapH(String.valueOf(overlapH));
-                overlap.setOrthoCameraOverlapW(String.valueOf(overlapW));
-            }
+        if (StringUtils.equals(collectionMethod, LensTypeEnums.CAMERA.getValue())) {
+            overlap.setOrthoCameraOverlapH(String.valueOf(overlapH));
+            overlap.setOrthoCameraOverlapW(String.valueOf(overlapW));
+            overlap.setInclinedCameraOverlapW(String.valueOf(overlapW));
+            overlap.setInclinedCameraOverlapH(String.valueOf(overlapH));
         } else {
-            if (StringUtils.equals(lensType, LensTypeEnums.LIDAR.getValue())) {
-                overlap.setInclinedLidarOverlapH(String.valueOf(overlapH));
-                overlap.setInclinedCameraOverlapW(String.valueOf(overlapW));
-            } else {
-                overlap.setInclinedCameraOverlapH(String.valueOf(overlapH));
-                overlap.setInclinedCameraOverlapW(String.valueOf(overlapW));
-            }
+            overlap.setOrthoLidarOverlapH(String.valueOf(overlapH));
+            overlap.setOrthoLidarOverlapW(String.valueOf(overlapW));
+            overlap.setInclinedLidarOverlapH(String.valueOf(overlapH));
+            overlap.setInclinedLidarOverlapW(String.valueOf(overlapW));
         }
         return overlap;
     }
@@ -343,7 +383,6 @@
     private static KmlPolygon buildKmlPolygon(List<CoordinatePointReq> coordinatePointReqList) {
         KmlPolygon kmlPolygon = new KmlPolygon();
         KmlLinearRing kmlLinearRing = new KmlLinearRing();
-
         String coordinates = coordinatePointReqList.stream().map(point -> point.getLongitude() + "," + point.getLatitude() + "," + point.getHeight())
                 .collect(Collectors.joining(", "));
         kmlLinearRing.setCoordinates(StringUtils.join(coordinates, " "));
@@ -392,9 +431,7 @@
                 kmlPlacemark.setWaypointHeadingParam(buildKmlWaypointHeadingParam(globalWaypointHeading.getWaypointHeadingMode(), globalWaypointHeading.getWaypointHeadingAngle(), globalWaypointHeading.getWaypointPoiPoint()));
             }
         }
-
     }
-
 
     private static void handleSpeed(RoutePointInfo routePointInfo, KmlParams kmlParams, String fileType, KmlPlacemark kmlPlacemark) {
         if (ObjectUtil.isNotEmpty(routePointInfo.getSpeed())) {
@@ -464,47 +501,15 @@
         return kmlWaypointTurnParam;
     }
 
-    public static KmlActionGroup buildKmlActionGroup(RoutePointInfo routePointInfo, KmlParams kmlParams) {
+    public static KmlActionGroup buildKmlActionGroup(ActionGroupReq actionGroupReq, KmlParams kmlParams) {
         KmlActionGroup kmlActionGroup = new KmlActionGroup();
-        kmlActionGroup.setActionGroupId(String.valueOf(routePointInfo.getRoutePointIndex()));
-        kmlActionGroup.setActionGroupStartIndex(String.valueOf(routePointInfo.getRoutePointIndex()));
-        kmlActionGroup.setActionGroupEndIndex(String.valueOf(ObjectUtil.isNotNull(routePointInfo.getEndIntervalRouteIndex()) ?
-                routePointInfo.getEndIntervalRouteIndex() : routePointInfo.getRoutePointIndex()));
-        kmlActionGroup.setActionGroupMode(ActionGroupModeEnums.SEQUENCE.getValue());
+            kmlActionGroup.setActionGroupId(String.valueOf(actionGroupReq.getActionGroupId()));
+            kmlActionGroup.setActionGroupStartIndex(String.valueOf(actionGroupReq.getActionGroupStartIndex()));
+            kmlActionGroup.setActionGroupEndIndex(String.valueOf(actionGroupReq.getActionGroupEndIndex()));
+            kmlActionGroup.setActionGroupMode(ActionGroupModeEnums.SEQUENCE.getValue());
 
-        String actionTriggerType = ActionTriggerTypeEnums.REACH_POINT.getValue();
-        Double actionTriggerParam = 0.0;
-        if (ObjectUtil.isNotNull(routePointInfo.getTimeInterval())) {
-            actionTriggerType = ActionTriggerTypeEnums.MULTIPLE_TIMING.getValue();
-            actionTriggerParam = routePointInfo.getTimeInterval();
-        } else if (ObjectUtil.isNotNull(routePointInfo.getDistanceInterval())) {
-            actionTriggerType = ActionTriggerTypeEnums.MULTIPLE_DISTANCE.getValue();
-            actionTriggerParam = routePointInfo.getDistanceInterval();
-        }
-
-        kmlActionGroup.setActionTrigger(buildKmlActionTrigger(actionTriggerType, actionTriggerParam));
-        List<KmlAction> kmlActionList = new ArrayList<>();
-        for (PointActionReq pointActionReq : routePointInfo.getActions()) {
-            if (ObjectUtil.isNotNull(pointActionReq.getHoverTime())) {
-                kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.HOVER.getValue(), pointActionReq, kmlParams));
-            } else if (ObjectUtil.isNotNull(pointActionReq.getAircraftHeading())) {
-                kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.ROTATE_YAW.getValue(), pointActionReq, kmlParams));
-            } else if (ObjectUtil.isNotNull(pointActionReq.getTakePhotoType()) && ObjectUtil.equals(pointActionReq.getTakePhotoType(), 0)) {
-                kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.TAKE_PHOTO.getValue(), pointActionReq, kmlParams));
-            } else if ((ObjectUtil.isNotNull(pointActionReq.getGimbalYawRotateAngle())) || (ObjectUtil.isNotNull(pointActionReq.getGimbalPitchRotateAngle()))) {
-                kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.GIMBAL_ROTATE.getValue(), pointActionReq, kmlParams));
-            } else if (ObjectUtil.isNotNull(pointActionReq.getZoom())) {
-                kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.ZOOM.getValue(), pointActionReq, kmlParams));
-            } else if (ObjectUtil.isNotNull(pointActionReq.getTakePhotoType()) && ObjectUtil.equals(pointActionReq.getTakePhotoType(), 1)) {
-                kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.PANO_SHOT.getValue(), pointActionReq, kmlParams));
-            } else if (ObjectUtil.isNotNull(pointActionReq.getStartRecord()) && pointActionReq.getStartRecord()) {
-                kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.START_RECORD.getValue(), pointActionReq, kmlParams));
-            } else if (ObjectUtil.isNotNull(pointActionReq.getStopRecord()) && pointActionReq.getStopRecord()) {
-                kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.STOP_RECORD.getValue(), pointActionReq, kmlParams));
-            }
-
-        }
-        kmlActionGroup.setAction(kmlActionList);
+            kmlActionGroup.setActionTrigger(buildKmlActionTrigger(actionGroupReq.getActionTriggerType(), actionGroupReq.getActionTriggerParam()));
+            kmlActionGroup.setAction(getKmlActionList(actionGroupReq.getActions(), kmlParams));
         return kmlActionGroup;
     }
 
@@ -531,8 +536,16 @@
         if (StringUtils.equals(actionActuatorFunc, ActionActuatorFuncEnums.TAKE_PHOTO.getValue()) ||
                 StringUtils.equals(actionActuatorFunc, ActionActuatorFuncEnums.START_RECORD.getValue())) {
             kmlActionActuatorFuncParam.setPayloadPositionIndex(String.valueOf(kmlParams.getPayloadPosition()));
-            kmlActionActuatorFuncParam.setFileSuffix("");
-            kmlActionActuatorFuncParam.setUseGlobalPayloadLensIndex(String.valueOf(pointActionReq.getUseGlobalImageFormat()));
+            if (pointActionReq.getFileSuffix() != null){
+                kmlActionActuatorFuncParam.setFileSuffix(pointActionReq.getFileSuffix());
+            }else {
+                kmlActionActuatorFuncParam.setFileSuffix("panoramicPhoto_360");
+            }
+            if (pointActionReq.getUseGlobalImageFormat() != null) {
+                kmlActionActuatorFuncParam.setUseGlobalPayloadLensIndex(String.valueOf(pointActionReq.getUseGlobalImageFormat()));
+            }else {
+                kmlActionActuatorFuncParam.setUseGlobalPayloadLensIndex("0");
+            }
             if (ObjectUtil.equals(pointActionReq.getUseGlobalImageFormat(), 0)) {
                 kmlActionActuatorFuncParam.setPayloadLensIndex(pointActionReq.getImageFormat());
             } else {
@@ -573,7 +586,11 @@
         } else if (StringUtils.equals(actionActuatorFunc, ActionActuatorFuncEnums.PANO_SHOT.getValue())) {
             kmlActionActuatorFuncParam.setPayloadPositionIndex(String.valueOf(kmlParams.getPayloadPosition()));
             kmlActionActuatorFuncParam.setUseGlobalPayloadLensIndex(String.valueOf(pointActionReq.getUseGlobalImageFormat()));
-            kmlActionActuatorFuncParam.setPanoShotSubMode("panoShot_360");
+            if (pointActionReq.getFileSuffix()!=null){
+                kmlActionActuatorFuncParam.setPanoShotSubMode(pointActionReq.getPanoShotSubMode());
+            }else {
+                kmlActionActuatorFuncParam.setPanoShotSubMode("panoShot_360");
+            }
             if (ObjectUtil.equals(pointActionReq.getUseGlobalImageFormat(), 0)) {
                 kmlActionActuatorFuncParam.setPayloadLensIndex(pointActionReq.getImageFormat());
             } else {

--
Gitblit v1.9.3