lyhzzz 1 rok pred
rodič
commit
8d20be144a

+ 10 - 6
src/main/java/com/fdkankan/fusion/service/impl/CaseNumServiceImpl.java

@@ -126,26 +126,30 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
             List<String> ossGlbPaths = new ArrayList<>();
             File localFile = new File(objPath);
             this.toGlB(localFile,localGlbPaths);
-
+            Long modelSize = 0L;
             if(localGlbPaths.size() >0){
                 for (String localGlbPath : localGlbPaths) {
-                    File file = new File(localGlbPath);
-                    if(file!=null){
-                        model.setModelSize(FileWriterUtil.setFileSize(file.length()));
-                    }
                     String ossGlbPath = localGlbPath.replace(FilePath.LOCAL_BASE_PATH,"fusion/");
                     uploadToOssUtil.uploadOss(localGlbPath,ossGlbPath);
                     if(ossGlbPath.contains("lod_")){
                         if(ossGlbPath.contains("lod_0")){
                             ossGlbPaths.add(queryPath  +ossGlbPath);
                         }
+                        File file = new File(localGlbPath);
+                        if(file!=null){
+                            modelSize += file.length();
+                        }
                         continue;
                     }
+                    File file = new File(localGlbPath);
+                    if(file!=null){
+                        modelSize += file.length();
+                    }
                     ossGlbPaths.add(queryPath +ossGlbPath);
                 }
                 return JSONArray.toJSONString(ossGlbPaths);
             }
-
+            model.setModelSize(FileWriterUtil.setFileSize(modelSize));
             FileUtil.del(objPath);
         }
         return null;