From 024c59c54c86af4577c10874e31bfe1af538350c Mon Sep 17 00:00:00 2001 From: yixian Date: Fri, 25 Sep 2020 18:51:48 +1000 Subject: [PATCH] fix: default orgid=1 when manager org is null --- .../manage/merchants/core/impls/ClientManagerImpl.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java index cc72b70c9..8199a1968 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java @@ -789,10 +789,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid partner.put("ali_sub_merchant_id", registery.getClientMoniker()); partner.put("credential_code", RandomStringUtils.random(32, true, true)); partner.put("creator", manager.getString("manager_id")); - int orgId = manager.getIntValue("org_id"); + int orgId = manager.getInteger("org_id") == null ? 1 : manager.getIntValue("org_id"); partner.put("org_id", orgId); JSONObject org = orgMapper.findOne(orgId); - Assert.notNull(orgId, "Merchant Org shall not be null"); if (StringUtils.isNotEmpty(registery.getLogoId())) { partner.put("logo_url", attachmentClient.getFileUrl(registery.getLogoId())); partner.put("logo_thumbnail", attachmentClient.getThumbnail(registery.getLogoId(), 600).getString("url")); @@ -1974,7 +1973,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid json.put("overseas_rate_value", subRateObject(extRates.getBigDecimal("international_rate_value"), config.getIntValue("clean_days") + 1)); }); newConfig.put("ext_rates", extRateParams.toJSONString()); - }else{ + } else { List existRate = clientRateMapper.listCurrentClientRates(clientId, config.getDate("active_time"), channel); for (JSONObject rateLog : existRate) { rateLog.put("expiry_time", DateUtils.addDays(config.getDate("active_time"), -1));