|
@@ -21,6 +21,9 @@ import com.fdkankan.contro.service.*;
|
|
|
import com.fdkankan.contro.vo.SceneEditControlsVO;
|
|
|
import com.fdkankan.fyun.constant.FYunTypeEnum;
|
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
+import com.fdkankan.model.constants.ConstantFilePath;
|
|
|
+import com.fdkankan.model.constants.UploadFilePath;
|
|
|
+import com.fdkankan.model.utils.CreateHouseJsonUtil;
|
|
|
import com.fdkankan.push.PushMessageConfig;
|
|
|
import com.fdkankan.push.PushMsgUtil;
|
|
|
import com.fdkankan.rabbitmq.bean.BuildSceneResultMqMessage;
|
|
@@ -103,8 +106,7 @@ public class BuildScenePostServiceImpl implements IBuildScenePostService {
|
|
|
try {
|
|
|
if(!buildSuccess){//建模失败,修改状态为失败状态
|
|
|
log.info("建模失败,修改状态为失败状态");
|
|
|
- scenePlusService.update(
|
|
|
- new LambdaUpdateWrapper<ScenePlus>()
|
|
|
+ scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
|
|
|
.set(ScenePlus::getSceneStatus, SceneStatus.FAILD.code())
|
|
|
.eq(ScenePlus::getNum, sceneCode));
|
|
|
|
|
@@ -162,23 +164,6 @@ public class BuildScenePostServiceImpl implements IBuildScenePostService {
|
|
|
//上传全景图俯视图
|
|
|
this.uploadFloorCad(path, sceneCode, newUploadFiles);
|
|
|
|
|
|
- Map<String,String> visionTxtPath = new HashMap<>();
|
|
|
-
|
|
|
- // dam 文件设置请求头
|
|
|
- newUploadFiles.entrySet().stream().filter(entry-> FileNameUtil.getName(entry.getKey()).equals("vision.modeldata"))
|
|
|
- .forEach(entry-> {
|
|
|
- try {
|
|
|
- log.info("开始转换 vision.modeldata");
|
|
|
- visionTxtPath.put(entry.getKey().replace("vision.modeldata","vision.txt"),entry.getValue().replace("vision.modeldata","vision.txt"));
|
|
|
- ConvertCommonUtils.convertVisionModelDataToTxt(entry.getKey(),entry.getKey().replace("vision.modeldata","vision.txt"));
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("vision.modeldata 转换json失败!");
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- newUploadFiles.putAll(visionTxtPath);
|
|
|
-
|
|
|
//上传文件
|
|
|
fYunFileService.uploadMulFiles(newUploadFiles);
|
|
|
|
|
@@ -195,7 +180,8 @@ public class BuildScenePostServiceImpl implements IBuildScenePostService {
|
|
|
this.copyToEditDir(sceneCode);
|
|
|
|
|
|
//生成houseTypejson并上传
|
|
|
- this.uploadHouseTypeJson(sceneCode);
|
|
|
+ newUploadFiles.entrySet().stream().filter(entry-> FileNameUtil.getName(entry.getKey()).equals("floorplan_cad.json"))
|
|
|
+ .forEach(entry-> uploadHouseTypeJson(sceneCode,entry.getKey()));
|
|
|
|
|
|
//写scene.json
|
|
|
this.writeSceneJson(sceneCode, videosJson,sceneEditInfo, sceneEditInfoExt, sceneEditControls, scenePlus,
|
|
@@ -629,19 +615,15 @@ public class BuildScenePostServiceImpl implements IBuildScenePostService {
|
|
|
return new Object[]{sceneEditInfo, sceneEditInfoExt, sceneEditControls};
|
|
|
}
|
|
|
|
|
|
- public void uploadHouseTypeJson(String num) throws IOException {
|
|
|
-
|
|
|
- String floorplanCadPath = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "floorplan_cad.json";
|
|
|
- fYunFileService.downloadFile(floorplanCadPath,floorplanCadPath);
|
|
|
-
|
|
|
- JSONObject json = CreateHouseJsonUtil.createHouseTypeJsonByCad(floorplanCadPath);
|
|
|
-
|
|
|
+ public void uploadHouseTypeJson(String num, String floorPlanCardFilePath) {
|
|
|
+ if (!new File(floorPlanCardFilePath).exists()) {
|
|
|
+ log.error("floorplan_cad.json 文件不存在,文件路径:{}", floorPlanCardFilePath);
|
|
|
+ }
|
|
|
+ JSONObject json = CreateHouseJsonUtil.createHouseTypeJsonByCad(floorPlanCardFilePath);
|
|
|
String hourseTypeJsonPath = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "houseType.json";
|
|
|
fYunFileService.uploadFile(json.toJSONString().getBytes(), hourseTypeJsonPath);
|
|
|
hourseTypeJsonPath = String.format(UploadFilePath.DATA_EDIT_PATH, num) + "houseType.json";
|
|
|
fYunFileService.uploadFile(json.toJSONString().getBytes(), hourseTypeJsonPath);
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
private JSONArray[] createHouseTypeJsonHandler(JSONObject floor){
|