From 0c97aac57ef013e764f9e919a42596de4cf8a629 Mon Sep 17 00:00:00 2001
From: fwq <582742538@qq.com>
Date: 星期四, 26 十月 2023 11:26:59 +0800
Subject: [PATCH] 获取客户群消息

---
 src/main/java/com/hx/util/ExcelUtil.java |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/hx/util/ExcelUtil.java b/src/main/java/com/hx/util/ExcelUtil.java
index 9c789f8..cb92bab 100644
--- a/src/main/java/com/hx/util/ExcelUtil.java
+++ b/src/main/java/com/hx/util/ExcelUtil.java
@@ -3,6 +3,7 @@
 import com.hx.exception.TipsException;
 import com.monitorjbl.xlsx.StreamingReader;
 import org.apache.poi.hssf.usermodel.*;
+import org.apache.poi.openxml4j.exceptions.OLE2NotOfficeXmlFileException;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.xssf.streaming.SXSSFWorkbook;
 import org.apache.poi.xssf.usermodel.XSSFCell;
@@ -884,7 +885,10 @@
 					.bufferSize(10240)
 					.open(new FileInputStream(file));
 			listData =readhandle(book);
-		}catch (Exception e){
+		}catch (OLE2NotOfficeXmlFileException ex){
+			ex.printStackTrace();
+			throw new RuntimeException("excel鐗堟湰涓嶄负2007鍙婁互涓�");
+		} catch (Exception e){
 			e.printStackTrace();
 			throw new RuntimeException(e.getMessage());
 		}
@@ -912,7 +916,10 @@
 					.open(new BufferedInputStream(file.getInputStream()));
 
 			listData =readhandle(book);
-		}catch (Exception e){
+		}catch (OLE2NotOfficeXmlFileException ex){
+			ex.printStackTrace();
+			throw new RuntimeException("excel鐗堟湰涓嶄负2007鍙婁互涓�");
+		} catch (Exception e){
 			e.printStackTrace();
 			throw new RuntimeException(e.getMessage());
 		}

--
Gitblit v1.8.0