dsx 2 роки тому
батько
коміт
de4cd3e96b

+ 0 - 27
src/main/java/com/fdkankan/contro/bean/SceneJsonBean.java

@@ -77,16 +77,6 @@ public class SceneJsonBean {
      */
     private Date createTime;
 
-//    /**
-//     * 点位数量
-//     */
-//    private Integer panoCount;
-//
-//    /**
-//     * 球幕视频数量
-//     */
-//    private Integer videoCount;
-
     /**
      * 版本
      */
@@ -107,23 +97,6 @@ public class SceneJsonBean {
      */
     private Byte floorPlanUser;
 
-//    private String cadInfo;
-
-//    /**
-//     * 是否上传模型
-//     */
-//    private Byte isUploadObj;
-//
-//    /**
-//     * 重新建模的版本
-//     */
-//    private Integer floorEditVer;
-//
-//    /**
-//     * 正式发布重新建模的版本
-//     */
-//    private Integer floorPublishVer;
-
     /**
      * 初始点信息
      */

+ 9 - 5
src/main/java/com/fdkankan/contro/controller/TestController.java

@@ -1,6 +1,8 @@
 package com.fdkankan.contro.controller;
 
+import com.fdkankan.contro.service.IScene3dNumService;
 import com.fdkankan.web.response.ResultData;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -11,17 +13,19 @@ import org.springframework.web.bind.annotation.RestController;
  * </p>
  *
  * @author dengsixing
- * @since 2022/12/13
+ * @since 2022/12/12
  **/
 @RestController
 @RequestMapping("/test")
 public class TestController {
 
+    @Autowired
+    private IScene3dNumService scene3dNumService;
+
     @GetMapping("/test")
-    public ResultData test(){
-        String test = null;
-        test.equals("");
-        return ResultData.ok();
+    public ResultData test() throws Exception {
+        String s = scene3dNumService.generateSceneNum(1);
+        return ResultData.ok(s);
     }
 
 }

+ 3 - 0
src/main/java/com/fdkankan/contro/entity/Scene3dNum.java

@@ -37,6 +37,9 @@ public class Scene3dNum implements Serializable {
     @TableField("folder_name")
     private String folderName;
 
+    /**
+     * 记录的状态,A: 生效,I: 禁用
+     */
     @TableField("code")
     private String code;
 

+ 46 - 21
src/main/java/com/fdkankan/contro/mq/service/impl/BuildObjServiceImpl.java

@@ -1,7 +1,10 @@
 package com.fdkankan.contro.mq.service.impl;
 
+import cn.hutool.core.collection.CollUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.fdkankan.common.constant.CommonStatus;
+import com.fdkankan.common.constant.ModelKind;
 import com.fdkankan.common.util.FileUtils;
 import com.fdkankan.contro.entity.ScenePlus;
 import com.fdkankan.contro.entity.ScenePro;
@@ -24,6 +27,8 @@ import org.springframework.stereotype.Service;
 import org.springframework.util.ObjectUtils;
 
 import java.io.File;
+import java.util.List;
+import java.util.Objects;
 
 /**
  * <p>
@@ -43,7 +48,7 @@ public class BuildObjServiceImpl implements IBuildSceneService {
     @Value("${queue.modeling.obj.modeling-post}")
     private String queueObjModelingPost;
 
-    @Value("${model.modelKind:dam}")
+    @Value("${model.modelKind:3dtiles}")
     private String modelKind;
 
     @Autowired
@@ -134,6 +139,7 @@ public class BuildObjServiceImpl implements IBuildSceneService {
         String prevoisPath = message.getBuildContext().get("previousPath").toString();
         FileUtils.copyFile(prevoisPath + "/caches/reconstruction/final.bin", path + "/caches/reconstruction/final.bin", true);
         FileUtils.copyFile(prevoisPath + "/caches/reconstruction/chunk.json", path + "/caches/reconstruction/chunk.json", true);
+        FileUtils.copyFile(prevoisPath + "/caches/floor_group_fix.json", path + "/caches/floor_group_fix.json", true);
         FileUtils.copyDirectiory(prevoisPath + "/caches/images", path + "/caches/images");
 
         FileUtils.copyDirectiory(prevoisPath + "/caches/depthmap_csc", path + "/caches/depthmap_csc");
@@ -154,19 +160,40 @@ public class BuildObjServiceImpl implements IBuildSceneService {
         }
 
         String path = message.getPath();
-        String projectNum = message.getBuildContext().get("sceneNum").toString();
-
         String laserObjFilePath = path;
-        CreateObjUtil.convertTxtToDam(laserObjFilePath + File.separator + "results" + File.separator + "tex" + File.separator + "modeldata.txt", laserObjFilePath + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam");
-        CreateObjUtil.convertDamToLzma(laserObjFilePath + File.separator + "results/");
-        CreateObjUtil.convertTxtToDam(laserObjFilePath + File.separator + "results" + File.separator + "tex" + File.separator + "modeldata.txt", laserObjFilePath + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam");
-        File file = new File(laserObjFilePath + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam.lzma");
-        while (!file.exists()) {
-            Thread.sleep(60000);
+        String projectNum = message.getBuildContext().get("sceneNum").toString();
+        ScenePro scenePro = sceneProService.getByNum(projectNum);
+        String version = "v4";
+        String ossImagePath = String.format(UploadFilePath.IMG_VIEW_PATH,  projectNum);
+        //如果是微服务上线之前的存量场景且未生成过obj(未升级过),需要上传到v3的目录,在函数最后调用升级接口进行文件拷贝
+        if(Objects.nonNull(scenePro) && scenePro.getIsUpgrade() != CommonStatus.YES.code().intValue()){
+            ossImagePath = String.format(ConstantFilePath.IMAGE_PATH_FORMAT, projectNum);
+            version = "v3";
+        }
+        //上传obj
+        String resultsPath = path + File.separator + "results" + File.separator;
+        if(this.modelKind.equals(ModelKind.DAM.code())){
+            CreateObjUtil.convertTxtToDam(path + File.separator + "results" + File.separator + "tex" + File.separator + "modeldata.txt", path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam");
+            CreateObjUtil.convertDamToLzma(path + File.separator + "results/");
+            CreateObjUtil.convertTxtToDam(path + File.separator + "results" + File.separator + "tex" + File.separator + "modeldata.txt", path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam");
+            File file = new File(path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam.lzma");
+            while (!file.exists()) {
+                Thread.sleep(60000);
+            }
+            fYunFileService.uploadFile(path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam.lzma", ossImagePath + ConstantFileName.modelUUID + "_50k.dam.lzma");
+            fYunFileService.uploadFile(path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam", ossImagePath + ConstantFileName.modelUUID + "_50k.dam");
+        }
+        if(this.modelKind.equals(ModelKind.THREE_D_TILE.code())){
+            String threedtilesPath = resultsPath + ModelKind.THREE_D_TILE.code();
+            String oss3dtilesPath = ossImagePath + ModelKind.THREE_D_TILE.code();
+            List<String> list = FileUtils.list(new File(threedtilesPath));
+            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目录异常");
+            }
+            //上传3dtiles文件
+            fYunFileService.uploadFileByCommand(threedtilesPath, oss3dtilesPath);
         }
-
-        fYunFileService.uploadFile(laserObjFilePath + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam.lzma", String.format(UploadFilePath.IMG_VIEW_PATH,  projectNum) + ConstantFileName.modelUUID + "_50k.dam.lzma");
-        fYunFileService.uploadFile(laserObjFilePath + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam", String.format(UploadFilePath.IMG_VIEW_PATH,  projectNum) + ConstantFileName.modelUUID + "_50k.dam");
 
         String texPath = laserObjFilePath + File.separator + "results" + File.separator + "tex";
 
@@ -175,28 +202,24 @@ public class BuildObjServiceImpl implements IBuildSceneService {
             for (File textureFile : texFile.listFiles()) {
                 if(textureFile.getName().endsWith(".jpg")){
                     fYunFileService.uploadFile(textureFile.getAbsolutePath(),
-                            String.format(UploadFilePath.IMG_VIEW_PATH,  projectNum) + ConstantFileName.modelUUID + "_50k_texture_jpg_high1/"+textureFile.getName());
+                        ossImagePath + ConstantFileName.modelUUID + "_50k_texture_jpg_high1/"+textureFile.getName());
                 }
             }
         }
 
         fYunFileService.uploadFile(laserObjFilePath + File.separator + "results" + File.separator + "tex/texture1.jpg",
-                String.format(UploadFilePath.IMG_VIEW_PATH,  projectNum) + "/" + ConstantFileName.modelUUID + "_50k_texture_jpg_high1/texture1.jpg");
+                ossImagePath + ConstantFileName.modelUUID + "_50k_texture_jpg_high1/texture1.jpg");
 
         // 拷贝结果
         log.info("开始拷贝obj文件");
         FileUtils.copyFolderAllFiles(laserObjFilePath + "/results/mesh", laserObjFilePath + "/laserData/mesh/", true);
 
-        File meshFolder = new File(laserObjFilePath + "/results/mesh");
-
-        for (File meshFile : meshFolder.listFiles()) {
-            fYunFileService.uploadFile(meshFile.getAbsolutePath(), String.format(UploadFilePath.DATA_VIEW_PATH,  projectNum) + "mesh/" + meshFile.getName());
-        }
+        //上传mesh文件
+        fYunFileService.uploadFileByCommand(laserObjFilePath + "/results/mesh", String.format(UploadFilePath.DATA_VIEW_PATH,  projectNum) + "mesh");
 
         fdkkLaserService.pushBuildStatusToLaserSystem(projectNum, laserObjFilePath + "/laserData/mesh");
 
 
-        ScenePro scenePro = sceneProService.getByNum(projectNum);
         if(!ObjectUtils.isEmpty(scenePro)){
             LambdaUpdateWrapper<ScenePro> updateWrapper = new LambdaUpdateWrapper<ScenePro>()
                     .set(ScenePro::getStatus, -2).eq(ScenePro::getNum, projectNum);
@@ -213,7 +236,9 @@ public class BuildObjServiceImpl implements IBuildSceneService {
         }
 
         // 如果未升级V4,则升级V4
-        fdkkV4Service.upgradeToV4(projectNum);
+        if("v3".equals(version)){
+            fdkkV4Service.upgradeToV4(projectNum);
+        }
     }
 
 }

+ 30 - 12
src/main/java/com/fdkankan/contro/mq/service/impl/BuildSceneServiceImpl.java

@@ -19,7 +19,6 @@ import com.fdkankan.common.util.FileUtils;
 import com.fdkankan.contro.bean.SceneJsonBean;
 import com.fdkankan.contro.entity.*;
 import com.fdkankan.contro.mq.service.IBuildSceneService;
-import com.fdkankan.contro.service.ISceneAsynOperLogService;
 import com.fdkankan.contro.service.*;
 import com.fdkankan.contro.vo.SceneEditControlsVO;
 import com.fdkankan.fyun.config.FYunFileConfig;
@@ -74,7 +73,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
     @Value("${model.type:#{null}}")
     private String modelType;
 
-    @Value("${model.modelKind:dam}")
+    @Value("${model.modelKind:3dtiles}")
     private String modelKind;
 
     @Autowired
@@ -259,16 +258,18 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
             //上传全景图俯视图
             this.uploadFloorCad(path, sceneCode, uploadFiles);
 
-            //上传文件
             log.info("开始上传场景计算结果数据,num:{}", sceneCode);
+            //由于3dtiles算法mesh文件发生变化,所以这里需要先清除一下oss的mesh目录,避免存在旧算法obj文件
+            fYunFileService.deleteFolder(String.format(UploadFilePath.DATA_VIEW_PATH, sceneCode) + "mesh");
+            //上传文件
             fYunFileService.uploadMulFiles(uploadFiles);
 
             Map<String,String> damFileHeaders = new HashMap<>();
             damFileHeaders.put("Content-Encoding","gzip");
-
-            if (!fYunFileService.getFyunType().equals(FYunTypeEnum.LOCAL.code())) {
-                // dam 文件设置请求头
-                uploadFiles.entrySet().stream().filter(entry -> FileNameUtil.extName(entry.getKey()).equals("dam"))
+            if (!ObjectUtils.isEmpty(cameraType) && !cameraType.equals(14)) {
+                if (!fYunFileService.getFyunType().equals(FYunTypeEnum.LOCAL.code())) {
+                    // dam 文件设置请求头
+                    uploadFiles.entrySet().stream().filter(entry -> FileNameUtil.extName(entry.getKey()).equals("dam"))
                         .forEach(entry -> {
                             if (!new File(entry.getKey()).exists()) {
                                 log.error("文件不存在,不予gzip压缩,文件路径:{}", entry.getKey());
@@ -280,6 +281,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
                             FileUtil.rename(new File(entry.getKey() + ".gzip"), entry.getKey(), true);
                             fYunFileService.uploadFile(entry.getKey(), entry.getValue(), damFileHeaders);
                         });
+                }
             }
 
             //拷贝部分文件到编辑目录,用于用户编辑
@@ -307,6 +309,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
                 sceneEditControls.setShowMap(0);
             }
 
+            //写scene.json
             this.writeSceneJson(sceneCode, videosJson,sceneEditInfo, sceneEditInfoExt, sceneEditControls, scenePlus,scenePlusExt,company);
 
             String qrLogo = !ObjectUtils.isEmpty(company) && !ObjectUtils.isEmpty(company.getQrLogo()) ? company.getQrLogo() : null;
@@ -439,9 +442,8 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
             }
         }
 
-
-        if ((fdageData.containsKey("exportMeshObj") && fdageData.getIntValue("exportMeshObj") == 1)
-                || (!ObjectUtils.isEmpty(cameraType) && (!cameraType.equals(14)))) {
+        //exportMeshObj这个是字段由app写入的
+        if (!ObjectUtils.isEmpty(cameraType) && cameraType != 14) {
             CreateObjUtil.convertTxtToDam(path + File.separator + "results" + File.separator + "tex" + File.separator + "modeldata.txt", path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam");
             CreateObjUtil.convertDamToLzma(path + File.separator + "results/");
             CreateObjUtil.convertTxtToDam(path + File.separator + "results" + File.separator + "tex" + File.separator + "modeldata.txt", path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam");
@@ -449,13 +451,28 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
             map.put(path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam", imagesPath + ConstantFileName.modelUUID + "_50k.dam");
         }
 
+        if(this.modelKind.equals(ModelKind.THREE_D_TILE.code())
+                && (!ObjectUtils.isEmpty(cameraType) && cameraType == 14 )//是激光场景
+                && (fdageData.containsKey("exportMeshObj") && fdageData.getIntValue("exportMeshObj") == 1)//选择生成obj
+        ){
+            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);
-
-        FileUtil.touch("/mnt/4Dkankan/scene/data" + File.separator + "data" + 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");
@@ -783,6 +800,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
 
         String sceneKind = scenePlusExt.getSceneScheme() == 3 ? SceneKind.FACE.code():SceneKind.TILES.code();
         scenePlusExt.setSceneKind(sceneKind);
+//        scenePlusExt.setModelKind(modelKind);
 
         scenePlusExtService.updateById(scenePlusExt);
     }

+ 14 - 7
src/main/java/com/fdkankan/contro/mq/service/impl/BuildV3SceneServiceImpl.java

@@ -11,6 +11,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.fdkankan.common.constant.ExpiredStatus;
+import com.fdkankan.common.constant.ModelKind;
 import com.fdkankan.common.constant.PayStatus;
 import com.fdkankan.common.constant.SceneStatus;
 import com.fdkankan.common.util.DateExtUtil;
@@ -67,7 +68,7 @@ public class BuildV3SceneServiceImpl implements IBuildSceneService {
     @Value("${model.type:#{null}}")
     private String modelSceneKind;
 
-    @Value("${model.modelKind:dam}")
+    @Value("${model.modelKind:3dtiles}")
     private String modelKind;
 
     @Autowired
@@ -236,17 +237,23 @@ public class BuildV3SceneServiceImpl implements IBuildSceneService {
             Map<String,String> damFileHeaders = new HashMap<>();
             damFileHeaders.put("Content-Encoding","gzip");
 
-            if (!fYunFileService.getFyunType().equals(FYunTypeEnum.LOCAL.code())) {
-                // dam 文件设置请求头
-                uploadFiles.entrySet().stream().filter(entry -> FileNameUtil.extName(entry.getKey()).equals("dam"))
+            if(modelKind.equals(ModelKind.DAM.code())) {
+                if (!fYunFileService.getFyunType().equals(FYunTypeEnum.LOCAL.code())) {
+                    // dam 文件设置请求头
+                    uploadFiles.entrySet().stream()
+                        .filter(entry -> FileNameUtil.extName(entry.getKey()).equals("dam"))
                         .filter(entry -> new File(entry.getKey()).exists())
                         .forEach(entry -> {
                             // gzip压缩
-                            FileUtil.writeBytes(ZipUtil.gzip(new File(entry.getKey())), entry.getKey() + ".gzip");
+                            FileUtil.writeBytes(ZipUtil.gzip(new File(entry.getKey())),
+                                entry.getKey() + ".gzip");
                             // 重命名
-                            FileUtil.rename(new File(entry.getKey() + ".gzip"), entry.getKey(), true);
-                            fYunFileService.uploadFile(entry.getKey(), entry.getValue(), damFileHeaders);
+                            FileUtil
+                                .rename(new File(entry.getKey() + ".gzip"), entry.getKey(), true);
+                            fYunFileService
+                                .uploadFile(entry.getKey(), entry.getValue(), damFileHeaders);
                         });
+                }
             }
 
             //生成houseTypejson并上传

+ 60 - 23
src/main/java/com/fdkankan/contro/service/impl/SceneFileBuildServiceImpl.java

@@ -8,6 +8,7 @@ import cn.hutool.core.util.StrUtil;
 import cn.hutool.extra.qrcode.QrCodeUtil;
 import cn.hutool.extra.qrcode.QrConfig;
 import cn.hutool.http.HttpUtil;
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -85,7 +86,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
     @Value("${v3.controlUrl:#{null}}")
     private String v3controlUrl;
 
-    @Value("${model.modelKind:dam}")
+    @Value("${model.modelKind:3dtiles}")
     private String modelKind;
 
     @Value("${build.notSupport.beforeTime:202203}")
@@ -587,12 +588,14 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
             }
         }
 
-        ResultData ok = callV3(preParams, fdageJson,"api/scene/file/uploadSuccessBuild");
-        if (ok != null) return ok;
-
         // 判断是否是V3的场景
         ScenePro scenePro = sceneProService.getOne(
-                new LambdaQueryWrapper<ScenePro>().like(ScenePro::getDataSource, fileId));
+            new LambdaQueryWrapper<ScenePro>().like(ScenePro::getDataSource, fileId));
+
+        boolean callV3 = callV3(scenePro, preParams, fdageJson, "api/scene/file/uploadSuccessBuild");
+        if(callV3) return ResultData.ok();
+
+
         if (ObjectUtils.isEmpty(scenePro) || (!ObjectUtils.isEmpty(scenePro.getIsUpgrade()) && scenePro.getIsUpgrade() == 1)) {
             buildScene(fileId, prefixBuffer.toString(),fdageJson,buildType,cameraType);
         }else{
@@ -601,7 +604,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
         return ResultData.ok();
     }
 
-    private ResultData callV3(String preParams, JSONObject fdageJson,String api) {
+    private boolean callV3(ScenePro scenePro, String preParams, JSONObject fdageJson,String api) throws Exception {
         String cameraName = fdageJson.getJSONObject("cam").getString("uuid");
 
         Camera camera = cameraService.getByChildName(cameraName);
@@ -615,7 +618,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
             log.error("该相机详情不存在:" + cameraName);
             throw new BusinessException(CameraConstant.FAILURE_6003);
         }
-        // 判断是否是正顺的场景,如果是正顺的场景,则发送到原来的系统进行计算
+        // 判断是否是正顺|火调|普通v3的场景,如果是正顺|火调|普通v3的场景,则发送到原来的系统进行计算
         if (!ObjectUtils.isEmpty(cameraDetail.getCompanyId())) {
             Company company = companyService.getById(cameraDetail.getCompanyId());
             if(ObjectUtils.isEmpty(company)){
@@ -623,18 +626,25 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
                 throw new BusinessException(CameraConstant.FAILURE_6003);
             }
             if (!ObjectUtils.isEmpty(company.getSceneVersion()) && company.getSceneVersion().equals("V3")) {
-                callV3Service(preParams,api);
-                return ResultData.ok();
+                callV3Service(preParams, api);
+                return Boolean.TRUE;
             }
         }
-        return null;
+        // TODO: 2023/1/12 3dtiles临时上激光场景
+//        else if (Objects.nonNull(scenePro) &&
+//            scenePro.getSceneSource() != SceneSource.JG.code() &&
+//            scenePro.getIsUpgrade() == CommonStatus.NO.code().intValue()){
+//            callV3Service(preParams,api);
+//            return Boolean.TRUE;
+//        }
+        return Boolean.FALSE;
     }
 
-    public void callV3Service(String params,String api){
+    public void callV3Service(String params,String api) throws Exception {
         log.info("params:{}", params);
         if(ObjectUtils.isEmpty(v3controlUrl)){
             log.error("未配置V3服务器!");
-            return;
+            throw new Exception("未配置V3服务器!");
         }
         HttpHeaders headers = new HttpHeaders();
         headers.setContentType(MediaType.MULTIPART_FORM_DATA);
@@ -642,9 +652,9 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
         paramMap.add("params",params);
         HttpEntity<Object> formEntity = new HttpEntity<>(paramMap,headers);
         ResponseEntity<Result> responseEntity = restTemplate.postForEntity(v3controlUrl+api, formEntity, Result.class);
-        if (responseEntity.getStatusCode() != HttpStatus.OK || responseEntity.getBody().getCode() != HttpStatus.OK.value()) {
-            log.error("正顺场景请求V3服务器失败!");
-            return;
+        if (responseEntity.getStatusCode().value() != HttpStatus.OK.value() || responseEntity.getBody().getCode() != ServerCode.SUCCESS.code()) {
+            log.error("正顺场景请求V3服务器失败, params:{}, result:{}",params, JSON.toJSONString(responseEntity));
+            throw new BusinessException(ErrorCode.SYSTEM_BUSY);
         }
         log.info("正顺场景请求V3服务器成功!");
     }
@@ -705,19 +715,18 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
             cameraType = 14L;
         }
 
-        ResultData ok = callV3(preParams, fdageJson,"api/scene/file/turntableUploadSuccess");
-        if (ok != null) return ok;
-
-
-        ScenePlusVO scenePlusVO = null;
-
         // 判断是否是V3的场景
         ScenePro scenePro = sceneProService.getOne(
-                new LambdaQueryWrapper<ScenePro>().like(ScenePro::getDataSource, fileId));
+            new LambdaQueryWrapper<ScenePro>().like(ScenePro::getDataSource, fileId));
+
+        boolean callV3 = callV3(scenePro, preParams, fdageJson, "api/scene/file/turntableUploadSuccess");
+        if (callV3) return ResultData.ok();
 
         //激光场景校验是否能够计算
         this.checkJgCanBuild(scenePro);
 
+        ScenePlusVO scenePlusVO = null;
+
         if (ObjectUtils.isEmpty(scenePro) || (!ObjectUtils.isEmpty(scenePro.getIsUpgrade()) && scenePro.getIsUpgrade() == 1)) {
             scenePlusVO = buildScene(fileId, prefixBuffer.toString(), fdageJson, buildType, cameraType);
         } else {
@@ -780,6 +789,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
         if(cameraType.longValue() == 14 ){
             scenePlus.setSceneSource(4);
             scenePlusExt.setSceneScheme(10);
+            scenePlusExt.setModelKind(modelKind);
         }
 
         if (pic != null && pic.length() > 5) {
@@ -1070,12 +1080,23 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
 
         ScenePro scenePro = sceneProService.getByNum(num);
 
+        // TODO: 2023/1/12 3dtiles临时上激光场景
+//        if(Objects.nonNull(scenePro) && (Objects.isNull(scenePro.getIsUpgrade())
+//            || scenePro.getIsUpgrade() != CommonStatus.YES.code().intValue())){
+//            if(scenePro.getSceneSource() == SceneSource.JG.code().intValue()){
+//                return rebuildV3Scene(scenePro,num,force);
+//            }else{
+//                return rebuildV3SceneToMini(scenePro);
+//            }
+//        }
+
+
         //激光场景校验是否能够计算
         this.checkJgCanBuild(scenePro);
 
         //如果是v3场景,不允许重算,需要升级v4后再调此接口进行重算
         if(Objects.nonNull(scenePro) && (Objects.isNull(scenePro.getIsUpgrade())
-            || scenePro.getIsUpgrade() != CommonStatus.YES.code().intValue())){
+                || scenePro.getIsUpgrade() != CommonStatus.YES.code().intValue())){
             return rebuildV3Scene(scenePro,num,force);
         }
 
@@ -1151,6 +1172,11 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
             .set(ScenePlus::getSceneStatus, SceneStatus.wait.code())
             .eq(ScenePlus::getNum, num));
 
+        if(cameraType == 14){
+            scenePlusExt.setModelKind(this.modelKind);
+        }
+        scenePlusExtService.updateById(scenePlusExt);
+
         return ResultData.ok();
     }
 
@@ -1610,4 +1636,15 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
         return scene;
     }
 
+    private ResultData rebuildV3SceneToMini(ScenePro scenePro){
+        log.info("v3场景重算,请求v3服务器,url:{}",v3controlUrl+"api/scene/rebuildScene?num=" + scenePro.getNum());
+        ResponseEntity<Result> responseEntity = restTemplate.getForEntity(v3controlUrl+"api/scene/rebuildScene?num=" + scenePro.getNum(), Result.class);
+        if (responseEntity.getStatusCode().value() != HttpStatus.OK.value() || responseEntity.getBody().getCode() != ServerCode.SUCCESS.code()) {
+            log.error("请求V3服务器重算场景失败, num:{}, result:{}",scenePro.getNum(), JSON.toJSONString(responseEntity));
+            throw new BusinessException(ErrorCode.SYSTEM_BUSY);
+        }
+        log.info("v3场景重算,请求v3服务器,url:{}, result",v3controlUrl+"api/scene/rebuildScene?num=" + scenePro.getNum(), JSON.toJSONString(responseEntity));
+        return ResultData.ok();
+    }
+
 }