Browse Source

短信多人推送,保存多条记录

zhongwei
ty 8 months ago
parent
commit
2753a76c04
  1. 4
      hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java

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

@ -180,13 +180,13 @@ public class MessageClient extends BladeController implements IMessageClient{
@PostMapping(SEND_SMS_IMMEDIATELY_MSG)
public R<Boolean> sendSmsImmediatelyMsg(@RequestBody SmsImmediatelyPushDTO smsImmediatelyPushDTO) {
try {
MessagePushRecordEntity record = BeanUtil.copy(smsImmediatelyPushDTO, MessagePushRecordEntity.class);
record.setMessageId(IdWorker.getId());
for (Long pushId : Func.toLongList(",", smsImmediatelyPushDTO.getPusher())) {
User user = UserCache.getUser(pushId);
if (ObjectUtil.isEmpty(user)||ObjectUtil.isEmpty(user.getPhone())){
continue;
}
MessagePushRecordEntity record = BeanUtil.copy(smsImmediatelyPushDTO, MessagePushRecordEntity.class);
record.setMessageId(IdWorker.getId());
record.setPusherName(user.getRealName());
record.setPusher(pushId.toString());
record.setPushType(MessageConstants.IMMEDIATELY);

Loading…
Cancel
Save