根据文件名读取文件工具-文件名格式修改
This commit is contained in:
+4
@@ -61,6 +61,10 @@ public class OcrRecordEOController extends JeroController<OcrRecordEO, IOcrRecor
|
||||
@RequiresPermissions("ocr:ocrRecord:page")
|
||||
public Result<?> queryPageList(@RequestBody OcrRecordEOPage ocrRecordEOPage) {
|
||||
LambdaQueryWrapper<OcrRecordEO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StringUtils.isNotEmpty(ocrRecordEOPage.getStandNumber())) {
|
||||
ocrRecordEOPage.setStandNumber(ocrRecordEOPage.getStandNumber().replace("%","\\%"));
|
||||
}
|
||||
|
||||
queryWrapper.like(StringUtils.isNotEmpty(ocrRecordEOPage.getStandName()), OcrRecordEO::getStandName, ocrRecordEOPage.getStandName())
|
||||
.like(StringUtils.isNotEmpty(ocrRecordEOPage.getStandNumber()), OcrRecordEO::getStandNumber, ocrRecordEOPage.getStandNumber())
|
||||
.eq(StringUtils.isNotEmpty(ocrRecordEOPage.getResultContent()), OcrRecordEO::getResultContent, ocrRecordEOPage.getResultContent())
|
||||
|
||||
+25
-16
@@ -117,6 +117,7 @@ public class FileUnZip {
|
||||
|
||||
/**
|
||||
* 根据文件名称读取固定目录下文件
|
||||
* 适用范围:filename内容 dir/file
|
||||
* gaoyan
|
||||
* @param filename
|
||||
*/
|
||||
@@ -174,22 +175,30 @@ public class FileUnZip {
|
||||
}
|
||||
return resultlist;
|
||||
}
|
||||
// public static List<File> readFileByFilename(String path,String filename) {
|
||||
// List<File> resultlist = new ArrayList<>();
|
||||
// if (StringUtil.isNotEmpty(path)){
|
||||
// File file = new File(path);
|
||||
// if (file.isDirectory()) {
|
||||
// File[] files = file.listFiles();
|
||||
// for (File fi : files) {
|
||||
// // 对文件进行过滤
|
||||
// if (fi.getName().equals(filename)) {
|
||||
// resultlist.add(fi);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return resultlist;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 根据文件名称读取固定目录下文件
|
||||
* 适用范围:filename内容 dir/file; file
|
||||
* @param path
|
||||
* @param filename
|
||||
* @return
|
||||
*/
|
||||
public static List<File> readFileByFilename(String path,String filename) {
|
||||
List<File> resultlist = new ArrayList<>();
|
||||
if (StringUtil.isNotEmpty(path)){
|
||||
File file = new File(path);
|
||||
if (file.isDirectory()) {
|
||||
File[] files = file.listFiles();
|
||||
for (File fi : files) {
|
||||
// 对文件进行过滤
|
||||
if (fi.getName().equals(filename)) {
|
||||
resultlist.add(fi);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return resultlist;
|
||||
}
|
||||
|
||||
/**
|
||||
*@Description: 删除某个文件
|
||||
|
||||
+3
-3
@@ -1217,7 +1217,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
}
|
||||
}
|
||||
}
|
||||
List<File> nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i],null,null,null,null,null);
|
||||
List<File> nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i]);
|
||||
if (nowfilelist != null && !nowfilelist.isEmpty()) {
|
||||
String url = nowfilelist.get(0).getPath();
|
||||
MultipartFile multipartFile = createMfileByPath(url);
|
||||
@@ -1262,7 +1262,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
}
|
||||
}
|
||||
}
|
||||
List<File> nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i],null,null,null,null,null);
|
||||
List<File> nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i]);
|
||||
if (nowfilelist != null && !nowfilelist.isEmpty()) {
|
||||
String url = nowfilelist.get(0).getPath();
|
||||
MultipartFile multipartFile = createMfileByPath(url);
|
||||
@@ -1311,7 +1311,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
}
|
||||
}
|
||||
}
|
||||
List<File> nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i],null,null,null,null,null);
|
||||
List<File> nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i]);
|
||||
if (nowfilelist != null && !nowfilelist.isEmpty()) {
|
||||
String url = nowfilelist.get(0).getPath();
|
||||
MultipartFile multipartFile = createMfileByPath(url);
|
||||
|
||||
+3
-3
@@ -993,7 +993,7 @@ public class SarFileSplitItemsEOServiceImpl extends ServiceImpl<SarFileSplitItem
|
||||
}
|
||||
}
|
||||
}
|
||||
List<File> nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i],null,null,null,null,null);
|
||||
List<File> nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i]);
|
||||
if (nowfilelist != null && !nowfilelist.isEmpty()) {
|
||||
OSSFile ossFile = new OSSFile();
|
||||
ossFile.setFileName(nowfilelist.get(0).getName());
|
||||
@@ -1030,7 +1030,7 @@ public class SarFileSplitItemsEOServiceImpl extends ServiceImpl<SarFileSplitItem
|
||||
}
|
||||
}
|
||||
}
|
||||
List<File> nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i],null,null,null,null,null);
|
||||
List<File> nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i]);
|
||||
if (nowfilelist != null && !nowfilelist.isEmpty()) {
|
||||
OSSFile ossFile = new OSSFile();
|
||||
ossFile.setFileName(nowfilelist.get(0).getName());
|
||||
@@ -1069,7 +1069,7 @@ public class SarFileSplitItemsEOServiceImpl extends ServiceImpl<SarFileSplitItem
|
||||
}
|
||||
}
|
||||
}
|
||||
List<File> nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i],null,null,null,null,null);
|
||||
List<File> nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i]);
|
||||
if (nowfilelist != null && !nowfilelist.isEmpty()) {
|
||||
OSSFile ossFile = new OSSFile();
|
||||
ossFile.setFileName(nowfilelist.get(0).getName());
|
||||
|
||||
Reference in New Issue
Block a user