feat: 导入支持UTF8编码导入

This commit is contained in:
2023-11-09 14:42:33 +08:00
parent 40221b91ae
commit e2aae12414
2 changed files with 7 additions and 2 deletions
@@ -134,7 +134,7 @@ public class ImportUtil {
try {
standardNumber = cell.toString().trim();
// 必须是数字
if (!standardNumber.matches("^[0-9]*$")) {
if (!standardNumber.matches("^[0-9]+(\\.[0-9]+)?$")) {
log.error("" + row + "" + tag.getDbFieldTxt() + "填写错误,标准号必须为数字 ");
errMsg.append("").append(row).append("").append(tag.getDbFieldTxt()).append("填写错误,标准号必须为数字 ");
break;
@@ -31,7 +31,12 @@ public class FileUnZip {
if (!pathFile.exists()) {
pathFile.mkdirs();
}
ZipFile zip = new ZipFile(zipFile,"gbk");
ZipFile zip = null;
try {
zip = new ZipFile(zipFile,"gbk");
} catch (Exception e) {
zip = new ZipFile(zipFile,"utf-8");
}
String orgMkdirs = "";
int count = 0;
for (Enumeration entries = zip.getEntries(); entries.hasMoreElements(); ) {