提交 b072597e 编写于 作者: hebao@lab.ibiz5.com's avatar hebao@lab.ibiz5.com

自动构建不记录无业务数据的记录

上级 2804d217
......@@ -31,6 +31,9 @@ public class BaseRequest
", datas=" + datas.size() +
", model='" + model + '\'' +
", batch='" + batch + '\'' +
", engineId='" + engineId + '\'' +
", extCond='" + extCond + '\'' +
", isAutoRun='" + isAutoRun + '\'' +
", rules=" + rules.size() +
'}';
}
......@@ -52,6 +55,7 @@ public class BaseRequest
private String modelId;
private String model;
private String engineId;
private boolean isAutoRun = false;
private String resultDataSource;
private String resultTableName;
private String resultTopic;
......
......@@ -183,12 +183,25 @@ public class RuleEngineExService extends RuleEngineServiceImpl {
execlog.setName(msg.getBatch());
execlog.setKeyValueField(msg.getModel());
execlog.setSystemId(msg.getSystemid());
ruExecLogService.create(execlog);
if(StringUtils.hasLength(msg.getExtCond())){
msg.setDatas(liteDataService.getModelObjs2(msg.getModelId(),msg.getFillpropertys(),engineMQMsg.getDatas(),msg.getExtCond()));
}else{
msg.setDatas(liteDataService.getModelObjs(msg.getModelId(),msg.getFillpropertys(),engineMQMsg.getDatas()));
try {
if (StringUtils.hasLength(msg.getExtCond())) {
msg.setDatas(liteDataService.getModelObjs2(msg.getModelId(), msg.getFillpropertys(), engineMQMsg.getDatas(), msg.getExtCond()));
} else {
msg.setDatas(liteDataService.getModelObjs(msg.getModelId(), msg.getFillpropertys(), engineMQMsg.getDatas()));
}
//自动构建引擎,无业务数据时不记录构建日志
if(msg.isAutoRun() && (msg.getDatas() == null || msg.getDatas().size() == 0)){
return;
}
}catch (Exception ex){
String info = String.format("构建数据:%1$s,业务数据加载错误:%2$s", msg, ex.getMessage());
log.error(info);
execlog.setRetCode(4);
execlog.setRunResult(info);
ruExecLogService.create(execlog);
return;
}
ruExecLogService.create(execlog);
baseEntityService.processAll(msg);
}catch (Exception ex){
......@@ -237,7 +250,14 @@ public class RuleEngineExService extends RuleEngineServiceImpl {
String resultDataSource = Setting.getValue(et.getExtParams(), "resultDataSource");
String resultTableName = Setting.getValue(et.getExtParams(), "resultTableName");
String resultTopic = Setting.getValue(et.getExtParams(), "resultTopic");
String isAuto = Setting.getValue(et.getExtParams(), "isAuto");
String extCond = Setting.getValue(et.getExtParams(), "extCond");
//设置是否为自动构建引擎
if("Y".equalsIgnoreCase(isAuto)){
msg.setAutoRun(true);
}else{
msg.setAutoRun(false);
}
if(StringUtils.isEmpty(resultDataSource)){
resultDataSource=Default_ResultDataSource;
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册