记得上下班打卡 | git大法好,push需谨慎

Commit 10b03c74 authored by jiangxiulong's avatar jiangxiulong

关注公众号 判断摩登的话不发送模版消息

parent 77db0b9a
......@@ -20,7 +20,6 @@ import me.chanjar.weixin.mp.bean.result.WxMpUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
import java.util.LinkedList;
import java.util.Map;
......@@ -85,7 +84,7 @@ public class SubscribeHandler implements WxMpMessageHandler {
// 入缓存
redisDataUtils.setSweetWechatUser(sweetWechatUser);
//发送模版消息
sweetWechatTemplateService.subscribeSend(sweetWechatUser);
sweetWechatTemplateService.subscribeSend(wxMpService, sweetWechatUser);
}
return null;
......
......@@ -157,7 +157,10 @@ public class SweetWechatTemplateServiceImpl {
return ResponseDto.success();
}
public void subscribeSend(SweetWechatUser sweetWechatUser) {
public void subscribeSend(WxMpService wxMpService, SweetWechatUser sweetWechatUser) {
String zhengzaiAppId = wechatMpConfigure.getWxMpService(1).getWxMpConfigStorage().getAppId();
String otherAppId = wxMpService.getWxMpConfigStorage().getAppId();
if (zhengzaiAppId.equals(otherAppId)) {
String templateId = "y-j82V1TYhlTH1j8QscuDPcPQtNiDtENb7N5IZMBvqU";
try {
String nowTime = DateUtil.getNowTime();
......@@ -182,6 +185,9 @@ public class SweetWechatTemplateServiceImpl {
} catch (Exception e) {
log.error("关注模版消息处理异常", e);
}
} else {
log.info("不是正在, 不发模版消息");
}
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment