|
@ -2,6 +2,7 @@ package com.yihu.wlyy.wechat.process;
|
|
|
|
|
|
import com.yihu.wlyy.entity.dict.SystemDict;
|
|
|
import com.yihu.wlyy.repository.dict.SystemDictDao;
|
|
|
import com.yihu.wlyy.service.common.account.PatientService;
|
|
|
import com.yihu.wlyy.task.PushMsgTask;
|
|
|
import com.yihu.wlyy.util.SystemConf;
|
|
|
import com.yihu.wlyy.wechat.util.WeiXinMessageReplyUtils;
|
|
@ -41,6 +42,9 @@ public class WeiXinEventProcess {
|
|
|
|
|
|
@Autowired
|
|
|
private SystemDictDao systemDictDao;
|
|
|
|
|
|
@Autowired
|
|
|
private PatientService patientService;
|
|
|
|
|
|
/**
|
|
|
* 微信推送事件处理
|
|
@ -64,6 +68,9 @@ public class WeiXinEventProcess {
|
|
|
result = subscribeEventProcess(message);
|
|
|
}
|
|
|
break;
|
|
|
case WeiXinMessageUtils.EVENT_TYPE_UNSUBSCRIBE: // 取消订阅事件
|
|
|
result = unsubscribeEventProcess(message);
|
|
|
break;
|
|
|
case WeiXinMessageUtils.EVENT_TYPE_CLICK: //菜单点击
|
|
|
result = this.clickProcess(message);
|
|
|
default:
|
|
@ -342,6 +349,25 @@ public class WeiXinEventProcess {
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 取消关注事件
|
|
|
* @param message
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
private String unsubscribeEventProcess(Map<String, String> message)throws Exception{
|
|
|
String result = "";
|
|
|
|
|
|
//居民openid
|
|
|
String patient_openid = message.get("FromUserName");
|
|
|
|
|
|
//如果居民取消关注,则清空该openid相关联的所有账号的Openid
|
|
|
if(StringUtils.isNotBlank(patient_openid)){
|
|
|
patientService.clearOpenidByOpenid(patient_openid);
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|