|
@@ -108,20 +108,24 @@ public class FileMangerController {
|
|
|
LambdaQueryWrapper<SystemFile> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.in(SystemFile::getGuid, fileIds);
|
|
|
List<SystemFile> systemFiles = systemFileService.list(queryWrapper);
|
|
|
- systemFiles.forEach(systemFile -> {
|
|
|
- //定义一个空字符串装载文件名后缀
|
|
|
- String extension = "";
|
|
|
- //文件名
|
|
|
- String name = systemFile.getFileName();
|
|
|
- //获取最后一个点的位置
|
|
|
- int dotIndex = name.lastIndexOf(".");
|
|
|
- if (dotIndex > 0 && dotIndex < name.length() - 1) {
|
|
|
- //获取文件名后缀
|
|
|
- extension = name.substring(dotIndex + 1);
|
|
|
- }
|
|
|
- systemFile.setType(extension);
|
|
|
- });
|
|
|
- return systemFiles;
|
|
|
+ if (!systemFiles.isEmpty()) {
|
|
|
+ systemFiles.forEach(systemFile -> {
|
|
|
+ //定义一个空字符串装载文件名后缀
|
|
|
+ String extension = "";
|
|
|
+ //文件名
|
|
|
+ String name = systemFile.getFileName();
|
|
|
+ //获取最后一个点的位置
|
|
|
+ int dotIndex = name.lastIndexOf(".");
|
|
|
+ if (dotIndex > 0 && dotIndex < name.length() - 1) {
|
|
|
+ //获取文件名后缀
|
|
|
+ extension = name.substring(dotIndex + 1);
|
|
|
+ }
|
|
|
+ systemFile.setType(extension);
|
|
|
+ });
|
|
|
+ return systemFiles;
|
|
|
+ } else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|