Преглед на файлове

增加 视频重算功能

by su преди 4 години
родител
ревизия
3086eeb875
променени са 16 файла, в които са добавени 835 реда и са изтрити 102 реда
  1. 6 0
      4dkankan-base/src/main/java/com/fdkankan/base/mq/ModelingMsgProducer.java
  2. 32 0
      4dkankan-common/src/main/java/com/fdkankan/common/vo/request/RequestRebuildVedioScene.java
  3. 28 0
      4dkankan-common/src/main/java/com/fdkankan/common/vo/response/ResponseVideoSceneProgress.java
  4. 274 0
      4dkankan-modeling/src/main/java/com/fdkankan/modeling/message/ReBuildVideoSceneReceiver.java
  5. 1 0
      4dkankan-modeling/src/main/resources/application-dev.properties
  6. 1 0
      4dkankan-modeling/src/main/resources/application-pro.properties
  7. 1 0
      4dkankan-modeling/src/main/resources/application-test.properties
  8. 1 0
      4dkankan-modeling/src/main/resources/application-uat.properties
  9. 62 0
      4dkankan-scene/src/main/java/com/fdkankan/scene/entity/VideoSceneProgressEntity.java
  10. 4 0
      4dkankan-scene/src/main/java/com/fdkankan/scene/mapper/ISceneProMapper.java
  11. 23 0
      4dkankan-scene/src/main/java/com/fdkankan/scene/service/IRebuildVideoProgressService.java
  12. 2 0
      4dkankan-scene/src/main/java/com/fdkankan/scene/service/ISceneProService.java
  13. 67 0
      4dkankan-scene/src/main/java/com/fdkankan/scene/service/impl/RebuildVideoProgressServiceImpl.java
  14. 134 102
      4dkankan-scene/src/main/java/com/fdkankan/scene/service/impl/SceneProServiceImpl.java
  15. 65 0
      4dkankan-scene/src/main/java/com/fdkankan/scene/util/ComputerUtil.java
  16. 134 0
      4dkankan-web/src/main/java/com/fdkankan/web/controller/SceneController.java

+ 6 - 0
4dkankan-base/src/main/java/com/fdkankan/base/mq/ModelingMsgProducer.java

@@ -48,6 +48,12 @@ public class ModelingMsgProducer implements RabbitTemplate.ConfirmCallback {
 
     }
 
+    public void sendMsg2(String content) {
+        CorrelationData correlationId = new CorrelationData(UUID.randomUUID().toString());
+        rabbitTemplate.convertAndSend("QUEUE_VIDEO_A", (Object) content, correlationId);
+
+    }
+
     /**
      * 获取mq的数量
      * @return

+ 32 - 0
4dkankan-common/src/main/java/com/fdkankan/common/vo/request/RequestRebuildVedioScene.java

@@ -0,0 +1,32 @@
+package com.fdkankan.common.vo.request;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class RequestRebuildVedioScene extends RequestBase implements Serializable {
+
+    @ApiModelProperty(value="场景码",name="",example="t-num")
+    private String sceneNum;
+
+    @ApiModelProperty(value="视频名(获取视频进度时不传)",name="",example="0")
+    private String panoId;
+
+    @ApiModelProperty(value="点位id - x(获取视频进度时不传)",name="",example="")
+    private String x;
+
+    @ApiModelProperty(value="点位id - y(获取视频进度时不传)",name="",example="")
+    private String y;
+
+    @ApiModelProperty(value="点位id - w(获取视频进度时不传)",name="",example="")
+    private String w;
+
+    @ApiModelProperty(value="点位id - h(获取视频进度时不传)",name="",example="")
+    private String h;
+
+
+
+
+}

+ 28 - 0
4dkankan-common/src/main/java/com/fdkankan/common/vo/response/ResponseVideoSceneProgress.java

@@ -0,0 +1,28 @@
+package com.fdkankan.common.vo.response;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 视频进度返回
+ */
+@Data
+public class ResponseVideoSceneProgress implements Serializable {
+
+    private static final long serialVersionUID = 661912133849676944L;
+
+    @ApiModelProperty(value="",name="",example="")
+    private Long id;
+
+    @ApiModelProperty(value="重算结果 0:失败,1:成功 2:等待 3:计算中",name="",example="")
+    private int rebuildResult;
+
+    @ApiModelProperty(value="视频名称",name="",example="")
+    private String videoName;
+
+
+
+
+}

+ 274 - 0
4dkankan-modeling/src/main/java/com/fdkankan/modeling/message/ReBuildVideoSceneReceiver.java

