类 WeiXinUtil

java.lang.Object
com.sh.weixin.util.WeiXinUtil

public class WeiXinUtil extends Object

Description:

Title:首亨软件 - TSS/CRM等

从以下版本开始:
2014年2月13日
  • 字段详细资料

    • isTest

      public static boolean isTest
    • TOKEN

      public static String TOKEN
  • 构造器详细资料

    • WeiXinUtil

      public WeiXinUtil()
  • 方法详细资料

    • xml2Map

      public static Map<String,String> xml2Map(String xmlStr) throws org.jdom2.JDOMException, IOException
      将字符串转化后保存到Map对象中
      参数:
      xmlStr - String
      返回:
      Map
      抛出:
      org.jdom2.JDOMException - JDOMException
      IOException - IOException
    • clearCorpAccessTokenCacheValue

      public static void clearCorpAccessTokenCacheValue()
    • clearMPAccessTokenCacheValue

      public static void clearMPAccessTokenCacheValue()
    • clearXiaoAccessTokenCacheValue

      public static void clearXiaoAccessTokenCacheValue()
    • getCorpAccessToken

      public static String getCorpAccessToken()
      获取accessToken
      返回:
      String
    • getMpAccessToken

      public static String getMpAccessToken()
      获取accessToken
      返回:
      String
    • getXiaoAccessToken

      public static String getXiaoAccessToken()
      获取小程序accessToken
      返回:
      String
    • getMPTicket

      public static String getMPTicket()
      获取ticket
      返回:
      String
    • getWXWebConfig

      public static WXWebConfig getWXWebConfig(String url)
      获取页面请求对象
      参数:
      url - String
      返回:
      WXWebConfig
    • getCorpOAuthInfo

      public static OAuthCorpRet getCorpOAuthInfo(jakarta.servlet.http.HttpServletRequest request, String code)
      企业应用中的URL链接(包括自定义菜单或者消息中的链接),可以通过OAuth2.0验证接口来获取成员的身份信息
      参数:
      request - HttpServletRequest
      code - String
      返回:
      OAuthCorpRet
    • getOpenIdByCorpUserId

      public static String getOpenIdByCorpUserId(String userId)
      userid转换成openid
      参数:
      userId - String
      返回:
      String
    • getCorpUserIdByOpenId

      public static String getCorpUserIdByOpenId(String openId)
      openid转换成userid
      参数:
      openId - String
      返回:
      String
    • getMpUserInfo

      public static WXUser getMpUserInfo(String openId)
      获取用户基本信息
      参数:
      openId - String
      返回:
      WXUser
    • getMpOAuthInfo

      public static OAuthMpRet getMpOAuthInfo(jakarta.servlet.http.HttpServletRequest request, String code)
      订阅号应用中的URL链接(包括自定义菜单或者消息中的链接),可以通过OAuth2.0验证接口来获取成员的身份信息
      参数:
      request - HttpServletRequest
      code - String
      返回:
      OAuthMpRet
    • setUserInfoByCorpOAuth

      public static UserInfo setUserInfoByCorpOAuth(DataCenter dc, OAuthCorpRet oauthRet, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
      通过微信帐号获取系统用户
      参数:
      dc - DataCenter
      oauthRet - OAuthCorpRet
      request - HttpServletRequest
      response - HttpServletResponse
      返回:
      UserInfo
    • setUserInfoByWxUserId

      public static UserInfo setUserInfoByWxUserId(DataCenter dc, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String wxUserId)
    • clearCacheLogin

      public static void clearCacheLogin(jakarta.servlet.http.HttpServletRequest request)
      清除登陆信息
      参数:
      request - HttpServletRequest
    • clearCacheLogin

      public static void clearCacheLogin(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
      清除登陆信息
      参数:
      request - HttpServletRequest
      response - HttpServletResponse
    • getCacheWxUserId

      public static String getCacheWxUserId(jakarta.servlet.http.HttpServletRequest request)
    • getCacheWxOpenId

      public static String getCacheWxOpenId(jakarta.servlet.http.HttpServletRequest request)
    • getCacheMpWxOpenId

      public static String getCacheMpWxOpenId(jakarta.servlet.http.HttpServletRequest request)
    • sendMpKfMsg

      public static String[] sendMpKfMsg(String content, String... openIds)
      发送客服消息
      参数:
      content - String
      openIds - String[]
      返回:
      String[]
    • sendMpKfMsgSelf

      public static String[] sendMpKfMsgSelf(String[] msg)
      发送客服消息
      参数:
      msg - String[]
      返回:
      String[]