|
@@ -213,7 +213,20 @@ public class WeixinApiController extends ApiController {
|
|
|
}
|
|
|
// redirect("http://wechat.pacsonline.cn/wx_patient/api/getQrcode?appId=" + appId + "&reportId=" + reportId);
|
|
|
ApiConfigKit.setThreadLocalAppId(appId);
|
|
|
- String urlString = getQrcode(reportId);
|
|
|
+ String urlString = "";
|
|
|
+ Report reports = Report.dao.findById(reportId);
|
|
|
+ if (reportId == null || reports == null) {
|
|
|
+// renderNull();
|
|
|
+ urlString=null;
|
|
|
+ }
|
|
|
+// if (reports.getQrCode() == null || reports.getQrCode().isEmpty()) {
|
|
|
+ String str = "{\"expire_seconds\": 2592000, \"action_name\": \"QR_STR_SCENE\", \"action_info\": {\"scene\": {\"scene_str\": \"ReportQR_"
|
|
|
+ + reportId + "\"}}}";
|
|
|
+ ApiResult apiResult = QrcodeApi.create(str);
|
|
|
+ String url = apiResult.getStr("url");
|
|
|
+ urlString = url;
|
|
|
+ reports.setQrCode(url);
|
|
|
+ reports.update();
|
|
|
if (urlString==null) {
|
|
|
renderNull();
|
|
|
}
|