dengsixing 3 ヶ月 前
コミット
103ab41b1c

+ 47 - 0
src/main/java/com/fdkankan/scene/mq/consumer/CopySceneConsumer.java

@@ -0,0 +1,47 @@
+package com.fdkankan.scene.mq.consumer;
+
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.redis.util.RedisUtil;
+import com.fdkankan.scene.service.ISceneCopyService;
+import com.rabbitmq.client.Channel;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.amqp.core.Message;
+import org.springframework.amqp.rabbit.annotation.Queue;
+import org.springframework.amqp.rabbit.annotation.RabbitListener;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.nio.charset.StandardCharsets;
+
+/**
+ * 场景封存解封 mq
+ */
+@Slf4j
+@Component
+public class CopySceneConsumer {
+
+
+    @Autowired
+    ISceneCopyService sceneCopyService;
+    @RabbitListener(
+            queuesToDeclare = @Queue("${queue.scene.copy:ucenter-copy-scene}") ,
+            concurrency = "1"
+    )
+    public void consumerQueue(Channel channel, Message message)  {
+        try {
+            String messageId = message.getMessageProperties().getMessageId();
+            String msg = new String(message.getBody(), StandardCharsets.UTF_8);
+            log.info("copy-scene--messageId:{},msg:{}",messageId,msg);
+            channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
+
+            JSONObject jsonObject = JSONObject.parseObject(msg);
+            String oldNum = jsonObject.getString("oldNum");
+            String newNum = jsonObject.getString("newNum");
+            sceneCopyService.copyScene(oldNum,newNum);
+        }catch (Exception e){
+            log.info("copy-scene----消费失败",e);
+        }
+
+    }
+
+}

+ 33 - 0
src/main/java/com/fdkankan/scene/mq/consumer/SceneResourcePath.java

@@ -0,0 +1,33 @@
+package com.fdkankan.scene.mq.consumer;
+
+public class SceneResourcePath {
+    /*
+     * data/data{SceneNum}
+     * images/images{SceneNum}
+     * video/video{SceneNum}
+     * voice/voice{SceneNum}
+     */
+    public static String nasBasePath = "/mnt/4Dkankan/scene/";
+    public static String nasBasePath_v4 = "/mnt/4Dkankan/scene_v4/";
+    public static String qrCodeBasePath = "/mnt/4Dkankan/sceneQRcode/";
+
+    public static String dataPath = "data/data%s";
+    public static String imagesPath = "images/images%s";
+    public static String videoPath = "video/video%s";
+    public static String voicePath = "voice/voice%s";
+
+
+    public static final String EDIT_PATH_v4 =  "scene_edit_data/%s/";
+    public static final String VIEW_PATH_v4 =  "scene_view_data/%s/";
+
+    public static final String SCENE_RESULT_DATA_PATH = "scene_result_data/%s/";
+
+    public static final String DATA_EDIT_PATH =  "scene_edit_data/%s/data";
+    public static final String DATA_VIEW_PATH =  "scene_view_data/%s/data";
+    public static final String USER_VIEW_PATH =  "scene_view_data/%s/user";
+    public static final String DYNAMIC_VIEW_PATH =  "scene_view_data/%s/user/dynamicPanel.json";
+    public static final String DYNAMIC_EDIT_PATH =  "scene_edit_data/%s/user/dynamicPanel.json";
+
+    public static final String DOWNLOADS_QRCODE = "downloads/scene/%s/QRcode/";
+
+}

+ 8 - 0
src/main/java/com/fdkankan/scene/service/ILaserService.java

@@ -0,0 +1,8 @@
+package com.fdkankan.scene.service;
+
+public interface ILaserService {
+
+    void copy(String oldNum , String newNum, String  path,Boolean flag);
+
+    void cloudPointBuild(String oldNum, String newNum);
+}

+ 6 - 0
src/main/java/com/fdkankan/scene/service/ISceneCopyService.java

@@ -0,0 +1,6 @@
+package com.fdkankan.scene.service;
+
+public interface ISceneCopyService {
+
+    void copyScene(String oldNum,String newNum);
+}

+ 66 - 0
src/main/java/com/fdkankan/scene/service/impl/LaserServiceImpl.java

