diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/impl/DingCustomNoticeSender.java b/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/impl/DingCustomNoticeSender.java index 23b9eb39e1..62e79a5257 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/impl/DingCustomNoticeSender.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/impl/DingCustomNoticeSender.java @@ -1,13 +1,12 @@ package io.metersphere.system.notice.sender.impl; +import io.metersphere.sdk.util.LogUtils; +import io.metersphere.system.domain.User; import io.metersphere.system.notice.MessageDetail; import io.metersphere.system.notice.NoticeModel; import io.metersphere.system.notice.Receiver; import io.metersphere.system.notice.sender.AbstractNoticeSender; import io.metersphere.system.notice.utils.DingClient; -import io.metersphere.sdk.util.LogUtils; -import io.metersphere.system.domain.User; -import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; import java.util.List; @@ -25,8 +24,7 @@ public class DingCustomNoticeSender extends AbstractNoticeSender { List mobileList = users.stream().map(User::getPhone).toList(); LogUtils.info("钉钉自定义机器人收件人: {}", userIds); - context += StringUtils.join(mobileList, StringUtils.SPACE); - DingClient.send(messageDetail.getWebhook(), "消息通知: \n" + context, mobileList); + DingClient.send(messageDetail.getWebhook(), messageDetail.getSubject()+": \n" + context, mobileList); } @Override diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/impl/LarkNoticeSender.java b/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/impl/LarkNoticeSender.java index 559ded82d1..7d8101e1e5 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/impl/LarkNoticeSender.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/impl/LarkNoticeSender.java @@ -28,7 +28,7 @@ public class LarkNoticeSender extends AbstractNoticeSender { LogUtils.info("飞书收件人: {}", userIds); context += StringUtils.join(collect, StringUtils.SPACE); - LarkClient.send(messageDetail.getWebhook(), "消息通知: \n" + context); + LarkClient.send(messageDetail.getWebhook(), messageDetail.getSubject()+": \n" + context); } @Override diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/impl/WeComNoticeSender.java b/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/impl/WeComNoticeSender.java index 4679f82ab5..d703d5f2a2 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/impl/WeComNoticeSender.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/impl/WeComNoticeSender.java @@ -1,13 +1,12 @@ package io.metersphere.system.notice.sender.impl; +import io.metersphere.sdk.util.LogUtils; +import io.metersphere.system.domain.User; import io.metersphere.system.notice.MessageDetail; import io.metersphere.system.notice.NoticeModel; import io.metersphere.system.notice.Receiver; import io.metersphere.system.notice.sender.AbstractNoticeSender; import io.metersphere.system.notice.utils.WeComClient; -import io.metersphere.sdk.util.LogUtils; -import io.metersphere.system.domain.User; -import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; import java.util.List; @@ -24,8 +23,7 @@ public class WeComNoticeSender extends AbstractNoticeSender { List users = super.getUsers(userIds); List mobileList = users.stream().map(User::getPhone).toList(); LogUtils.info("企业微信收件人: {}", userIds); - context += StringUtils.join(mobileList, StringUtils.SPACE); - WeComClient.send(messageDetail.getWebhook(), "消息通知: \n" + context, mobileList); + WeComClient.send(messageDetail.getWebhook(), messageDetail.getSubject()+": \n" + context, mobileList); } @Override