|
@ -113,22 +113,6 @@ public class CustomerService{
|
|
|
public Map<String, Object> sendMsg(Doctor doctor,String msg,String type) {
|
|
|
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();
|
|
|
if(!StringUtils.isBlank(openId)&&!"1".equals(type)){
|
|
@ -142,6 +126,20 @@ public class CustomerService{
|
|
|
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;
|
|
|
}
|
|
|
}
|