瀏覽代碼

Merge branch 'dev' of yeshijie/patient-co-management into dev

yeshijie 7 年之前
父節點
當前提交
b57bf09f09

+ 3 - 12
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/weixin/WeiXinCoreService.java

@ -1,9 +1,6 @@
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;
@ -11,8 +8,6 @@ import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
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;
@ -20,8 +15,6 @@ import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -42,13 +35,13 @@ public class WeiXinCoreService extends BaseService {
     * @param accessToken
     */
    public String messageProcess(HttpServletRequest request, String accessToken) {
        try {
        try (InputStream inputStream = request.getInputStream()){
            String returnStr = "";
            // 将解析结果存储在HashMap中
            Map<String, String> message = new HashMap();
            // 从request中取得输入流
            InputStream inputStream = request.getInputStream();
            // 读取输入流
            SAXReader reader = new SAXReader();
            Document document = reader.read(inputStream);
@ -62,9 +55,7 @@ public class WeiXinCoreService extends BaseService {
                Element ele = (Element) e;
                message.put(ele.getName(), ele.getText());
            }
            logger.info("weixin  event:" + message.toString());
            // 释放资源
            inputStream.close();
//            logger.info("weixin  event:" + message.toString());
            // 添加access_token参数
            message.put("token", accessToken);
            // 消息处理