@@ -0,0 +1,274 @@
+package com.fdkankan.modeling.message;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.common.constant.ConstantFilePath;
+import com.fdkankan.common.util.FileUtils;
+import com.fdkankan.common.util.UploadToOssUtil;
+import com.fdkankan.scene.entity.SceneProEditEntity;
+import com.fdkankan.scene.entity.SceneProEntity;
+import com.fdkankan.scene.entity.VideoSceneProgressEntity;
+import com.fdkankan.scene.service.IRebuildVideoProgressService;
+import com.fdkankan.scene.service.ISceneProEditService;
+import com.fdkankan.scene.service.ISceneProService;
+import com.fdkankan.scene.util.ComputerUtil;
+import com.fdkankan.scene.util.CreateObjUtil;
+import lombok.extern.log4j.Log4j2;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.amqp.rabbit.annotation.RabbitListener;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+
+import java.io.File;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+@Log4j2
+public class ReBuildVideoSceneReceiver {
+
+    @Autowired
+    private ISceneProService sceneProService;
+
+    @Autowired
+    private ISceneProEditService sceneProEditService;
+
+    @Autowired
+    private IRebuildVideoProgressService rebuildVideoProgressService;
+
+    @Autowired
+    private UploadToOssUtil uploadToOssUtil;
+
+    @Value("${rabbitmq.queue}")
+    private String queue;
+
+
+    @RabbitListener(queues = "${rabbitmq.queue.video}", containerFactory = "rabbitListenerContainerFactory")
+    public void processvideo(String content) {
+        log.info( "接收处理队列当中" + queue + "的消息: " + content);
+
+        rebuildVideo(content);
+
+
+    }
+
+    private void rebuildVideo(String content){
+        String projectNum = null;
+        String panId = null;
+        String path = null;
+        SceneProEntity scene = null;
+
+        try {
+            if(content == null||content.trim().equals("")){
+                return;
+            }
+            String[] strs  = content.split(":;");
+
+            projectNum = strs[0];
+            panId = strs[1];
+
+            VideoSceneProgressEntity videoSceneProgressEntity = rebuildVideoProgressService.findrebuildVideoProgressDetail(projectNum,panId);
+            videoSceneProgressEntity.setRebuildStartTime(new Date());
+            videoSceneProgressEntity.setRebuildResult(3);
+            rebuildVideoProgressService.update(videoSceneProgressEntity);
+
+            log.info("开始计算 : 进度列表:" + videoSceneProgressEntity);
+
+            String splitType = "SPLIT_V13";
+            String skyboxType = "SKYBOX_V5";
+
+            Map<String,String> map = new HashMap<>();
+            //从云端拉取capture文件
+
+            //目前只支持八目相机
+
+            //休眠1秒,否则可能获取不到场景资源
+            Thread.sleep(1000);
+            scene = sceneProService.findBySceneNum(projectNum);
+            if (scene == null) {
+                log.info(projectNum + ":场景不存在");
+                return;
+            }
+
+            String filePath = videoSceneProgressEntity.getDataSource()  + "_rv";
+            File targetFile = new File(filePath);
+            if(!targetFile.getParentFile().exists()){
+                targetFile.getParentFile().mkdirs();
+            }
+
+            String fileId = videoSceneProgressEntity.getDataSource().replace(ConstantFilePath.BUILD_MODEL_PATH, "") ;
+            log.info("fileId : " + fileId);
+
+            //下载capture
+            CreateObjUtil.ossUtilCp(ConstantFilePath.OSS_PREFIX + fileId  + File.separator,
+                    ConstantFilePath.BUILD_MODEL_PATH + fileId + "_rv" + File.separator + "capture");
+
+            path = ConstantFilePath.BUILD_MODEL_PATH + fileId + "_rv"  + File.separator ;
+
+            log.info("path :" + path);
+
+            ComputerUtil.createJson(path, splitType, skyboxType, null, projectNum, path);
+
+            //创建文件 Extras 供算法不用
+            log.info("开始生成 Extras 文件");
+            ComputerUtil.createExtras(videoSceneProgressEntity,path);
+            log.info("开始生成 Extras 文件结束");
+
+            //计算模型并返回需要上传oss的文件集合
+            map = ComputerUtil.computerRebuildVideo(projectNum, path);
+            log.info("上传内容 ===== + " + map);
+            uploadToOssUtil.uploadMulFiles(map);
+
+            log.info("结束计算 =====");
+
+
+            Map map2 = new HashMap();
+
+            JSONArray uploadarray = null;
+            JSONArray hdrArray = null;
+            JSONObject fileJson = null;
+            String fileName = "";
+
+            //读取videos_hdr_param.json, 保存点位视频的value
+            String videosHdr = FileUtils.readFile(path + File.separator + "results/videos/videos_hdr_param.json");
+            String uploadData = FileUtils.readFile(path + File.separator + "results" +File.separator+"upload.json");
+            String strsceneInfos = FileUtils.readFile(ConstantFilePath.SCENE_PATH + "data/data" + projectNum + File.separator + "scene.json");
+            JSONObject scenejson = new JSONObject();
+            log.info("strsceneInfos =====" + strsceneInfos);
+
+            if(strsceneInfos!=null){
+                scenejson = JSONObject.parseObject(strsceneInfos);
+                log.info("scenejson =====" + scenejson);
+            }
+
+            JSONObject videoJsonNew = new JSONObject();
+            JSONArray dataarray = new JSONArray();
+
+            SceneProEntity sceneProEntity = sceneProService.findBySceneNum(projectNum);
+            //获取 videos
+            if(StringUtils.isNotEmpty(sceneProEntity.getVideos())){
+                JSONObject videosjson = JSONObject.parseObject(sceneProEntity.getVideos());
+                log.info("videosjson =====" + videosjson);
+
+                if (videosjson.containsKey("data")) {
+                    JSONArray dataArray = new JSONArray();
+                    dataArray = (JSONArray) videosjson.get("data");
+                    JSONObject uploadJson = null;
+                    if(uploadData!=null) {
+                        uploadJson = JSONObject.parseObject(uploadData);
+                        uploadarray = uploadJson.getJSONArray("upload");
+                        log.info("uploadarray =====" + uploadarray);
+                    }
+                    JSONObject hdrObject = new JSONObject();
+                    for(int i = 0, len = uploadarray.size(); i < len; i++) {
+                        fileJson = uploadarray.getJSONObject(i);
+                        fileName = fileJson.getString("file");
+                        if (fileJson.getIntValue("clazz") == 20 && fileName.contains(".mp4") && !fileName.contains("-ios.mp4")) {
+                            String id =fileName.substring( 0, fileName.lastIndexOf(".")).replace("videos/", "");
+
+                            log.info("id :" + id);
+
+                            //生成objet
+                            if(StringUtils.isNotEmpty(videosHdr)){
+                                hdrArray = JSONObject.parseObject(videosHdr).getJSONArray("hdr_param");
+                                log.info("hdrArray :" + hdrArray);
+                            }
+                            if(hdrArray != null){
+                                for(int z = 0, lenq = hdrArray.size(); z< lenq; z++) {
+                                    JSONObject obj = (JSONObject) hdrArray.get(z);
+                                    String name = (String) obj.get("name");
+                                    if(name.equals(id)){
+                                        String fov =  obj.get("fov").toString();
+                                        String name1 = obj.get("name").toString();
+                                        String value =  obj.get("value").toString();
+                                        hdrObject.put("blend_fov",String.valueOf(fov));
+                                        hdrObject.put("id",name1);
+                                        hdrObject.put("value",String.valueOf(value));
+                                        log.info("hdrObject :" + hdrObject);
+                                        dataarray.add(hdrObject);
+                                    }
+                                }
+                            }
+
+                            log.info("dataArray 2  =====" + dataArray);
+                            for(int x = 0; x < dataArray.size(); x++) {
+                                JSONObject obj = (JSONObject) dataArray.get(x);
+                                String id2 = (String) obj.get("id");
+                                if(!id2.equals(id)){
+                                    dataarray.add(obj);
+                                    log.info("data obj =====" + obj);
+                                }
+                            }
+                        }
+                    }
+                }
+                log.info("dataarray =====" + dataarray);
+                videoJsonNew.put("data",dataarray);
+                videoJsonNew.put("upPath",videosjson.get("upPath"));
+                videoJsonNew.put("version",videosjson.get("version"));
+            }
+            map2.put("videos",videoJsonNew.toJSONString());
+
+            long start = System.currentTimeMillis();
+            long computeTime = (System.currentTimeMillis() - start) / 1000;
+            sceneProService.updateTime2(projectNum,  videoJsonNew.toJSONString(), computeTime);
+            Integer imagesVersion = 50;
+            if(strsceneInfos!=null){
+                scenejson = JSONObject.parseObject(strsceneInfos);
+                if(scenejson.containsKey("imagesVersion")){
+                    log.error("imagesVersion ============" + imagesVersion);
+                    imagesVersion = (Integer) scenejson.get("imagesVersion");
+                    imagesVersion = imagesVersion + 50;
+//                    map2.put("imagesVersion", imagesVersion + 50);
+                }
+
+                log.error("imagesVersion2 ============" + imagesVersion);
+                map2.put("imagesVersion",  imagesVersion);
+                log.error("map2 ============" + map2);
+                FileUtils.writeJsonFile(ConstantFilePath.SCENE_PATH + "data/data" + projectNum + File.separator + "scene.json", map2);
+            }else{
+                log.error("更新 scene.json 文件失败");
+            }
+
+
+
+            SceneProEditEntity sceneProEditEntity = sceneProEditService.findByProId(sceneProEntity.getId());
+            sceneProEditEntity.setImagesVersion(imagesVersion);
+//            sceneProEditEntity.setFloorEditVer(sceneProEditEntity.getFloorEditVer() + 1);
+//            sceneProEditEntity.setFloorPublishVer(sceneProEditEntity.getFloorPublishVer() + 1);
+            sceneProEditService.update(sceneProEditEntity);
+
+            rebuildVideoProgressService.updateProgress(projectNum, panId,1);
+
+        }catch(Exception e){
+            log.error("视频失败"+projectNum);
+            rebuildVideoProgressService.updateProgress(projectNum, panId,0);
+            e.printStackTrace();
+            StringWriter trace=new StringWriter();
+            e.printStackTrace(new PrintWriter(trace));
+            log.error(trace.toString());
+
+        }finally {
+            try{
+                scene = sceneProService.findBySceneNum(projectNum);
+                if(scene != null){
+                    JSONObject statusJson = new JSONObject();
+                    //临时将-2改成1,app还没完全更新
+                    statusJson.put("status", scene.getStatus() == -2? 1 : scene.getStatus());
+                    statusJson.put("webSite", scene.getWebSite());
+                    statusJson.put("sceneNum", scene.getNum());
+                    statusJson.put("thumb", scene.getThumb());
+                    statusJson.put("payStatus", scene.getPayStatus());
+                    FileUtils.writeFile(ConstantFilePath.SCENE_PATH+"data/data"+projectNum+File.separator+"status.json", statusJson.toString());
+                    uploadToOssUtil.upload(ConstantFilePath.SCENE_PATH+"data/data"+projectNum+File.separator+"status.json",
+                            "data/data"+projectNum+File.separator+"status.json");
+                }
+            }catch (Exception e){
+                e.printStackTrace();
+            }
+        }
+
+    }
+}

