Commit aa472ef4 by leejoker

修复没有数据也发送通知的bug

1 parent 8e4f9f12
...@@ -257,7 +257,7 @@ public class WeSensitiveServiceImpl implements IWeSensitiveService { ...@@ -257,7 +257,7 @@ public class WeSensitiveServiceImpl implements IWeSensitiveService {
private void addHitSensitiveList(List<JSONObject> json, WeSensitive weSensitive) { private void addHitSensitiveList(List<JSONObject> json, WeSensitive weSensitive) {
elasticSearch.createIndex2(WeConstans.WECOM_SENSITIVE_HIT_INDEX, getSensitiveHitMapping()); elasticSearch.createIndex2(WeConstans.WECOM_SENSITIVE_HIT_INDEX, getSensitiveHitMapping());
boolean sendMessage = false; boolean sendMessage = false;
if (weSensitive.getAlertFlag().equals(1)) { if (weSensitive.getAlertFlag().equals(1) && CollectionUtils.isNotEmpty(json)) {
//发送消息通知给相应的审计人 //发送消息通知给相应的审计人
WeCorpAccount weCorpAccount = weCorpAccountService.findValidWeCorpAccount(); WeCorpAccount weCorpAccount = weCorpAccountService.findValidWeCorpAccount();
String auditUserId = weSensitive.getAuditUserId(); String auditUserId = weSensitive.getAuditUserId();
...@@ -268,7 +268,7 @@ public class WeSensitiveServiceImpl implements IWeSensitiveService { ...@@ -268,7 +268,7 @@ public class WeSensitiveServiceImpl implements IWeSensitiveService {
pushDto.setTouser(auditUserId); pushDto.setTouser(auditUserId);
pushDto.setMsgtype(MessageType.TEXT.getMessageType()); pushDto.setMsgtype(MessageType.TEXT.getMessageType());
pushDto.setText(textMessageDto); pushDto.setText(textMessageDto);
weMessagePushClient.sendMessageToUser(pushDto,weCorpAccount.getAgentId()); weMessagePushClient.sendMessageToUser(pushDto, weCorpAccount.getAgentId());
sendMessage = true; sendMessage = true;
} }
//批量提交插入记录 //批量提交插入记录
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!