|
@@ -117,20 +117,24 @@ public class NavEmailParser extends AbstractEmailParser {
|
|
|
|
|
|
private List<EmailFundNavDTO> parsePackageFile(EmailContentInfoDTO emailContentInfoDTO, String fileName, String filePath, Map<String, List<String>> emailFieldMap) {
|
|
|
List<EmailFundNavDTO> emailFundNavDTOList = CollUtil.newArrayList();
|
|
|
- if(ExcelUtil.isZip(filePath)){
|
|
|
- String destPath = filePath.replaceAll(".zip", "").replaceAll(".ZIP", "");
|
|
|
- log.info("压缩包地址:{},解压后文件地址:{}", filePath, destPath);
|
|
|
- List<String> dir = ExcelUtil.extractCompressedFiles(filePath, destPath);
|
|
|
- log.info("解压后文件列表大小:{}", dir.size());
|
|
|
- for (String zipFilePath : dir) {
|
|
|
- emailFundNavDTOList.addAll(parseZipFile(emailContentInfoDTO, zipFilePath, emailFieldMap));
|
|
|
- File file = new File(zipFilePath);
|
|
|
- if (file.isDirectory()) {
|
|
|
- for (String navFilePath : Objects.requireNonNull(file.list())) {
|
|
|
- emailFundNavDTOList.addAll(parseZipFile(emailContentInfoDTO, navFilePath, emailFieldMap));
|
|
|
+ try{
|
|
|
+ if(ExcelUtil.isZip(filePath)){
|
|
|
+ String destPath = filePath.replaceAll(".zip", "").replaceAll(".ZIP", "");
|
|
|
+ log.info("压缩包地址:{},解压后文件地址:{}", filePath, destPath);
|
|
|
+ List<String> dir = ExcelUtil.extractCompressedFiles(filePath, destPath);
|
|
|
+ log.info("解压后文件列表大小:{}", dir.size());
|
|
|
+ for (String zipFilePath : dir) {
|
|
|
+ emailFundNavDTOList.addAll(parseZipFile(emailContentInfoDTO, zipFilePath, emailFieldMap));
|
|
|
+ File file = new File(zipFilePath);
|
|
|
+ if (file.isDirectory()) {
|
|
|
+ for (String navFilePath : Objects.requireNonNull(file.list())) {
|
|
|
+ emailFundNavDTOList.addAll(parseZipFile(emailContentInfoDTO, navFilePath, emailFieldMap));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }catch (Exception e){
|
|
|
+ log.error(e.getMessage(),e);
|
|
|
}
|
|
|
try{
|
|
|
if(ExcelUtil.isRAR(filePath)){
|