图片上传
parent
a67e76b4a3
commit
0a0a624983
|
|
@ -39,11 +39,11 @@ public class FileImporter {
|
|||
// 数据库查询SQL
|
||||
private static final String QUERY_HDP_POINT_SQL =
|
||||
"SELECT GUID FROM SHZH_JCSJ.IA_SHZH_HDP_POINT " +
|
||||
"WHERE NAME = ? AND WSCD = ? AND TYPE = ? AND STATUS = '1'";
|
||||
"WHERE NAME = ? AND WSCD = ? AND TYPE = ?";
|
||||
|
||||
private static final String QUERY_RBAD_INFO_SQL =
|
||||
"SELECT GUID FROM SHZH_JCSJ.IA_RBAD_INFO " +
|
||||
"WHERE CD = ? AND WSCD = ? AND STATUS = '1'";
|
||||
"WHERE CD = ? AND WSCD = ?";
|
||||
|
||||
// FILE_ASSOCIATIONS 表相关SQL
|
||||
private static final String CHECK_FILE_ASSOC_SQL =
|
||||
|
|
@ -320,9 +320,6 @@ public class FileImporter {
|
|||
private static List<File> collectImageFiles(File dir) {
|
||||
List<File> imgList = new ArrayList<>();
|
||||
|
||||
// 如果是危险地建房文件夹,需要递归搜索
|
||||
boolean isDangerHouse = dir.getName().contains("危险地建房");
|
||||
|
||||
// 定义图片过滤器
|
||||
FilenameFilter imgFilter = (d, name) -> {
|
||||
String lowerName = name.toLowerCase();
|
||||
|
|
@ -331,16 +328,7 @@ public class FileImporter {
|
|||
lowerName.endsWith(".png");
|
||||
};
|
||||
|
||||
if (isDangerHouse) {
|
||||
// 危险地建房:搜索当前目录及其所有子目录
|
||||
searchImagesRecursively(dir, imgList, imgFilter);
|
||||
} else {
|
||||
// 普通文件夹:只搜索当前目录
|
||||
File[] imgs = dir.listFiles(imgFilter);
|
||||
if (imgs != null) {
|
||||
imgList.addAll(Arrays.asList(imgs));
|
||||
}
|
||||
}
|
||||
searchImagesRecursively(dir, imgList, imgFilter);
|
||||
|
||||
return imgList;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue