刘韬 3 years ago
parent
commit
2aca4b58c4

+ 10 - 5
PacsOnline_Wechat_Patient/src/main/java/com/zskk/controller/WeixinApiController.java

@@ -213,18 +213,22 @@ public class WeixinApiController extends ApiController {
 		}
 		}
 //		redirect("http://wechat.pacsonline.cn/wx_patient/api/getQrcode?appId=" + appId + "&reportId=" + reportId);
 //		redirect("http://wechat.pacsonline.cn/wx_patient/api/getQrcode?appId=" + appId + "&reportId=" + reportId);
         ApiConfigKit.setThreadLocalAppId(appId);
         ApiConfigKit.setThreadLocalAppId(appId);
-        getQrcode(reportId);
+        String urlString =  getQrcode(reportId);
+        if (urlString==null) {
+			renderNull();
+		}
+        renderText(urlString);
     }
     }
     
     
     /**
     /**
      * 获取参数二维码
      * 获取参数二维码
      */
      */
-    public void getQrcode(String reportId)
+    public String getQrcode(String reportId)
     {
     {
 		Report reports = Report.dao.findById(reportId);
 		Report reports = Report.dao.findById(reportId);
 		if (reportId == null || reports == null) {
 		if (reportId == null || reports == null) {
-			renderNull();
-			return;
+//			renderNull();
+			return null;
 		}
 		}
 //		if (reports.getQrCode() == null || reports.getQrCode().isEmpty()) {		
 //		if (reports.getQrCode() == null || reports.getQrCode().isEmpty()) {		
 		String str = "{\"expire_seconds\": 2592000, \"action_name\": \"QR_STR_SCENE\", \"action_info\": {\"scene\": {\"scene_str\": \"ReportQR_"
 		String str = "{\"expire_seconds\": 2592000, \"action_name\": \"QR_STR_SCENE\", \"action_info\": {\"scene\": {\"scene_str\": \"ReportQR_"
@@ -233,7 +237,8 @@ public class WeixinApiController extends ApiController {
 		String url = apiResult.getStr("url");
 		String url = apiResult.getStr("url");
 		reports.setQrCode(url);
 		reports.setQrCode(url);
 		reports.update();
 		reports.update();
-		renderText(url);
+		return url;
+//		renderText(url);
 //		}else {
 //		}else {
 //			//ApiResult qrresult = new ApiResult(reports.getQrCode());
 //			//ApiResult qrresult = new ApiResult(reports.getQrCode());
 //			renderText(reports.getQrCode());;
 //			renderText(reports.getQrCode());;