|
@@ -213,18 +213,22 @@ public class WeixinApiController extends ApiController {
|
|
|
}
|
|
|
// redirect("http://wechat.pacsonline.cn/wx_patient/api/getQrcode?appId=" + appId + "&reportId=" + reportId);
|
|
|
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);
|
|
|
if (reportId == null || reports == null) {
|
|
|
- renderNull();
|
|
|
- return;
|
|
|
+// renderNull();
|
|
|
+ return null;
|
|
|
}
|
|
|
// if (reports.getQrCode() == null || reports.getQrCode().isEmpty()) {
|
|
|
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");
|
|
|
reports.setQrCode(url);
|
|
|
reports.update();
|
|
|
- renderText(url);
|
|
|
+ return url;
|
|
|
+// renderText(url);
|
|
|
// }else {
|
|
|
// //ApiResult qrresult = new ApiResult(reports.getQrCode());
|
|
|
// renderText(reports.getQrCode());;
|