|
@ -3,6 +3,7 @@ package com.yihu.wlyy.service.weixin;
|
|
|
import com.yihu.wlyy.entity.patient.SignFamily;
|
|
|
import com.yihu.wlyy.repository.patient.SignFamilyDao;
|
|
|
import com.yihu.wlyy.service.BaseService;
|
|
|
import com.yihu.wlyy.web.WeixinBaseController;
|
|
|
import com.yihu.wlyy.wechat.process.WeiXinEventProcess;
|
|
|
import com.yihu.wlyy.wechat.util.WeiXinMessageUtils;
|
|
|
import org.dom4j.Document;
|
|
@ -12,6 +13,8 @@ import org.dom4j.Element;
|
|
|
import org.dom4j.io.SAXReader;
|
|
|
import org.json.JSONException;
|
|
|
import org.json.JSONObject;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@ -28,6 +31,7 @@ import java.util.Map;
|
|
|
*/
|
|
|
@Service
|
|
|
public class WeiXinCoreService extends BaseService {
|
|
|
private Logger logger= LoggerFactory.getLogger(WeiXinCoreService.class);
|
|
|
@Autowired
|
|
|
private WeiXinEventProcess weiXinEventProcess;
|
|
|
|
|
@ -58,7 +62,7 @@ public class WeiXinCoreService extends BaseService {
|
|
|
Element ele = (Element) e;
|
|
|
message.put(ele.getName(), ele.getText());
|
|
|
}
|
|
|
System.out.println("weixin event:" + message.toString());
|
|
|
logger.info("weixin event:" + message.toString());
|
|
|
// 释放资源
|
|
|
inputStream.close();
|
|
|
// 添加access_token参数
|
|
@ -91,9 +95,9 @@ public class WeiXinCoreService extends BaseService {
|
|
|
String content = message.get("Content");
|
|
|
if ("续签".equals(content)){
|
|
|
// 发送续签和签约图文消息
|
|
|
System.out.print("content======? "+content);
|
|
|
logger.info("content======? "+content);
|
|
|
result = weiXinEventProcess.replyKeyword(message);
|
|
|
System.out.print("图文结束======? ");
|
|
|
logger.info("图文结束======? ");
|
|
|
}
|
|
|
break;
|
|
|
default:
|