From 0a87728a9626de6e22de02198d0d2abf4e93e3b0 Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Tue, 20 Mar 2018 18:09:03 +0800 Subject: [PATCH] update --- .../core/impls/ActMonDelaySettleServiceImp.java | 16 +++++++++------- src/main/resources/i18n/msg_en.properties | 5 ++++- src/main/resources/i18n/msg_zh.properties | 4 +++- .../templates/activity/mondelay/mondelay.html | 4 +++- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/core/impls/ActMonDelaySettleServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/core/impls/ActMonDelaySettleServiceImp.java index 931257f48..5b0e9fc65 100644 --- a/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/core/impls/ActMonDelaySettleServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/core/impls/ActMonDelaySettleServiceImp.java @@ -9,6 +9,7 @@ import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.tools.device.DeviceSupport; import au.com.royalpay.payment.tools.env.PlatformEnvironment; +import au.com.royalpay.payment.tools.env.RequestEnvironment; import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.ForbiddenException; import au.com.royalpay.payment.tools.permission.enums.PartnerRole; @@ -19,6 +20,7 @@ import com.github.miemiedev.mybatis.paginator.domain.Order; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageList; +import org.springframework.context.MessageSource; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; @@ -47,11 +49,11 @@ public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService { private ClientsOperationLogMapper clientsOperationLogMapper; @Resource private ClientManager clientManager; + @Resource + private MessageSource messageSource; @Override public JSONObject getActNotice(JSONObject device) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); int client_id = device.getIntValue("client_id"); BigDecimal total_redpack = actMonDelaySettleRedPackMapper.getTotalRedPack(client_id); JSONObject res = new JSONObject(); @@ -68,15 +70,14 @@ public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService { if (!act.getBoolean("is_valid")) { throw new BadRequestException("Activity is not valid"); } - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); int client_id = device.getIntValue("client_id"); List clientLogs = actMonDelaySettleMapper.clientLog(client_id); JSONObject res = new JSONObject(); res.put("operation_pause",false); - Boolean apply = false; - if (!clientLogs.isEmpty()) { - apply = true; + Boolean apply = true; + if (clientLogs.isEmpty()) { + apply = false; + res.put("cancel_waring",messageSource.getMessage("sys.mondelay.cancel.waring", null, RequestEnvironment.getLocale())); } if (new Date().compareTo(act.getDate("active_date")) < 0) { res.put("active", false); @@ -98,6 +99,7 @@ public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService { res.put("apply", apply); res.put("total_redpack", total_redpack); res.put("list", list); + return res; } diff --git a/src/main/resources/i18n/msg_en.properties b/src/main/resources/i18n/msg_en.properties index 1ea334469..88903aca8 100644 --- a/src/main/resources/i18n/msg_en.properties +++ b/src/main/resources/i18n/msg_en.properties @@ -104,4 +104,7 @@ 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 +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. + + +sys.mondelay.cancel.waring=this is mondelay cancel waring \ 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 a2a041316..20964d285 100644 --- a/src/main/resources/i18n/msg_zh.properties +++ b/src/main/resources/i18n/msg_zh.properties @@ -98,4 +98,6 @@ 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 +sys.contract.info=尊敬的商户,您与ROYALPAY的服务合同已到期,为了不影响您的正常使用,请查看最新服务协议进行续约。 + +sys.mondelay.cancel.waring=商户取消活动警告 \ No newline at end of file diff --git a/src/main/resources/templates/activity/mondelay/mondelay.html b/src/main/resources/templates/activity/mondelay/mondelay.html index 6cf9c91e8..2fc2237b4 100644 --- a/src/main/resources/templates/activity/mondelay/mondelay.html +++ b/src/main/resources/templates/activity/mondelay/mondelay.html @@ -111,6 +111,8 @@