feat: 导入支持UTF8编码导入
This commit is contained in:
@@ -134,7 +134,7 @@ public class ImportUtil {
|
|||||||
try {
|
try {
|
||||||
standardNumber = cell.toString().trim();
|
standardNumber = cell.toString().trim();
|
||||||
// 必须是数字
|
// 必须是数字
|
||||||
if (!standardNumber.matches("^[0-9]*$")) {
|
if (!standardNumber.matches("^[0-9]+(\\.[0-9]+)?$")) {
|
||||||
log.error("第" + row + "列" + tag.getDbFieldTxt() + "填写错误,标准号必须为数字 ");
|
log.error("第" + row + "列" + tag.getDbFieldTxt() + "填写错误,标准号必须为数字 ");
|
||||||
errMsg.append("第").append(row).append("列").append(tag.getDbFieldTxt()).append("填写错误,标准号必须为数字 ");
|
errMsg.append("第").append(row).append("列").append(tag.getDbFieldTxt()).append("填写错误,标准号必须为数字 ");
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -31,7 +31,12 @@ public class FileUnZip {
|
|||||||
if (!pathFile.exists()) {
|
if (!pathFile.exists()) {
|
||||||
pathFile.mkdirs();
|
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 = "";
|
String orgMkdirs = "";
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (Enumeration entries = zip.getEntries(); entries.hasMoreElements(); ) {
|
for (Enumeration entries = zip.getEntries(); entries.hasMoreElements(); ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user