refactor: 处理接收人修改

This commit is contained in:
Captain.B 2021-08-23 18:42:20 +08:00 committed by 刘瑞斌
parent 01d03092c2
commit fe6d5b3310
2 changed files with 16 additions and 16 deletions

View File

@ -131,19 +131,19 @@ public abstract class AbstractNoticeSender implements NoticeSender {
}
break;
case NoticeConstants.RelatedUser.CREATOR:
Object creator = paramMap.get("creator");
Object createUser = paramMap.get("createUser");
Object createUserId = paramMap.get("createUserId");
Object userId1 = paramMap.get("userId");
String creator = (String) paramMap.get("creator");
String createUser = (String) paramMap.get("createUser");
String createUserId = (String) paramMap.get("createUserId");
String userId1 = (String) paramMap.get("userId");
if (userId1 != null) {
toUsers.add(new Receiver(userId1.toString(), NotificationConstants.Type.SYSTEM_NOTICE.name()));
} else if (creator != null) {
toUsers.add(new Receiver(creator.toString(), NotificationConstants.Type.SYSTEM_NOTICE.name()));
} else if (createUser != null) {
toUsers.add(new Receiver(createUser.toString(), NotificationConstants.Type.SYSTEM_NOTICE.name()));
} else if (createUserId != null) {
toUsers.add(new Receiver(createUserId.toString(), NotificationConstants.Type.SYSTEM_NOTICE.name()));
if (StringUtils.isNotBlank(userId1)) {
toUsers.add(new Receiver(userId1, NotificationConstants.Type.SYSTEM_NOTICE.name()));
} else if (StringUtils.isNotBlank(creator)) {
toUsers.add(new Receiver(creator, NotificationConstants.Type.SYSTEM_NOTICE.name()));
} else if (StringUtils.isNotBlank(createUser)) {
toUsers.add(new Receiver(createUser, NotificationConstants.Type.SYSTEM_NOTICE.name()));
} else if (StringUtils.isNotBlank(createUserId)) {
toUsers.add(new Receiver(createUserId, NotificationConstants.Type.SYSTEM_NOTICE.name()));
}
break;
case NoticeConstants.RelatedUser.MAINTAINER:
@ -156,9 +156,9 @@ public abstract class AbstractNoticeSender implements NoticeSender {
}
break;
case NoticeConstants.RelatedUser.FOLLOW_PEOPLE:
Object followPeople = paramMap.get("followPeople");
if (followPeople != null) {
toUsers.add(new Receiver(followPeople.toString(), NotificationConstants.Type.SYSTEM_NOTICE.name()));
String followPeople = (String) paramMap.get("followPeople");
if (StringUtils.isNotBlank(followPeople)) {
toUsers.add(new Receiver(followPeople, NotificationConstants.Type.SYSTEM_NOTICE.name()));
}
break;
default:

View File

@ -27,7 +27,7 @@ public class InSiteNoticeSender extends AbstractNoticeSender {
return;
}
LogUtil.info("发送站内通知: {}", messageDetail.getUserIds());
LogUtil.info("发送站内通知: {}", receivers);
receivers.forEach(receiver -> {
Map<String, Object> paramMap = noticeModel.getParamMap();