|
|
|
@ -88,45 +88,6 @@ public class GetInformationForExcelServiceImpl extends ServiceImpl<GetInformatio |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void saveFileList(EquipmentFolderLocation location){ |
|
|
|
//获取文件夹下所有文件 |
|
|
|
//创建本地文件夹路径 |
|
|
|
File fileInfo = new File(location.getFolderPath()); |
|
|
|
//获取本地文件夹下所有文件 |
|
|
|
File[] files = fileInfo.listFiles(); |
|
|
|
//如果文件夹下面的文件是空,则退出 |
|
|
|
if (files == null ||files.length==0) { |
|
|
|
return; |
|
|
|
} |
|
|
|
Map<String, List<File>> map = new HashMap<>(); |
|
|
|
for (File file : files) { |
|
|
|
String fileName = file.getName(); |
|
|
|
int index = fileName.lastIndexOf("."); |
|
|
|
String fileType = fileName.substring(index + 1); |
|
|
|
if (!map.containsKey(fileType)){ |
|
|
|
List<File> list = new ArrayList<>(); |
|
|
|
list.add(file); |
|
|
|
map.put(fileType, list); |
|
|
|
} else { |
|
|
|
map.get(fileType).add(file); |
|
|
|
} |
|
|
|
} |
|
|
|
for (String fileType : map.keySet()) { |
|
|
|
if (!location.getSuffix().contains(fileType)){ |
|
|
|
continue; |
|
|
|
} |
|
|
|
List<File> fileList = map.get(fileType); |
|
|
|
for (File file : fileList) { |
|
|
|
//处理文件 |
|
|
|
|
|
|
|
// 拷贝文件 |
|
|
|
|
|
|
|
// 删除文件 |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void saveInformation(EquipmentFolderLocation equipmentFolderLocation) throws Exception { |
|
|
|
String folderFiler = equipmentFolderLocation.getFolderPath(); |
|
|
|
//获取文件夹下所有文件 |
|
|
|
|