Skip to content

Commit 5bf8d37

Browse files
committed
feat(0): [wcf-bmc]-修复配置文件open-msg-groups参数取值问题
1 parent cd922bc commit 5bf8d37

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

clients/java/wcf-bmc/src/main/java/com/wechat/ferry/service/impl/WeChatMsgServiceImpl.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import java.util.ArrayList;
44
import java.util.Arrays;
5-
import java.util.HashMap;
5+
import java.util.LinkedHashMap;
66
import java.util.List;
77
import java.util.Map;
88
import java.util.stream.Collectors;
@@ -45,7 +45,7 @@ public void receiveMsg(String jsonString) {
4545
WxPpMsgDTO dto = JSON.parseObject(jsonString, WxPpMsgDTO.class);
4646
// 有开启的群聊配置
4747
if (weChatFerryProperties.getOpenMsgGroupSwitch() && !weChatFerryProperties.getOpenMsgGroups().isEmpty()) {
48-
Map<String, List<String>> openMsgGroupMap = new HashMap<>();
48+
Map<String, List<String>> openMsgGroupMap = new LinkedHashMap<>();
4949
String allFnNoStr = "";
5050
List<String> allFnNoList = new ArrayList<>();
5151
if (weChatFerryProperties.getOpenMsgGroups().containsKey("ALL")) {
@@ -79,6 +79,7 @@ public void receiveMsg(String jsonString) {
7979

8080
// 指定处理的群聊
8181
if (!openMsgGroupMap.isEmpty()) {
82+
log.debug("[收到消息后处理]-[汇总后的所有功能]-openMsgGroupMap:{}", openMsgGroupMap);
8283
List<String> fnNoList = new ArrayList<>();
8384
// 先执行所有群都需要执行的
8485
if (openMsgGroupMap.containsKey("ALL")) {
@@ -90,6 +91,7 @@ public void receiveMsg(String jsonString) {
9091
}
9192
// 需要执行的策略
9293
if (!CollectionUtils.isEmpty(fnNoList)) {
94+
log.debug("[收到消息后处理]-[汇总后的单群功能]-fnNoList:{},群号:{}", fnNoList, dto.getRoomId());
9395
for (String no : fnNoList) {
9496
// 根据功能号获取对应的策略
9597
ReceiveMsgStrategy receiveMsgStrategy = ReceiveMsgFactory.getStrategy(no);

clients/java/wcf-bmc/src/main/resources/application.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@ wechat:
3535
contacts-type-official:
3636
- weixinguanhaozhushou|微信公众平台
3737
# 接收消息回调开关
38-
open-msg-group-switch: false
38+
open-msg-group-switch: true
3939
# 需要开启消息处理的群
4040
open-msg-groups:
41-
# key:群编号 val:开启的功能号,对应ReceiveMsgChannelEnum枚举中的code
42-
ALL: '1'
43-
53257911730@chatroom: '1,2'
41+
# key:"[群编号]" val:开启的功能号,对应ReceiveMsgChannelEnum枚举中的code
42+
"[ALL]": '0,1'
43+
"[53257911730@chatroom]": '0,2,3'
44+
"[50501762866@chatroom]": '0,3'
4445
# 接收消息回调开关
4546
receive-msg-callback-switch: false
4647
# 接收消息回调地址

0 commit comments

Comments
 (0)