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 e11c4f1b6..346cd339c 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 @@ -245,6 +245,8 @@ public interface ClientManager { void setSkipClearing(String clientMoniker, Boolean skip_clearing); + void setSkipContract(String clientMoniker, Boolean skip_contract); + void enableGatewayUpgrade(String clientMoniker, boolean gatewayUpgrade); void setCustomerSurchargeRate(String clientMoniker, BigDecimal customer_surcharge_rate); 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 f9c9663ce..3e3f91525 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 @@ -2839,6 +2839,20 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid clientInfoCacheSupport.clearClientCache(clientId); } + @Override + public void setSkipContract(String clientMoniker, Boolean skip_contract) { + 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("skip_contract", skip_contract); + clientMapper.update(update); + clientInfoCacheSupport.clearClientCache(clientId); + } + @Override public void enableGatewayUpgrade(String clientMoniker, boolean gatewayUpgrade) { JSONObject client = getClientInfoByMoniker(clientMoniker); 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 5343e2075..2ecab3a50 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 @@ -533,4 +533,10 @@ public class PartnerManageController { public void confirmSourceAgreeFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { clientContractService.confirmSourceAgreement(account.getIntValue("client_id"),account.getString("account_id"),"PC"); } + + @ManagerMapping(value = "/{clientMoniker}/skip_contract", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF}) + public void skipContract(@PathVariable String clientMoniker, @RequestBody JSONObject skip_clearing) { + clientManager.setSkipClearing(clientMoniker, skip_clearing.getBooleanValue("skip_contract")); + } + } 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 24b2838f0..958095d6e 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 @@ -98,10 +98,10 @@ public class ClientContractServiceImpl implements ClientContractService { if (client == null) { throw new NotFoundException("merchant not found"); } - JSONObject rateExpire = getClientContractExpire(client_id); - boolean expire = rateExpire.getBoolean("rate_expire"); - boolean waring = rateExpire.getBoolean("rate_waring"); - boolean old_contract = rateExpire.getBoolean("old_contract"); +// JSONObject rateExpire = getClientContractExpire(client_id); +// boolean expire = rateExpire.getBoolean("rate_expire"); +// boolean waring = rateExpire.getBoolean("rate_waring"); +// boolean old_contract = rateExpire.getBoolean("old_contract"); JSONObject contract = clientsContractMapper.findByClientId(client_id); if (contract == null) { throw new BadRequestException("generate contract first"); @@ -130,6 +130,8 @@ public class ClientContractServiceImpl implements ClientContractService { clientRateMapper.saveRate(p); }); clientManager.setClientTaxInSurcharge(client.getString("client_moniker"), false); + clientManager.setSkipContract(client.getString("client_moniker"), true); + } @Override @@ -155,6 +157,9 @@ public class ClientContractServiceImpl implements ClientContractService { if (sysconfig != null && !sysconfig.getBoolean("sys_new_contract_on")) { return defaultResult; } + if(client.getBooleanValue("skip_contract")){ + return defaultResult; + } List rateInfo = clientRateMapper.minExpiryTime(client_id, null); JSONObject result = new JSONObject(); diff --git a/src/main/resources/application-local.properties b/src/main/resources/application-local.properties index c9015a1d9..91173a856 100644 --- a/src/main/resources/application-local.properties +++ b/src/main/resources/application-local.properties @@ -1,6 +1,6 @@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.schema-name=royalpay_production -spring.datasource.host=192.168.99.100:3306 +spring.datasource.host=192.168.0.49:3306 spring.datasource.url=jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false spring.datasource.username=root spring.datasource.password=root \ No newline at end of file diff --git a/src/main/ui/static/boot/indexMainApp.js b/src/main/ui/static/boot/indexMainApp.js index 53590059e..8f9c2e399 100644 --- a/src/main/ui/static/boot/indexMainApp.js +++ b/src/main/ui/static/boot/indexMainApp.js @@ -151,7 +151,7 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo }); }; - //$scope.getAgStatus(); + $scope.getAgStatus(); $scope.refundNotice = {counts: 0}; $scope.openRefundNotice = false; $scope.showRefundNotice = function () {