价保
This commit is contained in:
@@ -20,6 +20,7 @@ import org.springframework.stereotype.Component;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
/**
|
||||
* @author Leo
|
||||
@@ -81,7 +82,7 @@ public class WXUtil {
|
||||
private final MessageProducerService messageProducerService;
|
||||
public int sendTimes = 0;
|
||||
private Environment env;
|
||||
|
||||
private static boolean restartNoticeSent = false;
|
||||
@Autowired
|
||||
public WXUtil(Environment env, WxtsUtil wxTsUtil, @Lazy MessageProducerService messageProducerService) {
|
||||
this.messageProducerService = messageProducerService;
|
||||
@@ -124,6 +125,9 @@ public class WXUtil {
|
||||
|
||||
// 初始化超级管理员
|
||||
public void initSuperAdmins() {
|
||||
if (restartNoticeSent) {
|
||||
return;
|
||||
}
|
||||
SuperAdmin admin1 = new SuperAdmin("wxid_ytpc72mdoskt22", "凡", "2014264913", "98e21c89ae5610240ec3f5f575f86a59", "3dcb6b23a1104639ac433fd07adb6dfb");
|
||||
super_admins.put(admin1.getWxid() + admin1.getUnionId(), admin1);
|
||||
jdidToWxidMap.put(admin1.getUnionId(), admin1.getWxid());
|
||||
@@ -211,11 +215,20 @@ public class WXUtil {
|
||||
// 舵手群(48621589056@chatroom):"曲莉亚@河南慧推电子商务有限公司、齐学法@河南慧推电子商务有限公司"为企业微信用户,<_wc_custom_link_ href="https://weixin.qq.com/cgi-bin/newreadtemplate?t=work_wechat/about_group">了解更多</_wc_custom_link_>。
|
||||
chatRoom_xb.put("48621589056@chatroom", "舵手");
|
||||
|
||||
//发送通知到微信
|
||||
String messageContent = "Jarvis 重启完成 [亲亲][亲亲][亲亲] ";
|
||||
String fromWxid = default_bot_wxid; // 来源为机器人自身
|
||||
|
||||
super_admins.forEach((wxid, superAdmin) -> {
|
||||
sendTextMessage(wxid, "Jarvis 重启完成 [亲亲][亲亲][亲亲] ", 1, wxid, false);
|
||||
try {
|
||||
// 异步发送,不影响启动流程
|
||||
CompletableFuture.runAsync(() -> sendTextMessage(wxid.substring(0, 19), messageContent, 1, fromWxid, false));
|
||||
} catch (Exception e) {
|
||||
logger.warn("发送重启通知失败,目标 wxid: {}", wxid, e);
|
||||
}
|
||||
});
|
||||
|
||||
restartNoticeSent = true;
|
||||
|
||||
}
|
||||
|
||||
// 获取微信列表
|
||||
|
||||
Reference in New Issue
Block a user