刘韬 5 år sedan
förälder
incheckning
29e1f2cff2

+ 2 - 1
PacsOnline_Wechat_Patient/src/main/java/com/zskk/controller/WeixinApiController.java

@@ -122,7 +122,8 @@ public class WeixinApiController extends ApiController {
         String openid = getPara("openid");
 		WeixinService wService = ServiceFactory.getService(WeixinService.class);
 		String urlString = "http://wechat.client.pacsonline.cn/#/pay?openid="+openid;
-		wService.sendTemplateMsg(openid, urlString, "a", pushType);
+		ApiResult apiResult = wService.sendTemplateMsg(openid, urlString, "a", pushType);
+		renderJson(apiResult);
 
     }
     

+ 6 - 3
PacsOnline_Wechat_Patient/src/main/java/com/zskk/service/WeixinService.java

@@ -127,8 +127,9 @@ public class WeixinService {
 	/*
 	 * 发送模板消息
 	 */
-	public void sendTemplateMsg(String openid, String url, String userName,Integer pushtype) {
+	public ApiResult sendTemplateMsg(String openid, String url, String userName,Integer pushtype) {
 		PUSH_TYPE dType2 = null;
+		ApiResult apiResult = null;
 		for (PUSH_TYPE xxxEnum : PUSH_TYPE.values()) {
 			if (xxxEnum.getPushType() == pushtype) {
 				dType2 = xxxEnum;
@@ -136,15 +137,16 @@ public class WeixinService {
 		}
 		switch (dType2) {
 		case REMOTE_DIAGNOSIS_PATIENT_PAY:
-			sendRemoteDiagnosisPatientPayMsg(openid,url,userName);
+			apiResult = sendRemoteDiagnosisPatientPayMsg(openid,url,userName);
 			break;
 
 		default:
 			break;
 		}
+		return apiResult;
 	}
 	
-	public void sendRemoteDiagnosisPatientPayMsg(String openid, String url, String userName) {
+	public ApiResult sendRemoteDiagnosisPatientPayMsg(String openid, String url, String userName) {
 		String str = " {\n" +
                 "           \"touser\":\""+openid+"\",\n" +
                 "           \"template_id\":\"VZ0Y3yj6N6187EggHdtdUZYcdQ-UycrjKCZKjqLn60Y\",\n" +
@@ -182,6 +184,7 @@ public class WeixinService {
                 "           }\n" +
                 "       }";
         ApiResult apiResult = TemplateMsgApi.send(str);
+        return apiResult;
 	}
 	public static String getParamByUrl(String url, String name) {
 	    url += "&";