From dd883671f81cd7b47fe5ee306b565e24807aa0b9 Mon Sep 17 00:00:00 2001 From: Hoky <303455184@qq.com> Date: Tue, 22 Feb 2022 14:31:38 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-64014=20=E5=B1=82=E6=AC=A1=E5=9D=90?= =?UTF-8?q?=E6=A0=87=E4=BC=98=E5=8C=96=201.=E6=96=B0=E5=A2=9E=E4=B8=89?= =?UTF-8?q?=E4=B8=AA=E5=B1=82=E6=AC=A1=E5=9D=90=E6=A0=87=E5=85=AC=E5=BC=8F?= =?UTF-8?q?=EF=BC=9B=202.=E4=BF=AE=E6=94=B9=E5=85=AC=E5=BC=8FSORT=E3=80=81?= =?UTF-8?q?MOM=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/formula/FunctionConstants.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/formula/FunctionConstants.java b/designer-base/src/main/java/com/fr/design/formula/FunctionConstants.java index 28bb985552..6e128a4356 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FunctionConstants.java +++ b/designer-base/src/main/java/com/fr/design/formula/FunctionConstants.java @@ -36,6 +36,7 @@ import java.util.Comparator; import java.util.Enumeration; import java.util.List; import java.util.Set; +import java.util.stream.Collectors; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; @@ -46,6 +47,7 @@ public final class FunctionConstants { public static NameAndFunctionList COMMON = getCommonFunctionList(); public static NameAndTypeAndFunctionList[] EMBFUNCTIONS = getEmbededFunctionListArray(); public static FunctionGroup ALL = getAllFunctionGroup(); + public static List abandonFormulas = Arrays.asList("CIRCULAR", "CROSSLAYERTOTAL", "HIERARCHY", "LAYERTOTAL"); static { loadEmbededFunctions(); @@ -54,7 +56,8 @@ public final class FunctionConstants { /** * Don't let anyone instantiate this class. */ - private FunctionConstants() {} + private FunctionConstants() { + } private static void loadEmbededFunctions() { String pkgName = "com.fr.function"; @@ -88,7 +91,10 @@ public final class FunctionConstants { Class cls = Class.forName(pkgName + "." + fileName.substring(0, fileName.length() - 6)); if (StableUtils.classInstanceOf(cls, iface)) { Function inst; - inst = (Function)cls.newInstance(); + inst = (Function) cls.newInstance(); + if (abandonFormulas.contains(inst.getClass().getSimpleName())) { + continue; + } for (NameAndTypeAndFunctionList EMBFUNCTION : EMBFUNCTIONS) { if (EMBFUNCTION.test(inst)) { break; @@ -300,11 +306,12 @@ public final class FunctionConstants { Collections.addAll(all, CUSTOM.getDescriptions()); //hugh:自定义函数分组 Set containers = ExtraClassManager.getInstance().getArray(FunctionDefContainer.MARK_STRING); - if(!containers.isEmpty()){ - for(Mutable container : containers){ - Collections.addAll(all,createFunctionGroup(((FunctionDefContainer)container)).getDescriptions()); + if (!containers.isEmpty()) { + for (Mutable container : containers) { + Collections.addAll(all, createFunctionGroup(((FunctionDefContainer) container)).getDescriptions()); } } + all = all.stream().filter(n -> !abandonFormulas.contains(n.getName())).collect(Collectors.toList()); Collections.sort(all, new Comparator() { @Override