Explorar o código

修改配置项

tianboguang %!s(int64=2) %!d(string=hai) anos
pai
achega
0fcc4be8e5

+ 1 - 3
src/main/java/com/fdkankan/contro/mq/service/impl/BuildSceneServiceImpl.java

@@ -310,9 +310,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
                         .eq(SceneEditControls::getEditInfoId,sceneEditInfo.getId()));
                 sceneEditControls.setShowMap(0);
             } else if (new File(path + "/results/laserData/vision_edit.txt").exists()) {
-                // 上传点云编辑文件,并通知激光系统
-                String visionEditFilePath = fYunFileService.uploadFile(path + "/results/laserData/vision_edit.txt", String.format(UploadFilePath.DATA_EDIT_PATH, sceneCode) + "vision_edit.txt");
-                fdkkLaserService.cloudPointBuild(sceneCode,visionEditFilePath);
+                fdkkLaserService.cloudPointBuild(sceneCode,path);
             }
 
             //写scene.json

+ 25 - 3
src/main/java/com/fdkankan/contro/service/impl/IFdkkLaserServiceImpl.java

@@ -9,6 +9,7 @@ import com.fdkankan.contro.entity.ScenePro;
 import com.fdkankan.contro.service.IFdkkLaserService;
 import com.fdkankan.contro.service.IScenePlusService;
 import com.fdkankan.contro.service.ISceneProService;
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
 import com.fdkankan.rabbitmq.util.RabbitMqProducer;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -17,7 +18,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.util.ObjectUtils;
 
 import java.io.File;
-import java.util.Arrays;
+import java.io.IOException;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
@@ -44,6 +45,15 @@ public class IFdkkLaserServiceImpl implements IFdkkLaserService {
     @Value("${queue.application.laser.cloud-point-build}")
     private String cloudPointBuild;
 
+    @Value("${4dkk.laserService.bucket}")
+    private String bucket;
+
+    @Value("${4dkk.laserService.cloud-point-fyun-path}")
+    private String cloudPointFyunPath;
+
+    @Autowired
+    private FYunFileServiceInterface fYunFileService;
+
 
     public void updateSceneStatus(String sceneCode, int sceneStatus, String path, Date createTime) {
         Map<String, Object> params = new HashMap<>();
@@ -154,10 +164,22 @@ public class IFdkkLaserServiceImpl implements IFdkkLaserService {
     }
 
     @Override
-    public void cloudPointBuild(String sceneCode, String visionEditFilePath) {
+    public void cloudPointBuild(String sceneCode, String path) {
+        // 删除旧的文件及目录
+        try {
+            fYunFileService.deleteFile(cloudPointFyunPath + "vision_edit.txt");
+            fYunFileService.deleteFolder(cloudPointFyunPath + "uuidcloud");
+        } catch (IOException e) {
+            log.error("删除文件失败", e);
+            e.printStackTrace();
+        }
+
+        // 上传点云编辑文件,并通知激光系统
+        fYunFileService.uploadFile(bucket,path + "/results/laserData/vision_edit.txt", cloudPointFyunPath + "vision_edit.txt");
+        fYunFileService.uploadFileByCommand(bucket,path + "/results/laserData/uuidcloud", cloudPointFyunPath + "uuidcloud");
+
         Map<String, Object> params = new HashMap<>();
         params.put("sceneNum", sceneCode);
-        params.put("filePaths", Arrays.asList(visionEditFilePath));
         params.put("businessType", 0);
         rabbitMqProducer.sendByWorkQueue(cloudPointBuild, params);
     }