@@ -0,0 +1,66 @@
+package com.fdkankan.scene.service.impl;
+
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
+import com.fdkankan.rabbitmq.util.RabbitMqProducer;
+import com.fdkankan.scene.service.ILaserService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Service
+@Slf4j
+public class LaserServiceImpl implements ILaserService {
+
+    @Autowired
+    RabbitMqProducer rabbitMqProducer;
+    @Autowired
+    private FYunFileServiceInterface fYunFileService;
+
+
+    @Value("${4dkk.laserService.cloud-point-fyun-path:testdata/%s/data/bundle_%s/building/}")
+    private String cloudPointFyunPath;
+    @Value("${4dkk.laserService.bucket:laser-data}")
+    private String bucket;
+    @Value("${queue.application.laser.cloud-point-build:laser-cloud-point-build}")
+    private String cloudPointBuild;
+    @Value("${queue.application.laser.copy-scene:laser-copy-scene}")
+    private String laserCopyScene;
+    @Value("${queue.application.laser.copy-scene:laser-copy-scene-init}")
+    private String laserInitCopyScene;
+    @Override
+    public void copy(String oldNum, String newNum, String path, Boolean flag) {
+        Map<String,Object> params = new HashMap<>();
+        params.put("sceneCode", newNum);
+        params.put("oldSceneCode", oldNum);
+        params.put("path",path);
+        params.put("init",flag);
+        if(flag){
+            rabbitMqProducer.sendByWorkQueue(laserInitCopyScene,params);
+            return;
+        }
+        rabbitMqProducer.sendByWorkQueue(laserCopyScene,params);
+    }
+
+    @Override
+    public void cloudPointBuild(String oldSceneCode,String sceneCode) {
+        if (!fYunFileService.fileExist(bucket,String.format(cloudPointFyunPath,oldSceneCode,oldSceneCode) +"vision_edit.txt")){
+            return;
+        }
+        log.info("开始同步点云编辑文件");
+        // 上传点云编辑文件,并通知激光系统
+        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);
+        params.put("businessType", 0);
+        rabbitMqProducer.sendByWorkQueue(cloudPointBuild, params);
+    }
+}

+ 421 - 0
src/main/java/com/fdkankan/scene/service/impl/SceneCopyServiceImpl.java

