From 1088e2bbdc7d84699ce3fd869155e86f8e32be72 Mon Sep 17 00:00:00 2001 From: luoyang Date: Fri, 28 Feb 2020 14:10:49 +0800 Subject: [PATCH] =?UTF-8?q?fix=20app=20=E5=BC=B9=E7=AA=97=E6=AC=A1?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 4 ++-- .../core/impls/RetailAppServiceImp.java | 12 +++++------- .../impls/CityPartnerPrizeServiceImplTest.java | 16 +++++++--------- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/pom.xml b/pom.xml index 0df81feea..344a0e40a 100644 --- a/pom.xml +++ b/pom.xml @@ -5,11 +5,11 @@ au.com.royalpay.payment payment-parent - 1.1.12 + 1.1.13 4.0.0 manage - 1.3.67 + 1.3.72 UTF-8 1.8.0 diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index 25bfd5fa3..b1dc36644 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -1583,9 +1583,6 @@ public class RetailAppServiceImp implements RetailAppService { JSONObject latestAct = appActService.getAppActPopup(); if (latestAct != null) { - if (accountIsRead(device.getString("account_id"), latestAct)) { - return result; - } latestAct.put("id", latestAct.getString("act_id")); latestAct.put("url", latestAct.getString("act_url")); latestAct.put("title", latestAct.getString("act_name")); @@ -1601,6 +1598,9 @@ public class RetailAppServiceImp implements RetailAppService { return result; } } + if (accountIsRead(device.getString("account_id"), latestAct)) { + return result; + } latestAct.remove("act_id"); latestAct.remove("act_name"); latestAct.remove("act_url"); @@ -1769,10 +1769,8 @@ public class RetailAppServiceImp implements RetailAppService { List newActs = new ArrayList<>(); for (JSONObject act : JSON.parseArray(acts.toJSONString(), JSONObject.class)) { if (act.getString("page_desc") != null && !act.getString("page_desc").equals("0")) { - JSONObject reference = act.getJSONObject("reference"); - String geekUrl = "https://opt.royalpay.com.au/geekforbest/v1/operation/purpose_apply/index?source=app"; - if (reference != null && StringUtils.isNotBlank(reference.getString("url")) - && StringUtils.equalsIgnoreCase(geekUrl, reference.getString("url"))) { + logger.info("app get banner{}-{}", device.getIntValue("client_id"), act.toJSONString()); + if (StringUtils.equalsIgnoreCase(act.getString("page_keywords"), "RYCBSM")) { if (geekShowActVersion(device.getString("version"))) { newActs.add(act); } diff --git a/src/test/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImplTest.java b/src/test/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImplTest.java index 13ff97c55..0724d80a0 100644 --- a/src/test/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImplTest.java +++ b/src/test/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImplTest.java @@ -81,8 +81,6 @@ public class CityPartnerPrizeServiceImplTest { put("client_pay_type", "2"); put("client_pay_desc", "201"); put("royalpay_industry", "10001"); - put("wechat_industry", "339"); - put("alipay_industry", "4511"); put("company_photo", "https://c-ssl.duitang.com/uploads/item/201812/10/20181210170153_xPUVk.jpeg"); put("store_photo", "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3199241964,979639112&fm=26&gp=0.jpg"); put("company_website", "https://11.com"); @@ -120,7 +118,7 @@ public class CityPartnerPrizeServiceImplTest { JSONObject params = new JSONObject() {{ - put("apply_id", "orgapply1"); + put("apply_id", "orgtestadmin4"); put("notify_url", "http://127.0.0.1:9002/sys/partners/7CMV/qrcode"); put("company_info", companyInfo); put("contact_info", contactInfo); @@ -129,7 +127,7 @@ public class CityPartnerPrizeServiceImplTest { put("settle_info", settleConfig); put("compliance_file_info", complianceInfo); }}; - String originUrl = "https://mpay.royalpay.com.au/api/v1.0/org_gateway/partner/AXLCEXDDMB/merchant/application"; + String originUrl = "https://sandbox.royalpay.com.au/api/v1.0/org_gateway/partner/RE2ZLPEAZL/merchant/application"; String url = addSignUrl(originUrl, params, PRIKEY); HttpRequestGenerator gen = new HttpRequestGenerator(url, RequestMethod.POST); gen.setJSONEntity(params); @@ -145,8 +143,8 @@ public class CityPartnerPrizeServiceImplTest { @Test public void queryMerchantStatus() throws Exception{ - String partnerCode = "PBAR"; - String originUrl = "https://mpay.royalpay.com.au/api/v1.0/org_gateway/partner/AXLCEXDDMB/merchant/" + partnerCode + "/status"; + String partnerCode = "PHQ3"; + String originUrl = "https://sandbox.royalpay.com.au/api/v1.0/org_gateway/partner/RE2ZLPEAZL/merchant/" + partnerCode + "/status"; String url = addSignUrl(originUrl, null, PRIKEY); HttpRequestGenerator gen = new HttpRequestGenerator(url, RequestMethod.GET); HttpRequestResult result = gen.execute(); @@ -159,13 +157,13 @@ public class CityPartnerPrizeServiceImplTest { @Test public void updateFile() throws Exception{ - String originUrl = "https://mpay.royalpay.com.au/api/v1.0/org_gateway/partner/RQ6CJ4CGJZ/attachment/files"; + String originUrl = "https://sandbox.royalpay.com.au/api/v1.0/org_gateway/partner/RE2ZLPEAZL/attachment/files"; String url = addSignUrl(originUrl, null, PRIKEY); - File file = new File("/Users/luoyang/Downloads/121.jpg"); + File file = new File("/Users/luoyang/Downloads/banner_eshop.jpg"); InputStream stream = new FileInputStream(file); HttpRequestGenerator gen = new HttpRequestGenerator(url, RequestMethod.POST); gen.setTimeout(10000); - gen.initFileEntity().attachFile("file", "121.jpg", stream); + gen.initFileEntity().attachFile("file", "banner_eshop.jpg", stream); HttpRequestResult result = gen.execute(); if (result.isSuccess()) { System.out.println(result.getResponseContentJSONObj().toJSONString());