diff --git a/app.platform/Wsp.class b/app.platform/Wsp.class new file mode 100644 index 00000000..548d6497 Binary files /dev/null and b/app.platform/Wsp.class differ diff --git a/build-version.gradle b/build-version.gradle index e62916d1..a7637fc3 100755 --- a/build-version.gradle +++ b/build-version.gradle @@ -7,6 +7,7 @@ ext['PlatformDependencyVersions'] =[ "org.checkerframework:checker-qual" : "${checker_version}", "com.google.guava:guava" : "${guava_version}", "com.nimbusds:nimbus-jose-jwt" : "9.22", + "org.javassist:javassist" : "${javassist_version}", "org.codehaus.groovy:groovy" : "3.0.19", "org.codehaus.groovy:groovy-jsr223" : "3.0.19", "org.codehaus.groovy:groovy-datetime" : "3.0.19", diff --git a/erm.frontend/package.json b/erm.frontend/package.json index 66347e09..d69c8b9a 100644 --- a/erm.frontend/package.json +++ b/erm.frontend/package.json @@ -1,6 +1,6 @@ { "name": "erm.frontend", - "version": "8.2.2", + "version": "8.2.3", "description": "", "private": false, "keywords": [], @@ -111,7 +111,7 @@ "node-sql-parser": "5.3.4", "pinia": "2.2.6", "pinia-undo": "0.2.4", - "platform-core": "8.2.8", + "platform-core": "8.2.14", "quasar": "2.17.4", "sort-array": "5.0.0", "svg-path-commander": "2.1.5", diff --git a/gradle.properties b/gradle.properties index fcefcff3..7bff8e03 100644 --- a/gradle.properties +++ b/gradle.properties @@ -36,15 +36,15 @@ application_version=1.0.0 # platform ######################################gra##################### platform_group=io.sc -platform_version=8.2.2 -platform_plugin_version=8.2.2 -platform_core_frontend_version=8.2.10 +platform_version=8.2.3 +platform_plugin_version=8.2.3 +platform_core_frontend_version=8.2.14 ########################################################### # dependencies version ########################################################### asciidoctor_version=3.3.2 -asm_version=9.7 +asm_version=9.7.1 checker_version=3.43.0 commons_fileupload_version=1.4 commons_io_version=2.16.1 @@ -56,6 +56,7 @@ flowable_version=6.8.0 guava_version=31.1-jre ipaddress_version=5.4.0 jackson_version=2.13.5 +javassist_version=3.21.0-GA jasypt_version=2.1.2 jboss_logging_version=3.3.2.Final jcommander_version=1.82 diff --git a/io.sc.creditreport.core/build.gradle b/io.sc.creditreport.core/build.gradle index 684f8027..00c84bd7 100644 --- a/io.sc.creditreport.core/build.gradle +++ b/io.sc.creditreport.core/build.gradle @@ -1,6 +1,5 @@ dependencies { api( - "org.springframework:spring-core", - "com.fasterxml.jackson.dataformat:jackson-dataformat-xml", + project(":io.sc.platform.util"), ) } diff --git a/io.sc.creditreport.core/src/main/java/io/sc/creditreport/core/CreditReportParser.java b/io.sc.creditreport.core/src/main/java/io/sc/creditreport/core/CreditReportParser.java index 633bf2b7..3f758cc6 100644 --- a/io.sc.creditreport.core/src/main/java/io/sc/creditreport/core/CreditReportParser.java +++ b/io.sc.creditreport.core/src/main/java/io/sc/creditreport/core/CreditReportParser.java @@ -1,28 +1,14 @@ package io.sc.creditreport.core; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.MapperFeature; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.dataformat.xml.XmlMapper; +import io.sc.platform.util.ObjectMapperUtil; public class CreditReportParser { - private static XmlMapper mapper =new XmlMapper(); - - static { - mapper.configure(DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES,false); - mapper.configure(SerializationFeature.WRAP_ROOT_VALUE,false); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - mapper.enable(MapperFeature.USE_STD_BEAN_NAMING); - } - public static io.sc.creditreport.core.person.Document parsePersonCreditReport(String xml) throws JsonProcessingException { - return mapper.readValue(xml, io.sc.creditreport.core.person.Document.class); + return ObjectMapperUtil.xml().readValue(xml, io.sc.creditreport.core.person.Document.class); } public static io.sc.creditreport.core.company.Document parseCompanyCreditReport(String xml) throws JsonProcessingException { - return mapper.readValue(xml, io.sc.creditreport.core.company.Document.class); + return ObjectMapperUtil.xml().readValue(xml, io.sc.creditreport.core.company.Document.class); } } diff --git a/io.sc.engine.mv.frontend/package.json b/io.sc.engine.mv.frontend/package.json index 6388d392..cb59ee45 100644 --- a/io.sc.engine.mv.frontend/package.json +++ b/io.sc.engine.mv.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.engine.mv.frontend", - "version": "8.2.2", + "version": "8.2.3", "description": "", "private": false, "keywords": [], @@ -111,7 +111,7 @@ "node-sql-parser": "5.3.4", "pinia": "2.2.6", "pinia-undo": "0.2.4", - "platform-core": "8.2.10", + "platform-core": "8.2.14", "quasar": "2.17.4", "sort-array": "5.0.0", "svg-path-commander": "2.1.5", @@ -122,4 +122,4 @@ "vue-router": "4.5.0", "xml-formatter": "3.6.3" } -} +} \ No newline at end of file diff --git a/io.sc.engine.rule.client/src/main/java/io/sc/engine/rule/client/local/LocalExecutor.java b/io.sc.engine.rule.client/src/main/java/io/sc/engine/rule/client/local/LocalExecutor.java index 5ef7bcab..e7a124af 100644 --- a/io.sc.engine.rule.client/src/main/java/io/sc/engine/rule/client/local/LocalExecutor.java +++ b/io.sc.engine.rule.client/src/main/java/io/sc/engine/rule/client/local/LocalExecutor.java @@ -29,60 +29,60 @@ public class LocalExecutor implements Executor { @Override public void compile(String resourceId) throws Exception { ExecuteUnit executeUnit =loader.load(resourceId); - EngineRuntime.getInstance().compileById(resourceId,executeUnit); + EngineRuntime.getInstance().compile(resourceId,executeUnit); } @Override public void compile(String resourceCode, Integer version) throws Exception { ExecuteUnit executeUnit =loader.load(resourceCode,version); - EngineRuntime.getInstance().compileByCode(resourceCode,version,executeUnit); + EngineRuntime.getInstance().compile(resourceCode,version,executeUnit); } @Override public ResourceResult execute(String resourceId, Map map) throws Exception { ExecuteUnit executeUnit =loader.load(resourceId); - return EngineRuntime.getInstance().executeById(this,resourceId,executeUnit, map); + return EngineRuntime.getInstance().execute(this,resourceId,executeUnit, map); } @Override public ResourceResult execute(String resourceId, String json) throws Exception { ExecuteUnit executeUnit =loader.load(resourceId); - return EngineRuntime.getInstance().executeById(this,resourceId,executeUnit, json); + return EngineRuntime.getInstance().execute(this,resourceId,executeUnit, json); } @Override public ResourceResult execute(String resourceId, String subModelCode, Map map) throws Exception { ExecuteUnit executeUnit =loader.load(resourceId); - return EngineRuntime.getInstance().executeById(this,resourceId,executeUnit,subModelCode,map); + return EngineRuntime.getInstance().execute(this,resourceId,executeUnit,subModelCode,map); } @Override public ResourceResult execute(String resourceId, String subModelCode, String json) throws Exception { ExecuteUnit executeUnit =loader.load(resourceId); - return EngineRuntime.getInstance().executeById(this,resourceId,executeUnit,subModelCode,json); + return EngineRuntime.getInstance().execute(this,resourceId,executeUnit,subModelCode,json); } @Override public ResourceResult execute(String resourceCode, Integer version, Map map) throws Exception { ExecuteUnit executeUnit =loader.load(resourceCode, version); - return EngineRuntime.getInstance().executeByCode(this,resourceCode,version,executeUnit, map); + return EngineRuntime.getInstance().execute(this,resourceCode,version,executeUnit, map); } @Override public ResourceResult execute(String resourceCode, Integer version, String json) throws Exception { ExecuteUnit executeUnit =loader.load(resourceCode, version); - return EngineRuntime.getInstance().executeByCode(this,resourceCode,version,executeUnit, json); + return EngineRuntime.getInstance().execute(this,resourceCode,version,executeUnit, json); } @Override public ResourceResult execute(String resourceCode, Integer version, String subModelCode, Map map) throws Exception { ExecuteUnit executeUnit =loader.load(resourceCode, version); - return EngineRuntime.getInstance().executeByCode(this,resourceCode,version,executeUnit,subModelCode,map); + return EngineRuntime.getInstance().execute(this,resourceCode,version,executeUnit,subModelCode,map); } @Override public ResourceResult execute(String resourceCode, Integer version, String subModelCode, String json) throws Exception { ExecuteUnit executeUnit =loader.load(resourceCode, version); - return EngineRuntime.getInstance().executeByCode(this,resourceCode,version,executeUnit,subModelCode,json); + return EngineRuntime.getInstance().execute(this,resourceCode,version,executeUnit,subModelCode,json); } } diff --git a/io.sc.engine.rule.client/src/main/java/io/sc/engine/rule/client/runtime/EngineRuntime.java b/io.sc.engine.rule.client/src/main/java/io/sc/engine/rule/client/runtime/EngineRuntime.java index ade878f3..8236c0f0 100644 --- a/io.sc.engine.rule.client/src/main/java/io/sc/engine/rule/client/runtime/EngineRuntime.java +++ b/io.sc.engine.rule.client/src/main/java/io/sc/engine/rule/client/runtime/EngineRuntime.java @@ -21,19 +21,18 @@ public abstract class EngineRuntime { public static EngineRuntime getInstance() { return getInstance(GROOVY); } + + public abstract void compile(String resourceId, ExecuteUnit wrapper) throws Exception; + public abstract void compile(String resourceCode, Integer version, ExecuteUnit wrapper) throws Exception; - public abstract ResourceResult executeById(Executor executor, String resourceId, ExecuteUnit wrapper, String json) throws Exception; - public abstract ResourceResult executeById(Executor executor,String resourceId,ExecuteUnit wrapper,String subModelCode,String json) throws Exception; - - public abstract ResourceResult executeByCode(Executor executor,String resourceCode,Integer version,ExecuteUnit wrapper,String json) throws Exception; - public abstract ResourceResult executeByCode(Executor executor,String resourceCode,Integer version,ExecuteUnit wrapper,String subModelCode,String json) throws Exception; - - public abstract ResourceResult executeById(Executor executor,String resourceId,ExecuteUnit wrapper,Map map) throws Exception; - public abstract ResourceResult executeById(Executor executor,String resourceId,ExecuteUnit wrapper,String subModelCode,Map map) throws Exception; - - public abstract ResourceResult executeByCode(Executor executor,String resourceCode,Integer version,ExecuteUnit wrapper,Map map) throws Exception; - public abstract ResourceResult executeByCode(Executor executor,String resourceCode,Integer version,ExecuteUnit wrapper,String subModelCode,Map map) throws Exception; + public abstract ResourceResult execute(Executor executor, String resourceId, ExecuteUnit wrapper, String json) throws Exception; + public abstract ResourceResult execute(Executor executor, String resourceId, ExecuteUnit wrapper, Map map) throws Exception; + public abstract ResourceResult execute(Executor executor, String resourceId, ExecuteUnit wrapper, String subModelCode, String json) throws Exception; + public abstract ResourceResult execute(Executor executor, String resourceId, ExecuteUnit wrapper, String subModelCode, Map map) throws Exception; - public abstract void compileById(String resourceId,ExecuteUnit wrapper) throws Exception; - public abstract void compileByCode(String resourceCode,Integer version,ExecuteUnit wrapper) throws Exception; + public abstract ResourceResult execute(Executor executor, String resourceCode, Integer version, ExecuteUnit wrapper, String json) throws Exception; + public abstract ResourceResult execute(Executor executor, String resourceCode, Integer version, ExecuteUnit wrapper, Map map) throws Exception; + public abstract ResourceResult execute(Executor executor, String resourceCode, Integer version, ExecuteUnit wrapper, String subModelCode, String json) throws Exception; + public abstract ResourceResult execute(Executor executor, String resourceCode, Integer version, ExecuteUnit wrapper, String subModelCode, Map map) throws Exception; + } diff --git a/io.sc.engine.rule.client/src/main/java/io/sc/engine/rule/client/runtime/impl/GroovyEngineRuntime.java b/io.sc.engine.rule.client/src/main/java/io/sc/engine/rule/client/runtime/impl/GroovyEngineRuntime.java index 13678982..79281779 100644 --- a/io.sc.engine.rule.client/src/main/java/io/sc/engine/rule/client/runtime/impl/GroovyEngineRuntime.java +++ b/io.sc.engine.rule.client/src/main/java/io/sc/engine/rule/client/runtime/impl/GroovyEngineRuntime.java @@ -28,7 +28,7 @@ public class GroovyEngineRuntime extends EngineRuntime{ } @Override - public void compileById(String resourceId, ExecuteUnit executeUnit) throws Exception { + public void compile(String resourceId, ExecuteUnit executeUnit) throws Exception { SourceCode code = generator.generate(resourceId, executeUnit); String resourceName =null; if("RESOURCE".equals(executeUnit.getType())){ @@ -49,7 +49,7 @@ public class GroovyEngineRuntime extends EngineRuntime{ } @Override - public void compileByCode(String resourceCode, Integer version, ExecuteUnit wrapper) throws Exception { + public void compile(String resourceCode, Integer version, ExecuteUnit wrapper) throws Exception { SourceCode code = generator.generate(resourceCode, version, wrapper); String resourceName =null; if("RESOURCE".equals(wrapper.getType())){ @@ -69,31 +69,31 @@ public class GroovyEngineRuntime extends EngineRuntime{ } @Override - public ResourceResult executeById(Executor executor, String resourceId, ExecuteUnit wrapper, String json) throws Exception { + public ResourceResult execute(Executor executor, String resourceId, ExecuteUnit wrapper, String json) throws Exception { SourceCode code = generator.generate(resourceId,wrapper); if(log.isDebugEnabled()) {log.debug("generated groovy source code:\n{}",code.getSource());} ResourceResult result =(ResourceResult)service.eval(code.getSource(), "INPUT_PARAMETER", prepareParameter(executor,null,json)); return result; } - + @Override - public ResourceResult executeById(Executor executor,String resourceId, ExecuteUnit wrapper, String subModelCode, String json) throws Exception { + public ResourceResult execute(Executor executor, String resourceId, ExecuteUnit wrapper, Map map) throws Exception { SourceCode code = generator.generate(resourceId,wrapper); if(log.isDebugEnabled()) {log.debug("generated groovy source code:\n{}",code.getSource());} - ResourceResult result =(ResourceResult)service.eval(code.getSource(), "INPUT_PARAMETER", prepareParameter(executor,subModelCode,json)); + ResourceResult result =(ResourceResult)service.eval(code.getSource(), "INPUT_PARAMETER", prepareParameter(executor,null,map)); return result; } - + @Override - public ResourceResult executeById(Executor executor,String resourceId, ExecuteUnit wrapper, Map map) throws Exception { + public ResourceResult execute(Executor executor, String resourceId, ExecuteUnit wrapper, String subModelCode, String json) throws Exception { SourceCode code = generator.generate(resourceId,wrapper); if(log.isDebugEnabled()) {log.debug("generated groovy source code:\n{}",code.getSource());} - ResourceResult result =(ResourceResult)service.eval(code.getSource(), "INPUT_PARAMETER", prepareParameter(executor,null,map)); + ResourceResult result =(ResourceResult)service.eval(code.getSource(), "INPUT_PARAMETER", prepareParameter(executor,subModelCode,json)); return result; } - + @Override - public ResourceResult executeById(Executor executor,String resourceId, ExecuteUnit wrapper, String subModelCode, Map map) throws Exception { + public ResourceResult execute(Executor executor, String resourceId, ExecuteUnit wrapper, String subModelCode, Map map) throws Exception { SourceCode code = generator.generate(resourceId,wrapper); if(log.isDebugEnabled()) {log.debug("generated groovy source code:\n{}",code.getSource());} ResourceResult result =(ResourceResult)service.eval(code.getSource(), "INPUT_PARAMETER", prepareParameter(executor,subModelCode,map)); @@ -101,7 +101,7 @@ public class GroovyEngineRuntime extends EngineRuntime{ } @Override - public ResourceResult executeByCode(Executor executor,String resourceCode, Integer version, ExecuteUnit wrapper, String json) throws Exception { + public ResourceResult execute(Executor executor, String resourceCode, Integer version, ExecuteUnit wrapper, String json) throws Exception { SourceCode code = generator.generate(resourceCode,version,wrapper); if(log.isDebugEnabled()) {log.debug("generated groovy source code:\n{}",code.getSource());} ResourceResult result =(ResourceResult)service.eval(code.getSource(), "INPUT_PARAMETER", prepareParameter(executor,null,json)); @@ -109,23 +109,23 @@ public class GroovyEngineRuntime extends EngineRuntime{ } @Override - public ResourceResult executeByCode(Executor executor,String resourceCode, Integer version, ExecuteUnit wrapper, String subModelCode, String json) throws Exception { + public ResourceResult execute(Executor executor, String resourceCode, Integer version, ExecuteUnit wrapper, Map map) throws Exception { SourceCode code = generator.generate(resourceCode,version,wrapper); - if(log.isDebugEnabled()) {log.debug("generated groovy source code:\n{}",code.getSource());} - ResourceResult result =(ResourceResult)service.eval(code.getSource(), "INPUT_PARAMETER", prepareParameter(executor,subModelCode,json)); + //if(log.isDebugEnabled()) {log.debug("generated groovy source code:\n{}",code.getSource());} + ResourceResult result =(ResourceResult)service.eval(code.getSource(), "INPUT_PARAMETER", prepareParameter(executor,null,map)); return result; } @Override - public ResourceResult executeByCode(Executor executor,String resourceCode, Integer version, ExecuteUnit wrapper,Map map) throws Exception { + public ResourceResult execute(Executor executor, String resourceCode, Integer version, ExecuteUnit wrapper, String subModelCode, String json) throws Exception { SourceCode code = generator.generate(resourceCode,version,wrapper); - //if(log.isDebugEnabled()) {log.debug("generated groovy source code:\n{}",code.getSource());} - ResourceResult result =(ResourceResult)service.eval(code.getSource(), "INPUT_PARAMETER", prepareParameter(executor,null,map)); + if(log.isDebugEnabled()) {log.debug("generated groovy source code:\n{}",code.getSource());} + ResourceResult result =(ResourceResult)service.eval(code.getSource(), "INPUT_PARAMETER", prepareParameter(executor,subModelCode,json)); return result; } @Override - public ResourceResult executeByCode(Executor executor,String resourceCode, Integer version, ExecuteUnit wrapper, String subModelCode, Map map) throws Exception { + public ResourceResult execute(Executor executor, String resourceCode, Integer version, ExecuteUnit wrapper, String subModelCode, Map map) throws Exception { SourceCode code = generator.generate(resourceCode,version,wrapper); if(log.isDebugEnabled()) {log.debug("generated groovy source code:\n{}",code.getSource());} ResourceResult result =(ResourceResult)service.eval(code.getSource(), "INPUT_PARAMETER", prepareParameter(executor,subModelCode,map)); diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/ParameterResult.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/ParameterResult.java index f26484e2..bda83f55 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/ParameterResult.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/ParameterResult.java @@ -21,9 +21,9 @@ public class ParameterResult { private RoundingMode valueRoundingMode; //参数值四舍五入模式 private String defaultValue; //默认值 private String value; //结果值 - private RuleResult ruleResult; //规则结果值 private SingleRuleResult singleRuleResult; //单规则结果值 - + private RuleSetResult ruleSetResult; //规则集结果值 + public ParameterResult() {} public ParameterResult(String code,String name,ParameterType type,String valueType,String value) { this.code =code; @@ -32,19 +32,19 @@ public class ParameterResult { this.valueType =valueType; this.value =value; } - - public ParameterResult(String code,String name,ParameterType type,RuleResult ruleResult) { + + public ParameterResult(String code,String name,ParameterType type,SingleRuleResult singleRuleResult) { this.code =code; this.name =name; this.type =type; - this.ruleResult =ruleResult; + this.singleRuleResult =singleRuleResult; } - - public ParameterResult(String code,String name,ParameterType type,SingleRuleResult singleRuleResult) { + + public ParameterResult(String code, String name, ParameterType type, RuleSetResult ruleSetResult) { this.code =code; this.name =name; this.type =type; - this.singleRuleResult =singleRuleResult; + this.ruleSetResult =ruleSetResult; } public ParameterResult(String code,String name,ParameterType type,String valueType,Integer valueScale,RoundingMode valueRoundingMode,String value) { @@ -117,26 +117,16 @@ public class ParameterResult { public void setValue(String value) { this.value = value; } - public RuleResult getRuleResult() { - return ruleResult; - } - public void setRuleResult(RuleResult ruleResult) { - this.ruleResult = ruleResult; - } public SingleRuleResult getSingleRuleResult() { return singleRuleResult; } public void setSingleRuleResult(SingleRuleResult singleRuleResult) { this.singleRuleResult = singleRuleResult; } - @Override - public String toString() { - try { - return ObjectMapperUtil.json().writeValueAsString(this); - } catch (JsonProcessingException e) { - return "ParameterResult [code=" + code + ", name=" + name + ", type=" + type + ", valueType=" + valueType - + ", valueScale=" + valueScale + ", valueRoundingMode=" + valueRoundingMode + ", defaultValue=" - + defaultValue + ", value=" + value + "]"; - } + public RuleSetResult getRuleResult() { + return ruleSetResult; + } + public void setRuleResult(RuleSetResult ruleResult) { + this.ruleSetResult = ruleResult; } } diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/ResourceResult.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/ResourceResult.java index 67473093..99738b62 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/ResourceResult.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/ResourceResult.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import io.sc.engine.rule.core.enums.ParameterType; import io.sc.platform.util.ObjectMapperUtil; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/RuleResult.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/RuleSetResult.java similarity index 93% rename from io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/RuleResult.java rename to io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/RuleSetResult.java index 8e250d40..fb4640bb 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/RuleResult.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/RuleSetResult.java @@ -9,10 +9,10 @@ import java.util.List; /** * 规则结果值 */ -public class RuleResult { +public class RuleSetResult { private boolean triggered; //是否触发 private Integer level; //等级 - private List rules =new ArrayList(); //触发的规则集合 + private List rules =new ArrayList<>(); //触发的规则集合 public void addRule(boolean isTriggered,Integer level,String code,String name,String category,String value,String message) { Rule rule =new Rule(isTriggered,level,code,name,category,value,message); @@ -85,7 +85,7 @@ public class RuleResult { return false; if (getClass() != obj.getClass()) return false; - RuleResult other = (RuleResult) obj; + RuleSetResult other = (RuleSetResult) obj; if (triggered != other.triggered) return false; if (level == null) { diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/ScoreCardItem.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/ScoreCardItem.java similarity index 87% rename from io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/ScoreCardItem.java rename to io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/ScoreCardItem.java index be6b837f..06563e14 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/ScoreCardItem.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/ScoreCardItem.java @@ -1,6 +1,8 @@ -package io.sc.engine.rule.core.code.generator.impl.processor; +package io.sc.engine.rule.core; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import io.sc.engine.rule.core.code.generator.impl.processor.ConditionRange; +import io.sc.engine.rule.core.code.generator.impl.processor.NumberRange; import io.sc.engine.rule.core.enums.ProcessorType; import java.util.List; diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/ExecuteUnit4ResourceGenerator.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/ExecuteUnit4ResourceGenerator.java index 3f796e3c..cdfa7798 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/ExecuteUnit4ResourceGenerator.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/ExecuteUnit4ResourceGenerator.java @@ -60,6 +60,9 @@ public class ExecuteUnit4ResourceGenerator extends ExecuteUnitGenerator { engine.addSharedObject("SqlFieldMapping",new SqlFieldMapping()); engine.addSharedObject("Ternary",new Ternary()); engine.addSharedObject("WhenThen",new WhenThen()); + engine.addSharedObject("ScoreCard",new ScoreCard()); + engine.addSharedObject("SingleRule",new SingleRule()); + engine.addSharedObject("RuleSet",new RuleSet()); Map data =new HashMap<>(); data.put("packageName",this.getPackageName()); diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/GroovySourceCodeGenerator.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/GroovySourceCodeGenerator.java index c9af0595..35b72409 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/GroovySourceCodeGenerator.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/GroovySourceCodeGenerator.java @@ -22,6 +22,6 @@ public class GroovySourceCodeGenerator implements SourceCodeGenerator { @Override public SourceCode generate(String resourceCode, Integer version, ExecuteUnit executeUnit) throws Exception { - return null; + return generate(executeUnit); } } diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/IndicatorGenerator.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/IndicatorGenerator.java index cea816f9..6a5586a0 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/IndicatorGenerator.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/IndicatorGenerator.java @@ -1,5 +1,6 @@ package io.sc.engine.rule.core.code.generator.impl; +import io.sc.engine.rule.core.enums.IndicatorType; import io.sc.engine.rule.core.enums.ParameterType; import io.sc.engine.rule.core.po.lib.Indicator; import io.sc.engine.rule.core.po.lib.IndicatorValidator; @@ -200,7 +201,7 @@ public class IndicatorGenerator { variables.put("valueRoundingMode",valueRoundingMode==null?RoundingMode.HALF_UP:valueRoundingMode); variables.put("fieldName",IdReplacer.fieldName(code)); - if(ParameterType.INDICATOR.equals(indicator.getType()) || ParameterType.OUT.equals(indicator.getType()) || ParameterType.INTERMEDIATE.equals(indicator.getType())){ + if(IndicatorType.INDICATOR.equals(indicator.getType())){ if(ValueTypeUtil.isDecimal(indicator.getValueType())){ String tpl ="result.addParameterResult(new ParameterResult('${code}','${name}',ParameterType.${type},'${valueType}',${valueScale},RoundingMode.${valueRoundingMode},this.${fieldName}==null?null:this.${fieldName}.setScale(${valueScale},RoundingMode.${valueRoundingMode})));"; sb.append(StringUtil.format(tpl,variables)).append("\n"); diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/ParameterGenerator.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/ParameterGenerator.java index 68c04aaa..283b9ee9 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/ParameterGenerator.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/ParameterGenerator.java @@ -1,5 +1,6 @@ package io.sc.engine.rule.core.code.generator.impl; +import io.sc.engine.rule.core.RuleSetResult; import io.sc.engine.rule.core.enums.ParameterType; import io.sc.engine.rule.core.po.model.Parameter; import io.sc.engine.rule.core.po.model.ParameterValidator; @@ -199,10 +200,10 @@ public class ParameterGenerator { if(ParameterType.INDICATOR.equals(parameter.getType()) || ParameterType.OUT.equals(parameter.getType()) || ParameterType.INTERMEDIATE.equals(parameter.getType())){ if(ValueTypeUtil.isDecimal(parameter.getValueType())){ - String tpl ="result.addParameterResult(new ParameterResult('${code}','${name}',ParameterType.${type},'${valueType}',${valueScale},RoundingMode.${valueRoundingMode},this.${fieldName}==null?null:this.${fieldName}.setScale(${valueScale},RoundingMode.${valueRoundingMode})));"; + String tpl ="result.addParameterResult(new ParameterResult('${code}','${name}',ParameterType.${type},'${valueType}',${valueScale},RoundingMode.${valueRoundingMode},this.${fieldName}==null?null:this.${fieldName}.setScale(${valueScale},RoundingMode.${valueRoundingMode}).toString()));"; sb.append(StringUtil.format(tpl,variables)).append("\n"); }else if(ValueTypeUtil.isBase(parameter.getValueType())){ - String tpl ="result.addParameterResult(new ParameterResult('${code}','${name}',ParameterType.${type},'${valueType}',null,null,this.${fieldName}==null?null:this.${fieldName}));"; + String tpl ="result.addParameterResult(new ParameterResult('${code}','${name}',ParameterType.${type},'${valueType}',null,null,this.${fieldName}==null?null:this.${fieldName}.toString()));"; sb.append(StringUtil.format(tpl,variables)).append("\n"); }else{ String tpl ="result.addParameterResult(new ParameterResult('${code}','${name}',ParameterType.${type},'${valueType}',null,null,this.${fieldName}==null?null:ObjectMapperUtil.json().writeValueAsString(this.${fieldName})));"; diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/ConditionRange.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/ConditionRange.java index d8d51847..fec184ea 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/ConditionRange.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/ConditionRange.java @@ -42,7 +42,7 @@ public class ConditionRange { } } - private String groovy(String code, String valueType,List conditionRanges){ + public String groovy(String code, String valueType,List conditionRanges){ if(!CollectionUtil.hasElements(conditionRanges)){ return null; } List _conditionRanges =new ArrayList(); //移除没有填写条件的条件范围 diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/ExecutionFlow.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/ExecutionFlow.java index 07e00b53..6c533adf 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/ExecutionFlow.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/ExecutionFlow.java @@ -88,7 +88,7 @@ public class ExecutionFlow { methodNameCache.put(methodName, null); } } - return StringUtil.tabs(sb.toString(),1); + return sb.toString(); } /** @@ -101,16 +101,15 @@ public class ExecutionFlow { */ private String generateConditionGroovyCode(Map methodNameCache,Parameter parameter,ConditionNode node,String methodName) { StringBuilder sb =new StringBuilder(); - sb.append("\tprivate static void ").append(methodName).append("(Executor executor,Argument ").append(ExpressionReplacer.ARGUMENT_NAME).append("){//条件判断").append("\n"); + sb.append("private static void ").append(methodName).append("(Executor executor,Argument ").append(ExpressionReplacer.ARGUMENT_NAME).append("){//条件判断").append("\n"); List branches =node.getOuts(); //获取条件的所有出口边 if(branches!=null && branches.size()>0) { List outs =orderEdges(branches); //对出口边进行排序,有条件的放前面,无条件的放后面 for(int i=0;i0) { for(String split : commandSplits) { - sb.append("\t\t\t").append(split).append("\n"); + sb.append("\t\t").append(split).append("\n"); } } } - sb.append("\t\t\t").append("Flow_").append(parameter.getCode()).append("_").append(nexNode.getId()).append("(").append("executor,").append(ExpressionReplacer.ARGUMENT_NAME).append(");").append("\n"); - sb.append("\t\t}"); + sb.append("\t\t").append("Flow_").append(parameter.getCode()).append("_").append(nexNode.getId()).append("(").append("executor,").append(ExpressionReplacer.ARGUMENT_NAME).append(");").append("\n"); + sb.append("\t}"); } - sb.append("\n\t}\n\n"); + sb.append("\n}\n\n"); //继续生成后续方法 for(GraphNode out :outs) { sb.append(_generateGroovyCode(methodNameCache,parameter,out.getOuts().get(0))); @@ -149,16 +148,16 @@ public class ExecutionFlow { */ private String generateParallelGroovyCode(Map methodNameCache,Parameter parameter,ParallelNode node,String methodName) { StringBuilder sb =new StringBuilder(); - sb.append("\tprivate static void ").append(methodName).append("(Executor executor,Argument ").append(ExpressionReplacer.ARGUMENT_NAME).append("){//并发网关").append("\n"); + sb.append("private static void ").append(methodName).append("(Executor executor,Argument ").append(ExpressionReplacer.ARGUMENT_NAME).append("){//并发网关").append("\n"); List outs =node.getOuts(); //获取条件的所有出口边 if(outs!=null && outs.size()>0) { for(int i=0;i methodNameCache,Parameter parameter,CommandSetNode node,String methodName) { StringBuilder sb =new StringBuilder(); - sb.append("\tprivate static void ").append(methodName).append("(Executor executor,Argument ").append(ExpressionReplacer.ARGUMENT_NAME).append("){//指令集").append("\n"); + sb.append("private static void ").append(methodName).append("(Executor executor,Argument ").append(ExpressionReplacer.ARGUMENT_NAME).append("){//指令集").append("\n"); String commands =node.getCommands(); if(commands!=null && !commands.isEmpty()) { - sb.append("\t\t").append(ExpressionReplacer.groovy(commands,null)).append("\n"); + sb.append("\t").append(ExpressionReplacer.groovy(commands,null)).append("\n"); //继续调用后续方法 List edges =node.getOuts(); //获取条件的所有出口边 if(edges!=null && edges.size()>0) { for(GraphNode edge : edges) { GraphNode nexNode =edge.getOuts().get(0); //出口边指向的节点 - sb.append("\t\t").append("Flow_").append(parameter.getCode()).append("_").append(nexNode.getId()).append("(").append("executor,").append(ExpressionReplacer.ARGUMENT_NAME).append(");").append("\n"); + sb.append("\t").append("Flow_").append(parameter.getCode()).append("_").append(nexNode.getId()).append("(").append("executor,").append(ExpressionReplacer.ARGUMENT_NAME).append(");").append("\n"); } } } - sb.append("\t}").append("\n\n"); + sb.append("}").append("\n\n"); //继续生成后续方法 List edges =node.getOuts(); //获取条件的所有出口边 @@ -213,23 +212,23 @@ public class ExecutionFlow { */ private String generateResourceAbstractGroovyCode(Map methodNameCache,Parameter parameter,ResourceAbstractNode node,String methodName) { StringBuilder sb =new StringBuilder(); - sb.append("\tprivate static void ").append(methodName).append("(Executor executor,Argument ").append(ExpressionReplacer.ARGUMENT_NAME).append("){//资源").append("\n"); + sb.append("private static void ").append(methodName).append("(Executor executor,Argument ").append(ExpressionReplacer.ARGUMENT_NAME).append("){//资源").append("\n"); String code =node.getCode(); String version =node.getVersion(); if(version==null || version.trim().equals("")) { version ="null"; } - sb.append("\t\t").append("ResourceResult result =executor.executeByCode(\"").append(code).append("\",").append(version).append(",arg.toMap())").append(";\n"); - sb.append("\t\t").append("arg.mergeResult(result);").append("\n"); + sb.append("\t").append("ResourceResult result =executor.execute(\"").append(code).append("\",").append(version).append(",arg.toMap())").append(";\n"); + sb.append("\t").append("arg.mergeResult(result);").append("\n"); //继续调用后续方法 List edges =node.getOuts(); //获取条件的所有出口边 if(edges!=null && edges.size()>0) { for(GraphNode edge : edges) { GraphNode nexNode =edge.getOuts().get(0); //出口边指向的节点 - sb.append("\t\t").append("Flow_").append(parameter.getCode()).append("_").append(nexNode.getId()).append("(").append("executor,").append(ExpressionReplacer.ARGUMENT_NAME).append(");").append("\n"); + sb.append("\t").append("Flow_").append(parameter.getCode()).append("_").append(nexNode.getId()).append("(").append("executor,").append(ExpressionReplacer.ARGUMENT_NAME).append(");").append("\n"); } } - sb.append("\t}").append("\n\n"); + sb.append("}").append("\n\n"); //继续生成后续方法 edges =node.getOuts(); //获取条件的所有出口边 @@ -252,7 +251,7 @@ public class ExecutionFlow { */ private String generateConfigurableResourceAbstractGroovyCode(Map methodNameCache,Parameter parameter,ConfigurableResourceAbstractNode node,String methodName) { StringBuilder sb =new StringBuilder(); - sb.append("\tprivate static void ").append(methodName).append("(Executor executor,Argument ").append(ExpressionReplacer.ARGUMENT_NAME).append("){//可配置资源").append("\n"); + sb.append("private static void ").append(methodName).append("(Executor executor,Argument ").append(ExpressionReplacer.ARGUMENT_NAME).append("){//可配置资源").append("\n"); String code =node.getCode(); String version =node.getVersion(); String inputCommands =node.getInputCommands(); @@ -261,24 +260,24 @@ public class ExecutionFlow { version ="null"; } - sb.append("\t\t//准备调用资源的输入参数\n"); - sb.append("\t\t").append("Map map =new HashMap();").append("\n"); - sb.append("\t\t").append(ExpressionReplacer.groovy(inputCommands,null).replace("\n", "\n\t\t")).append("\n"); + sb.append("\t//准备调用资源的输入参数\n"); + sb.append("\t").append("Map map =new HashMap();").append("\n"); + sb.append("\t").append(StringUtil.tabs(ExpressionReplacer.groovy(inputCommands,null),1)).append("\n"); sb.append("\n"); - sb.append("\t\t//调用资源\n"); - sb.append("\t\t").append("ResourceResult result =executor.executeByCode(\"").append(code).append("\",").append(version).append(",map);").append("\n"); + sb.append("\t//调用资源\n"); + sb.append("\t").append("ResourceResult result =executor.execute(\"").append(code).append("\",").append(version).append(",map);").append("\n"); sb.append("\n"); - sb.append("\t\t//处理资源调用完毕后的输出值\n"); - sb.append("\t\t").append(ExpressionReplacer.groovy(outputCommands,null).replace("\n", "\n\t\t")).append("\n"); + sb.append("\t//处理资源调用完毕后的输出值\n"); + sb.append("\t").append(ExpressionReplacer.groovy(outputCommands,null).replace("\n", "\n\t\t")).append("\n"); //继续调用后续方法 List edges =node.getOuts(); //获取条件的所有出口边 if(edges!=null && edges.size()>0) { for(GraphNode edge : edges) { GraphNode nexNode =edge.getOuts().get(0); //出口边指向的节点 - sb.append("\t\t").append("Flow_").append(parameter.getCode()).append("_").append(nexNode.getId()).append("(").append("executor,").append(ExpressionReplacer.ARGUMENT_NAME).append(");").append("\n"); + sb.append("\t").append("Flow_").append(parameter.getCode()).append("_").append(nexNode.getId()).append("(").append("executor,").append(ExpressionReplacer.ARGUMENT_NAME).append(");").append("\n"); } } - sb.append("\t}").append("\n\n"); + sb.append("}").append("\n\n"); //继续生成后续方法 edges =node.getOuts(); //获取条件的所有出口边 @@ -301,18 +300,18 @@ public class ExecutionFlow { */ private String generateModelAbstractGroovyCode(Map methodNameCache,Parameter parameter,SubModelAbstractNode node,String methodName) { StringBuilder sb =new StringBuilder(); - sb.append("\tprivate static void ").append(methodName).append("(Executor executor,Argument ").append(ExpressionReplacer.ARGUMENT_NAME).append("){//模型").append("\n"); + sb.append("private static void ").append(methodName).append("(Executor executor,Argument ").append(ExpressionReplacer.ARGUMENT_NAME).append("){//模型").append("\n"); String code =node.getCode(); - sb.append("\t\t").append("").append(code).append("(executor,arg);\n"); + sb.append("\t").append("").append(code).append("(executor,arg);\n"); //继续调用后续方法 List edges =node.getOuts(); //获取条件的所有出口边 if(edges!=null && edges.size()>0) { for(GraphNode edge : edges) { GraphNode nexNode =edge.getOuts().get(0); //出口边指向的节点 - sb.append("\t\t").append("Flow_").append(parameter.getCode()).append("_").append(nexNode.getId()).append("(").append("executor,").append(ExpressionReplacer.ARGUMENT_NAME).append(");").append("\n"); + sb.append("\t").append("Flow_").append(parameter.getCode()).append("_").append(nexNode.getId()).append("(").append("executor,").append(ExpressionReplacer.ARGUMENT_NAME).append(");").append("\n"); } } - sb.append("\t}").append("\n\n"); + sb.append("}").append("\n\n"); //继续生成后续方法 edges =node.getOuts(); //获取条件的所有出口边 diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/MathFormula.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/MathFormula.java index c4a80115..7fb8eb40 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/MathFormula.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/MathFormula.java @@ -1,6 +1,5 @@ package io.sc.engine.rule.core.code.generator.impl.processor; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import io.sc.engine.rule.core.po.lib.Indicator; import io.sc.engine.rule.core.po.lib.processor.MathFormulaIndicatorProcessor; import io.sc.engine.rule.core.po.model.Parameter; @@ -18,7 +17,6 @@ import java.io.Reader; import java.io.StringReader; import java.util.ArrayDeque; -@JsonIgnoreProperties(ignoreUnknown=true) public class MathFormula { public String groovy(Parameter parameter, MathFormulaParameterProcessor processor) throws Exception{ if (parameter == null || processor == null) { diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/NumberRange.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/NumberRange.java index 24d0478a..31fb6fd5 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/NumberRange.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/NumberRange.java @@ -1,6 +1,5 @@ package io.sc.engine.rule.core.code.generator.impl.processor; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.core.type.TypeReference; import io.sc.engine.rule.core.po.lib.Indicator; import io.sc.engine.rule.core.po.lib.processor.NumberRangeIndicatorProcessor; @@ -14,7 +13,6 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -@JsonIgnoreProperties(ignoreUnknown=true) public class NumberRange { private Boolean minIncluded; private BigDecimal min; diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/ObjectProperty.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/ObjectProperty.java index eaa9c5c8..34b6f088 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/ObjectProperty.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/ObjectProperty.java @@ -16,7 +16,6 @@ import org.springframework.util.StringUtils; import java.util.ArrayList; import java.util.List; -@JsonIgnoreProperties(ignoreUnknown=true) public class ObjectProperty { private String code; private String name; @@ -74,7 +73,7 @@ public class ObjectProperty { sb.append("if (true) {").append("\n"); } sb.append("\tif (").append(GroovyExpressionReplacer.ARGUMENT_NAME).append(".").append(IdReplacer.fieldName(code)).append("==null) {").append("\n"); - sb.append("t\t").append(GroovyExpressionReplacer.ARGUMENT_NAME).append(".").append(IdReplacer.fieldName(code)).append(" =new ").append(valueType).append("_V").append(valueTypeVersion).append("();").append("\n"); + sb.append("\t\t").append(GroovyExpressionReplacer.ARGUMENT_NAME).append(".").append(IdReplacer.fieldName(code)).append(" =new ").append(valueType).append("_V").append(valueTypeVersion).append("();").append("\n"); sb.append("\t}").append("\n"); int size =_objectProperties.size(); for(int i=0;i parse(String json) throws Exception{ + return ObjectMapperUtil.json().readValue(json, new TypeReference>(){}); + } + + public String groovy(Parameter parameter, RuleSetParameterProcessor processor) throws Exception{ + if(parameter==null || processor==null){ + return null; + } + try { + List rules =parse(processor.getRuleSet()); + List _rules =new ArrayList<>(); + + //移除没有填写条件的条件范围 + if(rules!=null && rules.size()>0) { + for(RuleSet rule : rules) { + if(rule.getCondition()!=null && !"".equals(rule.getCondition().trim())) { + _rules.add(rule); + } + } + } + + if(_rules!=null && _rules.size()>0) { + StringBuilder sb =new StringBuilder(); + sb.append("RuleSetResult temp =new RuleSetResult();").append("\n"); + int size =_rules.size(); + for(int i=0;i parse(String json) throws Exception{ + return ObjectMapperUtil.json().readValue(json, new TypeReference>(){}); + } + + public String groovy(Parameter parameter, ScoreCardParameterProcessor processor) throws Exception{ + if(parameter==null || processor==null){ return null; } + try { + List scoreCardItems = parse(processor.getScoreCard()); + if(!CollectionUtil.hasElements(scoreCardItems)){ + return null; + } + StringBuilder sb =new StringBuilder(); + sb.append(GroovyExpressionReplacer.ARGUMENT_NAME).append(".").append(IdReplacer.fieldName(parameter.getCode())).append(" =0;"); + sb.append("//初始化结果值").append("\n"); + sb.append("\n"); + for(ScoreCardItem item : scoreCardItems){ + sb.append("//").append(item.getCode()).append(",").append(item.getType()).append("\n"); + switch(item.getType()){ + case CONDITION_RANGE: + sb.append(groovyConditionRange(parameter,item)); + break; + case NUMBER_RANGE: + sb.append(groovyNumberRange(parameter,item)); + break; + } + sb.append("\n\n"); + } + return sb.toString(); + }catch(Exception e) { + throw new RuntimeException("There was a Error when generate " + parameter.getName()+ "'s ScoreCard groovy source code.", e); + } + } + + public String groovyConditionRange(Parameter parameter,ScoreCardItem scoreCardItem){ + if(!CollectionUtil.hasElements(scoreCardItem.getConditionRange())){ return null; } + List _conditionRanges =new ArrayList(); + //移除没有填写条件的条件范围 + for(ConditionRange conditionRange : scoreCardItem.getConditionRange()) { + if(StringUtils.hasText(conditionRange.getCondition())) { + _conditionRanges.add(conditionRange); + } + } + if(_conditionRanges.isEmpty()){ + return null; + } + + StringBuilder sb =new StringBuilder(); + int size =_conditionRanges.size(); + for(int i=0;i _numberRanges =new ArrayList(); + + //移除空行 + for(NumberRange numberRange : scoreCardItem.getNumberRange()) { + if(numberRange.getMin()!=null || numberRange.getMax()!=null || numberRange.getValue()!=null) { + _numberRanges.add(numberRange); + } + } + if(_numberRanges.isEmpty()){ + return null; + } + + String var =GroovyExpressionReplacer.ARGUMENT_NAME + "." + scoreCardItem.getCode(); + StringBuilder sb = new StringBuilder(); + int size = _numberRanges.size(); + for (int i = 0; i < size; i++) { + NumberRange numberRange = _numberRanges.get(i); + if (i == 0) { + sb.append("if("); + } else { + sb.append("else if("); + } + if (numberRange.getMin() == null && numberRange.getMax() == null) { + sb.append(GroovyExpressionReplacer.groovy(var)).append("==null"); + } else if (numberRange.getMin() != null) { + if (numberRange.getMaxIncluded() != null && numberRange.getMinIncluded()) { + sb.append(GroovyExpressionReplacer.groovy(var)).append(">=").append(numberRange.getMin()); + } else { + sb.append(GroovyExpressionReplacer.groovy(var)).append(">").append(numberRange.getMin()); + } + } + if (numberRange.getMin() != null && numberRange.getMax() != null) { + sb.append(" && "); + } + if (numberRange.getMax() != null) { + if (numberRange.getMaxIncluded() != null && numberRange.getMaxIncluded()) { + sb.append(GroovyExpressionReplacer.groovy(var)).append("<=").append(numberRange.getMax()); + } else { + sb.append(GroovyExpressionReplacer.groovy(var)).append("<").append(numberRange.getMax()); + } + } + sb.append(")").append("{").append("\n"); + if(StringUtils.hasText(numberRange.getValue())){ + sb.append("\t").append(GroovyExpressionReplacer.ARGUMENT_NAME).append(".").append(IdReplacer.fieldName(parameter.getCode())); + sb.append(" +="); + if(scoreCardItem.getWeight()!=null) { + sb.append(scoreCardItem.getWeight()).append("*").append(GroovyExpressionReplacer.groovy(numberRange.getValue(), parameter.getValueType())).append(";\n"); + }else{ + sb.append(GroovyExpressionReplacer.groovy(numberRange.getValue(), parameter.getValueType())).append(";\n"); + } + } + sb.append("}"); + } + return sb.toString(); + } +} diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/SingleRule.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/SingleRule.java new file mode 100644 index 00000000..8c2d3703 --- /dev/null +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/SingleRule.java @@ -0,0 +1,115 @@ +package io.sc.engine.rule.core.code.generator.impl.processor; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.sc.engine.rule.core.po.model.Parameter; +import io.sc.engine.rule.core.po.model.processor.SingleRuleParameterProcessor; +import io.sc.engine.rule.core.util.GroovyExpressionReplacer; +import io.sc.engine.rule.core.util.IdReplacer; +import io.sc.platform.util.ObjectMapperUtil; + +import java.util.ArrayList; +import java.util.List; + +public class SingleRule { + private Integer level; + private String category; + private String condition; + private String value; + private String message; + + public static List parse(String json) throws Exception{ + return ObjectMapperUtil.json().readValue(json, new TypeReference>(){}); + } + + public String groovy(Parameter parameter, SingleRuleParameterProcessor processor) throws Exception{ + if(parameter==null || processor==null){ + return null; + } + try { + List rules =parse(processor.getSingleRule()); + List _rules =new ArrayList<>(); + + //移除没有填写条件的条件范围 + if(rules!=null && rules.size()>0) { + for(SingleRule rule : rules) { + if(rule.getCondition()!=null && !"".equals(rule.getCondition().trim())) { + _rules.add(rule); + } + } + } + + if(_rules!=null && _rules.size()>0) { + StringBuilder sb =new StringBuilder(); + sb.append("SingleRuleResult result =new SingleRuleResult();").append("\n"); + int size =_rules.size(); + for(int i=0;itemp.getLevel()){").append("\n"); + sb.append("\t\t").append("result =temp;").append("\n"); + sb.append("\t}").append("\n"); + sb.append("}\n"); + } + sb.append("\n"); + sb.append("").append(GroovyExpressionReplacer.ARGUMENT_NAME).append(".").append(IdReplacer.fieldName(parameter.getCode())).append(" =result;").append("\n"); + return sb.toString(); + } + }catch(Exception e) { + throw new RuntimeException("There was a Error when generate " + parameter.getName()+ "'s Single Rule groovy source code.", e); + } + return null; + } + + public Integer getLevel() { + return level; + } + + public void setLevel(Integer level) { + this.level = level; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getCondition() { + return condition; + } + + public void setCondition(String condition) { + this.condition = condition; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/SqlFieldMapping.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/SqlFieldMapping.java index eb12ccf9..5343bec9 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/SqlFieldMapping.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/SqlFieldMapping.java @@ -16,7 +16,6 @@ import org.springframework.util.StringUtils; import java.util.List; -@JsonIgnoreProperties(ignoreUnknown=true) public class SqlFieldMapping { private String parameter; private String field; diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/functions_render.tpl b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/functions_render.tpl index 1dd78ce0..a6443382 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/functions_render.tpl +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/functions_render.tpl @@ -1,6 +1,7 @@ #define renderFunction(function) -/** - * #(function.description) - */ -#(function.body) + + /** + * #(function.description) + */ + #(tabs(function.body,1)) #end \ No newline at end of file diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/impl/lib.tpl b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/impl/lib.tpl index 309ea899..0acf137d 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/impl/lib.tpl +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/impl/lib.tpl @@ -17,9 +17,11 @@ //****************************************************************************** // 自定义函数 //****************************************************************************** +class UDF { #for(function : executeUnit.functions) -#@renderFunction(function) + #@renderFunction(function) #end +} //****************************************************************************** // 执行主体类 diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/impl/resource.tpl b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/impl/resource.tpl index bac5220a..79389ae0 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/impl/resource.tpl +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/impl/resource.tpl @@ -22,9 +22,11 @@ //****************************************************************************** // 自定义函数 //****************************************************************************** +class UDF { #for(function : executeUnit.functions) -#@renderFunction(function) + #@renderFunction(function) #end +} //****************************************************************************** // 执行主体类 @@ -44,7 +46,7 @@ class #(className(resource.code,resource.version)) { * @return 执行结果 */ public static ResourceResult execute(Map map) throws Exception{ - return execute(map["executor"],map["subModelCode"],map["arg"]); + return execute(map["executor"],map["subModelCode"],map["argument"]); } /** @@ -71,7 +73,7 @@ class #(className(resource.code,resource.version)) { #end //初始化模型参数 - if(log.isDebugEnabled()){log.debug("从 {} 初始化模型参数","java.lang.String"==data.class?"Json":"Map");} + if(log.isDebugEnabled()){log.debug("从 {} 初始化模型参数",String.class==data.class?"Json":"Map");} Argument arg =Argument.convertArgument(data); //输入参数合法性检查 diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/import_render.tpl b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/import_render.tpl index 8068450e..0378d29a 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/import_render.tpl +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/import_render.tpl @@ -4,7 +4,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import groovy.transform.Canonical; import io.sc.engine.rule.client.Executor; import io.sc.engine.rule.core.ResourceAbstract; -import io.sc.engine.rule.core.RuleResult; +import io.sc.engine.rule.core.RuleSetResult; import io.sc.engine.rule.core.SingleRuleResult; import io.sc.engine.rule.core.FieldValidator; import io.sc.engine.rule.core.ParameterResult; @@ -30,6 +30,7 @@ import static io.sc.engine.rule.core.function.ArithmeticFunction.ln; import static io.sc.engine.rule.core.function.ArithmeticFunction.log; import static io.sc.engine.rule.core.function.ArithmeticFunction.max; import static io.sc.engine.rule.core.function.ArithmeticFunction.min; +import static io.sc.engine.rule.core.function.ArithmeticFunction.mod; import static io.sc.engine.rule.core.function.ArithmeticFunction.randomInt; import static io.sc.engine.rule.core.function.ArithmeticFunction.root; import static io.sc.engine.rule.core.function.ArithmeticFunction.sum; diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/parameter_render.tpl b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/parameter_render.tpl index 18946681..e322eb74 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/parameter_render.tpl +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/parameter_render.tpl @@ -1,6 +1,25 @@ #define renderParameter(model) -#for(parameter : model.allParameters) - #if("INTERMEDIATE"==parameter.type.toString() || "OUT"==parameter.type.toString()) +#for(parameter : model.parameters) + #if(("INTERMEDIATE"==parameter.type.toString() || "OUT"==parameter.type.toString()) && ("io.sc.engine.rule.core.SingleRuleResult"==parameter.valueType || "io.sc.engine.rule.core.RuleSetResult"==parameter.valueType)) + //参数处理器, #(parameter.name)(#(parameter.type)) + private static void #(methodName(parameter.code))(Executor executor,Argument arg) { + if(log.isDebugEnabled()){log.debug(" {}","#(parameter.name)(#(parameter.type))");} + #for(processor : parameter.processors) + #if(processor.enable) + #switch (processor.type.toString()) + #case ("SINGLE_RULE") + //单规则 + #include("/io/sc/engine/rule/core/code/template/processor/single_rule.tpl") + if(log.isDebugEnabled()){log.debug(" 单规则运算结果 : {}",arg.#(fieldName(parameter.code)));} + #case ("RULE_SET") + //规则集 + #include("/io/sc/engine/rule/core/code/template/processor/rule_set.tpl") + if(log.isDebugEnabled()){log.debug(" 规则集运算结果 : {}",arg.#(fieldName(parameter.code)));} + #end + #end + #end + } + #else if("INTERMEDIATE"==parameter.type.toString() || "OUT"==parameter.type.toString()) //参数处理器, #(parameter.name)(#(parameter.type)) private static void #(methodName(parameter.code))(Executor executor,Argument arg) { if(log.isDebugEnabled()){log.debug(" {}","#(parameter.name)(#(parameter.type))");} @@ -26,7 +45,7 @@ #case ("DECISION_TREE") //决策树(此处只是入口,真正的决策树计算逻辑在后面通过一系列方法完成) #include("/io/sc/engine/rule/core/code/template/processor/decision_tree.tpl") - if(log.isDebugEnabled()){log.debug(" 决策树运算结果 : {}",,arg.#(fieldName(parameter.code)));} + if(log.isDebugEnabled()){log.debug(" 决策树运算结果 : {}",arg.#(fieldName(parameter.code)));} #case ("EXECUTION_FLOW") //执行流(此处只是入口,真正的执行流计算逻辑在后面通过一系列方法完成) #include("/io/sc/engine/rule/core/code/template/processor/execution_flow.tpl") @@ -98,7 +117,7 @@ #for(processor : parameter.processors) #if("EXECUTION_FLOW"==processor.type.toString()) //执行流函数: #(parameter.name)(#(parameter.type)) - #(ExecutionFlow.groovy(parameter,processor)) + #(tabs(ExecutionFlow.groovy(parameter,processor),1)) #end #end #end diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/processor/rule_set.tpl b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/processor/rule_set.tpl new file mode 100644 index 00000000..f7e97293 --- /dev/null +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/processor/rule_set.tpl @@ -0,0 +1 @@ +#(tabs(RuleSet.groovy(parameter,processor),2)) \ No newline at end of file diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/processor/score_card.tpl b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/processor/score_card.tpl index e69de29b..5564e645 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/processor/score_card.tpl +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/processor/score_card.tpl @@ -0,0 +1 @@ +#(tabs(ScoreCard.groovy(parameter,processor),2)) \ No newline at end of file diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/processor/single_rule.tpl b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/processor/single_rule.tpl new file mode 100644 index 00000000..6d3b5d94 --- /dev/null +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/template/processor/single_rule.tpl @@ -0,0 +1 @@ +#(tabs(SingleRule.groovy(parameter,processor),2)) \ No newline at end of file diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/enums/ParameterType.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/enums/ParameterType.java index 08d29d4f..1cab4afa 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/enums/ParameterType.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/enums/ParameterType.java @@ -10,8 +10,6 @@ public enum ParameterType { INDICATOR, //指标 INTERMEDIATE, //中间值 OUT, //输出 - RULE_RESULT, //规则结果值 - SINGLE_RULE_RESULT, //单规则结果值 CONSTANT; //常量 public static boolean isInputType(ParameterType type) { diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/enums/ProcessorType.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/enums/ProcessorType.java index 1b5a463b..eb6a5639 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/enums/ProcessorType.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/enums/ProcessorType.java @@ -18,7 +18,7 @@ public enum ProcessorType { OBJECT_PROPERTIES, //对象属性, 处理对象的所有属性 OPTION_VALUE, //选项值 PMML, //pmml - RULE, //规则 + RULE_SET, //规则集 SCORE_CARD, //评分卡 SINGLE_RULE, //单规则 SQL, //sql diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/function/ArithmeticFunction.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/function/ArithmeticFunction.java index 24bc3b2c..7313c9d0 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/function/ArithmeticFunction.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/function/ArithmeticFunction.java @@ -148,4 +148,6 @@ public class ArithmeticFunction { public static Double div(Double x, Double y){ return x/y; } + + public static Integer mod(Integer x, Integer y) { return x % y;} } diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/mxgraph/parser/ExecutionFlowParser.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/mxgraph/parser/ExecutionFlowParser.java index 0c3d1222..f87d6401 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/mxgraph/parser/ExecutionFlowParser.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/mxgraph/parser/ExecutionFlowParser.java @@ -199,7 +199,6 @@ public class ExecutionFlowParser { xml = xml.replace("", ""); - return xml; } return xml; diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/mxgraph/po/EdgeConditionBranchNode.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/mxgraph/po/EdgeConditionBranchNode.java index 2c4fb140..86dd34a7 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/mxgraph/po/EdgeConditionBranchNode.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/mxgraph/po/EdgeConditionBranchNode.java @@ -1,10 +1,8 @@ package io.sc.engine.rule.core.mxgraph.po; -public class EdgeConditionBranchNode extends GraphNode { +public class EdgeConditionBranchNode extends EdgeNode { private String valueType; //值类型 private String value; //值 - private String sourceId; //源节点ID - private String targetId; //目标节点ID private String commands; //命令 /** @@ -39,38 +37,6 @@ public class EdgeConditionBranchNode extends GraphNode { this.value = value; } - /** - * 获取源节点ID - * @return 源节点ID - */ - public String getSourceId() { - return sourceId; - } - - /** - * 设置源节点ID - * @param sourceId 源节点ID - */ - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - /** - * 获取目标节点ID - * @return 目标节点ID - */ - public String getTargetId() { - return targetId; - } - - /** - * 设置目标节点ID - * @param targetId 目标节点ID - */ - public void setTargetId(String targetId) { - this.targetId = targetId; - } - /** * 获取命令 * @return 命令 @@ -86,16 +52,4 @@ public class EdgeConditionBranchNode extends GraphNode { public void setCommands(String commands) { this.commands = commands; } - - @Override - public String toString() { - return "EdgeConditionBranchNode [id=" + id - + ", label=" + label - + ", valueType=" + valueType - + ", value=" + value - + ", sourceId=" + sourceId - + ", targetId=" + targetId - + ", commands=" + commands - + ", outs=" + outs + "]"; - } } diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/mxgraph/po/EdgeNode.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/mxgraph/po/EdgeNode.java index 60d18434..77a15f76 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/mxgraph/po/EdgeNode.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/mxgraph/po/EdgeNode.java @@ -6,8 +6,8 @@ package io.sc.engine.rule.core.mxgraph.po; * */ public class EdgeNode extends GraphNode{ - private String sourceId; //源节点ID - private String targetId; //目标节点ID + protected String sourceId; //源节点ID + protected String targetId; //目标节点ID /** * 获取源节点ID @@ -40,13 +40,4 @@ public class EdgeNode extends GraphNode{ public void setTargetId(String targetId) { this.targetId = targetId; } - - @Override - public String toString() { - return "EdgeNode [id=" + id - + ", label=" + label - + ", sourceId=" + sourceId - + ", targetId=" + targetId - + ", outs=" + outs + "]"; - } } diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/Parameter.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/Parameter.java index 5e9ff6eb..a7d92d2d 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/Parameter.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/Parameter.java @@ -18,8 +18,6 @@ import java.util.List; @JsonSubTypes.Type(value=InOptionParameter.class), //输入选项 @JsonSubTypes.Type(value=InSubOutParameter.class), //子模型输出 @JsonSubTypes.Type(value=IntermediateParameter.class), //中间值 - @JsonSubTypes.Type(value=RuleResultParameter.class), //规则结果值 - @JsonSubTypes.Type(value=SingleRuleResultParameter.class), //单规则结果值 @JsonSubTypes.Type(value=OutParameter.class) //结果值 }) public abstract class Parameter { diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/ParameterProcessor.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/ParameterProcessor.java index 362ee18e..e172c39b 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/ParameterProcessor.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/ParameterProcessor.java @@ -28,7 +28,7 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; @JsonSubTypes.Type(value=ObjectPropertiesParameterProcessor.class), //对象属性处理器 @JsonSubTypes.Type(value=OptionValueParameterProcessor.class), //选项值处理器 @JsonSubTypes.Type(value=PmmlParameterProcessor.class), //PMML处理器 - @JsonSubTypes.Type(value=RuleParameterProcessor.class), //规则处理器 + @JsonSubTypes.Type(value=RuleSetParameterProcessor.class), //规则集处理器 @JsonSubTypes.Type(value=ScoreCardParameterProcessor.class), //评分卡处理器 @JsonSubTypes.Type(value=SingleRuleParameterProcessor.class), //单规则处理器 @JsonSubTypes.Type(value=SqlParameterProcessor.class), //Sql处理器 diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/parameter/RuleResultParameter.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/parameter/RuleResultParameter.java deleted file mode 100644 index 74502054..00000000 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/parameter/RuleResultParameter.java +++ /dev/null @@ -1,17 +0,0 @@ -package io.sc.engine.rule.core.po.model.parameter; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.sc.engine.rule.core.enums.ParameterType; - -/** - * 模型参数(规则结果) - */ -@JsonTypeName("RULE_RESULT") -@JsonIgnoreProperties(ignoreUnknown=true) -public class RuleResultParameter extends OutParameter { - @Override - public ParameterType getType() { - return ParameterType.RULE_RESULT; - } -} diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/parameter/SingleRuleResultParameter.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/parameter/SingleRuleResultParameter.java deleted file mode 100644 index df5dfa99..00000000 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/parameter/SingleRuleResultParameter.java +++ /dev/null @@ -1,17 +0,0 @@ -package io.sc.engine.rule.core.po.model.parameter; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.sc.engine.rule.core.enums.ParameterType; - -/** - * 模型参数(单规则结果) - */ -@JsonTypeName("SINGLE_RULE_RESULT") -@JsonIgnoreProperties(ignoreUnknown=true) -public class SingleRuleResultParameter extends OutParameter { - @Override - public ParameterType getType() { - return ParameterType.SINGLE_RULE_RESULT; - } -} diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/processor/RuleParameterProcessor.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/processor/RuleSetParameterProcessor.java similarity index 62% rename from io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/processor/RuleParameterProcessor.java rename to io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/processor/RuleSetParameterProcessor.java index c8bbd72f..1f588920 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/processor/RuleParameterProcessor.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/processor/RuleSetParameterProcessor.java @@ -11,21 +11,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; * @author wangshaoping * */ -@JsonTypeName("RULE") +@JsonTypeName("RULE_SET") @JsonIgnoreProperties(ignoreUnknown=true) -public class RuleParameterProcessor extends ParameterProcessor{ - private String rule; +public class RuleSetParameterProcessor extends ParameterProcessor{ + private String ruleSet; @Override public ProcessorType getType() { - return ProcessorType.RULE; + return ProcessorType.RULE_SET; } - - public String getRule() { - return rule; + + public String getRuleSet() { + return ruleSet; } - public void setRule(String rule) { - this.rule = rule; + public void setRuleSet(String ruleSet) { + this.ruleSet = ruleSet; } } diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/util/IdReplacer.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/util/IdReplacer.java index b19367e0..a7165bcb 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/util/IdReplacer.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/util/IdReplacer.java @@ -37,18 +37,27 @@ public class IdReplacer { * @return 合法的Java类名 */ public static String className(String code) { - return StringUtil.capitalize(ValueTypeUtil.getSimpleName(code)); + if(!StringUtils.hasText(code)){ + return "Object"; + } + if(!code.contains(".")) { + return StringUtil.capitalize(ValueTypeUtil.getSimpleName(code)); + } + return code; } public static String className(String code,Integer version) { if(!StringUtils.hasText(code)){ return "Object"; } - if(version!=null){ - return StringUtil.capitalize(code) + "_V" + version; - }else{ - return StringUtil.capitalize(ValueTypeUtil.getSimpleName(code)); + if(!code.contains(".")) { + if(version!=null){ + return StringUtil.capitalize(code) + "_V" + version; + }else{ + return StringUtil.capitalize(ValueTypeUtil.getSimpleName(code)); + } } + return code; } /** diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/util/ValueTypeUtil.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/util/ValueTypeUtil.java index 510d1a44..1f16f3d1 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/util/ValueTypeUtil.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/util/ValueTypeUtil.java @@ -1,31 +1,42 @@ package io.sc.engine.rule.core.util; import io.sc.platform.util.DateUtil; +import io.sc.platform.util.MapUtil; +import io.sc.platform.util.support.KV; import java.math.BigDecimal; import java.math.BigInteger; -import java.util.*; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Map; public class ValueTypeUtil { - private static final Map> BASE_CLASS_MAP = new HashMap<>(); - - static { - BASE_CLASS_MAP.put(Boolean.class.getName(),Boolean.class); - BASE_CLASS_MAP.put(Byte.class.getName(),Byte.class); - BASE_CLASS_MAP.put(Character.class.getName(),Character.class); - BASE_CLASS_MAP.put(Short.class.getName(),Short.class); - BASE_CLASS_MAP.put(Integer.class.getName(),Integer.class); - BASE_CLASS_MAP.put(Long.class.getName(),Long.class); - BASE_CLASS_MAP.put(Float.class.getName(),Float.class); - BASE_CLASS_MAP.put(Double.class.getName(),Double.class); - BASE_CLASS_MAP.put(BigInteger.class.getName(),BigInteger.class); - BASE_CLASS_MAP.put(BigDecimal.class.getName(),BigDecimal.class); - - BASE_CLASS_MAP.put(String.class.getName(),String.class); - BASE_CLASS_MAP.put(Date.class.getName(),Date.class); - BASE_CLASS_MAP.put(Calendar.class.getName(),Calendar.class); - - } + private static final Map> BASE_CLASS_MAP = MapUtil.of( + new KV("boolean",Boolean.class), + new KV("byte",Byte.class), + new KV("char",Character.class), + new KV("short",Short.class), + new KV("int",Integer.class), + new KV("long",Long.class), + new KV("float",Float.class), + new KV("double",Double.class), + + new KV(Boolean.class.getName(),Boolean.class), + new KV(Byte.class.getName(),Byte.class), + new KV(Character.class.getName(),Character.class), + new KV(Short.class.getName(),Short.class), + new KV(Integer.class.getName(),Integer.class), + new KV(Long.class.getName(),Long.class), + new KV(Float.class.getName(),Float.class), + new KV(Double.class.getName(),Double.class), + new KV(BigInteger.class.getName(),BigInteger.class), + new KV(BigDecimal.class.getName(),BigDecimal.class), + + new KV(String.class.getName(),String.class), + new KV(Date.class.getName(),Date.class), + new KV(Calendar.class.getName(),Calendar.class) + ); public static boolean isString(Class type){ return isString(type.getName()); @@ -39,6 +50,18 @@ public class ValueTypeUtil { public static boolean isDecimal(String type) { return BigDecimal.class.getName().equals(type);} + public static boolean isEnum(Class type){ + return type.isEnum(); + } + + public static boolean isEnum(String type){ + try { + return Class.forName(type).isEnum(); + }catch (Exception e){ + return false; + } + } + public static boolean isBase(Class type){ return isBase(type.getName()); } diff --git a/io.sc.engine.rule.core/src/main/resources/META-INF/platform/plugins/rule-engine-dictionary.json b/io.sc.engine.rule.core/src/main/resources/META-INF/platform/plugins/rule-engine-dictionary.json index 8ef5cf7a..7fb725c9 100644 --- a/io.sc.engine.rule.core/src/main/resources/META-INF/platform/plugins/rule-engine-dictionary.json +++ b/io.sc.engine.rule.core/src/main/resources/META-INF/platform/plugins/rule-engine-dictionary.json @@ -9,8 +9,8 @@ { "type": "JAVA_CLASS", "order": 700, "id": "java.util.List", "parent": "re.dictionary.category.base", "code": "java.util.List", "nameI18nKey": "java.util.List", "description": "列表类型", "version": null}, { "type": "JAVA_CLASS", "order": 800, "id": "java.util.Map", "parent": "re.dictionary.category.base", "code": "java.util.Map", "nameI18nKey": "java.util.Map", "description": "字典类型", "version": null}, { "type": "FOLDER", "order": 2000, "id": "re.dictionary.category.engine", "parent": null, "code": "re.dictionary.category.engine", "nameI18nKey": "re.dictionary.category.engine", "description": "引擎内置类型", "version": null}, - { "type": "JAVA_CLASS", "order": 100, "id": "io.sc.engine.rule.core.classes.ResourceAbstract", "parent": "re.dictionary.category.engine", "code": "io.sc.engine.rule.core.classes.ResourceAbstract", "nameI18nKey": "io.sc.engine.rule.core.classes.ResourceAbstract", "description": "资源摘要", "version": null}, - { "type": "JAVA_CLASS", "order": 200, "id": "io.sc.engine.rule.core.classes.RuleResult", "parent": "re.dictionary.category.engine", "code": "io.sc.engine.rule.core.classes.RuleResult", "nameI18nKey": "io.sc.engine.rule.core.classes.RuleResult", "description": "规则集结果", "version": null}, - { "type": "JAVA_CLASS", "order": 300, "id": "io.sc.engine.rule.core.classes.SingleRuleResult", "parent": "re.dictionary.category.engine", "code": "io.sc.engine.rule.core.classes.SingleRuleResult", "nameI18nKey": "io.sc.engine.rule.core.classes.SingleRuleResult", "description": "单规则结果", "version": null}, + { "type": "JAVA_CLASS", "order": 100, "id": "io.sc.engine.rule.core.ResourceAbstract", "parent": "re.dictionary.category.engine", "code": "io.sc.engine.rule.core.ResourceAbstract", "nameI18nKey": "io.sc.engine.rule.core.ResourceAbstract", "description": "资源摘要", "version": null}, + { "type": "JAVA_CLASS", "order": 200, "id": "io.sc.engine.rule.core.SingleRuleResult", "parent": "re.dictionary.category.engine", "code": "io.sc.engine.rule.core.SingleRuleResult", "nameI18nKey": "io.sc.engine.rule.core.SingleRuleResult", "description": "单规则结果", "version": null}, + { "type": "JAVA_CLASS", "order": 300, "id": "io.sc.engine.rule.core.RuleSetResult", "parent": "re.dictionary.category.engine", "code": "io.sc.engine.rule.core.RuleSetResult", "nameI18nKey": "io.sc.engine.rule.core.RuleSetResult", "description": "规则集结果", "version": null}, { "type": "FOLDER", "order": 3000, "id": "re.dictionary.category.customization", "parent": null, "code": "re.dictionary.category.customization", "nameI18nKey": "re.dictionary.category.customization", "description": "用户自定义类型", "version": null} ] diff --git a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/dictionary.properties b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/dictionary.properties index 8f42acb9..7851a0da 100644 --- a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/dictionary.properties +++ b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/dictionary.properties @@ -1,3 +1,25 @@ re.dictionary.category.base=Base re.dictionary.category.engine=Engine -re.dictionary.category.customization=User Customization \ No newline at end of file +re.dictionary.category.customization=User Customization + +# \u57FA\u672C\u7C7B\u578B +java.lang.Boolean=Boolean +java.lang.Byte=Byte +java.lang.Character=Character +java.lang.Short=Short +java.lang.Integer=Integer +java.lang.Long=Long +java.lang.Float=Float +java.lang.Double=Double +java.math.BigInteger=Big Integer +java.math.BigDecimal=Decimal +java.lang.String=String +java.util.Date=Date +java.util.Calendar=Calendar +java.util.List=List +java.util.Map=Map + +# \u5F15\u64CE\u5185\u7F6E\u7C7B\u578B +io.sc.engine.rule.core.ResourceAbstract=Resource Abstract +io.sc.engine.rule.core.SingleRuleResult=Single Rule Result +io.sc.engine.rule.core.RuleSetResult=Rule Set Result \ No newline at end of file diff --git a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/dictionary_tw_CN.properties b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/dictionary_tw_CN.properties index 9f667b47..c775e628 100644 --- a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/dictionary_tw_CN.properties +++ b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/dictionary_tw_CN.properties @@ -1,3 +1,25 @@ re.dictionary.category.base=\u57FA\u672C\u985E\u578B re.dictionary.category.engine=\u5F15\u64CE\u5167\u7F6E\u985E\u578B -re.dictionary.category.customization=\u7528\u6236\u81EA\u5B9A\u7FA9\u985E\u578B \ No newline at end of file +re.dictionary.category.customization=\u7528\u6236\u81EA\u5B9A\u7FA9\u985E\u578B + +# \u57FA\u672C\u7C7B\u578B +java.lang.Boolean=\u5E03\u723E +java.lang.Byte=\u5B57\u7BC0 +java.lang.Character=\u5B57\u7B26 +java.lang.Short=\u77ED\u6574\u6578 +java.lang.Integer=\u6574\u6578 +java.lang.Long=\u6574\u6578 +java.lang.Float=\u6D6E\u9EDE\u6578 +java.lang.Double=\u96D9\u7CBE\u5EA6\u6578 +java.math.BigInteger=\u5927\u6574\u6578 +java.math.BigDecimal=\u5C0F\u6578 +java.lang.String=\u5B57\u7B26\u4E32 +java.util.Date=\u65E5\u671F +java.util.Calendar=\u65E5\u66C6 +java.util.List=\u5217\u8868 +java.util.Map=\u5B57\u5178 + +# \u5F15\u64CE\u5185\u7F6E\u7C7B\u578B +io.sc.engine.rule.core.ResourceAbstract=\u8CC7\u6E90\u6458\u8981 +io.sc.engine.rule.core.SingleRuleResult=\u55AE\u898F\u5247\u7D50\u679C +io.sc.engine.rule.core.RuleSetResult=\u898F\u5247\u96C6\u7D50\u679C \ No newline at end of file diff --git a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/dictionary_zh_CN.properties b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/dictionary_zh_CN.properties index 8d495d2f..332fbfea 100644 --- a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/dictionary_zh_CN.properties +++ b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/dictionary_zh_CN.properties @@ -1,3 +1,25 @@ re.dictionary.category.base=\u57FA\u672C\u7C7B\u578B re.dictionary.category.engine=\u5F15\u64CE\u5185\u7F6E\u7C7B\u578B -re.dictionary.category.customization=\u7528\u6237\u81EA\u5B9A\u4E49\u7C7B\u578B \ No newline at end of file +re.dictionary.category.customization=\u7528\u6237\u81EA\u5B9A\u4E49\u7C7B\u578B + +# \u57FA\u672C\u7C7B\u578B +java.lang.Boolean=\u5E03\u5C14 +java.lang.Byte=\u5B57\u8282 +java.lang.Character=\u5B57\u7B26 +java.lang.Short=\u77ED\u6574\u6570 +java.lang.Integer=\u6574\u6570 +java.lang.Long=\u6574\u6570 +java.lang.Float=\u6D6E\u70B9\u6570 +java.lang.Double=\u53CC\u7CBE\u5EA6\u6570 +java.math.BigInteger=\u5927\u6574\u6570 +java.math.BigDecimal=\u5C0F\u6570 +java.lang.String=\u5B57\u7B26\u4E32 +java.util.Date=\u65E5\u671F +java.util.Calendar=\u65E5\u5386 +java.util.List=\u5217\u8868 +java.util.Map=\u5B57\u5178 + +# \u5F15\u64CE\u5185\u7F6E\u7C7B\u578B +io.sc.engine.rule.core.ResourceAbstract=\u8D44\u6E90\u6458\u8981 +io.sc.engine.rule.core.SingleRuleResult=\u5355\u89C4\u5219\u7ED3\u679C +io.sc.engine.rule.core.RuleSetResult=\u89C4\u5219\u96C6\u7ED3\u679C \ No newline at end of file diff --git a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums.properties b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums.properties index 2e7f8088..a13facf9 100644 --- a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums.properties +++ b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums.properties @@ -38,8 +38,6 @@ io.sc.engine.rule.core.enums.ParameterType.IN_OPTION=Input(Option) io.sc.engine.rule.core.enums.ParameterType.IN_SUB_OUT=Sub Model Output io.sc.engine.rule.core.enums.ParameterType.INDICATOR=Indicator io.sc.engine.rule.core.enums.ParameterType.INTERMEDIATE=Intermediate -io.sc.engine.rule.core.enums.ParameterType.RULE_RESULT=Rule Out -io.sc.engine.rule.core.enums.ParameterType.SINGLE_RULE_RESULT=Single Rule Out io.sc.engine.rule.core.enums.ParameterType.OUT=Out io.sc.engine.rule.core.enums.ParameterType.CONSTANT=Constant @@ -66,7 +64,7 @@ io.sc.engine.rule.core.enums.ProcessorType.NUMBER_RANGE=Number Range io.sc.engine.rule.core.enums.ProcessorType.OBJECT_PROPERTIES=Object Properties io.sc.engine.rule.core.enums.ProcessorType.OPTION_VALUE=Option Value io.sc.engine.rule.core.enums.ProcessorType.PMML=PMML -io.sc.engine.rule.core.enums.ProcessorType.RULE=Rule +io.sc.engine.rule.core.enums.ProcessorType.RULE_SET=Rule Set io.sc.engine.rule.core.enums.ProcessorType.SCORE_CARD=Score Card io.sc.engine.rule.core.enums.ProcessorType.SINGLE_RULE=Single Rule io.sc.engine.rule.core.enums.ProcessorType.SQL=SQL Asignment Value diff --git a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums_tw_CN.properties b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums_tw_CN.properties index a4939b3c..2859d192 100644 --- a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums_tw_CN.properties +++ b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums_tw_CN.properties @@ -38,8 +38,6 @@ io.sc.engine.rule.core.enums.ParameterType.IN_OPTION=\u8F38\u5165\u503C(\u9078\u io.sc.engine.rule.core.enums.ParameterType.IN_SUB_OUT=\u5B50\u6A21\u578B\u7D50\u679C\u503C io.sc.engine.rule.core.enums.ParameterType.INDICATOR=\u6307\u6A19 io.sc.engine.rule.core.enums.ParameterType.INTERMEDIATE=\u4E2D\u9593\u503C -io.sc.engine.rule.core.enums.ParameterType.RULE_RESULT=\u898F\u5247\u7D50\u679C\u503C -io.sc.engine.rule.core.enums.ParameterType.SINGLE_RULE_RESULT=\u55AE\u898F\u5247\u7D50\u679C\u503C io.sc.engine.rule.core.enums.ParameterType.OUT=\u7D50\u679C\u503C io.sc.engine.rule.core.enums.ParameterType.CONSTANT=\u5E38\u91CF @@ -66,7 +64,7 @@ io.sc.engine.rule.core.enums.ProcessorType.NUMBER_RANGE=\u6578\u503C\u5206\u6BB5 io.sc.engine.rule.core.enums.ProcessorType.OBJECT_PROPERTIES=\u5C0D\u8C61\u5C6C\u6027\u8CE6\u503C io.sc.engine.rule.core.enums.ProcessorType.OPTION_VALUE=\u9078\u9805\u503C io.sc.engine.rule.core.enums.ProcessorType.PMML=\u9810\u6E2C\u6A21\u578B\u6A19\u8A18\u8A9E\u8A00 -io.sc.engine.rule.core.enums.ProcessorType.RULE=\u898F\u5247 +io.sc.engine.rule.core.enums.ProcessorType.RULE_SET=\u898F\u5247\u96C6 io.sc.engine.rule.core.enums.ProcessorType.SCORE_CARD=\u8A55\u5206\u5361 io.sc.engine.rule.core.enums.ProcessorType.SINGLE_RULE=\u55AE\u898F\u5247 io.sc.engine.rule.core.enums.ProcessorType.SQL=SQL \u8CE6\u503C diff --git a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums_zh_CN.properties b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums_zh_CN.properties index 08da7958..375cb5e3 100644 --- a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums_zh_CN.properties +++ b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums_zh_CN.properties @@ -38,8 +38,6 @@ io.sc.engine.rule.core.enums.ParameterType.IN_OPTION=\u8F93\u5165\u503C(\u9009\u io.sc.engine.rule.core.enums.ParameterType.IN_SUB_OUT=\u5B50\u6A21\u578B\u7ED3\u679C\u503C io.sc.engine.rule.core.enums.ParameterType.INDICATOR=\u6307\u6807 io.sc.engine.rule.core.enums.ParameterType.INTERMEDIATE=\u4E2D\u95F4\u503C -io.sc.engine.rule.core.enums.ParameterType.RULE_RESULT=\u89C4\u5219\u7ED3\u679C\u503C -io.sc.engine.rule.core.enums.ParameterType.SINGLE_RULE_RESULT=\u5355\u89C4\u5219\u7ED3\u679C\u503C io.sc.engine.rule.core.enums.ParameterType.OUT=\u7ED3\u679C\u503C io.sc.engine.rule.core.enums.ParameterType.CONSTANT=\u5E38\u91CF @@ -66,7 +64,7 @@ io.sc.engine.rule.core.enums.ProcessorType.NUMBER_RANGE=\u6570\u503C\u5206\u6BB5 io.sc.engine.rule.core.enums.ProcessorType.OBJECT_PROPERTIES=\u5BF9\u8C61\u5C5E\u6027\u8D4B\u503C io.sc.engine.rule.core.enums.ProcessorType.OPTION_VALUE=\u9009\u9879\u503C io.sc.engine.rule.core.enums.ProcessorType.PMML=\u9884\u6D4B\u6A21\u578B\u6807\u8BB0\u8BED\u8A00 -io.sc.engine.rule.core.enums.ProcessorType.RULE=\u89C4\u5219 +io.sc.engine.rule.core.enums.ProcessorType.RULE_SET=\u89C4\u5219\u96C6 io.sc.engine.rule.core.enums.ProcessorType.SCORE_CARD=\u8BC4\u5206\u5361 io.sc.engine.rule.core.enums.ProcessorType.SINGLE_RULE=\u5355\u89C4\u5219 io.sc.engine.rule.core.enums.ProcessorType.SQL=SQL \u8D4B\u503C diff --git a/io.sc.engine.rule.frontend/package.json b/io.sc.engine.rule.frontend/package.json index 851718ab..75dd330b 100644 --- a/io.sc.engine.rule.frontend/package.json +++ b/io.sc.engine.rule.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.engine.rule.frontend", - "version": "8.2.2", + "version": "8.2.3", "description": "", "private": false, "keywords": [], @@ -111,7 +111,7 @@ "node-sql-parser": "5.3.4", "pinia": "2.2.6", "pinia-undo": "0.2.4", - "platform-core": "8.2.8", + "platform-core": "8.2.14", "quasar": "2.17.4", "sort-array": "5.0.0", "svg-path-commander": "2.1.5", diff --git a/io.sc.engine.rule.frontend/src/i18n/messages.json b/io.sc.engine.rule.frontend/src/i18n/messages.json index 0d948c2b..d8e6f163 100644 --- a/io.sc.engine.rule.frontend/src/i18n/messages.json +++ b/io.sc.engine.rule.frontend/src/i18n/messages.json @@ -119,7 +119,7 @@ "re.processor.grid.entity.objectProperties": "Object Properties", "re.processor.grid.entity.optionCode": "Option", "re.processor.grid.entity.pmml": "PMML", - "re.processor.grid.entity.rule": "Rule", + "re.processor.grid.entity.ruleSet": "Rule Set", "re.processor.grid.entity.scoreCard": "Score Card", "re.processor.grid.entity.singleRule": "Single Rule", "re.processor.grid.entity.sqlDatasourceName": "Datasource Name", diff --git a/io.sc.engine.rule.frontend/src/i18n/messages_tw_CN.json b/io.sc.engine.rule.frontend/src/i18n/messages_tw_CN.json index a7a677fd..c7c010ac 100644 --- a/io.sc.engine.rule.frontend/src/i18n/messages_tw_CN.json +++ b/io.sc.engine.rule.frontend/src/i18n/messages_tw_CN.json @@ -119,7 +119,7 @@ "re.processor.grid.entity.objectProperties": "對象屬性", "re.processor.grid.entity.optionCode": "選項", "re.processor.grid.entity.pmml": "PMML", - "re.processor.grid.entity.rule": "規則", + "re.processor.grid.entity.ruleSet": "規則集", "re.processor.grid.entity.scoreCard": "評分卡", "re.processor.grid.entity.singleRule": "單規則", "re.processor.grid.entity.sqlDatasourceName": "數據源名稱", diff --git a/io.sc.engine.rule.frontend/src/i18n/messages_zh_CN.json b/io.sc.engine.rule.frontend/src/i18n/messages_zh_CN.json index fb32a0b8..786bff43 100644 --- a/io.sc.engine.rule.frontend/src/i18n/messages_zh_CN.json +++ b/io.sc.engine.rule.frontend/src/i18n/messages_zh_CN.json @@ -119,7 +119,7 @@ "re.processor.grid.entity.objectProperties": "对象属性", "re.processor.grid.entity.optionCode": "选项", "re.processor.grid.entity.pmml": "PMML", - "re.processor.grid.entity.rule": "规则", + "re.processor.grid.entity.ruleSet": "规则集", "re.processor.grid.entity.scoreCard": "评分卡", "re.processor.grid.entity.singleRule": "单规则", "re.processor.grid.entity.sqlDatasourceName": "数据源名称", diff --git a/io.sc.engine.rule.frontend/src/views/lib/IndicatorGrid.vue b/io.sc.engine.rule.frontend/src/views/lib/IndicatorGrid.vue index 8a3dba18..d97ccb5a 100644 --- a/io.sc.engine.rule.frontend/src/views/lib/IndicatorGrid.vue +++ b/io.sc.engine.rule.frontend/src/views/lib/IndicatorGrid.vue @@ -110,7 +110,7 @@ :columns="[ { width: '100%', - name: 'namec', + name: 'name', label: $t('name'), format: (value: any, row: any) => { return row.name; diff --git a/io.sc.engine.rule.frontend/src/views/lib/Lib.vue b/io.sc.engine.rule.frontend/src/views/lib/Lib.vue index 1f066f1a..5351af29 100644 --- a/io.sc.engine.rule.frontend/src/views/lib/Lib.vue +++ b/io.sc.engine.rule.frontend/src/views/lib/Lib.vue @@ -5,7 +5,6 @@ ref="libTreeGridRef" @row-click=" (args: any) => { - console.log('>>>>>'); if (args.row.type === 'INDICATOR') { currentSelectedLibRef = args.row; readOnlyRef = currentSelectedLibRef.status !== 'SKETCH'; diff --git a/io.sc.engine.rule.frontend/src/views/resources/Resources.vue b/io.sc.engine.rule.frontend/src/views/resources/Resources.vue index f6efd3be..cce423f0 100644 --- a/io.sc.engine.rule.frontend/src/views/resources/Resources.vue +++ b/io.sc.engine.rule.frontend/src/views/resources/Resources.vue @@ -7,6 +7,7 @@ :config-button="true" selection="multiple" :checkbox-selection="false" + dnd-mode="server" :tree="true" :tree-icon=" (row) => { diff --git a/io.sc.engine.rule.frontend/src/views/resources/designer/DecisionTreeDialog.vue b/io.sc.engine.rule.frontend/src/views/resources/designer/DecisionTreeDialog.vue index f06b9f51..23dca002 100644 --- a/io.sc.engine.rule.frontend/src/views/resources/designer/DecisionTreeDialog.vue +++ b/io.sc.engine.rule.frontend/src/views/resources/designer/DecisionTreeDialog.vue @@ -345,7 +345,7 @@ const open = async (parameterId, processorId) => { processorIdRef.value = processorId; // 获取资源摘要 - const resourceAbstractResponse = await axios.get(Environment.apiContextPath('/api/re/resource/getAllReleasableResourceAbstract')); + const resourceAbstractResponse = await axios.get(Environment.apiContextPath('/api/re/resource/getAllResourceAbstract')); resourceAbstractsRef.value = resourceAbstractResponse?.data; // 获取决策树 graph xml diff --git a/io.sc.engine.rule.frontend/src/views/resources/designer/ExecutionFlowDialog.vue b/io.sc.engine.rule.frontend/src/views/resources/designer/ExecutionFlowDialog.vue index 28b769e0..2284cec2 100644 --- a/io.sc.engine.rule.frontend/src/views/resources/designer/ExecutionFlowDialog.vue +++ b/io.sc.engine.rule.frontend/src/views/resources/designer/ExecutionFlowDialog.vue @@ -286,7 +286,7 @@ const vertexDefines = [ }, dataUrl: Environment.apiContextPath('/api/re/resource'), pageable: false, - sortBy: ['order', '-lastModifyDate'], + sortBy: ['type', 'namec', '-lastModifyDate'], toolbarConfigure: { noIcon: false }, toolbarActions: ['refresh', 'expand'], columns: [ @@ -398,7 +398,7 @@ const vertexDefines = [ }, dataUrl: Environment.apiContextPath('/api/re/resource'), pageable: false, - sortBy: ['order', '-lastModifyDate'], + sortBy: ['type', 'namec', '-lastModifyDate'], toolbarConfigure: { noIcon: false }, toolbarActions: ['refresh', 'expand'], columns: [ @@ -522,7 +522,7 @@ const open = async (parameterId, processorId) => { processorIdRef.value = processorId; // 获取资源摘要 - const resourceAbstractResponse = await axios.get(Environment.apiContextPath('/api/re/resource/getAllReleasableResourceAbstract')); + const resourceAbstractResponse = await axios.get(Environment.apiContextPath('/api/re/resource/getAllResourceAbstract')); resourceAbstractsRef.value = resourceAbstractResponse?.data; // 获取子模型 diff --git a/io.sc.engine.rule.frontend/src/views/resources/designer/Parameter.vue b/io.sc.engine.rule.frontend/src/views/resources/designer/Parameter.vue index 163978ab..ab5950fb 100644 --- a/io.sc.engine.rule.frontend/src/views/resources/designer/Parameter.vue +++ b/io.sc.engine.rule.frontend/src/views/resources/designer/Parameter.vue @@ -84,25 +84,6 @@ }, }, 'separator', - { - extend: 'add', - name: 'ruleResult', - label: $t('re.parameter.grid.toolbar.add.ruleResult'), - icon: 'bi-sliders', - afterClick: (args) => { - args.grid.getEditorForm().setFieldValue('type', 'RULE_RESULT'); - }, - }, - { - extend: 'add', - name: 'singleRuleResult', - label: $t('re.parameter.grid.toolbar.add.singleRuleResult'), - icon: 'bi-lightning', - afterClick: (args) => { - args.grid.getEditorForm().setFieldValue('type', 'SINGLE_RULE_RESULT'); - }, - }, - 'separator', { name: 'importPmml', label: $t('re.parameter.grid.toolbar.add.importPmml'), diff --git a/io.sc.engine.rule.frontend/src/views/shared/ProcessorManager.ts b/io.sc.engine.rule.frontend/src/views/shared/ProcessorManager.ts index 447b7833..caa6d50c 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/ProcessorManager.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/ProcessorManager.ts @@ -14,7 +14,7 @@ import { ObjectProperties, OptionValue, Pmml, - Rule, + RuleSet, ScoreCard, SingleRule, Sql, @@ -24,6 +24,9 @@ import { class ProcessorManager { static PROCESSOR_TYPES_PARAMETER: string[] = [ + 'SINGLE_RULE', + 'RULE_SET', + 'separator', 'OBJECT_PROPERTIES', 'OPTION_VALUE', 'MATH_FORMULA', @@ -41,8 +44,6 @@ class ProcessorManager { 'GROOVY_SCRIPT', 'SQL', 'HTTP_REQUEST', - 'RULE', - 'SINGLE_RULE', ]; static PROCESSOR_TYPES_INDICATOR = [ 'OBJECT_PROPERTIES', @@ -62,6 +63,8 @@ class ProcessorManager { constructor(targetType: string, context?: any) { this.targetType = targetType; this.processors = {}; + this.processors.SINGLE_RULE = new SingleRule(this.targetType, context); + this.processors.RULE_SET = new RuleSet(this.targetType, context); this.processors.ARITHMETIC = new Arithmetic(this.targetType, context); this.processors.CONDITION_RANGE = new ConditionRange(this.targetType, context); this.processors.DECISION_TABLE = new DecisionTable(this.targetType, context); @@ -74,9 +77,7 @@ class ProcessorManager { this.processors.OBJECT_PROPERTIES = new ObjectProperties(this.targetType, context); this.processors.OPTION_VALUE = new OptionValue(this.targetType, context); this.processors.PMML = new Pmml(this.targetType, context); - this.processors.RULE = new Rule(this.targetType, context); this.processors.SCORE_CARD = new ScoreCard(this.targetType, context); - this.processors.SINGLE_RULE = new SingleRule(this.targetType, context); this.processors.SQL = new Sql(this.targetType, context); this.processors.HTTP_REQUEST = new HttpRequest(this.targetType, context); this.processors.TERNARY = new Ternary(this.targetType, context); @@ -88,7 +89,11 @@ class ProcessorManager { switch (this.targetType) { case Processor.PARAMETER: ProcessorManager.PROCESSOR_TYPES_PARAMETER.forEach((name) => { - result.push(this.processors[name].getToolbarAction()); + if (name === 'separator') { + result.push('separator'); + } else { + result.push(this.processors[name].getToolbarAction()); + } }); break; case Processor.INDICATOR: @@ -112,12 +117,16 @@ class ProcessorManager { switch (this.targetType) { case Processor.PARAMETER: ProcessorManager.PROCESSOR_TYPES_PARAMETER.forEach((name) => { - result.push(...this.processors[name].getEditorFields()); + if (name !== 'separator') { + result.push(...this.processors[name].getEditorFields()); + } }); break; case Processor.INDICATOR: ProcessorManager.PROCESSOR_TYPES_INDICATOR.forEach((name) => { - result.push(...this.processors[name].getEditorFields()); + if (name !== 'separator') { + result.push(...this.processors[name].getEditorFields()); + } }); break; } @@ -129,12 +138,16 @@ class ProcessorManager { switch (this.targetType) { case Processor.PARAMETER: ProcessorManager.PROCESSOR_TYPES_PARAMETER.forEach((name) => { - result.push(...this.processors[name].getViewerFields()); + if (name !== 'separator') { + result.push(...this.processors[name].getViewerFields()); + } }); break; case Processor.INDICATOR: ProcessorManager.PROCESSOR_TYPES_INDICATOR.forEach((name) => { - result.push(...this.processors[name].getViewerFields()); + if (name !== 'separator') { + result.push(...this.processors[name].getViewerFields()); + } }); break; } diff --git a/io.sc.engine.rule.frontend/src/views/shared/TestCaseGrid.vue b/io.sc.engine.rule.frontend/src/views/shared/TestCaseGrid.vue index ccd942a7..48328ab3 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/TestCaseGrid.vue +++ b/io.sc.engine.rule.frontend/src/views/shared/TestCaseGrid.vue @@ -81,15 +81,16 @@ panel: { columnNum: 1, fields: [ - { name: 'id', label: $t('id') }, - { name: 'name', label: $t('name') }, - { name: 'description', label: $t('description') }, - { name: 'ownerId', label: $t('re.testcase.grid.entity.ownerId') }, { name: 'ownerType', label: $t('re.testcase.grid.entity.ownerType'), format: Formater.none() }, + { name: 'ownerId', label: $t('re.testcase.grid.entity.ownerId') }, { name: 'ownerCode', label: $t('re.testcase.grid.entity.ownerCode') }, { name: 'ownerName', label: $t('re.testcase.grid.entity.ownerName') }, { name: 'ownerVersion', label: $t('re.testcase.grid.entity.ownerVersion') }, { name: 'ownerStatus', label: $t('re.testcase.grid.entity.ownerStatus'), format: Formater.none() }, + + { name: 'id', label: $t('id') }, + { name: 'name', label: $t('name') }, + { name: 'description', label: $t('description') }, ], }, }" diff --git a/io.sc.engine.rule.frontend/src/views/shared/TestcaseParameterGrid.vue b/io.sc.engine.rule.frontend/src/views/shared/TestcaseParameterGrid.vue index ab86e860..1c662192 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/TestcaseParameterGrid.vue +++ b/io.sc.engine.rule.frontend/src/views/shared/TestcaseParameterGrid.vue @@ -42,7 +42,7 @@ icon: 'bi-caret-right', click: (args: any) => { axios.post(Environment.apiContextPath('/api/re/testCase/execute/' + Tools.initialize(testCase?.id, '')), {}, { loading: true }).then(() => { - testcaseParameterGridRef?.refresh(); + gridRef?.refresh(); }); }, }, @@ -160,6 +160,7 @@ toolbar: false, rows: 4, lang: 'json', + editable: true, }, { name: 'skipCheck', label: $t('re.testCaseParameter.grid.entity.skipCheck'), type: 'w-checkbox' }, ], diff --git a/io.sc.engine.rule.frontend/src/views/shared/UserDefinedFunctionsManager.ts b/io.sc.engine.rule.frontend/src/views/shared/UserDefinedFunctionsManager.ts index c8b3cb51..b0fe8445 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/UserDefinedFunctionsManager.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/UserDefinedFunctionsManager.ts @@ -13,7 +13,7 @@ class UserDefinedFunctionsManager { } public async load() { - const response = await axios.get(Environment.apiContextPath('/api/re/function?pageable=false')); + const response = await axios.get(Environment.apiContextPath('/api/re/function?pageable=false&sortBy=name')); this.#functions.value = Tools.objects2Objects(response.data?.content, null, (obj: any) => { return obj.enable; }); diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/Arithmetic.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/Arithmetic.ts index f80b4e6f..37e9b03a 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/Arithmetic.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/Arithmetic.ts @@ -15,8 +15,8 @@ class Arithmetic extends Processor { label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE), icon: 'bi-calculator', enableIf: (args) => { - const type = this.context.target.type; - return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; + const valueType = this.context.target.valueType; + return valueType !== 'io.sc.engine.rule.core.SingleRuleResult' && valueType !== 'io.sc.engine.rule.core.RuleSetResult'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE); diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/ConditionRange.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/ConditionRange.ts index 5e27ed6f..e2562c69 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/ConditionRange.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/ConditionRange.ts @@ -16,8 +16,8 @@ class ConditionRange extends Processor { label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE), icon: 'bi-card-checklist', enableIf: (args: any) => { - const type = this.context.target.type; - return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; + const valueType = this.context.target.valueType; + return valueType !== 'io.sc.engine.rule.core.SingleRuleResult' && valueType !== 'io.sc.engine.rule.core.RuleSetResult'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE); diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTable.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTable.ts index 0b2b67fe..db94e288 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTable.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTable.ts @@ -19,8 +19,8 @@ class DecisionTable extends Processor { label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE), icon: 'bi-grid-3x3', enableIf: (args: any) => { - const type = this.context.target.type; - return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; + const valueType = this.context.target.valueType; + return valueType !== 'io.sc.engine.rule.core.SingleRuleResult' && valueType !== 'io.sc.engine.rule.core.RuleSetResult'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE); diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTable2c.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTable2c.ts index 358594ca..bbd44c88 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTable2c.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTable2c.ts @@ -18,8 +18,8 @@ class DecisionTable2C extends DecisionTable { label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE), icon: 'bi-grid-3x2', enableIf: (args) => { - const type = this.context.target.type; - return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; + const valueType = this.context.target.valueType; + return valueType !== 'io.sc.engine.rule.core.SingleRuleResult' && valueType !== 'io.sc.engine.rule.core.RuleSetResult'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE); diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTree.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTree.ts index d21b0e05..502bbbac 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTree.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTree.ts @@ -30,8 +30,8 @@ class DecisionTree extends Processor { label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE), icon: 'bi-tree', enableIf: (args) => { - const type = this.context.target.type; - return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; + const valueType = this.context.target.valueType; + return valueType !== 'io.sc.engine.rule.core.SingleRuleResult' && valueType !== 'io.sc.engine.rule.core.RuleSetResult'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE); diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/ExecutionFlow.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/ExecutionFlow.ts index edfbefa8..b379cd33 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/ExecutionFlow.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/ExecutionFlow.ts @@ -31,8 +31,8 @@ class ExecutionFlow extends Processor { label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE), icon: 'bi-bounding-box-circles', enableIf: (args: any) => { - const type = this.context.target.type; - return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; + const valueType = this.context.target.valueType; + return valueType !== 'io.sc.engine.rule.core.SingleRuleResult' && valueType !== 'io.sc.engine.rule.core.RuleSetResult'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE); diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/GroovyScript.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/GroovyScript.ts index d7c39028..d554226c 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/GroovyScript.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/GroovyScript.ts @@ -15,8 +15,8 @@ class GroovyScript extends Processor { label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE), icon: 'bi-code', enableIf: (args) => { - const type = this.context.target.type; - return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; + const valueType = this.context.target.valueType; + return valueType !== 'io.sc.engine.rule.core.SingleRuleResult' && valueType !== 'io.sc.engine.rule.core.RuleSetResult'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE); diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/HttpRequest.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/HttpRequest.ts index 637943fc..b8297a63 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/HttpRequest.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/HttpRequest.ts @@ -28,8 +28,8 @@ class HttpRequest extends Processor { label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE), icon: 'sync_alt', enableIf: (args: any) => { - const type = this.context.target.type; - return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; + const valueType = this.context.target.valueType; + return valueType !== 'io.sc.engine.rule.core.SingleRuleResult' && valueType !== 'io.sc.engine.rule.core.RuleSetResult'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE); diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/MathFormula.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/MathFormula.ts index fc478ebc..4d29e62f 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/MathFormula.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/MathFormula.ts @@ -17,8 +17,8 @@ class MathFormula extends Processor { label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE), icon: 'bi-superscript', enableIf: (args: any) => { - const type = this.context.target.type; - return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; + const valueType = this.context.target.valueType; + return valueType !== 'io.sc.engine.rule.core.SingleRuleResult' && valueType !== 'io.sc.engine.rule.core.RuleSetResult'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE); @@ -83,12 +83,21 @@ class MathFormula extends Processor { } public afterEditorOpen(args: any) { - // 将 ${aaa}.${bbb}[n].${ccc} 替换成 aaa.bbb[n].ccc - // 这样可使在数学公式编辑器中不出现 ${}, 显示更友好 - args.grid.getEditorForm().setFieldValue('mathFormula', ExpressionTools.replacePlaceholder(args.data.mathFormula)); args.grid.getEditorDialog().setWidth(this.EDITOR_DIALOG_WIDTH); this.initAutoCompletionManager(); this.initUserDefinedFunctionsManager(); + + const form = args.grid.getEditorForm(); + switch (form.getStatus()) { + case 'add': // 新增时清空表格内容 + break; + case 'edit': // 编辑/复制时填充表格内容 + case 'clone': + // 将 ${aaa}.${bbb}[n].${ccc} 替换成 aaa.bbb[n].ccc + // 这样可使在数学公式编辑器中不出现 ${}, 显示更友好 + form.setFieldValue('mathFormula', ExpressionTools.replacePlaceholder(args.data.mathFormula)); + break; + } } } diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/NumberRange.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/NumberRange.ts index 77cbda63..0773e55e 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/NumberRange.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/NumberRange.ts @@ -16,8 +16,8 @@ class NumberRange extends Processor { label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE), icon: 'bi-justify', enableIf: (args: any) => { - const type = this.context.target.type; - return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; + const valueType = this.context.target.valueType; + return valueType !== 'io.sc.engine.rule.core.SingleRuleResult' && valueType !== 'io.sc.engine.rule.core.RuleSetResult'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE); diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/ObjectProperties.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/ObjectProperties.ts index 869fc991..32eb826b 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/ObjectProperties.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/ObjectProperties.ts @@ -17,7 +17,12 @@ class ObjectProperties extends Processor { label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE), icon: 'bi-list-task', enableIf: (args: any) => { - return !ValueTypeUtil.isBase(this.context.target.valueType); + const valueType = this.context.target.valueType; + return ( + !ValueTypeUtil.isBase(this.context.target.valueType) && + valueType !== 'io.sc.engine.rule.core.SingleRuleResult' && + valueType !== 'io.sc.engine.rule.core.RuleSetResult' + ); }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE); diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/OptionValue.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/OptionValue.ts index 8756f484..a1dccaca 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/OptionValue.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/OptionValue.ts @@ -19,8 +19,8 @@ class OptionValue extends Processor { label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE), icon: 'bi-card-list', enableIf: (args: any) => { - const type = this.context.target.type; - return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; + const valueType = this.context.target.valueType; + return valueType !== 'io.sc.engine.rule.core.SingleRuleResult' && valueType !== 'io.sc.engine.rule.core.RuleSetResult'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE); diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/Pmml.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/Pmml.ts index 5201d129..99b15f8e 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/Pmml.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/Pmml.ts @@ -15,8 +15,8 @@ class Pmml extends Processor { label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE), icon: 'bi-filetype-xml', enableIf: (args) => { - const type = this.context.target.type; - return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; + const valueType = this.context.target.valueType; + return valueType !== 'io.sc.engine.rule.core.SingleRuleResult' && valueType !== 'io.sc.engine.rule.core.RuleSetResult'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE); diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/Rule.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/RuleSet.ts similarity index 57% rename from io.sc.engine.rule.frontend/src/views/shared/processors/Rule.ts rename to io.sc.engine.rule.frontend/src/views/shared/processors/RuleSet.ts index 2fae08c8..a70e9bc5 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/Rule.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/RuleSet.ts @@ -2,22 +2,22 @@ import { $t, Tools, MarkupTableUtil } from 'platform-core'; import { Processor } from '../Processor'; import { PlaceHolder } from '@/utils/PlaceHolder'; -class Rule extends Processor { +class RuleSet extends Processor { constructor(targetType: string, context?: any) { super(targetType, context); - this.PROCESSOR_TYPE = 'RULE'; - this.EDITOR_DIALOG_WIDTH = 800; + this.PROCESSOR_TYPE = 'RULE_SET'; + this.EDITOR_DIALOG_WIDTH = 1024; } public getToolbarAction(): any { return { extend: 'add', - name: 'rule', + name: 'ruleSet', label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE), icon: 'bi-shadows', enableIf: (args: any) => { - const type = this.context.target.type; - return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; + const valueType = this.context.target.valueType; + return valueType === 'io.sc.engine.rule.core.RuleSetResult'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE); @@ -26,12 +26,12 @@ class Rule extends Processor { } public format(row: any): any { - const objs: any[] = Tools.json2Object(row.rule); + const objs: any[] = Tools.json2Object(row.ruleSet); if (objs && Tools.isArray(objs) && objs.length > 0) { let header: string = ''; header += ''; - header += ' ' + $t('category') + ''; header += ' ' + $t('level') + ''; + header += ' ' + $t('category') + ''; header += ' ' + $t('code') + ''; header += ' ' + $t('name') + ''; header += ' ' + $t('condition') + ''; @@ -42,26 +42,26 @@ class Rule extends Processor { let body: string = ''; objs.forEach((obj) => { body += ''; - body += ' ' + $t(obj.category) + ''; - body += ' ' + $t(obj.level) + ''; - body += ' ' + $t(obj.code) + ''; - body += ' ' + $t(obj.name) + ''; - body += ' ' + $t(obj.condition) + ''; - body += ' ' + $t(obj.value) + ''; - body += ' ' + $t(obj.message) + ''; + body += ' ' + obj.level + ''; + body += ' ' + obj.category + ''; + body += ' ' + obj.code + ''; + body += ' ' + obj.name + ''; + body += ' ' + PlaceHolder.replace(obj.condition) + ''; + body += ' ' + PlaceHolder.replace(obj.value) + ''; + body += ' ' + PlaceHolder.replace(obj.message) + ''; body += ''; }); return MarkupTableUtil.markupTable(header, body, Tools.mergeObject({}, Processor.FORMAT_TABLE_STYLE)); } - return row.rule; + return row.ruleSet; } public getEditorFields(): any { return [ { colSpan: 12, - name: 'rule', - label: $t('re.processor.grid.entity.rule'), + name: 'ruleSet', + label: $t('re.processor.grid.entity.ruleSet'), showIf: (args: any) => { return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; }, @@ -70,102 +70,66 @@ class Rule extends Processor { localMode: true, dbClickOperation: 'edit', autoFetchData: false, - denseBody: true, + denseBody: false, dndMode: 'local', pageable: false, configButton: false, toolbarConfigure: { noIcon: false }, - toolbarActions: ['add', 'clone', 'edit', 'remove'], - columns: [ - { - name: 'category', - label: $t('category'), - align: 'left', - sortable: false, - format: (value: any) => { - return PlaceHolder.replace(value); - }, - }, - { - name: 'level', - label: $t('level'), - align: 'left', - sortable: false, - format: (value: any) => { - return PlaceHolder.replace(value); - }, - }, - { - name: 'code', - label: $t('code'), - align: 'left', - sortable: false, - format: (value: any) => { - return PlaceHolder.replace(value); - }, - }, - { - name: 'name', - label: $t('name'), - align: 'left', - sortable: false, - format: (value: any) => { - return PlaceHolder.replace(value); - }, - }, - { - name: 'condition', - label: $t('condition'), - align: 'left', - sortable: false, - format: (value: any) => { - return PlaceHolder.replace(value); - }, - }, - { - name: 'value', - label: $t('value'), - sortable: false, - format: (value: any) => { - return PlaceHolder.replace(value); - }, - }, + toolbarActions: [ + 'add', + 'clone', + 'edit', + 'remove', + 'separator', { - name: 'message', - label: $t('message'), - sortable: false, - format: (value: any) => { - return PlaceHolder.replace(value); + name: 'example', + label: $t('example'), + icon: 'bi-balloon', + click: (args: any) => { + const sampleData = [ + { + level: 1, + category: '财务预警', + code: '', + name: '', + condition: '${资产负债率}>0.3', + value: '${资产负债率}', + message: '资产负债率: ${资产负债率}, 大于 0.3', + }, + { + level: 1, + category: '财务预警', + code: '', + name: '', + condition: '${净利润率}>0.3', + value: '${净利润率}', + message: '净利润率: ${净利润率}, 大于 0.3', + }, + ]; + args.grid.setLocalData(sampleData); }, }, ], + columns: [ + { width: 60, name: 'level', label: $t('level') }, + { width: 100, name: 'category', label: $t('category') }, + { width: 100, name: 'code', label: $t('code') }, + { width: 100, name: 'name', label: $t('name') }, + { width: 250, name: 'condition', label: $t('condition') }, + { width: 200, name: 'value', label: $t('value') }, + { width: '100%', name: 'message', label: $t('message') }, + ], editor: { - dialog: { - width: '600px', + cellDialog: { + width: '1024px', }, form: { colsNum: 1, fields: [ - { - name: 'category', - label: $t('category'), - type: 'w-text', - }, - { - name: 'level', - label: $t('level'), - type: 'w-integer', - }, - { - name: 'code', - label: $t('code'), - type: 'w-text', - }, - { - name: 'name', - label: $t('name'), - type: 'w-text', - }, + { name: 'level', label: $t('level'), type: 'w-integer' }, + { name: 'category', label: $t('category'), type: 'w-text' }, + { name: 'code', label: $t('code'), type: 'w-text' }, + { name: 'name', label: $t('name'), type: 'w-text' }, { name: 'condition', label: $t('condition'), @@ -205,17 +169,20 @@ class Rule extends Processor { ], }, }, - onBeforeEditorDataSubmit: (args: any) => {}, + onAfterEditorOpen: (args: any) => { + this.initAutoCompletionManager(); + this.initUserDefinedFunctionsManager(); + }, }, ]; } public getViewerFields(): any { - return [{ name: 'rule', label: $t('re.processor.grid.entity.rule') }]; + return [{ name: 'ruleSet', label: $t('re.processor.grid.entity.ruleSet') }]; } public beforeEditorDataSubmit(args: any): void { - const grid = args.grid.getEditorForm().getFieldComponent('rule'); + const grid = args.grid.getEditorForm().getFieldComponent('ruleSet'); const localData: any[] = grid.getRows(); const rules: any[] = []; localData.forEach((item) => { @@ -229,7 +196,7 @@ class Rule extends Processor { message: item.message, }); }); - args.data.rule = Tools.object2Json(rules); + args.data.ruleSet = Tools.object2Json(rules); } public afterEditorOpen(args: any): void { @@ -238,18 +205,18 @@ class Rule extends Processor { this.initUserDefinedFunctionsManager(); const form = args.grid.getEditorForm(); - const grid = args.grid.getEditorForm().getFieldComponent('rule'); + const grid = args.grid.getEditorForm().getFieldComponent('ruleSet'); switch (form.getStatus()) { case 'add': // 新增时清空表格内容 grid.setLocalData([]); break; case 'edit': // 编辑/复制时填充表格内容 case 'clone': - const data = Tools.json2Object(args.data.rule); + const data = Tools.json2Object(args.data.ruleSet); grid.setLocalData(data); break; } } } -export { Rule }; +export { RuleSet }; diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/ScoreCard.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/ScoreCard.ts index 4277b797..1b0bc7b5 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/ScoreCard.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/ScoreCard.ts @@ -33,8 +33,8 @@ class ScoreCard extends Processor { label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE), icon: 'bi-credit-card-2-front', enableIf: (args) => { - const type = this.context.target.type; - return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; + const valueType = this.context.target.valueType; + return valueType !== 'io.sc.engine.rule.core.SingleRuleResult' && valueType !== 'io.sc.engine.rule.core.RuleSetResult'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE); @@ -48,8 +48,9 @@ class ScoreCard extends Processor { let str = ''; objs.forEach((obj: any) => { str += ''; - str += ' ' + $t('io.sc.engine.rule.core.enums.ProcessorType.' + obj.type) + ''; str += ' ' + this.getParameterNameByCode(obj.code) + ''; + str += ' ' + (Tools.isNill(obj.weight) ? '' : obj.weight) + ''; + str += ' ' + $t('io.sc.engine.rule.core.enums.ProcessorType.' + obj.type) + ''; if (obj.type === 'CONDITION_RANGE') { str += ' ' + this.#conditionRange.format({ conditionRange: Tools.object2Json(obj.conditionRange) }) + ''; } else if (obj.type === 'NUMBER_RANGE') { diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/SingleRule.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/SingleRule.ts index 0fdd4af5..f629d4a2 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/SingleRule.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/SingleRule.ts @@ -1,11 +1,12 @@ -import { $t } from 'platform-core'; +import { $t, Tools, MarkupTableUtil } from 'platform-core'; import { Processor } from '../Processor'; +import { PlaceHolder } from '@/utils/PlaceHolder'; class SingleRule extends Processor { constructor(targetType: string, context?: any) { super(targetType, context); this.PROCESSOR_TYPE = 'SINGLE_RULE'; - this.EDITOR_DIALOG_WIDTH = 800; + this.EDITOR_DIALOG_WIDTH = 1024; } public getToolbarAction(): any { @@ -15,8 +16,8 @@ class SingleRule extends Processor { label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE), icon: 'bi-noise-reduction', enableIf: (args: any) => { - const type = this.context.target.type; - return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; + const valueType = this.context.target.valueType; + return valueType === 'io.sc.engine.rule.core.SingleRuleResult'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE); @@ -25,21 +26,171 @@ class SingleRule extends Processor { } public format(row: any): any { + const objs: any[] = Tools.json2Object(row.singleRule); + if (objs && Tools.isArray(objs) && objs.length > 0) { + let header: string = ''; + header += ''; + header += ' ' + $t('level') + ''; + header += ' ' + $t('category') + ''; + header += ' ' + $t('condition') + ''; + header += ' ' + $t('value') + ''; + header += ' ' + $t('message') + ''; + header += ''; + + let body: string = ''; + objs.forEach((obj) => { + body += ''; + body += ' ' + obj.level + ''; + body += ' ' + obj.category + ''; + body += ' ' + PlaceHolder.replace(obj.condition) + ''; + body += ' ' + PlaceHolder.replace(obj.value) + ''; + body += ' ' + PlaceHolder.replace(obj.message) + ''; + body += ''; + }); + return MarkupTableUtil.markupTable(header, body, Tools.mergeObject({}, Processor.FORMAT_TABLE_STYLE)); + } return row.singleRule; } public getEditorFields(): any { - return []; + return [ + { + colSpan: 12, + name: 'singleRule', + label: $t('re.processor.grid.entity.singleRule'), + showIf: (args: any) => { + return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; + }, + type: 'w-grid', + height: 300, + localMode: true, + dbClickOperation: 'edit', + autoFetchData: false, + denseBody: false, + dndMode: 'local', + pageable: false, + configButton: false, + toolbarConfigure: { noIcon: false }, + toolbarActions: [ + 'add', + 'clone', + 'edit', + 'remove', + 'separator', + { + name: 'example', + label: $t('example'), + icon: 'bi-balloon', + click: (args: any) => { + const sampleData = [ + { level: 1, category: '财务预警', condition: '${资产负债率}>0.3', value: '${资产负债率}', message: '资产负债率: ${资产负债率}, 大于 0.3' }, + { level: 1, category: '财务预警', condition: '${净利润率}>0.3', value: '${净利润率}', message: '净利润率: ${净利润率}, 大于 0.3' }, + ]; + args.grid.setLocalData(sampleData); + }, + }, + ], + columns: [ + { width: 60, name: 'level', label: $t('level') }, + { width: 100, name: 'category', label: $t('category') }, + { width: 250, name: 'condition', label: $t('condition') }, + { width: 200, name: 'value', label: $t('value') }, + { width: '100%', name: 'message', label: $t('message') }, + ], + editor: { + cellDialog: { + width: '1024px', + }, + form: { + colsNum: 1, + fields: [ + { name: 'level', label: $t('level'), type: 'w-integer' }, + { name: 'category', label: $t('category'), type: 'w-text' }, + { + name: 'condition', + label: $t('condition'), + type: 'w-code-mirror', + lang: 'java', + rows: 4, + lineWrap: true, + lineBreak: false, + placeholder: true, + autoCompletion: this.autoCompletionManager.autoCompletion(), + userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(), + }, + { + name: 'value', + label: $t('value'), + type: 'w-code-mirror', + lang: 'java', + rows: 4, + lineWrap: true, + lineBreak: false, + placeholder: true, + autoCompletion: this.autoCompletionManager.autoCompletion(), + userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(), + }, + { + name: 'message', + label: $t('message'), + type: 'w-code-mirror', + lang: 'java', + rows: 4, + lineWrap: true, + lineBreak: false, + placeholder: true, + autoCompletion: this.autoCompletionManager.autoCompletion(), + userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(), + }, + ], + }, + }, + onAfterEditorOpen: (args: any) => { + this.initAutoCompletionManager(); + this.initUserDefinedFunctionsManager(); + }, + }, + ]; } public getViewerFields(): any { return [{ name: 'singleRule', label: $t('re.processor.grid.entity.singleRule') }]; } - public beforeEditorDataSubmit(args: any): void {} + public beforeEditorDataSubmit(args: any): void { + const grid = args.grid.getEditorForm().getFieldComponent('singleRule'); + const localData: any[] = grid.getRows(); + const rules: any[] = []; + localData.forEach((item) => { + rules.push({ + level: item.level, + category: item.category, + condition: item.condition, + value: item.value, + message: item.message, + }); + }); + args.data.singleRule = Tools.object2Json(rules); + } public afterEditorOpen(args: any): void { args.grid.getEditorDialog().setWidth(this.EDITOR_DIALOG_WIDTH); + this.initAutoCompletionManager(); + this.initUserDefinedFunctionsManager(); + + const form = args.grid.getEditorForm(); + const grid = args.grid.getEditorForm().getFieldComponent('singleRule'); + + switch (form.getStatus()) { + case 'add': // 新增时清空表格内容 + grid.setLocalData([]); + break; + case 'edit': // 编辑/复制时填充表格内容 + case 'clone': + const data = Tools.json2Object(args.data.singleRule); + grid.setLocalData(data); + break; + } } } diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/Sql.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/Sql.ts index 2d0300a3..aa726222 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/Sql.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/Sql.ts @@ -24,8 +24,8 @@ class Sql extends Processor { label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE), icon: 'bi-filetype-sql', enableIf: (args: any) => { - const type = this.context.target.type; - return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; + const valueType = this.context.target.valueType; + return valueType !== 'io.sc.engine.rule.core.SingleRuleResult' && valueType !== 'io.sc.engine.rule.core.RuleSetResult'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE); diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/Ternary.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/Ternary.ts index b2dba85b..f2e9c4f8 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/Ternary.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/Ternary.ts @@ -16,8 +16,8 @@ class Ternary extends Processor { label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE), icon: 'bi-question', enableIf: (args: any) => { - const type = this.context.target.type; - return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; + const valueType = this.context.target.valueType; + return valueType !== 'io.sc.engine.rule.core.SingleRuleResult' && valueType !== 'io.sc.engine.rule.core.RuleSetResult'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE); diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/WhenThen.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/WhenThen.ts index 74040c35..519460dc 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/WhenThen.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/WhenThen.ts @@ -16,8 +16,8 @@ class WhenThen extends Processor { label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE), icon: 'bi-sliders', enableIf: (args: any) => { - const type = this.context.target.type; - return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; + const valueType = this.context.target.valueType; + return valueType !== 'io.sc.engine.rule.core.SingleRuleResult' && valueType !== 'io.sc.engine.rule.core.RuleSetResult'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE); diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/index.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/index.ts index b8a0c8ff..96c8fa9d 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/index.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/index.ts @@ -11,9 +11,10 @@ export { NumberRange } from './NumberRange'; export { ObjectProperties } from './ObjectProperties'; export { OptionValue } from './OptionValue'; export { Pmml } from './Pmml'; -export { Rule } from './Rule'; export { ScoreCard } from './ScoreCard'; -export { SingleRule } from './SingleRule'; export { Sql } from './Sql'; export { Ternary } from './Ternary'; export { WhenThen } from './WhenThen'; + +export { SingleRule } from './SingleRule'; +export { RuleSet } from './RuleSet'; diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/common/service/impl/AutoCompletionServiceImpl.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/common/service/impl/AutoCompletionServiceImpl.java index 10857626..2818428b 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/common/service/impl/AutoCompletionServiceImpl.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/common/service/impl/AutoCompletionServiceImpl.java @@ -224,7 +224,7 @@ public class AutoCompletionServiceImpl implements AutoCompletionService { } private void buildJavaClassValueTypes(AutoCompletion autoCompletion,Class clazz,String valueTypeCode, String valueTypeName,Integer valueTypeVersion,Locale locale) throws Exception { - if(ValueTypeUtil.isBase(clazz)) { + if(ValueTypeUtil.isBase(clazz) || ValueTypeUtil.isEnum(clazz)) { ValueType valueType =new ValueType(); valueType.setCode(clazz.getName()); valueType.setName(messageSource.getMessage(clazz.getName(),null,locale)); diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/common/service/impl/ParameterAndValueTypeServiceImpl.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/common/service/impl/ParameterAndValueTypeServiceImpl.java index fac23157..c4a2b5a2 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/common/service/impl/ParameterAndValueTypeServiceImpl.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/common/service/impl/ParameterAndValueTypeServiceImpl.java @@ -257,7 +257,7 @@ public class ParameterAndValueTypeServiceImpl implements ParameterAndValueTypeSe } private void buildJavaClassValueTypes(ParameterAndValueType parameterAndValueType,Class clazz,String valueTypeCode, String valueTypeName,Integer valueTypeVersion,Locale locale) throws Exception { - if(ValueTypeUtil.isBase(clazz)) { + if(ValueTypeUtil.isBase(clazz) || ValueTypeUtil.isEnum(clazz)) { ValueType valueType =new ValueType(); valueType.setCode(clazz.getName()); valueType.setName(messageSource.getMessage(clazz.getName(),null,locale)); diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/function/controller/FunctionWebController.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/function/controller/FunctionWebController.java index 4589b77e..36bc8c9e 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/function/controller/FunctionWebController.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/function/controller/FunctionWebController.java @@ -31,8 +31,6 @@ import java.util.Locale; public class FunctionWebController extends RestCrudController { private static final Logger log = LoggerFactory.getLogger(FunctionWebController.class); - - @RequestMapping(value="import",method= {RequestMethod.POST}) @ResponseBody public void imports(@RequestParam(name="file",required=false) MultipartFile multipartFile, Locale locale) throws Exception{ diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/converter/ParameterEntityConverter.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/converter/ParameterEntityConverter.java index f484875e..275afb68 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/converter/ParameterEntityConverter.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/converter/ParameterEntityConverter.java @@ -11,8 +11,6 @@ import io.sc.engine.rule.core.po.model.parameter.InSubOutParameter; import io.sc.engine.rule.core.po.model.parameter.IndicatorParameter; import io.sc.engine.rule.core.po.model.parameter.IntermediateParameter; import io.sc.engine.rule.core.po.model.parameter.OutParameter; -import io.sc.engine.rule.core.po.model.parameter.RuleResultParameter; -import io.sc.engine.rule.core.po.model.parameter.SingleRuleResultParameter; import io.sc.engine.rule.server.model.entity.ParameterEntity; import io.sc.engine.rule.server.model.entity.ParameterInOptionItemEntity; import io.sc.engine.rule.server.model.entity.ParameterProcessorEntity; @@ -24,8 +22,6 @@ import io.sc.engine.rule.server.model.entity.parameter.InSubOutParameterEntity; import io.sc.engine.rule.server.model.entity.parameter.IndicatorParameterEntity; import io.sc.engine.rule.server.model.entity.parameter.IntermediateParameterEntity; import io.sc.engine.rule.server.model.entity.parameter.OutParameterEntity; -import io.sc.engine.rule.server.model.entity.parameter.RuleResultParameterEntity; -import io.sc.engine.rule.server.model.entity.parameter.SingleRuleResultParameterEntity; /** * 模型参数实体转换器 @@ -59,10 +55,6 @@ public class ParameterEntityConverter { po =new InSubOutParameter(); }else if(entity instanceof IntermediateParameterEntity) { po =new IntermediateParameter(); - }else if(entity instanceof RuleResultParameterEntity) {//注意: RuleResultParameterEntity 继承 OutParameterEntity,需先处理 RuleResultParameterEntity - po =new RuleResultParameter(); - }else if(entity instanceof SingleRuleResultParameterEntity) {//注意: SingleRuleResultParameterEntity 继承 OutParameterEntity,需先处理 SingleRuleResultParameterEntity - po =new SingleRuleResultParameter(); }else if(entity instanceof OutParameterEntity) { po =new OutParameter(); }else { @@ -138,10 +130,6 @@ public class ParameterEntityConverter { entity =new InSubOutParameterEntity(); }else if(po instanceof IntermediateParameter) { entity =new IntermediateParameterEntity(); - }else if(po instanceof RuleResultParameter) {//注意: RuleResultParameterEntity 继承 OutParameterEntity,需先处理 RuleResultParameterEntity - entity =new RuleResultParameterEntity(); - }else if(po instanceof SingleRuleResultParameter) {//注意: SingleRuleResultParameter 继承 OutParameterEntity,需先处理 SingleRuleResultParameter - entity =new SingleRuleResultParameterEntity(); }else if(po instanceof OutParameter) { entity =new OutParameterEntity(); }else { diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/converter/ParameterProcessorEntityConverter.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/converter/ParameterProcessorEntityConverter.java index 4c60539d..e4f88c21 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/converter/ParameterProcessorEntityConverter.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/converter/ParameterProcessorEntityConverter.java @@ -98,10 +98,10 @@ public class ParameterProcessorEntityConverter { PmmlParameterProcessor _po =new PmmlParameterProcessor(); _po.setPmml(_entity.getPmml()); po =_po; - }else if(entity instanceof RuleParameterProcessorEntity) { - RuleParameterProcessorEntity _entity=(RuleParameterProcessorEntity)entity; - RuleParameterProcessor _po =new RuleParameterProcessor(); - _po.setRule(_entity.getRule()); + }else if(entity instanceof RuleSetParameterProcessorEntity) { + RuleSetParameterProcessorEntity _entity=(RuleSetParameterProcessorEntity)entity; + RuleSetParameterProcessor _po =new RuleSetParameterProcessor(); + _po.setRuleSet(_entity.getRuleSet()); po =_po; }else if(entity instanceof ScoreCardParameterProcessorEntity){ ScoreCardParameterProcessorEntity _entity=(ScoreCardParameterProcessorEntity)entity; @@ -251,10 +251,10 @@ public class ParameterProcessorEntityConverter { PmmlParameterProcessorEntity _entity =new PmmlParameterProcessorEntity(); _entity.setPmml(_po.getPmml()); entity =_entity; - }else if(po instanceof RuleParameterProcessor) { - RuleParameterProcessor _po =(RuleParameterProcessor)po; - RuleParameterProcessorEntity _entity =new RuleParameterProcessorEntity(); - _entity.setRule(_po.getRule()); + }else if(po instanceof RuleSetParameterProcessor) { + RuleSetParameterProcessor _po =(RuleSetParameterProcessor)po; + RuleSetParameterProcessorEntity _entity =new RuleSetParameterProcessorEntity(); + _entity.setRuleSet(_po.getRuleSet()); entity =_entity; }else if(po instanceof ScoreCardParameterProcessor) { ScoreCardParameterProcessor _po =(ScoreCardParameterProcessor)po; diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/ParameterEntity.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/ParameterEntity.java index 51294115..4af44d74 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/ParameterEntity.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/ParameterEntity.java @@ -36,8 +36,6 @@ import java.util.List; @JsonSubTypes.Type(value=InOptionParameterEntity.class), //输入选项 @JsonSubTypes.Type(value=InSubOutParameterEntity.class), //子模型输出 @JsonSubTypes.Type(value=IntermediateParameterEntity.class), //中间值 - @JsonSubTypes.Type(value=RuleResultParameterEntity.class), //规则结果 - @JsonSubTypes.Type(value=SingleRuleResultParameterEntity.class), //单规则结果 @JsonSubTypes.Type(value=OutParameterEntity.class) //结果值 }) public abstract class ParameterEntity extends CorporationAuditorEntity implements DeepClone, IdClearable, TestCaseParameterAble{ diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/ParameterProcessorEntity.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/ParameterProcessorEntity.java index 54cbd0fb..bfeb6fc6 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/ParameterProcessorEntity.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/ParameterProcessorEntity.java @@ -41,7 +41,7 @@ import javax.validation.constraints.Size; @JsonSubTypes.Type(value=ObjectPropertiesParameterProcessorEntity.class), //对象属性处理器 @JsonSubTypes.Type(value=OptionValueParameterProcessorEntity.class), //选项值处理器 @JsonSubTypes.Type(value=PmmlParameterProcessorEntity.class), //PMML处理器 - @JsonSubTypes.Type(value=RuleParameterProcessorEntity.class), //规则处理器 + @JsonSubTypes.Type(value=RuleSetParameterProcessorEntity.class), //规则处理器 @JsonSubTypes.Type(value=ScoreCardParameterProcessorEntity.class), //评分卡处理器 @JsonSubTypes.Type(value=SingleRuleParameterProcessorEntity.class), //单规则处理器 @JsonSubTypes.Type(value=SqlParameterProcessorEntity.class), //Sql处理器 diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/parameter/InSubOutParameterEntity.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/parameter/InSubOutParameterEntity.java index f5e96f1d..3629a8ae 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/parameter/InSubOutParameterEntity.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/parameter/InSubOutParameterEntity.java @@ -29,20 +29,6 @@ public class InSubOutParameterEntity extends ParameterEntity { this.id =id; } - public InSubOutParameterEntity(RuleResultParameterEntity out) { - this.id=out.getId(); - this.code =out.getCode(); - this.name =out.getName(); - this.description =out.getDescription(); - this.order =out.getOrder(); - this.valueType =out.getValueType(); - this.valueTypeVersion =out.getValueTypeVersion(); - this.valueScale =null; - this.valueRoundingMode =null; - this.valueTypeIsList =null; - this.defaultValue =null; - } - public InSubOutParameterEntity(OutParameterEntity out) { this.id=out.getId(); this.code =out.getCode(); diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/parameter/RuleResultParameterEntity.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/parameter/RuleResultParameterEntity.java deleted file mode 100644 index 939933e3..00000000 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/parameter/RuleResultParameterEntity.java +++ /dev/null @@ -1,61 +0,0 @@ -package io.sc.engine.rule.server.model.entity.parameter; - -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.sc.engine.rule.core.enums.ParameterType; -import io.sc.engine.rule.server.model.vo.parameter.RuleResultParameterVo; - -import javax.persistence.DiscriminatorValue; -import javax.persistence.Entity; - -/** - * 模型参数(规则结果值)实体类 - */ -@Entity -@DiscriminatorValue("RULE_RESULT") -@JsonTypeName("RULE_RESULT") -public class RuleResultParameterEntity extends OutParameterEntity { - @Override - public RuleResultParameterVo toVo() { - RuleResultParameterVo vo =new RuleResultParameterVo(); - super.toVo(vo); - this.setType(this.getType()); - return vo; - } - - public RuleResultParameterEntity() {} - public RuleResultParameterEntity(String id) { - this.id =id; - } - - public InSubOutParameterEntity toInSubOutParameterEntity() { - return new InSubOutParameterEntity(this); - } - - @Override - public ParameterType getType() { - return ParameterType.RULE_RESULT; - } - - @Override - public String toString() { - return "RuleResultParameterEntity [" - + " type=" + type - + " id=" + id - + ", code=" + code - + ", name=" + name - + ", description=" + description - + ", order=" + order - - + ", valueType" + valueType - + ", valueScale" + valueScale - + ", valueRoundingMode" + valueRoundingMode - + ", valueTypeIsList" + valueTypeIsList - + ", defaultValue=" + defaultValue - - + ", creator=" + creator - + ", createDate=" + createDate - + ", lastModifier=" + lastModifier - + ", lastModifyDate=" + lastModifyDate - + "]"; - } -} diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/parameter/SingleRuleResultParameterEntity.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/parameter/SingleRuleResultParameterEntity.java deleted file mode 100644 index 04ec2448..00000000 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/parameter/SingleRuleResultParameterEntity.java +++ /dev/null @@ -1,61 +0,0 @@ -package io.sc.engine.rule.server.model.entity.parameter; - -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.sc.engine.rule.core.enums.ParameterType; -import io.sc.engine.rule.server.model.vo.parameter.SingleRuleResultParameterVo; - -import javax.persistence.DiscriminatorValue; -import javax.persistence.Entity; - -/** - * 模型参数(单规则结果值)实体类 - */ -@Entity -@DiscriminatorValue("SINGLE_RULE_RESULT") -@JsonTypeName("SINGLE_RULE_RESULT") -public class SingleRuleResultParameterEntity extends OutParameterEntity { - @Override - public SingleRuleResultParameterVo toVo() { - SingleRuleResultParameterVo vo =new SingleRuleResultParameterVo(); - super.toVo(vo); - this.setType(this.getType()); - return vo; - } - - public SingleRuleResultParameterEntity() {} - public SingleRuleResultParameterEntity(String id) { - this.id =id; - } - - public InSubOutParameterEntity toInSubOutParameterEntity() { - return new InSubOutParameterEntity(this); - } - - @Override - public ParameterType getType() { - return ParameterType.SINGLE_RULE_RESULT; - } - - @Override - public String toString() { - return "SingleRuleResultParameterEntity [" - + " type=" + type - + " id=" + id - + ", code=" + code - + ", name=" + name - + ", description=" + description - + ", order=" + order - - + ", valueType" + valueType - + ", valueScale" + valueScale - + ", valueRoundingMode" + valueRoundingMode - + ", valueTypeIsList" + valueTypeIsList - + ", defaultValue=" + defaultValue - - + ", creator=" + creator - + ", createDate=" + createDate - + ", lastModifier=" + lastModifier - + ", lastModifyDate=" + lastModifyDate - + "]"; - } -} diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/processor/RuleParameterProcessorEntity.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/processor/RuleSetParameterProcessorEntity.java similarity index 56% rename from io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/processor/RuleParameterProcessorEntity.java rename to io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/processor/RuleSetParameterProcessorEntity.java index f79387db..9e886450 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/processor/RuleParameterProcessorEntity.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/processor/RuleSetParameterProcessorEntity.java @@ -5,7 +5,7 @@ import io.sc.engine.rule.core.enums.ProcessorType; import io.sc.engine.rule.core.enums.ReplaceMode; import io.sc.engine.rule.server.common.service.support.ParameterAndValueType; import io.sc.engine.rule.server.model.entity.ParameterProcessorEntity; -import io.sc.engine.rule.server.model.vo.processor.RuleParameterProcessorVo; +import io.sc.engine.rule.server.model.vo.processor.RuleSetParameterProcessorVo; import javax.persistence.Column; import javax.persistence.DiscriminatorValue; @@ -15,44 +15,44 @@ import javax.persistence.Entity; * 模型参数处理器(规则)实体类 */ @Entity -@DiscriminatorValue("RULE") -@JsonTypeName("RULE") -public class RuleParameterProcessorEntity extends ParameterProcessorEntity { +@DiscriminatorValue("RULE_SET") +@JsonTypeName("RULE_SET") +public class RuleSetParameterProcessorEntity extends ParameterProcessorEntity { //规则配置 @Column(name="RULE_") - private String rule; + private String ruleSet; @Override - public RuleParameterProcessorVo toVo() { - RuleParameterProcessorVo vo =new RuleParameterProcessorVo(); + public RuleSetParameterProcessorVo toVo() { + RuleSetParameterProcessorVo vo =new RuleSetParameterProcessorVo(); super.toVo(vo); - vo.setRule(this.getRule()); + vo.setRuleSet(this.getRuleSet()); return vo; } @Override public ProcessorType getType() { - return ProcessorType.RULE; + return ProcessorType.RULE_SET; } - - public String getRule() { - return rule; + + public String getRuleSet() { + return ruleSet; } - public void setRule(String rule) { - this.rule = rule; + public void setRuleSet(String ruleSet) { + this.ruleSet = ruleSet; } @Override public boolean replace(ParameterAndValueType parameterAndValueType, ReplaceMode mode) { - String replaced =parameterAndValueType.replace(this.rule, mode); + String replaced =parameterAndValueType.replace(this.ruleSet, mode); replaced =(replaced==null?"":replaced); boolean result =false; - if(!replaced.equals(this.rule)) { + if(!replaced.equals(this.ruleSet)) { result =true; } - this.rule =replaced; + this.ruleSet =replaced; return result; } } diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/processor/ScoreCardParameterProcessorEntity.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/processor/ScoreCardParameterProcessorEntity.java index 6c8c82ce..d9e2bb50 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/processor/ScoreCardParameterProcessorEntity.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/processor/ScoreCardParameterProcessorEntity.java @@ -2,9 +2,9 @@ package io.sc.engine.rule.server.model.entity.processor; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.core.type.TypeReference; +import io.sc.engine.rule.core.ScoreCardItem; import io.sc.engine.rule.core.code.generator.impl.processor.ConditionRange; import io.sc.engine.rule.core.code.generator.impl.processor.NumberRange; -import io.sc.engine.rule.core.code.generator.impl.processor.ScoreCardItem; import io.sc.engine.rule.core.enums.ProcessorType; import io.sc.engine.rule.core.enums.ReplaceMode; import io.sc.engine.rule.server.common.service.support.ParameterAndValueType; diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/repository/ParameterProcessorRepository.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/repository/ParameterProcessorRepository.java index 26365a6d..f50abd08 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/repository/ParameterProcessorRepository.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/repository/ParameterProcessorRepository.java @@ -54,12 +54,6 @@ public interface ParameterProcessorRepository extends DaoRepository findPmmlParameterProcessorEntityByParameterIds(@Param("parameterIds") Set parameterIds); - @Query("select e from RuleParameterProcessorEntity e where e.parameter.id in :parameterIds") - public List findRuleParameterProcessorEntityByParameterIds(@Param("parameterIds") Set parameterIds); - - @Query("select e from SingleRuleParameterProcessorEntity e where e.parameter.id in :parameterIds") - public List findSingleRuleParameterProcessorEntityByParameterIds(@Param("parameterIds") Set parameterIds); - @Query("select e from TernaryParameterProcessorEntity e where e.parameter.id in :parameterIds") public List findTernaryParameterProcessorEntityByParameterIds(@Param("parameterIds") Set parameterIds); diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/repository/ParameterRepository.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/repository/ParameterRepository.java index cd7980e6..21673e29 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/repository/ParameterRepository.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/repository/ParameterRepository.java @@ -55,10 +55,4 @@ public interface ParameterRepository extends DaoRepository findOutParameterEntityByModelIds(@Param("ids") Set modelIds); - - @Query("select e from RuleResultParameterEntity e where e.model.id in :ids") - public List findRuleResultParameterEntityByModelIds(@Param("ids") Set modelIds); - - @Query("select e from SingleRuleResultParameterEntity e where e.model.id in :ids") - public List findSingleRuleResultParameterEntityByModelIds(@Param("ids") Set modelIds); } diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/service/impl/ParameterProcessorServiceImpl.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/service/impl/ParameterProcessorServiceImpl.java index bc42e441..90bf422c 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/service/impl/ParameterProcessorServiceImpl.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/service/impl/ParameterProcessorServiceImpl.java @@ -4,7 +4,6 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.google.common.base.CharMatcher; import com.google.common.base.Splitter; import io.sc.engine.rule.core.Rule; -import io.sc.engine.rule.core.enums.ParameterType; import io.sc.engine.rule.core.enums.ReplaceMode; import io.sc.engine.rule.core.util.ExpressionReplacer; import io.sc.engine.rule.core.util.ValueTypeUtil; @@ -16,7 +15,7 @@ import io.sc.engine.rule.server.dictionary.entity.UserDefinedJavaClassFieldEntit import io.sc.engine.rule.server.dictionary.service.DictionaryService; import io.sc.engine.rule.server.model.entity.ParameterEntity; import io.sc.engine.rule.server.model.entity.ParameterProcessorEntity; -import io.sc.engine.rule.server.model.entity.processor.RuleParameterProcessorEntity; +import io.sc.engine.rule.server.model.entity.processor.RuleSetParameterProcessorEntity; import io.sc.engine.rule.server.model.entity.processor.SqlParameterProcessorEntity; import io.sc.engine.rule.server.model.exception.SqlNotOnlyQueryException; import io.sc.engine.rule.server.model.repository.ParameterProcessorRepository; @@ -303,10 +302,10 @@ public class ParameterProcessorServiceImpl public void importFromCsv(String parameterId, String csvContent, String splitChar) throws Exception { if(StringUtils.hasText(parameterId) && StringUtils.hasText(csvContent)) { ParameterEntity parameterEntity =parameterService.findById(parameterId); - if(parameterEntity!=null && ParameterType.RULE_RESULT.equals(parameterEntity.getType())) { + if(parameterEntity!=null) { List lines =IOUtils.readLines(new ByteArrayInputStream(csvContent.getBytes("UTF-8")), "UTF-8"); if(lines!=null && lines.size()>0) { - RuleParameterProcessorEntity entity =new RuleParameterProcessorEntity(); + RuleSetParameterProcessorEntity entity =new RuleSetParameterProcessorEntity(); Integer nextOrder =repository.getNextOrder(parameterId); nextOrder =nextOrder==null?0:nextOrder; entity.setOrder(nextOrder); @@ -349,7 +348,7 @@ public class ParameterProcessorServiceImpl rules.add(rule); } - entity.setRule(ObjectMapperUtil.json().writeValueAsString(rules)); + entity.setRuleSet(ObjectMapperUtil.json().writeValueAsString(rules)); repository.save(entity); } } diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/vo/parameter/RuleResultParameterVo.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/vo/parameter/RuleResultParameterVo.java deleted file mode 100644 index d6701125..00000000 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/vo/parameter/RuleResultParameterVo.java +++ /dev/null @@ -1,15 +0,0 @@ -package io.sc.engine.rule.server.model.vo.parameter; - -import io.sc.engine.rule.core.enums.ParameterType; - -/** - * 模型参数(规则结果值) Vo 类 - */ -public class RuleResultParameterVo extends OutParameterVo { - - @Override - public ParameterType getType() { - return ParameterType.RULE_RESULT; - } - -} diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/vo/parameter/SingleRuleResultParameterVo.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/vo/parameter/SingleRuleResultParameterVo.java deleted file mode 100644 index 06577518..00000000 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/vo/parameter/SingleRuleResultParameterVo.java +++ /dev/null @@ -1,14 +0,0 @@ -package io.sc.engine.rule.server.model.vo.parameter; - -import io.sc.engine.rule.core.enums.ParameterType; - -/** - * 模型参数(单规则结果值) Vo 类 - */ -public class SingleRuleResultParameterVo extends OutParameterVo { - @Override - public ParameterType getType() { - return ParameterType.SINGLE_RULE_RESULT; - } - -} diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/vo/processor/RuleParameterProcessorVo.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/vo/processor/RuleSetParameterProcessorVo.java similarity index 54% rename from io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/vo/processor/RuleParameterProcessorVo.java rename to io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/vo/processor/RuleSetParameterProcessorVo.java index 69aedddb..9a597e60 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/vo/processor/RuleParameterProcessorVo.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/vo/processor/RuleSetParameterProcessorVo.java @@ -6,21 +6,20 @@ import io.sc.engine.rule.server.model.vo.ParameterProcessorVo; /** * 模型参数处理器(规则)Vo 类 */ -public class RuleParameterProcessorVo extends ParameterProcessorVo { +public class RuleSetParameterProcessorVo extends ParameterProcessorVo { //规则配置 - private String rule; + private String ruleSet; @Override public ProcessorType getType() { - return ProcessorType.RULE; - } - - public String getRule() { - return rule; + return ProcessorType.RULE_SET; } - public void setRule(String rule) { - this.rule = rule; + public String getRuleSet() { + return ruleSet; } + public void setRuleSet(String ruleSet) { + this.ruleSet = ruleSet; + } } diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/controller/ResourceWebController.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/controller/ResourceWebController.java index d8628f9a..36f11852 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/controller/ResourceWebController.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/controller/ResourceWebController.java @@ -3,6 +3,7 @@ package io.sc.engine.rule.server.resource.controller; import io.sc.engine.rule.client.runtime.impl.groovy.GroovyScriptEngineService; import io.sc.engine.rule.client.runtime.impl.groovy.GroovyScriptEngineServiceImpl; import io.sc.engine.rule.client.spring.service.ExecutorFactoryService; +import io.sc.engine.rule.core.ResourceAbstract; import io.sc.engine.rule.core.ResourceResult; import io.sc.engine.rule.core.code.ExecuteUnit; import io.sc.engine.rule.core.code.SourceCode; @@ -42,6 +43,16 @@ import java.util.*; public class ResourceWebController extends RestCrudController { private static final Logger log =LoggerFactory.getLogger(ResourceWebController.class); @Autowired private ExecutorFactoryService executorFactoryService; + + @RequestMapping(value="getAllResourceAbstract",method=RequestMethod.GET) + @ResponseBody + public List getAllReleasableResourceAbstract() throws Exception{ + List list =service.getAllResourceAbstract(); + if(list==null) { + list =Collections.emptyList(); + } + return list; + } @GetMapping(value="getDefineById") @IgnoreResponseBodyAdvice diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/entity/ResourceEntity.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/entity/ResourceEntity.java index 1d03a1bb..cb4e6da2 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/entity/ResourceEntity.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/entity/ResourceEntity.java @@ -88,7 +88,6 @@ public class ResourceEntity extends CorporationAuditorEntity impleme //测试用例集合 @OneToMany(mappedBy="owner",cascade= {CascadeType.PERSIST}) - @OrderBy("order") protected List testCases =new ArrayList(); //所属角色集合 diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/repository/ResourceRepository.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/repository/ResourceRepository.java index fb569d61..ceba3336 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/repository/ResourceRepository.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/repository/ResourceRepository.java @@ -28,13 +28,13 @@ public interface ResourceRepository extends DaoRepository @Query("select e from io.sc.engine.rule.server.resource.entity.ResourceEntity e where e.parent.id is null and e.name=:name") public List findSameNameEntitiesInRoot(@Param("name")String name); - @Query("select entity from io.sc.engine.rule.server.resource.entity.ModelResourceEntity entity where entity.id=:id") + @Query("select e from io.sc.engine.rule.server.resource.entity.ModelResourceEntity e where e.id=:id") public ModelResourceEntity findModelResourceById(@Param("id") String id); - @Query("select entity from io.sc.engine.rule.server.resource.entity.ModelResourceEntity entity") + @Query("select e from io.sc.engine.rule.server.resource.entity.ModelResourceEntity e order by e.namec") public List findAllModelResourceEntities(); - @Query("select entity from io.sc.engine.rule.server.resource.entity.ResourceEntity entity where concat(entity.code,':',entity.version) in (:codeAndVersions)") + @Query("select e from io.sc.engine.rule.server.resource.entity.ResourceEntity e where concat(e.code,':',e.version) in (:codeAndVersions)") public List findByCodeAndVersions(@Param("codeAndVersions") Set codeAndVersions); public List findByIdIn(Collection ids); diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/service/ResourceService.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/service/ResourceService.java index c63af14a..990d7f2d 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/service/ResourceService.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/service/ResourceService.java @@ -17,6 +17,13 @@ import io.sc.platform.orm.service.support.QueryParameter; * 资源服务接口 */ public interface ResourceService extends DaoService{ + + /** + * 获取所有可发布的资源摘要信息 + * @return 所有可发布的资源摘要信息 + * @throws Exception 违例 + */ + public List getAllResourceAbstract() throws Exception; /** * 通过资源 ID 获取资源定义封装对象 diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/service/impl/ResourceQueryServiceImpl.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/service/impl/ResourceQueryServiceImpl.java index edcf2957..4c5c7a31 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/service/impl/ResourceQueryServiceImpl.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/service/impl/ResourceQueryServiceImpl.java @@ -21,8 +21,6 @@ import io.sc.engine.rule.server.model.entity.parameter.InParameterEntity; import io.sc.engine.rule.server.model.entity.parameter.IndicatorParameterEntity; import io.sc.engine.rule.server.model.entity.parameter.IntermediateParameterEntity; import io.sc.engine.rule.server.model.entity.parameter.OutParameterEntity; -import io.sc.engine.rule.server.model.entity.parameter.RuleResultParameterEntity; -import io.sc.engine.rule.server.model.entity.parameter.SingleRuleResultParameterEntity; import io.sc.engine.rule.server.model.entity.processor.ArithmeticParameterProcessorEntity; import io.sc.engine.rule.server.model.entity.processor.ConditionRangeParameterProcessorEntity; import io.sc.engine.rule.server.model.entity.processor.DecisionTable2CParameterProcessorEntity; @@ -34,7 +32,7 @@ import io.sc.engine.rule.server.model.entity.processor.GroovyScriptParameterProc import io.sc.engine.rule.server.model.entity.processor.NumberRangeParameterProcessorEntity; import io.sc.engine.rule.server.model.entity.processor.OptionValueParameterProcessorEntity; import io.sc.engine.rule.server.model.entity.processor.PmmlParameterProcessorEntity; -import io.sc.engine.rule.server.model.entity.processor.RuleParameterProcessorEntity; +import io.sc.engine.rule.server.model.entity.processor.RuleSetParameterProcessorEntity; import io.sc.engine.rule.server.model.entity.processor.SingleRuleParameterProcessorEntity; import io.sc.engine.rule.server.model.entity.processor.TernaryParameterProcessorEntity; import io.sc.engine.rule.server.model.entity.processor.WhenThenParameterProcessorEntity; @@ -175,23 +173,6 @@ public class ResourceQueryServiceImpl implements ResourceQueryService{ } } - List ruleResultParameterEntities =parameterService.getRepository().findRuleResultParameterEntityByModelIds(modelIds); - if(ruleResultParameterEntities!=null && ruleResultParameterEntities.size()>0) { - for(RuleResultParameterEntity entity : ruleResultParameterEntities) { - parameterEntityCache.put(entity.getId(), entity); - ModelEntity modelEntity=modelEntityCache.get(entity.getModel().getId()); - modelEntity.getParameters().add(entity); - } - } - - List singleRuleResultParameterEntities =parameterService.getRepository().findSingleRuleResultParameterEntityByModelIds(modelIds); - if(singleRuleResultParameterEntities!=null && singleRuleResultParameterEntities.size()>0) { - for(SingleRuleResultParameterEntity entity : singleRuleResultParameterEntities) { - parameterEntityCache.put(entity.getId(), entity); - ModelEntity modelEntity=modelEntityCache.get(entity.getModel().getId()); - modelEntity.getParameters().add(entity); - } - } buildModelParameterProcessors(parameterEntityCache); } } @@ -288,21 +269,21 @@ public class ResourceQueryServiceImpl implements ResourceQueryService{ } } - List ruleParameterProcessorEntities =parameterProcessorService.getRepository().findRuleParameterProcessorEntityByParameterIds(parameterIds); - if(ruleParameterProcessorEntities!=null && ruleParameterProcessorEntities.size()>0) { - for(RuleParameterProcessorEntity entity : ruleParameterProcessorEntities) { - ParameterEntity parameterEntity=parameterEntityCache.get(entity.getParameter().getId()); - parameterEntity.getProcessors().add(entity); - } - } +// List ruleParameterProcessorEntities =parameterProcessorService.getRepository().findRuleParameterProcessorEntityByParameterIds(parameterIds); +// if(ruleParameterProcessorEntities!=null && ruleParameterProcessorEntities.size()>0) { +// for(RuleSetParameterProcessorEntity entity : ruleParameterProcessorEntities) { +// ParameterEntity parameterEntity=parameterEntityCache.get(entity.getParameter().getId()); +// parameterEntity.getProcessors().add(entity); +// } +// } - List singleRuleParameterProcessorEntities =parameterProcessorService.getRepository().findSingleRuleParameterProcessorEntityByParameterIds(parameterIds); - if(singleRuleParameterProcessorEntities!=null && singleRuleParameterProcessorEntities.size()>0) { - for(SingleRuleParameterProcessorEntity entity : singleRuleParameterProcessorEntities) { - ParameterEntity parameterEntity=parameterEntityCache.get(entity.getParameter().getId()); - parameterEntity.getProcessors().add(entity); - } - } +// List singleRuleParameterProcessorEntities =parameterProcessorService.getRepository().findSingleRuleParameterProcessorEntityByParameterIds(parameterIds); +// if(singleRuleParameterProcessorEntities!=null && singleRuleParameterProcessorEntities.size()>0) { +// for(SingleRuleParameterProcessorEntity entity : singleRuleParameterProcessorEntities) { +// ParameterEntity parameterEntity=parameterEntityCache.get(entity.getParameter().getId()); +// parameterEntity.getProcessors().add(entity); +// } +// } List ternaryParameterProcessorEntities =parameterProcessorService.getRepository().findTernaryParameterProcessorEntityByParameterIds(parameterIds); if(ternaryParameterProcessorEntities!=null && ternaryParameterProcessorEntities.size()>0) { diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/service/impl/ResourceServiceImpl.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/service/impl/ResourceServiceImpl.java index be6daf43..b2c54789 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/service/impl/ResourceServiceImpl.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/service/impl/ResourceServiceImpl.java @@ -1,6 +1,7 @@ package io.sc.engine.rule.server.resource.service.impl; import com.fasterxml.jackson.core.type.TypeReference; +import io.sc.engine.rule.core.ResourceAbstract; import io.sc.engine.rule.core.code.ExecuteUnit; import io.sc.engine.rule.core.code.ExecuteUnit4Lib; import io.sc.engine.rule.core.code.ExecuteUnit4Resource; @@ -78,12 +79,19 @@ public class ResourceServiceImpl extends DaoServiceImpl getAllResourceAbstract() throws Exception { + List result =new ArrayList<>(); + List entities =repository.findAllModelResourceEntities(); + if(entities!=null && entities.size()>0) { + for(ModelResourceEntity entity : entities) { + result.add(new ResourceAbstract(entity.getId(),entity.getCode(),entity.getName(),entity.getVersion(),entity.getStatus(),entity.getEffectiveDate())); + } + } + return result; + } - @Override + @Override @Transactional public ResourceEntity add(ResourceEntity entity) throws Exception { if (entity == null) { diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/annotation/TestCaseParameterBuilderType.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/annotation/TestCaseParameterBuilderType.java deleted file mode 100644 index 6ba9fc86..00000000 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/annotation/TestCaseParameterBuilderType.java +++ /dev/null @@ -1,14 +0,0 @@ -package io.sc.engine.rule.server.testcase.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import io.sc.engine.rule.core.enums.TestCaseOwnerType; - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -public @interface TestCaseParameterBuilderType { - public TestCaseOwnerType value(); -} diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/bean/LibTestCaseParameterBuilder.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/bean/LibTestCaseParameterBuilder.java index 820637bf..8c71c26c 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/bean/LibTestCaseParameterBuilder.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/bean/LibTestCaseParameterBuilder.java @@ -1,29 +1,34 @@ package io.sc.engine.rule.server.testcase.bean; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import org.springframework.util.StringUtils; import io.sc.engine.rule.core.enums.TestCaseOwnerType; import io.sc.engine.rule.server.lib.entity.IndicatorEntity; import io.sc.engine.rule.server.lib.service.IndicatorService; -import io.sc.engine.rule.server.testcase.annotation.TestCaseParameterBuilderType; import io.sc.engine.rule.server.testcase.entity.TestCaseParameterEntity; import io.sc.engine.rule.server.testcase.service.TestCaseParameterBuilder; import io.sc.engine.rule.server.testcase.service.TestCaseParameterService; import io.sc.engine.rule.server.testcase.wrapper.TestCaseParameterWrapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; -@Component -@TestCaseParameterBuilderType(TestCaseOwnerType.LIB) +import javax.transaction.Transactional; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service("io.sc.engine.rule.server.testcase.bean.LibTestCaseParameterBuilder") public class LibTestCaseParameterBuilder implements TestCaseParameterBuilder{ @Autowired private TestCaseParameterService testCaseParameterService; @Autowired IndicatorService indicatorService; - + + @Override + public TestCaseOwnerType getTestCaseOwnerType() { + return TestCaseOwnerType.LIB; + } + @Override + @Transactional public List buildTestCaseParameterWrappers(String ownerId,String testCaseId) throws Exception { if(StringUtils.hasText(ownerId)) { List wrappers =new ArrayList(); @@ -75,7 +80,7 @@ public class LibTestCaseParameterBuilder implements TestCaseParameterBuilder{ List inserts =new ArrayList(); for(String key : modelStructMap.keySet()) { TestCaseParameterWrapper wrapper =modelStructMap.get(key); - if(!configuredMap.containsKey(key) && "P".equals(wrapper.getCategory())) { + if(!configuredMap.containsKey(key) && "I".equals(wrapper.getGroup())) { TestCaseParameterEntity entity =wrapper.toTestCaseParameterEntity(); entity.clearId(); inserts.add(entity); diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/bean/ModelTestCaseParameterBuilder.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/bean/ModelTestCaseParameterBuilder.java index be27ee3f..3d9260df 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/bean/ModelTestCaseParameterBuilder.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/bean/ModelTestCaseParameterBuilder.java @@ -1,32 +1,38 @@ package io.sc.engine.rule.server.testcase.bean; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import org.springframework.util.StringUtils; import io.sc.engine.rule.core.enums.TestCaseOwnerType; import io.sc.engine.rule.server.lib.service.IndicatorService; import io.sc.engine.rule.server.model.entity.ModelEntity; import io.sc.engine.rule.server.model.entity.ParameterEntity; import io.sc.engine.rule.server.model.service.ModelService; -import io.sc.engine.rule.server.testcase.annotation.TestCaseParameterBuilderType; import io.sc.engine.rule.server.testcase.entity.TestCaseParameterEntity; import io.sc.engine.rule.server.testcase.service.TestCaseParameterBuilder; import io.sc.engine.rule.server.testcase.service.TestCaseParameterService; import io.sc.engine.rule.server.testcase.wrapper.TestCaseParameterWrapper; +import io.sc.platform.util.CollectionUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; -@Component -@TestCaseParameterBuilderType(TestCaseOwnerType.MODEL) +import javax.transaction.Transactional; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service("io.sc.engine.rule.server.testcase.bean.ModelTestCaseParameterBuilder") public class ModelTestCaseParameterBuilder implements TestCaseParameterBuilder{ @Autowired private ModelService modelService; @Autowired private TestCaseParameterService testCaseParameterService; @Autowired IndicatorService indicatorService; + + @Override + public TestCaseOwnerType getTestCaseOwnerType() { + return TestCaseOwnerType.MODEL; + } @Override + @Transactional public List buildTestCaseParameterWrappers(String ownerId,String testCaseId) throws Exception { if(StringUtils.hasText(ownerId)) { List wrappers =new ArrayList(); @@ -45,7 +51,7 @@ public class ModelTestCaseParameterBuilder implements TestCaseParameterBuilder{ if(tree!=null && modelEntity!=null) { //添加模型 TestCaseParameterWrapper modelNode =modelEntity.toTestCaseParameterWrapper(); - modelNode.setParent(parentNode==null?null:parentNode.getId()); + modelNode.setParent(parentNode==null?null:parentNode.getCode()); tree.add(modelNode); //添加模型包含的子模型 List children =modelEntity.getChildren(); @@ -59,7 +65,7 @@ public class ModelTestCaseParameterBuilder implements TestCaseParameterBuilder{ if(parameters!=null && parameters.size()>0) { for(ParameterEntity parameter : parameters) { TestCaseParameterWrapper wrapper =parameter.toTestCaseParameterWrapper(); - wrapper.setParent(modelNode==null?null:modelNode.getId()); + wrapper.setParent(modelNode==null?null:modelNode.getCode()); tree.add(wrapper); } } @@ -69,15 +75,15 @@ public class ModelTestCaseParameterBuilder implements TestCaseParameterBuilder{ private void mergeTestCaseParameterTree(String testCaseId,List wrappers) throws Exception { if(wrappers!=null && wrappers.size()>0) { //根据模型结构构建的测试用例参数树 - Map modelStructMap =new HashMap(); + Map modelStructMap =new HashMap<>(); for(TestCaseParameterWrapper wrapper : wrappers) { wrapper.setTestCaseId(testCaseId); modelStructMap.put(wrapper.getCode(), wrapper); } //已经配置的测试用例参数 - Map configuredMap =new HashMap(); - List entities =testCaseParameterService.getRepository().findByTestCase(testCaseId); + Map configuredMap =new HashMap<>(); + List entities =testCaseParameterService.findByTestCase(testCaseId); for(TestCaseParameterEntity entity : entities) { configuredMap.put(entity.getCode(), entity); } @@ -90,27 +96,38 @@ public class ModelTestCaseParameterBuilder implements TestCaseParameterBuilder{ deleteds.add(entity.getId()); } } - testCaseParameterService.remove(deleteds); + if(CollectionUtil.hasElements(deleteds)) { + testCaseParameterService.remove(deleteds); + } //将要插入的 - List inserts =new ArrayList(); + List inserts =new ArrayList<>(); for(String key : modelStructMap.keySet()) { TestCaseParameterWrapper wrapper =modelStructMap.get(key); - if(!configuredMap.containsKey(key) && "P".equals(wrapper.getCategory())) { + if(!configuredMap.containsKey(key) && "P".equals(wrapper.getGroup())) { TestCaseParameterEntity entity =wrapper.toTestCaseParameterEntity(); entity.clearId(); inserts.add(entity); } } - testCaseParameterService.getRepository().saveAll(inserts); + if(CollectionUtil.hasElements(inserts)) { + testCaseParameterService.getRepository().saveAll(inserts); + } //合并 entities =testCaseParameterService.findByTestCase(testCaseId); + Map mergedMap =new HashMap<>(); if(entities!=null && entities.size()>0) { + for(TestCaseParameterEntity entity : entities) { + mergedMap.put(entity.getCode(),entity); + } for(TestCaseParameterEntity entity : entities) { TestCaseParameterWrapper wrapper =modelStructMap.get(entity.getCode()); + TestCaseParameterWrapper parentWrapper =modelStructMap.get(wrapper.getParent()); + String parentId =parentWrapper==null?null:mergedMap.get(parentWrapper.getCode()).getId(); if(wrapper!=null) { wrapper.setId(entity.getId()); + wrapper.setParent(parentId); wrapper.setSkipCheck(entity.getSkipCheck()); wrapper.setInputValue(entity.getInputValue()); wrapper.setExpectValue(entity.getExpectValue()); diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/bean/TestCaseParameterBuilderFactory.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/bean/TestCaseParameterBuilderFactory.java index 5063bd48..01f59279 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/bean/TestCaseParameterBuilderFactory.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/bean/TestCaseParameterBuilderFactory.java @@ -1,23 +1,25 @@ package io.sc.engine.rule.server.testcase.bean; -import java.util.HashMap; -import java.util.Map; - +import io.sc.engine.rule.core.enums.TestCaseOwnerType; +import io.sc.engine.rule.server.testcase.service.TestCaseParameterBuilder; import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.stereotype.Component; -import io.sc.engine.rule.core.enums.TestCaseOwnerType; -import io.sc.engine.rule.server.testcase.annotation.TestCaseParameterBuilderType; -import io.sc.engine.rule.server.testcase.service.TestCaseParameterBuilder; + +import java.util.HashMap; +import java.util.Map; /** * 测试用例参数构建器工厂 */ -@Component("reTestCaseParameterBuilderFactory") +@Component("io.sc.engine.rule.server.testcase.bean.TestCaseParameterBuilderFactory") public class TestCaseParameterBuilderFactory implements BeanPostProcessor{ + //@Autowired private ModelTestCaseParameterBuilder modelTestCaseParameterBuilder; + //@Autowired private LibTestCaseParameterBuilder libTestCaseParameterBuilder; + private Map builderMap =new HashMap(); - + public TestCaseParameterBuilder getBuilder(TestCaseOwnerType ownerType) { return builderMap.get(ownerType); } @@ -29,13 +31,9 @@ public class TestCaseParameterBuilderFactory implements BeanPostProcessor{ @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { - Class clazz =bean.getClass(); - TestCaseParameterBuilderType builderAnnotation =clazz.getAnnotation(TestCaseParameterBuilderType.class); - if(builderAnnotation!=null) { - TestCaseOwnerType ownerType =builderAnnotation.value(); - if(ownerType!=null) { - builderMap.put(ownerType,(TestCaseParameterBuilder)bean); - } + if(bean instanceof TestCaseParameterBuilder){ + TestCaseParameterBuilder builder =(TestCaseParameterBuilder)bean; + builderMap.put(builder.getTestCaseOwnerType(),builder); } return bean; } diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/service/TestCaseParameterBuilder.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/service/TestCaseParameterBuilder.java index 79a09a12..c6ccce0a 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/service/TestCaseParameterBuilder.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/service/TestCaseParameterBuilder.java @@ -2,12 +2,14 @@ package io.sc.engine.rule.server.testcase.service; import java.util.List; +import io.sc.engine.rule.core.enums.TestCaseOwnerType; import io.sc.engine.rule.server.testcase.wrapper.TestCaseParameterWrapper; /** * 测试用例参数构建器 */ public interface TestCaseParameterBuilder { + public TestCaseOwnerType getTestCaseOwnerType(); /** * 构建测试用例参数实体封装器列表 * @param ownerId 测试用例所有者ID diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/service/impl/TestCaseParameterServiceImpl.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/service/impl/TestCaseParameterServiceImpl.java index 6272a85f..a4a30867 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/service/impl/TestCaseParameterServiceImpl.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/service/impl/TestCaseParameterServiceImpl.java @@ -9,6 +9,7 @@ import io.sc.engine.rule.server.testcase.service.TestCaseParameterService; import io.sc.engine.rule.server.testcase.service.TestCaseService; import io.sc.engine.rule.server.testcase.wrapper.TestCaseParameterWrapper; import io.sc.platform.orm.service.impl.DaoServiceImpl; +import io.sc.platform.util.CollectionUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/service/impl/TestCaseServiceImpl.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/service/impl/TestCaseServiceImpl.java index 1209d1c2..2a8438f2 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/service/impl/TestCaseServiceImpl.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/testcase/service/impl/TestCaseServiceImpl.java @@ -652,44 +652,16 @@ public class TestCaseServiceImpl extends DaoServiceImpl datas =result.getData(); if(datas!=null && datas.size()>0) { for(ParameterResult data : datas) { - if(ParameterType.RULE_RESULT.equals(data.getType())){ - String code =data.getCode(); - String valueType ="io.sc.engine.rule.core.classes.RuleResult"; - String value =data.getRuleResult().toString(); - TestCaseParameterEntity entity =cache.get(code); - if(entity!=null) { - entity.setResultValue(value); - if(entity.getSkipCheck()!=null && entity.getSkipCheck()) { - entity.setTestResult(TestResult.PASSED); - }else { - entity.setTestResult(checkTestResult(entity.getExpectValue(),value,valueType)); - } - } - }else if(ParameterType.SINGLE_RULE_RESULT.equals(data.getType())){ - String code =data.getCode(); - String valueType ="io.sc.engine.rule.core.classes.SingleRuleResult"; - String value =data.getSingleRuleResult().toString(); - TestCaseParameterEntity entity =cache.get(code); - if(entity!=null) { - entity.setResultValue(value); - if(entity.getSkipCheck()!=null && entity.getSkipCheck()) { - entity.setTestResult(TestResult.PASSED); - }else { - entity.setTestResult(checkTestResult(entity.getExpectValue(),value,valueType)); - } - } - }else { - String code =data.getCode(); - String valueType =data.getValueType(); - String value =data.getValue(); - TestCaseParameterEntity entity =cache.get(code); - if(entity!=null) { - entity.setResultValue(value); - if(entity.getSkipCheck()!=null && entity.getSkipCheck()) { - entity.setTestResult(TestResult.PASSED); - }else { - entity.setTestResult(checkTestResult(entity.getExpectValue(),value,valueType)); - } + String code =data.getCode(); + String valueType =data.getValueType(); + String value =data.getValue(); + TestCaseParameterEntity entity =cache.get(code); + if(entity!=null) { + entity.setResultValue(value); + if(entity.getSkipCheck()!=null && entity.getSkipCheck()) { + entity.setTestResult(TestResult.PASSED); + }else { + entity.setTestResult(checkTestResult(entity.getExpectValue(),value,valueType)); } } } @@ -806,7 +778,7 @@ public class TestCaseServiceImpl extends DaoServiceImpl0) { @@ -831,7 +803,6 @@ public class TestCaseServiceImpl extends DaoServiceImpl(), { lineNumber: false, lineBreak: true, placeholder: false, + dbClickEditPlaceholder: false, autoCompletion: undefined, userDefinedFunctions: () => { return []; diff --git a/io.sc.platform.core.frontend/src/platform/components/code-mirror/w-code-mirror/PlaceholderPlugin.ts b/io.sc.platform.core.frontend/src/platform/components/code-mirror/w-code-mirror/PlaceholderPlugin.ts index 36d8a54f..40a2f50a 100644 --- a/io.sc.platform.core.frontend/src/platform/components/code-mirror/w-code-mirror/PlaceholderPlugin.ts +++ b/io.sc.platform.core.frontend/src/platform/components/code-mirror/w-code-mirror/PlaceholderPlugin.ts @@ -69,8 +69,8 @@ const placeholderPlugin = ViewPlugin.fromClass( }, contextmenu: (e, view) => { e.preventDefault(); - console.log(view); }, + /* dblclick: (e, view) => { e.stopPropagation(); e.preventDefault(); @@ -94,6 +94,7 @@ const placeholderPlugin = ViewPlugin.fromClass( e.target.textContent = data; }); }, + */ }, }, ); diff --git a/io.sc.platform.core.frontend/src/platform/components/graph/style/PlatformStylesheet.ts b/io.sc.platform.core.frontend/src/platform/components/graph/style/PlatformStylesheet.ts index edbb1535..230ae73c 100644 --- a/io.sc.platform.core.frontend/src/platform/components/graph/style/PlatformStylesheet.ts +++ b/io.sc.platform.core.frontend/src/platform/components/graph/style/PlatformStylesheet.ts @@ -32,7 +32,7 @@ export class PlatformStylesheet extends Stylesheet { const style = {}; style.shape = constants.SHAPE.RECTANGLE; style.perimeter = constants.PERIMETER.RECTANGLE; - style.rounded = true; + style.rounded = false; style.verticalAlign = constants.ALIGN.MIDDLE; style.align = constants.ALIGN.CENTER; style.fillColor = 'white'; diff --git a/io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/digit/RandomInt.vue b/io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/digit/RandomInt.vue index b76a2d2b..59b9dc92 100644 --- a/io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/digit/RandomInt.vue +++ b/io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/digit/RandomInt.vue @@ -15,6 +15,7 @@ const xmlData = ` randomInt ( + x ) @@ -31,7 +32,7 @@ const dragstart = (event) => { }; const append = () => { - props.sourceCodeEditor?.dispatch(props.sourceCodeEditor?.state?.replaceSelection('randomInt')); + props.sourceCodeEditor?.dispatch(props.sourceCodeEditor?.state?.replaceSelection('randomInt(x)')); modelValueRef.value = modelValueRef.value + xmlData.replace('', ''); }; diff --git a/io.sc.platform.core.frontend/src/platform/i18n/messages_zh_CN.json b/io.sc.platform.core.frontend/src/platform/i18n/messages_zh_CN.json index a67e3554..c419ac68 100644 --- a/io.sc.platform.core.frontend/src/platform/i18n/messages_zh_CN.json +++ b/io.sc.platform.core.frontend/src/platform/i18n/messages_zh_CN.json @@ -207,8 +207,8 @@ "math.toolbar.functions.number.sum": "求和", "math.toolbar.functions.number.ceil": "大于或者等于 x 的最小整数", "math.toolbar.functions.number.floor": "不大于 x 的最大整数", - "math.toolbar.functions.number.random": "随机小数 [0 - 1]", - "math.toolbar.functions.number.randomInt": "随机整数", + "math.toolbar.functions.number.random": "随机小数 [0 - 1)", + "math.toolbar.functions.number.randomInt": "随机整数 [0 - x)", "math.toolbar.functions.number.rint": "最接近 x 的整数", "math.toolbar.functions.number.round": "四舍五入", "math.toolbar.functions.number.mod": "x/y 的余数, 其中 x 和 y 均为整数", diff --git a/io.sc.platform.core.frontend/template-project/package.json b/io.sc.platform.core.frontend/template-project/package.json index bdf61bed..e5765719 100644 --- a/io.sc.platform.core.frontend/template-project/package.json +++ b/io.sc.platform.core.frontend/template-project/package.json @@ -1,6 +1,6 @@ { "name": "platform-core", - "version": "8.2.10", + "version": "8.2.14", "description": "前端核心包,用于快速构建前端的脚手架", "private": false, "keywords": [], @@ -110,7 +110,7 @@ "mockjs": "1.1.0", "node-sql-parser": "5.3.4", "pinia": "2.2.6", - "platform-core": "8.2.10", + "platform-core": "8.2.14", "quasar": "2.17.4", "sort-array": "5.0.0", "svg-path-commander": "2.1.5", diff --git a/io.sc.platform.core/build.gradle b/io.sc.platform.core/build.gradle index 8ff923be..80b2320f 100644 --- a/io.sc.platform.core/build.gradle +++ b/io.sc.platform.core/build.gradle @@ -21,5 +21,7 @@ dependencies { "net.lingala.zip4j:zip4j:${zip4j_version}", "com.github.seancfoley:ipaddress:${ipaddress_version}", "com.belerweb:pinyin4j:${pinyin4j_version}", + "org.ow2.asm:asm-commons:${asm_version}", + "org.javassist:javassist:${javassist_version}", ) } diff --git a/io.sc.platform.core/src/main/java/io/sc/platform/core/License.java b/io.sc.platform.core/src/main/java/io/sc/platform/core/License.java index 378512fd..a7469d41 100644 --- a/io.sc.platform.core/src/main/java/io/sc/platform/core/License.java +++ b/io.sc.platform.core/src/main/java/io/sc/platform/core/License.java @@ -12,6 +12,7 @@ public class License { private String consumerName; //用户名称 private String description; //描述信息 private LicenseType type; //类型 + private Date issuedDate; //发行日期 private Date startDate; //开始日期 private Date expiredDate; //结束日期 private Integer term; //期限(天数) @@ -29,6 +30,7 @@ public class License { license.setConsumerName(consumerName); license.setDescription("Free Trial License"); license.setType(LicenseType.TRIAL); + license.setIssuedDate(new Date()); license.setStartDate(new Date()); license.setTerm(7); return license; @@ -74,6 +76,14 @@ public class License { this.type = type; } + public Date getIssuedDate() { + return issuedDate; + } + + public void setIssuedDate(Date issuedDate) { + this.issuedDate = issuedDate; + } + public Date getStartDate() { return startDate; } diff --git a/io.sc.platform.core/src/main/java/io/sc/platform/core/spi/JavassistSpiService.java b/io.sc.platform.core/src/main/java/io/sc/platform/core/spi/JavassistSpiService.java new file mode 100644 index 00000000..ab900d9b --- /dev/null +++ b/io.sc.platform.core/src/main/java/io/sc/platform/core/spi/JavassistSpiService.java @@ -0,0 +1,11 @@ +package io.sc.platform.core.spi; + +import javassist.ClassPool; + +/** + * javassist spi 服务接口 + * 该类为一个标记接口,用于启动时动态修改第三方包中的类行为 + */ +public interface JavassistSpiService { + public void modify(ClassLoader classLoader, ClassPool pool); +} diff --git a/io.sc.platform.core/src/main/java/io/sc/platform/core/springboot/AfterEnvironmentProcessor.java b/io.sc.platform.core/src/main/java/io/sc/platform/core/springboot/AfterEnvironmentProcessor.java index ff86b0b5..5de16d33 100644 --- a/io.sc.platform.core/src/main/java/io/sc/platform/core/springboot/AfterEnvironmentProcessor.java +++ b/io.sc.platform.core/src/main/java/io/sc/platform/core/springboot/AfterEnvironmentProcessor.java @@ -3,7 +3,14 @@ package io.sc.platform.core.springboot; import io.sc.platform.core.Environment; import io.sc.platform.core.plugins.PluginManager; import io.sc.platform.core.plugins.item.ExportableResource; +import io.sc.platform.core.spi.JavassistSpiService; +import io.sc.platform.core.spi.PluginSpiService; +import io.sc.platform.util.CollectionUtil; import io.sc.platform.util.FileUtil; +import javassist.ClassClassPath; +import javassist.ClassPool; +import javassist.CtClass; +import javassist.CtMethod; import org.springframework.boot.SpringApplication; import org.springframework.boot.env.EnvironmentPostProcessor; import org.springframework.core.Ordered; @@ -11,6 +18,7 @@ import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.io.DefaultResourceLoader; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; +import org.springframework.core.io.support.SpringFactoriesLoader; import org.springframework.util.StringUtils; import java.io.File; @@ -30,6 +38,7 @@ public class AfterEnvironmentProcessor implements EnvironmentPostProcessor, Orde @Override public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) { exportExportableResources(environment); + javassist(); } private void exportExportableResources(ConfigurableEnvironment environment){ @@ -83,4 +92,19 @@ public class AfterEnvironmentProcessor implements EnvironmentPostProcessor, Orde } } } + + /** + * 当某些第三方包不能满足需求或者存在 bug 时(不支持国产数据库时), 在不直接修改第三方包的情况下, + * 通过 javassist 提供的字节码操作实现对第三方包中类进行修改, 以满足项目需要。 + */ + private void javassist() { + List services =SpringFactoriesLoader.loadFactories(JavassistSpiService.class, this.getClass().getClassLoader()); + if(CollectionUtil.hasElements(services)){ + ClassPool pool =ClassPool.getDefault(); + pool.insertClassPath(new ClassClassPath(this.getClass())); + for(JavassistSpiService service : services){ + service.modify(this.getClass().getClassLoader(),pool); + } + } + } } diff --git a/io.sc.platform.core/src/main/java/io/sc/platform/core/springboot/BeforeEnvironmentProcessor.java b/io.sc.platform.core/src/main/java/io/sc/platform/core/springboot/BeforeEnvironmentProcessor.java index 87bb3c55..22f55e23 100644 --- a/io.sc.platform.core/src/main/java/io/sc/platform/core/springboot/BeforeEnvironmentProcessor.java +++ b/io.sc.platform.core/src/main/java/io/sc/platform/core/springboot/BeforeEnvironmentProcessor.java @@ -8,6 +8,10 @@ import io.sc.platform.core.plugins.item.Directory; import io.sc.platform.core.spi.PluginSpiService; import io.sc.platform.util.FileUtil; import io.sc.platform.util.StringUtil; +import javassist.ClassClassPath; +import javassist.ClassPool; +import javassist.CtClass; +import javassist.CtMethod; import org.springframework.boot.SpringApplication; import org.springframework.boot.env.EnvironmentPostProcessor; import org.springframework.core.Ordered; @@ -19,6 +23,7 @@ import org.springframework.util.StringUtils; import javax.validation.constraints.NotNull; import java.io.File; import java.io.IOException; +import java.lang.reflect.Method; import java.util.Collections; import java.util.List; import java.util.Map; diff --git a/io.sc.platform.developer.doc/asciidoc/9999-appendix/appendix.adoc b/io.sc.platform.developer.doc/asciidoc/9999-appendix/appendix.adoc index cee2abd4..b516d0be 100644 --- a/io.sc.platform.developer.doc/asciidoc/9999-appendix/appendix.adoc +++ b/io.sc.platform.developer.doc/asciidoc/9999-appendix/appendix.adoc @@ -13,6 +13,7 @@ include::mac/mac.adoc[] include::linux/linux.adoc[] include::oauth2/oauth2.adoc[] include::java/java.adoc[] +include::javassist/javassist.adoc[] include::rwa/rwa.adoc[] include::icaap/icaap.adoc[] include::refrence/refrence.adoc[] diff --git a/io.sc.platform.developer.doc/asciidoc/9999-appendix/javassist/javassist.adoc b/io.sc.platform.developer.doc/asciidoc/9999-appendix/javassist/javassist.adoc new file mode 100644 index 00000000..21c50642 --- /dev/null +++ b/io.sc.platform.developer.doc/asciidoc/9999-appendix/javassist/javassist.adoc @@ -0,0 +1,18 @@ +[appendix] += Javassist +Javassist 是一个处理 Java 字节码的类库. Java 字节码被存储在叫做 class 的二进制文件中. +每个 class 文件包含一个 java 类或接口. + +类 Javassist.CtClass 是 class 类文件的抽象表示形式。 +CtClass(编译时类) 的对象用于处理类文件。下面的程序是一个非常简单的示例: + +[source,java] +---- +ClassPool pool = ClassPool.getDefault(); +CtClass cc = pool.get("test.Rectangle"); +cc.setSuperclass(pool.get("test.Point")); +cc.writeFile(); +---- + +A CtClass (compile-time class) object is a handle for dealing with a class file. +The following program is a very simple example: diff --git a/io.sc.platform.developer.doc/package.json b/io.sc.platform.developer.doc/package.json index 0a23e103..e31ea330 100644 --- a/io.sc.platform.developer.doc/package.json +++ b/io.sc.platform.developer.doc/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.platform.developer.doc", - "version": "8.2.2", + "version": "8.2.3", "description": "", "main": "index.js", "scripts": { @@ -28,7 +28,7 @@ "vuepress": "2.0.0-rc.15" }, "dependencies": { - "platform-core": "8.2.8", + "platform-core": "8.2.14", "quasar": "2.17.4", "vue": "3.5.13", "vue-i18n": "10.0.4" diff --git a/io.sc.platform.developer.frontend/package.json b/io.sc.platform.developer.frontend/package.json index 0a50caab..c7fbc75b 100644 --- a/io.sc.platform.developer.frontend/package.json +++ b/io.sc.platform.developer.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.platform.developer.frontend", - "version": "8.2.2", + "version": "8.2.3", "description": "", "private": false, "keywords": [], @@ -111,7 +111,7 @@ "node-sql-parser": "5.3.4", "pinia": "2.2.6", "pinia-undo": "0.2.4", - "platform-core": "8.2.8", + "platform-core": "8.2.14", "quasar": "2.17.4", "sort-array": "5.0.0", "svg-path-commander": "2.1.5", diff --git a/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/spi/javassist/AbstractEngineConfiguration.java b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/spi/javassist/AbstractEngineConfiguration.java new file mode 100644 index 00000000..eed3e2f8 --- /dev/null +++ b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/spi/javassist/AbstractEngineConfiguration.java @@ -0,0 +1,29 @@ +package io.sc.platform.flowable.spi.javassist; + +import io.sc.platform.core.spi.JavassistSpiService; +import javassist.ClassPool; +import javassist.CtClass; +import javassist.CtMethod; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class AbstractEngineConfiguration implements JavassistSpiService { + private static final Logger log = LoggerFactory.getLogger(AbstractEngineConfiguration.class); + + @Override + public void modify(ClassLoader classLoader, ClassPool pool) { + try { + // 替换 org.flowable.common.engine.impl.AbstractEngineConfiguration.getDefaultDatabaseTypeMappings() 方法 + CtClass cc = pool.get("org.flowable.common.engine.impl.AbstractEngineConfiguration"); + CtMethod method = cc.getDeclaredMethod("getDefaultDatabaseTypeMappings"); + StringBuilder sb =new StringBuilder(); + sb.append("{"); + sb.append(" return io.sc.platform.flowable.util.FlowableDatabaseTypeUtil.getDefaultDatabaseTypeMappings();"); + sb.append("}"); + method.setBody(sb.toString()); + cc.toClass(classLoader); + }catch (Exception e){ + log.error("",e); + } + } +} diff --git a/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/util/FlowableDatabaseTypeUtil.java b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/util/FlowableDatabaseTypeUtil.java index 5a955ccf..b970274f 100644 --- a/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/util/FlowableDatabaseTypeUtil.java +++ b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/util/FlowableDatabaseTypeUtil.java @@ -1,34 +1,53 @@ package io.sc.platform.flowable.util; -import io.sc.platform.jdbc.DatabaseType; +import java.util.Properties; public class FlowableDatabaseTypeUtil { - public static String getDatabaseType(DatabaseType type){ - switch(type){ - case DB2: - return "db2"; - case DB2ZOS: - return "db2zos"; - case DERBY: - return "derby"; - case H2: - return "h2"; - case HSQL: - return "hsql"; - case MYSQL: - return "mysql"; - case ORACLE: - return "oracle"; - case POSTGRESQL: - return "postgres"; - case SQLITE: - return "sqlite"; - case SQLSERVER: - return "mssql"; - case SYBASE: - return "sybase"; - default: - return null; - } + public static final String PRODUCT_NAME_POSTGRES = "PostgreSQL"; + public static final String PRODUCT_NAME_CRDB = "CockroachDB"; + + public static final String DATABASE_TYPE_H2 = "h2"; + public static final String DATABASE_TYPE_HSQL = "hsql"; + public static final String DATABASE_TYPE_MYSQL = "mysql"; + public static final String DATABASE_TYPE_ORACLE = "oracle"; + public static final String DATABASE_TYPE_POSTGRES = "postgres"; + public static final String DATABASE_TYPE_MSSQL = "mssql"; + public static final String DATABASE_TYPE_DB2 = "db2"; + public static final String DATABASE_TYPE_COCKROACHDB = "cockroachdb"; + + public static Properties getDefaultDatabaseTypeMappings() { + Properties databaseTypeMappings = new Properties(); + databaseTypeMappings.setProperty("H2", DATABASE_TYPE_H2); + databaseTypeMappings.setProperty("HSQL Database Engine", DATABASE_TYPE_HSQL); + databaseTypeMappings.setProperty("MySQL", DATABASE_TYPE_MYSQL); + databaseTypeMappings.setProperty("MariaDB", DATABASE_TYPE_MYSQL); + databaseTypeMappings.setProperty("Oracle", DATABASE_TYPE_ORACLE); + databaseTypeMappings.setProperty(PRODUCT_NAME_POSTGRES, DATABASE_TYPE_POSTGRES); + databaseTypeMappings.setProperty("Microsoft SQL Server", DATABASE_TYPE_MSSQL); + databaseTypeMappings.setProperty(DATABASE_TYPE_DB2, DATABASE_TYPE_DB2); + databaseTypeMappings.setProperty("DB2", DATABASE_TYPE_DB2); + databaseTypeMappings.setProperty("DB2/NT", DATABASE_TYPE_DB2); + databaseTypeMappings.setProperty("DB2/NT64", DATABASE_TYPE_DB2); + databaseTypeMappings.setProperty("DB2 UDP", DATABASE_TYPE_DB2); + databaseTypeMappings.setProperty("DB2/LINUX", DATABASE_TYPE_DB2); + databaseTypeMappings.setProperty("DB2/LINUX390", DATABASE_TYPE_DB2); + databaseTypeMappings.setProperty("DB2/LINUXX8664", DATABASE_TYPE_DB2); + databaseTypeMappings.setProperty("DB2/LINUXZ64", DATABASE_TYPE_DB2); + databaseTypeMappings.setProperty("DB2/LINUXPPC64", DATABASE_TYPE_DB2); + databaseTypeMappings.setProperty("DB2/LINUXPPC64LE", DATABASE_TYPE_DB2); + databaseTypeMappings.setProperty("DB2/400 SQL", DATABASE_TYPE_DB2); + databaseTypeMappings.setProperty("DB2/6000", DATABASE_TYPE_DB2); + databaseTypeMappings.setProperty("DB2 UDB iSeries", DATABASE_TYPE_DB2); + databaseTypeMappings.setProperty("DB2/AIX64", DATABASE_TYPE_DB2); + databaseTypeMappings.setProperty("DB2/HPUX", DATABASE_TYPE_DB2); + databaseTypeMappings.setProperty("DB2/HP64", DATABASE_TYPE_DB2); + databaseTypeMappings.setProperty("DB2/SUN", DATABASE_TYPE_DB2); + databaseTypeMappings.setProperty("DB2/SUN64", DATABASE_TYPE_DB2); + databaseTypeMappings.setProperty("DB2/PTX", DATABASE_TYPE_DB2); + databaseTypeMappings.setProperty("DB2/2", DATABASE_TYPE_DB2); + databaseTypeMappings.setProperty("DB2 UDB AS400", DATABASE_TYPE_DB2); + databaseTypeMappings.setProperty("DM DBMS", DATABASE_TYPE_ORACLE); + databaseTypeMappings.setProperty(PRODUCT_NAME_CRDB, DATABASE_TYPE_COCKROACHDB); + return databaseTypeMappings; } } diff --git a/io.sc.platform.flowable/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java b/io.sc.platform.flowable/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java deleted file mode 100644 index a35e1cd8..00000000 --- a/io.sc.platform.flowable/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java +++ /dev/null @@ -1,2068 +0,0 @@ -/* Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.flowable.common.engine.impl; - -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.sql.Connection; -import java.sql.DatabaseMetaData; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.time.Duration; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.ServiceLoader; -import java.util.Set; - -import javax.naming.InitialContext; -import javax.sql.DataSource; - -import org.apache.commons.lang3.StringUtils; -import org.apache.ibatis.builder.xml.XMLConfigBuilder; -import org.apache.ibatis.builder.xml.XMLMapperBuilder; -import org.apache.ibatis.datasource.pooled.PooledDataSource; -import org.apache.ibatis.mapping.Environment; -import org.apache.ibatis.plugin.Interceptor; -import org.apache.ibatis.session.Configuration; -import org.apache.ibatis.session.SqlSessionFactory; -import org.apache.ibatis.session.defaults.DefaultSqlSessionFactory; -import org.apache.ibatis.transaction.TransactionFactory; -import org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory; -import org.apache.ibatis.transaction.managed.ManagedTransactionFactory; -import org.apache.ibatis.type.ArrayTypeHandler; -import org.apache.ibatis.type.BigDecimalTypeHandler; -import org.apache.ibatis.type.BlobInputStreamTypeHandler; -import org.apache.ibatis.type.BlobTypeHandler; -import org.apache.ibatis.type.BooleanTypeHandler; -import org.apache.ibatis.type.ByteTypeHandler; -import org.apache.ibatis.type.ClobTypeHandler; -import org.apache.ibatis.type.DateOnlyTypeHandler; -import org.apache.ibatis.type.DateTypeHandler; -import org.apache.ibatis.type.DoubleTypeHandler; -import org.apache.ibatis.type.FloatTypeHandler; -import org.apache.ibatis.type.IntegerTypeHandler; -import org.apache.ibatis.type.JdbcType; -import org.apache.ibatis.type.LongTypeHandler; -import org.apache.ibatis.type.NClobTypeHandler; -import org.apache.ibatis.type.NStringTypeHandler; -import org.apache.ibatis.type.ShortTypeHandler; -import org.apache.ibatis.type.SqlxmlTypeHandler; -import org.apache.ibatis.type.StringTypeHandler; -import org.apache.ibatis.type.TimeOnlyTypeHandler; -import org.apache.ibatis.type.TypeHandlerRegistry; -import org.flowable.common.engine.api.FlowableException; -import org.flowable.common.engine.api.delegate.event.FlowableEngineEventType; -import org.flowable.common.engine.api.delegate.event.FlowableEventDispatcher; -import org.flowable.common.engine.api.delegate.event.FlowableEventListener; -import org.flowable.common.engine.api.engine.EngineLifecycleListener; -import org.flowable.common.engine.impl.agenda.AgendaOperationRunner; -import org.flowable.common.engine.impl.cfg.CommandExecutorImpl; -import org.flowable.common.engine.impl.cfg.IdGenerator; -import org.flowable.common.engine.impl.cfg.TransactionContextFactory; -import org.flowable.common.engine.impl.cfg.standalone.StandaloneMybatisTransactionContextFactory; -import org.flowable.common.engine.impl.db.CommonDbSchemaManager; -import org.flowable.common.engine.impl.db.DbSqlSessionFactory; -import org.flowable.common.engine.impl.db.LogSqlExecutionTimePlugin; -import org.flowable.common.engine.impl.db.MybatisTypeAliasConfigurator; -import org.flowable.common.engine.impl.db.MybatisTypeHandlerConfigurator; -import org.flowable.common.engine.impl.db.SchemaManager; -import org.flowable.common.engine.impl.event.EventDispatchAction; -import org.flowable.common.engine.impl.event.FlowableEventDispatcherImpl; -import org.flowable.common.engine.impl.interceptor.Command; -import org.flowable.common.engine.impl.interceptor.CommandConfig; -import org.flowable.common.engine.impl.interceptor.CommandContextFactory; -import org.flowable.common.engine.impl.interceptor.CommandContextInterceptor; -import org.flowable.common.engine.impl.interceptor.CommandExecutor; -import org.flowable.common.engine.impl.interceptor.CommandInterceptor; -import org.flowable.common.engine.impl.interceptor.CrDbRetryInterceptor; -import org.flowable.common.engine.impl.interceptor.DefaultCommandInvoker; -import org.flowable.common.engine.impl.interceptor.LogInterceptor; -import org.flowable.common.engine.impl.interceptor.SessionFactory; -import org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor; -import org.flowable.common.engine.impl.lock.LockManager; -import org.flowable.common.engine.impl.lock.LockManagerImpl; -import org.flowable.common.engine.impl.logging.LoggingListener; -import org.flowable.common.engine.impl.logging.LoggingSession; -import org.flowable.common.engine.impl.logging.LoggingSessionFactory; -import org.flowable.common.engine.impl.persistence.GenericManagerFactory; -import org.flowable.common.engine.impl.persistence.StrongUuidGenerator; -import org.flowable.common.engine.impl.persistence.cache.EntityCache; -import org.flowable.common.engine.impl.persistence.cache.EntityCacheImpl; -import org.flowable.common.engine.impl.persistence.entity.ByteArrayEntityManager; -import org.flowable.common.engine.impl.persistence.entity.ByteArrayEntityManagerImpl; -import org.flowable.common.engine.impl.persistence.entity.Entity; -import org.flowable.common.engine.impl.persistence.entity.PropertyEntityManager; -import org.flowable.common.engine.impl.persistence.entity.PropertyEntityManagerImpl; -import org.flowable.common.engine.impl.persistence.entity.TableDataManager; -import org.flowable.common.engine.impl.persistence.entity.TableDataManagerImpl; -import org.flowable.common.engine.impl.persistence.entity.data.ByteArrayDataManager; -import org.flowable.common.engine.impl.persistence.entity.data.PropertyDataManager; -import org.flowable.common.engine.impl.persistence.entity.data.impl.MybatisByteArrayDataManager; -import org.flowable.common.engine.impl.persistence.entity.data.impl.MybatisPropertyDataManager; -import org.flowable.common.engine.impl.runtime.Clock; -import org.flowable.common.engine.impl.service.CommonEngineServiceImpl; -import org.flowable.common.engine.impl.util.DefaultClockImpl; -import org.flowable.common.engine.impl.util.IoUtil; -import org.flowable.common.engine.impl.util.ReflectUtil; -import org.flowable.eventregistry.api.EventRegistryEventConsumer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; - -public abstract class AbstractEngineConfiguration { - - protected final Logger logger = LoggerFactory.getLogger(getClass()); - - /** The tenant id indicating 'no tenant' */ - public static final String NO_TENANT_ID = ""; - - /** - * Checks the version of the DB schema against the library when the form engine is being created and throws an exception if the versions don't match. - */ - public static final String DB_SCHEMA_UPDATE_FALSE = "false"; - public static final String DB_SCHEMA_UPDATE_CREATE = "create"; - public static final String DB_SCHEMA_UPDATE_CREATE_DROP = "create-drop"; - - /** - * Creates the schema when the form engine is being created and drops the schema when the form engine is being closed. - */ - public static final String DB_SCHEMA_UPDATE_DROP_CREATE = "drop-create"; - - /** - * Upon building of the process engine, a check is performed and an update of the schema is performed if it is necessary. - */ - public static final String DB_SCHEMA_UPDATE_TRUE = "true"; - - protected boolean forceCloseMybatisConnectionPool = true; - - protected String databaseType; - protected String jdbcDriver = "org.h2.Driver"; - protected String jdbcUrl = "jdbc:h2:tcp://localhost/~/flowable"; - protected String jdbcUsername = "sa"; - protected String jdbcPassword = ""; - protected String dataSourceJndiName; - protected int jdbcMaxActiveConnections = 16; - protected int jdbcMaxIdleConnections = 8; - protected int jdbcMaxCheckoutTime; - protected int jdbcMaxWaitTime; - protected boolean jdbcPingEnabled; - protected String jdbcPingQuery; - protected int jdbcPingConnectionNotUsedFor; - protected int jdbcDefaultTransactionIsolationLevel; - protected DataSource dataSource; - protected SchemaManager commonSchemaManager; - protected SchemaManager schemaManager; - protected Command schemaManagementCmd; - - protected String databaseSchemaUpdate = DB_SCHEMA_UPDATE_FALSE; - - /** - * Whether to use a lock when performing the database schema create or update operations. - */ - protected boolean useLockForDatabaseSchemaUpdate = false; - - protected String xmlEncoding = "UTF-8"; - - // COMMAND EXECUTORS /////////////////////////////////////////////// - - protected CommandExecutor commandExecutor; - protected Collection defaultCommandInterceptors; - protected CommandConfig defaultCommandConfig; - protected CommandConfig schemaCommandConfig; - protected CommandContextFactory commandContextFactory; - protected CommandInterceptor commandInvoker; - - protected AgendaOperationRunner agendaOperationRunner = (commandContext, runnable) -> runnable.run(); - - protected List customPreCommandInterceptors; - protected List customPostCommandInterceptors; - protected List commandInterceptors; - - protected Map engineConfigurations = new HashMap<>(); - protected Map serviceConfigurations = new HashMap<>(); - - protected ClassLoader classLoader; - /** - * Either use Class.forName or ClassLoader.loadClass for class loading. See http://forums.activiti.org/content/reflectutilloadclass-and-custom- classloader - */ - protected boolean useClassForNameClassLoading = true; - - protected List engineLifecycleListeners; - - // Event Registry ////////////////////////////////////////////////// - protected Map eventRegistryEventConsumers = new HashMap<>(); - - // MYBATIS SQL SESSION FACTORY ///////////////////////////////////// - - protected boolean isDbHistoryUsed = true; - protected DbSqlSessionFactory dbSqlSessionFactory; - protected SqlSessionFactory sqlSessionFactory; - protected TransactionFactory transactionFactory; - protected TransactionContextFactory transactionContextFactory; - - /** - * If set to true, enables bulk insert (grouping sql inserts together). Default true. - * For some databases (eg DB2+z/OS) needs to be set to false. - */ - protected boolean isBulkInsertEnabled = true; - - /** - * Some databases have a limit of how many parameters one sql insert can have (eg SQL Server, 2000 params (!= insert statements) ). Tweak this parameter in case of exceptions indicating too much - * is being put into one bulk insert, or make it higher if your database can cope with it and there are inserts with a huge amount of data. - *

- * By default: 100 (55 for mssql server as it has a hard limit of 2000 parameters in a statement) - */ - protected int maxNrOfStatementsInBulkInsert = 100; - - public int DEFAULT_MAX_NR_OF_STATEMENTS_BULK_INSERT_SQL_SERVER = 55; // currently Execution has most params (35). 2000 / 35 = 57. - - protected String mybatisMappingFile; - protected Set> customMybatisMappers; - protected Set customMybatisXMLMappers; - protected List customMybatisInterceptors; - - protected Set dependentEngineMyBatisXmlMappers; - protected List dependentEngineMybatisTypeAliasConfigs; - protected List dependentEngineMybatisTypeHandlerConfigs; - - // SESSION FACTORIES /////////////////////////////////////////////// - protected List customSessionFactories; - protected Map, SessionFactory> sessionFactories; - - protected boolean enableEventDispatcher = true; - protected FlowableEventDispatcher eventDispatcher; - protected List eventListeners; - protected Map> typedEventListeners; - protected List additionalEventDispatchActions; - - protected LoggingListener loggingListener; - - protected boolean transactionsExternallyManaged; - - /** - * Flag that can be set to configure or not a relational database is used. This is useful for custom implementations that do not use relational databases at all. - * - * If true (default), the {@link AbstractEngineConfiguration#getDatabaseSchemaUpdate()} value will be used to determine what needs to happen wrt the database schema. - * - * If false, no validation or schema creation will be done. That means that the database schema must have been created 'manually' before but the engine does not validate whether the schema is - * correct. The {@link AbstractEngineConfiguration#getDatabaseSchemaUpdate()} value will not be used. - */ - protected boolean usingRelationalDatabase = true; - - /** - * Flag that can be set to configure whether or not a schema is used. This is useful for custom implementations that do not use relational databases at all. - * Setting {@link #usingRelationalDatabase} to true will automatically imply using a schema. - */ - protected boolean usingSchemaMgmt = true; - - /** - * Allows configuring a database table prefix which is used for all runtime operations of the process engine. For example, if you specify a prefix named 'PRE1.', Flowable will query for executions - * in a table named 'PRE1.ACT_RU_EXECUTION_'. - * - *

- * NOTE: the prefix is not respected by automatic database schema management. If you use {@link AbstractEngineConfiguration#DB_SCHEMA_UPDATE_CREATE_DROP} or - * {@link AbstractEngineConfiguration#DB_SCHEMA_UPDATE_TRUE}, Flowable will create the database tables using the default names, regardless of the prefix configured here. - */ - protected String databaseTablePrefix = ""; - - /** - * Escape character for doing wildcard searches. - * - * This will be added at then end of queries that include for example a LIKE clause. For example: SELECT * FROM table WHERE column LIKE '%\%%' ESCAPE '\'; - */ - protected String databaseWildcardEscapeCharacter; - - /** - * database catalog to use - */ - protected String databaseCatalog = ""; - - /** - * In some situations you want to set the schema to use for table checks / generation if the database metadata doesn't return that correctly, see https://jira.codehaus.org/browse/ACT-1220, - * https://jira.codehaus.org/browse/ACT-1062 - */ - protected String databaseSchema; - - /** - * Set to true in case the defined databaseTablePrefix is a schema-name, instead of an actual table name prefix. This is relevant for checking if Flowable-tables exist, the databaseTablePrefix - * will not be used here - since the schema is taken into account already, adding a prefix for the table-check will result in wrong table-names. - */ - protected boolean tablePrefixIsSchema; - - /** - * Set to true if the latest version of a definition should be retrieved, ignoring a possible parent deployment id value - */ - protected boolean alwaysLookupLatestDefinitionVersion; - - /** - * Set to true if by default lookups should fallback to the default tenant (an empty string by default or a defined tenant value) - */ - protected boolean fallbackToDefaultTenant; - - /** - * Default tenant provider that is executed when looking up definitions, in case the global or local fallback to default tenant value is true - */ - protected DefaultTenantProvider defaultTenantProvider = (tenantId, scope, scopeKey) -> NO_TENANT_ID; - - /** - * Enables the MyBatis plugin that logs the execution time of sql statements. - */ - protected boolean enableLogSqlExecutionTime; - - protected Properties databaseTypeMappings = getDefaultDatabaseTypeMappings(); - - /** - * Duration between the checks when acquiring a lock. - */ - protected Duration lockPollRate = Duration.ofSeconds(10); - - /** - * Duration to wait for the DB Schema lock before giving up. - */ - protected Duration schemaLockWaitTime = Duration.ofMinutes(5); - - // DATA MANAGERS ////////////////////////////////////////////////////////////////// - - protected PropertyDataManager propertyDataManager; - protected ByteArrayDataManager byteArrayDataManager; - protected TableDataManager tableDataManager; - - // ENTITY MANAGERS //////////////////////////////////////////////////////////////// - - protected PropertyEntityManager propertyEntityManager; - protected ByteArrayEntityManager byteArrayEntityManager; - - protected List customPreDeployers; - protected List customPostDeployers; - protected List deployers; - - // CONFIGURATORS //////////////////////////////////////////////////////////// - - protected boolean enableConfiguratorServiceLoader = true; // Enabled by default. In certain environments this should be set to false (eg osgi) - protected List configurators; // The injected configurators - protected List allConfigurators; // Including auto-discovered configurators - protected EngineConfigurator idmEngineConfigurator; - protected EngineConfigurator eventRegistryConfigurator; - - public static final String PRODUCT_NAME_POSTGRES = "PostgreSQL"; - public static final String PRODUCT_NAME_CRDB = "CockroachDB"; - - public static final String DATABASE_TYPE_H2 = "h2"; - public static final String DATABASE_TYPE_HSQL = "hsql"; - public static final String DATABASE_TYPE_MYSQL = "mysql"; - public static final String DATABASE_TYPE_ORACLE = "oracle"; - public static final String DATABASE_TYPE_POSTGRES = "postgres"; - public static final String DATABASE_TYPE_MSSQL = "mssql"; - public static final String DATABASE_TYPE_DB2 = "db2"; - public static final String DATABASE_TYPE_COCKROACHDB = "cockroachdb"; - - public static Properties getDefaultDatabaseTypeMappings() { - Properties databaseTypeMappings = new Properties(); - databaseTypeMappings.setProperty("H2", DATABASE_TYPE_H2); - databaseTypeMappings.setProperty("HSQL Database Engine", DATABASE_TYPE_HSQL); - databaseTypeMappings.setProperty("MySQL", DATABASE_TYPE_MYSQL); - databaseTypeMappings.setProperty("MariaDB", DATABASE_TYPE_MYSQL); - databaseTypeMappings.setProperty("Oracle", DATABASE_TYPE_ORACLE); - databaseTypeMappings.setProperty(PRODUCT_NAME_POSTGRES, DATABASE_TYPE_POSTGRES); - databaseTypeMappings.setProperty("Microsoft SQL Server", DATABASE_TYPE_MSSQL); - databaseTypeMappings.setProperty(DATABASE_TYPE_DB2, DATABASE_TYPE_DB2); - databaseTypeMappings.setProperty("DB2", DATABASE_TYPE_DB2); - databaseTypeMappings.setProperty("DB2/NT", DATABASE_TYPE_DB2); - databaseTypeMappings.setProperty("DB2/NT64", DATABASE_TYPE_DB2); - databaseTypeMappings.setProperty("DB2 UDP", DATABASE_TYPE_DB2); - databaseTypeMappings.setProperty("DB2/LINUX", DATABASE_TYPE_DB2); - databaseTypeMappings.setProperty("DB2/LINUX390", DATABASE_TYPE_DB2); - databaseTypeMappings.setProperty("DB2/LINUXX8664", DATABASE_TYPE_DB2); - databaseTypeMappings.setProperty("DB2/LINUXZ64", DATABASE_TYPE_DB2); - databaseTypeMappings.setProperty("DB2/LINUXPPC64", DATABASE_TYPE_DB2); - databaseTypeMappings.setProperty("DB2/LINUXPPC64LE", DATABASE_TYPE_DB2); - databaseTypeMappings.setProperty("DB2/400 SQL", DATABASE_TYPE_DB2); - databaseTypeMappings.setProperty("DB2/6000", DATABASE_TYPE_DB2); - databaseTypeMappings.setProperty("DB2 UDB iSeries", DATABASE_TYPE_DB2); - databaseTypeMappings.setProperty("DB2/AIX64", DATABASE_TYPE_DB2); - databaseTypeMappings.setProperty("DB2/HPUX", DATABASE_TYPE_DB2); - databaseTypeMappings.setProperty("DB2/HP64", DATABASE_TYPE_DB2); - databaseTypeMappings.setProperty("DB2/SUN", DATABASE_TYPE_DB2); - databaseTypeMappings.setProperty("DB2/SUN64", DATABASE_TYPE_DB2); - databaseTypeMappings.setProperty("DB2/PTX", DATABASE_TYPE_DB2); - databaseTypeMappings.setProperty("DB2/2", DATABASE_TYPE_DB2); - databaseTypeMappings.setProperty("DB2 UDB AS400", DATABASE_TYPE_DB2); - databaseTypeMappings.setProperty("DM DBMS", DATABASE_TYPE_ORACLE); - databaseTypeMappings.setProperty(PRODUCT_NAME_CRDB, DATABASE_TYPE_COCKROACHDB); - return databaseTypeMappings; - } - - protected Map beans; - - protected IdGenerator idGenerator; - protected boolean usePrefixId; - - protected Clock clock; - protected ObjectMapper objectMapper; - - // Variables - - public static final int DEFAULT_GENERIC_MAX_LENGTH_STRING = 4000; - public static final int DEFAULT_ORACLE_MAX_LENGTH_STRING = 2000; - - /** - * Define a max length for storing String variable types in the database. Mainly used for the Oracle NVARCHAR2 limit of 2000 characters - */ - protected int maxLengthStringVariableType = -1; - - protected void initEngineConfigurations() { - addEngineConfiguration(getEngineCfgKey(), getEngineScopeType(), this); - } - - // DataSource - // /////////////////////////////////////////////////////////////// - - protected void initDataSource() { - if (dataSource == null) { - if (dataSourceJndiName != null) { - try { - dataSource = (DataSource) new InitialContext().lookup(dataSourceJndiName); - } catch (Exception e) { - throw new FlowableException("couldn't lookup datasource from " + dataSourceJndiName + ": " + e.getMessage(), e); - } - - } else if (jdbcUrl != null) { - if ((jdbcDriver == null) || (jdbcUsername == null)) { - throw new FlowableException("DataSource or JDBC properties have to be specified in a process engine configuration"); - } - - logger.debug("initializing datasource to db: {}", jdbcUrl); - - if (logger.isInfoEnabled()) { - logger.info("Configuring Datasource with following properties (omitted password for security)"); - logger.info("datasource driver : {}", jdbcDriver); - logger.info("datasource url : {}", jdbcUrl); - logger.info("datasource user name : {}", jdbcUsername); - } - - PooledDataSource pooledDataSource = new PooledDataSource(this.getClass().getClassLoader(), jdbcDriver, jdbcUrl, jdbcUsername, jdbcPassword); - - if (jdbcMaxActiveConnections > 0) { - pooledDataSource.setPoolMaximumActiveConnections(jdbcMaxActiveConnections); - } - if (jdbcMaxIdleConnections > 0) { - pooledDataSource.setPoolMaximumIdleConnections(jdbcMaxIdleConnections); - } - if (jdbcMaxCheckoutTime > 0) { - pooledDataSource.setPoolMaximumCheckoutTime(jdbcMaxCheckoutTime); - } - if (jdbcMaxWaitTime > 0) { - pooledDataSource.setPoolTimeToWait(jdbcMaxWaitTime); - } - if (jdbcPingEnabled) { - pooledDataSource.setPoolPingEnabled(true); - if (jdbcPingQuery != null) { - pooledDataSource.setPoolPingQuery(jdbcPingQuery); - } - pooledDataSource.setPoolPingConnectionsNotUsedFor(jdbcPingConnectionNotUsedFor); - } - if (jdbcDefaultTransactionIsolationLevel > 0) { - pooledDataSource.setDefaultTransactionIsolationLevel(jdbcDefaultTransactionIsolationLevel); - } - dataSource = pooledDataSource; - } - } - - if (databaseType == null) { - initDatabaseType(); - } - } - - public void initDatabaseType() { - Connection connection = null; - try { - connection = dataSource.getConnection(); - DatabaseMetaData databaseMetaData = connection.getMetaData(); - String databaseProductName = databaseMetaData.getDatabaseProductName(); - logger.debug("database product name: '{}'", databaseProductName); - - // CRDB does not expose the version through the jdbc driver, so we need to fetch it through version(). - if (PRODUCT_NAME_POSTGRES.equalsIgnoreCase(databaseProductName)) { - try (PreparedStatement preparedStatement = connection.prepareStatement("select version() as version;"); - ResultSet resultSet = preparedStatement.executeQuery()) { - String version = null; - if (resultSet.next()) { - version = resultSet.getString("version"); - } - - if (StringUtils.isNotEmpty(version) && version.toLowerCase().startsWith(PRODUCT_NAME_CRDB.toLowerCase())) { - databaseProductName = PRODUCT_NAME_CRDB; - logger.info("CockroachDB version '{}' detected", version); - } - } - } - - databaseType = databaseTypeMappings.getProperty(databaseProductName); - if (databaseType == null) { - throw new FlowableException("couldn't deduct database type from database product name '" + databaseProductName + "'"); - } - logger.debug("using database type: {}", databaseType); - - } catch (SQLException e) { - throw new RuntimeException("Exception while initializing Database connection", e); - } finally { - try { - if (connection != null) { - connection.close(); - } - } catch (SQLException e) { - logger.error("Exception while closing the Database connection", e); - } - } - - // Special care for MSSQL, as it has a hard limit of 2000 params per statement (incl bulk statement). - // Especially with executions, with 100 as default, this limit is passed. - if (DATABASE_TYPE_MSSQL.equals(databaseType)) { - maxNrOfStatementsInBulkInsert = DEFAULT_MAX_NR_OF_STATEMENTS_BULK_INSERT_SQL_SERVER; - } - } - - public void initSchemaManager() { - if (this.commonSchemaManager == null) { - this.commonSchemaManager = new CommonDbSchemaManager(); - } - } - - // session factories //////////////////////////////////////////////////////// - - public void addSessionFactory(SessionFactory sessionFactory) { - sessionFactories.put(sessionFactory.getSessionType(), sessionFactory); - } - - public void initCommandContextFactory() { - if (commandContextFactory == null) { - commandContextFactory = new CommandContextFactory(); - } - } - - public void initTransactionContextFactory() { - if (transactionContextFactory == null) { - transactionContextFactory = new StandaloneMybatisTransactionContextFactory(); - } - } - - public void initCommandExecutors() { - initDefaultCommandConfig(); - initSchemaCommandConfig(); - initCommandInvoker(); - initCommandInterceptors(); - initCommandExecutor(); - } - - - public void initDefaultCommandConfig() { - if (defaultCommandConfig == null) { - defaultCommandConfig = new CommandConfig(); - } - } - - public void initSchemaCommandConfig() { - if (schemaCommandConfig == null) { - schemaCommandConfig = new CommandConfig(); - } - } - - public void initCommandInvoker() { - if (commandInvoker == null) { - commandInvoker = new DefaultCommandInvoker(); - } - } - - public void initCommandInterceptors() { - if (commandInterceptors == null) { - commandInterceptors = new ArrayList<>(); - if (customPreCommandInterceptors != null) { - commandInterceptors.addAll(customPreCommandInterceptors); - } - commandInterceptors.addAll(getDefaultCommandInterceptors()); - if (customPostCommandInterceptors != null) { - commandInterceptors.addAll(customPostCommandInterceptors); - } - commandInterceptors.add(commandInvoker); - } - } - - public Collection getDefaultCommandInterceptors() { - if (defaultCommandInterceptors == null) { - List interceptors = new ArrayList<>(); - interceptors.add(new LogInterceptor()); - - if (DATABASE_TYPE_COCKROACHDB.equals(databaseType)) { - interceptors.add(new CrDbRetryInterceptor()); - } - - CommandInterceptor transactionInterceptor = createTransactionInterceptor(); - if (transactionInterceptor != null) { - interceptors.add(transactionInterceptor); - } - - if (commandContextFactory != null) { - String engineCfgKey = getEngineCfgKey(); - CommandContextInterceptor commandContextInterceptor = new CommandContextInterceptor(commandContextFactory, - classLoader, useClassForNameClassLoading, clock, objectMapper); - engineConfigurations.put(engineCfgKey, this); - commandContextInterceptor.setEngineCfgKey(engineCfgKey); - commandContextInterceptor.setEngineConfigurations(engineConfigurations); - interceptors.add(commandContextInterceptor); - } - - if (transactionContextFactory != null) { - interceptors.add(new TransactionContextInterceptor(transactionContextFactory)); - } - - List additionalCommandInterceptors = getAdditionalDefaultCommandInterceptors(); - if (additionalCommandInterceptors != null) { - interceptors.addAll(additionalCommandInterceptors); - } - - defaultCommandInterceptors = interceptors; - } - return defaultCommandInterceptors; - } - - public abstract String getEngineCfgKey(); - - public abstract String getEngineScopeType(); - - public List getAdditionalDefaultCommandInterceptors() { - return null; - } - - public void initCommandExecutor() { - if (commandExecutor == null) { - CommandInterceptor first = initInterceptorChain(commandInterceptors); - commandExecutor = new CommandExecutorImpl(getDefaultCommandConfig(), first); - } - } - - public CommandInterceptor initInterceptorChain(List chain) { - if (chain == null || chain.isEmpty()) { - throw new FlowableException("invalid command interceptor chain configuration: " + chain); - } - for (int i = 0; i < chain.size() - 1; i++) { - chain.get(i).setNext(chain.get(i + 1)); - } - return chain.get(0); - } - - public abstract CommandInterceptor createTransactionInterceptor(); - - - public void initBeans() { - if (beans == null) { - beans = new HashMap<>(); - } - } - - // id generator - // ///////////////////////////////////////////////////////////// - - public void initIdGenerator() { - if (idGenerator == null) { - idGenerator = new StrongUuidGenerator(); - } - } - - public void initObjectMapper() { - if (objectMapper == null) { - objectMapper = new ObjectMapper(); - objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); - } - } - - public void initClock() { - if (clock == null) { - clock = new DefaultClockImpl(); - } - } - - // Data managers /////////////////////////////////////////////////////////// - - public void initDataManagers() { - if (propertyDataManager == null) { - propertyDataManager = new MybatisPropertyDataManager(idGenerator); - } - - if (byteArrayDataManager == null) { - byteArrayDataManager = new MybatisByteArrayDataManager(idGenerator); - } - } - - // Entity managers ////////////////////////////////////////////////////////// - - public void initEntityManagers() { - if (propertyEntityManager == null) { - propertyEntityManager = new PropertyEntityManagerImpl(this, propertyDataManager); - } - - if (byteArrayEntityManager == null) { - byteArrayEntityManager = new ByteArrayEntityManagerImpl(byteArrayDataManager, getEngineCfgKey(), this::getEventDispatcher); - } - - if (tableDataManager == null) { - tableDataManager = new TableDataManagerImpl(this); - } - } - - // services - // ///////////////////////////////////////////////////////////////// - - protected void initService(Object service) { - if (service instanceof CommonEngineServiceImpl) { - ((CommonEngineServiceImpl) service).setCommandExecutor(commandExecutor); - } - } - - // myBatis SqlSessionFactory - // //////////////////////////////////////////////// - - public void initSessionFactories() { - if (sessionFactories == null) { - sessionFactories = new HashMap<>(); - - if (usingRelationalDatabase) { - initDbSqlSessionFactory(); - } - - addSessionFactory(new GenericManagerFactory(EntityCache.class, EntityCacheImpl.class)); - - if (isLoggingSessionEnabled()) { - if (!sessionFactories.containsKey(LoggingSession.class)) { - LoggingSessionFactory loggingSessionFactory = new LoggingSessionFactory(); - loggingSessionFactory.setLoggingListener(loggingListener); - loggingSessionFactory.setObjectMapper(objectMapper); - sessionFactories.put(LoggingSession.class, loggingSessionFactory); - } - } - - commandContextFactory.setSessionFactories(sessionFactories); - - } else { - if (usingRelationalDatabase) { - initDbSqlSessionFactoryEntitySettings(); - } - } - - if (customSessionFactories != null) { - for (SessionFactory sessionFactory : customSessionFactories) { - addSessionFactory(sessionFactory); - } - } - } - - public void initDbSqlSessionFactory() { - if (dbSqlSessionFactory == null) { - dbSqlSessionFactory = createDbSqlSessionFactory(); - } - dbSqlSessionFactory.setDatabaseType(databaseType); - dbSqlSessionFactory.setSqlSessionFactory(sqlSessionFactory); - dbSqlSessionFactory.setDbHistoryUsed(isDbHistoryUsed); - dbSqlSessionFactory.setDatabaseTablePrefix(databaseTablePrefix); - dbSqlSessionFactory.setTablePrefixIsSchema(tablePrefixIsSchema); - dbSqlSessionFactory.setDatabaseCatalog(databaseCatalog); - dbSqlSessionFactory.setDatabaseSchema(databaseSchema); - dbSqlSessionFactory.setMaxNrOfStatementsInBulkInsert(maxNrOfStatementsInBulkInsert); - - initDbSqlSessionFactoryEntitySettings(); - - addSessionFactory(dbSqlSessionFactory); - } - - public DbSqlSessionFactory createDbSqlSessionFactory() { - return new DbSqlSessionFactory(usePrefixId); - } - - protected abstract void initDbSqlSessionFactoryEntitySettings(); - - protected void defaultInitDbSqlSessionFactoryEntitySettings(List> insertOrder, List> deleteOrder) { - if (insertOrder != null) { - for (Class clazz : insertOrder) { - dbSqlSessionFactory.getInsertionOrder().add(clazz); - - if (isBulkInsertEnabled) { - dbSqlSessionFactory.getBulkInserteableEntityClasses().add(clazz); - } - } - } - - if (deleteOrder != null) { - for (Class clazz : deleteOrder) { - dbSqlSessionFactory.getDeletionOrder().add(clazz); - } - } - } - - public void initTransactionFactory() { - if (transactionFactory == null) { - if (transactionsExternallyManaged) { - transactionFactory = new ManagedTransactionFactory(); - Properties properties = new Properties(); - properties.put("closeConnection", "false"); - this.transactionFactory.setProperties(properties); - } else { - transactionFactory = new JdbcTransactionFactory(); - } - } - } - - public void initSqlSessionFactory() { - if (sqlSessionFactory == null) { - InputStream inputStream = null; - try { - inputStream = getMyBatisXmlConfigurationStream(); - - Environment environment = new Environment("default", transactionFactory, dataSource); - Reader reader = new InputStreamReader(inputStream); - Properties properties = new Properties(); - properties.put("prefix", databaseTablePrefix); - - String wildcardEscapeClause = ""; - if ((databaseWildcardEscapeCharacter != null) && (databaseWildcardEscapeCharacter.length() != 0)) { - wildcardEscapeClause = " escape '" + databaseWildcardEscapeCharacter + "'"; - } - properties.put("wildcardEscapeClause", wildcardEscapeClause); - - // set default properties - properties.put("limitBefore", ""); - properties.put("limitAfter", ""); - properties.put("limitBetween", ""); - properties.put("limitBeforeNativeQuery", ""); - properties.put("limitAfterNativeQuery", ""); - properties.put("blobType", "BLOB"); - properties.put("boolValue", "TRUE"); - - if (databaseType != null) { - properties.load(getResourceAsStream(pathToEngineDbProperties())); - } - - Configuration configuration = initMybatisConfiguration(environment, reader, properties); - sqlSessionFactory = new DefaultSqlSessionFactory(configuration); - - } catch (Exception e) { - throw new FlowableException("Error while building ibatis SqlSessionFactory: " + e.getMessage(), e); - } finally { - IoUtil.closeSilently(inputStream); - } - } else { - // This is needed when the SQL Session Factory is created by another engine. - // When custom XML Mappers are registered with this engine they need to be loaded in the configuration as well - applyCustomMybatisCustomizations(sqlSessionFactory.getConfiguration()); - } - } - - public String pathToEngineDbProperties() { - return "org/flowable/common/db/properties/" + databaseType + ".properties"; - } - - public Configuration initMybatisConfiguration(Environment environment, Reader reader, Properties properties) { - XMLConfigBuilder parser = new XMLConfigBuilder(reader, "", properties); - Configuration configuration = parser.getConfiguration(); - - if (databaseType != null) { - configuration.setDatabaseId(databaseType); - } - - configuration.setEnvironment(environment); - - initMybatisTypeHandlers(configuration); - initCustomMybatisInterceptors(configuration); - if (isEnableLogSqlExecutionTime()) { - initMyBatisLogSqlExecutionTimePlugin(configuration); - } - - configuration = parseMybatisConfiguration(parser); - return configuration; - } - - public void initCustomMybatisMappers(Configuration configuration) { - if (getCustomMybatisMappers() != null) { - for (Class clazz : getCustomMybatisMappers()) { - if (!configuration.hasMapper(clazz)) { - configuration.addMapper(clazz); - } - } - } - } - - public void initMybatisTypeHandlers(Configuration configuration) { - // When mapping into Map there is currently a problem with MyBatis. - // It will return objects which are driver specific. - // Therefore we are registering the mappings between Object.class and the specific jdbc type here. - // see https://github.com/mybatis/mybatis-3/issues/2216 for more info - TypeHandlerRegistry handlerRegistry = configuration.getTypeHandlerRegistry(); - - handlerRegistry.register(Object.class, JdbcType.BOOLEAN, new BooleanTypeHandler()); - handlerRegistry.register(Object.class, JdbcType.BIT, new BooleanTypeHandler()); - - handlerRegistry.register(Object.class, JdbcType.TINYINT, new ByteTypeHandler()); - - handlerRegistry.register(Object.class, JdbcType.SMALLINT, new ShortTypeHandler()); - - handlerRegistry.register(Object.class, JdbcType.INTEGER, new IntegerTypeHandler()); - - handlerRegistry.register(Object.class, JdbcType.FLOAT, new FloatTypeHandler()); - - handlerRegistry.register(Object.class, JdbcType.DOUBLE, new DoubleTypeHandler()); - - handlerRegistry.register(Object.class, JdbcType.CHAR, new StringTypeHandler()); - handlerRegistry.register(Object.class, JdbcType.CLOB, new ClobTypeHandler()); - handlerRegistry.register(Object.class, JdbcType.VARCHAR, new StringTypeHandler()); - handlerRegistry.register(Object.class, JdbcType.LONGVARCHAR, new StringTypeHandler()); - handlerRegistry.register(Object.class, JdbcType.NVARCHAR, new NStringTypeHandler()); - handlerRegistry.register(Object.class, JdbcType.NCHAR, new NStringTypeHandler()); - handlerRegistry.register(Object.class, JdbcType.NCLOB, new NClobTypeHandler()); - - handlerRegistry.register(Object.class, JdbcType.ARRAY, new ArrayTypeHandler()); - - handlerRegistry.register(Object.class, JdbcType.BIGINT, new LongTypeHandler()); - - handlerRegistry.register(Object.class, JdbcType.REAL, new BigDecimalTypeHandler()); - handlerRegistry.register(Object.class, JdbcType.DECIMAL, new BigDecimalTypeHandler()); - handlerRegistry.register(Object.class, JdbcType.NUMERIC, new BigDecimalTypeHandler()); - - handlerRegistry.register(Object.class, JdbcType.BLOB, new BlobInputStreamTypeHandler()); - handlerRegistry.register(Object.class, JdbcType.LONGVARBINARY, new BlobTypeHandler()); - - handlerRegistry.register(Object.class, JdbcType.DATE, new DateOnlyTypeHandler()); - handlerRegistry.register(Object.class, JdbcType.TIME, new TimeOnlyTypeHandler()); - handlerRegistry.register(Object.class, JdbcType.TIMESTAMP, new DateTypeHandler()); - - handlerRegistry.register(Object.class, JdbcType.SQLXML, new SqlxmlTypeHandler()); - } - - public void initCustomMybatisInterceptors(Configuration configuration) { - if (customMybatisInterceptors!=null){ - for (Interceptor interceptor :customMybatisInterceptors){ - configuration.addInterceptor(interceptor); - } - } - } - - public void initMyBatisLogSqlExecutionTimePlugin(Configuration configuration) { - configuration.addInterceptor(new LogSqlExecutionTimePlugin()); - } - - public Configuration parseMybatisConfiguration(XMLConfigBuilder parser) { - Configuration configuration = parser.parse(); - - applyCustomMybatisCustomizations(configuration); - return configuration; - } - - protected void applyCustomMybatisCustomizations(Configuration configuration) { - initCustomMybatisMappers(configuration); - - if (dependentEngineMybatisTypeAliasConfigs != null) { - for (MybatisTypeAliasConfigurator typeAliasConfig : dependentEngineMybatisTypeAliasConfigs) { - typeAliasConfig.configure(configuration.getTypeAliasRegistry()); - } - } - if (dependentEngineMybatisTypeHandlerConfigs != null) { - for (MybatisTypeHandlerConfigurator typeHandlerConfig : dependentEngineMybatisTypeHandlerConfigs) { - typeHandlerConfig.configure(configuration.getTypeHandlerRegistry()); - } - } - - parseDependentEngineMybatisXMLMappers(configuration); - parseCustomMybatisXMLMappers(configuration); - } - - public void parseCustomMybatisXMLMappers(Configuration configuration) { - if (getCustomMybatisXMLMappers() != null) { - for (String resource : getCustomMybatisXMLMappers()) { - parseMybatisXmlMapping(configuration, resource); - } - } - } - - public void parseDependentEngineMybatisXMLMappers(Configuration configuration) { - if (getDependentEngineMyBatisXmlMappers() != null) { - for (String resource : getDependentEngineMyBatisXmlMappers()) { - parseMybatisXmlMapping(configuration, resource); - } - } - } - - protected void parseMybatisXmlMapping(Configuration configuration, String resource) { - // see XMLConfigBuilder.mapperElement() - XMLMapperBuilder mapperParser = new XMLMapperBuilder(getResourceAsStream(resource), configuration, resource, configuration.getSqlFragments()); - mapperParser.parse(); - } - - protected InputStream getResourceAsStream(String resource) { - ClassLoader classLoader = getClassLoader(); - if (classLoader != null) { - return getClassLoader().getResourceAsStream(resource); - } else { - return this.getClass().getClassLoader().getResourceAsStream(resource); - } - } - - public void setMybatisMappingFile(String file) { - this.mybatisMappingFile = file; - } - - public String getMybatisMappingFile() { - return mybatisMappingFile; - } - - public abstract InputStream getMyBatisXmlConfigurationStream(); - - public void initConfigurators() { - - allConfigurators = new ArrayList<>(); - allConfigurators.addAll(getEngineSpecificEngineConfigurators()); - - // Configurators that are explicitly added to the config - if (configurators != null) { - allConfigurators.addAll(configurators); - } - - // Auto discovery through ServiceLoader - if (enableConfiguratorServiceLoader) { - ClassLoader classLoader = getClassLoader(); - if (classLoader == null) { - classLoader = ReflectUtil.getClassLoader(); - } - - ServiceLoader configuratorServiceLoader = ServiceLoader.load(EngineConfigurator.class, classLoader); - int nrOfServiceLoadedConfigurators = 0; - for (EngineConfigurator configurator : configuratorServiceLoader) { - allConfigurators.add(configurator); - nrOfServiceLoadedConfigurators++; - } - - if (nrOfServiceLoadedConfigurators > 0) { - logger.info("Found {} auto-discoverable Process Engine Configurator{}", nrOfServiceLoadedConfigurators, nrOfServiceLoadedConfigurators > 1 ? "s" : ""); - } - - if (!allConfigurators.isEmpty()) { - - // Order them according to the priorities (useful for dependent - // configurator) - allConfigurators.sort(new Comparator() { - - @Override - public int compare(EngineConfigurator configurator1, EngineConfigurator configurator2) { - int priority1 = configurator1.getPriority(); - int priority2 = configurator2.getPriority(); - - if (priority1 < priority2) { - return -1; - } else if (priority1 > priority2) { - return 1; - } - return 0; - } - }); - - // Execute the configurators - logger.info("Found {} Engine Configurators in total:", allConfigurators.size()); - for (EngineConfigurator configurator : allConfigurators) { - logger.info("{} (priority:{})", configurator.getClass(), configurator.getPriority()); - } - - } - - } - } - - public void close() { - if (forceCloseMybatisConnectionPool && dataSource instanceof PooledDataSource) { - /* - * When the datasource is created by a Flowable engine (i.e. it's an instance of PooledDataSource), - * the connection pool needs to be closed when closing the engine. - * Note that calling forceCloseAll() multiple times (as is the case when running with multiple engine) is ok. - */ - ((PooledDataSource) dataSource).forceCloseAll(); - } - } - - protected List getEngineSpecificEngineConfigurators() { - // meant to be overridden if needed - return Collections.emptyList(); - } - - public void configuratorsBeforeInit() { - for (EngineConfigurator configurator : allConfigurators) { - logger.info("Executing beforeInit() of {} (priority:{})", configurator.getClass(), configurator.getPriority()); - configurator.beforeInit(this); - } - } - - public void configuratorsAfterInit() { - for (EngineConfigurator configurator : allConfigurators) { - logger.info("Executing configure() of {} (priority:{})", configurator.getClass(), configurator.getPriority()); - configurator.configure(this); - } - } - - public LockManager getLockManager(String lockName) { - return new LockManagerImpl(commandExecutor, lockName, getLockPollRate(), getEngineCfgKey()); - } - - // getters and setters - // ////////////////////////////////////////////////////// - - public abstract String getEngineName(); - - public ClassLoader getClassLoader() { - return classLoader; - } - - public AbstractEngineConfiguration setClassLoader(ClassLoader classLoader) { - this.classLoader = classLoader; - return this; - } - - public boolean isUseClassForNameClassLoading() { - return useClassForNameClassLoading; - } - - public AbstractEngineConfiguration setUseClassForNameClassLoading(boolean useClassForNameClassLoading) { - this.useClassForNameClassLoading = useClassForNameClassLoading; - return this; - } - - public void addEngineLifecycleListener(EngineLifecycleListener engineLifecycleListener) { - if (this.engineLifecycleListeners == null) { - this.engineLifecycleListeners = new ArrayList<>(); - } - this.engineLifecycleListeners.add(engineLifecycleListener); - } - - public List getEngineLifecycleListeners() { - return engineLifecycleListeners; - } - - public AbstractEngineConfiguration setEngineLifecycleListeners(List engineLifecycleListeners) { - this.engineLifecycleListeners = engineLifecycleListeners; - return this; - } - - public String getDatabaseType() { - return databaseType; - } - - public AbstractEngineConfiguration setDatabaseType(String databaseType) { - this.databaseType = databaseType; - return this; - } - - public DataSource getDataSource() { - return dataSource; - } - - public AbstractEngineConfiguration setDataSource(DataSource dataSource) { - this.dataSource = dataSource; - return this; - } - - public SchemaManager getSchemaManager() { - return schemaManager; - } - - public AbstractEngineConfiguration setSchemaManager(SchemaManager schemaManager) { - this.schemaManager = schemaManager; - return this; - } - - public SchemaManager getCommonSchemaManager() { - return commonSchemaManager; - } - - public AbstractEngineConfiguration setCommonSchemaManager(SchemaManager commonSchemaManager) { - this.commonSchemaManager = commonSchemaManager; - return this; - } - - public Command getSchemaManagementCmd() { - return schemaManagementCmd; - } - - public AbstractEngineConfiguration setSchemaManagementCmd(Command schemaManagementCmd) { - this.schemaManagementCmd = schemaManagementCmd; - return this; - } - - public String getJdbcDriver() { - return jdbcDriver; - } - - public AbstractEngineConfiguration setJdbcDriver(String jdbcDriver) { - this.jdbcDriver = jdbcDriver; - return this; - } - - public String getJdbcUrl() { - return jdbcUrl; - } - - public AbstractEngineConfiguration setJdbcUrl(String jdbcUrl) { - this.jdbcUrl = jdbcUrl; - return this; - } - - public String getJdbcUsername() { - return jdbcUsername; - } - - public AbstractEngineConfiguration setJdbcUsername(String jdbcUsername) { - this.jdbcUsername = jdbcUsername; - return this; - } - - public String getJdbcPassword() { - return jdbcPassword; - } - - public AbstractEngineConfiguration setJdbcPassword(String jdbcPassword) { - this.jdbcPassword = jdbcPassword; - return this; - } - - public int getJdbcMaxActiveConnections() { - return jdbcMaxActiveConnections; - } - - public AbstractEngineConfiguration setJdbcMaxActiveConnections(int jdbcMaxActiveConnections) { - this.jdbcMaxActiveConnections = jdbcMaxActiveConnections; - return this; - } - - public int getJdbcMaxIdleConnections() { - return jdbcMaxIdleConnections; - } - - public AbstractEngineConfiguration setJdbcMaxIdleConnections(int jdbcMaxIdleConnections) { - this.jdbcMaxIdleConnections = jdbcMaxIdleConnections; - return this; - } - - public int getJdbcMaxCheckoutTime() { - return jdbcMaxCheckoutTime; - } - - public AbstractEngineConfiguration setJdbcMaxCheckoutTime(int jdbcMaxCheckoutTime) { - this.jdbcMaxCheckoutTime = jdbcMaxCheckoutTime; - return this; - } - - public int getJdbcMaxWaitTime() { - return jdbcMaxWaitTime; - } - - public AbstractEngineConfiguration setJdbcMaxWaitTime(int jdbcMaxWaitTime) { - this.jdbcMaxWaitTime = jdbcMaxWaitTime; - return this; - } - - public boolean isJdbcPingEnabled() { - return jdbcPingEnabled; - } - - public AbstractEngineConfiguration setJdbcPingEnabled(boolean jdbcPingEnabled) { - this.jdbcPingEnabled = jdbcPingEnabled; - return this; - } - - public int getJdbcPingConnectionNotUsedFor() { - return jdbcPingConnectionNotUsedFor; - } - - public AbstractEngineConfiguration setJdbcPingConnectionNotUsedFor(int jdbcPingConnectionNotUsedFor) { - this.jdbcPingConnectionNotUsedFor = jdbcPingConnectionNotUsedFor; - return this; - } - - public int getJdbcDefaultTransactionIsolationLevel() { - return jdbcDefaultTransactionIsolationLevel; - } - - public AbstractEngineConfiguration setJdbcDefaultTransactionIsolationLevel(int jdbcDefaultTransactionIsolationLevel) { - this.jdbcDefaultTransactionIsolationLevel = jdbcDefaultTransactionIsolationLevel; - return this; - } - - public String getJdbcPingQuery() { - return jdbcPingQuery; - } - - public AbstractEngineConfiguration setJdbcPingQuery(String jdbcPingQuery) { - this.jdbcPingQuery = jdbcPingQuery; - return this; - } - - public String getDataSourceJndiName() { - return dataSourceJndiName; - } - - public AbstractEngineConfiguration setDataSourceJndiName(String dataSourceJndiName) { - this.dataSourceJndiName = dataSourceJndiName; - return this; - } - - public CommandConfig getSchemaCommandConfig() { - return schemaCommandConfig; - } - - public AbstractEngineConfiguration setSchemaCommandConfig(CommandConfig schemaCommandConfig) { - this.schemaCommandConfig = schemaCommandConfig; - return this; - } - - public boolean isTransactionsExternallyManaged() { - return transactionsExternallyManaged; - } - - public AbstractEngineConfiguration setTransactionsExternallyManaged(boolean transactionsExternallyManaged) { - this.transactionsExternallyManaged = transactionsExternallyManaged; - return this; - } - - public Map getBeans() { - return beans; - } - - public AbstractEngineConfiguration setBeans(Map beans) { - this.beans = beans; - return this; - } - - public IdGenerator getIdGenerator() { - return idGenerator; - } - - public AbstractEngineConfiguration setIdGenerator(IdGenerator idGenerator) { - this.idGenerator = idGenerator; - return this; - } - - public boolean isUsePrefixId() { - return usePrefixId; - } - - public AbstractEngineConfiguration setUsePrefixId(boolean usePrefixId) { - this.usePrefixId = usePrefixId; - return this; - } - - public String getXmlEncoding() { - return xmlEncoding; - } - - public AbstractEngineConfiguration setXmlEncoding(String xmlEncoding) { - this.xmlEncoding = xmlEncoding; - return this; - } - - public CommandConfig getDefaultCommandConfig() { - return defaultCommandConfig; - } - - public AbstractEngineConfiguration setDefaultCommandConfig(CommandConfig defaultCommandConfig) { - this.defaultCommandConfig = defaultCommandConfig; - return this; - } - - public CommandExecutor getCommandExecutor() { - return commandExecutor; - } - - public AbstractEngineConfiguration setCommandExecutor(CommandExecutor commandExecutor) { - this.commandExecutor = commandExecutor; - return this; - } - - public CommandContextFactory getCommandContextFactory() { - return commandContextFactory; - } - - public AbstractEngineConfiguration setCommandContextFactory(CommandContextFactory commandContextFactory) { - this.commandContextFactory = commandContextFactory; - return this; - } - - public CommandInterceptor getCommandInvoker() { - return commandInvoker; - } - - public AbstractEngineConfiguration setCommandInvoker(CommandInterceptor commandInvoker) { - this.commandInvoker = commandInvoker; - return this; - } - - public AgendaOperationRunner getAgendaOperationRunner() { - return agendaOperationRunner; - } - - public AbstractEngineConfiguration setAgendaOperationRunner(AgendaOperationRunner agendaOperationRunner) { - this.agendaOperationRunner = agendaOperationRunner; - return this; - } - - public List getCustomPreCommandInterceptors() { - return customPreCommandInterceptors; - } - - public AbstractEngineConfiguration setCustomPreCommandInterceptors(List customPreCommandInterceptors) { - this.customPreCommandInterceptors = customPreCommandInterceptors; - return this; - } - - public List getCustomPostCommandInterceptors() { - return customPostCommandInterceptors; - } - - public AbstractEngineConfiguration setCustomPostCommandInterceptors(List customPostCommandInterceptors) { - this.customPostCommandInterceptors = customPostCommandInterceptors; - return this; - } - - public List getCommandInterceptors() { - return commandInterceptors; - } - - public AbstractEngineConfiguration setCommandInterceptors(List commandInterceptors) { - this.commandInterceptors = commandInterceptors; - return this; - } - - public Map getEngineConfigurations() { - return engineConfigurations; - } - - public AbstractEngineConfiguration setEngineConfigurations(Map engineConfigurations) { - this.engineConfigurations = engineConfigurations; - return this; - } - - public void addEngineConfiguration(String key, String scopeType, AbstractEngineConfiguration engineConfiguration) { - if (engineConfigurations == null) { - engineConfigurations = new HashMap<>(); - } - engineConfigurations.put(key, engineConfiguration); - engineConfigurations.put(scopeType, engineConfiguration); - } - - public Map getServiceConfigurations() { - return serviceConfigurations; - } - - public AbstractEngineConfiguration setServiceConfigurations(Map serviceConfigurations) { - this.serviceConfigurations = serviceConfigurations; - return this; - } - - public void addServiceConfiguration(String key, AbstractServiceConfiguration serviceConfiguration) { - if (serviceConfigurations == null) { - serviceConfigurations = new HashMap<>(); - } - serviceConfigurations.put(key, serviceConfiguration); - } - - public Map getEventRegistryEventConsumers() { - return eventRegistryEventConsumers; - } - - public AbstractEngineConfiguration setEventRegistryEventConsumers(Map eventRegistryEventConsumers) { - this.eventRegistryEventConsumers = eventRegistryEventConsumers; - return this; - } - - public void addEventRegistryEventConsumer(String key, EventRegistryEventConsumer eventRegistryEventConsumer) { - if (eventRegistryEventConsumers == null) { - eventRegistryEventConsumers = new HashMap<>(); - } - eventRegistryEventConsumers.put(key, eventRegistryEventConsumer); - } - - public AbstractEngineConfiguration setDefaultCommandInterceptors(Collection defaultCommandInterceptors) { - this.defaultCommandInterceptors = defaultCommandInterceptors; - return this; - } - - public SqlSessionFactory getSqlSessionFactory() { - return sqlSessionFactory; - } - - public AbstractEngineConfiguration setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) { - this.sqlSessionFactory = sqlSessionFactory; - return this; - } - - public boolean isDbHistoryUsed() { - return isDbHistoryUsed; - } - - public AbstractEngineConfiguration setDbHistoryUsed(boolean isDbHistoryUsed) { - this.isDbHistoryUsed = isDbHistoryUsed; - return this; - } - - public DbSqlSessionFactory getDbSqlSessionFactory() { - return dbSqlSessionFactory; - } - - public AbstractEngineConfiguration setDbSqlSessionFactory(DbSqlSessionFactory dbSqlSessionFactory) { - this.dbSqlSessionFactory = dbSqlSessionFactory; - return this; - } - - public TransactionFactory getTransactionFactory() { - return transactionFactory; - } - - public AbstractEngineConfiguration setTransactionFactory(TransactionFactory transactionFactory) { - this.transactionFactory = transactionFactory; - return this; - } - - public TransactionContextFactory getTransactionContextFactory() { - return transactionContextFactory; - } - - public AbstractEngineConfiguration setTransactionContextFactory(TransactionContextFactory transactionContextFactory) { - this.transactionContextFactory = transactionContextFactory; - return this; - } - - public int getMaxNrOfStatementsInBulkInsert() { - return maxNrOfStatementsInBulkInsert; - } - - public AbstractEngineConfiguration setMaxNrOfStatementsInBulkInsert(int maxNrOfStatementsInBulkInsert) { - this.maxNrOfStatementsInBulkInsert = maxNrOfStatementsInBulkInsert; - return this; - } - - public boolean isBulkInsertEnabled() { - return isBulkInsertEnabled; - } - - public AbstractEngineConfiguration setBulkInsertEnabled(boolean isBulkInsertEnabled) { - this.isBulkInsertEnabled = isBulkInsertEnabled; - return this; - } - - public Set> getCustomMybatisMappers() { - return customMybatisMappers; - } - - public AbstractEngineConfiguration setCustomMybatisMappers(Set> customMybatisMappers) { - this.customMybatisMappers = customMybatisMappers; - return this; - } - - public Set getCustomMybatisXMLMappers() { - return customMybatisXMLMappers; - } - - public AbstractEngineConfiguration setCustomMybatisXMLMappers(Set customMybatisXMLMappers) { - this.customMybatisXMLMappers = customMybatisXMLMappers; - return this; - } - - public Set getDependentEngineMyBatisXmlMappers() { - return dependentEngineMyBatisXmlMappers; - } - - public AbstractEngineConfiguration setCustomMybatisInterceptors(List customMybatisInterceptors) { - this.customMybatisInterceptors = customMybatisInterceptors; - return this; - } - - public List getCustomMybatisInterceptors() { - return customMybatisInterceptors; - } - - public AbstractEngineConfiguration setDependentEngineMyBatisXmlMappers(Set dependentEngineMyBatisXmlMappers) { - this.dependentEngineMyBatisXmlMappers = dependentEngineMyBatisXmlMappers; - return this; - } - - public List getDependentEngineMybatisTypeAliasConfigs() { - return dependentEngineMybatisTypeAliasConfigs; - } - - public AbstractEngineConfiguration setDependentEngineMybatisTypeAliasConfigs(List dependentEngineMybatisTypeAliasConfigs) { - this.dependentEngineMybatisTypeAliasConfigs = dependentEngineMybatisTypeAliasConfigs; - return this; - } - - public List getDependentEngineMybatisTypeHandlerConfigs() { - return dependentEngineMybatisTypeHandlerConfigs; - } - - public AbstractEngineConfiguration setDependentEngineMybatisTypeHandlerConfigs(List dependentEngineMybatisTypeHandlerConfigs) { - this.dependentEngineMybatisTypeHandlerConfigs = dependentEngineMybatisTypeHandlerConfigs; - return this; - } - - public List getCustomSessionFactories() { - return customSessionFactories; - } - - public AbstractEngineConfiguration addCustomSessionFactory(SessionFactory sessionFactory) { - if (customSessionFactories == null) { - customSessionFactories = new ArrayList<>(); - } - customSessionFactories.add(sessionFactory); - return this; - } - - public AbstractEngineConfiguration setCustomSessionFactories(List customSessionFactories) { - this.customSessionFactories = customSessionFactories; - return this; - } - - public boolean isUsingRelationalDatabase() { - return usingRelationalDatabase; - } - - public AbstractEngineConfiguration setUsingRelationalDatabase(boolean usingRelationalDatabase) { - this.usingRelationalDatabase = usingRelationalDatabase; - return this; - } - - public boolean isUsingSchemaMgmt() { - return usingSchemaMgmt; - } - - public AbstractEngineConfiguration setUsingSchemaMgmt(boolean usingSchema) { - this.usingSchemaMgmt = usingSchema; - return this; - } - - public String getDatabaseTablePrefix() { - return databaseTablePrefix; - } - - public AbstractEngineConfiguration setDatabaseTablePrefix(String databaseTablePrefix) { - this.databaseTablePrefix = databaseTablePrefix; - return this; - } - - public String getDatabaseWildcardEscapeCharacter() { - return databaseWildcardEscapeCharacter; - } - - public AbstractEngineConfiguration setDatabaseWildcardEscapeCharacter(String databaseWildcardEscapeCharacter) { - this.databaseWildcardEscapeCharacter = databaseWildcardEscapeCharacter; - return this; - } - - public String getDatabaseCatalog() { - return databaseCatalog; - } - - public AbstractEngineConfiguration setDatabaseCatalog(String databaseCatalog) { - this.databaseCatalog = databaseCatalog; - return this; - } - - public String getDatabaseSchema() { - return databaseSchema; - } - - public AbstractEngineConfiguration setDatabaseSchema(String databaseSchema) { - this.databaseSchema = databaseSchema; - return this; - } - - public boolean isTablePrefixIsSchema() { - return tablePrefixIsSchema; - } - - public AbstractEngineConfiguration setTablePrefixIsSchema(boolean tablePrefixIsSchema) { - this.tablePrefixIsSchema = tablePrefixIsSchema; - return this; - } - - public boolean isAlwaysLookupLatestDefinitionVersion() { - return alwaysLookupLatestDefinitionVersion; - } - - public AbstractEngineConfiguration setAlwaysLookupLatestDefinitionVersion(boolean alwaysLookupLatestDefinitionVersion) { - this.alwaysLookupLatestDefinitionVersion = alwaysLookupLatestDefinitionVersion; - return this; - } - - public boolean isFallbackToDefaultTenant() { - return fallbackToDefaultTenant; - } - - public AbstractEngineConfiguration setFallbackToDefaultTenant(boolean fallbackToDefaultTenant) { - this.fallbackToDefaultTenant = fallbackToDefaultTenant; - return this; - } - - /** - * @return name of the default tenant - * @deprecated use {@link AbstractEngineConfiguration#getDefaultTenantProvider()} instead - */ - @Deprecated - public String getDefaultTenantValue() { - return getDefaultTenantProvider().getDefaultTenant(null, null, null); - } - - public AbstractEngineConfiguration setDefaultTenantValue(String defaultTenantValue) { - this.defaultTenantProvider = (tenantId, scope, scopeKey) -> defaultTenantValue; - return this; - } - - public DefaultTenantProvider getDefaultTenantProvider() { - return defaultTenantProvider; - } - - public AbstractEngineConfiguration setDefaultTenantProvider(DefaultTenantProvider defaultTenantProvider) { - this.defaultTenantProvider = defaultTenantProvider; - return this; - } - - public boolean isEnableLogSqlExecutionTime() { - return enableLogSqlExecutionTime; - } - - public void setEnableLogSqlExecutionTime(boolean enableLogSqlExecutionTime) { - this.enableLogSqlExecutionTime = enableLogSqlExecutionTime; - } - - public Map, SessionFactory> getSessionFactories() { - return sessionFactories; - } - - public AbstractEngineConfiguration setSessionFactories(Map, SessionFactory> sessionFactories) { - this.sessionFactories = sessionFactories; - return this; - } - - public String getDatabaseSchemaUpdate() { - return databaseSchemaUpdate; - } - - public AbstractEngineConfiguration setDatabaseSchemaUpdate(String databaseSchemaUpdate) { - this.databaseSchemaUpdate = databaseSchemaUpdate; - return this; - } - - public boolean isUseLockForDatabaseSchemaUpdate() { - return useLockForDatabaseSchemaUpdate; - } - - public AbstractEngineConfiguration setUseLockForDatabaseSchemaUpdate(boolean useLockForDatabaseSchemaUpdate) { - this.useLockForDatabaseSchemaUpdate = useLockForDatabaseSchemaUpdate; - return this; - } - - public boolean isEnableEventDispatcher() { - return enableEventDispatcher; - } - - public AbstractEngineConfiguration setEnableEventDispatcher(boolean enableEventDispatcher) { - this.enableEventDispatcher = enableEventDispatcher; - return this; - } - - public FlowableEventDispatcher getEventDispatcher() { - return eventDispatcher; - } - - public AbstractEngineConfiguration setEventDispatcher(FlowableEventDispatcher eventDispatcher) { - this.eventDispatcher = eventDispatcher; - return this; - } - - public List getEventListeners() { - return eventListeners; - } - - public AbstractEngineConfiguration setEventListeners(List eventListeners) { - this.eventListeners = eventListeners; - return this; - } - - public Map> getTypedEventListeners() { - return typedEventListeners; - } - - public AbstractEngineConfiguration setTypedEventListeners(Map> typedEventListeners) { - this.typedEventListeners = typedEventListeners; - return this; - } - - public List getAdditionalEventDispatchActions() { - return additionalEventDispatchActions; - } - - public AbstractEngineConfiguration setAdditionalEventDispatchActions(List additionalEventDispatchActions) { - this.additionalEventDispatchActions = additionalEventDispatchActions; - return this; - } - - public void initEventDispatcher() { - if (this.eventDispatcher == null) { - this.eventDispatcher = new FlowableEventDispatcherImpl(); - } - - initAdditionalEventDispatchActions(); - - this.eventDispatcher.setEnabled(enableEventDispatcher); - - initEventListeners(); - initTypedEventListeners(); - } - - protected void initEventListeners() { - if (eventListeners != null) { - for (FlowableEventListener listenerToAdd : eventListeners) { - this.eventDispatcher.addEventListener(listenerToAdd); - } - } - } - - protected void initAdditionalEventDispatchActions() { - if (this.additionalEventDispatchActions == null) { - this.additionalEventDispatchActions = new ArrayList<>(); - } - } - - protected void initTypedEventListeners() { - if (typedEventListeners != null) { - for (Map.Entry> listenersToAdd : typedEventListeners.entrySet()) { - // Extract types from the given string - FlowableEngineEventType[] types = FlowableEngineEventType.getTypesFromString(listenersToAdd.getKey()); - - for (FlowableEventListener listenerToAdd : listenersToAdd.getValue()) { - this.eventDispatcher.addEventListener(listenerToAdd, types); - } - } - } - } - - public boolean isLoggingSessionEnabled() { - return loggingListener != null; - } - - public LoggingListener getLoggingListener() { - return loggingListener; - } - - public void setLoggingListener(LoggingListener loggingListener) { - this.loggingListener = loggingListener; - } - - public Clock getClock() { - return clock; - } - - public AbstractEngineConfiguration setClock(Clock clock) { - this.clock = clock; - return this; - } - - public ObjectMapper getObjectMapper() { - return objectMapper; - } - - public AbstractEngineConfiguration setObjectMapper(ObjectMapper objectMapper) { - this.objectMapper = objectMapper; - return this; - } - - public int getMaxLengthString() { - if (maxLengthStringVariableType == -1) { - if ("oracle".equalsIgnoreCase(databaseType)) { - return DEFAULT_ORACLE_MAX_LENGTH_STRING; - } else { - return DEFAULT_GENERIC_MAX_LENGTH_STRING; - } - } else { - return maxLengthStringVariableType; - } - } - - public int getMaxLengthStringVariableType() { - return maxLengthStringVariableType; - } - - public AbstractEngineConfiguration setMaxLengthStringVariableType(int maxLengthStringVariableType) { - this.maxLengthStringVariableType = maxLengthStringVariableType; - return this; - } - - public PropertyDataManager getPropertyDataManager() { - return propertyDataManager; - } - - public Duration getLockPollRate() { - return lockPollRate; - } - - public AbstractEngineConfiguration setLockPollRate(Duration lockPollRate) { - this.lockPollRate = lockPollRate; - return this; - } - - public Duration getSchemaLockWaitTime() { - return schemaLockWaitTime; - } - - public void setSchemaLockWaitTime(Duration schemaLockWaitTime) { - this.schemaLockWaitTime = schemaLockWaitTime; - } - - public AbstractEngineConfiguration setPropertyDataManager(PropertyDataManager propertyDataManager) { - this.propertyDataManager = propertyDataManager; - return this; - } - - public PropertyEntityManager getPropertyEntityManager() { - return propertyEntityManager; - } - - public AbstractEngineConfiguration setPropertyEntityManager(PropertyEntityManager propertyEntityManager) { - this.propertyEntityManager = propertyEntityManager; - return this; - } - - public ByteArrayDataManager getByteArrayDataManager() { - return byteArrayDataManager; - } - - public AbstractEngineConfiguration setByteArrayDataManager(ByteArrayDataManager byteArrayDataManager) { - this.byteArrayDataManager = byteArrayDataManager; - return this; - } - - public ByteArrayEntityManager getByteArrayEntityManager() { - return byteArrayEntityManager; - } - - public AbstractEngineConfiguration setByteArrayEntityManager(ByteArrayEntityManager byteArrayEntityManager) { - this.byteArrayEntityManager = byteArrayEntityManager; - return this; - } - - public TableDataManager getTableDataManager() { - return tableDataManager; - } - - public AbstractEngineConfiguration setTableDataManager(TableDataManager tableDataManager) { - this.tableDataManager = tableDataManager; - return this; - } - - public List getDeployers() { - return deployers; - } - - public AbstractEngineConfiguration setDeployers(List deployers) { - this.deployers = deployers; - return this; - } - - public List getCustomPreDeployers() { - return customPreDeployers; - } - - public AbstractEngineConfiguration setCustomPreDeployers(List customPreDeployers) { - this.customPreDeployers = customPreDeployers; - return this; - } - - public List getCustomPostDeployers() { - return customPostDeployers; - } - - public AbstractEngineConfiguration setCustomPostDeployers(List customPostDeployers) { - this.customPostDeployers = customPostDeployers; - return this; - } - - public boolean isEnableConfiguratorServiceLoader() { - return enableConfiguratorServiceLoader; - } - - public AbstractEngineConfiguration setEnableConfiguratorServiceLoader(boolean enableConfiguratorServiceLoader) { - this.enableConfiguratorServiceLoader = enableConfiguratorServiceLoader; - return this; - } - - public List getConfigurators() { - return configurators; - } - - public AbstractEngineConfiguration addConfigurator(EngineConfigurator configurator) { - if (configurators == null) { - configurators = new ArrayList<>(); - } - configurators.add(configurator); - return this; - } - - /** - * @return All {@link EngineConfigurator} instances. Will only contain values after init of the engine. - * Use the {@link #getConfigurators()} or {@link #addConfigurator(EngineConfigurator)} methods otherwise. - */ - public List getAllConfigurators() { - return allConfigurators; - } - - public AbstractEngineConfiguration setConfigurators(List configurators) { - this.configurators = configurators; - return this; - } - - public EngineConfigurator getIdmEngineConfigurator() { - return idmEngineConfigurator; - } - - public AbstractEngineConfiguration setIdmEngineConfigurator(EngineConfigurator idmEngineConfigurator) { - this.idmEngineConfigurator = idmEngineConfigurator; - return this; - } - - public EngineConfigurator getEventRegistryConfigurator() { - return eventRegistryConfigurator; - } - - public AbstractEngineConfiguration setEventRegistryConfigurator(EngineConfigurator eventRegistryConfigurator) { - this.eventRegistryConfigurator = eventRegistryConfigurator; - return this; - } - - public AbstractEngineConfiguration setForceCloseMybatisConnectionPool(boolean forceCloseMybatisConnectionPool) { - this.forceCloseMybatisConnectionPool = forceCloseMybatisConnectionPool; - return this; - } - - public boolean isForceCloseMybatisConnectionPool() { - return forceCloseMybatisConnectionPool; - } -} diff --git a/io.sc.platform.flowable/src/main/resources/META-INF/spring.factories b/io.sc.platform.flowable/src/main/resources/META-INF/spring.factories index 6ca53dc2..287fdd84 100644 --- a/io.sc.platform.flowable/src/main/resources/META-INF/spring.factories +++ b/io.sc.platform.flowable/src/main/resources/META-INF/spring.factories @@ -1,3 +1,7 @@ # Auto Configuration #org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ -#org.wsp.framework.flowable.autoconfigure.FlowableAutoConfiguration \ No newline at end of file +#org.wsp.framework.flowable.autoconfigure.FlowableAutoConfiguration + +# javassist spi service +io.sc.platform.core.spi.JavassistSpiService=\ +io.sc.platform.flowable.spi.javassist.AbstractEngineConfiguration \ No newline at end of file diff --git a/io.sc.platform.gradle/templates/pgp/setup/gradle.properties b/io.sc.platform.gradle/templates/pgp/setup/gradle.properties index 614e47c0..a6275399 100644 --- a/io.sc.platform.gradle/templates/pgp/setup/gradle.properties +++ b/io.sc.platform.gradle/templates/pgp/setup/gradle.properties @@ -36,9 +36,9 @@ application_version=1.0.0 # platform ######################################gra##################### platform_group=io.sc -platform_version=8.2.2 -platform_plugin_version=8.2.2 -platform_core_frontend_version=8.2.8 +platform_version=8.2.3 +platform_plugin_version=8.2.3 +platform_core_frontend_version=8.2.14 ########################################################### # dependencies version diff --git a/io.sc.platform.jdbc.driver/build.gradle b/io.sc.platform.jdbc.driver/build.gradle new file mode 100644 index 00000000..afcd86d4 --- /dev/null +++ b/io.sc.platform.jdbc.driver/build.gradle @@ -0,0 +1,14 @@ +dependencies { + api( + project(":io.sc.platform.jdbc.driver.db2"), + project(":io.sc.platform.jdbc.driver.dm"), + project(":io.sc.platform.jdbc.driver.h2"), + project(":io.sc.platform.jdbc.driver.mysql"), + project(":io.sc.platform.jdbc.driver.oceanbase-mysql"), + project(":io.sc.platform.jdbc.driver.oceanbase-oracle"), + project(":io.sc.platform.jdbc.driver.oracle"), + project(":io.sc.platform.jdbc.driver.postgresql"), + project(":io.sc.platform.jdbc.driver.sqlite"), + project(":io.sc.platform.jdbc.driver.tidb"), + ) +} \ No newline at end of file diff --git a/io.sc.platform.lcdp.frontend/package.json b/io.sc.platform.lcdp.frontend/package.json index 66acc042..fc2e7a91 100644 --- a/io.sc.platform.lcdp.frontend/package.json +++ b/io.sc.platform.lcdp.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.platform.lcdp.frontend", - "version": "8.2.2", + "version": "8.2.3", "description": "", "private": false, "keywords": [], @@ -111,7 +111,7 @@ "node-sql-parser": "5.3.4", "pinia": "2.2.6", "pinia-undo": "0.2.4", - "platform-core": "8.2.10", + "platform-core": "8.2.14", "quasar": "2.17.4", "sort-array": "5.0.0", "svg-path-commander": "2.1.5", @@ -122,4 +122,4 @@ "vue-router": "4.5.0", "xml-formatter": "3.6.3" } -} +} \ No newline at end of file diff --git a/io.sc.platform.license.keygen.frontend/package.json b/io.sc.platform.license.keygen.frontend/package.json index 60787e48..f600b7d2 100644 --- a/io.sc.platform.license.keygen.frontend/package.json +++ b/io.sc.platform.license.keygen.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.platform.license.keygen.frontend", - "version": "8.2.2", + "version": "8.2.3", "description": "", "private": false, "keywords": [], @@ -111,7 +111,7 @@ "node-sql-parser": "5.3.4", "pinia": "2.2.6", "pinia-undo": "0.2.4", - "platform-core": "8.2.8", + "platform-core": "8.2.14", "quasar": "2.17.4", "sort-array": "5.0.0", "svg-path-commander": "2.1.5", diff --git a/io.sc.platform.license.keygen/src/main/java/io/sc/platform/license/keygen/service/impl/LicenseKeyGeneratorServiceImpl.java b/io.sc.platform.license.keygen/src/main/java/io/sc/platform/license/keygen/service/impl/LicenseKeyGeneratorServiceImpl.java index bdfddad5..ac057fc8 100644 --- a/io.sc.platform.license.keygen/src/main/java/io/sc/platform/license/keygen/service/impl/LicenseKeyGeneratorServiceImpl.java +++ b/io.sc.platform.license.keygen/src/main/java/io/sc/platform/license/keygen/service/impl/LicenseKeyGeneratorServiceImpl.java @@ -17,6 +17,7 @@ import java.io.ByteArrayInputStream; import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.util.Base64; +import java.util.Date; @Service("io.sc.platform.license.keygen.service.impl.LicenseKeyGeneratorServiceImpl") public class LicenseKeyGeneratorServiceImpl implements LicenseKeyGeneratorService { @@ -32,6 +33,7 @@ public class LicenseKeyGeneratorServiceImpl implements LicenseKeyGeneratorServic license.setConsumerName(entity.getConsumerName()); license.setDescription(entity.getDescription()); license.setType(entity.getType()); + license.setIssuedDate(new Date()); license.setExpiredDate(entity.getExpiredDate()); license.setTerm(entity.getTerm()); license.setMacAddresses(entity.getMacAddresses().replace("-",":")); diff --git a/io.sc.platform.mvc.frontend/package.json b/io.sc.platform.mvc.frontend/package.json index a4a6ce3a..91a5020a 100644 --- a/io.sc.platform.mvc.frontend/package.json +++ b/io.sc.platform.mvc.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.platform.mvc.frontend", - "version": "8.2.2", + "version": "8.2.3", "description": "", "private": false, "keywords": [], @@ -111,7 +111,7 @@ "node-sql-parser": "5.3.4", "pinia": "2.2.6", "pinia-undo": "0.2.4", - "platform-core": "8.2.10", + "platform-core": "8.2.14", "quasar": "2.17.4", "sort-array": "5.0.0", "svg-path-commander": "2.1.5", diff --git a/io.sc.platform.scheduler.manager.frontend/package.json b/io.sc.platform.scheduler.manager.frontend/package.json index bde7177b..469a244b 100644 --- a/io.sc.platform.scheduler.manager.frontend/package.json +++ b/io.sc.platform.scheduler.manager.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.platform.scheduler.manager.frontend", - "version": "8.2.2", + "version": "8.2.3", "description": "", "private": false, "keywords": [], @@ -111,7 +111,7 @@ "node-sql-parser": "5.3.4", "pinia": "2.2.6", "pinia-undo": "0.2.4", - "platform-core": "8.2.8", + "platform-core": "8.2.14", "quasar": "2.17.4", "sort-array": "5.0.0", "svg-path-commander": "2.1.5", diff --git a/io.sc.platform.system.frontend/package.json b/io.sc.platform.system.frontend/package.json index 81b167a7..5271b500 100644 --- a/io.sc.platform.system.frontend/package.json +++ b/io.sc.platform.system.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.platform.system.frontend", - "version": "8.2.2", + "version": "8.2.3", "description": "", "private": false, "keywords": [], @@ -110,7 +110,7 @@ "mockjs": "1.1.0", "node-sql-parser": "5.3.4", "pinia": "2.2.6", - "platform-core": "8.2.10", + "platform-core": "8.2.14", "quasar": "2.17.4", "sort-array": "5.0.0", "svg-path-commander": "2.1.5", @@ -120,4 +120,4 @@ "vue-router": "4.5.0", "xml-formatter": "3.6.3" } -} +} \ No newline at end of file diff --git a/io.sc.platform.util/src/main/java/io/sc/platform/util/MapUtil.java b/io.sc.platform.util/src/main/java/io/sc/platform/util/MapUtil.java new file mode 100644 index 00000000..60945b6e --- /dev/null +++ b/io.sc.platform.util/src/main/java/io/sc/platform/util/MapUtil.java @@ -0,0 +1,20 @@ +package io.sc.platform.util; + +import io.sc.platform.util.support.KV; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +public class MapUtil { + public static Map of(KV... kvs){ + if(kvs==null || kvs.length==0){ + return Collections.emptyMap(); + } + Map map =new HashMap<>(); + for(KV kv : kvs){ + map.put(kv.key,kv.value); + } + return map; + } +} diff --git a/io.sc.platform.util/src/main/java/io/sc/platform/util/TypeConvertor.java b/io.sc.platform.util/src/main/java/io/sc/platform/util/TypeConvertor.java index 97edbfc2..fbea8fea 100644 --- a/io.sc.platform.util/src/main/java/io/sc/platform/util/TypeConvertor.java +++ b/io.sc.platform.util/src/main/java/io/sc/platform/util/TypeConvertor.java @@ -1,5 +1,6 @@ package io.sc.platform.util; +import org.springframework.core.convert.ConverterNotFoundException; import org.springframework.core.convert.support.DefaultConversionService; import org.springframework.util.StringUtils; @@ -9,6 +10,24 @@ import org.springframework.util.StringUtils; public class TypeConvertor { private TypeConvertor(){} + /** + * 将对象转换成所需类型值 + * @param object 对象 + * @param targetType 目标类型 + * @return 转换后的值 + * @param 泛型 + */ + public static T getValue(Object object, Class targetType){ + if(object!=null){ + if(targetType.isAssignableFrom(object.getClass())){ + return (T)object; + }else{ + return getValue(object.toString(),targetType); + } + } + return null; + } + /** * 将字符串转换成所需类型值 * @param string 字符串 @@ -18,7 +37,15 @@ public class TypeConvertor { */ public static T getValue(String string, Class targetType){ if(StringUtils.hasText(string)) { - return DefaultConversionService.getSharedInstance().convert(string, targetType); + try { + return DefaultConversionService.getSharedInstance().convert(string, targetType); + }catch (ConverterNotFoundException e){ + try { + return ObjectMapperUtil.json().readValue(string, targetType); + }catch (Exception e1){ + return null; + } + } } return null; } diff --git a/io.sc.platform.util/src/main/java/io/sc/platform/util/support/KV.java b/io.sc.platform.util/src/main/java/io/sc/platform/util/support/KV.java new file mode 100644 index 00000000..1cb7d0ea --- /dev/null +++ b/io.sc.platform.util/src/main/java/io/sc/platform/util/support/KV.java @@ -0,0 +1,13 @@ +package io.sc.platform.util.support; + +public class KV { + public K key; + public V value; + + private KV(){} + + public KV(K key, V value){ + this.key =key; + this.value =value; + } +} diff --git a/io.sc.standard.frontend/package.json b/io.sc.standard.frontend/package.json index 01dbee21..7b446592 100644 --- a/io.sc.standard.frontend/package.json +++ b/io.sc.standard.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.standard.frontend", - "version": "8.2.2", + "version": "8.2.3", "description": "", "private": false, "keywords": [], @@ -111,7 +111,7 @@ "node-sql-parser": "5.3.4", "pinia": "2.2.6", "pinia-undo": "0.2.4", - "platform-core": "8.2.8", + "platform-core": "8.2.14", "quasar": "2.17.4", "sort-array": "5.0.0", "svg-path-commander": "2.1.5", diff --git a/io.sc.standard/src/main/resources/standard/二代征信报告报文示例(个人).xml b/io.sc.standard/src/main/resources/standard/二代征信报告报文示例(个人).xml new file mode 100644 index 00000000..e11a1d9d --- /dev/null +++ b/io.sc.standard/src/main/resources/standard/二代征信报告报文示例(个人).xml @@ -0,0 +1,3337 @@ + + + + + 2019021408350416551574 + 2019-02-14T08:35:04 + + + ��ijij + 10 + 11010819931010444X + T10152521H0001 + 01 + + + + + + + + + 0 + + + + + + + 1 + 1981-08-15 + 20 + 4 + 91 + zhang15@hotmail.com + 北京市西城区金融大街35号国际企业大厦A座301室 + CHN + 北京市朝阳区春晓园北区7号楼C522室 + + + 5 + + 13811117777 + 2018-10-01 + + + 13811112222 + 2018-09-22 + + + 13900000000 + 2017-02-01 + + + 13300000000 + 2017-01-22 + + + 18600000000 + 2016-11-12 + + + + + + + 20 + 李金花 + 8 + 12356000000888 + 三星电子北京分公司财务部 + 13800003333 + + + + + 2 + 北京市朝阳区春晓园北区7号楼C555室 + 010-83234323 + 2018-10-01 + + + 4 + 北京市海淀区学院路20号院甲2号楼401室 + 010-62123212 + 2018-09-22 + + + 5 + 北京市西城区复兴门北大街4号楼603室 + 010-59873232 + 2017-02-01 + + + 5 + 北京市西城区西交民巷64号院1号楼201室 + 010-59000011 + 2017-01-22 + + + 5 + 北京市海淀区花园路10号院3号楼701室 + 010-57889900 + 2016-11-12 + + + + + 91 + 中国人民银行征信中心企业部 + 10 + J + 北京市西城区金融大街35号国际企业大厦A座305室 + 010-83233333 + 3 + 2 + 2 + 2008 + 2018-10-01 + + + 91 + 北京大学信息科学技术学院软件工程研究所 + 10 + M + 北京市海淀区颐和园路5号理科3号楼601室 + 010-62123333 + 1 + 2 + 2 + 2007 + 2018-09-22 + + + 91 + 中科院微电子研究所 + 10 + M + 北京市海淀区清华园1号 + 010-59875555 + 1 + 3 + 3 + 2004 + 2017-02-01 + + + 91 + 北京威力公司 + 40 + M + 北京市朝阳区北土城西路3号 + 010-59006666 + 1 + 3 + 3 + 2003 + 2017-01-22 + + + 91 + IBM软件中心 + 30 + M + 北京市朝阳区北辰东路8号 + 010-57889900 + 1 + 3 + 3 + 2001 + 2016-11-12 + + + + + + + + + 7 + 4 + + 11 + 1 + 2 + 2010-01 + + + 19 + 1 + 2 + 2014-09 + + + 21 + 2 + 2 + 2009-05 + + + 22 + 2 + 1 + 2009-05 + + + + 1 + 0 + 1 + + 2 + 1 + 0 + + + + 1 + 17100 + + + 5 + + 1 + 1 + 2 + 6100 + 2 + + + 2 + 1 + 2 + 6000 + 1 + + + 3 + 1 + 2 + 6100 + 2 + + + 4 + 1 + 8 + 24550 + 7 + + + 5 + 1 + 1 + 1000 + 3 + + + + 1 + 2 + 860000 + 417100 + 6000 + + + 1 + 1 + 1200000 + 40000 + 2000 + + + 1 + 1 + 70000 + 30000 + 5000 + + + 1 + 2 + 190000 + 160000 + 160000 + 135500 + 90000 + + + 1 + 1 + 16000 + 16000 + 16000 + 1000 + 1000 + + + 2 + + 1 + 1 + 2 + 220000 + 110000 + + + 2 + 1 + 1 + 1375838 + 687919 + + + + + + + 1 + + 1 + 1 + 1000 + + + + + + 4 + + 1 + 1 + 500 + + + 2 + 1 + 500000 + + + 3 + 1 + 420000 + + + 4 + 2 + 400 + + + + + + + 2019-02-13 + 11 + UV + 02 + + + 11 + 8 + 16 + 14 + 0 + 39 + 1 + 5 + + + + + + + 37745 + 11 + SR + Q705 + 31 + 16000 + CNY + 2009-04-01 + 2099-12-31 + 1 + 1000 + + + + + + + 96537 + 11 + SR + I211 + 31 + 30000 + CNY + 2017-04-01 + 2099-12-31 + 1 + 0 + + + + + + + 66837 + 11 + SR + F954 + 10 + 1200000 + USD + 2012-10-01 + 2020-01-31 + 1 + 40000 + + + + + + + 95604 + 11 + SR + J639 + 31 + 160000 + CNY + 2009-05-01 + 2099-12-31 + 1 + 135500 + + + + + + + 96085 + 11 + SR + H157 + 10 + 70000 + USD + 2014-09-01 + 2019-01-31 + 1 + 30000 + + + + + + + 97098 + 11 + SR + F645 + 20 + 500000 + USD + 2010-09-01 + 2020-01-31 + 1 + 500000 + 100000 + R134 + + + + + + + 55165 + C1 + 53 + YO + B1 + 2007-11-08 + 10000 + 2 + + + 2 + 2018-01-20 + + + 2018-01-20 + + + 1 + + 2 + 2018-01-20 + 0 + 10000 + 该贷款由XX公司代偿10,000元 + + + + + + 73655 + D1 + 11 + SR + + + 11 + 2010-01-22 + CNY + 360000 + 2020-01-19 + 12 + 03 + 180 + 2 + 1 + 1 + + + 4 + + + 17100 + 2018-10-25 + + + + 2018-10-25 + + + 2016-11 + 2018-10 + + 2018-10 + B + + + 2018-09 + B + + + 2018-08 + B + + + 2018-07 + B + + + 2018-06 + B + + + 2018-05 + B + + + 2018-04 + B + + + 2018-03 + B + + + 2018-02 + B + + + 2018-01 + B + + + 2017-12 + B + + + 2017-11 + B + + + 2017-10 + B + + + 2017-09 + B + + + 2017-08 + B + + + 2017-07 + B + + + 2017-06 + B + + + 2017-05 + B + + + 2017-04 + B + + + 2017-03 + B + + + 2017-02 + B + + + 2017-01 + B + + + 2016-12 + B + + + 2016-11 + B + + + + 2014-03 + 2018-10 + 56 + + 2018-10 + B + 17100 + + + 2018-09 + B + 17000 + + + 2018-08 + B + 16900 + + + 2018-07 + B + 16800 + + + 2018-06 + B + 16700 + + + 2018-05 + B + 16600 + + + 2018-04 + B + 16500 + + + 2018-03 + B + 16400 + + + 2018-02 + B + 16300 + + + 2018-01 + B + 16200 + + + 2017-12 + B + 16200 + + + 2017-11 + B + 16200 + + + 2017-10 + B + 16200 + + + 2017-09 + B + 16200 + + + 2017-08 + B + 16200 + + + 2017-07 + B + 16200 + + + 2017-06 + B + 16200 + + + 2017-05 + B + 16200 + + + 2017-04 + B + 16200 + + + 2017-03 + B + 16200 + + + 2017-02 + B + 16200 + + + 2017-01 + B + 16200 + + + 2016-12 + B + 16200 + + + 2016-11 + B + 16200 + + + 2016-10 + B + 16200 + + + 2016-09 + B + 16200 + + + 2016-08 + B + 16200 + + + 2016-07 + B + 16200 + + + 2016-06 + B + 16200 + + + 2016-05 + 7 + 16200 + + + 2016-04 + 6 + 16200 + + + 2016-03 + 5 + 16200 + + + 2016-02 + 4 + 16200 + + + 2016-01 + 3 + 16200 + + + 2015-12 + 2 + 16200 + + + 2015-11 + 1 + 16200 + + + 2015-10 + N + 0 + + + 2015-09 + N + 0 + + + 2015-08 + N + 0 + + + 2015-07 + N + 0 + + + 2015-06 + N + 0 + + + 2015-05 + N + 0 + + + 2015-04 + N + 0 + + + 2015-03 + N + 0 + + + 2015-02 + N + 0 + + + 2015-01 + N + 0 + + + 2014-12 + N + 0 + + + 2014-11 + N + 0 + + + 2014-10 + N + 0 + + + 2014-09 + N + 0 + + + 2014-08 + N + 0 + + + 2014-07 + N + 0 + + + 2014-06 + N + 0 + + + 2014-05 + N + 0 + + + 2014-04 + N + 0 + + + 2014-03 + N + 0 + + + + + + 75050 + D1 + 11 + SR + + 97098 + 11 + 2010-09-22 + USD + 500000 + 2025-09-21 + 12 + 03 + 180 + 2 + 5 + 0 + + + + + + 394000 + 2018-10-31 + 6100 + 1 + N + 2018-10-31 + + + 2018-10 + 2 + 400000 + 3 + 125 + 2018-10-05 + 5000 + 0 + 2018-10-05 + 2 + 6100 + 1000 + 0 + 0 + 0 + 2018-10-05 + + + 2016-11 + 2018-10 + + 2018-10 + 2 + + + 2018-09 + 1 + + + 2018-08 + N + + + 2018-07 + N + + + 2018-06 + N + + + 2018-05 + N + + + 2018-04 + N + + + 2018-03 + N + + + 2018-02 + N + + + 2018-01 + N + + + 2017-12 + N + + + 2017-11 + N + + + 2017-10 + N + + + 2017-09 + N + + + 2017-08 + N + + + 2017-07 + N + + + 2017-06 + N + + + 2017-05 + N + + + 2017-04 + N + + + 2017-03 + N + + + 2017-02 + N + + + 2017-01 + N + + + 2016-12 + N + + + 2016-11 + N + + + + 2014-03 + 2018-10 + 56 + + 2018-10 + 2 + 6100 + + + 2018-09 + 1 + 3000 + + + 2018-08 + N + 0 + + + 2018-07 + N + 0 + + + 2018-06 + N + 0 + + + 2018-05 + N + 0 + + + 2018-04 + N + 0 + + + 2018-03 + N + 0 + + + 2018-02 + N + 0 + + + 2018-01 + N + 0 + + + 2017-12 + N + 0 + + + 2017-11 + N + 0 + + + 2017-10 + N + 0 + + + 2017-09 + N + 0 + + + 2017-08 + N + 0 + + + 2017-07 + N + 0 + + + 2017-06 + N + 0 + + + 2017-05 + N + 0 + + + 2017-04 + N + 0 + + + 2017-03 + N + 0 + + + 2017-02 + N + 0 + + + 2017-01 + N + 0 + + + 2016-12 + N + 0 + + + 2016-11 + N + 0 + + + 2016-10 + N + 0 + + + 2016-09 + N + 0 + + + 2016-08 + N + 0 + + + 2016-07 + N + 0 + + + 2016-06 + N + 0 + + + 2016-05 + N + 0 + + + 2016-04 + N + 0 + + + 2016-03 + N + 0 + + + 2016-02 + N + 0 + + + 2016-01 + N + 0 + + + 2015-12 + N + 0 + + + 2015-11 + N + 0 + + + 2015-10 + N + 0 + + + 2015-09 + N + 0 + + + 2015-08 + N + 0 + + + 2015-07 + N + 0 + + + 2015-06 + N + 0 + + + 2015-05 + N + 0 + + + 2015-04 + N + 0 + + + 2015-03 + N + 0 + + + 2015-02 + N + 0 + + + 2015-01 + N + 0 + + + 2014-12 + N + 0 + + + 2014-11 + N + 0 + + + 2014-10 + N + 0 + + + 2014-09 + N + 0 + + + 2014-08 + N + 0 + + + 2014-07 + N + 0 + + + 2014-06 + N + 0 + + + 2014-05 + N + 0 + + + 2014-04 + N + 0 + + + 2014-03 + N + 0 + + + + 1 + + 2 + 2017-07-05 + 0 + 20000 + 该贷款由阿里公司代偿20000元 + + + + + + 80253 + R1 + 11 + SR + + 96085 + 91 + 2016-07-22 + USD + 70000 + 2019-01-31 + 31 + 03 + 2 + 0 + + + + + 30000 + 2018-10-05 + + 3 + 2 + 2018-10-05 + + + 2018-10 + 2 + 30000 + 3 + 20 + 2018-10-05 + 5000 + 0 + 2018-10-05 + 2 + 6100 + 1000 + 0 + 0 + 0 + 2018-10-05 + + + 2016-11 + 2018-10 + + 2018-10 + 2 + + + 2018-09 + 1 + + + 2018-08 + N + + + 2018-07 + N + + + 2018-06 + N + + + 2018-05 + N + + + 2018-04 + N + + + 2018-03 + N + + + 2018-02 + N + + + 2018-01 + N + + + 2017-12 + N + + + 2017-11 + N + + + 2017-10 + N + + + 2017-09 + N + + + 2017-08 + N + + + 2017-07 + N + + + 2017-06 + N + + + 2017-05 + N + + + 2017-04 + N + + + 2017-03 + N + + + 2017-02 + N + + + 2017-01 + N + + + 2016-12 + N + + + 2016-11 + N + + + + 2016-07 + 2018-10 + 28 + + 2018-10 + 2 + 6100 + + + 2018-09 + 1 + 6000 + + + 2018-08 + N + 0 + + + 2018-07 + N + 0 + + + 2018-06 + N + 0 + + + 2018-05 + N + 0 + + + 2018-04 + N + 0 + + + 2018-03 + N + 0 + + + 2018-02 + N + 0 + + + 2018-01 + N + 0 + + + 2017-12 + N + 0 + + + 2017-11 + N + 0 + + + 2017-10 + N + 0 + + + 2017-09 + N + 0 + + + 2017-08 + N + 0 + + + 2017-07 + N + 0 + + + 2017-06 + N + 0 + + + 2017-05 + N + 0 + + + 2017-04 + N + 0 + + + 2017-03 + N + 0 + + + 2017-02 + N + 0 + + + 2017-01 + N + 0 + + + 2016-12 + N + 0 + + + 2016-11 + N + 0 + + + 2016-10 + N + 0 + + + 2016-09 + N + 0 + + + 2016-08 + N + 0 + + + 2016-07 + N + 0 + + + + + + 55900 + R2 + 11 + SR + + 95604 + 81 + 2009-05-22 + CNY + 160000 + + 4 + + + + + 230950 + 2018-09-25 + 24550 + N + 2018-09-25 + + + 2018-09 + 1 + 255500 + 135500 + 110000 + 11 + 2018-09-12 + 24500 + 0 + 2018-09-10 + 1 + 24550 + 90000 + 150000 + 2018-09-12 + + + 2016-10 + 2018-09 + + 2018-09 + 1 + + + 2018-08 + N + + + 2018-07 + N + + + 2018-06 + N + + + 2018-05 + N + + + 2018-04 + N + + + 2018-03 + N + + + 2018-02 + N + + + 2018-01 + N + + + 2017-12 + 7 + + + 2017-11 + 6 + + + 2017-10 + 5 + + + 2017-09 + 4 + + + 2017-08 + 3 + + + 2017-07 + 2 + + + 2017-06 + 1 + + + 2017-05 + N + + + 2017-04 + N + + + 2017-03 + N + + + 2017-02 + N + + + 2017-01 + N + + + 2016-12 + N + + + 2016-11 + N + + + 2016-10 + N + + + + 2014-03 + 2018-09 + 55 + + 2018-09 + 1 + 24550 + + + 2018-08 + N + 0 + + + 2018-07 + N + 0 + + + 2018-06 + N + 0 + + + 2018-05 + N + 0 + + + 2018-04 + N + 0 + + + 2018-03 + N + 0 + + + 2018-02 + N + 0 + + + 2018-01 + N + 0 + + + 2017-12 + 7 + 10000 + + + 2017-11 + 6 + 9000 + + + 2017-10 + 5 + 8000 + + + 2017-09 + 4 + 7000 + + + 2017-08 + 3 + 6000 + + + 2017-07 + 2 + 5000 + + + 2017-06 + 1 + 4000 + + + 2017-05 + N + 0 + + + 2017-04 + N + 0 + + + 2017-03 + N + 0 + + + 2017-02 + N + 0 + + + 2017-01 + N + 0 + + + 2016-12 + N + 0 + + + 2016-11 + N + 0 + + + 2016-10 + N + 0 + + + 2016-09 + N + 0 + + + 2016-08 + N + 0 + + + 2016-07 + N + 0 + + + 2016-06 + N + 0 + + + 2016-05 + N + 0 + + + 2016-04 + N + 0 + + + 2016-03 + N + 0 + + + 2016-02 + N + 0 + + + 2016-01 + N + 0 + + + 2015-12 + N + 0 + + + 2015-11 + N + 0 + + + 2015-10 + N + 0 + + + 2015-09 + N + 0 + + + 2015-08 + N + 0 + + + 2015-07 + N + 0 + + + 2015-06 + N + 0 + + + 2015-05 + N + 0 + + + 2015-04 + N + 0 + + + 2015-03 + N + 0 + + + 2015-02 + N + 0 + + + 2015-01 + N + 0 + + + 2014-12 + N + 0 + + + 2014-11 + N + 0 + + + 2014-10 + # + + + + 2014-09 + # + + + + 2014-08 + # + + + + 2014-07 + # + + + + 2014-06 + # + + + + 2014-05 + # + + + + 2014-04 + # + + + + 2014-03 + # + + + + + 1 + + 2018-10 + 11 + + + + 1 + + 120000 + 2018-08-12 + 2019-08-11 + 120000 + + + + + + 60735 + R2 + 11 + SR + + 96537 + 81 + 2017-05-28 + CNY + 30000 + + 4 + + + 6 + + 0 + + + + 2017-05-28 + + + + + 67340 + R3 + 11 + SR + + 37745 + 2009-05-22 + CNY + 16000 + + 4 + + + + + 1000 + 2018-10-19 + + 3 + 2018-10-19 + + + 2018-10 + 1 + 1000 + 2018-10-19 + 0 + 2018-10-19 + 0 + 1000 + 1200 + 2018-10-19 + + + 2016-11 + 2018-10 + + 2018-10 + 3 + + + 2018-09 + 2 + + + 2018-08 + 1 + + + 2018-07 + 1 + + + 2018-06 + 1 + + + 2018-05 + 1 + + + 2018-04 + N + + + 2018-03 + N + + + 2018-02 + N + + + 2018-01 + N + + + 2017-12 + N + + + 2017-11 + N + + + 2017-10 + N + + + 2017-09 + N + + + 2017-08 + N + + + 2017-07 + N + + + 2017-06 + N + + + 2017-05 + N + + + 2017-04 + N + + + 2017-03 + N + + + 2017-02 + N + + + 2017-01 + N + + + 2016-12 + N + + + 2016-11 + N + + + + 2014-03 + 2018-10 + 56 + + 2018-10 + 3 + 1000 + + + 2018-09 + 2 + 900 + + + 2018-08 + 1 + 800 + + + 2018-07 + 1 + 1000 + + + 2018-06 + 1 + 1100 + + + 2018-05 + 1 + 1200 + + + 2018-04 + N + 0 + + + 2018-03 + N + 0 + + + 2018-02 + N + 0 + + + 2018-01 + N + 0 + + + 2017-12 + N + 0 + + + 2017-11 + N + 0 + + + 2017-10 + N + 0 + + + 2017-09 + N + 0 + + + 2017-08 + N + 0 + + + 2017-07 + N + 0 + + + 2017-06 + N + 0 + + + 2017-05 + N + 0 + + + 2017-04 + N + 1 + + + 2017-03 + N + 0 + + + 2017-02 + N + 0 + + + 2017-01 + N + 0 + + + 2016-12 + N + 0 + + + 2016-11 + N + 0 + + + 2016-10 + N + 0 + + + 2016-09 + N + 0 + + + 2016-08 + N + 0 + + + 2016-07 + N + 0 + + + 2016-06 + N + 0 + + + 2016-05 + N + 0 + + + 2016-04 + N + 0 + + + 2016-03 + N + 0 + + + 2016-02 + N + 0 + + + 2016-01 + N + 0 + + + 2015-12 + N + 0 + + + 2015-11 + N + 0 + + + 2015-10 + N + 0 + + + 2015-09 + N + 0 + + + 2015-08 + N + 0 + + + 2015-07 + N + 0 + + + 2015-06 + N + 0 + + + 2015-05 + N + 0 + + + 2015-04 + N + 0 + + + 2015-03 + N + 0 + + + 2015-02 + N + 0 + + + 2015-01 + N + 0 + + + 2014-12 + N + 0 + + + 2014-11 + N + 0 + + + 2014-10 + N + 0 + + + 2014-09 + N + 0 + + + 2014-08 + N + 0 + + + 2014-07 + N + 0 + + + 2014-06 + N + 0 + + + 2014-05 + N + 0 + + + 2014-04 + N + 0 + + + 2014-03 + N + 0 + + + + + + 94120 + R4 + 11 + SR + + 66837 + 91 + 2014-09-22 + USD + 500000 + 2019-09-21 + 11 + 03 + 60 + 2 + 0 + + + + + 40000 + 2018-10-05 + + 1 + N + 2018-10-05 + + + 2018-10 + 1 + 40000 + 1 + 16 + 2018-10-05 + 5000 + 5000 + 2018-10-05 + 0 + 0 + 0 + 0 + 0 + 0 + 2018-10-05 + + + 2016-11 + 2018-10 + + 2018-10 + N + + + 2018-09 + N + + + 2018-08 + N + + + 2018-07 + N + + + 2018-06 + N + + + 2018-05 + N + + + 2018-04 + N + + + 2018-03 + N + + + 2018-02 + N + + + 2018-01 + N + + + 2017-12 + N + + + 2017-11 + N + + + 2017-10 + N + + + 2017-09 + N + + + 2017-08 + N + + + 2017-07 + N + + + 2017-06 + N + + + 2017-05 + N + + + 2017-04 + N + + + 2017-03 + N + + + 2017-02 + N + + + 2017-01 + N + + + 2016-12 + N + + + 2016-11 + N + + + + 2014-09 + 2018-10 + 50 + + 2018-10 + N + 0 + + + 2018-09 + N + 0 + + + 2018-08 + N + 0 + + + 2018-07 + N + 0 + + + 2018-06 + N + 0 + + + 2018-05 + N + 0 + + + 2018-04 + N + 0 + + + 2018-03 + N + 0 + + + 2018-02 + N + 0 + + + 2018-01 + N + 0 + + + 2017-12 + N + 0 + + + 2017-11 + N + 0 + + + 2017-10 + N + 0 + + + 2017-09 + N + 0 + + + 2017-08 + N + 0 + + + 2017-07 + N + 0 + + + 2017-06 + N + 0 + + + 2017-05 + N + 0 + + + 2017-04 + N + 0 + + + 2017-03 + N + 0 + + + 2017-02 + N + 0 + + + 2017-01 + N + 0 + + + 2016-12 + N + 0 + + + 2016-11 + N + 0 + + + 2016-10 + 1 + 6000 + + + 2016-09 + N + 0 + + + 2016-08 + N + 0 + + + 2016-07 + 1 + 5000 + + + 2016-06 + N + 0 + + + 2016-05 + N + 0 + + + 2016-04 + N + 0 + + + 2016-03 + N + 0 + + + 2016-02 + N + 0 + + + 2016-01 + # + 0 + + + 2015-12 + N + 0 + + + 2015-11 + N + 0 + + + 2015-10 + N + 0 + + + 2015-09 + N + 0 + + + 2015-08 + N + 0 + + + 2015-07 + N + 0 + + + 2015-06 + # + + + + 2015-05 + N + 0 + + + 2015-04 + N + 0 + + + 2015-03 + N + 0 + + + 2015-02 + N + 0 + + + 2015-01 + N + 0 + + + 2014-12 + # + + + + 2014-11 + # + + + + 2014-10 + # + + + + 2014-09 + # + + + + + + + + + 1 + 11 + QV + 81 + 2011-05-15 + 2099-12-31 + 2 + O983 + 20000 + CNY + 10000 + 1 + R2 + N + + 2018-10-25 + + + + + 2 + 11 + QV + 11 + 2014-05-15 + 2019-05-14 + 2 + Y046 + 200000 + USD + 100000 + 3 + + + 2 + 2018-10-25 + + + + + 1 + 11 + QV + 91 + 2014-05-15 + 2019-05-14 + 2 + J143 + 200000 + CNY + 100000 + 1 + D1 + N + + 2018-10-25 + + + + + + + TE + 中国电信集团江苏省电信公司 + 1 + 2009-08-17 + 1 + 1000 + 2018-10 + NNNNNNNNNNNNNNNNNNNNNN12 + + + + + TE + 中国电信集团江苏省电信公司 + 2 + 2012-08-17 + 0 + 0 + 2018-10 + NNNNNN1NNNNNNNNNNNNNNNNN + + + + + + + 北京市东城区地税局 + 500 + 2017-03-17 + + + + + + + 北京市西城区人民法院 + + 2014-09-11 + 1 + 被告张某某赔偿原告李四人民币500,000元 + 2018-07-09 + 房屋买卖纠纷 + 500000 + + + + + + + 北京市西城区人民法院 + + 2015-09-11 + 004 + 执行完毕 + 2017-09-15 + 房屋 + 420000 + 房屋买卖纠纷 + 420000 + + + + + + + 北京市西城区地方税务局 + 责令限期改正、没收违法所得 + 400 + 2016-08 + + + + + + + 北京市建设管理服务中心 + 暂扣或者吊销许可证、暂扣或者吊销执照 + + 2015-07 + 2016-07 + + + + + + + + 110000 + 2008-08-01 + 1 + 2008-08 + 2008-11 + 12 + 12 + 1000 + 北京银行 + 2018-10-01 + + + + + + + 1 + 110000 + + 200 + 1995-01-08 + 1995-03-08 + 2018-12-19 + + + + + + + 会计从业资格证书 + 北京市财政厅 + 2 + 110105 + 2007-05 + 2029-03 + 0000-00 + + + + + + + 北京市建筑管理服务中心 + 先进生产者 + 2017-05 + 2019-05 + + + + + + + 2019-01-30 + 11 + DP + 02 + + + 2019-01-24 + 11 + EJ + 03 + + + 2019-01-25 + 11 + UV + 03 + + + 2019-02-13 + 11 + GM + 02 + + + 2019-01-24 + 11 + PT + 03 + + + 2019-01-24 + 11 + PT + 02 + + + 2019-02-13 + 11 + JA + 02 + + + 2019-01-25 + 11 + JF + 02 + + + 2019-02-01 + 11 + DP + 02 + + + 2019-01-28 + 11 + UV + 03 + + + 2019-02-13 + 11 + JX + 03 + + + 2019-01-28 + 11 + JX + 03 + + + 2019-02-11 + 11 + JX + 03 + + + 2019-01-31 + 11 + JX + 03 + + + 2019-01-29 + 11 + ZD + 02 + + + 2019-02-01 + 11 + DP + 03 + + + 2019-01-30 + 11 + JX + 03 + + + 2019-02-01 + 11 + DP + 02 + + + 2019-02-01 + 11 + DP + 08 + + + 2019-02-12 + 11 + OC + 03 + + + 2019-01-29 + 11 + DP + 02 + + + 2019-01-24 + 11 + EJ + 03 + + + 2019-01-24 + 11 + ML + 02 + + + 2019-02-13 + 11 + OC + 03 + + + 2019-02-13 + 11 + UV + 02 + + + 2019-02-13 + 11 + DP + 02 + + + 2019-01-25 + 11 + IA + 02 + + + 2019-02-12 + 11 + BJ + 02 + + + 2019-01-25 + 11 + ML + 02 + + + 2019-02-02 + 11 + DP + 02 + + + 2019-01-28 + 11 + DP + 03 + + + \ No newline at end of file diff --git a/io.sc.standard/src/main/resources/standard/二代征信报告报文示例(企业).xml b/io.sc.standard/src/main/resources/standard/二代征信报告报文示例(企业).xml new file mode 100644 index 00000000..c00be9ac --- /dev/null +++ b/io.sc.standard/src/main/resources/standard/二代征信报告报文示例(企业).xml @@ -0,0 +1,2937 @@ + + + + + 2019022208310062527930 + 2019-02-22T08:31:00 + + + 011726400H0001 + 01 + + + 北京报告样本公司 + 1 + + 30 + 686905719 + + + + 0 + + + 6.88 + 2018-10 + + + + + + + 2012 + 2015 + 3 + 3 + 2956600 + 380000 + 401600 + 0 + 2438000 + 0 + 0 + + + 1 + 0 + 1 + 1 + 1 + + + + + + + 1 + 380000 + 2018-08-15 + 0 + 0 + + 105000 + 100000 + 5000 + 12 + + 1 + 1 + 1 + 1000000 + + + 1 + 0 + 1 + 1000000 + + + 2 + 1 + 1 + 225000 + + + 2 + 0 + 1 + 225000 + + + 3 + 1 + 1 + 500000 + + + 3 + 0 + 1 + 500000 + + + 4 + 1 + 1 + 450000 + + + 4 + 3 + 1 + 401600 + + + 4 + 0 + 2 + 851600 + + + 0 + 1 + 4 + 2175000 + + + 0 + 3 + 1 + 401600 + + + 0 + 0 + 5 + 2576600 + + + + 0 + 0 + + + 0 + 0 + 13 + + 1 + 3 + 1 + + + 1 + 0 + 2 + + + 2 + 2 + 1 + + + 2 + 3 + 1 + + + 2 + 0 + 2 + + + 3 + 1 + 2 + + + 3 + 0 + 2 + + + 4 + 1 + 2 + + + 4 + 0 + 2 + + + 0 + 1 + 4 + + + 0 + 2 + 1 + + + 0 + 3 + 2 + + + 0 + 0 + 8 + + + + 12 + + 2018-12 + 6 + 2956600 + 0 + 0 + 2 + 781600 + 0 + 0 + 0 + 0 + + + 2018-09 + 6 + 3680000 + 0 + 0 + 1 + 380000 + 0 + 0 + 0 + 0 + + + 2018-06 + 6 + 3900000 + 1 + 1000000 + 2 + 900000 + 0 + 0 + 0 + 0 + + + 2018-03 + 3 + 2050000 + 0 + 0 + 1 + 400000 + 0 + 0 + 0 + 0 + + + 2017-12 + 2 + 1650000 + 0 + 0 + 1 + 450000 + 0 + 0 + 0 + 0 + + + 2017-09 + 3 + 2650000 + 0 + 0 + 1 + 450000 + 0 + 0 + 0 + 0 + + + 2017-06 + 3 + 2650000 + 0 + 0 + 1 + 450000 + 0 + 0 + 0 + 0 + + + 2017-03 + 4 + 2900000 + 1 + 500000 + 1 + 200000 + 0 + 0 + 0 + 0 + + + 2016-12 + 3 + 1900000 + 1 + 500000 + 1 + 200000 + 0 + 0 + 0 + 0 + + + 2016-09 + 4 + 2900000 + 1 + 500000 + 1 + 200000 + 0 + 0 + 0 + 0 + + + 2016-06 + 5 + 4700000 + 1 + 500000 + 1 + 200000 + 0 + 0 + 0 + 0 + + + 2016-03 + 5 + 4900000 + 1 + 500000 + 1 + 400000 + 0 + 0 + 0 + 0 + + + + + + + + 6 + + 1 + 1 + 4 + 1016000 + + + 1 + 0 + 4 + 1016000 + + + 2 + 1 + 2 + 360000 + + + 2 + 0 + 2 + 360000 + + + 3 + 1 + 2 + 1062000 + + + 3 + 0 + 2 + 1062000 + + + + 6 + + 1 + 1 + 1 + + + 1 + 0 + 1 + + + 2 + 1 + 1 + + + 2 + 0 + 1 + + + 3 + 1 + 2 + + + 3 + 0 + 2 + + + + + + + 5000000 + 2000000 + 3000000 + 0 + 0 + 0 + 1 + + + + + + 3 + + 2 + 1000000 + 1 + 200000 + 1500000 + 2 + 300000 + 0 + 0 + + + 9 + 0 + 0 + 0 + 3150000 + 2 + 475000 + 0 + 100000 + + + 0 + 1000000 + 1 + 200000 + 4650000 + 4 + 775000 + 0 + 100000 + + + + 3 + + 2 + 1000000 + 3 + 80000 + 0 + 0 + + + 9 + 100000 + 2 + 60000 + 0 + 0 + + + 0 + 1100000 + 5 + 140000 + 0 + 0 + + + + + + + 130 + 13 + 3 + A0311 + 北京市北京路188号 + 1998 + 2028-01-01 + 北京市海淀区永丰路888号 + 1 + + + 2500000000 + 2 + + 10 + 2 + 报告样本上海公司 + 10 + 3301013044994685 + 60 + + + 10 + 1 + 高瑶 + 10 + 210522198602230673 + 40 + + 2018-05-12 + + + 6 + 2018-05-12 + + 刘吾 + 10 + 371426199112317020 + 3 + + + 周尔 + 10 + 120102199111116601 + 4 + + + 郑陆 + 10 + 341422197712271329 + 9 + + + 夏思 + 10 + 410802199010054963 + 2 + + + 张珊 + 10 + 360322197911242907 + 5 + + + 邹义 + 10 + 52242819791109441X + 1 + + + + 1 + 报告样本上海公司 + 10 + 3301013044994685 + 2018-08-15 + + + 1 + + 2 + 报告样本上海公司 + 10 + 3301013044994685 + + 2018-08-15 + + + + + + L8683 + 1 + D1 + 20 + 51 + 6829 + E066 + 11 + 12 + 2014-01-01 + CNY + 2000000 + 2020-12-31 + 0 + 0 + 1 + 0 + + 2018-08-01 + + + 2 + + 2018-08-01 + 1000000 + 2018-08-01 + 1 + 2014-01-01 + 2018-08-01 + 300000 + 10 + 2018-08-01 + 200000 + 0 + 0 + 0 + + + 2014-01-01 + 1200000 + 2014-01-01 + 1 + 2014-01-01 + 2014-01-01 + 0 + 99 + 2014-01-01 + 0 + 0 + 0 + 0 + + + + 1 + + 11 + 2017-03-31 + 800000 + 12 + + + + + + + S8057 + 1 + D1 + 10 + 41 + 9404 + + 12 + 11 + 2012-05-01 + CNY + 300000 + 2019-03-31 + 0 + 0 + 1 + 1 + + 2018-10-01 + + + 2 + + 2018-10-01 + 225000 + 2018-10-01 + 1 + 2018-05-01 + 2018-05-01 + 75000 + 10 + 2018-10-01 + 75000 + 0 + 0 + 0 + + + 2018-06-15 + 300000 + 2018-05-01 + 1 + 2018-05-01 + 2018-05-01 + 0 + 99 + 2018-05-01 + 0 + 0 + 0 + 0 + + + + 1 + + 11 + 2018-10-01 + 50000 + 6 + + + + + + + L3879 + 2 + D1 + 20 + 41 + 9404 + + 11 + 12 + 2012-07-01 + CNY + 1000000 + 2017-06-30 + + + + 0 + 2017-06-30 + + + + 6 + + 2017-06-30 + 0 + 2017-06-30 + 3 + 2014-10-30 + 2016-07-31 + 250000 + 10 + 2017-06-30 + 250000 + 0 + 0 + 0 + + + 2016-06-30 + 200000 + 2016-06-30 + 3 + 2014-10-30 + 2016-06-30 + 200000 + 10 + 2016-06-30 + 200000 + 0 + 0 + 0 + + + 2015-06-30 + 400000 + 2015-06-30 + 3 + 2014-10-30 + 2015-06-30 + 400000 + 10 + 2015-06-30 + 200000 + 0 + 0 + 0 + + + 2014-10-30 + 800000 + 2013-06-30 + 3 + 2014-10-30 + 2013-06-30 + 0 + 10 + 2014-06-30 + 200000 + 200000 + 200000 + 6 + + + 2013-06-30 + 800000 + 2013-06-30 + 1 + 2013-06-30 + 2013-06-30 + 200000 + 10 + 2013-06-30 + 200000 + 0 + 0 + 0 + + + 2012-07-01 + 1000000 + 2012-07-01 + 1 + 2012-07-01 + 2012-07-01 + 0 + 99 + 2012-07-01 + 0 + 0 + 0 + 0 + + + + + + L3098 + 2 + D1 + 20 + 51 + 6829 + + 11 + 12 + 2013-02-01 + CNY + 800000 + 2016-07-31 + + + + 2 + 2016-07-31 + + + + 2 + + 2016-07-31 + 0 + 2016-07-31 + 9 + 2013-02-01 + 2016-07-31 + 800000 + 10 + 2016-07-31 + 800000 + 0 + 0 + 0 + + + 2013-02-01 + 800000 + 2013-02-01 + 9 + 2013-02-01 + 2013-02-01 + 0 + 99 + 2013-02-01 + 0 + 0 + 0 + 0 + + + + + + S0807 + 2 + D1 + 10 + 41 + 9404 + + 12 + 11 + 2012-05-01 + CNY + 1000000 + 2017-10-31 + + + + 0 + 2017-10-31 + + + + 2 + + 2018-09-30 + 0 + 2017-10-31 + 2 + 2013-02-01 + 2013-02-01 + 1060000 + 10 + 2017-10-31 + 1050000 + 0 + 0 + 0 + + + 2018-04-01 + 1000000 + 2017-05-01 + 2 + 2013-02-01 + 2013-02-01 + 0 + 99 + 2017-05-01 + 0 + 0 + 0 + 0 + + + + + + S3333 + 2 + D1 + 10 + 51 + 6829 + + 11 + 11 + 2013-04-01 + CNY + 500000 + 2018-09-30 + + + + 1 + 2018-08-01 + + + + 2 + + 2018-08-01 + 0 + 2018-06-30 + 5 + 2014-10-30 + 2014-10-30 + 520000 + 52 + 2018-06-30 + 520000 + 0 + 0 + 0 + + + 2018-05-01 + 500000 + 2018-04-01 + 5 + 2014-10-30 + 2014-10-30 + 0 + 99 + 2018-04-01 + 0 + 0 + 0 + 0 + + + + + + D7539 + 1 + D2 + 51 + 6829 + 21 + 10 + 2018-09-01 + CNY + 500000 + 2019-08-31 + 0 + 0 + + + 2018-10-01 + 0 + + + 2 + + 2018-10-01 + 450000 + 2018-10-01 + 1 + 2018-09-01 + 2018-10-01 + 0 + 10 + 2018-10-01 + 50000 + 0 + 0 + 0 + + + 2018-09-01 + 500000 + 2018-09-01 + 1 + 2018-09-01 + 2018-09-01 + 0 + 99 + 2018-09-01 + 0 + 0 + 0 + 0 + + + + + + D0143 + 1 + D2 + 51 + 6829 + 21 + 10 + 2018-05-01 + CNY + 500000 + 2019-03-31 + 0 + 0 + + + 2018-10-01 + 0 + + + 2 + + 2018-10-01 + 401600 + 2018-10-01 + 3 + 2018-10-01 + 2018-10-01 + 101500 + 10 + 2018-08-01 + 220000 + 105000 + 100000 + 2 + + + 2018-05-01 + 500000 + 2018-05-01 + 1 + 2014-01-01 + 2014-01-01 + 0 + 99 + 2018-05-01 + 0 + 0 + 0 + 0 + + + + + + D7848 + 2 + D2 + 51 + 6829 + 21 + 10 + 2017-01-01 + CNY + 1000000 + 2017-12-31 + + + + 2017-12-31 + + 0 + + + 2 + + 2017-12-31 + 0 + 2017-12-31 + 1 + 2017-01-01 + 2017-12-31 + 0 + 10 + 2017-12-31 + 1000000 + 0 + 0 + 0 + + + 2017-01-01 + 1000000 + 2017-01-01 + 1 + 2017-01-01 + 2017-01-01 + 0 + 99 + 2017-01-01 + 0 + 0 + 0 + 0 + + + + + + D7438 + 2 + D2 + 41 + 9404 + 21 + 10 + 2018-01-01 + CNY + 450000 + 2018-06-30 + + + + 2018-06-30 + + 0 + + + 2 + + 2018-06-30 + 0 + 2018-06-30 + 1 + 2018-01-01 + 2018-06-30 + 450000 + 10 + 2018-06-30 + 450000 + 0 + 0 + 0 + + + 2018-01-01 + 450000 + 2018-01-01 + 1 + 2018-01-01 + 2018-01-01 + 0 + 99 + 2018-01-01 + 0 + 0 + 0 + 0 + + + + + + R0739 + 1 + R1 + 51 + 6829 + E510 + 16 + 10 + 2018-08-01 + CNY + 1000000 + 2019-07-31 + 3 + 0 + 1 + 0 + + 2018-10-01 + + + 2 + + 2018-10-01 + 500000 + 2018-10-01 + 1 + 2018-08-01 + 2018-10-01 + 500000 + 22 + 2018-08-01 + 158000 + 0 + 0 + 0 + 11 + + + 2018-08-01 + 1000000 + 2018-08-01 + 1 + 2018-08-01 + 2018-08-01 + 0 + 31 + 2018-08-01 + 0 + 0 + 0 + 0 + 12 + + + + + + R7226 + 2 + R1 + 51 + 6829 + + 16 + 10 + 2016-01-01 + CNY + 2000000 + 2016-12-31 + + + + 0 + 2016-12-31 + + + + 3 + + 2016-12-31 + 0 + 2016-12-31 + 1 + 2016-01-01 + 2016-12-31 + 1000000 + 10 + 2016-12-31 + 1000000 + 0 + 0 + 0 + 0 + + + 2016-07-01 + 1000000 + 2016-07-01 + 1 + 2016-01-01 + 2016-07-01 + 1000000 + 10 + 2016-07-01 + 1000000 + 0 + 0 + 0 + 6 + + + 2016-01-01 + 2000000 + 2016-01-01 + 1 + 2016-01-01 + 2016-01-01 + 0 + 99 + 2016-01-01 + 0 + 0 + 0 + 0 + 12 + + + + + + R0698 + 2 + R1 + 41 + 9404 + + 16 + 20 + 2015-06-01 + CNY + 800000 + 2015-12-31 + + + + 0 + 2015-12-31 + + + + 2 + + 2015-12-31 + 0 + 2015-12-31 + 1 + 2015-06-01 + 2015-12-31 + 820000 + 10 + 2015-12-31 + 820000 + 0 + 0 + 0 + 0 + + + 2015-06-01 + 800000 + 2015-06-01 + 1 + 2015-06-01 + 2015-06-01 + 0 + 99 + 2015-06-01 + 800000 + 0 + 0 + 0 + 6 + + + + + + C6885 + 1 + C1 + 11 + 9258 + 51 + 10 + 2015-01-01 + CNY + 500000 + + 2018-08-15 + 0 + + + 4 + + 2018-08-15 + 380000 + 2018-08-15 + 4 + 2015-10-15 + 2018-08-15 + 20000 + 10 + + + 2018-01-15 + 400000 + 2018-01-15 + 4 + 2015-10-15 + 2018-01-15 + 50000 + 52 + + + 2017-04-16 + 450000 + 2017-04-16 + 4 + 2015-10-15 + 2017-04-16 + 50000 + 52 + + + 2015-01-01 + 500000 + 2015-01-01 + 2 + 2015-01-01 + 2015-01-01 + 0 + 99 + + + + + 1 + 51 + 6829 + 10 + 1 + 1 + 450000 + 0 + 0 + + + + + 2 + 51 + 6829 + 10 + 3 + 1 + 401600 + 105000 + 100000 + + + + + 3 + 41 + 9404 + 10 + 1 + + + + + 1 + 450000 + + + 4 + 51 + 6829 + 10 + 1 + + + + + 1 + 1000000 + + + + + + F9205 + G3 + 41 + 9404 + + 51 + 2017-08-01 + CNY + 200000 + 2018-03-30 + + + + + + + 2 + + 1 + + 0 + 0 + 2018-03-30 + + + + + A6884 + G3 + 11 + 9258 + + 61 + 2017-09-01 + CNY + 200000 + 2017-12-30 + + + + + + + 2 + + 1 + + 1 + 0 + 2017-12-30 + + + + + G7476 + G3 + 51 + 6829 + + 71 + 2017-09-01 + CNY + 400000 + 2018-05-31 + + + + + + + 2 + + 1 + + 0 + 0 + 2018-05-31 + + + + + G8553 + G1 + 11 + 9258 + + 71 + 2017-09-01 + CNY + 300000 + 2018-02-28 + + + + + + + 2 + + 1 + + 1 + 0 + 2018-02-28 + + + + + F1170 + G3 + 41 + 9404 + + 51 + 2018-08-01 + CNY + 300000 + 2019-03-30 + 3 + 0 + 18 + + + 2018-08-01 + 1 + 300000 + 1 + 0 + + 0 + + + + + + F3465 + G3 + 41 + 9404 + + 51 + 2018-09-01 + CNY + 200000 + 2019-01-18 + 3 + 0 + 14 + + + 2018-09-01 + 1 + 60000 + 1 + 0 + + 0 + + + + + + A7704 + G3 + 11 + 9258 + + 61 + 2018-08-01 + CNY + 200000 + 2019-03-30 + 3 + 0 + 10 + + + 2018-08-01 + 1 + 200000 + 1 + 0 + + 0 + + + + + + A3607 + G3 + 11 + 9258 + + 61 + 2018-10-01 + CNY + 366000 + 2019-02-20 + 3 + 0 + 10 + + + 2018-10-01 + 1 + 366000 + 1 + 0 + + 0 + + + + + + A7763 + G3 + 11 + 9258 + + 61 + 2018-09-01 + CNY + 250000 + 2019-01-20 + 3 + 0 + 10 + + + 2018-09-01 + 1 + 250000 + 1 + 0 + + 0 + + + + + + A2720 + G3 + 11 + 9258 + + 61 + 2018-08-01 + CNY + 200000 + 2018-11-15 + 3 + 0 + 20 + + + 2018-08-01 + 1 + 200000 + 1 + 0 + + 0 + + + + + + G5781 + G1 + 11 + 9258 + + 71 + 2018-08-01 + CNY + 800000 + 2018-12-30 + 3 + 0 + 20 + + + 2018-10-01 + 1 + 667000 + 1 + 0 + + 0 + + + + + + G4482 + G3 + 51 + 6829 + + 72 + 2018-08-01 + CNY + 500000 + 2018-12-30 + 3 + 0 + 15 + + + 2018-10-01 + 1 + 395000 + 1 + 0 + + 0 + + + + + 5 + 11 + 9258 + 61 + 1 + + + + + + + 1 + 1 + + + 6 + 41 + 9404 + 51 + 1 + + + + + + + 1 + 0 + + + 7 + 51 + 6829 + 71 + 1 + + + + + + + 1 + 0 + + + 8 + 11 + 9258 + 71 + 1 + + + + + + + 1 + 1 + + + 9 + 11 + 9258 + 61 + 1 + 4 + 1016000 + 816000 + 200000 + 0 + 0 + + + + + 10 + 41 + 9404 + 51 + 1 + 2 + 360000 + 60000 + 300000 + 0 + 0 + + + + + 11 + 11 + 9258 + 71 + 1 + 1 + 667000 + + + + + + + + + 12 + 51 + 6829 + 72 + 1 + 1 + 395000 + + + + + + + + + + + E066 + 51 + 6829 + 11 + 0 + CNY + 5000000 + 2000000 + 20000000 + 4285 + 2016-01-01 + 2021-12-31 + 2018-07-02 + + + + + L8531 + 2 + D1 + 4 + CNY + 3000000 + 11 + 9258 + 11 + 11 + 2015-06-01 + 2019-05-31 + CNY + 375000 + 1 + 0 + 0 + 0 + + + 2018-09-02 + 375000 + + + + + C3218 + 2 + C1 + 2 + CNY + 1000000 + 11 + 9258 + 41 + 10 + 2015-02-01 + + CNY + 200000 + 4 + + + + + + 2018-05-16 + 200000 + + P189 + + + 13 + 3 + 41 + 9404 + 10 + 3 + 150000 + 1 + 100000 + 30000 + 30000 + 150000 + + + + 14 + 2 + 41 + 9404 + 10 + 1 + 1500000 + 2 + 300000 + 0 + 0 + 500000 + P346 + + + 15 + 9 + 41 + 9404 + 51 + 1 + 100000 + 2 + 60000 + 150000 + + + + 16 + 2 + 51 + 6829 + 71 + 1 + 1000000 + 3 + 80000 + 100000 + P523 + + + + + + H283 + 中国电信集团北京市电信公司 + 00 + 2 + 4300 + 2018-08 + + + 18 + + 2018-08 + 2 + 7800 + 5000 + 4300 + + + 2018-07 + 2 + 6500 + 5000 + 1500 + + + 2018-06 + 2 + 7700 + 0 + 7700 + + + 2018-05 + 2 + 7600 + 0 + 7600 + + + 2018-04 + 1 + 6800 + 6800 + 0 + + + 2018-03 + 2 + 4400 + 1000 + 3400 + + + 2018-02 + 2 + 5800 + 0 + 5800 + + + 2018-01 + 2 + 5800 + 0 + 5800 + + + 2017-12 + 1 + 6500 + 6500 + 0 + + + 2017-11 + 1 + 6400 + 6400 + 0 + + + 2017-10 + 1 + 7600 + 7600 + 0 + + + 2017-09 + 1 + 6800 + 6800 + 0 + + + 2017-08 + 1 + 4400 + 4400 + 0 + + + 2017-07 + 1 + 7300 + 7300 + 0 + + + 2017-06 + 1 + 6500 + 6500 + 0 + + + 2017-05 + 1 + 6400 + 6400 + 0 + + + 2017-04 + 1 + 7600 + 7600 + 0 + + + 2017-03 + 1 + 6800 + 6800 + 0 + + + + + + + + J687 + 四川省泸州市中级人民法院 + (2016)泸民终字第295号 + 2016-10-03 + 房地产合同纠纷 + 2 + 1 + 房屋 + 25000000 + 1 + 2017-02-05 + 驳回上诉,维持原判。限期被告中国有限责任公司支付原告四川王氏房地产开发有限公司违约金45万元。如果未按期履行给付金钱义务,应当依照法律规定,加倍支付债务利息。驳回原告的其他诉讼请求。 + + + K020 + 北京市西城区人民法院 + (2015)建执字第1573号 + 2015-09-25 + 货款 + 房屋 + 510000 + 2017年12月已结案 + 4 + 房屋 + 510000 + + + + + M945 + 北京市质量技术监督局 + (京)质技监罚字[2017]318号 + 生产伪造产地的建筑材料 + 该类产品停产 + 2017-05-13 + 500000 + 已缴纳罚款 + + + + + + + N839 + 2004-07 + 500 + 3000000 + 2018-09-27 + 2018-09 + 0 + + 2018-09 + + + 18 + + 2018-01 + 0 + 115035 + 115035 + + + + 2018-06 + 0 + 109209 + 109209 + + + + 2018-05 + 0 + 102460 + 102460 + + + + 2018-09 + 0 + 105460 + 105460 + + + + 2018-02 + 0 + 105460 + 105460 + + + + 2017-09 + 0 + 149209 + 149209 + + + + 2017-07 + 0 + 145030 + 145030 + + + + 2018-04 + 0 + 125030 + 125030 + + + + 2017-05 + 0 + 125460 + 125460 + + + + 2017-06 + 0 + 149209 + 149209 + + + + 2017-11 + 0 + 105460 + 105460 + + + + 2017-03 + 0 + 129209 + 129209 + + + + 2018-08 + 0 + 115030 + 115030 + + + + 2017-12 + 0 + 102209 + 102209 + + + + 2018-03 + 0 + 139219 + 139219 + + + + 2017-04 + 0 + 125030 + 125030 + + + + 2017-08 + 0 + 145460 + 145460 + + + + 2017-10 + 0 + 155030 + 155030 + + + + + + + + Q963 + 北京市环保局 + 环保审批 + 2017-01-01 + 2020-12-31 + 建设项目环境影响评价审批 + + + T813 + 北京市质量技术监督局 + 强制产品质量认证 + 2018-04-01 + 2020-03-31 + + + + U218 + 北京市建设厅 + 建筑企业资质 + 2014-07-10 + 2020-07-09 + + + + V767 + 北京市质量技术监督局 + 北京市名牌 + 2017-01-25 + 2020-12-31 + + + + + + W979 + 国家质量检验检疫总局 + 棉麻制品 + 2016-01-01 + + + X283 + 国家质量检验检疫总局 + 棉麻制品 + 201801234 + 2020-12-31 + + + Y638 + 国家质量检验检疫总局 + 北京分局 + 1 + 2015-08-01 + 2024-07-31 + + + + + + + 3145 + 41 + 9404 + 2018 + 20 + 1 + + + + 111111 + + 111111 + 111111 + 111111 + 111111 + + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 10 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 10 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 600000 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 100000 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 100000 + 200000 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 300000 + 600000 + + + + + 3418 + 11 + 9258 + 2017 + 10 + 2 + + + + + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + + + 5 + 11111111 + 11111111 + + + + 11111111 + 11111111 + 11111111 + 11111111 + 11111111 + 11111111 + 11111111 + + + + + + 5 + 10 + + + + + + + + + + + + + 3 + + + 6666 + + + + + 3 + 6 + + + + + + 4 + 10 + + + + + 3785 + 41 + 9404 + 2017 + 10 + 1 + + + 7 + 7 + 7 + 7 + 7 + 7 + + 7 + 7 + 7 + + 7 + 7 + 7 + 7 + + 7 + 7 + + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + + + + + 3934 + 11 + 9258 + 2018 + 40 + 2 + + + 1 + 1 + 1 + + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + + + 3180 + 41 + 9404 + 2017 + 10 + 1 + + + + 100 + 45 + 1067 + 45 + 14 + 72 + 43 + 175 + 892 + + 34 + 76 + + 244 + 42 + + 29 + 106 + 138 + + 27 + 61 + 161 + 27 + 42 + 89 + 159 + 2 + 100 + 1133 + 201 + 12 + 23 + 34 + 56 + 67 + 78 + 89 + 51 + 59 + 21 + 43 + 72 + 12 + 32 + 34 + 892 + 12 + 23 + + 26 + 1175 + 23 + 42 + 61 + 1234567891234567 + + + + + 3842 + 11 + 9258 + 2018 + 20 + 2 + + + + + + 2 + + + 7 + + 1 + 1 + + + 1088 + + + 5 + + + + + 4 + 1 + + + + 5 + + + + 4 + 1 + 1 + 4 + 5 + 9 + + + + + + + + + + 111111 + 111111 + 111111 + 111111 + 111111 + 111111 + + + + + + + 1234567891011121 + 1234567891011121 + 1234567891011121 + + + + 26 + + + + + + \ No newline at end of file diff --git a/io.sc.standard/src/main/resources/standard/二代个人征信接口结构化数据详细说明.xlsx b/io.sc.standard/src/main/resources/standard/二代征信报告数据说明.xlsx similarity index 100% rename from io.sc.standard/src/main/resources/standard/二代个人征信接口结构化数据详细说明.xlsx rename to io.sc.standard/src/main/resources/standard/二代征信报告数据说明.xlsx diff --git a/io.sc.website/package.json b/io.sc.website/package.json index 54a791fb..24a44482 100644 --- a/io.sc.website/package.json +++ b/io.sc.website/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.website", - "version": "8.2.2", + "version": "8.2.3", "description": "", "main": "index.js", "scripts": { @@ -28,6 +28,6 @@ }, "dependencies": { "vue": "3.5.13", - "platform-core": "8.2.8" + "platform-core": "8.2.14" } } \ No newline at end of file