Prechádzať zdrojové kódy

Merge branch 'feature-增加上传人工计算结果接口(刘强需要)-dsx' into release

dengsixing 11 mesiacov pred
rodič
commit
d97bec9390

+ 49 - 0
src/main/java/com/fdkankan/contro/controller/InnerController.java

@@ -0,0 +1,49 @@
+package com.fdkankan.contro.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.common.constant.ModelingBuildStatus;
+import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.contro.service.IAppCameraFailLogService;
+import com.fdkankan.contro.service.IInnerService;
+import com.fdkankan.contro.service.ISceneFileBuildService;
+import com.fdkankan.contro.service.ISceneUploadCountService;
+import com.fdkankan.contro.vo.ReportFailLogVO;
+import com.fdkankan.contro.vo.ResponseSceneFile;
+import com.fdkankan.contro.vo.SceneUploadCountParamVO;
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
+import com.fdkankan.rabbitmq.bean.BuildSceneResultMqMessage;
+import com.fdkankan.web.response.ResultData;
+import lombok.extern.log4j.Log4j2;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 场景文件上传模块
+ */
+@Log4j2
+@RestController
+@RequestMapping("/api/inner")
+public class InnerController {
+
+    @Autowired
+    private IInnerService innerService;
+
+    @GetMapping("uploadArtificialResult")
+    public ResultData uploadArtificialResult(String num) throws Exception {
+        innerService.uploadArtificialResult(num);
+        return ResultData.ok();
+    }
+
+
+}

+ 2 - 136
src/main/java/com/fdkankan/contro/mq/service/impl/BuildSceneServiceImpl.java

@@ -77,12 +77,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
     @Value("${model.type:#{null}}")
     private String modelType;
 
-    @Value("${model.modelKind:3dtiles}")
-    private String modelKind;
-
-    @Value("#{'${model.3dtiles.sceneSource:}'.split(',')}")
-    private List<Integer> sdTilesSceneSourceList;
-
     @Value("${env:gn}")
     private String env;
 
@@ -261,12 +255,12 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
                 buildSceneDTService.handModelFail("计算失败", message.getPath(), sceneCode, message.getHostName());
                 return;
             }
-            JSONObject fdageData = getFdageData(path + File.separator + "capture" +File.separator+"data.fdage");
+            JSONObject fdageData = commonService.getFdageData(path + File.separator + "capture" +File.separator+"data.fdage");
 
             ScenePlus scenePlus = scenePlusService.getScenePlusByNum(sceneCode);
 
             Integer cameraType = Integer.parseInt(message.getBuildContext().get("cameraType").toString());
-            Map<String, String> uploadFiles = getUploadFiles(scenePlus,path,cameraType,fdageData);
+            Map<String, String> uploadFiles = commonService.getUploadFiles(scenePlus,path,cameraType,fdageData);
 
             scenePlus.setPayStatus(PayStatus.PAY.code());
             scenePlus.setUpdateTime(new Date());
@@ -422,135 +416,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
 //        });
 //    }
 
