|
@@ -1,5 +1,6 @@
|
|
|
package com.fdkk.sxz.webApi.controller;
|
|
|
|
|
|
+import cn.hutool.core.io.FileUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
@@ -590,10 +591,24 @@ public class ManagerController extends BaseController {
|
|
|
paramsMap.put("outFilePath",buildPath + buildPath + modelUploadEntity.getObjPath().replace(".obj", ""));
|
|
|
OkHttpUtils.httpPostForm(maxObjUrl+"toToolbag",paramsMap);
|
|
|
Thread.sleep(1000);
|
|
|
- uploadToOssUtil.uploadTo4dTjw(buildPath + modelUploadEntity.getObjPath().replace(".obj", ".mview"), "domain/eHome/furniture/temp/" + modelUploadEntity.getFileId() + ".mview");
|
|
|
- log.info("配件obj转换成mview格式结束{}",modelUploadEntity.getObjPath().replace(".obj", ".mview"));
|
|
|
-
|
|
|
|
|
|
+ log.info("上传开始");
|
|
|
+ int count=4;
|
|
|
+ boolean flag=true;
|
|
|
+ while (flag){
|
|
|
+ if(FileUtil.exist(buildPath + modelUploadEntity.getObjPath().replace(".obj", ".mview"))){
|
|
|
+ log.info("文件存在");
|
|
|
+ uploadToOssUtil.uploadTo4dTjw(buildPath + modelUploadEntity.getObjPath().replace(".obj", ".mview"), "domain/eHome/furniture/temp/" + modelUploadEntity.getFileId() + ".mview");
|
|
|
+ flag=false;
|
|
|
+ }else {
|
|
|
+ Thread.sleep(1000);
|
|
|
+ }
|
|
|
+ if (count<=0){
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ count -= 1;
|
|
|
+ }
|
|
|
+ log.info("配件obj转换成mview格式结束{}",modelUploadEntity.getObjPath().replace(".obj", ".mview"));
|
|
|
|
|
|
//obj转换成glb格式
|
|
|
String glbPath = buildPath + "upload/" + modelUploadEntity.getFileId() + "/" + modelUploadEntity.getFileId() + ".glb";
|
|
@@ -627,10 +642,12 @@ public class ManagerController extends BaseController {
|
|
|
RenovationPartsDetailEntity renovationPartsDetailEntity = new RenovationPartsDetailEntity();
|
|
|
BeanUtils.copyProperties(param, renovationPartsDetailEntity);
|
|
|
renovationPartsDetailEntity.setExamine(0);
|
|
|
- renovationPartsDetailEntity.setMviewPath(prefix + "domain/eHome/furniture/temp/" + modelUploadEntity.getFileId() + ".mview");
|
|
|
renovationPartsDetailEntity.setName(modelUploadEntity.getFileId());
|
|
|
renovationPartsDetailEntity.setPath(prefix + "domain/eHome/furniture/temp/" + modelUploadEntity.getFileId() + ".glb");
|
|
|
-
|
|
|
+ if(FileUtil.exist(buildPath + modelUploadEntity.getObjPath().replace(".obj", ".mview"))){
|
|
|
+ log.info("文件存在");
|
|
|
+ renovationPartsDetailEntity.setMviewPath(prefix + "domain/eHome/furniture/temp/" + modelUploadEntity.getFileId() + ".mview");
|
|
|
+ }
|
|
|
//入库前先提交模型到模型库,失败返回提示
|
|
|
String version = SnowFlakeUUidUtils.generaUUid(null, null, null);
|
|
|
JSONObject jsonObject = new JSONObject();
|