From ea7846eb3807fd78d22ce8136eb2c060fe3afe71 Mon Sep 17 00:00:00 2001 From: "taylor.dang" Date: Sun, 19 Aug 2018 23:55:51 +0800 Subject: [PATCH] [Y] fix --- .../manage/risk/core/impl/RiskMerchantServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/risk/core/impl/RiskMerchantServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/risk/core/impl/RiskMerchantServiceImpl.java index 1260fcb77..09188ab9f 100644 --- a/src/main/java/au/com/royalpay/payment/manage/risk/core/impl/RiskMerchantServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/risk/core/impl/RiskMerchantServiceImpl.java @@ -18,6 +18,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Date; +import java.util.List; import javax.annotation.Resource; @@ -232,7 +233,7 @@ public class RiskMerchantServiceImpl implements RiskMerchantService { throw new BadRequestException("The Merchant does not exist"); } int clientId = client.getIntValue("client_id"); - JSONObject bankAccount = clientBankAccountMapper.clientBankAccounts(clientId).get(0); + List bankAccount = clientBankAccountMapper.clientBankAccounts(clientId); JSONObject attention = new JSONObject(); attention.put("client_id", clientId); attention.put("client_moniker", clientMoniker); @@ -240,7 +241,7 @@ public class RiskMerchantServiceImpl implements RiskMerchantService { attention.put("acn", client.getString("acn")); attention.put("contact_person", client.getString("contact_person")); attention.put("contact_phone", client.getString("contact_phone")); - attention.put("bank_account_no", bankAccount == null ? "" : bankAccount.getString("account_no")); + attention.put("bank_account_no", bankAccount == null || bankAccount.size() <= 0 ? "" : bankAccount.get(0).getString("account_no")); attention.put("is_valid", 1); attention.put("creation_date", new Date()); attention.put("creation_by", manager.getString("manager_id"));