Browse Source
1) 规则引擎中,移除模型或子模型类型"定量(输入)" 2) 规则引擎中,增加参数别名,是否作为指标持久化,附加属性 3)规则引擎中,调整代码编辑器提示,显示当前模型前面模型的相关参数 4)规则引擎中,增加服务器执行器配置,支持远程调用main
57 changed files with 1240 additions and 11380 deletions
File diff suppressed because it is too large
@ -0,0 +1,12 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<configuration> |
||||
|
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> |
||||
|
<encoder> |
||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n</pattern> |
||||
|
</encoder> |
||||
|
</appender> |
||||
|
|
||||
|
<root level="info"> |
||||
|
<appender-ref ref="STDOUT" /> |
||||
|
</root> |
||||
|
</configuration> |
@ -1,100 +0,0 @@ |
|||||
package io.sc.engine.rule.core; |
|
||||
|
|
||||
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; |
|
||||
|
|
||||
/** |
|
||||
* 模型结果 |
|
||||
* @author wangshaoping |
|
||||
* |
|
||||
*/ |
|
||||
public class ResourceResult { |
|
||||
private int status; |
|
||||
private ValidateResult validateResult; |
|
||||
private List<ParameterResult> data =new ArrayList<ParameterResult>(); |
|
||||
|
|
||||
/** |
|
||||
* 添加结果参数 |
|
||||
* @param code 代码 |
|
||||
* @param name 名称 |
|
||||
* @param type 类型 |
|
||||
* @param valueType 值类型 |
|
||||
* @param value 值 |
|
||||
*/ |
|
||||
public void addParameterResult(String code,String name,ParameterType type,String valueType,String value) { |
|
||||
data.add(new ParameterResult(code,name,type,valueType,value)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 通过参数代码获取参数值 |
|
||||
* @param code 参数代码 |
|
||||
* @return 参数值 |
|
||||
*/ |
|
||||
public boolean exists(String code) { |
|
||||
if(code!=null && !"".equals(code.trim())) { |
|
||||
if(data!=null && data.size()>0) { |
|
||||
for(ParameterResult parameterResult : data) { |
|
||||
if(code.equals(parameterResult.getCode())){ |
|
||||
return true; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 通过参数代码获取参数值 |
|
||||
* @param code 参数代码 |
|
||||
* @return 参数值 |
|
||||
*/ |
|
||||
public String getValueByParameterCode(String code) { |
|
||||
if(code!=null && !"".equals(code.trim())) { |
|
||||
if(data!=null && data.size()>0) { |
|
||||
for(ParameterResult parameterResult : data) { |
|
||||
if(code.equals(parameterResult.getCode())){ |
|
||||
return parameterResult.getValue(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
public int getStatus() { |
|
||||
return status; |
|
||||
} |
|
||||
public void setStatus(int status) { |
|
||||
this.status = status; |
|
||||
} |
|
||||
public ValidateResult getValidateResult() { |
|
||||
return validateResult; |
|
||||
} |
|
||||
public void setValidateResult(ValidateResult validateResult) { |
|
||||
this.validateResult = validateResult; |
|
||||
} |
|
||||
public List<ParameterResult> getData() { |
|
||||
return data; |
|
||||
} |
|
||||
public void setData(List<ParameterResult> data) { |
|
||||
this.data = data; |
|
||||
} |
|
||||
|
|
||||
public void addParameterResult(ParameterResult result) { |
|
||||
this.data.add(result); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public String toString() { |
|
||||
try { |
|
||||
return ObjectMapperUtil.json().writeValueAsString(this); |
|
||||
} catch (JsonProcessingException e) { |
|
||||
return "ResourceResult [status=" + status + ", validateResult=" + validateResult + ", data=" + data + "]"; |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,6 @@ |
|||||
|
package io.sc.engine.rule.core.enums; |
||||
|
|
||||
|
public enum ParameterPropertiesName { |
||||
|
SHOW_IF, // 是否可现实
|
||||
|
MODIFY_IF; // 是否可修改
|
||||
|
} |
Loading…
Reference in new issue