diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java index a80593140..a45b7110c 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java @@ -60,9 +60,10 @@ public interface ManageAppService { List getOrgPrizeList(JSONObject device); - JSONObject getBdConfigKpi(JSONObject device); List getBdPrizeList(JSONObject device); + String getPrizeRulesUrl(JSONObject device); + } diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java index 29e37f1df..2d9c56cf0 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java @@ -143,6 +143,7 @@ public class ManageAppServiceImp implements ManageAppService { query.setQuickPass(true); break; } + query.setOnlyMe(true); return clientManager.listClientsByApp(manager, query); } @@ -372,4 +373,17 @@ public class ManageAppServiceImp implements ManageAppService { } return listBdPrizeLogByOne; } + + @Override + public String getPrizeRulesUrl(JSONObject device) { + //todo 获取BD提成列表 + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + if (manager.getIntValue("org_id") == 1) { + return "http://192.168.0.49:9002/app/rules/bd"; + } else { + return "http://192.168.0.49:9002/app/rules/org"; + } + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java index 81ac37fd0..83adccb81 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java @@ -168,4 +168,9 @@ public class ManageAppController { return manageAppService.getBdPrizeList(device); } + @RequestMapping(value = "/prize/rules", method = RequestMethod.GET) + public String getPrizeRulesUrl(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + return manageAppService.getPrizeRulesUrl(device); + } + } diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/MangerAppRulesController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/MangerAppRulesController.java new file mode 100644 index 000000000..81a1ca326 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/dev/web/MangerAppRulesController.java @@ -0,0 +1,37 @@ +package au.com.royalpay.payment.manage.dev.web; + +import au.com.royalpay.payment.manage.bdprize.core.BDPrizeService; +import com.alibaba.fastjson.JSONObject; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.ModelAndView; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; + +@RestController +@RequestMapping("/app/rules") +public class MangerAppRulesController { + + @Resource + private BDPrizeService bdPrizeService; + + @RequestMapping(value = "/org", method = RequestMethod.GET) + public ModelAndView hrefOrgRules() { + ModelAndView view = new ModelAndView("app/org_prize_rules"); + return view; + } + + @RequestMapping(value = "/bd", method = RequestMethod.GET) + public ModelAndView hrefBdRules() { + ModelAndView view = new ModelAndView("app/bd_prize_rules"); + return view; + } + + @RequestMapping(value = "/bd/config", method = RequestMethod.GET) + public List bdConfigRates() { + return bdPrizeService.getRateConfig(); + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientRegisterInfo.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientRegisterInfo.java index 9f9f4d25e..8084f0237 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientRegisterInfo.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientRegisterInfo.java @@ -76,6 +76,8 @@ public class ClientRegisterInfo { private String merchant_video_url; @JSONField(name = "store_name") private String storeName; + private String client_pay_type; + private String client_pay_desc; public JSONObject insertObject() { JSONObject res = (JSONObject) JSON.toJSON(this); @@ -386,4 +388,20 @@ public class ClientRegisterInfo { public String getStoreName() { return storeName; } + + public void setClient_pay_type(String client_pay_type) { + this.client_pay_type = client_pay_type; + } + + public void setClient_pay_desc(String client_pay_desc) { + this.client_pay_desc = client_pay_desc; + } + + public String getClient_pay_type() { + return client_pay_type; + } + + public String getClient_pay_desc() { + return client_pay_desc; + } } 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 1166a2423..01422682a 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 @@ -676,6 +676,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid JSONObject clientConfig = new JSONObject(); clientConfig.put("client_id", partner.getIntValue("client_id")); clientConfig.put("client_moniker", partner.getString("client_moniker")); + clientConfig.put("client_pay_type", partner.getString("client_pay_type")); + clientConfig.put("client_pay_desc", partner.get("client_pay_desc")); + clientConfigService.save(clientConfig); permissionPartnerManagerImpl.permissionClientModuleSave(partner.getIntValue("client_id"), partner.getString("client_moniker")); } catch (Exception e) { @@ -744,6 +747,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } clientMapper.update(updateInfo); saveOrUpdateMailList(updateInfo, client); + JSONObject clientConfig = new JSONObject(); + clientConfig.put("client_id", clientId); + clientConfig.put("client_moniker", client.getString("client_moniker")); + clientConfig.put("client_pay_type", updateInfo.getString("client_pay_type")); + clientConfig.put("client_pay_desc", updateInfo.get("client_pay_desc")); + clientConfigMapper.update(clientConfig); clientInfoCacheSupport.clearClientCache(clientId); } diff --git a/src/main/resources/templates/app/bd_prize_rules.html b/src/main/resources/templates/app/bd_prize_rules.html new file mode 100755 index 000000000..31e8d1270 --- /dev/null +++ b/src/main/resources/templates/app/bd_prize_rules.html @@ -0,0 +1,98 @@ + + + + + + Title + + + + + + +
+
提成规则
+
+

BD分级提成费率速查表

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
BD LevelKPI完成度Junior BDIntermediate BDSenior BD
费率0.6-0.790.8-2.00.6-0.790.8-2.00.6-0.790.8-2.0
+
+

补充说明

+
    +
  • 按月度发放
  • +
  • 每月发放总提成额度的 80%,剩余 20%按照“年度考评分数比例”于每年年底即 12 月 25 日圣诞前发放
  • +
  • 提前离职者,20%提成不予发放
  • +
  • 年度考评(根据销管中心每月考评表打分制进行统计)按照考评分数对应比例发放 20%的占比部分,扣下部分如果第二年考评超出一定评分 110%可以补发;同样,如果年度考评分数超过 100 分按照同比例发放
  • +
  • 商户开通后连续 1 个月未产生流水的,上交主管,由主管重新分配
  • +
  • 连续 2 个月不产生流水的商户,由销管部统一收回,重新分配
  • +
  • 分配后的商户流水客户专员只能占一半
  • +
  • 离职及调岗人员商户统一上交销管中心,由销管中心 leader 及跨境事业部总监相互协商及相互监督,按照公平公正的原则, 做出分配方案,并由总监确认后统一分配。调岗人员移交的商户,在移交后 1 个月内移交人员和接收人员平分该商家产生的提成,移交人员需配合接收人员做好商户对接和短期内的商户维护; + 离职人员交接的商户提成,接收人员享受一半的提成,另一半作为跨境客服专员福利会基金
  • +
  • 被客户投诉情况严重者,此商户由销管中心无条件收回重新分配
  • +
  • 活动执行未传达到位且出现舞弊、徇私、懒惰等行为的,商户上交由销管中心统一分配
  • +
  • 后期维护不及时,连续一个月不跟踪者,此商户上交销管中心,统一重新分配
  • +
  • 以上分配,销管中心 leader 和跨境支付事业部商量好之后需做好方案后经 COO 审批方可执行
  • +
+
+
+ + \ No newline at end of file diff --git a/src/main/resources/templates/app/org_prize_rules.html b/src/main/resources/templates/app/org_prize_rules.html new file mode 100755 index 000000000..fd5e09c30 --- /dev/null +++ b/src/main/resources/templates/app/org_prize_rules.html @@ -0,0 +1,65 @@ + + + + + + Title + + + + +
+
+
+
+
+
合伙人提成计算说明
+

2018-11-30更新

+
+
+
+ 合伙人提成算法:按照合伙人签约的商户下每笔订单计算合伙人提成,提成规则明细如下:    + (取整规则为:四舍五入保留2位小数) +
+
    +
  • 单笔订单 :  (单笔订单交易金额 * 商家签约费率)取整     - +   (单笔订单交易金额 * 组织成本费率)取整     + =    单笔订单合伙人提成 +
  • +
  • 总交易额 :  合伙人签约的商户累计交易额
  • +
  • 平台手续费:合伙人签约的商户(单笔订单交易金额 * 组织成本费率)取整 累加
  • +
  • 合伙人提成: 每笔订单合伙人提成累加
  • +
+
+
如合伙人存在二级代理,可从二级代理的交易额中得到分润,分润规则如下:
+
    +
  • 二级代理合伙人提成计算规则如同一级代理,分润从平台手续费中扣除。
  • +
  • 如A合伙人与平台签约组织成本费率为1.5%,A合伙人的二级代理B的签约组织成本费率为1.8%,B的商户签约费率为3%
  • +
  • 假设B当月只有一笔交易且交易额为1000,总手续费为30,平台手续费为18,B合伙人提成为12。
  • +
  • 计算A的分润时,会将B的交易额1000 * A的组织成本费率 1.5% = 15,A的分润就是 18-15=3,而B合伙人平台手续费为15,其中扣除3是A的分润
  • +
+
补充说明
+
    +
  • 退款成功的订单不计入合伙人提成内
  • +
  • 当本月有合伙人手续费存在欠款时,无法下载汇款文件
  • +
+
+
+
+
+ + \ No newline at end of file diff --git a/src/main/ui/static/commons/filters/commonFilters.js b/src/main/ui/static/commons/filters/commonFilters.js index 609130527..7361abf79 100644 --- a/src/main/ui/static/commons/filters/commonFilters.js +++ b/src/main/ui/static/commons/filters/commonFilters.js @@ -45,6 +45,17 @@ define(['../app', 'jquery'], function (app, $) { } }); + var offlineDesc = []; + $.ajax({ + url: '/static/data/client_offline_desc.json', + method: 'GET', + async: false, + dataType: 'json', + success: function (data) { + offlineDesc = data; + + } + }); app.filter('partner_state', ['stateMap', function (stateMap) { return function (stateValue) { @@ -163,6 +174,29 @@ define(['../app', 'jquery'], function (app, $) { }]); + app.filter('partner_offline_desc', ['$http', function ($http) { + return function (industryCode) { + var industryLabel = ''; + angular.forEach(offlineDesc, function (category) { + if (category.value == industryCode) { + industryLabel = category.label; + } + angular.forEach(category.children, function (categoryChildren1) { + if (categoryChildren1.value == industryCode) { + industryLabel = categoryChildren1.label; + } + angular.forEach(categoryChildren1.children, function (categoryChildren2) { + if (categoryChildren2.value == industryCode) { + industryLabel = categoryChildren2.label; + } + }); + }); + }); + return industryLabel; + } + + }]); + app.filter('partner_sector', ['sectorMap', function (sectorMap) { return function (sectorValue) { var sectorLabel = ''; diff --git a/src/main/ui/static/config/orgcommission/templates/org_commission_info.html b/src/main/ui/static/config/orgcommission/templates/org_commission_info.html index 2370ed76b..d9cb4c525 100644 --- a/src/main/ui/static/config/orgcommission/templates/org_commission_info.html +++ b/src/main/ui/static/config/orgcommission/templates/org_commission_info.html @@ -2,12 +2,15 @@
-

合伙人提成计算说明

+
+

合伙人提成计算说明

+

2018-11-30更新

+
+
+ 合伙人提成算法:按照合伙人签约的商户下每笔订单计算合伙人提成,提成规则明细如下:    + (取整规则为:四舍五入保留2位小数) +
    -
  • 2018-11-30更新
  • -
  • 合伙人提成算法:按照合伙人签约的商户下每笔订单计算合伙人提成,提成规则明细如下:    - (取整规则为:四舍五入保留2位小数) -
  • 单笔订单 :  (单笔订单交易金额 * 商家签约费率)取整     -   (单笔订单交易金额 * 组织成本费率)取整     =    单笔订单合伙人提成
  • 总交易额 :  合伙人签约的商户累计交易额
  • @@ -19,8 +22,6 @@
  • 如A合伙人与平台签约组织成本费率为1.5%,A合伙人的二级代理B的签约组织成本费率为1.8%,B的商户签约费率为3%
  • 假设B当月只有一笔交易且交易额为1000,总手续费为30,平台手续费为18,B合伙人提成为12。
  • 计算A的分润时,会将B的交易额1000 * A的组织成本费率 1.5% = 15,A的分润就是 18-15=3,而B合伙人平台手续费为15,其中扣除3是A的分润
  • - -

补充说明

    diff --git a/src/main/ui/static/data/client_offline_desc.json b/src/main/ui/static/data/client_offline_desc.json new file mode 100644 index 000000000..777877860 --- /dev/null +++ b/src/main/ui/static/data/client_offline_desc.json @@ -0,0 +1,54 @@ +[ + { + "children": [ + { + "children": [], + "label": "立牌", + "value": "qrcode" + }, + { + "children": [], + "label": "POS", + "value": "pos" + } + ], + "label": "门店", + "value": "1" + }, + { + "children": [ + { + "children": [], + "label": "ipos", + "value": "ipos" + }, + { + "children": [], + "label": "银豹", + "value": "pospal" + }, + { + "children": [], + "label": "aupos", + "value": "aupos" + }, + { + "children": [], + "label": "其他", + "value": "other" + } + ], + "label": "收银系统", + "value": "2" + },{ + "children": [ + { + "children": [], + "label": "无门店", + "value": "no-store" + } + ], + "label": "其他", + "value": "3" + } +] diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 082fbc03b..aa74df360 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -30,6 +30,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter {code: 2, label: 'Manager'}, {code: 3, label: 'Cashier'} ]; + var wxMerchantIndustries = [ { "label": "鞋包服饰|Shoes&Garments", @@ -361,7 +362,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }; }]); - app.controller('addPartnerCtrl', ['$rootScope', '$scope', '$http', '$state', 'Upload', 'commonDialog', 'timezone','businessStructuresMap', 'industryMap', 'stateMap', 'sectorMap', 'countryMap', function ($rootScope, $scope, $http, $state, Upload, commonDialog, timezone, businessStructuresMap, industryMap, stateMap, sectorMap, countryMap) { + app.controller('addPartnerCtrl', ['$rootScope', '$scope', '$http', '$state', 'Upload', 'commonDialog', 'timezone', 'businessStructuresMap', 'industryMap', 'stateMap', 'sectorMap', 'countryMap', function ($rootScope, $scope, $http, $state, Upload, commonDialog, timezone, businessStructuresMap, industryMap, stateMap, sectorMap, countryMap) { if ($scope.partner_application) { $scope.partner = angular.copy($scope.partner_application); delete $rootScope.partner_application; @@ -382,6 +383,12 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.bd_citys = angular.copy(bd_city_map); $scope.params = {textType: 'all', org_name: 'ALL'}; + + $scope.onOfflineDescSelect = function (selectedItem) { + $scope.partner.offline_label = selectedItem.label; + $scope.partner.client_offline_desc = selectedItem.value; + }; + function remove(arr, val) { if (angular.isArray(arr)) { for (var i = arr.length; i--;) { @@ -393,6 +400,12 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } return arr; } + $scope.loadOfflineDesc = function () { + $http.get('/static/data/client_offline_desc.json').then(function (resp) { + $scope.client_offline_select = resp.data; + }) + }; + $scope.loadOfflineDesc(); var industries = angular.copy($scope.industries); $scope.industries = remove(industries, 331); @@ -504,7 +517,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter alert("Logo is necessary!"); return; } - if($scope.partner.partner_type == 'photo'){ + if ($scope.partner.partner_type == 'photo') { if (!$scope.partner.company_photo) { alert('Shop Photo1 is necessary'); return; @@ -523,10 +536,20 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } }) } + // if ($scope.partner.client_pay_type =='online' || $scope.partner.client_pay_type =='all') { + // if (!$scope.partner.online_website && !$scope.partner.online_public_account && !$scope.partner.online_mini_program && !$scope.partner.online_app) { + // alert('线上支付场景至少填写一种方式'); + // return; + // } + // } // if(!window.frames['merchant_detail'].merchant_location){ // alert("Please Locate Merchant's Location"); // return; // } + if ($scope.params.client_pay_type==''){ + alert('请选择商户支付场景') + } + $http.post('/sys/partners', $scope.partner).then(function (resp) { commonDialog.alert({title: 'Success', content: 'Register new partner successfully', type: 'success'}); $scope.updateMerchantLocation(); @@ -618,15 +641,15 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.isComplianceOfShortName = false; $scope.isComplianceOfBusinessStructure = false; var website = partner.data.company_website; - if (website!=null){ - if (website.indexOf('http')!=0){ - $scope.partner.company_website= 'http://'+angular.copy(website); + if (website != null) { + if (website.indexOf('http') != 0) { + $scope.partner.company_website = 'http://' + angular.copy(website); } } $scope.decideCompliance = function (name) { - var keywords = ['education','financial' ,'train','immigrant','invest', - '律师咨询','会计事务所', '移民', '留学','娱乐','金融','地产','投资']; - for(var i = 0; i < keywords.length; i++){ + var keywords = ['education', 'financial', 'train', 'immigrant', 'invest', + '律师咨询', '会计事务所', '移民', '留学', '娱乐', '金融', '地产', '投资']; + for (var i = 0; i < keywords.length; i++) { if (name.indexOf(keywords[i]) != -1) { return true; } @@ -655,12 +678,12 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }; $scope.showFile(); $scope.passClient = function () { - if(!$scope.partner.wechat_institution_merchant_id){ + if (!$scope.partner.wechat_institution_merchant_id) { commonDialog.alert({title: 'info', content: 'HF Institution Merchant Id not Refresh', type: 'info'}); return; } if ($scope.partner.enable_hf) { - if($scope.partner.hfindustry == null){ + if ($scope.partner.hfindustry == null) { alert("已开启HF支付通道,HF行业不可为空!"); return; } @@ -698,7 +721,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter info.push('Business Structure'); } title = 'Warning'; - contentHtml = $sce.trustAsHtml('本次提交的商户[' + $scope.partner.company_name + '],'+ info.toString() +'存在微信渠道不合规信息'); + contentHtml = $sce.trustAsHtml('本次提交的商户[' + $scope.partner.company_name + '],' + info.toString() + '存在微信渠道不合规信息'); choises = [{label: '取消', className: 'btn-danger', key: '2', dismiss: true}, {label: '确认提交', className: 'btn-success', key: '1'}]; content = ''; @@ -731,8 +754,12 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }); }; $scope.pass2GreenChannel = function () { - if(!$scope.partner.wechat_institution_merchant_id){ - commonDialog.alert({title: 'info', content: 'Wechat Institution Merchant Id not Refresh', type: 'info'}); + if (!$scope.partner.wechat_institution_merchant_id) { + commonDialog.alert({ + title: 'info', + content: 'Wechat Institution Merchant Id not Refresh', + type: 'info' + }); return; } commonDialog.confirm({ @@ -787,7 +814,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }; $scope.Export = function () { - var url = '/dev/' + $scope.partner.client_moniker +'/export/aggregate/agreepdf' ; + var url = '/dev/' + $scope.partner.client_moniker + '/export/aggregate/agreepdf'; return url; } $scope.uploadAgreeFile = function (file) { @@ -1037,7 +1064,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter if (!$scope.partner) { return; } - if(!$state.is('partners.detail')){ + if (!$state.is('partners.detail')) { $scope.init.wechat_compliance = false; return; } @@ -1059,7 +1086,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter if (!$scope.partner) { return; } - if(!$state.is('partners.detail')){ + if (!$state.is('partners.detail')) { $scope.init.local_merchant = false; return; } @@ -1096,6 +1123,18 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter var origin_referrer_id = angular.copy($scope.partner.referrer_id); $scope.partner.partner_type = $scope.partner.website ? 'website' : 'photo'; + $scope.loadOfflineDesc = function () { + $http.get('/static/data/client_offline_desc.json').then(function (resp) { + $scope.client_offline_select = resp.data; + }) + }; + $scope.loadOfflineDesc(); + + $scope.onOfflineDescSelect = function (selectedItem) { + $scope.partner.offline_label = selectedItem.label; + $scope.partner.client_offline_desc = selectedItem.value; + }; + $scope.listReferrers = function () { $http.get('/sys/orgs/referrer').then(function (resp) { $scope.referrers = resp.data; @@ -1170,7 +1209,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter alert('suburb can not contain two and more continuous space characters'); return; } - if($scope.partner.partner_type == 'photo'){ + if ($scope.partner.partner_type == 'photo') { if (!$scope.partner.company_photo) { alert('Shop Photo1 is necessary'); return; @@ -1198,10 +1237,19 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter if (!origin_referrer_id && $scope.partner.referrer_id) { content = 'Update partner info successfully,But You Had add new Referrer,Please Change the BD Commission Proportion!'; } + // if ($scope.partner.client_pay_type =='online' || $scope.partner.client_pay_type =='all') { + // if (!$scope.partner.online_website && !$scope.partner.online_public_account && !$scope.partner.online_mini_program && !$scope.partner.online_app) { + // alert('线上支付场景至少填写一种方式'); + // return; + // } + // } // if(!window.frames['merchant_detail'].merchant_location){ // alert("Please Locate Merchant Location!"); // return; // } + if ($scope.params.client_pay_type==''){ + alert('请选择商户支付场景') + } $http.put('/sys/partners/' + $scope.partner.client_moniker, $scope.partner).then(function () { if (content != '') { commonDialog.alert({ @@ -1305,34 +1353,34 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } } }]); - app.controller('partnerPaymentInfoCtrl', ['$scope', '$http', '$state', 'commonDialog','$uibModal', '$sce', function ($scope, $http, $state, commonDialog,$uibModal, $sce) { - $scope.copyHfLink = function() { - var e=document.getElementById("cpbt"); + app.controller('partnerPaymentInfoCtrl', ['$scope', '$http', '$state', 'commonDialog', '$uibModal', '$sce', function ($scope, $http, $state, commonDialog, $uibModal, $sce) { + $scope.copyHfLink = function () { + var e = document.getElementById("cpbt"); e.select(); var successful = document.execCommand("Copy"); if (successful) { commonDialog.alert({title: 'Success', content: '已复制到剪切板!', type: 'success'}); - }else { + } else { commonDialog.alert({title: 'Error', content: '您的浏览器不支持!', type: 'error'}); } }; - $scope.copyYeepayLink = function() { - var e=document.getElementById("cpyeepay"); + $scope.copyYeepayLink = function () { + var e = document.getElementById("cpyeepay"); e.select(); var successful = document.execCommand("Copy"); if (successful) { commonDialog.alert({title: 'Success', content: '已复制到剪切板!', type: 'success'}); - }else { + } else { commonDialog.alert({title: 'Error', content: '您的浏览器不支持!', type: 'error'}); } }; - $scope.copyCBBankPayLink = function() { - var e=document.getElementById("cpcbbankpay"); + $scope.copyCBBankPayLink = function () { + var e = document.getElementById("cpcbbankpay"); e.select(); var successful = document.execCommand("Copy"); if (successful) { commonDialog.alert({title: 'Success', content: '已复制到剪切板!', type: 'success'}); - }else { + } else { commonDialog.alert({title: 'Error', content: '您的浏览器不支持!', type: 'error'}); } }; @@ -1362,7 +1410,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter size: 'lg', resolve: { logs: ['$http', function ($http) { - return $http.get('/sys/partners/'+$scope.partner.client_moniker+'/get_sub_merchant_id_logs'); + return $http.get('/sys/partners/' + $scope.partner.client_moniker + '/get_sub_merchant_id_logs'); }] } }).result.then(function () { @@ -1528,7 +1576,19 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }) }) }; - $scope.init = {jsapi: false, gateway: false, offline: false, refund: false,common_sub_merchant_id:false, channel: {},gateway_alipay_online:false,hf_Link:false,enable_hf_email_notice:false,enable_yeepay_link:false,enable_yeepay_email_notice:false}; + $scope.init = { + jsapi: false, + gateway: false, + offline: false, + refund: false, + common_sub_merchant_id: false, + channel: {}, + gateway_alipay_online: false, + hf_Link: false, + enable_hf_email_notice: false, + enable_yeepay_link: false, + enable_yeepay_email_notice: false + }; $scope.switchCommonSubMerchantId = function () { if (!$scope.paymentInfo) { return; @@ -1549,9 +1609,9 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }; var info = []; $scope.decideCompliance = function (name) { - var keywords = ['education','financial' ,'train','immigrant','invest', - '律师咨询','会计事务所', '移民', '留学','娱乐','金融','地产','投资']; - for(var i = 0; i < keywords.length; i++){ + var keywords = ['education', 'financial', 'train', 'immigrant', 'invest', + '律师咨询', '会计事务所', '移民', '留学', '娱乐', '金融', '地产', '投资']; + for (var i = 0; i < keywords.length; i++) { if (name.indexOf(keywords[i]) != -1) { return true; } @@ -1560,17 +1620,17 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }; $scope.getComplianceInfo = function () { if ($scope.paymentInfo.company_name != null) { - if($scope.decideCompliance($scope.paymentInfo.company_name)) { + if ($scope.decideCompliance($scope.paymentInfo.company_name)) { info.push('Company Name'); } } if ($scope.paymentInfo.short_name != null) { - if($scope.decideCompliance($scope.paymentInfo.short_name)) { - info.push('Short Name'); + if ($scope.decideCompliance($scope.paymentInfo.short_name)) { + info.push('Short Name'); } } if ($scope.paymentInfo.business_structure != null) { - if($scope.decideCompliance($scope.paymentInfo.business_structure)) { + if ($scope.decideCompliance($scope.paymentInfo.business_structure)) { info.push('Business Structure'); } } @@ -1591,7 +1651,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter && $scope.paymentInfo.open_status == 5 && info.length > 0) { commonDialog.confirm({ title: "Warning", - contentHtml: $sce.trustAsHtml('本次提交的商户[' + $scope.partner.company_name + '],'+ info.toString() +'存在微信渠道不合规信息') + contentHtml: $sce.trustAsHtml('本次提交的商户[' + $scope.partner.company_name + '],' + info.toString() + '存在微信渠道不合规信息') }).then(function () { $scope.saveChannel(channel); }) @@ -1640,16 +1700,16 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter if (!$scope.paymentInfo) { return; } - var channelLink = 'enable_'+channel+'_link'; + var channelLink = 'enable_' + channel + '_link'; if (!$scope.init[channelLink]) { $scope.init[channelLink] = true; return; } - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/'+channel, {allow: $scope.paymentInfo[channelLink]}).then(function () { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/' + channel, {allow: $scope.paymentInfo[channelLink]}).then(function () { $scope.loadPartnerPaymentInfo(); }, function (resp) { commonDialog.alert({ - title: 'Failed to change '+channelLink+' permission status', + title: 'Failed to change ' + channelLink + ' permission status', content: resp.data.message, type: 'error' }); @@ -1692,7 +1752,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter title: 'Confirm', content: content }).then(function () { - $http.put('/sys/partners/'+ $scope.partner.client_moniker + '/cb_bankpay/'+ key +'/channel_id', {channel_id: channel}).then(function (resp) { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/cb_bankpay/' + key + '/channel_id', {channel_id: channel}).then(function (resp) { commonDialog.alert({type: 'success', title: 'Success', content: '修改成功'}); $scope.loadPartnerPaymentInfo(); }, function (resp) { @@ -1705,16 +1765,16 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter if (!$scope.paymentInfo) { return; } - var channelNotice = 'enable_'+channel+'_email_notice'; + var channelNotice = 'enable_' + channel + '_email_notice'; if (!$scope.init[channelNotice]) { $scope.init[channelNotice] = true; return; } - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/'+channel+'/email_notice', {allow: $scope.paymentInfo[channelNotice]}).then(function () { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/' + channel + '/email_notice', {allow: $scope.paymentInfo[channelNotice]}).then(function () { $scope.loadPartnerPaymentInfo(); }, function (resp) { commonDialog.alert({ - title: 'Failed to change '+channelNotice+' permission status', + title: 'Failed to change ' + channelNotice + ' permission status', content: resp.data.message, type: 'error' }); @@ -1938,7 +1998,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }]); app.controller('clientSubMerchantIdLogCtrl', ['$scope', '$http', 'logs', function ($scope, $http, logs) { - $scope.logs = logs.data; + $scope.logs = logs.data; }]); app.controller('partnerSubCtrl', ['$scope', '$http', '$uibModal', function ($scope, $http, $uibModal) { $scope.newSubClient = function () { @@ -1964,9 +2024,14 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.loadSubClients(); }]); - app.controller('partnerRatesCtrl', ['$scope', '$rootScope', '$http', '$uibModal', 'commonDialog','$sce', function ($scope, $rootScope, $http, $uibModal, commonDialog,$sce) { + app.controller('partnerRatesCtrl', ['$scope', '$rootScope', '$http', '$uibModal', 'commonDialog', '$sce', function ($scope, $rootScope, $http, $uibModal, commonDialog, $sce) { $scope.bankCtrl = {edit: true, rate_name: 'Wechat'}; - $scope.init = {skip_clearing:false,tax_in_surcharge:false,customer_tax_free:false,allow_surcharge_credit:false}; + $scope.init = { + skip_clearing: false, + tax_in_surcharge: false, + customer_tax_free: false, + allow_surcharge_credit: false + }; $scope.getBankAccount = function () { $http.get('/sys/partners/' + $scope.partner.client_moniker + '/bank_account').then(function (resp) { $scope.bankaccount = resp.data; @@ -1979,7 +2044,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter title: 'Warning', content: '启用收支分离模式清算将使消费者支付手续费模式失效,请确认是否切换?' }).then(function () { - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/surcharge_mode', {surcharge_mode:'distributed'}).then(function () { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/surcharge_mode', {surcharge_mode: 'distributed'}).then(function () { commonDialog.alert({title: 'Success', content: '已切换为收支分离模式', type: 'success'}); $scope.partner.surcharge_mode = 'distributed'; $scope.getBalance(); @@ -1987,12 +2052,12 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); }) }) - }else { + } else { commonDialog.confirm({ title: 'Warning', content: '请确认是否切换成净值清算模式?' }).then(function () { - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/surcharge_mode', {surcharge_mode:'balance'}).then(function () { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/surcharge_mode', {surcharge_mode: 'balance'}).then(function () { commonDialog.alert({title: 'Success', content: '已切换为净值清算模式', type: 'success'}); $scope.partner.surcharge_mode = 'balance'; }, function (resp) { @@ -2033,7 +2098,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter if (!skipClearing) { commonDialog.confirm({ title: 'Warning', - content: 'This operation will switch skip clearing status. Are you sure?' + content: 'This operation will switch skip clearing status. Are you sure?' }).then(function () { commonDialog.inputText({title: '请输入关闭跳过清算的原因'}).then(function (text) { $http.put('/sys/partners/' + $scope.partner.client_moniker + '/skip_clearing', { @@ -2044,7 +2109,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }); }); }) - }else{ + } else { commonDialog.confirm({ title: 'Warning', content: 'This operation will switch skip clearing status. Are you sure?', @@ -2137,10 +2202,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }; $scope.getRates(); $scope.saveBankAccount = function () { - if(isNaN($scope.bankaccount.account_no)){ + if (isNaN($scope.bankaccount.account_no)) { alert("Account No应输入数字!"); return; - }; + } + ; $http.put('/sys/partners/' + $scope.partner.client_moniker + '/bank_account', $scope.bankaccount).then(function () { $scope.getBankAccount(); }, function (resp) { @@ -2200,7 +2266,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }; $scope.complianceChangeCheck(); }]); - app.controller('surchargeAccountDetailCtrl', ['$scope','$http','balance','partner','transactions','commonDialog', function ($scope, $http, balance, partner, transactions,commonDialog) { + app.controller('surchargeAccountDetailCtrl', ['$scope', '$http', 'balance', 'partner', 'transactions', 'commonDialog', function ($scope, $http, balance, partner, transactions, commonDialog) { $scope.surcharge = angular.copy(balance); $scope.transactions = angular.copy(transactions.data); $scope.partner = angular.copy(partner); @@ -2232,7 +2298,10 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.params = {}; } $scope.save = function () { - $http.post('/sys/partners/' + $scope.partner.client_moniker + '/account/save', {amount:$scope.params.amount,remark:$scope.params.remark}).then(function (resp) { + $http.post('/sys/partners/' + $scope.partner.client_moniker + '/account/save', { + amount: $scope.params.amount, + remark: $scope.params.remark + }).then(function (resp) { $scope.getTransactions(); $scope.getBalance(); $scope.canAddDetail = false; @@ -2548,7 +2617,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter alert("Logo is necessary!"); return; } - if($scope.partner.partner_type == 'photo'){ + if ($scope.partner.partner_type == 'photo') { if (!$scope.partner.company_photo) { alert('Shop Photo1 is necessary'); return; @@ -3340,7 +3409,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter detail: ['$http', '$stateParams', function ($http) { return $http.get('/analysis/partner_card/' + client_id + '/settlement_logs/' + detail_id); }], - detail_id:detail_id + detail_id: detail_id }, size: 'lg' }); @@ -3408,7 +3477,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter detail: ['$http', '$stateParams', function ($http) { return $http.get('/analysis/partner_card/' + client_id + '/settlement_logs/' + detail_id); }], - detail_id:detail_id + detail_id: detail_id }, size: 'lg' }); @@ -3416,17 +3485,17 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.chooseLast7Days(); }]); - app.controller('managerSettlementDetailCtrl', ['$scope', 'detail','detail_id','$http', function ($scope, detail,detail_id,$http) { + app.controller('managerSettlementDetailCtrl', ['$scope', 'detail', 'detail_id', '$http', function ($scope, detail, detail_id, $http) { $scope.ctrl = {channel: null}; $scope.show = true; $scope.report = detail.data; - $scope.report.total_charge = Decimal.add($scope.report.total_charge,$scope.report.tax_amount).toFixed(2); - angular.forEach($scope.report.channels,function (e) { - e.total_charge = Decimal.add(e.tax_amount,e.total_charge).toFixed(2); + $scope.report.total_charge = Decimal.add($scope.report.total_charge, $scope.report.tax_amount).toFixed(2); + angular.forEach($scope.report.channels, function (e) { + e.total_charge = Decimal.add(e.tax_amount, e.total_charge).toFixed(2); }); $scope.channelAndDayOfAnalysis = function () { - $http.get('/analysis/partner_card/settlement_logs/' + detail_id+'/analysis/'+$scope.ctrl.channel).then(function (resp) { + $http.get('/analysis/partner_card/settlement_logs/' + detail_id + '/analysis/' + $scope.ctrl.channel).then(function (resp) { $scope.channelAndDayMap = resp.data; $scope.index = 0; }) @@ -3705,7 +3774,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } }]); - app.controller('applyRpaySubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', 'businessStructuresMap','$filter', 'commonDialog','timezone', function ($scope, $http, $uibModal, $state, subMerchantInfo, businessStructuresMap,$filter, commonDialog,timezone) { + app.controller('applyRpaySubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', 'businessStructuresMap', '$filter', 'commonDialog', 'timezone', function ($scope, $http, $uibModal, $state, subMerchantInfo, businessStructuresMap, $filter, commonDialog, timezone) { $scope.subMerchantInfo = angular.copy(subMerchantInfo); $scope.business_structures = businessStructuresMap.configs(); $scope.timezone = timezone.configs(); @@ -3713,7 +3782,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.saveRpayAppliy = function (form) { var merchantInfo = {}; - $scope.errmsg = null; + $scope.errmsg = null; if (form.$invalid) { angular.forEach(form, function (item, key) { if (key.indexOf('$') < 0) { @@ -3722,13 +3791,13 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }); return; } - angular.forEach(form, function (item, key) { - if(item !=null) { - if(item.$name !=null) { - merchantInfo[key] = item.$modelValue; - } - } - }); + angular.forEach(form, function (item, key) { + if (item != null) { + if (item.$name != null) { + merchantInfo[key] = item.$modelValue; + } + } + }); $http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/registRpaySubMerchantId', merchantInfo).then(function (resp) { $scope.apply_sub_merchant_id = resp.data; @@ -3751,17 +3820,17 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } }]); - app.controller('applyYeepaySubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state','subMerchantInfo','yeepayIndustryMap','yeepayBusinessContentMap','$filter', 'commonDialog','Upload', function ($scope, $http, $uibModal, $state,subMerchantInfo,yeepayIndustryMap,yeepayBusinessContentMap,$filter, commonDialog,Upload) { + app.controller('applyYeepaySubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', 'yeepayIndustryMap', 'yeepayBusinessContentMap', '$filter', 'commonDialog', 'Upload', function ($scope, $http, $uibModal, $state, subMerchantInfo, yeepayIndustryMap, yeepayBusinessContentMap, $filter, commonDialog, Upload) { $scope.yeepay_industries = yeepayIndustryMap.configs(); $scope.yeepay_business_contents = yeepayBusinessContentMap.configs(); $scope.subMerchantInfo = angular.copy(subMerchantInfo); - if(!$scope.subMerchantInfo.abn){ + if (!$scope.subMerchantInfo.abn) { $scope.subMerchantInfo.abn = $scope.subMerchantInfo.acn; } - var vouchers={}; + var vouchers = {}; - $scope.directors={}; - $scope.executives={}; + $scope.directors = {}; + $scope.executives = {}; $scope.industry = ''; $scope.business_content = ''; var merchantInfo = {}; @@ -4068,17 +4137,17 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } }]); - app.controller('updateYeepaySubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state','subMerchantInfo','yeepayIndustryMap','yeepayBusinessContentMap','$filter', 'commonDialog','Upload','subMerchantId', function ($scope, $http, $uibModal, $state,subMerchantInfo,yeepayIndustryMap,yeepayBusinessContentMap,$filter, commonDialog,Upload,subMerchantId) { + app.controller('updateYeepaySubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', 'yeepayIndustryMap', 'yeepayBusinessContentMap', '$filter', 'commonDialog', 'Upload', 'subMerchantId', function ($scope, $http, $uibModal, $state, subMerchantInfo, yeepayIndustryMap, yeepayBusinessContentMap, $filter, commonDialog, Upload, subMerchantId) { $scope.yeepay_industries = yeepayIndustryMap.configs(); $scope.yeepay_business_contents = yeepayBusinessContentMap.configs(); $scope.subMerchantInfo = angular.copy(subMerchantInfo); - if(!$scope.subMerchantInfo.abn){ + if (!$scope.subMerchantInfo.abn) { $scope.subMerchantInfo.abn = $scope.subMerchantInfo.acn; } - var vouchers={}; + var vouchers = {}; - $scope.directors={}; - $scope.executives={}; + $scope.directors = {}; + $scope.executives = {}; $scope.industry = ''; $scope.business_content = ''; var merchantInfo = {}; @@ -4388,10 +4457,10 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter app.controller('permissionClientCtrl', ['$scope', '$http', '$uibModal', '$state', '$filter', 'commonDialog', function ($scope, $http, $uibModal, $state, $filter, commonDialog) { - $scope.clientPermission = {client_moniker:$scope.partner.client_moniker}; + $scope.clientPermission = {client_moniker: $scope.partner.client_moniker}; $scope.loadPermissionList = function () { var params = angular.copy($scope.clientPermission); - $http.get('/sys/permission/list',{params:params}).then(function (resp) { + $http.get('/sys/permission/list', {params: params}).then(function (resp) { $scope.permissionList = resp.data; }, function (resp) { commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) @@ -4401,16 +4470,16 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.switchValid = function (permission) { $scope.clientPermission.isValid = permission.is_valid; var params = angular.copy($scope.clientPermission); - $http.post('/sys/permission/'+permission.id,params).then(function (resp) { - },function (resp) { + $http.post('/sys/permission/' + permission.id, params).then(function (resp) { + }, function (resp) { commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) }) }; $scope.init = function () { - var params = {client_moniker:$scope.partner.client_moniker}; - $http.post('/sys/permission/init',params).then(function (resp) { - },function (resp) { + var params = {client_moniker: $scope.partner.client_moniker}; + $http.post('/sys/permission/init', params).then(function (resp) { + }, function (resp) { commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) }) }; @@ -4418,11 +4487,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }]); - - - - - app.filter('bdOrg', function () { return function (bdUsers, org_id) { if (org_id) { diff --git a/src/main/ui/static/payment/partner/templates/add_partner.html b/src/main/ui/static/payment/partner/templates/add_partner.html index aff61f82b..0ed591d6e 100644 --- a/src/main/ui/static/payment/partner/templates/add_partner.html +++ b/src/main/ui/static/payment/partner/templates/add_partner.html @@ -1,5 +1,5 @@