Browse Source

下载模型,过滤文件

dengsixing 3 years ago
parent
commit
1402b586b9

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

@@ -4889,8 +4889,18 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
             log.info(new File(meshPath).listFiles().toString());
             if(new File(meshPath).listFiles().length > 0){
                 for(File file : new File(meshPath).listFiles()){
-                    if(file.getName().equals("reference.obj")){
-                        file.delete();
+                    if(file.isDirectory()){
+                        for (File item : file.listFiles()) {
+                            if(item.getName().endsWith(".obj") && !"output.house.obj".equals(item.getName()) &&
+                                !"mesh.obj".equals(item.getName())){
+                                item.delete();
+                            }
+                            if(item.getName().endsWith(".mtl") && !"output.house.mtl".equals(item.getName()) &&
+                                !"mesh.mtl".equals(item.getName())){
+                                item.delete();
+                            }
+                        }
+                        continue;
                     }
                     if(file.getName().endsWith(".obj") && !"output.house.obj".equals(file.getName()) &&
                             !"mesh.obj".equals(file.getName())){