|
@@ -72,6 +72,9 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
@Value("${model.type:#{null}}")
|
|
@Value("${model.type:#{null}}")
|
|
private String modelType;
|
|
private String modelType;
|
|
|
|
|
|
|
|
+ @Value("${model.modelKind:3dtiles}")
|
|
|
|
+ private String modelKind;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private RabbitMqProducer mqProducer;
|
|
private RabbitMqProducer mqProducer;
|
|
|
|
|
|
@@ -213,7 +216,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
scenePlus.setSceneStatus(SceneStatus.NO_DISPLAY.code());
|
|
scenePlus.setSceneStatus(SceneStatus.NO_DISPLAY.code());
|
|
scenePlusService.updateById(scenePlus);
|
|
scenePlusService.updateById(scenePlus);
|
|
|
|
|
|
-
|
|
|
|
Integer videoVersion = fdageData.getInteger("videoVersion");
|
|
Integer videoVersion = fdageData.getInteger("videoVersion");
|
|
//读取计算结果文件生成videosJson
|
|
//读取计算结果文件生成videosJson
|
|
JSONObject videosJson = this.getVideosJson(path, videoVersion, sceneCode, cameraType);
|
|
JSONObject videosJson = this.getVideosJson(path, videoVersion, sceneCode, cameraType);
|
|
@@ -231,16 +233,18 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
//上传全景图俯视图
|
|
//上传全景图俯视图
|
|
this.uploadFloorCad(path, sceneCode, uploadFiles);
|
|
this.uploadFloorCad(path, sceneCode, uploadFiles);
|
|
|
|
|
|
- //上传文件
|
|
|
|
log.info("开始上传场景计算结果数据,num:{}", sceneCode);
|
|
log.info("开始上传场景计算结果数据,num:{}", sceneCode);
|
|
|
|
+ //由于3dtiles算法mesh文件发生变化,所以这里需要先清除一下oss的mesh目录,避免存在旧算法obj文件
|
|
|
|
+ fYunFileService.deleteFolder(String.format(UploadFilePath.DATA_VIEW_PATH, sceneCode) + "mesh");
|
|
|
|
+ //上传文件
|
|
fYunFileService.uploadMulFiles(uploadFiles);
|
|
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(modelKind.equals(ModelKind.DAM.code())){
|
|
|
|
+ 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"))
|
|
.filter(entry -> new File(entry.getKey()).exists())
|
|
.filter(entry -> new File(entry.getKey()).exists())
|
|
.forEach(entry -> {
|
|
.forEach(entry -> {
|
|
// gzip压缩
|
|
// gzip压缩
|
|
@@ -249,6 +253,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
FileUtil.rename(new File(entry.getKey() + ".gzip"), entry.getKey(), true);
|
|
FileUtil.rename(new File(entry.getKey() + ".gzip"), entry.getKey(), true);
|
|
fYunFileService.uploadFile(entry.getKey(), entry.getValue(), damFileHeaders);
|
|
fYunFileService.uploadFile(entry.getKey(), entry.getValue(), damFileHeaders);
|
|
});
|
|
});
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
//拷贝部分文件到编辑目录,用于用户编辑
|
|
//拷贝部分文件到编辑目录,用于用户编辑
|
|
@@ -258,9 +263,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
uploadFiles.entrySet().stream().filter(entry-> FileNameUtil.getName(entry.getKey()).equals("floorplan_cad.json"))
|
|
uploadFiles.entrySet().stream().filter(entry-> FileNameUtil.getName(entry.getKey()).equals("floorplan_cad.json"))
|
|
.forEach(entry-> uploadHouseTypeJson(sceneCode,entry.getKey()));
|
|
.forEach(entry-> uploadHouseTypeJson(sceneCode,entry.getKey()));
|
|
|
|
|
|
- //写scene.json
|
|
|
|
-
|
|
|
|
-
|
|
|
|
log.info("生成scene.json上传oss并设置缓存,num:{}", sceneCode);
|
|
log.info("生成scene.json上传oss并设置缓存,num:{}", sceneCode);
|
|
CameraDetail cameraDetail = cameraDetailService.getByCameraId(scenePlus.getCameraId());
|
|
CameraDetail cameraDetail = cameraDetailService.getByCameraId(scenePlus.getCameraId());
|
|
Company company = !ObjectUtils.isEmpty(cameraDetail.getCompanyId()) ? companyService.getById(cameraDetail.getCompanyId()) : null;
|
|
Company company = !ObjectUtils.isEmpty(cameraDetail.getCompanyId()) ? companyService.getById(cameraDetail.getCompanyId()) : null;
|
|
@@ -279,6 +281,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
sceneEditControls.setShowMap(0);
|
|
sceneEditControls.setShowMap(0);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //写scene.json
|
|
this.writeSceneJson(sceneCode, videosJson,sceneEditInfo, sceneEditInfoExt, sceneEditControls, scenePlus,scenePlusExt,company);
|
|
this.writeSceneJson(sceneCode, videosJson,sceneEditInfo, sceneEditInfoExt, sceneEditControls, scenePlus,scenePlusExt,company);
|
|
|
|
|
|
String qrLogo = !ObjectUtils.isEmpty(company) && !ObjectUtils.isEmpty(company.getQrLogo()) ? company.getQrLogo() : null;
|
|
String qrLogo = !ObjectUtils.isEmpty(company) && !ObjectUtils.isEmpty(company.getQrLogo()) ? company.getQrLogo() : null;
|
|
@@ -372,15 +375,26 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
- if ((fdageData.containsKey("exportMeshObj") && fdageData.getIntValue("exportMeshObj") == 1)
|
|
|
|
- || (!ObjectUtils.isEmpty(cameraType) && (!cameraType.equals(14)))) {
|
|
|
|
|
|
+ //exportMeshObj这个是字段由app写入的
|
|
|
|
+ if (this.modelKind.equals(ModelKind.DAM.code()) &&
|
|
|
|
+ ((fdageData.containsKey("exportMeshObj") && fdageData.getIntValue("exportMeshObj") == 1)
|
|
|
|
+ || (!ObjectUtils.isEmpty(cameraType) && (!cameraType.equals(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.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.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");
|
|
CreateObjUtil.convertTxtToDam(path + File.separator + "results" + File.separator + "tex" + File.separator + "modeldata.txt", path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam");
|
|
map.put(path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam.lzma", imagesPath + ConstantFileName.modelUUID + "_50k.dam.lzma");
|
|
map.put(path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam.lzma", imagesPath + ConstantFileName.modelUUID + "_50k.dam.lzma");
|
|
map.put(path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam", imagesPath + ConstantFileName.modelUUID + "_50k.dam");
|
|
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())){
|
|
|
|
+ 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");
|
|
CreateObjUtil.convertTxtToVisionmodeldata(resultsPath + "vision.txt", resultsPath + "vision.modeldata");
|
|
map.put(resultsPath + "vision.txt", imagesPath + "vision.txt");
|
|
map.put(resultsPath + "vision.txt", imagesPath + "vision.txt");
|
|
@@ -749,6 +763,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
String sceneKind = scenePlusExt.getSceneScheme() == 3 ? SceneKind.FACE.code():SceneKind.TILES.code();
|
|
String sceneKind = scenePlusExt.getSceneScheme() == 3 ? SceneKind.FACE.code():SceneKind.TILES.code();
|
|
scenePlusExt.setSceneKind(sceneKind);
|
|
scenePlusExt.setSceneKind(sceneKind);
|
|
|
|
+ scenePlusExt.setModelKind(modelKind);
|
|
|
|
|
|
scenePlusExtService.updateById(scenePlusExt);
|
|
scenePlusExtService.updateById(scenePlusExt);
|
|
}
|
|
}
|