Explorar el Código

复制场景,通知深时

lyhzzz hace 2 años
padre
commit
2351e3eb86

+ 6 - 11
src/main/java/com/fdkankan/ucenter/httpClient/service/LaserService.java

@@ -290,20 +290,15 @@ public class LaserService {
 
 
 
-    public void cloudPointBuild(String sceneCode, String path) {
+    public void cloudPointBuild(String oldSceneCode,String sceneCode, String path) {
         log.info("开始同步点云编辑文件");
-        // 删除旧的文件及目录
-        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", String.format(cloudPointFyunPath,sceneCode,sceneCode) + "vision_edit.txt");
-        fYunFileService.uploadFileByCommand(bucket,path + "/results/laserData/uuidcloud", String.format(cloudPointFyunPath,sceneCode,sceneCode) + "uuidcloud");
+        fYunFileService.copyFileBetweenBucket(bucket,String.format(cloudPointFyunPath,oldSceneCode,oldSceneCode) + "vision_edit.txt",
+                bucket,String.format(cloudPointFyunPath,sceneCode,sceneCode) + "vision_edit.txt");
+
+        fYunFileService.copyFileBetweenBucket(bucket,String.format(cloudPointFyunPath,oldSceneCode,oldSceneCode) + "uuidcloud",
+                bucket,String.format(cloudPointFyunPath,sceneCode,sceneCode) + "uuidcloud");
 
         Map<String, Object> params = new HashMap<>();
         params.put("sceneNum", sceneCode);

+ 1 - 1
src/main/java/com/fdkankan/ucenter/service/impl/ScenePlusServiceImpl.java

@@ -312,7 +312,7 @@ public class ScenePlusServiceImpl extends ServiceImpl<IScenePlusMapper, ScenePlu
                     laserService.copy(scenePlus.getCameraId(),scenePlus.getCreateTime(),newNum,2,laserPath,
                             sceneEditInfo.getScenePassword(),scenePlus.getTitle(),scenePlus.getUserId(),"V4");
                 } else if (new File(plusExt.getDataSource() + "/results/laserData/vision_edit.txt").exists()) {
-                    laserService.cloudPointBuild(newNum,plusExt.getDataSource());
+                    laserService.cloudPointBuild(num,newNum,plusExt.getDataSource());
                 }
                 sceneCopyLogService.saveByNum(num,newNum,scenePlus.getUserId());