|
|
@ -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); |
|
|
|