提交 33df7395 编写于 作者: xuhui961310148's avatar xuhui961310148

update:报表、规则构建结果为空不发送消息

上级 bc014994
......@@ -247,6 +247,8 @@ public class AnalyseAllServiceImpl extends BaseEntityServiceImpl {
resultsMQMsg.setMsgId(msg.getId());
resultsMQMsg.setKeyValueField(modelObj.getRowKey());
resultsMQMsg.setRules(msg.getRuleIds());
resultsMQMsg.setDeleteIds(new ArrayList<>());
resultsMQMsg.setSaveDatas(new ArrayList<>());
Object saveResults = modelObj.get(Tag_SaveResults);
if(saveResults != null && saveResults instanceof List){
resultsMQMsg.setSaveDatas((List<ExecResult>)saveResults);
......@@ -260,6 +262,9 @@ public class AnalyseAllServiceImpl extends BaseEntityServiceImpl {
resultsMQMsg.setDeleteIds((List<String>)deleteResults);
}
}
if (resultsMQMsg.getDeleteIds().size() == 0 && resultsMQMsg.getSaveDatas().size() == 0){
continue;
}
if (resultsBatchSend){
sqlResultsMQMsgList.add(resultsMQMsg);
}else {
......
......@@ -206,9 +206,10 @@ public class AnalyseEntityServiceImpl extends BaseEntityServiceImpl {
Object saveResults = modelObj.get(Tag_SaveResults);
if(saveResults instanceof List){
resultsMQMsg.setDatas((List<ExecResult>)saveResults);
// defaultMQProducerService.sendToMQ(resultsMQMsg, "default");
}
defaultMQProducerService.sendResultsMsg(resultsMQMsg);
if (resultsMQMsg.getDatas() != null && resultsMQMsg.getDatas().size() > 0){
defaultMQProducerService.sendResultsMsg(resultsMQMsg);
}
}
catch (Exception e)
{
......
......@@ -553,6 +553,8 @@ public class BaseEntityServiceImpl implements BaseEntityService
}else {
SqlResultsMQMsg sqlResultsMQMsg = new SqlResultsMQMsg();
sqlResultsMQMsg.setMsgId(msg.getId());
sqlResultsMQMsg.setSaveDatas(new ArrayList<>());
sqlResultsMQMsg.setDeleteDatas(new ArrayList<>());
if (saveExecResultList != null && saveExecResultList.size()>0){
sqlResultsMQMsg.setSaveDatas(saveExecResultList);
}
......@@ -565,7 +567,9 @@ public class BaseEntityServiceImpl implements BaseEntityService
if(!StringUtils.isEmpty(msg.getResultTableName())){
sqlResultsMQMsg.setResultTableName(msg.getResultTableName());
}
localMsgResultProducerService.sendEngineResultsMsg(sqlResultsMQMsg);
if (sqlResultsMQMsg.getSaveDatas().size() > 0 || sqlResultsMQMsg.getDeleteDatas().size() > 0){
localMsgResultProducerService.sendEngineResultsMsg(sqlResultsMQMsg);
}
}
}
catch (Exception e)
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册