From 91c4c7a0f050bc1da0bfd30750e3c1171ae2078f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Thu, 27 Aug 2020 19:05:34 +0800 Subject: [PATCH] =?UTF-8?q?CHART-15451=20=E6=97=A5=E6=9C=9F=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E9=9C=80=E8=A6=81=E6=98=AF=E4=B8=80=E7=A7=8D=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/chart/auto/AutoTypeCalculate.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/auto/AutoTypeCalculate.java b/designer-chart/src/main/java/com/fr/design/chart/auto/AutoTypeCalculate.java index c30679e0e..c504a5064 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/auto/AutoTypeCalculate.java +++ b/designer-chart/src/main/java/com/fr/design/chart/auto/AutoTypeCalculate.java @@ -102,22 +102,22 @@ public class AutoTypeCalculate { } private static boolean isNumberData(List values) { - for (String value : values) { - if (!isNumberData(value)) { - return false; + for (Pattern pattern : dataPatterns) { + if (isNumberData(values, pattern)) { + return true; } } - return true; + return false; } - private static boolean isNumberData(String value) { - for (Pattern pattern : dataPatterns) { + private static boolean isNumberData(List values, Pattern pattern) { + for (String value : values) { Matcher matcher = pattern.matcher(value); - if (matcher.matches()) { - return true; + if (!matcher.matches()) { + return false; } } - return false; + return true; } private static List calculateField(String tableName, List columns) {