瀏覽代碼

发送短信,增加提示用户关注微信号

chenyongxing 7 年之前
父節點
當前提交
05df868e15

+ 14 - 16
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/account/CustomerService.java

@ -113,22 +113,6 @@ public class CustomerService{
	public Map<String, Object> sendMsg(Doctor doctor,String msg,String type) {
	public Map<String, Object> sendMsg(Doctor doctor,String msg,String type) {
		Map<String, Object> resp = new HashMap<String, Object>();
		Map<String, Object> resp = new HashMap<String, Object>();
		//发送短信消息啦
		String mobile = doctor.getMobile();
		//
		if(!StringUtils.isBlank(mobile)&&!"2".equals(type)){
			List<NameValuePair> par = new ArrayList<NameValuePair>();
			par.add(new BasicNameValuePair("mobiles", mobile));
			par.add(new BasicNameValuePair("content", msg));
			String result = HttpClientUtil.post(messageApi+"/sendMobileMessage",par,"UTF-8");
			JSONObject resultJson = new JSONObject(result);
			if(1!=resultJson.getInt("successNum")){
				resp.put("mobile","-1");//-1代表发送失败
			}
		}
		//发送微信消息啦
		//发送微信消息啦
		String openId = doctor.getOpenid();
		String openId = doctor.getOpenid();
		if(!StringUtils.isBlank(openId)&&!"1".equals(type)){
		if(!StringUtils.isBlank(openId)&&!"1".equals(type)){
@ -142,6 +126,20 @@ public class CustomerService{
				resp.put("wechat","-1");//-1代表发送失败
				resp.put("wechat","-1");//-1代表发送失败
			}
			}
		}
		}
		//发送短信消息啦
		String mobile = doctor.getMobile();
		if(!StringUtils.isBlank(mobile)&&!"2".equals(type)){
			msg+="\n您可通过微信关注\"i健康智能助手\"公众号(微信号:厦门i健康)更快更便捷的获取服务信息。";
			List<NameValuePair> par = new ArrayList<NameValuePair>();
			par.add(new BasicNameValuePair("mobiles", mobile));
			par.add(new BasicNameValuePair("content", msg));
			String result = HttpClientUtil.post(messageApi+"/sendMobileMessage",par,"UTF-8");
			JSONObject resultJson = new JSONObject(result);
			if(1!=resultJson.getInt("successNum")){
				resp.put("mobile","-1");//-1代表发送失败
			}
		}
		return resp;
		return resp;
	}
	}
}
}