161 changed files with 7784 additions and 3084 deletions
Binary file not shown.
@ -1,6 +1,5 @@ |
|||||
dependencies { |
dependencies { |
||||
api( |
api( |
||||
"org.springframework:spring-core", |
project(":io.sc.platform.util"), |
||||
"com.fasterxml.jackson.dataformat:jackson-dataformat-xml", |
|
||||
) |
) |
||||
} |
} |
||||
|
@ -1,28 +1,14 @@ |
|||||
package io.sc.creditreport.core; |
package io.sc.creditreport.core; |
||||
|
|
||||
import com.fasterxml.jackson.annotation.JsonInclude; |
|
||||
import com.fasterxml.jackson.core.JsonProcessingException; |
import com.fasterxml.jackson.core.JsonProcessingException; |
||||
import com.fasterxml.jackson.databind.DeserializationFeature; |
import io.sc.platform.util.ObjectMapperUtil; |
||||
import com.fasterxml.jackson.databind.MapperFeature; |
|
||||
import com.fasterxml.jackson.databind.SerializationFeature; |
|
||||
import com.fasterxml.jackson.dataformat.xml.XmlMapper; |
|
||||
|
|
||||
public class CreditReportParser { |
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 { |
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 { |
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); |
||||
} |
} |
||||
} |
} |
||||
|
@ -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 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 io.sc.engine.rule.core.enums.ProcessorType; |
||||
|
|
||||
import java.util.List; |
import java.util.List; |
@ -0,0 +1,145 @@ |
|||||
|
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.RuleSetParameterProcessor; |
||||
|
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 RuleSet { |
||||
|
private Integer level; |
||||
|
private String code; |
||||
|
private String name; |
||||
|
private String category; |
||||
|
private String condition; |
||||
|
private String value; |
||||
|
private String message; |
||||
|
|
||||
|
public static List<RuleSet> parse(String json) throws Exception{ |
||||
|
return ObjectMapperUtil.json().readValue(json, new TypeReference<List<RuleSet>>(){}); |
||||
|
} |
||||
|
|
||||
|
public String groovy(Parameter parameter, RuleSetParameterProcessor processor) throws Exception{ |
||||
|
if(parameter==null || processor==null){ |
||||
|
return null; |
||||
|
} |
||||
|
try { |
||||
|
List<RuleSet> rules =parse(processor.getRuleSet()); |
||||
|
List<RuleSet> _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<size;i++) { |
||||
|
RuleSet rule =_rules.get(i); |
||||
|
sb.append("if("); |
||||
|
sb.append(GroovyExpressionReplacer.groovy(rule.condition, null)); |
||||
|
sb.append(")").append("{").append("\n"); |
||||
|
sb.append("\t").append("temp.addRule("); |
||||
|
sb.append("true,"); |
||||
|
sb.append(rule.level).append(","); |
||||
|
sb.append("'''" + rule.code + "''',"); |
||||
|
sb.append("'''" + rule.name + "''',"); |
||||
|
if(rule.category!=null && !"".equals(rule.category)) { |
||||
|
sb.append("'''" + rule.category + "''',"); |
||||
|
}else { |
||||
|
sb.append("null,"); |
||||
|
} |
||||
|
sb.append(GroovyExpressionReplacer.groovy(rule.value, "java.lang.String")).append(","); |
||||
|
sb.append(GroovyExpressionReplacer.groovy(rule.message, "java.lang.String")); |
||||
|
sb.append(")").append(";\n"); |
||||
|
sb.append("}else{").append("\n"); |
||||
|
sb.append("\t").append("temp.addRule("); |
||||
|
sb.append("false,"); |
||||
|
sb.append(rule.level).append(","); |
||||
|
sb.append("'''" + rule.code + "''',"); |
||||
|
sb.append("'''" + rule.name + "''',"); |
||||
|
if(rule.category!=null && !"".equals(rule.category)) { |
||||
|
sb.append("'''" + rule.category + "''',"); |
||||
|
}else { |
||||
|
sb.append("null,"); |
||||
|
} |
||||
|
sb.append(GroovyExpressionReplacer.groovy(rule.value, "java.lang.String")).append(","); |
||||
|
sb.append(GroovyExpressionReplacer.groovy(rule.message, "java.lang.String")); |
||||
|
sb.append(")").append(";\n"); |
||||
|
sb.append("}\n"); |
||||
|
} |
||||
|
sb.append("").append(GroovyExpressionReplacer.ARGUMENT_NAME).append(".").append(IdReplacer.fieldName(parameter.getCode())).append(" =temp;").append("\n"); |
||||
|
return sb.toString(); |
||||
|
} |
||||
|
}catch(Exception e) { |
||||
|
throw new RuntimeException("There was a Error when generate " + parameter.getName()+ "'s Rule Set groovy source code.", e); |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
public Integer getLevel() { |
||||
|
return level; |
||||
|
} |
||||
|
|
||||
|
public void setLevel(Integer level) { |
||||
|
this.level = level; |
||||
|
} |
||||
|
|
||||
|
public String getCode() { |
||||
|
return code; |
||||
|
} |
||||
|
|
||||
|
public void setCode(String code) { |
||||
|
this.code = code; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
public void setName(String name) { |
||||
|
this.name = name; |
||||
|
} |
||||
|
|
||||
|
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; |
||||
|
} |
||||
|
} |
@ -0,0 +1,146 @@ |
|||||
|
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.ScoreCardItem; |
||||
|
import io.sc.engine.rule.core.po.model.Parameter; |
||||
|
import io.sc.engine.rule.core.po.model.processor.ScoreCardParameterProcessor; |
||||
|
import io.sc.engine.rule.core.util.GroovyExpressionReplacer; |
||||
|
import io.sc.engine.rule.core.util.IdReplacer; |
||||
|
import io.sc.platform.util.CollectionUtil; |
||||
|
import io.sc.platform.util.ObjectMapperUtil; |
||||
|
import org.springframework.util.StringUtils; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
public class ScoreCard { |
||||
|
public List<ScoreCardItem> parse(String json) throws Exception{ |
||||
|
return ObjectMapperUtil.json().readValue(json, new TypeReference<List<ScoreCardItem>>(){}); |
||||
|
} |
||||
|
|
||||
|
public String groovy(Parameter parameter, ScoreCardParameterProcessor processor) throws Exception{ |
||||
|
if(parameter==null || processor==null){ return null; } |
||||
|
try { |
||||
|
List<ScoreCardItem> 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<ConditionRange> _conditionRanges =new ArrayList<ConditionRange>(); |
||||
|
//移除没有填写条件的条件范围
|
||||
|
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<size;i++) { |
||||
|
ConditionRange conditionRange =_conditionRanges.get(i); |
||||
|
if(i==0) { |
||||
|
sb.append("if("); |
||||
|
}else { |
||||
|
sb.append("else if("); |
||||
|
} |
||||
|
sb.append(GroovyExpressionReplacer.groovy(conditionRange.getCondition())); |
||||
|
sb.append(")").append("{").append("\n"); |
||||
|
if(StringUtils.hasText(conditionRange.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(conditionRange.getValue(), parameter.getValueType())).append(";\n"); |
||||
|
}else{ |
||||
|
sb.append(GroovyExpressionReplacer.groovy(conditionRange.getValue(), parameter.getValueType())).append(";\n"); |
||||
|
} |
||||
|
} |
||||
|
sb.append("}"); |
||||
|
} |
||||
|
return sb.toString(); |
||||
|
} |
||||
|
|
||||
|
public String groovyNumberRange(Parameter parameter,ScoreCardItem scoreCardItem){ |
||||
|
if(!CollectionUtil.hasElements(scoreCardItem.getNumberRange())){ return null; } |
||||
|
List<NumberRange> _numberRanges =new ArrayList<NumberRange>(); |
||||
|
|
||||
|
//移除空行
|
||||
|
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(); |
||||
|
} |
||||
|
} |
@ -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<SingleRule> parse(String json) throws Exception{ |
||||
|
return ObjectMapperUtil.json().readValue(json, new TypeReference<List<SingleRule>>(){}); |
||||
|
} |
||||
|
|
||||
|
public String groovy(Parameter parameter, SingleRuleParameterProcessor processor) throws Exception{ |
||||
|
if(parameter==null || processor==null){ |
||||
|
return null; |
||||
|
} |
||||
|
try { |
||||
|
List<SingleRule> rules =parse(processor.getSingleRule()); |
||||
|
List<SingleRule> _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;i<size;i++) { |
||||
|
SingleRule rule =_rules.get(i); |
||||
|
sb.append("if("); |
||||
|
sb.append(GroovyExpressionReplacer.groovy(rule.condition, null)); |
||||
|
sb.append(")").append("{").append("\n"); |
||||
|
sb.append("\t").append("SingleRuleResult temp =new SingleRuleResult("); |
||||
|
sb.append("true,"); |
||||
|
sb.append(rule.level).append(","); |
||||
|
if(rule.category!=null && !"".equals(rule.category)) { |
||||
|
sb.append("'''" + rule.category + "''',"); |
||||
|
}else { |
||||
|
sb.append("null,"); |
||||
|
} |
||||
|
sb.append(GroovyExpressionReplacer.groovy(rule.value, "java.lang.String")).append(","); |
||||
|
sb.append(GroovyExpressionReplacer.groovy(rule.message, "java.lang.String")); |
||||
|
sb.append(")").append(";\n"); |
||||
|
sb.append("\tif(!result.getTriggered() || result.getLevel()>temp.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; |
||||
|
} |
||||
|
} |
@ -1,6 +1,7 @@ |
|||||
#define renderFunction(function) |
#define renderFunction(function) |
||||
/** |
|
||||
* #(function.description) |
/** |
||||
*/ |
* #(function.description) |
||||
#(function.body) |
*/ |
||||
|
#(tabs(function.body,1)) |
||||
#end |
#end |
@ -0,0 +1 @@ |
|||||
|
#(tabs(RuleSet.groovy(parameter,processor),2)) |
@ -0,0 +1 @@ |
|||||
|
#(tabs(ScoreCard.groovy(parameter,processor),2)) |
@ -0,0 +1 @@ |
|||||
|
#(tabs(SingleRule.groovy(parameter,processor),2)) |
@ -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; |
|
||||
} |
|
||||
} |
|
@ -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; |
|
||||
} |
|
||||
} |
|
@ -1,3 +1,25 @@ |
|||||
re.dictionary.category.base=Base |
re.dictionary.category.base=Base |
||||
re.dictionary.category.engine=Engine |
re.dictionary.category.engine=Engine |
||||
re.dictionary.category.customization=User Customization |
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 |
@ -1,3 +1,25 @@ |
|||||
re.dictionary.category.base=\u57FA\u672C\u985E\u578B |
re.dictionary.category.base=\u57FA\u672C\u985E\u578B |
||||
re.dictionary.category.engine=\u5F15\u64CE\u5167\u7F6E\u985E\u578B |
re.dictionary.category.engine=\u5F15\u64CE\u5167\u7F6E\u985E\u578B |
||||
re.dictionary.category.customization=\u7528\u6236\u81EA\u5B9A\u7FA9\u985E\u578B |
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 |
@ -1,3 +1,25 @@ |
|||||
re.dictionary.category.base=\u57FA\u672C\u7C7B\u578B |
re.dictionary.category.base=\u57FA\u672C\u7C7B\u578B |
||||
re.dictionary.category.engine=\u5F15\u64CE\u5185\u7F6E\u7C7B\u578B |
re.dictionary.category.engine=\u5F15\u64CE\u5185\u7F6E\u7C7B\u578B |
||||
re.dictionary.category.customization=\u7528\u6237\u81EA\u5B9A\u4E49\u7C7B\u578B |
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 |
@ -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 |
|
||||
+ "]"; |
|
||||
} |
|
||||
} |
|
@ -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 |
|
||||
+ "]"; |
|
||||
} |
|
||||
} |
|
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue