lyhzzz hai 1 ano
pai
achega
a2b5c51fcf

+ 7 - 3
src/main/java/com/fdkankan/fusion/service/impl/ThreadService.java

@@ -194,9 +194,9 @@ public class ThreadService {
         List<String> localGlbPaths = new ArrayList<>();
         List<String> ossGlbPaths = new ArrayList<>();
         File localFile = new File(objPath);
-        String size = FileWriterUtil.setFileSize(localFile.length());
 
-        this.toGlB(localFile,localGlbPaths);
+        Long sizeL = this.toGlB(localFile, localGlbPaths);
+        String size = FileWriterUtil.setFileSize(sizeL);
         if(!localGlbPaths.isEmpty()){
             for (String localGlbPath : localGlbPaths) {
                 String ossPath = localGlbPath.replace("/mnt/","");
@@ -218,7 +218,8 @@ public class ThreadService {
     }
 
 
-    private void toGlB(File localFile, List<String> localGlbPath) {
+    private Long toGlB(File localFile, List<String> localGlbPath) {
+        Long size = 0L;
         File[] files = localFile.listFiles();
         for (File file : files) {
             if(file.isDirectory()){
@@ -227,6 +228,7 @@ public class ThreadService {
             if(file.getPath().contains("lod_")  ){
                 if(file.getPath().contains("lod_0") && file.getName().contains(".obj")){
                     String glbPath =  OBJToGLBUtil.objToB3dm(file.getPath(),file.getParentFile().getPath()+"/b3dm");
+                    size += file.length();
                     localGlbPath.add(glbPath);
                 }
                 continue;
@@ -234,9 +236,11 @@ public class ThreadService {
 
             if(file.getName().contains(".obj")){
                 String glbPath =  OBJToGLBUtil.objToB3dm(file.getPath(),file.getParentFile().getPath()+"/b3dm");
+                size += file.length();
                 localGlbPath.add(glbPath);
             }
         }
+        return size;
     }
 
 }