From f197922247ad8e5e4fb4e0f386ea0a40e2f3f1f8 Mon Sep 17 00:00:00 2001 From: dalong306 <304592994@qq.com> Date: Wed, 16 Jun 2021 17:54:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=9B=B4=E6=96=B0=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E5=AD=90=E5=95=86=E6=88=B7=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/dev/web/TestController.java | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java index 448dbf857..0034eebe2 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java @@ -585,31 +585,36 @@ public class TestController { } newSubMerchantIdApply.setCompany_register_no(cutLength(TextUtils.isEmpty(clientJson.getString("acn"))?clientJson.getString("abn"):clientJson.getString("acn"),50)); - newSubMerchantIdApply.setCertificat_expire_date("PERMANENT"); - JSONObject params = newSubMerchantIdApply.insertObject(clientJson); - params.put("merchant_app_id", jsonObject.getString("merchant_app_id")); - SubMerchantInfoInheritance subMerchantInfo = JSON.toJavaObject(params, SubMerchantInfoInheritance.class); - params.put("operator","System"); + if (!TextUtils.isEmpty(clientJson.getString("certificat_expire_date"))) { + newSubMerchantIdApply.setCertificat_expire_date(clientJson.getString("certificat_expire_date")); + } else { + newSubMerchantIdApply.setCertificat_expire_date("PERMANENT"); + } if("ENTERPRISE".equalsIgnoreCase(newSubMerchantIdApply.getMerchant_type())&&TextUtils.isEmpty(newSubMerchantIdApply.getCompany_register_no())){ - logger.error("=======>公司注册号为空:clientid:"+jsonObject.getInteger("client_id")); + logger.error("=======>公司注册号为空:clientid:"+clientJson.getInteger("client_id")+":"+clientJson.getString("client_moniker")); return; } - if("BOTH".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type())&&(TextUtils.isEmpty(newSubMerchantIdApply.getAddress()))|| - TextUtils.isEmpty(newSubMerchantIdApply.getWebsite())){ - logger.error("=======>公司类型为BOTH:网址或地址为空:clientid:"+jsonObject.getInteger("client_id")); + if("BOTH".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type())&&(TextUtils.isEmpty(newSubMerchantIdApply.getAddress())|| + TextUtils.isEmpty(newSubMerchantIdApply.getWebsite()))){ + logger.error("=======>公司类型为BOTH:网址或地址为空:clientid:"+clientJson.getInteger("client_id")+":"+clientJson.getString("client_moniker")); return; } else if("OFFLINE".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type())&&(TextUtils.isEmpty(newSubMerchantIdApply.getAddress()))){ - logger.error("=======>公司类型为OFFLINE:地址为空:clientid:"+jsonObject.getInteger("client_id")); + logger.error("=======>公司类型为OFFLINE:地址为空:clientid:"+clientJson.getInteger("client_id")+":"+clientJson.getString("client_moniker")); return; } else if("ONLINE".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type())&& TextUtils.isEmpty(newSubMerchantIdApply.getWebsite())){ - logger.error("=======>公司类型为ONLINE:网址为空:clientid:"+jsonObject.getInteger("client_id")); + logger.error("=======>公司类型为ONLINE:网址为空:clientid:"+clientJson.getInteger("client_id")+":"+clientJson.getString("client_moniker")); return; } + JSONObject params = newSubMerchantIdApply.insertObject(clientJson); + params.put("merchant_app_id", jsonObject.getString("merchant_app_id")); + SubMerchantInfoInheritance subMerchantInfo = JSON.toJavaObject(params, SubMerchantInfoInheritance.class); + params.put("operator","System"); + WxPayMerchantRegister register = Optional.ofNullable(merchantChannelApplicationManager.getRegister(WxPayMerchantRegister.class)) .orElseThrow(() -> new ServerErrorException("No Register found for wechat")); @@ -617,7 +622,7 @@ public class TestController { manager.put("display_name","System"); register.modifyForBatch(jsonObject.getString("merchant_app_id"), clientJson, subMerchantInfo, manager); try { - Thread.sleep(20); + Thread.sleep(500); } catch (InterruptedException e) { e.printStackTrace(); }