+ 1 - 0
4dkankan-modeling/src/main/resources/application-dev.properties

@@ -82,6 +82,7 @@ phone.sign=四维看看
 
 #mq的任务key
 rabbitmq.queue=QUEUE_MODELING_A
+rabbitmq.queue.video=QUEUE_VIDEO_A
 #mq当排队任务超过这个数量时启用弹性升缩
 mq.base.num=300
 #弹性伸缩组id

+ 1 - 0
4dkankan-modeling/src/main/resources/application-pro.properties

@@ -76,6 +76,7 @@ environment=dev
 
 #mq的任务key
 rabbitmq.queue=QUEUE_MODELING_A
+rabbitmq.queue.video=QUEUE_VIDEO_A
 #mq当排队任务超过这个数量时启用弹性升缩
 mq.base.num=300
 #弹性伸缩组id

+ 1 - 0
4dkankan-modeling/src/main/resources/application-test.properties

@@ -76,6 +76,7 @@ environment=dev
 
 #mq的任务key
 rabbitmq.queue=QUEUE_MODELING_A
+rabbitmq.queue.video=QUEUE_VIDEO_A
 #mq当排队任务超过这个数量时启用弹性升缩
 mq.base.num=300
 #弹性伸缩组id

+ 1 - 0
4dkankan-modeling/src/main/resources/application-uat.properties

@@ -77,6 +77,7 @@ environment=dev
 
 #mq的任务key
 rabbitmq.queue=QUEUE_MODELING_A
+rabbitmq.queue.video=QUEUE_VIDEO_A
 #mq当排队任务超过这个数量时启用弹性升缩
 mq.base.num=300
 #弹性伸缩组id

+ 62 - 0
4dkankan-scene/src/main/java/com/fdkankan/scene/entity/VideoSceneProgressEntity.java

@@ -0,0 +1,62 @@
+package com.fdkankan.scene.entity;
+
+import com.fdkankan.base.entity.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Column;
+import javax.persistence.Table;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 场景表
+ */
+@Data
+@Table(name = "t_video_scene_progress")
+public class VideoSceneProgressEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = 661912133849676944L;
+
+    @Column(name = "scene_code")
+    @ApiModelProperty(value="大场景序号",name="",example="")
+    private String sceneCode;
+
+    @Column(name = "rebuild_queue_start_time")
+    @ApiModelProperty(value="重算开始时间(进入队列)",name="",example="")
+    private Date rebuildQueueStartTime;
+
+    @Column(name = "rebuild_start_time")
+    @ApiModelProperty(value="重算开始时间",name="",example="")
+    private Date rebuildStartTime;
+
+    @Column(name = "rebuild_end_time")
+    @ApiModelProperty(value="重算结束时间",name="",example="")
+    private Date rebuildEndTime;
+
+    @Column(name = "video_name")
+    @ApiModelProperty(value="视频名称",name="",example="0.mp4")
+    private String videoName;
+
+    @Column(name = "data_source")
+    @ApiModelProperty(value="mnt路径",name="",example="")
+    private String dataSource;
+
+    @Column(name = "rebuild_result")
+    @ApiModelProperty(value="重算结果 0:失败,1:成功 2:等待",name="",example="")
+    private int rebuildResult;
+
+    @Column(name = "rebuild_param")
+    @ApiModelProperty(value="重算参数",name="",example="")
+    private String rebuildParam;
+
+    @Column(name = "hdr_param")
+    @ApiModelProperty(value="hdr_param 参数",name="",example="")
+    private String hdrParam;
+
+
+
+
+
+
+}

