Browse Source

# 消息即时推送代码提交错误问题解决

zhongwei
haungxing 10 months ago
parent
commit
034d11ec2b
  1. 7
      hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java

7
hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java

@ -167,7 +167,12 @@ public class MessageClient extends BladeController implements IMessageClient{
}).collect(Collectors.toList()); }).collect(Collectors.toList());
boolean saveResult = recordService.saveBatch(pushRecords); boolean saveResult = recordService.saveBatch(pushRecords);
if(saveResult) { if(saveResult) {
return R.status(recordService.sendMailMsgByUsers(pushRecords)); List<MessagePushRecordEntity> appRecords = pushRecords.stream().filter(record -> MessageConstants.APP_PUSH.equals(record.getType())).collect(Collectors.toList());
// 推送消息 - app
Boolean appFlag = recordService.sendAppMsgByUsers(request, appRecords);
// 推送消息 - web
Boolean wsFlag = recordService.sendWsMsgByUsers(new ArrayList<>(CollectionUtils.subtract(pushRecords, appRecords)));
return R.data(appFlag && wsFlag);
} }
else { else {
return R.data(false); return R.data(false);

Loading…
Cancel
Save