|
@@ -30,6 +30,7 @@ import com.fdkankan.model.constants.UploadFilePath;
|
|
import com.fdkankan.model.enums.ModelTypeEnums;
|
|
import com.fdkankan.model.enums.ModelTypeEnums;
|
|
import com.fdkankan.model.utils.CreateHouseJsonUtil;
|
|
import com.fdkankan.model.utils.CreateHouseJsonUtil;
|
|
import com.fdkankan.model.utils.CreateObjUtil;
|
|
import com.fdkankan.model.utils.CreateObjUtil;
|
|
|
|
+import com.fdkankan.model.utils.SceneUtil;
|
|
import com.fdkankan.push.config.PushMessageConfig;
|
|
import com.fdkankan.push.config.PushMessageConfig;
|
|
import com.fdkankan.push.utils.PushMsgUtil;
|
|
import com.fdkankan.push.utils.PushMsgUtil;
|
|
import com.fdkankan.rabbitmq.bean.BuildSceneCallMessage;
|
|
import com.fdkankan.rabbitmq.bean.BuildSceneCallMessage;
|
|
@@ -257,6 +258,9 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
//拷贝部分文件到编辑目录,用于用户编辑
|
|
//拷贝部分文件到编辑目录,用于用户编辑
|
|
this.copyToEditDir(sceneCode);
|
|
this.copyToEditDir(sceneCode);
|
|
|
|
|
|
|
|
+ //计算完毕后,同步全景图到缓存目录
|
|
|
|
+ this.cachePanorama(path, sceneCode);
|
|
|
|
+
|
|
//生成houseTypejson并上传
|
|
//生成houseTypejson并上传
|
|
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()));
|
|
@@ -301,6 +305,24 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void cachePanorama(String dataSource, String num){
|
|
|
|
+ String cachedImagesPath = String.format(ConstantFilePath.SCENE_CACHE_IMAGES, num);
|
|
|
|
+ //将全景图缓存到缓存目录
|
|
|
|
+ List<String> imagesList = FileUtil.listFileNames(dataSource + "/caches/images");
|
|
|
|
+ //先清除旧的全景图
|
|
|
|
+ cn.hutool.core.io.FileUtil.del(cachedImagesPath);
|
|
|
|
+ String visionPath = dataSource + "/results/vision.txt";
|
|
|
|
+ List<String> panoramaImageList = SceneUtil.getPanoramaImageList(visionPath);
|
|
|
|
+ imagesList.stream().forEach(fileName -> {
|
|
|
|
+ if (panoramaImageList.contains(fileName)) {
|
|
|
|
+ String srcPath = dataSource + "/caches/images/" + fileName;
|
|
|
|
+ String targetPath = cachedImagesPath + fileName;
|
|
|
|
+ log.info("源文件:{}, 目标文件:{}", srcPath, targetPath);
|
|
|
|
+ cn.hutool.core.io.FileUtil.copy(srcPath, targetPath, true);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
private Map<String, String> getUploadFiles(ScenePlus scenePlus,String path,Integer cameraType,JSONObject fdageData) throws Exception {
|
|
private Map<String, String> getUploadFiles(ScenePlus scenePlus,String path,Integer cameraType,JSONObject fdageData) throws Exception {
|
|
if (ObjectUtils.isEmpty(scenePlus)) {
|
|
if (ObjectUtils.isEmpty(scenePlus)) {
|
|
throw new Exception("未找到场景信息:" + path);
|
|
throw new Exception("未找到场景信息:" + path);
|