From 8943d91097fb8c772b07a9b6863dadbc61e2a45a Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Mon, 12 Mar 2018 19:12:52 +0800 Subject: [PATCH] fixbug contract greenchannel --- .../core/impls/ClientManagerImpl.java | 27 ++++--------------- .../core/impl/ClientContractServiceImpl.java | 15 ++++++----- 2 files changed, 14 insertions(+), 28 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 f6f877cc7..bc0a45666 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 @@ -37,27 +37,6 @@ import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo; import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; import au.com.royalpay.payment.manage.merchants.beans.SubMerchantIdApply; -import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientApplyMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientAuditProcessMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientBDMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientBankAccountMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientDeviceMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientFilesMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper; -import au.com.royalpay.payment.manage.mappers.system.CommoditiesMapper; -import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; -import au.com.royalpay.payment.manage.mappers.system.OrgMapper; -import au.com.royalpay.payment.manage.mappers.system.SysWxMerchantApplyMapper; -import au.com.royalpay.payment.manage.merchants.beans.ActivityPosterBuilder; -import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo; -import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; -import au.com.royalpay.payment.manage.merchants.beans.ClientRateConfig; -import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo; -import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; -import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; -import au.com.royalpay.payment.manage.merchants.beans.SubMerchantIdApply; import au.com.royalpay.payment.manage.merchants.core.ClientComplyValidator; import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.notice.core.MailService; @@ -3172,7 +3151,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid result.put("contract_info", messageSource.getMessage("sys.contract.info", null, RequestEnvironment.getLocale())); } JSONObject file = clientContractService.getOrGenerateSourceAgreement(account.getIntValue("client_id"),"pc"); - result.put("file_url", file.getString("file_value")); + if(file!=null){ + result.put("file_url", file.getString("file_value")); + }else { + result.put("file_url",""); + } return result; } diff --git a/src/main/java/au/com/royalpay/payment/manage/system/core/impl/ClientContractServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/system/core/impl/ClientContractServiceImpl.java index 20d66a08d..5d0b357b1 100644 --- a/src/main/java/au/com/royalpay/payment/manage/system/core/impl/ClientContractServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/system/core/impl/ClientContractServiceImpl.java @@ -64,13 +64,16 @@ public class ClientContractServiceImpl implements ClientContractService { return files.get(0); } else { List files = clientFilesMapper.findFileByClientAndType(client_id, "source_agree_file"); - JSONObject file = files.get(0); - if (expireInfo.getBoolean("rate_expire")) { - contract.put("create_time", now); - contract.put("expiry_date", DateUtils.addYears(now, 1)); - clientsContractMapper.update(contract); + if(!CollectionUtils.isEmpty(files)) { + JSONObject file = files.get(0); + if (expireInfo.getBoolean("rate_expire")) { + contract.put("create_time", now); + contract.put("expiry_date", DateUtils.addYears(now, 1)); + clientsContractMapper.update(contract); + } + return file; } - return file; + return null; } }