|
@@ -123,7 +123,7 @@ public class WxGzhServiceImpl implements IWxGzhService {
|
|
String msgType = jsonObjectData.getStr("MsgType");
|
|
String msgType = jsonObjectData.getStr("MsgType");
|
|
//获取用户信息
|
|
//获取用户信息
|
|
String userInfoResult = wxSendService.userInfo(this.getGzhToken(), fromUserName, "zh_CN");
|
|
String userInfoResult = wxSendService.userInfo(this.getGzhToken(), fromUserName, "zh_CN");
|
|
- System.out.println("userInfoResult:"+userInfoResult);
|
|
|
|
|
|
+ System.out.println("userInfoResult:"+userInfoResult);
|
|
JSONObject userInfoJson = JSONObject.parseObject(userInfoResult);
|
|
JSONObject userInfoJson = JSONObject.parseObject(userInfoResult);
|
|
|
|
|
|
// 普通消息
|
|
// 普通消息
|
|
@@ -141,6 +141,8 @@ public class WxGzhServiceImpl implements IWxGzhService {
|
|
log.info("3.1...");
|
|
log.info("3.1...");
|
|
String unionId = userInfoJson.getString("unionid");
|
|
String unionId = userInfoJson.getString("unionid");
|
|
String openId = userInfoJson.getString("openid");
|
|
String openId = userInfoJson.getString("openid");
|
|
|
|
+ System.out.println("unionId:"+unionId);
|
|
|
|
+ System.out.println("openId:"+openId);
|
|
UserInfo userInfoDB = userService.getStudentByUnionId(unionId);
|
|
UserInfo userInfoDB = userService.getStudentByUnionId(unionId);
|
|
if (userInfoDB == null) {
|
|
if (userInfoDB == null) {
|
|
UserInfo userInfo = new UserInfo();
|
|
UserInfo userInfo = new UserInfo();
|
|
@@ -165,6 +167,7 @@ public class WxGzhServiceImpl implements IWxGzhService {
|
|
return result;
|
|
return result;
|
|
} else if (MessageUtil.MESSAGE_UNSUBSCRIBE.equals(event)) { // 取消订阅事件
|
|
} else if (MessageUtil.MESSAGE_UNSUBSCRIBE.equals(event)) { // 取消订阅事件
|
|
log.info("3.2...");
|
|
log.info("3.2...");
|
|
|
|
+ log.info("fromUserName:"+fromUserName);
|
|
UserInfo userInfoDB = userService.getStudentByOpenId(fromUserName);
|
|
UserInfo userInfoDB = userService.getStudentByOpenId(fromUserName);
|
|
if (userInfoDB != null) {
|
|
if (userInfoDB != null) {
|
|
userInfoDB.setGzhOpenid(null);
|
|
userInfoDB.setGzhOpenid(null);
|