Kaynağa Gözat

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

trick9191 7 yıl önce
ebeveyn
işleme
b29b6fbc28

+ 4 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/common/account/CustomerController.java

@ -188,7 +188,10 @@ public class CustomerController extends BaseController {
            type="3";
        }
        Map<String, Object> resp = customerService.sendMsg(doctor,msg,type);
        return write(200,"","data",resp);
        if(resp.size()==0){
            return write(200,"发送成功");
        }
        return write(-1,"发送失败","data",resp);
    }
}

+ 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) {
		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;
	}
}