From fe26434e1114249f08fd56dc778ac4973e721b8f Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Thu, 3 May 2018 11:40:52 +0800 Subject: [PATCH] update --- .../payment/manage/merchants/core/ClientManager.java | 2 +- .../manage/merchants/core/impls/ClientManagerImpl.java | 9 ++------- .../manage/merchants/web/PartnerManageController.java | 4 ++-- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java index 965d42a1b..4f2a1293f 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java @@ -199,7 +199,7 @@ public interface ClientManager { void setClientTaxInSurcharge(JSONObject account,String clientMoniker, boolean taxInSurcharge); - void setClientCustomerTaxFree(String clientMoniker, boolean customerTaxFree); + void setClientCustomerTaxFree(JSONObject account,String clientMoniker, boolean customerTaxFree); List listClientsForSettlement(); 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 3826fde4a..6a3267843 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 @@ -2317,17 +2317,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } @Override - public void setClientCustomerTaxFree(String clientMoniker, boolean customerTaxFree) { + public void setClientCustomerTaxFree(JSONObject account,String clientMoniker, boolean customerTaxFree) { JSONObject client = getClientInfoByMoniker(clientMoniker); if (client == null) { throw new InvalidShortIdException(); } - JSONObject update = new JSONObject(); - int clientId = client.getIntValue("client_id"); - update.put("client_id", clientId); - update.put("customer_tax_free", customerTaxFree); - clientMapper.update(update); - clientInfoCacheSupport.clearClientCache(clientId); + clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account,clientMoniker,"customer_tax_free",customerTaxFree)); } @Override diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java index 8d84b469d..77bde5762 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java @@ -196,8 +196,8 @@ public class PartnerManageController { } @ManagerMapping(value = "/{clientMoniker}/customer_tax_free", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR}) - public void setClientCustomerTaxFree(@PathVariable String clientMoniker, @RequestBody JSONObject config) { - clientManager.setClientCustomerTaxFree(clientMoniker, config.getBooleanValue("customer_tax_free")); + public void setClientCustomerTaxFree(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,@PathVariable String clientMoniker, @RequestBody JSONObject config) { + clientManager.setClientCustomerTaxFree(manager,clientMoniker, config.getBooleanValue("customer_tax_free")); } @ManagerMapping(value = "/{clientMoniker}/credential_code", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER})