diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java index 8ccc2c505..16fb0781c 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java @@ -178,7 +178,7 @@ public class WxChannelMessageRouter { * @param wxMessage 消息 * @return 是否重复 */ - private boolean isMsgDuplicated(WxChannelMessage wxMessage) { + protected boolean isMsgDuplicated(WxChannelMessage wxMessage) { String messageId = this.generateMessageId(wxMessage); return this.messageDuplicateChecker.isDuplicate(messageId); } @@ -188,7 +188,7 @@ public class WxChannelMessageRouter { * * @return 消息id */ - private String generateMessageId(WxChannelMessage wxMessage) { + protected String generateMessageId(WxChannelMessage wxMessage) { StringBuilder sb = new StringBuilder(); if (wxMessage.getMsgId() == null) { sb.append(wxMessage.getCreateTime()) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/message/WxCpMessageRouter.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/message/WxCpMessageRouter.java index e2daeab54..a2417ec86 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/message/WxCpMessageRouter.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/message/WxCpMessageRouter.java @@ -258,7 +258,7 @@ public class WxCpMessageRouter { return this.route(wxMessage, new HashMap<>(2)); } - private boolean isMsgDuplicated(WxCpXmlMessage wxMessage) { + protected boolean isMsgDuplicated(WxCpXmlMessage wxMessage) { StringBuilder messageId = new StringBuilder(); if (wxMessage.getMsgId() == null) { messageId.append(wxMessage.getCreateTime()) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/message/WxCpTpMessageRouter.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/message/WxCpTpMessageRouter.java index 1df52149c..8887a23d5 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/message/WxCpTpMessageRouter.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/message/WxCpTpMessageRouter.java @@ -278,7 +278,7 @@ public class WxCpTpMessageRouter { return this.route(wxMessage, new HashMap<>(2)); } - private boolean isMsgDuplicated(final String suiteId, WxCpTpXmlMessage wxMessage) { + protected boolean isMsgDuplicated(final String suiteId, WxCpTpXmlMessage wxMessage) { StringBuilder messageId = new StringBuilder(); messageId.append(wxMessage.getToUserName()); if (wxMessage.getInfoType() != null) { @@ -306,7 +306,8 @@ public class WxCpTpMessageRouter { .append("-").append(wxMessage.getCreateTime()) .append("-").append(wxMessage.getFromUserName()) .append("-").append(StringUtils.trimToEmpty(wxMessage.getEvent())) - .append("-").append(StringUtils.trimToEmpty(wxMessage.getEventKey())); + .append("-").append(StringUtils.trimToEmpty(wxMessage.getEventKey())) + .append("-").append(StringUtils.trimToEmpty(wxMessage.getExternalUserID())); } } diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/message/WxMaMessageRouter.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/message/WxMaMessageRouter.java index 6cd603929..3d81b6d66 100644 --- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/message/WxMaMessageRouter.java +++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/message/WxMaMessageRouter.java @@ -173,7 +173,7 @@ public class WxMaMessageRouter { return this.route(wxMessage, new HashMap<>(2)); } - private boolean isMsgDuplicated(WxMaMessage wxMessage) { + protected boolean isMsgDuplicated(WxMaMessage wxMessage) { StringBuilder messageId = new StringBuilder(); if (wxMessage.getMsgId() == null) { messageId.append(wxMessage.getCreateTime()) diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpMessageRouter.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpMessageRouter.java index 070e952c0..f2a28c668 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpMessageRouter.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpMessageRouter.java @@ -315,7 +315,7 @@ public class WxMpMessageRouter { return this.route(appid, wxMessage, new HashMap<>(2)); } - private boolean isMsgDuplicated(WxMpXmlMessage wxMessage) { + protected boolean isMsgDuplicated(WxMpXmlMessage wxMessage) { StringBuilder messageId = new StringBuilder(); if (wxMessage.getMsgId() == null) { messageId.append(wxMessage.getCreateTime())