From 3a10bef91f2a2d9137a751cfdf4c1b97b0c4167f Mon Sep 17 00:00:00 2001 From: dulingling Date: Tue, 21 Apr 2020 17:12:50 +0800 Subject: [PATCH] =?UTF-8?q?Upd:=E4=BF=AE=E6=94=B9=E8=B4=A6=E5=8D=95?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../manage/bill/core/impl/BillServiceImpl.java | 14 ++++++++++++++ .../core/impl/PartnerBillServiceImpl.java | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 8e3941697..9504523b8 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 2.2.3 + 2.2.4 UTF-8 1.8.0 diff --git a/src/main/java/au/com/royalpay/payment/manage/bill/core/impl/BillServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/bill/core/impl/BillServiceImpl.java index f19d5edd8..75d6abbf8 100644 --- a/src/main/java/au/com/royalpay/payment/manage/bill/core/impl/BillServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/bill/core/impl/BillServiceImpl.java @@ -50,6 +50,8 @@ public class BillServiceImpl implements BillService { record.put("status", 1); billMapper.save(record); JSONObject result = new JSONObject(); + //添加开关 + String codeUrl = selectBillVersion(client,record.getString("bill_id")); result.put("partner_name",client.getString("short_name")); result.put("partner_code",client.getString("client_moniker")); result.put("full_name",client.getString("company_name")); @@ -58,6 +60,18 @@ public class BillServiceImpl implements BillService { return result; } + private String selectBillVersion(JSONObject clientInfo ,String billCodeId){ + String billCodeVersion = clientInfo.containsKey("billcode_version")?clientInfo.getString("billcode_version"):""; + switch (billCodeVersion){ + case "v1": + return PlatformEnvironment.getEnv().concatUrl("/api/v1.0/share_code/bills/payment/orders/" + billCodeId); + case "v2": + return PlatformEnvironment.getEnv().concatUrl("/api/v1.0/share_code/bills/payment/orders/"+billCodeId+"/link/payment"); + default: + return PlatformEnvironment.getEnv().concatUrl("/api/v1.0/share_code/bills/payment/orders/" + billCodeId); + } + } + @Override public JSONObject queryBills(int client_id, QueryBillBean queryBillBean) { JSONObject params = queryBillBean.toParams(); diff --git a/src/main/java/au/com/royalpay/payment/manage/billqrcode/core/impl/PartnerBillServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/billqrcode/core/impl/PartnerBillServiceImpl.java index 5e8d3ecd3..4bcb961fb 100644 --- a/src/main/java/au/com/royalpay/payment/manage/billqrcode/core/impl/PartnerBillServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/billqrcode/core/impl/PartnerBillServiceImpl.java @@ -84,7 +84,7 @@ public class PartnerBillServiceImpl implements PartnerBillService { record.put("code_urls",url); record.put("code_url",QRCodeUtils.qrcodeImageCode(url, 250, false)); } - return QRCodeUtils.qrcodeImageCode(code_url, 250, false); + return record.getString("code_url"); } private String getQRCodeImg(JSONObject bill){