From 7ab8a06feb4c3f1ad899535a45bf5bc944c73f5f Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Fri, 9 Mar 2018 18:11:56 +0800 Subject: [PATCH] updateupdate --- .../merchants/core/impls/ClientManagerImpl.java | 13 ++++++++----- src/main/resources/i18n/msg_en.properties | 4 ++++ src/main/resources/i18n/msg_zh.properties | 7 ++++++- 3 files changed, 18 insertions(+), 6 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 6f3c2c799..386be760f 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 @@ -50,6 +50,7 @@ import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; import au.com.royalpay.payment.tools.connections.mpsupport.exceptions.WechatException; import au.com.royalpay.payment.tools.env.PlatformEnvironment; +import au.com.royalpay.payment.tools.env.RequestEnvironment; import au.com.royalpay.payment.tools.env.SysConfigManager; import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.ForbiddenException; @@ -93,6 +94,7 @@ import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.Cacheable; import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisherAware; +import org.springframework.context.MessageSource; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -212,6 +214,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid private ClientsContractMapper clientsContractMapper; @Resource private ClientContractService clientContractService; + @Resource + private MessageSource messageSource; private static final String SOURCE_AGREE_FILE = "source_agree_file"; private static final String CLIENT_BANK_FILE = "client_bank_file"; @@ -3127,21 +3131,20 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid result.put("is_ordinary", true); if (!expire && waring) { String[] key = { result.getString("expire_days") }; - result.put("contract_info", editContractOrdinaryWaring(key, config.getString("sys_contract_ordinary_waring"))); + result.put("contract_info", editContractOrdinaryWaring(key, messageSource.getMessage("sys.contract.ordinary.waring", null, RequestEnvironment.getLocale()))); } if (expire) { - result.put("contract_info", config.getString("sys_contract_ordinary_info")); + result.put("contract_info", messageSource.getMessage("sys.contract.ordinary.info", null, RequestEnvironment.getLocale())); } return result; } else { - result.put("contract_info", config.getString("sys_contract_info")); result.put("is_ordinary", false); if (!expire && waring) { String[] key = { result.getString("expire_days") }; - result.put("contract_info", editContractOrdinaryWaring(key, config.getString("sys_contract_waring"))); + result.put("contract_info", messageSource.getMessage("sys.contract.waring", null, RequestEnvironment.getLocale())); } if (expire) { - result.put("contract_info", config.getString("sys_contract_info")); + 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")); diff --git a/src/main/resources/i18n/msg_en.properties b/src/main/resources/i18n/msg_en.properties index 4eed85d8e..1ea334469 100644 --- a/src/main/resources/i18n/msg_en.properties +++ b/src/main/resources/i18n/msg_en.properties @@ -101,3 +101,7 @@ app.label.close=Close app.label.coupons=Available Coupons +sys.contract.ordinary.info=Dear merchant, your service contract with ROYALPAY has expired. In order not to affect your normal use, please contact your supervisor or use your administrator account as soon as possible for service renewal. +sys.contract.ordinary.waring=Dear merchant, your service contract with ROYALPAY expires in {0} days. In order not to affect your normal use, please contact your supervisor or use your administrator account as soon as possible in order to renew your service contract. +sys.contract.waring=Dear merchant, your service contract with ROYALPAY is due to expire in {0} days. In order not to affect your normal use, please see the latest service agreement for renewal. +sys.contract.info=Dear merchant, your service contract with ROYALPAY has expired. Please check the latest service agreement to renew your contract so as not to affect your normal use. \ No newline at end of file diff --git a/src/main/resources/i18n/msg_zh.properties b/src/main/resources/i18n/msg_zh.properties index e91b8532e..a2a041316 100644 --- a/src/main/resources/i18n/msg_zh.properties +++ b/src/main/resources/i18n/msg_zh.properties @@ -93,4 +93,9 @@ app.label.pay=支付 app.label.remark=备注 app.label.creating-order=... app.label.close=关闭 -app.label.coupons=可用优惠券 \ No newline at end of file +app.label.coupons=可用优惠券 + +sys.contract.ordinary.info=尊敬的商户,您与ROYALPAY的服务合同已到期,为了不影响您的正常使用,请尽快联系您的主管或使用管理员账户登录以便进行服务续约 +sys.contract.ordinary.waring=尊敬的商户,您与ROYALPAY的服务合同还有{0}天到期,为了不影响您的正常使用,请尽快联系您的主管或使用管理员账户登录以便进行服务续约 +sys.contract.waring=尊敬的商户,您与ROYALPAY的服务合同还有{0}天到期,为了不影响您的正常使用,请查看最新服务协议进行续约。 +sys.contract.info=尊敬的商户,您与ROYALPAY的服务合同已到期,为了不影响您的正常使用,请查看最新服务协议进行续约。 \ No newline at end of file