|
@@ -207,7 +207,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
fYunFileService.downloadFileByCommand(path + File.separator + "capture", ossPath);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
public void buildScenePost(BuildSceneResultMqMessage message) throws Exception {
|
|
|
String sceneCode = message.getBuildContext().get("sceneNum").toString();
|
|
@@ -237,12 +236,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
Integer cameraType = Integer.parseInt(message.getBuildContext().get("cameraType").toString());
|
|
|
Map<String, String> uploadFiles = getUploadFiles(scenePlus,path,cameraType,fdageData);
|
|
|
|
|
|
- //计算场景消耗磁盘空间
|
|
|
- long space = this.calUseSpace(uploadFiles);
|
|
|
-
|
|
|
-
|
|
|
scenePlus.setPayStatus(PayStatus.PAY.code());
|
|
|
-
|
|
|
scenePlus.setUpdateTime(new Date());
|
|
|
scenePlus.setSceneStatus(SceneStatus.NO_DISPLAY.code());
|
|
|
|
|
@@ -252,8 +246,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
boolean isObj = fdageData.containsKey("exportMeshObj") && fdageData.getIntValue("exportMeshObj") == 1;
|
|
|
- //写入数据库
|
|
|
- this.updateDbPlus(scenePlus.getSceneSource(), space, videosJson.toJSONString(), message.getComputeTime(),isObj,scenePlusExt);
|
|
|
|
|
|
//上传全景图俯视图
|
|
|
this.uploadFloorCad(path, sceneCode, uploadFiles);
|
|
@@ -264,21 +256,11 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
//上传文件
|
|
|
fYunFileService.uploadMulFiles(uploadFiles);
|
|
|
|
|
|
+ //修改oss上dam的内容编码
|
|
|
Map<String,String> damFileHeaders = new HashMap<>();
|
|
|
damFileHeaders.put("Content-Encoding","gzip");
|
|
|
- // 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());
|
|
|
- return;
|
|
|
- }
|
|
|
- // 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);
|
|
|
- });
|
|
|
+ String damPath = path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam";
|
|
|
+ fYunFileService.uploadFile(damPath, String.format(UploadFilePath.IMG_VIEW_PATH, sceneCode) + ConstantFileName.modelUUID + "_50k.dam", damFileHeaders);
|
|
|
|
|
|
//拷贝部分文件到编辑目录,用于用户编辑
|
|
|
this.copyToEditDir(sceneCode);
|
|
@@ -287,11 +269,11 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
// this.cachePanorama(path, sceneCode);
|
|
|
|
|
|
//生成houseTypejson并上传
|
|
|
- boolean existHouseType = this.uploadHouseTypeJson(sceneCode, scenePlusExt.getDataSource());
|
|
|
+ boolean existHouseType = this.uploadHouseTypeJson(sceneCode, path);
|
|
|
scenePlus.setHouseType(existHouseType ? CommonStatus.YES.code().intValue() : CommonStatus.NO.code().intValue());
|
|
|
|
|
|
//生成floorpan.json
|
|
|
- commonService.uploadFloorplanJson(sceneCode, scenePlusExt.getDataSource());
|
|
|
+ commonService.uploadFloorplanJson(sceneCode, path);
|
|
|
|
|
|
//重置异步操作记录
|
|
|
this.removeSceneAsynOperLog(sceneCode);
|
|
@@ -302,8 +284,15 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
bizs.add(UserEditDataType.FLOORPLAN.message());
|
|
|
commonService.initUserEditData(sceneCode, bizs, null);
|
|
|
|
|
|
+ //计算场景消耗磁盘空间
|
|
|
+ long space = this.calUseSpace(uploadFiles);
|
|
|
+
|
|
|
//上传计算结果文件
|
|
|
- commonService.uploadBuildResultData(sceneCode, path, SceneVersionType.V4.code());
|
|
|
+ Long cacheSize = commonService.uploadBuildResultData(sceneCode, path, SceneVersionType.V4.code());
|
|
|
+ space += cacheSize;
|
|
|
+
|
|
|
+ //写入数据库
|
|
|
+ this.updateDbPlus(scenePlus.getSceneSource(), space, videosJson.toJSONString(), message.getComputeTime(),isObj,scenePlusExt);
|
|
|
|
|
|
Object[] editInfoArr = this.updateEditInfo(scenePlus);
|
|
|
SceneEditInfo sceneEditInfo = (SceneEditInfo)editInfoArr[0];
|
|
@@ -312,7 +301,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
if (cameraType == 14) {
|
|
|
//计算成功 激光转台相机 同步 请求
|
|
|
- fdkkLaserService.syncBuildResult(scenePlus.getNum(), scenePlusExt.getDataSource(),scenePlus.getCreateTime(), Calendar.getInstance().getTime());
|
|
|
+ fdkkLaserService.syncBuildResult(scenePlus.getNum(), path, scenePlus.getCreateTime(), Calendar.getInstance().getTime());
|
|
|
sceneEditControlsService.update(new LambdaUpdateWrapper<SceneEditControls>().set(SceneEditControls::getShowMap,0)
|
|
|
.eq(SceneEditControls::getEditInfoId,sceneEditInfo.getId()));
|
|
|
sceneEditControls.setShowMap(0);
|
|
@@ -488,11 +477,10 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
if(genModel){
|
|
|
if (!gen3dTiles) {
|
|
|
- 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");
|
|
|
- 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");
|
|
|
+ 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)){
|