From 138820f1bd1d9de321ae6dca01fd5fa36d5f9182 Mon Sep 17 00:00:00 2001 From: yixian Date: Fri, 2 Mar 2018 13:12:42 +0800 Subject: [PATCH] gst in surcharge config --- .../manage/merchants/core/ClientManager.java | 4 +- .../core/impls/ClientManagerImpl.java | 204 ++++++++++-------- .../web/PartnerManageController.java | 5 + .../static/payment/partner/partner-manage.js | 83 +++---- .../templates/partner_bankaccounts.html | 7 + 5 files changed, 171 insertions(+), 132 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 c093b50cc..cc679bfbb 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 @@ -150,8 +150,8 @@ public interface ClientManager { List listSubClients(int clientId); - // void newSubClient(String clientMoniker, SubClientRegistry registry, JSONObject manager); + // void newSubClient(String clientMoniker, SubClientRegistry registry, JSONObject manager); void validateClients(int client_id, JSONObject params) throws Exception; void updateClientBDUsers(JSONObject manager, String clientMoniker, JSONObject data) throws Exception; @@ -193,6 +193,8 @@ public interface ClientManager { void setClientRetailPaySurCharge(String clientMoniker, boolean paySurcharge); + void setClientTaxInSurcharge(String clientMoniker, boolean taxInSurcharge); + List listClientsForSettlement(); List listClientsDetailsForSettlement(); 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 a3f4daaa9..503337434 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 @@ -228,7 +228,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (client == null) { throw new InvalidShortIdException(); } - if (manager!=null){ + if (manager != null) { checkClientOrg(manager, client); } client.put("show_all_permission", true); @@ -291,10 +291,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } private void checkClientOrg(JSONObject manager, JSONObject client) { - if (manager.getInteger("org_id")!=null){ + if (manager.getInteger("org_id") != null) { List orgs = orgMapper.listOrgAndChild(manager.getIntValue("org_id")); - List orgIds = orgs.stream().map(org->org.getIntValue("org_id")).collect(Collectors.toList()); - if (!orgIds.contains(client.getIntValue("org_id"))){ + List orgIds = orgs.stream().map(org -> org.getIntValue("org_id")).collect(Collectors.toList()); + if (!orgIds.contains(client.getIntValue("org_id"))) { throw new ForbiddenException("The org of client is not belong to you"); } } @@ -313,11 +313,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Override public JSONObject listClients(JSONObject manager, PartnerQuery query) { JSONObject params = query.toJsonParam(); - if(params.getString("org_id") != null){ - if(params.getString("org_ids") == null){ - orgIds(params,Integer.parseInt(params.getString("org_id"))); - }else { - params.put("org_id",params.getString("org_ids")); + if (params.getString("org_id") != null) { + if (params.getString("org_ids") == null) { + orgIds(params, Integer.parseInt(params.getString("org_id"))); + } else { + params.put("org_id", params.getString("org_ids")); params.remove("org_ids"); } } @@ -331,15 +331,15 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } int orgId = manager.getIntValue("org_id"); if (orgId > 0) { - if(params.getString("org_ids") == null){ - JSONObject org2 = orgMapper.findOne(orgId); - if(org2.getString("parent_org_id") != null){ - params.put("org_id",orgId); - }else { - params.put("org_id",orgId); - orgIds(params,orgId); + if (params.getString("org_ids") == null) { + JSONObject org2 = orgMapper.findOne(orgId); + if (org2.getString("parent_org_id") != null) { + params.put("org_id", orgId); + } else { + params.put("org_id", orgId); + orgIds(params, orgId); } - }else { + } else { params.put("org_id", params.getIntValue("org_ids")); params.remove("org_ids"); } @@ -349,16 +349,16 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (bdConfig != null) { params.put("bd_group", bdConfig.getString("bd_group")); List listGroupBds = financialBDConfigMapper.listGroupBds(bdConfig.getString("bd_group")); - List bdUserId = listGroupBds.stream().map(groupBd->groupBd.getIntValue("manager_id")).collect(Collectors.toList()); - if(params.containsKey("bd_user")){ - if(!bdUserId.contains(params.getIntValue("bd_user"))){ + List bdUserId = listGroupBds.stream().map(groupBd -> groupBd.getIntValue("manager_id")).collect(Collectors.toList()); + if (params.containsKey("bd_user")) { + if (!bdUserId.contains(params.getIntValue("bd_user"))) { params.remove("bd_user"); } } - if(params.containsKey("org_ids")){ + if (params.containsKey("org_ids")) { params.remove("org_ids"); } - if(params.containsKey("org_id")){ + if (params.containsKey("org_id")) { params.remove("org_id"); } } @@ -390,18 +390,19 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } return PageListUtils.buildPageListResult(partners); } - private void orgIds(JSONObject params,int orgId){ + + private void orgIds(JSONObject params, int orgId) { JSONObject param = new JSONObject(); - param.put("parent_org_id",params.getString("org_id")); - param.put("type",0); + param.put("parent_org_id", params.getString("org_id")); + param.put("type", 0); List orgIds = new ArrayList<>(); List childOrgs = orgMapper.listOrgsWithChid(param); - if(childOrgs.size() > 0){ - for(JSONObject object : childOrgs ){ + if (childOrgs.size() > 0) { + for (JSONObject object : childOrgs) { orgIds.add(object.getIntValue("org_id")); } orgIds.add(orgId); - params.put("org_ids",orgIds); + params.put("org_ids", orgIds); params.remove("org_id"); } } @@ -1206,21 +1207,21 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid config.put("active_time", DateFormatUtils.format(config.getDate("active_time"), "yyyy-MM-dd")); config.put("expiry_time", DateFormatUtils.format(config.getDate("expiry_time"), "yyyy-MM-dd")); - checkAddRate(config,"Wechat", "wechat_rate_value",org,"min_wechat_rate"); - checkAddRate(config,"Alipay", "alipay_rate_value",org,"min_alipay_rate"); - checkAddRate(config,"AlipayOnline", "alipayonline_rate_value",org,"min_alipayonline_rate"); - checkAddRate(config,"Bestpay", "bestpay_rate_value",org,"min_bestpay_rate"); - checkAddRate(config,"jd", "jd_rate_value",org,"min_jd_rate"); + checkAddRate(config, "Wechat", "wechat_rate_value", org, "min_wechat_rate"); + checkAddRate(config, "Alipay", "alipay_rate_value", org, "min_alipay_rate"); + checkAddRate(config, "AlipayOnline", "alipayonline_rate_value", org, "min_alipayonline_rate"); + checkAddRate(config, "Bestpay", "bestpay_rate_value", org, "min_bestpay_rate"); + checkAddRate(config, "jd", "jd_rate_value", org, "min_jd_rate"); - configNewClientRate(config, clientId, "Wechat", "wechat_rate_value",org,"min_wechat_rate"); - configNewClientRate(config, clientId, "Alipay", "alipay_rate_value",org,"min_alipay_rate"); - configNewClientRate(config, clientId, "AlipayOnline", "alipayonline_rate_value",org,"min_alipayonline_rate"); - configNewClientRate(config, clientId, "Bestpay", "bestpay_rate_value",org,"min_bestpay_rate"); - configNewClientRate(config, clientId, "jd", "jd_rate_value",org,"min_jd_rate"); + configNewClientRate(config, clientId, "Wechat", "wechat_rate_value", org, "min_wechat_rate"); + configNewClientRate(config, clientId, "Alipay", "alipay_rate_value", org, "min_alipay_rate"); + configNewClientRate(config, clientId, "AlipayOnline", "alipayonline_rate_value", org, "min_alipayonline_rate"); + configNewClientRate(config, clientId, "Bestpay", "bestpay_rate_value", org, "min_bestpay_rate"); + configNewClientRate(config, clientId, "jd", "jd_rate_value", org, "min_jd_rate"); } - private void configNewClientRate(JSONObject config, int clientId, String channel, String rateKey,JSONObject org,String rateValueKey) { + private void configNewClientRate(JSONObject config, int clientId, String channel, String rateKey, JSONObject org, String rateValueKey) { if (config.containsKey(rateKey)) { JSONObject newConfig = new JSONObject(); newConfig.putAll(config); @@ -1249,11 +1250,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid checkOrgPermission(manager, client); JSONObject configJson = config.toJSON(); JSONObject org = orgMapper.findOne(client.getIntValue("org_id")); - checkModifyRate(org,configJson,"Wechat","min_wechat_rate"); - checkModifyRate(org,configJson,"Alipay","min_alipay_rate"); - checkModifyRate(org,configJson,"AlipayOnline","min_alipayonline_rate"); - checkModifyRate(org,configJson,"jd","min_jd_rate"); - checkModifyRate(org,configJson,"Bestpay","min_bestpay_rate"); + checkModifyRate(org, configJson, "Wechat", "min_wechat_rate"); + checkModifyRate(org, configJson, "Alipay", "min_alipay_rate"); + checkModifyRate(org, configJson, "AlipayOnline", "min_alipayonline_rate"); + checkModifyRate(org, configJson, "jd", "min_jd_rate"); + checkModifyRate(org, configJson, "Bestpay", "min_bestpay_rate"); configJson.put("client_rate_id", rateId); configJson.put("manager_id", manager.getString("manager_id")); configJson.put("manager_name", manager.getString("username")); @@ -1267,23 +1268,27 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } // clientMapper.updateCleanDays(clientId, config.getCleanDays()); } - private void checkModifyRate(JSONObject org,JSONObject configJson,String rateName,String rateValueKey){ - if(configJson.getString("rate_name").equals(rateName)){ - if(org.containsKey(rateValueKey)){ - if(configJson.getDouble("rate_value").compareTo(org.getDouble(rateValueKey)) < 0){ - throw new ForbiddenException("费率参数小于旗下商户最低"+rateName+"费率,请重新输入"); - }; + private void checkModifyRate(JSONObject org, JSONObject configJson, String rateName, String rateValueKey) { + if (configJson.getString("rate_name").equals(rateName)) { + if (org.containsKey(rateValueKey)) { + if (configJson.getDouble("rate_value").compareTo(org.getDouble(rateValueKey)) < 0) { + + throw new ForbiddenException("费率参数小于旗下商户最低" + rateName + "费率,请重新输入"); + } + ; } } } - private void checkAddRate(JSONObject config,String channel, String rateKey,JSONObject org,String rateValueKey){ - if(config.containsKey(rateKey)){ - if(org.containsKey(rateValueKey)){ - if(config.getBigDecimal(rateKey).compareTo(org.getBigDecimal(rateValueKey)) < 0){ - throw new ForbiddenException("费率参数小于旗下商户最低"+channel+"费率,请重新输入"); - }; + private void checkAddRate(JSONObject config, String channel, String rateKey, JSONObject org, String rateValueKey) { + if (config.containsKey(rateKey)) { + if (org.containsKey(rateValueKey)) { + if (config.getBigDecimal(rateKey).compareTo(org.getBigDecimal(rateValueKey)) < 0) { + + throw new ForbiddenException("费率参数小于旗下商户最低" + channel + "费率,请重新输入"); + } + ; } } } @@ -1465,7 +1470,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (client == null) { throw new InvalidShortIdException(); } - checkClientOrg(manager,client); + checkClientOrg(manager, client); JSONObject params = new JSONObject(); params.put("client_id", client.getIntValue("client_id")); params.put("is_valid", "1"); @@ -2081,7 +2086,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid throw new BadRequestException("Master Merchant is not valid"); } client.put("parent_client_id", master_client.getIntValue("client_id")); - }else { + } else { client.put("parent_client_id", null); } clientMapper.update(client); @@ -2159,6 +2164,20 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid clearClientCache(clientId); } + @Override + public void setClientTaxInSurcharge(String clientMoniker, boolean taxInSurcharge) { + 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("tax_in_surcharge", taxInSurcharge); + clientMapper.update(update); + clearClientCache(clientId); + } + @Override public List listClientsForSettlement() { return clientMapper.listClientsForSettlement(); @@ -2806,7 +2825,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } private TemplateMessage initSendToComplianceGreenChannelTemplate(String loginUrl, String wxopenid, String templateId2, String bd_user_name, - JSONObject client) { + JSONObject client) { TemplateMessage msg = new TemplateMessage(wxopenid, templateId2, loginUrl); msg.put("first", bd_user_name + " 提交了新商户绿色通道申请,请审核", "#ff0000"); msg.put("keyword1", client.getString("client_moniker") + "申请绿色通道", "#0000ff"); @@ -2965,28 +2984,28 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid throw new InvalidShortIdException(); } checkOrgPermission(manager, client); - List applices = sysWxMerchantApplyMapper.listWxMerchantApplices(client.getInteger("client_id"),new PageBounds(Order.formString("create_time.desc"))); - if(!applices.isEmpty()){ + List applices = sysWxMerchantApplyMapper.listWxMerchantApplices(client.getInteger("client_id"), new PageBounds(Order.formString("create_time.desc"))); + if (!applices.isEmpty()) { return applices; - }else { - if(StringUtils.isNotEmpty(client.getString("sub_merchant_id")) && StringUtils.isNotEmpty(client.getString("merchant_id"))){ - Element elem = wxPayClient.querySubMerchant(client.getString("merchant_id"),client.getString("sub_merchant_id")); + } else { + if (StringUtils.isNotEmpty(client.getString("sub_merchant_id")) && StringUtils.isNotEmpty(client.getString("merchant_id"))) { + Element elem = wxPayClient.querySubMerchant(client.getString("merchant_id"), client.getString("sub_merchant_id")); JSONObject object = new JSONObject(); - object.put("sub_merchant_id",elem.elementText("sub_mch_id_0")); - object.put("client_id",client.getInteger("client_id")); - object.put("merchant_name",elem.elementText("merchant_name_0")); - object.put("merchant_shortname",elem.elementText("merchant_shortname_0")); - object.put("office_phone",elem.elementText("office_phone_0")); - object.put("contact_name",elem.elementText("contact_name_0")); - object.put("contact_email",elem.elementText("contact_email_0")); - object.put("contact_phone",elem.elementText("contact_phone_0")); - object.put("business_category",elem.elementText("business_category_0")); - object.put("merchant_remark",elem.elementText("merchant_remark_0")); - object.put("website",elem.elementText("website_0")); - object.put("merchant_introduction",elem.elementText("merchant_introduction_0")); - object.put("merchant_id",client.getString("merchant_id")); - object.put("create_time",new Date()); - object.put("operator",manager.getString("display_name")); + object.put("sub_merchant_id", elem.elementText("sub_mch_id_0")); + object.put("client_id", client.getInteger("client_id")); + object.put("merchant_name", elem.elementText("merchant_name_0")); + object.put("merchant_shortname", elem.elementText("merchant_shortname_0")); + object.put("office_phone", elem.elementText("office_phone_0")); + object.put("contact_name", elem.elementText("contact_name_0")); + object.put("contact_email", elem.elementText("contact_email_0")); + object.put("contact_phone", elem.elementText("contact_phone_0")); + object.put("business_category", elem.elementText("business_category_0")); + object.put("merchant_remark", elem.elementText("merchant_remark_0")); + object.put("website", elem.elementText("website_0")); + object.put("merchant_introduction", elem.elementText("merchant_introduction_0")); + object.put("merchant_id", client.getString("merchant_id")); + object.put("create_time", new Date()); + object.put("operator", manager.getString("display_name")); List applyQuery = new ArrayList<>(); applyQuery.add(object); return applyQuery; @@ -2994,9 +3013,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } return null; } + @Override @CacheEvict(value = ":all_sub_merchant_id_applices:", key = "#clientMoniker") - public String subMerchantApplication(String clientMoniker, SubMerchantIdApply subMerchantApply,JSONObject manager) { + public String subMerchantApplication(String clientMoniker, SubMerchantIdApply subMerchantApply, JSONObject manager) { JSONObject client = getClientInfoByMoniker(clientMoniker); if (client == null) { throw new InvalidShortIdException(); @@ -3004,34 +3024,34 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid checkOrgPermission(manager, client); JSONObject params = subMerchantApply.insertObject(); - SubMerchantInfo subMerchantInfo = JSONObject.toJavaObject(params,SubMerchantInfo.class); - params.put("merchant_id",subMerchantApply.getMerchant_id()); - params.put("client_id",client.getString("client_id")); - params.put("create_time",new Date()); - params.put("operator",manager.getString("display_name")); - Element elem = wxPayClient.subMerchantApplication(subMerchantApply.getMerchant_id(),subMerchantInfo); + SubMerchantInfo subMerchantInfo = JSONObject.toJavaObject(params, SubMerchantInfo.class); + params.put("merchant_id", subMerchantApply.getMerchant_id()); + params.put("client_id", client.getString("client_id")); + params.put("create_time", new Date()); + params.put("operator", manager.getString("display_name")); + Element elem = wxPayClient.subMerchantApplication(subMerchantApply.getMerchant_id(), subMerchantInfo); String sub_merchant_id = elem.elementText("sub_mch_id"); - if(StringUtils.isNotEmpty(sub_merchant_id)){ - params.put("sub_merchant_id",sub_merchant_id); + if (StringUtils.isNotEmpty(sub_merchant_id)) { + params.put("sub_merchant_id", sub_merchant_id); sysWxMerchantApplyMapper.insertWxMerchantApply(params); clearCacheSubMerchantIdApplices(clientMoniker); - }else { + } else { throw new BadRequestException(elem.elementText("return_msg")); } return sub_merchant_id; } @Override - public List listMerchantIds(String clientMoniker,JSONObject manager) { + public List listMerchantIds(String clientMoniker, JSONObject manager) { JSONObject client = getClientInfoByMoniker(clientMoniker); if (client == null) { throw new InvalidShortIdException(); } checkOrgPermission(manager, client); List list = new ArrayList<>(); - for (WeChatPayConfig.Merchant mch : WechatPayEnvironment.getEnv().getWechatMerchantConfigs()){ + for (WeChatPayConfig.Merchant mch : WechatPayEnvironment.getEnv().getWechatMerchantConfigs()) { JSONObject merchantIds = new JSONObject(); - merchantIds.put("merchant_id",mch.getMerchantId()); + merchantIds.put("merchant_id", mch.getMerchantId()); list.add(merchantIds); } return list; 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 2c15a63f2..260e34b30 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 @@ -175,6 +175,11 @@ public class PartnerManageController { clientManager.setClientRetailPaySurCharge(clientMoniker, config.getBooleanValue("retail_surcharge")); } + @ManagerMapping(value = "/{clientMoniker}/tax_in_surcharge", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.SERVANT}) + public void setClientTaxPayer(@PathVariable String clientMoniker, @RequestBody JSONObject config) { + clientManager.setClientTaxInSurcharge(clientMoniker, config.getBooleanValue("tax_in_surcharge")); + } + @ManagerMapping(value = "/{clientMoniker}/credential_code", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) public void updateCredentialCode(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { clientManager.refreshClientCredentialCode(manager, clientMoniker); diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 619fee907..0f916f3d8 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -184,7 +184,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.business_structures = businessStructuresMap.configs(); $scope.clean_days = angular.copy(clean_days_map); $scope.bd_citys = angular.copy(bd_city_map); - $scope.params = {textType: 'all',org_name:'ALL'}; + $scope.params = {textType: 'all', org_name: 'ALL'}; $scope.loadPartners = function (page) { var params = angular.copy($scope.params); @@ -220,19 +220,19 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.loadOrgs = function () { var params = angular.copy($scope.params); - $http.get('/sys/orgs/orgChild',{params: params}).then(function (resp) { + $http.get('/sys/orgs/orgChild', {params: params}).then(function (resp) { $scope.orgs_child = resp.data; }) }; $scope.loadOrgs(); - /* $scope.onOrgsSelect = function (selectedItem) { - $scope.params.org_id = selectedItem.org_id; - $scope.params.org_name = selectedItem.label; - $scope.loadPartners(); - }; -*/ + /* $scope.onOrgsSelect = function (selectedItem) { + $scope.params.org_id = selectedItem.org_id; + $scope.params.org_name = selectedItem.label; + $scope.loadPartners(); + }; + */ /* $scope.chooseOrg = function (org) { if (org == 'all') { delete $scope.params.org_id; @@ -446,7 +446,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } }]); app.controller('partnerDetailCtrl', ['$scope', '$http', '$state', '$uibModal', '$rootScope', 'Upload', 'commonDialog', 'partner', function ($scope, $http, $state, $uibModal, $rootScope, Upload, commonDialog, partner) { - $scope.init = {wechat_compliance: false,local_merchant:false}; + $scope.init = {wechat_compliance: false, local_merchant: false}; $scope.partner = partner.data; $scope.showDBUsers = function () { $http.get('/sys/partners/' + $scope.partner.client_moniker + '/bd_user').then(function (resp) { @@ -1334,6 +1334,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $http.put('/sys/partners/' + $scope.partner.client_moniker + '/skip_clearing', {skip_clearing: skipClearing}).then(function (resp) { }); }; + $scope.taxInSurcharge = function (taxInSurcharge) { + $http.put('/sys/partners/' + $scope.partner.tax_in_surcharge + '/tax_in_surcharge', {tax_in_surcharge: taxInSurcharge}).then(function (resp) { + + }) + }; $scope.settleHours = [{value: undefined, label: 'Default(24:00, GMT+10)'}]; for (var h = 24; h > 0; h--) { $scope.settleHours.push({value: h, label: ('00' + h).substr(-2) + ':00, ' + $scope.partner.timezone}); @@ -1809,8 +1814,8 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.gatewaySelected = function (arr) { return $scope.params.gateway != null && $scope.params.gateway.filter(function (gateway) { - return arr.indexOf(gateway) >= 0 - }).length > 0 + return arr.indexOf(gateway) >= 0 + }).length > 0 }; $scope.showRefundLog = function (orderId) { @@ -2043,7 +2048,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.chooseOrg = {}; $scope.chooseOrg.org_name = null; if (($scope.currentUser.role & parseInt('1000011', 2)) > 0 && !$scope.currentUser.org_id) { - /* $scope.showOrg = 'Organization';*/ + /* $scope.showOrg = 'Organization';*/ $http.get('/sys/orgs', {params: {}}).then(function (resp) { $scope.orgs = resp.data; }); @@ -2051,22 +2056,22 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.loadOrgs = function () { var params = angular.copy($scope.params); - $http.get('/sys/orgs/orgChild',{params: params}).then(function (resp) { + $http.get('/sys/orgs/orgChild', {params: params}).then(function (resp) { $scope.orgs_child = resp.data; }) }; - /* $scope.chooseOrgFun = function (org) { - if (org == 'all') { - $scope.chooseOrg.org_name = null; - $scope.showOrg = 'All' - } else { - $scope.chooseOrg.org_name = org.name; - $scope.showOrg = org.name; - $scope.params.org_id = org.org_id; - $scope.loadOrgs(); - } - };*/ + /* $scope.chooseOrgFun = function (org) { + if (org == 'all') { + $scope.chooseOrg.org_name = null; + $scope.showOrg = 'All' + } else { + $scope.chooseOrg.org_name = org.name; + $scope.showOrg = org.name; + $scope.params.org_id = org.org_id; + $scope.loadOrgs(); + } + };*/ function initBD() { $http.get('/sys/partners/' + partner.client_moniker + '/bd_user/current').then(function (resp) { @@ -2076,12 +2081,12 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter if (m.manager_id == e.bd_id) { m.choose = true; m.proportion = e.proportion; - /* $scope.chooseOrgFun({org_id: m.org_id, name: m.org_name});*/ - if(($scope.currentUser.role & parseInt('1000000000000', 2))>0){ + /* $scope.chooseOrgFun({org_id: m.org_id, name: m.org_name});*/ + if (($scope.currentUser.role & parseInt('1000000000000', 2)) > 0) { $scope.params.org_ids = m.org_id; $scope.params.org_id = m.org_id; $scope.loadOrgs(); - }else { + } else { $scope.params.org_id = m.org_id; $scope.loadOrgs(); } @@ -2576,7 +2581,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } } }]); - app.controller('subMerchantIdApplicaitonsCtrl', ['$scope', '$http', '$uibModal','$state','commonDialog', function ($scope, $http, $uibModal, $state,commonDialog) { + app.controller('subMerchantIdApplicaitonsCtrl', ['$scope', '$http', '$uibModal', '$state', 'commonDialog', function ($scope, $http, $uibModal, $state, commonDialog) { $scope.loadSubMerchantInfos = function () { $http.get('/sys/partners/' + $scope.partner.client_moniker + '/list_sub_applices', {params: {}}).then(function (resp) { $scope.subMerchantInfos = resp.data; @@ -2599,11 +2604,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter templateUrl: '/static/payment/partner/templates/apply_sub_merchant_id.html', controller: 'applySubMerchantIdCtrl', resolve: { - subMerchantInfo:function () { + subMerchantInfo: function () { return $scope.partner; }, merchantIds: ['$http', '$stateParams', function ($http) { - return $http.get('/sys/partners/'+ $scope.partner.client_moniker +'/get_merchant_ids'); + return $http.get('/sys/partners/' + $scope.partner.client_moniker + '/get_merchant_ids'); }] } }).result.then(function () { @@ -2612,7 +2617,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }; $scope.loadSubMerchantInfos(); }]); - app.controller('applySubMerchantIdCtrl', ['$scope', '$http', '$uibModal','$state','subMerchantInfo', '$filter','merchantIds','commonDialog', function ($scope, $http, $uibModal, $state, subMerchantInfo,$filter,merchantIds,commonDialog) { + app.controller('applySubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', '$filter', 'merchantIds', 'commonDialog', function ($scope, $http, $uibModal, $state, subMerchantInfo, $filter, merchantIds, commonDialog) { $scope.wxIndustries = angular.copy(wxMerchantIndustries); $scope.subMerchantInfo = angular.copy(subMerchantInfo); $scope.merchantIds = merchantIds.data; @@ -2627,11 +2632,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }); return; } - $http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker+ '/sub_apply', $scope.subMerchantInfo).then(function (resp) { + $http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/sub_apply', $scope.subMerchantInfo).then(function (resp) { $scope.apply_sub_merchant_id = resp.data; $scope.$close(); - if(subMerchantInfo.sub_merchant_id != null){ - commonDialog.confirm({title:'Confirm',content:'已申请成功,是否确认使用'}).then(function () { + if (subMerchantInfo.sub_merchant_id != null) { + commonDialog.confirm({title: 'Confirm', content: '已申请成功,是否确认使用'}).then(function () { $http.put('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/payment_config', {sub_merchant_id: $scope.apply_sub_merchant_id}).then(function (resp) { commonDialog.alert({ title: 'Success', @@ -2643,7 +2648,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) }); }) - }else { + } else { $http.put('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/payment_config', {sub_merchant_id: $scope.apply_sub_merchant_id}).then(function (resp) { commonDialog.alert({ title: 'Success', @@ -2681,7 +2686,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter var industry = ''; angular.forEach(wxMerchantIndustries, function (wxMerchant) { if (wxMerchant.value == values) { - industry = wxMerchant.label; + industry = wxMerchant.label; } }); return industry; @@ -2690,17 +2695,17 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter app.filter('bdOrgSelect', function () { return function (bdUsers, params) { var org_id; - org_id = params.org_ids ||params.org_id || currentUser.org_id; + org_id = params.org_ids || params.org_id || currentUser.org_id; if (org_id) { var bdUserByOrg = {}; var count = 0; angular.forEach(bdUsers, function (bdUser) { - if(params.org_ids){ + if (params.org_ids) { if (bdUser.org_id == org_id) { bdUserByOrg[count] = bdUser; count++; } - }else { + } else { if (bdUser.org_id == org_id || bdUser.parent_org_id == org_id) { bdUserByOrg[count] = bdUser; count++; diff --git a/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html b/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html index 750f9bb33..fe75673dc 100644 --- a/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html +++ b/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html @@ -13,6 +13,13 @@
+
+ +
+ +
+