fix: 修复excel类型判断错误

This commit is contained in:
taojinlong 2024-12-13 15:43:22 +08:00 committed by dataeaseShu
parent 38123138e2
commit 06739df896

View File

@ -321,6 +321,10 @@ public class ExcelUtils {
if (StringUtils.isEmpty(value) || value.length() > 19) { if (StringUtils.isEmpty(value) || value.length() > 19) {
return "TEXT"; return "TEXT";
} }
String numberFormatRegex = "^[1-9]\\d*$";
if (!value.matches(numberFormatRegex)) {
return "TEXT";
}
String regex = "^-?\\d+(\\.\\d+)?$"; String regex = "^-?\\d+(\\.\\d+)?$";
if (!value.matches(regex)) { if (!value.matches(regex)) {
return "TEXT"; return "TEXT";