| 
					
				 | 
			
			
				@ -1,10 +1,8 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				package com.yihu.jw.care.util; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.alibaba.fastjson.JSON; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.alibaba.fastjson.JSONObject; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.doctor.dao.BaseDoctorDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.doctor.BaseDoctorDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.wx.BasePatientWechatDo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.wx.WxAccessTokenDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.wx.WxTemplateConfigDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.care.doorCoach.BaseDoorCoachOrderDO; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -13,10 +11,8 @@ import com.yihu.jw.entity.care.securitymonitoring.SecurityMonitoringOrderDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.hospital.message.SystemMessageDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.message.dao.SystemMessageDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.patient.dao.BasePatientDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.date.DateUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.http.HttpClientUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.wechat.WeixinMessagePushUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.wechat.wxhttp.HttpUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.wechat.dao.WxAccessTokenDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.wechat.dao.WxTemplateConfigDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.wechat.service.WxAccessTokenService; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -27,7 +23,6 @@ import org.slf4j.LoggerFactory; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.beans.BeanUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.beans.factory.annotation.Autowired; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.beans.factory.annotation.Value; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.jdbc.core.BeanPropertyRowMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.jdbc.core.JdbcTemplate; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.stereotype.Component; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -77,10 +72,11 @@ public class MessageUtil { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param url 跳转链接 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param remark 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param type  模板通知类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param josn 用于对跳转连接的修改, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param json 用于对跳转连接的修改, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param keywords 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public void putTemplateWxMessage(String wechatId, String templateName, String scene, String openId, String first,String url, String remark, Integer type,JSONObject josn,String ...keywords) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public void putTemplateWxMessage(String wechatId, String templateName, String scene, String openId, String first 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ,String url, String remark, Integer type,JSONObject json,String ...keywords) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            System.out.println(wechatId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -106,7 +102,7 @@ public class MessageUtil { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (StringUtils.isNoneBlank(remark)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                newConfig.setRemark(remark); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            newConfig = setTemPlateUrl(newConfig,type,openId,josn); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            newConfig = setTemPlateUrl(newConfig,type,openId,json); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            int keyLength = keywords.length; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (keyLength >= 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               if(StringUtils.isNoneBlank(keywords[0])){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -158,6 +154,11 @@ public class MessageUtil { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return wxTemplateConfigDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        switch (type){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            case 1: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //咨询回复 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                wxTemplateConfigDO.setUrl(wxTemplateConfigDO.getUrl() + "?sessionId=" + json.getString("sessionId") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        +"&type="+json.getString("consultType")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            case 19: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String urlStr= wxTemplateConfigDO.getUrl(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                boolean status = urlStr.contains("openid="); 
			 |