审核增加服务通知

main
rong.liu 11 months ago
parent a0a568ba55
commit 3e05b6a517
  1. 3
      nakadai/src/main/java/com/huoran/nakadai/controller/EnterpriseCertificationController.java
  2. 6
      nakadai/src/main/java/com/huoran/nakadai/utils/WeChatUtil.java

@ -149,7 +149,7 @@ public class EnterpriseCertificationController {
wxMssVo.setRequest_url("https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=" + accessToken); wxMssVo.setRequest_url("https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=" + accessToken);
//将模板中的值一一赋值 发送到小程序的数据要转化为json格式 可以使用下面的方法直接拼接成JSONObject //将模板中的值一一赋值 发送到小程序的数据要转化为json格式 可以使用下面的方法直接拼接成JSONObject
//使用map结合模板 后续再加遍历拼接成JSONObject //使用map结合模板 后续再加遍历拼接成JSONObject
HashMap<String, Object> map = new HashMap<>(3); HashMap<String, Object> map = new HashMap<>(4);
map.put("thing1", details.getCompanyName());//公司名称 map.put("thing1", details.getCompanyName());//公司名称
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@ -161,6 +161,7 @@ public class EnterpriseCertificationController {
//通过:更改认证状态 认证状态(0默认未认证 1.认证中2.已认证) //通过:更改认证状态 认证状态(0默认未认证 1.认证中2.已认证)
enterpriseCertification.setAuthenticationStatus(2); enterpriseCertification.setAuthenticationStatus(2);
authenticationStatus = "通过"; authenticationStatus = "通过";
map.put("thing3", "无");//备注
break; break;
case 3: case 3:
//不通过 //不通过

@ -60,9 +60,9 @@ public class WeChatUtil {
// String appid = PropUtils.getProp("APPID"); // String appid = PropUtils.getProp("APPID");
// String appsecret = PropUtils.getProp("APPSECRET"); // String appsecret = PropUtils.getProp("APPSECRET");
// 微信小程序ID // 微信小程序ID
String appid = WeChatPropertiesUtil.PARTNER_WX_OPEN_APP_ID; String appid = WeChatPropertiesUtil.KINDERGARTEN_WX_OPEN_APP_ID;
// 微信小程序秘钥 // 微信小程序秘钥
String appsecret =WeChatPropertiesUtil.PARTNER_WX_OPEN_APP_SECRET; String appsecret =WeChatPropertiesUtil.KINDERGARTEN_WX_OPEN_APP_SECRET;
//构建url,用于向微信服务器请求用户的openId //构建url,用于向微信服务器请求用户的openId
StringBuffer url = new StringBuffer("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&"); StringBuffer url = new StringBuffer("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&");
@ -75,7 +75,7 @@ public class WeChatUtil {
HttpResponse httpResponse = client.execute(httpGet); HttpResponse httpResponse = client.execute(httpGet);
HttpEntity result = httpResponse.getEntity(); HttpEntity result = httpResponse.getEntity();
String resultStr = EntityUtils.toString(result); String resultStr = EntityUtils.toString(result);
System.out.println(resultStr); System.err.println(resultStr);
JSONObject resultJsonObject = JSONUtil.parseObj(resultStr); JSONObject resultJsonObject = JSONUtil.parseObj(resultStr);
String accessToken = (String) resultJsonObject.get("access_token"); String accessToken = (String) resultJsonObject.get("access_token");
return accessToken; return accessToken;

Loading…
Cancel
Save