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

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

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