|
@@ -112,11 +112,12 @@ public class AddMoldelBuild {
|
|
|
renovationPartsDetailEntity.setName(modelUploadEntity.getFileId());
|
|
|
renovationPartsDetailEntity.setPath(prefix + "domain/eHome/furniture/temp/" + modelUploadEntity.getFileId() + ".glb");
|
|
|
String imgPath = buildPath + "upload/" + modelUploadEntity.getFileId() + "/" + modelUploadEntity.getFileId() + "_preview.jpg";
|
|
|
+ String birdPath = buildPath + "upload/" + modelUploadEntity.getFileId() + "/" + modelUploadEntity.getFileId() + "_bird.png";
|
|
|
|
|
|
// 加锁,同一个模型只能请求一次3d渲染,防止同一账号在登录多个客户端下同时操作一个模型导致出问题
|
|
|
Result result;
|
|
|
synchronized (param.getModelUploadId()) {
|
|
|
- result = synchronizedupdateByIdModel(param, modelUploadEntity, imgPath, renovationPartsDetailEntity);
|
|
|
+ result = synchronizedupdateByIdModel(param, modelUploadEntity, imgPath, birdPath, renovationPartsDetailEntity);
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
@@ -134,7 +135,7 @@ public class AddMoldelBuild {
|
|
|
}
|
|
|
|
|
|
private Result synchronizedupdateByIdModel(RequestRenovationPartsDetailManager param,
|
|
|
- ModelUploadEntity modelUploadEntity, String imgPath,
|
|
|
+ ModelUploadEntity modelUploadEntity, String imgPath, String birdPath,
|
|
|
RenovationPartsDetailEntity renovationPartsDetailEntity) throws Exception {
|
|
|
if (checkReaptPost(param)) {
|
|
|
AddMoldelBuild.log.info("模型已被提交,模型id-{}", param.getModelUploadId());
|
|
@@ -149,6 +150,11 @@ public class AddMoldelBuild {
|
|
|
renovationPartsDetailEntity.setHighImg(prefix + "domain/eHome/furniture/temp/" + modelUploadEntity.getFileId() + "_preview.jpg");
|
|
|
}
|
|
|
|
|
|
+ //判断缩略图是否存在,在就保存缩略图
|
|
|
+ if (new File(birdPath).exists()) {
|
|
|
+ uploadToOssUtil.uploadTo4dTjw(birdPath, "domain/eHome/furniture/temp/" + modelUploadEntity.getFileId() + "_bird.png");
|
|
|
+ renovationPartsDetailEntity.setBirdPath(prefix + "domain/eHome/furniture/temp/" + modelUploadEntity.getFileId() + "_bird.png");
|
|
|
+ }
|
|
|
|
|
|
//调用obj转换成toolbag文件
|
|
|
objToToolbagUtil.convertobjTomview(modelUploadEntity.getFileId());
|