Selaa lähdekoodia

模型下载报错

dengsixing 3 vuotta sitten
vanhempi
commit
93770bea3b

+ 6 - 4
4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/SceneProServiceImpl.java

@@ -3,6 +3,7 @@ package com.fdkankan.scene.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.core.util.ZipUtil;
 import com.alibaba.csp.sentinel.util.StringUtil;
@@ -4881,13 +4882,13 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
             String meshPath =  String.format(ConstantFilePath.DATABUFFER_FORMAT, num) + "mesh";
             FileUtils.deleteDirectory(meshPath);
             CreateObjUtil.ossUtilCp(dataViewPath + "mesh", meshPath);
-            log.info("meshPath="+meshPath.concat("/mesh"));
+            log.info("meshPath="+meshPath);
             if(!new File(meshPath.concat("/mesh")).exists()){
                 throw new BusinessException(ErrorCode.FAILURE_CODE_7006);
             }
-            log.info(new File(meshPath.concat("/mesh")).listFiles().toString());
-            if(new File(meshPath.concat("/mesh")).listFiles().length > 0){
-                for(File file : new File(meshPath.concat("/mesh")).listFiles()){
+            log.info(new File(meshPath).listFiles().toString());
+            if(new File(meshPath).listFiles().length > 0){
+                for(File file : new File(meshPath).listFiles()){
                     if(file.getName().endsWith(".obj") && !"output.house.obj".equals(file.getName()) &&
                             !"mesh.obj".equals(file.getName())){
                         file.delete();
@@ -4902,6 +4903,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
                 //上传压缩包
                 uploadToOssUtil.upload(zipPath, "downloads/extras/" + zipName);
                 String url = ossUrlPrefix + "downloads/extras/" + zipName + "?t=" + Calendar.getInstance().getTimeInMillis();
+//                FileUtil.del(zipPath);
                 return ResultData.ok(url);
             }
         }