Przeglądaj źródła

优化Excel匹配数值型.0结尾

RuoYi 11 miesięcy temu
rodzic
commit
57fe1c663e

+ 1 - 1
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java

@@ -390,7 +390,7 @@ public class ExcelUtil<T>
390 390
                     if (String.class == fieldType)
391 391
                     {
392 392
                         String s = Convert.toStr(val);
393
-                        if (StringUtils.endsWith(s, ".0"))
393
+                        if (s.matches("^\\d+\\.0$"))
394 394
                         {
395 395
                             val = StringUtils.substringBefore(s, ".0");
396 396
                         }