-    private Map<String, String> getUploadFiles(ScenePlus scenePlus,String path,Integer cameraType,JSONObject fdageData) throws Exception {
-        if (ObjectUtils.isEmpty(scenePlus)) {
-            throw new Exception("未找到场景信息:" + path);
-        }
-
-        String projectNum = scenePlus.getNum();
-
-        String dataViewPath = String.format(UploadFilePath.DATA_VIEW_PATH, projectNum);
-        String imagesPath = String.format(UploadFilePath.IMG_VIEW_PATH, projectNum);
-        String videoPath = String.format(UploadFilePath.VIDEOS_VIEW_PATH, projectNum);
-        String resultsPath = path + File.separator + "results" + File.separator;
-
-        String uploadData = FileUtils.readFile(resultsPath + "upload.json");
-        JSONArray array = JSONObject.parseObject(uploadData).getJSONArray("upload");
-
-        JSONObject fileJson = null;
-        String fileName = "";
-
-        Map<String, String> map = new HashMap();
-
-        for (int i = 0; i < array.size(); ++i) {
-            fileJson = array.getJSONObject(i);
-            fileName = fileJson.getString("file");
-            String filePath = resultsPath + fileName;
 
-            if (!(new File(filePath)).exists()) {
-                throw new Exception(filePath + "文件不存在");
-            }
-
-            if ("vision2.txt".equals(fileName)) {
-                CreateObjUtil.convertTxtToVisionmodeldata(resultsPath + "vision2.txt", resultsPath + "vision2.modeldata");
-                map.put(resultsPath + "vision2.modeldata", imagesPath + "vision2.modeldata");
-                map.put(resultsPath + "vision2.txt", imagesPath + "vision2.txt");
-            }
-
-            if (fileJson.getIntValue("clazz") == 2) {
-                map.put(filePath, imagesPath + ConstantFileName.modelUUID + "_50k_texture_jpg_high1/" + fileName.replace("tex/", ""));
-            } else if (fileJson.getIntValue("clazz") == 3) {
-                map.put(filePath, imagesPath + "pan/high/" + fileName.replace("high/", ""));
-            } else if (fileJson.getIntValue("clazz") == 4) {
-                map.put(filePath, imagesPath + "pan/low/" + fileName.replace("low/", ""));
-            } else if (fileJson.getIntValue("clazz") == 5) {
-                map.put(filePath, imagesPath + fileName);
-            } else if (fileJson.getIntValue("clazz") == 7) {
-                map.put(filePath, imagesPath + fileName);
-            } else if (fileJson.getIntValue("clazz") == 10) {
-                String updown = FileUtils.readFile(filePath);
-                JSONObject updownJson = JSONObject.parseObject(updown);
-                String mappingOssPath = String.format("scene_edit_data/%s/data/", projectNum) + fileName.replace("updown", "mapping");
-                map.put(filePath, mappingOssPath);
-            } else {
-                if (fileJson.getIntValue("clazz") == 11 || fileJson.getIntValue("clazz") == 12) {
-                    map.put(filePath, videoPath + fileName.replace("videos/", ""));
-                    if (fileName.contains(".mp4")) {
-                        map.put(resultsPath + fileName.replace("mp4", "flv"), videoPath + fileName.replace("videos/", "").replace("mp4", "flv"));
-                    }
-                }
-
-                if (fileJson.getIntValue("clazz") == 16) {
-                    map.put(filePath, dataViewPath + fileName);
-                }
-
-                if (fileJson.getIntValue("clazz") == 18) {
-                    map.put(filePath, imagesPath + fileName);
-                }
-            }
-        }
-
-        //exportMeshObj这个是字段由app写入的
-        boolean genModel = true;//是否生成模型 默认生成,深时场景要根据 exportMeshObj判断是否生成
-        if(!ObjectUtils.isEmpty(cameraType)
-                && cameraType == 14
-                && (!fdageData.containsKey("exportMeshObj") || fdageData.getIntValue("exportMeshObj") != 1)){
-            genModel = false;
-        }
-        boolean gen3dTiles = true;//是否生成3dtiles模型 默认生成
-        if(!ModelKind.THREE_D_TILE.code().equals(modelKind)
-                || CollUtil.isEmpty(sdTilesSceneSourceList)
-                || !sdTilesSceneSourceList.contains(scenePlus.getSceneSource())){
-            gen3dTiles = false;
-        }
-
-        if(genModel){
-            if (!gen3dTiles) {
-                String damPath = path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam";
-                CreateObjUtil.convertTxtToDam(path + File.separator + "results" + File.separator + "tex" + File.separator + "modeldata.txt", damPath);
-                FileUtil.writeBytes(ZipUtil.gzip(new File(damPath)), damPath);
-                map.put(damPath, imagesPath + ConstantFileName.modelUUID + "_50k.dam");
-            }else{
-                List<String> list = FileUtils.list(new File(path + File.separator + "results" + File.separator + ModelKind.THREE_D_TILE.code()));
-                if(CollUtil.isEmpty(list)){
-                    log.error("3dtiles目录异常,3dtiles地址:{}", new File(path + File.separator + "results" + File.separator + ModelKind.THREE_D_TILE.code()));
-                    throw new Exception("3dtiles目录异常");
-                }
-                list.stream().forEach(str->{
-                    map.put(str, str.replace(path + File.separator + "results" + File.separator, imagesPath));
-                });
-            }
-        }
-
-        CreateObjUtil.convertTxtToVisionmodeldata(resultsPath + "vision.txt", resultsPath + "vision.modeldata");
-        map.put(resultsPath + "vision.txt", imagesPath + "vision.txt");
-        map.put(resultsPath + "vision.modeldata", imagesPath + "vision.modeldata");
-
-        log.info("数据转换完成:" + projectNum);
-        if(!new File("/mnt/4Dkankan/scene/data" + File.separator + "data" + projectNum).exists()){
-            FileUtil.mkdir("/mnt/4Dkankan/scene/data" + File.separator + "data" + projectNum);
-        }
-//        map.put(resultsPath + "floorplan.json", dataViewPath + "floor.json");
-        map.put(resultsPath + "floorplan_cad.json", dataViewPath + "floorplan_cad.json");
-        map.put(path + File.separator + "capture/stitch_params.txt", dataViewPath + "stitch_params.txt");
-        map.put(path + File.separator + "capture/Up.xml", dataViewPath + "Up.xml");
-        map.put(path + File.separator + "capture/Up2.xml", dataViewPath + "Up2.xml");
-        map.put(path + File.separator + "capture/Up.txt", dataViewPath + "Up.txt");
-        map.put(path + File.separator + "capture/Up2.txt", dataViewPath + "Up2.txt");
-        return map;
-
-    }
-
-    private JSONObject getFdageData(String dataFdagePath) {
-        log.info("dataFdagePath 文件路径 :{}", dataFdagePath);
-        String data = FileUtils.readFile(dataFdagePath);
-        //获取data.fdage的内容
-        JSONObject dataJson = new JSONObject();
-        if(data!=null){
-            dataJson = JSONObject.parseObject(data);
-        }
-        return dataJson;
-    }
 
     private void uploadFloorCad(String path, String num, Map<String, String> uploadFiles){
 

+ 4 - 0
src/main/java/com/fdkankan/contro/service/ICommonService.java

@@ -54,4 +54,8 @@ public interface ICommonService {
     void removeSceneAsynOperLog(String num);
 
     JSONObject getVideosJson(String path, Integer videoVersion, String projectNum, int cameraType);
+
+    JSONObject getFdageData(String path);
+
+    Map<String, String> getUploadFiles(ScenePlus scenePlus,String path,Integer cameraType,JSONObject fdageData) throws Exception;
 }

+ 7 - 0
src/main/java/com/fdkankan/contro/service/IInnerService.java

@@ -0,0 +1,7 @@
+package com.fdkankan.contro.service;
+
+public interface IInnerService {
+
+    void uploadArtificialResult(String num) throws Exception;
+
+}

+ 143 - 6
src/main/java/com/fdkankan/contro/service/impl/CommonServiceImpl.java

@@ -3,18 +3,16 @@ package com.fdkankan.contro.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.util.ZipUtil;
 import cn.hutool.http.HttpUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.common.constant.*;
 import com.fdkankan.common.util.FileUtils;
 import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.fdkankan.common.constant.CommonStatus;
-import com.fdkankan.common.constant.PayStatus;
-import com.fdkankan.common.constant.SceneStatus;
-import com.fdkankan.common.constant.SpaceType;
 import com.fdkankan.common.util.FileUtils;
 import com.fdkankan.contro.bean.SceneJsonBean;
 import com.fdkankan.contro.entity.*;
@@ -26,8 +24,10 @@ import com.fdkankan.contro.vo.SceneEditControlsVO;
 import com.fdkankan.contro.vo.ScenePlusVO;
 import com.fdkankan.fyun.config.FYunFileConfig;
 import com.fdkankan.fyun.face.FYunFileServiceInterface;
+import com.fdkankan.model.constants.ConstantFileName;
 import com.fdkankan.model.constants.ConstantFilePath;
 import com.fdkankan.model.constants.UploadFilePath;
+import com.fdkankan.model.utils.CreateObjUtil;
 import com.fdkankan.model.utils.FloorPlanUserUtil;
 import com.fdkankan.rabbitmq.bean.BuildSceneCallMessage;
 import com.fdkankan.rabbitmq.util.RabbitMqProducer;
@@ -73,10 +73,15 @@ public class CommonServiceImpl implements ICommonService {
 
     @Value("#{'${camType.laser:}'.split(',')}")
     private List<Integer> laserCamTypeList;
-    @Autowired
-    private ISceneAsynOperLogService sceneAsynOperLogService;
 
+    @Value("${model.modelKind:3dtiles}")
+    private String modelKind;
+
+    @Value("#{'${model.3dtiles.sceneSource:}'.split(',')}")
+    private List<Integer> sdTilesSceneSourceList;
 
+    @Autowired
+    private ISceneAsynOperLogService sceneAsynOperLogService;
     @Resource
     private FYunFileServiceInterface fYunFileServiceInterface;
     @Autowired
@@ -626,4 +631,136 @@ public class CommonServiceImpl implements ICommonService {
 
         return videosJson;
     }
+
+    @Override
+    public JSONObject getFdageData(String dataFdagePath) {
+        log.info("dataFdagePath 文件路径 :{}", dataFdagePath);
+        String data = FileUtils.readFile(dataFdagePath);
+        //获取data.fdage的内容
+        JSONObject dataJson = new JSONObject();
+        if(data!=null){
+            dataJson = JSONObject.parseObject(data);
+        }
+        return dataJson;
+    }
+
+    @Override
+    public Map<String, String> getUploadFiles(ScenePlus scenePlus,String path,Integer cameraType,JSONObject fdageData) throws Exception {
+        if (ObjectUtils.isEmpty(scenePlus)) {
+            throw new Exception("未找到场景信息:" + path);
+        }
+
+        String projectNum = scenePlus.getNum();
+
+        String dataViewPath = String.format(UploadFilePath.DATA_VIEW_PATH, projectNum);
+        String imagesPath = String.format(UploadFilePath.IMG_VIEW_PATH, projectNum);
+        String videoPath = String.format(UploadFilePath.VIDEOS_VIEW_PATH, projectNum);
+        String resultsPath = path + File.separator + "results" + File.separator;
+
+        String uploadData = FileUtils.readFile(resultsPath + "upload.json");
+        JSONArray array = JSONObject.parseObject(uploadData).getJSONArray("upload");
+
+        JSONObject fileJson = null;
+        String fileName = "";
+
+        Map<String, String> map = new HashMap();
+
+        for (int i = 0; i < array.size(); ++i) {
+            fileJson = array.getJSONObject(i);
+            fileName = fileJson.getString("file");
+            String filePath = resultsPath + fileName;
+
+            if (!(new File(filePath)).exists()) {
+                throw new Exception(filePath + "文件不存在");
+            }
+
+            if ("vision2.txt".equals(fileName)) {
+                CreateObjUtil.convertTxtToVisionmodeldata(resultsPath + "vision2.txt", resultsPath + "vision2.modeldata");
+                map.put(resultsPath + "vision2.modeldata", imagesPath + "vision2.modeldata");
+                map.put(resultsPath + "vision2.txt", imagesPath + "vision2.txt");
+            }
+
+            if (fileJson.getIntValue("clazz") == 2) {
+                map.put(filePath, imagesPath + ConstantFileName.modelUUID + "_50k_texture_jpg_high1/" + fileName.replace("tex/", ""));
+            } else if (fileJson.getIntValue("clazz") == 3) {
+                map.put(filePath, imagesPath + "pan/high/" + fileName.replace("high/", ""));
+            } else if (fileJson.getIntValue("clazz") == 4) {
+                map.put(filePath, imagesPath + "pan/low/" + fileName.replace("low/", ""));
+            } else if (fileJson.getIntValue("clazz") == 5) {
+                map.put(filePath, imagesPath + fileName);
+            } else if (fileJson.getIntValue("clazz") == 7) {
+                map.put(filePath, imagesPath + fileName);
+            } else if (fileJson.getIntValue("clazz") == 10) {
+                String updown = FileUtils.readFile(filePath);
+                JSONObject updownJson = JSONObject.parseObject(updown);
+                String mappingOssPath = String.format("scene_edit_data/%s/data/", projectNum) + fileName.replace("updown", "mapping");
+                map.put(filePath, mappingOssPath);
+            } else {
+                if (fileJson.getIntValue("clazz") == 11 || fileJson.getIntValue("clazz") == 12) {
+                    map.put(filePath, videoPath + fileName.replace("videos/", ""));
+                    if (fileName.contains(".mp4")) {
+                        map.put(resultsPath + fileName.replace("mp4", "flv"), videoPath + fileName.replace("videos/", "").replace("mp4", "flv"));
+                    }
+                }
+
+                if (fileJson.getIntValue("clazz") == 16) {
+                    map.put(filePath, dataViewPath + fileName);
+                }
+
+                if (fileJson.getIntValue("clazz") == 18) {
+                    map.put(filePath, imagesPath + fileName);
+                }
+            }
+        }
+
+        //exportMeshObj这个是字段由app写入的
+        boolean genModel = true;//是否生成模型 默认生成,深时场景要根据 exportMeshObj判断是否生成
+        if(!ObjectUtils.isEmpty(cameraType)
+                && cameraType == 14
+                && (!fdageData.containsKey("exportMeshObj") || fdageData.getIntValue("exportMeshObj") != 1)){
+            genModel = false;
+        }
+        boolean gen3dTiles = true;//是否生成3dtiles模型 默认生成
+        if(!ModelKind.THREE_D_TILE.code().equals(modelKind)
+                || CollUtil.isEmpty(sdTilesSceneSourceList)
+                || !sdTilesSceneSourceList.contains(scenePlus.getSceneSource())){
+            gen3dTiles = false;
+        }
+
+        if(genModel){
+            if (!gen3dTiles) {
+                String damPath = path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam";
+                CreateObjUtil.convertTxtToDam(path + File.separator + "results" + File.separator + "tex" + File.separator + "modeldata.txt", damPath);
+                FileUtil.writeBytes(ZipUtil.gzip(new File(damPath)), damPath);
+                map.put(damPath, imagesPath + ConstantFileName.modelUUID + "_50k.dam");
+            }else{
+                List<String> list = FileUtils.list(new File(path + File.separator + "results" + File.separator + ModelKind.THREE_D_TILE.code()));
+                if(CollUtil.isEmpty(list)){
+                    log.error("3dtiles目录异常,3dtiles地址:{}", new File(path + File.separator + "results" + File.separator + ModelKind.THREE_D_TILE.code()));
+                    throw new Exception("3dtiles目录异常");
+                }
+                list.stream().forEach(str->{
+                    map.put(str, str.replace(path + File.separator + "results" + File.separator, imagesPath));
+                });
+            }
+        }
+
+        CreateObjUtil.convertTxtToVisionmodeldata(resultsPath + "vision.txt", resultsPath + "vision.modeldata");
+        map.put(resultsPath + "vision.txt", imagesPath + "vision.txt");
+        map.put(resultsPath + "vision.modeldata", imagesPath + "vision.modeldata");
+
+        log.info("数据转换完成:" + projectNum);
+        if(!new File("/mnt/4Dkankan/scene/data" + File.separator + "data" + projectNum).exists()){
+            FileUtil.mkdir("/mnt/4Dkankan/scene/data" + File.separator + "data" + projectNum);
+        }
+//        map.put(resultsPath + "floorplan.json", dataViewPath + "floor.json");
+        map.put(resultsPath + "floorplan_cad.json", dataViewPath + "floorplan_cad.json");
+        map.put(path + File.separator + "capture/stitch_params.txt", dataViewPath + "stitch_params.txt");
+        map.put(path + File.separator + "capture/Up.xml", dataViewPath + "Up.xml");
+        map.put(path + File.separator + "capture/Up2.xml", dataViewPath + "Up2.xml");
+        map.put(path + File.separator + "capture/Up.txt", dataViewPath + "Up.txt");
+        map.put(path + File.separator + "capture/Up2.txt", dataViewPath + "Up2.txt");
+        return map;
+
+    }
 }

+ 339 - 0
src/main/java/com/fdkankan/contro/service/impl/InnerServiceImpl.java

@@ -0,0 +1,339 @@
+package com.fdkankan.contro.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.http.ContentType;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.common.constant.*;
+import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.common.util.FileUtils;
+import com.fdkankan.contro.bean.SyncLaserResultBean;
+import com.fdkankan.contro.constant.UserEditDataType;
+import com.fdkankan.contro.entity.*;
+import com.fdkankan.contro.service.*;
+import com.fdkankan.fyun.config.FYunFileConfig;
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
+import com.fdkankan.model.constants.ConstantFileName;
+import com.fdkankan.model.constants.ConstantFilePath;
+import com.fdkankan.model.constants.UploadFilePath;
+import com.fdkankan.model.enums.ModelTypeEnums;
+import com.fdkankan.model.utils.CreateHouseJsonUtil;
+import com.fdkankan.model.utils.SceneUtil;
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.http.HttpHeaders;
+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.io.IOException;
+import java.util.*;
+
+@Service
+public class InnerServiceImpl implements IInnerService {
+
+    @Value("${model.type:#{null}}")
+    private String modelType;
+
+    @Autowired
+    private IScenePlusService scenePlusService;
+    @Autowired
+    private IScenePlusExtService scenePlusExtService;
+    @Autowired
+    private ICommonService commonService;
+    @Resource
+    private FYunFileServiceInterface fYunFileService;
+    @Autowired
+    private IFdkkLaserService fdkkLaserService;
+    @Autowired
+    private ICameraDetailService cameraDetailService;
+    @Autowired
+    private ICompanyService companyService;
+    @Resource
+    private FYunFileConfig fYunFileConfig;
+
+    @Override
+    public void uploadArtificialResult(String num) throws Exception {
+
+        ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
+        if(Objects.isNull(scenePlus)){
+            throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
+        }
+        ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
+
+        String path = scenePlusExt.getDataSource();
+
+        JSONObject fdageData = commonService.getFdageData(path + File.separator + "capture" +File.separator+"data.fdage");
+
+        Integer cameraType = 10;
+        if(scenePlus.getSceneSource() == SceneSource.ZT.code()){
+            cameraType = 13;
+        }else{
+            cameraType = 14;
+        }
+
+        Map<String, String> uploadFiles = commonService.getUploadFiles(scenePlus,path,cameraType,fdageData);
+
+        scenePlus.setPayStatus(PayStatus.PAY.code());
+        scenePlus.setUpdateTime(new Date());
+        scenePlus.setSceneStatus(SceneStatus.NO_DISPLAY.code());
+
+        Integer videoVersion = fdageData.getInteger("videoVersion");
+        //读取计算结果文件生成videosJson
+        JSONObject videosJson = commonService.getVideosJson(path, videoVersion, num, cameraType);
+
+        boolean isObj = fdageData.containsKey("exportMeshObj") && fdageData.getIntValue("exportMeshObj") == 1;
+
+        //上传全景图俯视图
+        this.uploadFloorCad(path, num, uploadFiles);
+
+        //由于3dtiles算法mesh文件发生变化,所以这里需要先清除一下oss的mesh目录,避免存在旧算法obj文件
+        fYunFileService.deleteFolder(String.format(UploadFilePath.DATA_VIEW_PATH, num) + "mesh");
+        fYunFileService.deleteFolder(String.format(UploadFilePath.IMG_VIEW_PATH,  num) + ModelKind.THREE_D_TILE.code());
+        //上传文件
+        fYunFileService.uploadMulFiles(uploadFiles);
+
+        //修改oss上dam的内容编码
+        Map<String,String> damFileHeaders = new HashMap<>();
+        damFileHeaders.put("Content-Encoding","gzip");
+        String damPath = path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam";
+        fYunFileService.uploadFile(damPath,  String.format(UploadFilePath.IMG_VIEW_PATH, num) + ConstantFileName.modelUUID + "_50k.dam", damFileHeaders);
+
+        //拷贝部分文件到编辑目录,用于用户编辑
+        this.copyToEditDir(num);
+
+        //计算完毕后,同步全景图到缓存目录
+//            this.cachePanorama(path, sceneCode);
+
+        //生成houseTypejson并上传
+        boolean existHouseType = this.uploadHouseTypeJson(num, path);
+        scenePlus.setHouseType(existHouseType ? CommonStatus.YES.code().intValue() : CommonStatus.NO.code().intValue());
+
+        //生成floorpan.json
+        commonService.uploadFloorplanJson(num, path);
+
+        //重置异步操作记录
+        commonService.removeSceneAsynOperLog(num);
+
+        //清除用户编辑业务数据
+        Set<String> bizs = new HashSet<>();
+        bizs.add(UserEditDataType.BOX_MODEL.message());
+        bizs.add(UserEditDataType.FLOORPLAN.message());
+        bizs.add(UserEditDataType.FILTERS.message());
+        commonService.initUserEditData(num, bizs, null);
+
+        //上传计算结果文件
+        commonService.uploadBuildResultData(num, path, SceneVersionType.V4.code());
+
+        //容量统计
+        Long space = commonService.getSpace(num);
+
+        //写入数据库
+        this.updateDbPlus(scenePlus.getSceneSource(), space, videosJson.toJSONString(), 0L,isObj,scenePlusExt);
+
+        Object[] editInfoArr = commonService.updateEditInfo(scenePlus);
+        SceneEditInfo sceneEditInfo = (SceneEditInfo)editInfoArr[0];
+        SceneEditInfoExt sceneEditInfoExt = (SceneEditInfoExt)editInfoArr[1];
+        SceneEditControls sceneEditControls = (SceneEditControls)editInfoArr[2];
+
+        //更新场景主表
+        //如果相机容量不足,需要把场景的paystatus改为容量不足状态
+        scenePlus.setPayStatus(commonService.getPayStatus(scenePlus.getCameraId(), space));
+        //统计原始资源大小
+        scenePlusExt.setOrigSpace(FileUtil.size(new File(path.concat(File.separator).concat("capture"))));
+
+        if (cameraType == 14) {
+            //计算成功  激光转台相机 同步 请求
+            fdkkLaserService.syncBuildResult(
+                    SyncLaserResultBean.builder()
+                            .num(num).dataSource(path)
+                            .sceneStatus(2)
+                            .createTime(scenePlus.getCreateTime())
+                            .shootCount(scenePlusExt.getShootCount())
+                            .payStatus(scenePlus.getPayStatus())
+                            .mixture(scenePlusExt.getMixture())
+                            .version(SceneVersionType.V4.code()).build());
+            sceneEditControls.setShowMap(0);
+        } else if (new File(path + "/results/laserData/vision_edit.txt").exists()) {
+            fdkkLaserService.cloudPointBuild(num,path);
+        }
+
+
+        CameraDetail cameraDetail = cameraDetailService.getByCameraId(scenePlus.getCameraId());
+        Company company = !ObjectUtils.isEmpty(cameraDetail.getCompanyId()) ? companyService.getById(cameraDetail.getCompanyId()) : null;
+        //写scene.json
+        commonService.writeSceneJson(num,sceneEditInfo, sceneEditInfoExt, sceneEditControls, scenePlus,scenePlusExt,company);
+
+        this.uploadStatusJson(scenePlus, scenePlusExt);
+
+        scenePlusService.updateById(scenePlus);
+        scenePlusExtService.updateById(scenePlusExt);
+    }
+
+    private void uploadStatusJson(ScenePlus scenePlus, ScenePlusExt scenePlusExt){
+        String num = scenePlus.getNum();
+        String dataViewPath = String.format(UploadFilePath.DATA_VIEW_PATH, num);
+
+        Integer status = 1;
+        if(scenePlus.getSceneSource() == 4 || scenePlus.getSceneSource() == 5){//如果是激光场景,需要激光系统那边完全处理好之后再发mq通知更新状态
+            status = 0;
+        }
+
+        // 上传status JSON.
+        JSONObject statusJson = new JSONObject();
+        //临时将-2改成1,app还没完全更新
+        statusJson.put("status", status);
+        statusJson.put("webSite", scenePlusExt.getWebSite());
+        statusJson.put("sceneNum", num);
+        statusJson.put("thumb", scenePlusExt.getThumb());
+        statusJson.put("payStatus", scenePlus.getPayStatus());
+        statusJson.put("sceneScheme", scenePlusExt.getSceneScheme());
+        FileUtils.writeFile(ConstantFilePath.SCENE_PATH + "data/data" + num + File.separator + "status.json", statusJson.toString());
+
+        Map<String,String> headers = new HashMap<>();
+        headers.put(HttpHeaders.CONTENT_TYPE, ContentType.JSON.getValue());
+        fYunFileService.uploadFile(ConstantFilePath.SCENE_PATH + "data/data" + num + File.separator + "status.json", dataViewPath + "status.json", headers);
+    }
+
+    private void uploadFloorCad(String path, String num, Map<String, String> uploadFiles){
+
+        //户型图上传
+        String  dataViewPath = UploadFilePath.DATA_VIEW_PATH + "floor-cad-%s.%s";
+        String floorCadPath = path + "/results/floorplan_cad";
+        List<String> floorCadList = FileUtils.getFileList(floorCadPath);
+        if(CollUtil.isNotEmpty(floorCadList)){
+            floorCadList.stream().forEach(str->{
+                String substring = str.substring(str.lastIndexOf(File.separator) + 1);
+                String[] arr = substring.split("floor");
+                String[] arr2 = arr[1].split("\\.");
+                uploadFiles.put(str, String.format(dataViewPath, num, arr2[0], arr2[1]));
+            });
+        }
+
+    }
+
+    private void copyToEditDir(String num) throws IOException {
+
+        String editImagesPath = String.format(UploadFilePath.IMG_EDIT_PATH, num);
+        String viewImagesPath = String.format(UploadFilePath.IMG_VIEW_PATH, num);
+
+        String editDataPath = String.format(UploadFilePath.DATA_EDIT_PATH, num);
+        String viewDataPath = String.format(UploadFilePath.DATA_VIEW_PATH, num);
+
+        Map<String, String> map = new HashMap<>();
+        map.put(editImagesPath + "vision.modeldata", viewImagesPath + "vision.modeldata");
+        map.put(editImagesPath + "vision2.modeldata", viewImagesPath + "vision2.modeldata");
+        map.put(editDataPath + "floorplan_cad.json", viewDataPath + "floorplan_cad.json");
+
+        for (Map.Entry<String, String> entry : map.entrySet()) {
+            fYunFileService.copyFileInBucket(entry.getValue(), entry.getKey());
+        }
+    }
+
+    public boolean uploadHouseTypeJson(String num, String dataSource) {
+        String floorPlanCardFilePath = dataSource + File.separator + "results/floorplan_cad.json";
+        if (!new File(floorPlanCardFilePath).exists()) {
+            return false;
+        }
+        JSONObject json = CreateHouseJsonUtil.createHouseTypeJsonByCad(floorPlanCardFilePath);
+        if(Objects.isNull(json)){
+            return false;
+        }
+        String hourseTypeJsonPath = String.format(UploadFilePath.USER_VIEW_PATH, num) + "houseType.json";
+        fYunFileService.uploadFile(json.toJSONString().getBytes(), hourseTypeJsonPath);
+        hourseTypeJsonPath = String.format(UploadFilePath.USER_EDIT_PATH, num) + "houseType.json";
+        fYunFileService.uploadFile(json.toJSONString().getBytes(), hourseTypeJsonPath);
+
+        return true;
+    }
+
+    private void updateDbPlus(int sceneSource,Long space,String videosJson, Long computeTime,boolean isObj,ScenePlusExt scenePlusExt){
+
+        scenePlusExt.setSpace(space);
+        scenePlusExt.setComputeTime(computeTime.toString());
+        scenePlusExt.setAlgorithmTime(new Date());
+        scenePlusExt.setVideos(videosJson);
+        scenePlusExt.setIsObj(isObj ? 1 : 0);
+
+        if(ModelTypeEnums.TILE_CODE.equals(modelType)){
+            scenePlusExt.setSceneScheme(3);
+        }
+
+        switch (SceneSource.get(sceneSource)){
+            case BM:
+                scenePlusExt.setSceneResolution(SceneResolution.two_K.code());
+                scenePlusExt.setSceneFrom(SceneFrom.PRO.code());
+                break;
+            case SM:
+                scenePlusExt.setSceneResolution(SceneResolution.one_k.code());
+                scenePlusExt.setSceneFrom(SceneFrom.LITE.code());
+                break;
+            case ZT:
+                scenePlusExt.setSceneResolution(SceneResolution.four_K.code());
+                scenePlusExt.setSceneFrom(SceneFrom.MINION.code());
+                break;
+            case JG:
+                scenePlusExt.setSceneResolution(SceneResolution.four_K.code());
+                scenePlusExt.setSceneFrom(SceneFrom.LASER.code());
+                break;
+            case SG:
+                scenePlusExt.setSceneResolution(SceneResolution.four_K.code());
+                scenePlusExt.setSceneFrom(SceneFrom.LASER.code());
+                break;
+        }
+
+        String sceneKind = scenePlusExt.getSceneScheme() == 3 ? SceneKind.FACE.code():SceneKind.TILES.code();
+        scenePlusExt.setSceneKind(sceneKind);
+//        scenePlusExt.setModelKind(modelKind);
+
+        //统计点位数量
+        Map<String, Integer> result = this.getShootCount(scenePlusExt);
+        Integer shootCount = result.get("shootCount");
+        Integer mixture = result.get("mixture");
+        scenePlusExt.setShootCount(shootCount);
+        scenePlusExt.setMixture(mixture);
+
+        scenePlusExtService.updateById(scenePlusExt);
+    }
+
+    private Map<String, Integer> getShootCount(ScenePlusExt scenePlusExt){
+
+        Map<String, Integer> result = new HashMap<>();
+
+        Integer shootCount = 0;
+        Integer mixture = Objects.isNull(scenePlusExt.getMixture()) ? 0 : scenePlusExt.getMixture();
+        String homePath = SceneUtil.getHomePath(scenePlusExt.getDataSource());
+        JSONObject dataFdageObj = JSON.parseObject(fYunFileService.getFileContent(homePath.concat("data.fdage")));
+        if(Objects.nonNull(dataFdageObj)){
+            JSONArray points = dataFdageObj.getJSONArray("points");
+            if(CollUtil.isNotEmpty(points)){
+                shootCount = points.size();
+            }
+        }
+        if(Objects.nonNull(shootCount) && shootCount > 0){
+            if(Objects.nonNull(scenePlusExt.getLocation()) && scenePlusExt.getLocation() == 6){
+                mixture = CommonStatus.YES.code().intValue();
+            }
+        }else{
+            String slamDataStr = fYunFileService.getFileContent(homePath.concat("slam_data.json"));
+            JSONObject slamDataObj = JSON.parseObject(slamDataStr);
+            if(Objects.nonNull(slamDataObj)){
+                JSONArray viewsInfo = slamDataObj.getJSONArray("views_info");
+                if(CollUtil.isNotEmpty(viewsInfo)){
+                    shootCount = viewsInfo.stream().mapToInt(info -> {
+                        return  ((JSONObject) info).getJSONArray("list_pose").size();
+                    }).sum();
+                }
+            }
+            mixture = CommonStatus.NO.code().intValue();
+        }
+
+        result.put("shootCount", shootCount);
+        result.put("mixture", mixture);
+
+        return result;
+    }
+}