diff --git a/backend/src/main/java/io/metersphere/notice/domain/MessageDetail.java b/backend/src/main/java/io/metersphere/notice/domain/MessageDetail.java index beec1d3866..799d0d1c1f 100644 --- a/backend/src/main/java/io/metersphere/notice/domain/MessageDetail.java +++ b/backend/src/main/java/io/metersphere/notice/domain/MessageDetail.java @@ -2,11 +2,12 @@ package io.metersphere.notice.domain; import lombok.Data; +import java.io.Serializable; import java.util.ArrayList; import java.util.List; @Data -public class MessageDetail { +public class MessageDetail implements Serializable { private List userIds = new ArrayList<>(); private String id; private String event; diff --git a/backend/src/main/java/io/metersphere/notice/sender/NoticeModel.java b/backend/src/main/java/io/metersphere/notice/sender/NoticeModel.java index c5620e6741..557e004c31 100644 --- a/backend/src/main/java/io/metersphere/notice/sender/NoticeModel.java +++ b/backend/src/main/java/io/metersphere/notice/sender/NoticeModel.java @@ -4,12 +4,13 @@ import io.metersphere.notice.domain.Receiver; import lombok.Builder; import lombok.Data; +import java.io.Serializable; import java.util.List; import java.util.Map; @Data @Builder -public class NoticeModel { +public class NoticeModel implements Serializable { /** * 保存 测试id */ diff --git a/backend/src/main/java/io/metersphere/notice/service/NoticeSendService.java b/backend/src/main/java/io/metersphere/notice/service/NoticeSendService.java index 4416bd42f3..7ade77f52d 100644 --- a/backend/src/main/java/io/metersphere/notice/service/NoticeSendService.java +++ b/backend/src/main/java/io/metersphere/notice/service/NoticeSendService.java @@ -8,6 +8,7 @@ import io.metersphere.notice.domain.MessageDetail; import io.metersphere.notice.sender.AbstractNoticeSender; import io.metersphere.notice.sender.NoticeModel; import io.metersphere.notice.sender.impl.*; +import org.apache.commons.lang3.SerializationUtils; import org.springframework.stereotype.Component; import javax.annotation.Resource; @@ -66,7 +67,9 @@ public class NoticeSendService { messageDetails.stream() .filter(messageDetail -> StringUtils.equals(messageDetail.getEvent(), noticeModel.getEvent())) .forEach(messageDetail -> { - this.getNoticeSender(messageDetail).send(messageDetail, noticeModel); + MessageDetail m = SerializationUtils.clone(messageDetail); + NoticeModel n = SerializationUtils.clone(noticeModel); + this.getNoticeSender(m).send(m, n); }); } catch (Exception e) { @@ -102,7 +105,9 @@ public class NoticeSendService { messageDetails.stream() .filter(messageDetail -> StringUtils.equals(messageDetail.getEvent(), noticeModel.getEvent())) .forEach(messageDetail -> { - this.getNoticeSender(messageDetail).send(messageDetail, noticeModel); + MessageDetail m = SerializationUtils.clone(messageDetail); + NoticeModel n = SerializationUtils.clone(noticeModel); + this.getNoticeSender(m).send(m, n); }); } catch (Exception e) { @@ -133,7 +138,9 @@ public class NoticeSendService { messageDetails.stream() .filter(messageDetail -> StringUtils.equals(messageDetail.getEvent(), noticeModel.getEvent())) .forEach(messageDetail -> { - this.getNoticeSender(messageDetail).send(messageDetail, noticeModel); + MessageDetail m = SerializationUtils.clone(messageDetail); + NoticeModel n = SerializationUtils.clone(noticeModel); + this.getNoticeSender(m).send(m, n); }); } catch (Exception e) {