@@ -0,0 +1,421 @@
+package com.fdkankan.scene.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.extra.qrcode.QrCodeUtil;
+import cn.hutool.extra.qrcode.QrConfig;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fdkankan.common.constant.SceneSource;
+import com.fdkankan.common.constant.SceneVersionType;
+import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.common.util.FileUtils;
+import com.fdkankan.common.util.SnowflakeIdGenerator;
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
+import com.fdkankan.rabbitmq.util.RabbitMqProducer;
+import com.fdkankan.scene.entity.*;
+import com.fdkankan.scene.mq.consumer.SceneResourcePath;
+import com.fdkankan.scene.service.*;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.util.*;
+
+@Service
+@Slf4j
+public class SceneCopyServiceImpl implements ISceneCopyService {
+
+    @Autowired
+    ISceneProService sceneProService;
+//    @Autowired
+//    ISceneProEditService sceneProEditService;
+    @Autowired
+    IScenePlusService scenePlusService;
+    @Autowired
+    IScenePlusExtService scenePlusExtService;
+    @Autowired
+    ISceneEditInfoService sceneEditInfoService;
+    @Autowired
+    ISceneEditInfoExtService sceneEditInfoExtService;
+    @Autowired
+    ISceneEditControlsService sceneEditControlsService;
+    @Autowired
+    ISurveillanceService surveillanceService;
+//    @Autowired
+//    IFolderSceneService folderSceneService;
+
+    @Autowired
+    ILaserService laserService;
+    @Resource
+    FYunFileServiceInterface fYunFileServiceInterface;
+    @Autowired
+    RabbitMqProducer rabbitMqProducer;
+    @Autowired
+    ISceneMarkShapeService sceneMarkShapeService;
+
+    @Override
+    public void copyScene(String oldNum, String newNum) {
+        ScenePlus scenePlus = scenePlusService.getScenePlusByNum(oldNum);
+        if(scenePlus != null){
+            cpV4(scenePlus,oldNum,newNum);
+        }
+    }
+
+    private void cpV4(ScenePlus scenePlus, String oldNum, String newNum) {
+        try {
+            Long plusId = scenePlus.getId();
+            ScenePlusExt plusExt = scenePlusExtService.getScenePlusExtByPlusId(plusId);
+            if(plusExt == null){
+                return;
+            }
+            scenePlus.setNum(newNum);
+            scenePlus.setTitle(scenePlus.getTitle() +"(copy)");
+            scenePlus.setSceneStatus(0);
+            scenePlus.setId(null);
+            scenePlusService.save(scenePlus);
+
+            String oldDataSource = plusExt.getDataSource();
+            String newDataSource = this.getNewDataSource(oldDataSource);
+            log.info("sceneCopy-V4-oldNum:{},oldDataSource:{},newNum:{},newDataSource:{}", oldNum,oldDataSource,newNum,newDataSource);
+
+            String newVideos = plusExt.getVideos();
+            if(StrUtil.isNotEmpty(newVideos)){
+                newVideos = plusExt.getVideos().replaceAll("/data/data" + oldNum, "/scene_view_data/" + newNum + "/data").replaceAll(oldNum, newNum);
+            }
+            plusExt.setId(null);
+            plusExt.setPlusId(scenePlus.getId());
+            plusExt.setDataSource(newDataSource);
+            plusExt.setWebSite(plusExt.getWebSite().replace(oldNum, newNum));
+            plusExt.setThumb(plusExt.getThumb().replace(oldNum, newNum));
+            plusExt.setVideos(newVideos);
+            plusExt.setViewCount(0);
+            scenePlusExtService.save(plusExt);
+
+            SceneEditInfo sceneEditInfo = sceneEditInfoService.getByScenePlusId(plusId);
+            Long sceneEditInfoId = sceneEditInfo.getId();
+
+            sceneEditInfo.setId(null);
+            sceneEditInfo.setScenePlusId(scenePlus.getId());
+            sceneEditInfo.setSceneProId(null);
+            sceneEditInfo.setTitle(scenePlus.getTitle());
+            sceneEditInfoService.save(sceneEditInfo);
+
+            SceneEditInfoExt sceneEditInfoExt = sceneEditInfoExtService.getByEditInfoId(sceneEditInfoId);
+            sceneEditInfoExt.setId(null);
+            sceneEditInfoExt.setEditInfoId(sceneEditInfo.getId());
+            sceneEditInfoExt.setScenePlusId(scenePlus.getId());
+            sceneEditInfoExt.setSceneProId(null);
+            sceneEditInfoExtService.save(sceneEditInfoExt);
+
+            SceneEditControls sceneEditControls = sceneEditControlsService.getBySceneEditId(sceneEditInfoId);
+            sceneEditControls.setId(null);
+            sceneEditControls.setEditInfoId(sceneEditInfo.getId());
+            sceneEditControlsService.save(sceneEditControls);
+
+            List<Surveillance> list = surveillanceService.list(new LambdaQueryWrapper<Surveillance>().eq(Surveillance::getNum, oldNum));
+            if (!Objects.isNull(list)) {
+                list.stream().forEach(item -> {
+                    item.setNum(newNum);
+                    item.setId(null);
+                    surveillanceService.save(item);
+                });
+            }
+
+            if(scenePlus.getSceneSource() == 4 || scenePlus.getSceneSource() == 5 || scenePlus.getSceneSource() == 7){  //深时复制
+                laserService.copy(oldNum,newNum,newDataSource,true);
+            }else {
+                laserService.cloudPointBuild(oldNum,newNum);
+            }
+
+            //重新生成编辑页基础设置二维码
+            this.createNewQrCode(SceneVersionType.V4.code(),sceneEditInfoExt.getShareLogoImg(),newNum,plusExt.getWebSite());
+            //copyDataSource
+            //cn.hutool.core.io.FileUtil.copyContent(new File(oldDataSource),new File(newDataSource),true);
+
+            this.copyOssAndNasV4(oldNum,newNum);
+
+//            this.copyMarkShape(oldNum,newNum);
+
+            //修改 oss status.json ,nas scene.json
+            String targetData = String.format(SceneResourcePath.DATA_VIEW_PATH,newNum);
+            this.updateOssJson(targetData,oldNum,newNum,"status.json");
+
+            this.updateNasSceneJson(targetData,oldNum,newNum,scenePlus.getTitle(),"v4","scene.json");
+
+            if(scenePlus.getSceneSource() == 4 || scenePlus.getSceneSource() == 5 || scenePlus.getSceneSource() == 7){  //深时复制
+                laserService.copy(oldNum,newNum,newDataSource,false);
+            }else {
+                scenePlus.setSceneStatus(-2);
+                scenePlusService.updateById(scenePlus);
+                sendMq(oldNum,newNum);
+            }
+        }catch (Exception e){
+            log.error("copy-V4-error-oldNum:{},newNum:{}",oldNum,newNum,e);
+            scenePlus.setSceneStatus(-1);
+            scenePlusService.updateById(scenePlus);
+        }
+
+    }
+
+//    private void copyMarkShape(String oldNum, String newNum){
+//        List<SceneMarkShape> sceneMarkShapes = sceneMarkShapeService.findByNum(oldNum);
+//        if(CollUtil.isEmpty(sceneMarkShapes)){
+//            return;
+//        }
+//        sceneMarkShapes.stream().forEach(v->{
+//            v.setId(null);
+//            v.setNum(newNum);
+//            v.setCreateTime(new Date());
+//            v.setUpdateTime(null);
+//        });
+//        sceneMarkShapeService.saveBatch(sceneMarkShapes);
+//    }
+
+
+
+    @Value("${queue.scene.copy.result:ucenter-copy-scene-result}")
+    private String ucenterCpResultQueue;
+
+    private void sendMq(String oldNum, String newNum) {
+        HashMap<String,Object> map = new HashMap<>();
+        map.put("oldNum",oldNum);
+        map.put("newNum",newNum);
+        rabbitMqProducer.sendByWorkQueue(ucenterCpResultQueue,map);
+    }
+
+
+
+    public String getNewDataSource(String oldDataSource){
+
+        String newDataSource = null;
+        if(StringUtils.isBlank(oldDataSource)){
+            log.info("oldDataSource为空:{}",oldDataSource);
+            return null;
+        }
+        if(!oldDataSource.contains("/")){
+            log.info("oldDataSource格式错误:{}",oldDataSource);
+            return null;
+        }
+
+        String time = com.fdkankan.common.util.DateUtil.date2String(new Date(), com.fdkankan.common.util.DateUtil.YYYYMMDDHHMMSSSSS_DATA_FORMAT);
+        String[] split = oldDataSource.split("/");
+        if(split.length == 6 ){
+            String oldFileId = split[4];
+            Long fileId = new SnowflakeIdGenerator(1,1).nextId();
+            newDataSource = oldDataSource.replace(oldFileId,fileId.toString());
+
+            String snCodeTime = split[5];
+            if(!snCodeTime.contains("_") || snCodeTime.split("_").length <= 1){
+                log.info("oldDataSource格式错误:{}",oldDataSource);
+            }
+            newDataSource = newDataSource.replace(snCodeTime.split("_")[1],time);
+            //this.copyFdage(oldDataSource,newDataSource,time);
+        }
+        if(newDataSource == null){
+            log.info("newDataSource格式错误:{}",newDataSource);
+        }
+        return newDataSource;
+    }
+
+
+    public  void createNewQrCode(String sceneVersion,String logoPath ,String newNum, String webSite){
+        String localLogoPath = null;
+        try {
+            if(StringUtils.isNotBlank(logoPath)){
+                if(sceneVersion.equals(SceneVersionType.V3.code())){
+                    localLogoPath = SceneResourcePath.nasBasePath + logoPath;
+                }else{
+                    localLogoPath = SceneResourcePath.qrCodeBasePath + newNum +"/logo/logo.png";
+                    fYunFileServiceInterface.downloadFile(logoPath,localLogoPath);
+                }
+            }
+            String outPathZh = SceneResourcePath.qrCodeBasePath + newNum + ".png";
+            String outPathEn = SceneResourcePath.qrCodeBasePath + newNum + "_en.png";
+            QrConfig qrConfig = QrConfig.create();
+            qrConfig.setWidth(1024);
+            qrConfig.setHeight(1024);
+            if(!ObjectUtils.isEmpty(localLogoPath)){
+                qrConfig.setImg(localLogoPath);
+            }
+            QrCodeUtil.generate(webSite, qrConfig, FileUtil.file(outPathZh));
+            QrCodeUtil.generate(webSite + "&lang=en", qrConfig, FileUtil.file(outPathEn));
+
+            fYunFileServiceInterface.uploadFile(outPathZh, String.format(SceneResourcePath.DOWNLOADS_QRCODE, newNum) + newNum + ".png");
+            fYunFileServiceInterface.uploadFile(outPathEn, String.format(SceneResourcePath.DOWNLOADS_QRCODE, newNum) + newNum + "_en.png");
+        }catch (Exception e){
+            log.info("copy-scene-error:{},newNum:{},error:{}",newNum,e);
+        }
+
+    }
+
+
+    public void updateNasSceneJson(String targetPath, String oldNum, String newNum,String newSceneName,String sceneVersion,String fileName) {
+        String fileContent = null;
+        if("v3".equals(sceneVersion)){
+            String localPath = SceneResourcePath.nasBasePath + targetPath + "/" + fileName;
+            File file = new File(localPath);
+            if(!file.exists()){
+                log.error("sceneCopy-error--localFileExist:localPath:{},oldNum:{},newNum:{}",localPath,oldNum,newNum);
+                return;
+            }
+            fileContent = FileUtil.readUtf8String(file);
+        }
+        if("v4".equals(sceneVersion)){
+            String ossStatusJsonPath =  targetPath + "/" + fileName;
+            if(!fYunFileServiceInterface.fileExist(ossStatusJsonPath)){
+                log.error("sceneCopy-error--ossFileExist:targetPath:{},oldNum:{},newNum:{}",ossStatusJsonPath,oldNum,newNum);
+                return;
+            }
+            fileContent = fYunFileServiceInterface.getFileContent(ossStatusJsonPath);
+        }
+
+        if(StringUtils.isNotBlank(fileContent)){
+            //v3编辑器使用
+            String localPath = SceneResourcePath.nasBasePath + targetPath +"/" + fileName;
+            File file = new File(localPath);
+            if(!file.getParentFile().exists()){
+                file.getParentFile().mkdirs();
+            }
+            String newJson = fileContent.replaceAll(oldNum,newNum);
+            try {
+                if("v3".equals(sceneVersion)){
+                    if(fileName.contains("scene.json")){
+                        JSONObject jsonObject = JSONObject.parseObject(newJson);
+                        jsonObject.put("sceneName",newSceneName);
+                        FileUtils.writeFile(localPath ,jsonObject.toJSONString());
+                        String sceneJsonPath = String.format(SceneResourcePath.dataPath+"/"+fileName, newNum);
+                        fYunFileServiceInterface.uploadFile(localPath, sceneJsonPath);
+                    }else {
+                        FileUtils.writeFile(localPath ,newJson);
+                    }
+
+                }
+                if("v4".equals(sceneVersion)){
+                    JSONObject jsonObject = JSONObject.parseObject(newJson);
+                    jsonObject.put("title",newSceneName);
+                    jsonObject.put("dynamicPanel",0);
+                    FileUtils.writeFile(localPath, jsonObject.toJSONString());
+
+                    String sceneJsonPath = String.format(SceneResourcePath.DATA_VIEW_PATH+"/" + fileName, newNum);
+                    fYunFileServiceInterface.uploadFile(localPath, sceneJsonPath);
+
+                    //修改图片名称
+                    String filePath = String.format(SceneResourcePath.USER_VIEW_PATH, newNum) ;
+                    List<String> files = fYunFileServiceInterface.listRemoteFiles(filePath);
+                    for (String ossFilePath : files) {
+                        if(ossFilePath.contains(oldNum)){
+                            String oldName = ossFilePath;
+                            ossFilePath = ossFilePath.replace(oldNum,newNum);
+                            fYunFileServiceInterface.copyFileInBucket(oldName,ossFilePath);
+                            fYunFileServiceInterface.deleteFile(oldName);
+                        }
+                    }
+                    String dynamicViewPath = String.format(SceneResourcePath.DYNAMIC_VIEW_PATH, newNum);
+                    String dynamicEditPath = String.format(SceneResourcePath.DYNAMIC_EDIT_PATH, newNum);
+                    if(fYunFileServiceInterface.fileExist(dynamicViewPath)){
+                        fYunFileServiceInterface.deleteFile(dynamicViewPath);
+                    }
+                    if(fYunFileServiceInterface.fileExist(dynamicEditPath)){
+                        fYunFileServiceInterface.deleteFile(dynamicEditPath);
+                    }
+
+                }
+            }catch (Exception e){
+                log.error("writeFile-error:{}",e);
+            }
+
+        }
+
+    }
+
+
+    public void updateOssJson(String targetPath,String oldNum, String newNum,String fileName) {
+        String ossStatusJsonPath =  targetPath + "/" + fileName;
+
+        if(!fYunFileServiceInterface.fileExist(ossStatusJsonPath)){
+            log.error("sceneCopy-error--ossFileExist:targetPath:{},oldNum:{},newNum:{}",ossStatusJsonPath,oldNum,newNum);
+            return;
+        }
+        String localPath = SceneResourcePath.nasBasePath + ossStatusJsonPath;
+        File file = new File(localPath);
+        if(!file.getParentFile().exists()){
+            file.getParentFile().mkdirs();
+        }
+        String fileContent = fYunFileServiceInterface.getFileContent(ossStatusJsonPath);
+        if(StringUtils.isNotBlank(fileContent)){
+            String newJson = fileContent.replaceAll(oldNum,newNum);
+            try {
+                FileUtils.writeFile(localPath, newJson);
+                fYunFileServiceInterface.uploadFile(localPath,ossStatusJsonPath);
+            }catch (Exception e){
+                log.error("writeFile-error:{}",e);
+            }
+        }
+
+    }
+
+    private void copyOssAndNasV3(String oldNum ,String newNum ,String sourcePath,String targetPath){
+        log.info("sceneCopy-ossSource-oldNum:{},newNum:{},sourcePath:{},targetPath:{}",oldNum,newNum,sourcePath,targetPath);
+        fYunFileServiceInterface.copyFileInBucket(sourcePath,targetPath);
+        File fileData = new File(SceneResourcePath.nasBasePath + sourcePath);
+        if(fileData.exists()){
+            if(targetPath.contains("images")){
+                this.delLink(fileData.getPath());
+            }
+            cn.hutool.core.io.FileUtil.copyContent(fileData,new File(SceneResourcePath.nasBasePath + targetPath),true);
+        }
+    }
+    private  void copyOssAndNasV4(String oldNum,String newNum){
+        // 拷贝场景编辑资源
+        String oldEditPath = String.format(SceneResourcePath.EDIT_PATH_v4, oldNum);
+        String newEditPath = String.format(SceneResourcePath.EDIT_PATH_v4, newNum);
+        fYunFileServiceInterface.copyFileInBucket(oldEditPath, newEditPath);
+
+        // 拷贝场景展示资源
+        String oldViewPath = String.format(SceneResourcePath.VIEW_PATH_v4, oldNum);
+        String newViewPath = String.format(SceneResourcePath.VIEW_PATH_v4, newNum);
+        fYunFileServiceInterface.copyFileInBucket(oldViewPath, newViewPath);
+
+        //复制计算结果文件
+        String oldResultPath = String.format(SceneResourcePath.SCENE_RESULT_DATA_PATH, oldNum);
+        String newResultPath = String.format(SceneResourcePath.SCENE_RESULT_DATA_PATH, newNum);
+        fYunFileServiceInterface.copyFileInBucket(oldResultPath, newResultPath);
+
+        // 拷贝本地资源
+        String oldPath = SceneResourcePath.nasBasePath + oldNum;
+        String newPath = SceneResourcePath.nasBasePath + newNum;
+        if(new File(oldPath).exists()){
+            FileUtil.copyContent(new File(oldPath), new File(newPath),true);
+        }
+        String oldPath_v4 = SceneResourcePath.nasBasePath_v4 + oldNum;
+        String newPath_v4 = SceneResourcePath.nasBasePath_v4 + newNum;
+        if(new File(oldPath_v4).exists()){
+            FileUtil.copyContent(new File(oldPath_v4), new File(newPath_v4),true);
+        }
+    }
+
+
+    public void delLink(String path) {
+        String panPath = path +"/panorama";
+        File file = new File(panPath);
+        if(file.exists()){
+            File[] files = file.listFiles();
+            if(files == null || files.length == 0){
+                return;
+            }
+            for (File file1 : files) {
+                String linkPath =file1.getPath() + "/capture";
+                log.info("delLink--filePath:{}",linkPath);
+                org.apache.commons.io.FileUtils.deleteQuietly(new File(linkPath));
+            }
+        }
+    }
+
+}