|
@@ -26,6 +26,7 @@ import com.fdkankan.common.exception.BusinessException;
|
|
|
import com.fdkankan.scene.bean.SceneBean;
|
|
import com.fdkankan.scene.bean.SceneBean;
|
|
|
import com.fdkankan.scene.config.FdkkLaserConfig;
|
|
import com.fdkankan.scene.config.FdkkLaserConfig;
|
|
|
import com.fdkankan.scene.util.CmdBuildUtil;
|
|
import com.fdkankan.scene.util.CmdBuildUtil;
|
|
|
|
|
+import com.fdkankan.scene.util.SystemUtil;
|
|
|
import com.fdkankan.web.response.ResultData;
|
|
import com.fdkankan.web.response.ResultData;
|
|
|
import com.fdkankan.model.utils.ComputerUtil;
|
|
import com.fdkankan.model.utils.ComputerUtil;
|
|
|
import com.fdkankan.model.utils.ConvertUtils;
|
|
import com.fdkankan.model.utils.ConvertUtils;
|
|
@@ -927,7 +928,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
sceneAsynOperLogService.save(sceneAsynOperLog);
|
|
sceneAsynOperLogService.save(sceneAsynOperLog);
|
|
|
try {
|
|
try {
|
|
|
//调用算法,不同的类型调用不同的算法
|
|
//调用算法,不同的类型调用不同的算法
|
|
|
- CmdBuildUtil.BuildModelCommand(fdkkLaserConfig.buildCallPath, path);
|
|
|
|
|
|
|
+ CmdBuildUtil.BuildModelCommand(path);
|
|
|
|
|
|
|
|
//算法计算完后,生成压缩文件,上传到oss
|
|
//算法计算完后,生成压缩文件,上传到oss
|
|
|
uploadFileofterBuildDamModel(path, filePath, num, bucket);
|
|
uploadFileofterBuildDamModel(path, filePath, num, bucket);
|
|
@@ -1059,7 +1060,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
try {
|
|
try {
|
|
|
//调用算法
|
|
//调用算法
|
|
|
log.info("上传3dtiles模型开始, num:{}, targetPath:{}", num, path);
|
|
log.info("上传3dtiles模型开始, num:{}, targetPath:{}", num, path);
|
|
|
- CmdBuildUtil.Obj2Tiles(fdkkLaserConfig.buildCallPath, path);
|
|
|
|
|
|
|
+ CmdBuildUtil.Obj2Tiles(path);
|
|
|
log.info("上传3dtiles模型结束, num:{}, targetPath:{}", num, path);
|
|
log.info("上传3dtiles模型结束, num:{}, targetPath:{}", num, path);
|
|
|
|
|
|
|
|
//检测计算结果
|
|
//检测计算结果
|
|
@@ -1331,18 +1332,46 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
private String downloadModel43dtiles(String num, String bucket, ScenePlusExt scenePlusExt, SceneEditInfo sceneEditInfo){
|
|
private String downloadModel43dtiles(String num, String bucket, ScenePlusExt scenePlusExt, SceneEditInfo sceneEditInfo){
|
|
|
|
|
|
|
|
//下载mesh到本地
|
|
//下载mesh到本地
|
|
|
- String meshOssPath = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "mesh/";
|
|
|
|
|
- String meshLocalPath = String.format(ConstantFilePath.SCENE_DATA_PATH_V4, num);
|
|
|
|
|
|
|
+ String meshOssPath = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "mesh" + File.separator;
|
|
|
|
|
+ String meshLocalPath = String.format(ConstantFilePath.SCENE_DATA_PATH_V4, num) + "mesh" + File.separator;
|
|
|
String zipName = num + "_mesh.zip";
|
|
String zipName = num + "_mesh.zip";
|
|
|
String zipFilePath = String.format(ConstantFilePath.SCENE_DATA_PATH_V4, num) + zipName;
|
|
String zipFilePath = String.format(ConstantFilePath.SCENE_DATA_PATH_V4, num) + zipName;
|
|
|
|
|
+ List<String> keys = ossUtil.listFiles(bucket, meshOssPath);
|
|
|
//下载
|
|
//下载
|
|
|
- ossUtil.downloadFile(bucket, meshOssPath, meshLocalPath);
|
|
|
|
|
|
|
+ //下载
|
|
|
|
|
+ keys.stream().filter(v->{
|
|
|
|
|
+ if((v.contains("lod_") && !v.contains("lod_0")) || v.endsWith(File.separator)){
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }).forEach(v->{
|
|
|
|
|
+ ossUtil.downloadFile(bucket, v, v.replace(SystemUtil.transPath(meshOssPath), meshLocalPath));
|
|
|
|
|
+ });
|
|
|
|
|
+ String meshJsonPath = meshLocalPath + "mesh.json";
|
|
|
|
|
+ if(FileUtil.exist(meshJsonPath)){
|
|
|
|
|
+ JSONObject meshJson = JSON.parseObject(FileUtil.readUtf8String(meshJsonPath));
|
|
|
|
|
+ JSONArray floors = meshJson.getJSONArray("floors");
|
|
|
|
|
+ for (Object floor : floors) {
|
|
|
|
|
+ JSONObject floorObj = (JSONObject)floor;
|
|
|
|
|
+ JSONArray lods = floorObj.getJSONArray("lods");
|
|
|
|
|
+ List<Object> list = lods.stream().filter(v -> {
|
|
|
|
|
+ JSONObject lodObj = (JSONObject) v;
|
|
|
|
|
+ String name = lodObj.getString("name");
|
|
|
|
|
+ if ("lod_0".equals(name)) {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
|
+ floorObj.put("lods", list);
|
|
|
|
|
+ }
|
|
|
|
|
+ FileUtil.writeUtf8String(meshJson.toJSONString(), meshJsonPath);
|
|
|
|
|
+ }
|
|
|
//打包
|
|
//打包
|
|
|
- ZipUtil.zip(meshLocalPath.concat("mesh") ,zipFilePath);
|
|
|
|
|
|
|
+ ZipUtil.zip(meshLocalPath ,zipFilePath);
|
|
|
//上传压缩包
|
|
//上传压缩包
|
|
|
ossUtil.uploadFile(bucket,"downloads/extras/" + zipName, zipFilePath, false);
|
|
ossUtil.uploadFile(bucket,"downloads/extras/" + zipName, zipFilePath, false);
|
|
|
//删除本地文件
|
|
//删除本地文件
|
|
|
- FileUtil.del(meshLocalPath.concat("mesh"));
|
|
|
|
|
|
|
+ FileUtil.del(meshLocalPath);
|
|
|
FileUtil.del(zipFilePath);
|
|
FileUtil.del(zipFilePath);
|
|
|
String url = "downloads/extras/" + zipName;
|
|
String url = "downloads/extras/" + zipName;
|
|
|
return url;
|
|
return url;
|