diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/WxAccountUtil.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/WxAccountUtil.java index 08a0a11..461531e 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/util/WxAccountUtil.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/WxAccountUtil.java @@ -23,11 +23,11 @@ import java.util.Map; @Component public class WxAccountUtil { @Value("${wx.ysk.appId}") - private static String appId = "wx212769170d2c6b2a"; + private String appId = "wx212769170d2c6b2a"; @Value("${wx.ysk.secrete}") - private static String secrete = "8492a7e8d55bbb1b57f5c8276ea1add0"; + private String secrete = "8492a7e8d55bbb1b57f5c8276ea1add0"; @Value("${wx.ysk.warnMsgTmpId}") - private static String msgTmpId = "C08OUr80x6wGmUN1zpFhSQ3Sv7VF5vksdZigiEx2pD0"; + private String msgTmpId = "C08OUr80x6wGmUN1zpFhSQ3Sv7VF5vksdZigiEx2pD0"; private final TbShopMsgStateMapper shopMsgStateMapper; static LinkedHashMap linkedHashMap=new LinkedHashMap<>(); @@ -49,7 +49,7 @@ public class WxAccountUtil { // sendStockWarnMsg("13213", "31123", "234", "ojC-S6n2DDlpj52iVMoiLL0Ry4HI"); } - public static String getRadarQrCode(Integer shopId) { + public String getRadarQrCode(Integer shopId) { HashMap req = new HashMap<>(); req.put("expire_seconds", 300); req.put("action_name", "QR_STR_SCENE"); @@ -70,7 +70,7 @@ public class WxAccountUtil { } - public static String getAccessToken() { + public String getAccessToken() { String resp = HttpUtil.get(StrUtil.format("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={}&secret={}", appId, secrete)); JSONObject respInfo = JSONObject.parseObject(resp); if (!respInfo.containsKey("access_token")) { @@ -80,7 +80,7 @@ public class WxAccountUtil { return respInfo.getString("access_token"); } - public static JSONObject sendTemplateMsg(String templateId, String toUserOpenId, Map data) { + public JSONObject sendTemplateMsg(String templateId, String toUserOpenId, Map data) { log.info("开始发送微信模板消息, 接收用户openId: {}, 消息数据: {}", toUserOpenId, data); String accessToken = getAccessToken();