+ 4 - 0
4dkankan-scene/src/main/java/com/fdkankan/scene/mapper/ISceneProMapper.java

@@ -39,6 +39,10 @@ public interface ISceneProMapper extends IBaseMapper<SceneProEntity, String> {
     @Select(" SELECT * FROM t_scene_pro WHERE data_source LIKE CONCAT('%',#{fileId},'%') AND is_delete = '0' order by create_time desc LIMIT 1 ")
     SceneProEntity findByFileId(@Param("fileId") String fileId);
 
+    @Update("UPDATE t_scene_pro SET create_time = NOW(),status=-2,  videos = #{videos}, compute_time = #{computeTime} WHERE num = #{sceneNum}")
+    int updateTime2(@Param("sceneNum") String sceneNum, @Param("videos") String videos, @Param("computeTime") long computeTime);
+
+
     @Select("<script> " +
             "  SELECT * FROM t_scene_pro  WHERE is_delete = '0' " +
             " <if test= 'cameraIds != null and cameraIds != \"\"'> " +

+ 23 - 0
4dkankan-scene/src/main/java/com/fdkankan/scene/service/IRebuildVideoProgressService.java

@@ -0,0 +1,23 @@
+package com.fdkankan.scene.service;
+
+import com.fdkankan.base.service.IBaseService;
+import com.fdkankan.common.vo.request.RequestRebuildVedioScene;
+import com.fdkankan.common.vo.response.ResponseVideoSceneProgress;
+import com.fdkankan.scene.entity.VideoSceneProgressEntity;
+
+import java.util.List;
+
+/**
+ * Created by Hb_zzZ on 2019/7/23.
+ */
+public interface IRebuildVideoProgressService extends IBaseService<VideoSceneProgressEntity, Long> {
+
+    List<ResponseVideoSceneProgress> findVideoSceneProgress(RequestRebuildVedioScene requestRebuildVedioScene);
+
+    int updateProgressRec(RequestRebuildVedioScene requestRebuildVedioScene);
+
+    VideoSceneProgressEntity findrebuildVideoProgressDetail (String num,String panId );
+
+    int updateProgress(String num,String panId,Integer status);
+
+}

+ 2 - 0
4dkankan-scene/src/main/java/com/fdkankan/scene/service/ISceneProService.java

@@ -121,4 +121,6 @@ public interface ISceneProService extends IBaseService<SceneProEntity, String> {
                           String videoDirMatrix, String dir, String hfov, String vfov) throws Exception;
 
     Result deleteROIVideo(String sceneNum, String fileName, String planId) throws Exception;
+
+    int updateTime2(String sceneNum, String videos, long computeTime);
 }

+ 67 - 0
4dkankan-scene/src/main/java/com/fdkankan/scene/service/impl/RebuildVideoProgressServiceImpl.java

@@ -0,0 +1,67 @@
+package com.fdkankan.scene.service.impl;
+
+import com.fdkankan.base.mapper.base.IBaseMapper;
+import com.fdkankan.base.service.impl.BaseServiceImpl;
+import com.fdkankan.common.vo.request.RequestRebuildVedioScene;
+import com.fdkankan.common.vo.response.ResponseVideoSceneProgress;
+import com.fdkankan.scene.entity.VideoSceneProgressEntity;
+import com.fdkankan.scene.mapper.IRebuildVideoProgressMapper;
+import com.fdkankan.scene.service.IRebuildVideoProgressService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by Hb_zzZ on 2019/7/23.
+ */
+@Slf4j
+@Service
+@Transactional
+public class RebuildVideoProgressServiceImpl extends BaseServiceImpl<VideoSceneProgressEntity, Long> implements IRebuildVideoProgressService {
+
+    @Autowired
+    private IRebuildVideoProgressMapper rebuildVideoProgressMapper;
+
+    @Override
+    public IBaseMapper<VideoSceneProgressEntity, Long> getBaseMapper() {
+        return rebuildVideoProgressMapper;
+    }
+
+    @Override
+    public List<ResponseVideoSceneProgress> findVideoSceneProgress(RequestRebuildVedioScene requestRebuildVedioScene) {
+        List<VideoSceneProgressEntity> videoSceneProgressEntityList = rebuildVideoProgressMapper.findrebuildVideoProgress(requestRebuildVedioScene.getSceneNum());
+
+        List<ResponseVideoSceneProgress> responseVideoSceneProgressList = new ArrayList<>();
+        for (VideoSceneProgressEntity videoSceneProgressEntity : videoSceneProgressEntityList){
+            ResponseVideoSceneProgress responseVideoSceneProgress = new ResponseVideoSceneProgress();
+            BeanUtils.copyProperties(videoSceneProgressEntity, responseVideoSceneProgress);
+            responseVideoSceneProgressList.add(responseVideoSceneProgress);
+        }
+
+        //更新访问量
+        rebuildVideoProgressMapper.updatePageView(requestRebuildVedioScene.getSceneNum());
+        return responseVideoSceneProgressList;
+    }
+
+    @Override
+    public int updateProgressRec(RequestRebuildVedioScene requestRebuildVedioScene) {
+        return rebuildVideoProgressMapper.updateProgressRecStatus(requestRebuildVedioScene.getSceneNum(),requestRebuildVedioScene.getPanoId());
+    }
+
+    @Override
+    public VideoSceneProgressEntity findrebuildVideoProgressDetail(String num,String panId) {
+        return rebuildVideoProgressMapper.findrebuildVideoProgressDetail(num,panId);
+    }
+
+    @Override
+    public int updateProgress(String num, String panId, Integer status) {
+        return rebuildVideoProgressMapper.updateProgressStatus(num ,panId ,status );
+    }
+
+
+}

+ 134 - 102
4dkankan-scene/src/main/java/com/fdkankan/scene/service/impl/SceneProServiceImpl.java

@@ -1710,7 +1710,7 @@ public class SceneProServiceImpl extends BaseServiceImpl<SceneProEntity, String>
         }
 
         //重算全景图并上传oss或视频上传oss
-        if(scenejson.containsKey("buildImages") && scenejson.getIntValue("buildImages") == 1){
+        if(scenejson.containsKey("buildImages")  ){
             String path = sceneProEntity.getDataSource();
 
             if(path != null && !"".equals(path) && path.startsWith("http")){
@@ -1721,127 +1721,149 @@ public class SceneProServiceImpl extends BaseServiceImpl<SceneProEntity, String>
             File images = new File(target + File.separator + "extras/images");
             File video = new File(target + File.separator + "extras/video");
 
-            log.info("下载vision.modeldata文件");
-            FileUtils.downLoadFromUrl(prefixAli + "images/images" + sceneProEntity.getNum() + "/vision.modeldata" + "?m="+new Date().getTime(),
-                    "vision.modeldata", target + File.separator + "extras" + File.separator);
-            CreateObjUtil.convertVisionmodeldataToTxt(target + File.separator + "extras" + File.separator + "vision.modeldata",
-                    target + File.separator + "extras" + File.separator + "vision.txt");
-
-            if(images.exists() && images.listFiles() != null && images.listFiles().length > 0){
+            if(scenejson.getIntValue("buildImages") == 1){
+                log.info("下载vision.modeldata文件");
+                FileUtils.downLoadFromUrl(prefixAli + "images/images" + sceneProEntity.getNum() + "/vision.modeldata" + "?m="+new Date().getTime(),
+                        "vision.modeldata", target + File.separator + "extras" + File.separator);
+                CreateObjUtil.convertVisionmodeldataToTxt(target + File.separator + "extras" + File.separator + "vision.modeldata",
+                        target + File.separator + "extras" + File.separator + "vision.txt");
+
+                if(images.exists() && images.listFiles() != null && images.listFiles().length > 0){
+
+                    FileUtils.copyFile(path + File.separator + "data.json", target + File.separator+"data.json", true);
+                    FileUtils.copyFile(path + File.separator + "project.json", target + File.separator+"project.json", true);
+
+                    //data.json增加extras为执行重建算法
+                    String data = FileUtils.readFile(target + File.separator+"data.json");
+                    if(data != null){
+                        JSONObject floorplanJson = new JSONObject();
+                        floorplanJson.put("has_source_images", true);
+                        floorplanJson.put("has_vision_txt", true);
+
+                        JSONObject dataJson = JSONObject.parseObject(data);
+                        dataJson.put("extras", floorplanJson);
+                        //V5表示不需要生成high,low文件
+                        dataJson.put("skybox_type", "SKYBOX_V6");
+                        if(sceneProEntity.getSceneScheme() == 11){
+                            dataJson.put("skybox_type", "SKYBOX_V7");
+                        }
+                        dataJson.put("split_type", "SPLIT_V8");
+                        //sceneScheme为3切成瓦片图
+                        if(sceneProEntity.getSceneScheme() == 3){
+                            dataJson.put("skybox_type", "SKYBOX_V4");
+                        }
+                        FileUtils.writeFile(target + File.separator+"data.json", new String(dataJson.toString().getBytes(), "UTF-8"));
+                    }
 
-                FileUtils.copyFile(path + File.separator + "data.json", target + File.separator+"data.json", true);
-                FileUtils.copyFile(path + File.separator + "project.json", target + File.separator+"project.json", true);
+                    //创建文件夹软连接并且复制data.json和project.json
+                    if(new File(target + File.separator + "capture").exists()){
+                        new File(target + File.separator + "capture").delete();
+                    }
+                    if(new File(target + File.separator + "results").exists()){
+                        FileUtils.delAllFile(target + File.separator + "results");
+                    }
+                    //下载data.fdage
+                    CreateObjUtil.ossUtilCp(ConstantFilePath.OSS_PREFIX + path.replace(ConstantFilePath.BUILD_MODEL_PATH, "") + "/data.fdage", target + File.separator + "capture/");
 
-                //data.json增加extras为执行重建算法
-                String data = FileUtils.readFile(target + File.separator+"data.json");
-                if(data != null){
-                    JSONObject floorplanJson = new JSONObject();
-                    floorplanJson.put("has_source_images", true);
-                    floorplanJson.put("has_vision_txt", true);
+                    CreateObjUtil.build3dModel(target , "1");
 
-                    JSONObject dataJson = JSONObject.parseObject(data);
-                    dataJson.put("extras", floorplanJson);
-                    //V5表示不需要生成high,low文件
-                    dataJson.put("skybox_type", "SKYBOX_V6");
-                    if(sceneProEntity.getSceneScheme() == 11){
-                        dataJson.put("skybox_type", "SKYBOX_V7");
+                    //读取upload文件,检验需要上传的文件是否存在
+                    String uploadData = FileUtils.readFile(target + File.separator + "results" +File.separator+"upload.json");
+                    JSONObject uploadJson = null;
+                    JSONArray array = null;
+                    if(uploadData!=null) {
+                        uploadJson = JSONObject.parseObject(uploadData);
+                        array = uploadJson.getJSONArray("upload");
                     }
-                    dataJson.put("split_type", "SPLIT_V8");
-                    //sceneScheme为3切成瓦片图
-                    if(sceneProEntity.getSceneScheme() == 3){
-                        dataJson.put("skybox_type", "SKYBOX_V4");
+                    if(array == null){
+                        throw new Exception("upload.json数据出错");
                     }
-                    FileUtils.writeFile(target + File.separator+"data.json", new String(dataJson.toString().getBytes(), "UTF-8"));
-                }
+                    JSONObject fileJson = null;
+                    String fileName = "";
+                    for(int i = 0, len = array.size(); i < len; i++){
+                        fileJson = array.getJSONObject(i);
+                        fileName = fileJson.getString("file");
+                        //文件不存在抛出异常
+                        if(!new File(target + File.separator + "results" +File.separator + fileName).exists()){
+                            throw new Exception(target + File.separator + "results" +File.separator + fileName+"文件不存在");
+                        }
 
-                //创建文件夹软连接并且复制data.json和project.json
-                if(new File(target + File.separator + "capture").exists()){
-                    new File(target + File.separator + "capture").delete();
-                }
-                if(new File(target + File.separator + "results").exists()){
-                    FileUtils.delAllFile(target + File.separator + "results");
-                }
-                //下载data.fdage
-                CreateObjUtil.ossUtilCp(ConstantFilePath.OSS_PREFIX + path.replace(ConstantFilePath.BUILD_MODEL_PATH, "") + "/data.fdage", target + File.separator + "capture/");
+                        //high文件夹
+                        if(fileJson.getIntValue("clazz") == 3){
+                            map.put(target + File.separator + "results" +File.separator+ fileName,"images/images"+
+                                    sceneProEntity.getNum()+"/pan/high/"+ fileName.replace("high/", ""));
+                            continue;
+                        }
+                        //low文件夹
+                        if(fileJson.getIntValue("clazz") == 4){
+                            map.put(target + File.separator + "results" +File.separator+ fileName,"images/images"+
+                                    sceneProEntity.getNum()+"/pan/low/"+ fileName.replace("low/", ""));
+                            continue;
+                        }
 
-                CreateObjUtil.build3dModel(target , "1");
+                        //tiles文件夹,亚马逊没有裁剪图片api,不需要上传4k图
+                        if(fileJson.getIntValue("clazz") == 5){
+                            map.put(target + File.separator + "results" + File.separator+ fileName,"images/images"+
+                                    sceneProEntity.getNum()+ File.separator + fileName);
+                            continue;
+                        }
 
-                //读取upload文件,检验需要上传的文件是否存在
-                String uploadData = FileUtils.readFile(target + File.separator + "results" +File.separator+"upload.json");
-                JSONObject uploadJson = null;
-                JSONArray array = null;
-                if(uploadData!=null) {
-                    uploadJson = JSONObject.parseObject(uploadData);
-                    array = uploadJson.getJSONArray("upload");
-                }
-                if(array == null){
-                    throw new Exception("upload.json数据出错");
-                }
-                JSONObject fileJson = null;
-                String fileName = "";
-                for(int i = 0, len = array.size(); i < len; i++){
-                    fileJson = array.getJSONObject(i);
-                    fileName = fileJson.getString("file");
-                    //文件不存在抛出异常
-                    if(!new File(target + File.separator + "results" +File.separator + fileName).exists()){
-                        throw new Exception(target + File.separator + "results" +File.separator + fileName+"文件不存在");
+                        //tiles文件夹,亚马逊瓦片图
+                        if(fileJson.getIntValue("clazz") == 7 ){
+                            map.put(target + File.separator + "results" + File.separator+ fileName,"images/images"+
+                                    sceneProEntity.getNum()+ File.separator + fileName);
+                            continue;
+                        }
                     }
 
-                    //high文件夹
-                    if(fileJson.getIntValue("clazz") == 3){
-                        map.put(target + File.separator + "results" +File.separator+ fileName,"images/images"+
-                                sceneProEntity.getNum()+"/pan/high/"+ fileName.replace("high/", ""));
-                        continue;
-                    }
-                    //low文件夹
-                    if(fileJson.getIntValue("clazz") == 4){
-                        map.put(target + File.separator + "results" +File.separator+ fileName,"images/images"+
-                                sceneProEntity.getNum()+"/pan/low/"+ fileName.replace("low/", ""));
-                        continue;
+                    for(String imagesName : images.list()){
+                        //覆盖原始图片资源
+                        FileUtils.copyFile(target + File.separator + "extras/images/" + imagesName,
+                                path + File.separator + "caches/images/" + imagesName, true);
+                        FileUtils.deleteFile(target + File.separator + "extras/images/" + imagesName);
                     }
+                }
 
-                    //tiles文件夹,亚马逊没有裁剪图片api,不需要上传4k图
-                    if(fileJson.getIntValue("clazz") == 5){
-                        map.put(target + File.separator + "results" + File.separator+ fileName,"images/images"+
-                                sceneProEntity.getNum()+ File.separator + fileName);
-                        continue;
-                    }
+                if(video.exists() && video.listFiles() != null && video.listFiles().length > 0){
+                    for(String videoName : video.list()){
+                        uploadToOssUtil.upload(target + File.separator + "extras/video/" + videoName,"video/video"+
+                                sceneProEntity.getNum()+ File.separator + videoName);
 
-                    //tiles文件夹,亚马逊瓦片图
-                    if(fileJson.getIntValue("clazz") == 7 ){
-                        map.put(target + File.separator + "results" + File.separator+ fileName,"images/images"+
-                                sceneProEntity.getNum()+ File.separator + fileName);
-                        continue;
-                    }
-                }
+                        CreateObjUtil.mp4ToFlv(target + File.separator + "extras/video/" + videoName,
+                                target + File.separator + "extras/video/" + videoName.replace("mp4", "flv"));
 
-                for(String imagesName : images.list()){
-                    //覆盖原始图片资源
-                    FileUtils.copyFile(target + File.separator + "extras/images/" + imagesName,
-                            path + File.separator + "caches/images/" + imagesName, true);
-                    FileUtils.deleteFile(target + File.separator + "extras/images/" + imagesName);
-                }
-            }
+                        uploadToOssUtil.upload(target + File.separator + "extras/video/" + videoName.replace("mp4", "flv"),"video/video"+
+                                sceneProEntity.getNum()+ File.separator + videoName.replace("mp4", "flv"));
 
-            if(video.exists() && video.listFiles() != null && video.listFiles().length > 0){
-                for(String videoName : video.list()){
-                    uploadToOssUtil.upload(target + File.separator + "extras/video/" + videoName,"video/video"+
-                            sceneProEntity.getNum()+ File.separator + videoName);
+                        //覆盖原始视频资源
+                        FileUtils.copyFile(target + File.separator + "extras/video/" + videoName,
+                                path + File.separator + "caches/videos/" + videoName, true);
 
-                    CreateObjUtil.mp4ToFlv(target + File.separator + "extras/video/" + videoName,
-                            target + File.separator + "extras/video/" + videoName.replace("mp4", "flv"));
+                    }
+                    FileUtils.deleteDirectory(target + File.separator + "extras/video/");
+                }
+            }else if(scenejson.getIntValue("buildImages") == 2){
+                if(video.exists() && video.listFiles() != null && video.listFiles().length > 0){
+                    for(String videoName : video.list()){
+                        uploadToOssUtil.upload(target + File.separator + "extras/video/" + videoName,"video/video"+
+                                sceneProEntity.getNum()+ File.separator + videoName);
 
-                    uploadToOssUtil.upload(target + File.separator + "extras/video/" + videoName.replace("mp4", "flv"),"video/video"+
-                            sceneProEntity.getNum()+ File.separator + videoName.replace("mp4", "flv"));
+                        CreateObjUtil.mp4ToFlv(target + File.separator + "extras/video/" + videoName,
+                                target + File.separator + "extras/video/" + videoName.replace("mp4", "flv"));
 
-                    //覆盖原始视频资源
-                    FileUtils.copyFile(target + File.separator + "extras/video/" + videoName,
-                            path + File.separator + "caches/videos/" + videoName, true);
+                        uploadToOssUtil.upload(target + File.separator + "extras/video/" + videoName.replace("mp4", "flv"),"video/video"+
+                                sceneProEntity.getNum()+ File.separator + videoName.replace("mp4", "flv"));
 
+                        //覆盖原始视频资源
+                        FileUtils.copyFile(target + File.separator + "extras/video/" + videoName,
+                                path + File.separator + "caches/videos/" + videoName, true);
+
+                    }
+                    FileUtils.deleteDirectory(target + File.separator + "extras/video/");
                 }
-                FileUtils.deleteDirectory(target + File.separator + "extras/video/");
             }
 
+
             scenejson.put("imagesVersion", sceneProEditEntity.getImagesVersion() + 1);
             scenejson.put("buildImages", 0);
             sceneProEditEntity.setImagesVersion(sceneProEditEntity.getImagesVersion() + 1);
@@ -3216,8 +3238,13 @@ public class SceneProServiceImpl extends BaseServiceImpl<SceneProEntity, String>
             scenejson = JSONObject.parseObject(strsceneInfos);
         }
 
-        scenejson.put("buildImages", 1);
-        FileUtils.writeFile(dataBuffer.toString() + "scene.json", scenejson.toString());
+        if(type.equals("video")){
+            scenejson.put("buildImages", 2);
+            FileUtils.writeFile(dataBuffer.toString() + "scene.json", scenejson.toString());
+        }else{
+            scenejson.put("buildImages", 1);
+            FileUtils.writeFile(dataBuffer.toString() + "scene.json", scenejson.toString());
+        }
 
         return Result.success();
     }
@@ -3872,4 +3899,9 @@ public class SceneProServiceImpl extends BaseServiceImpl<SceneProEntity, String>
         return Result.success();
     }
 
+    @Override
+    public int updateTime2(String sceneNum, String videos, long computeTime) {
+        return sceneProMapper.updateTime2(sceneNum,  videos, computeTime);
+    }
+
 }

+ 65 - 0
4dkankan-scene/src/main/java/com/fdkankan/scene/util/ComputerUtil.java

@@ -593,6 +593,71 @@ public class ComputerUtil {
         return scene;
     }
 
+    public static void createExtras(VideoSceneProgressEntity videoSceneProgressEntity,String path) throws Exception {
+        String msg = videoSceneProgressEntity.getRebuildParam();
+
+        FileUtils.writeFile( path + File.separator + "extras" + File.separator + "videos_hdr_param.json", videoSceneProgressEntity.getHdrParam());
+
+        FileUtils.writeFile( path + File.separator + "extras" + File.separator + "required_videos.json", videoSceneProgressEntity.getRebuildParam());
+
+    }
+
+    public static Map<String,String> computerRebuildVideo(String projectNum, String path) throws Exception{
+        Map<String,String> map = new HashMap<String,String>();
+        path = path.replace("//", "/");
+
+        log.info("开始建模:"+projectNum);
+        //构建算法isModel去掉,因此改成空字符串
+        CreateObjUtil.build3dModel(path, "");
+        log.info("建模完成转换数据:"+projectNum);
+
+        boolean vision2 = false;
+        //读取upload文件,检验需要上传的文件是否存在
+        String uploadData = FileUtils.readFile(path + File.separator + "results" +File.separator+"upload.json");
+        JSONObject uploadJson = null;
+        JSONArray array = null;
+        if(uploadData!=null) {
+            uploadJson = JSONObject.parseObject(uploadData);
+            array = uploadJson.getJSONArray("upload");
+        }
+
+        if(array == null){
+            String instanceId = FileUtils.readFile("/opt/hosts/hosts.txt");
+            FileUtils.writeFile(path + File.separator + "javaErrorNow.log", instanceId + ":计算错误!");
+
+            Thread.sleep(10000L);
+            FileUtils.writeFile(path + File.separator + "javaError.log", instanceId + ":计算错误!");
+            throw new Exception("upload.json数据出错");
+        }
+
+        JSONObject fileJson = null;
+        String fileName = "";
+        for(int i = 0, len = array.size(); i < len; i++) {
+            fileJson = array.getJSONObject(i);
+            fileName = fileJson.getString("file");
+            //文件不存在抛出异常
+            if (!new File(path + File.separator + "results" + File.separator + fileName).exists()) {
+                throw new Exception(path + File.separator + "results" + File.separator + fileName + "文件不存在");
+            }
+
+            //video视频文件或封面图
+            if (fileJson.getIntValue("clazz") == 20) {
+                if (fileName.contains(".flv")) {
+                    map.put(path + File.separator + "results" + File.separator + fileName, "video/video" +
+                            projectNum + File.separator + fileName.replace("videos/", ""));
+                }
+
+                if (fileName.contains(".mp4")) {
+                    map.put(path + File.separator + "results" + File.separator + fileName, "video/video" +
+                            projectNum + File.separator + fileName.replace("videos/", ""));
+                }
+            }
+        }
+
+        log.info("准备上传文件到oss:"+projectNum);
+        return map;
+    }
+
     public static void main(String[] args) {
 
     }

+ 134 - 0
4dkankan-web/src/main/java/com/fdkankan/web/controller/SceneController.java

@@ -1,6 +1,7 @@
 package com.fdkankan.web.controller;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.base.constant.CameraConstant;
 import com.fdkankan.base.constant.LoginConstant;
@@ -11,6 +12,7 @@ import com.fdkankan.common.constant.ConstantFilePath;
 import com.fdkankan.common.exception.BaseRuntimeException;
 import com.fdkankan.common.model.Result;
 import com.fdkankan.common.util.*;
+import com.fdkankan.common.vo.request.RequestRebuildVedioScene;
 import com.fdkankan.common.vo.request.RequestScene;
 import com.fdkankan.common.vo.response.ResponseScene;
 import com.fdkankan.scene.entity.CameraEntity;
@@ -41,6 +43,9 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.File;
 import java.io.PrintWriter;
 import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
 
 @Log4j2
 @Api(tags = "场景管理")
@@ -66,6 +71,9 @@ public class SceneController extends BaseController {
     private RedisTemplate<String, String> redisTemplate;
 
     @Autowired
+    private IRebuildVideoProgressService rebuildVideoProgressService;
+
+    @Autowired
     private PanoFeign panoFeign;
 
     @Value("${main.url}")
@@ -326,6 +334,132 @@ public class SceneController extends BaseController {
         return Result.success("生成新的场景重新计算");
     }
 
+
+    /**
+     * 场景模型重新计算
+     */
+    @ApiOperation("场景视频重新计算")
+    @RequestMapping(value = "/rebuildVideoScene", method = RequestMethod.POST)
+    public Result rebuildVideoScene(@RequestBody RequestRebuildVedioScene requestRebuildVedioScene) throws Exception {
+
+        if(StringUtils.isEmpty(requestRebuildVedioScene.getSceneNum()) || StringUtils.isEmpty(requestRebuildVedioScene.getPanoId())){
+            throw new BaseRuntimeException(LoginConstant.FAILURE_CODE_3001, LoginConstant.FAILURE_MSG_3001);
+        }
+
+        String num = requestRebuildVedioScene.getSceneNum();
+
+        SceneProEntity sceneProEntity = sceneProService.findBySceneNum(num);
+
+        String path = "";
+        path = sceneProEntity.getDataSource();
+
+        //先从备份文件下拉取
+        CreateObjUtil.ossUtilCp("video/video" +sceneProEntity.getNum()  + File.separator + "back" + File.separator,
+                sceneProEntity.getDataSource() + "_rv" + File.separator + "videoback_temp");
+
+        String backpathtemp = sceneProEntity.getDataSource() + "_rv" + File.separator + "videoback_temp";
+        File fileback = new File(backpathtemp);
+        File[] filebackList = fileback.listFiles();
+
+        if(filebackList.length<=0){
+            String backpath = sceneProEntity.getDataSource() + "_rv" + File.separator + "videoback";
+            log.info("------------------" +  backpath);
+
+            File file = new File(backpath);
+
+            //验证video 文件夹下是否有备份
+            CreateObjUtil.ossUtilCp("video/video" +sceneProEntity.getNum()  + File.separator,
+                    sceneProEntity.getDataSource() + "_rv" + File.separator + "videoback");
+
+            String name = "";
+            Map<String,String> map = new HashMap<String,String>();
+            file = new File(backpath);
+            File[] fileList = file.listFiles();
+            if(fileList.length>0){
+                for(File f:fileList){
+                    name = f.getName();
+                    log.info("file name :" + name);
+                    map.put(sceneProEntity.getDataSource() + "_rv" + File.separator + "videoback" + File.separator + name,
+                            "video/video" +sceneProEntity.getNum()  + File.separator + "back" + File.separator + name);
+
+                }
+            }
+            //上传
+            log.info("上传内容 ===== + " + map);
+            uploadToOssUtil.uploadMulFiles(map);
+            FileUtils.deleteDirectory(backpathtemp);
+        }
+
+
+        //更新旧记录
+        rebuildVideoProgressService.updateProgressRec(requestRebuildVedioScene);
+
+        //往文件中写入值
+        JSONObject reObject = new JSONObject();
+        JSONObject Object = new JSONObject();
+        Object.put("name",requestRebuildVedioScene.getPanoId());
+        Object.put("x",requestRebuildVedioScene.getX());
+        Object.put("y",requestRebuildVedioScene.getY());
+        Object.put("width",requestRebuildVedioScene.getW());
+        Object.put("height",requestRebuildVedioScene.getH());
+        JSONArray arrayRe = new JSONArray();
+        arrayRe.add(Object);
+        reObject.put("required_videos",arrayRe);
+
+        JSONObject hdrObject = new JSONObject();
+        if(StringUtils.isNotEmpty(sceneProEntity.getVideos())){
+            JSONObject object = JSONObject.parseObject(sceneProEntity.getVideos());
+            if(object.containsKey("data")){
+                JSONArray array = new JSONArray();
+                array = (JSONArray) object.get("data");
+                arrayRe = new JSONArray();
+                if(array.size()>0){
+                    for(int i = 0; i < array.size(); i++) {
+                        JSONObject obj = (JSONObject) array.get(i);
+                        Object = new JSONObject();
+                        Object.put("name",(String) obj.get("id"));
+                        Object.put("value",(String) obj.get("value"));
+                        Object.put("fov",(String) obj.get("blend_fov"));
+                        arrayRe.add(Object);
+                    }
+                    hdrObject.put("hdr_param",arrayRe);
+                }
+            }
+        }else{
+            hdrObject.put("hdr_param","{}");
+        }
+
+        //重新计算时需要删除文件夹,否知使用缓存
+        log.info("开始清除result");
+        FileUtils.delAllFile(path + File.separator + "results");
+        log.info("清除result结束");
+
+        String fileId = path.split("/")[path.split("/").length - 2];
+        log.info("fileId:" + fileId);
+
+        String parametr = "";
+        parametr += sceneProEntity.getNum() + ":;" +
+                requestRebuildVedioScene.getPanoId();
+
+        producer.sendMsg2(parametr);
+
+        long start = System.currentTimeMillis();
+
+        VideoSceneProgressEntity videoSceneProgressEntity = new VideoSceneProgressEntity();
+        videoSceneProgressEntity.setSceneCode(sceneProEntity.getNum());
+        videoSceneProgressEntity.setVideoName(requestRebuildVedioScene.getPanoId());
+        videoSceneProgressEntity.setDataSource(sceneProEntity.getDataSource());
+        videoSceneProgressEntity.setRebuildResult(2);
+        videoSceneProgressEntity.setDataSource(sceneProEntity.getDataSource());
+        videoSceneProgressEntity.setRebuildQueueStartTime(new Date());
+        videoSceneProgressEntity.setHdrParam(hdrObject.toJSONString());
+        videoSceneProgressEntity.setRebuildParam(reObject.toJSONString());
+        rebuildVideoProgressService.save(videoSceneProgressEntity);
+
+        return Result.success("视频场景计算中");
+    }
+
+
     /**
      * 查看场景对应的数据路径
      */