diff --git a/pom.xml b/pom.xml index 19eca1053..4e24bd556 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ au.com.royalpay.payment payment-parent - 2.1.26 + 2.1.28 4.0.0 manage diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysClientUpayProfileMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysClientUpayProfileMapper.java new file mode 100644 index 000000000..2e9842a40 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysClientUpayProfileMapper.java @@ -0,0 +1,19 @@ +package au.com.royalpay.payment.manage.mappers.system; + +import com.alibaba.fastjson.JSONObject; +import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; +import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; +import com.yixsoft.support.mybatis.autosql.annotations.SqlType; +import org.apache.ibatis.annotations.Param; + +@AutoMapper(tablename = "sys_client_upay_profile", pkName = "client_id") +public interface SysClientUpayProfileMapper { + @AutoSql(SqlType.INSERT) + void save(JSONObject info); + + @AutoSql(SqlType.UPDATE) + void update(JSONObject info); + + @AutoSql(SqlType.SELECT) + JSONObject findInfo(@Param("client_id") int clientId); +} 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 8ccdcc9c3..e6d7d0dbe 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 @@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.merchants.beans; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.annotation.JSONField; +import org.apache.commons.lang3.StringUtils; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.Pattern; @@ -114,8 +115,24 @@ public class ClientRegisterInfo { private String client_pay_desc; @JSONField(name = "it_contact_person_email") private String itContactPersonEmail; + @JSONField(name = "client_type") + private String clientType; + @JSONField(name = "acceptor_name") + private String acceptorName; + @JSONField(name = "expected_card_revenue") + private String expectCardRevenue; + @JSONField(name = "average_card_transaction") + private String averageCardTransaction; + @JSONField(name = "mw_industry") + private String mwIndustry; + @JSONField(name = "enable_international_card") + private boolean enableInternaltionCard; + public JSONObject insertObject() { + if (industry == null) { + setIndustry("331"); + } JSONObject res = (JSONObject) JSON.toJSON(this); if (client_apply_id==null){ res.remove("client_apply_id"); @@ -123,6 +140,10 @@ public class ClientRegisterInfo { return res; } + public boolean enableCardPayment() { + return StringUtils.equalsIgnoreCase("card-payment", clientType) || StringUtils.equalsIgnoreCase("all", clientType); + } + public JSONObject updateObject() { JSONObject obj = insertObject(); obj.remove("client_moniker"); @@ -560,4 +581,52 @@ public class ClientRegisterInfo { public void setItContactPersonEmail(String itContactPersonEmail) { this.itContactPersonEmail = itContactPersonEmail; } + + public void setAcceptorName(String acceptorName) { + this.acceptorName = acceptorName; + } + + public String getAcceptorName() { + return acceptorName; + } + + public boolean isEnableInternaltionCard() { + return enableInternaltionCard; + } + + public String getAverageCardTransaction() { + return averageCardTransaction; + } + + public String getExpectCardRevenue() { + return expectCardRevenue; + } + + public String getMwIndustry() { + return mwIndustry; + } + + public void setAverageCardTransaction(String averageCardTransaction) { + this.averageCardTransaction = averageCardTransaction; + } + + public void setEnableInternaltionCard(boolean enableInternaltionCard) { + this.enableInternaltionCard = enableInternaltionCard; + } + + public void setExpectCardRevenue(String expectCardRevenue) { + this.expectCardRevenue = expectCardRevenue; + } + + public void setMwIndustry(String mwIndustry) { + this.mwIndustry = mwIndustry; + } + + public String getClientType() { + return clientType; + } + + public void setClientType(String clientType) { + this.clientType = clientType; + } } 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 3edd05647..b77ff85ce 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 @@ -326,8 +326,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid private RPayPaymentCardSvcApi rPayPaymentCardSvcApi; @Resource private RPayMerchantMapper rPayMerchantMapper; - - + @Resource + private SysClientUpayProfileMapper sysClientUpayProfileMapper; @Resource private SmsSender smsSender; private static final String SOURCE_AGREE_FILE = "source_agree_file"; @@ -433,6 +433,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid clientConfig.put("ext_params",client.getString("ext_params")); } client.putAll(clientConfig); + JSONObject upayInfo = sysClientUpayProfileMapper.findInfo(client.getIntValue("client_id")); + client.putAll(upayInfo); client.put("unsubscribe", mailUnsubMapper.findOneByClientMoniker(clientMoniker) == null ? false : true); client.put("show_all_permission", true); int role = manager != null ? manager.getIntValue("role") : 0; @@ -782,10 +784,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid partner.put("ali_sub_merchant_id", registery.getClientMoniker()); partner.put("credential_code", RandomStringUtils.random(32, true, true)); partner.put("creator", manager.getString("manager_id")); - // if (manager.getIntValue("org_id") == 0) { - // throw new ForbiddenException("You were not belong to any organizations so that you cannot create new - // client"); - // } partner.put("org_id", manager.getIntValue("org_id")); if (StringUtils.isNotEmpty(registery.getLogoId())) { partner.put("logo_url", attachmentClient.getFileUrl(registery.getLogoId())); @@ -807,7 +805,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid //isRiskyMerchant(partner, null); try { - clientMapper.save(partner); JSONObject clientConfig = new JSONObject(); clientConfig.put("client_id", partner.getIntValue("client_id")); @@ -817,33 +814,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid clientConfigService.save(clientConfig); permissionPartnerManagerImpl.permissionClientModuleSave(partner.getIntValue("client_id"), partner.getString("client_moniker")); + saveLegalAndMarketingInfo(partner); + if (registery.enableCardPayment()) { + sysClientUpayProfileMapper.save(partner); + } } catch (Exception e) { throw new BadRequestException("error.partner.valid.dumplicate_client_moniker"); } - - try { - JSONObject representativeInfo = new JSONObject(); - representativeInfo.put("client_id", partner.getIntValue("client_id")); - representativeInfo.put("representative_person", partner.getString("legal_representative_person")); - representativeInfo.put("phone", partner.getString("legal_representative_phone")); - representativeInfo.put("email", partner.getString("legal_representative_email")); - representativeInfo.put("job_title", partner.getString("legal_representative_job")); - representativeInfo.put("address", partner.getString("registered_address")); - representativeInfo.put("suburb", partner.getString("registered_suburb")); - representativeInfo.put("postcode", partner.getString("registered_postcode")); - representativeInfo.put("state", partner.getString("registered_state")); - representativeInfo.put("legal_representative_wechatid", partner.getString("legal_representative_wechatid")); -// marking联系人 - representativeInfo.put("marketing_person", partner.getString("marketing_person")); - representativeInfo.put("marketing_phone", partner.getString("marketing_phone")); - representativeInfo.put("marketing_email", partner.getString("marketing_email")); - representativeInfo.put("marketing_job_title", partner.getString("marketing_job")); - representativeInfo.put("marketing_wechatid", partner.getString("marketing_wechatid")); - sysClientLegalPersonMapper.save(representativeInfo); - } catch (Exception e) { - throw new BadRequestException("error.partner.valid.dumplicate_client_moniker"); - } - if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { JSONObject client_bd = new JSONObject(); client_bd.put("client_id", partner.getIntValue("client_id")); @@ -917,6 +894,16 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid sysClientLegalPersonMapper.save(representativeInfo); } + if (info.enableCardPayment()) { + JSONObject upay = sysClientUpayProfileMapper.findInfo(clientId); + if (upay == null) { + sysClientUpayProfileMapper.save(updateInfo); + }else { + upay.putAll(updateInfo); + sysClientUpayProfileMapper.update(upay); + } + } + int originReferrerId = client.getIntValue("referrer_id"); int updateReferrerId = Integer.parseInt(info.getReferrer_id() == null ? "0" : info.getReferrer_id()); if (originReferrerId == 0 && updateReferrerId != 0) { @@ -7128,4 +7115,24 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid return day+" "+ months[month]+" "+ year; } + public void saveLegalAndMarketingInfo(JSONObject partner) { + JSONObject representativeInfo = new JSONObject(); + representativeInfo.put("client_id", partner.getIntValue("client_id")); + representativeInfo.put("representative_person", partner.getString("legal_representative_person")); + representativeInfo.put("phone", partner.getString("legal_representative_phone")); + representativeInfo.put("email", partner.getString("legal_representative_email")); + representativeInfo.put("job_title", partner.getString("legal_representative_job")); + representativeInfo.put("address", partner.getString("registered_address")); + representativeInfo.put("suburb", partner.getString("registered_suburb")); + representativeInfo.put("postcode", partner.getString("registered_postcode")); + representativeInfo.put("state", partner.getString("registered_state")); + representativeInfo.put("legal_representative_wechatid", partner.getString("legal_representative_wechatid")); + representativeInfo.put("marketing_person", partner.getString("marketing_person")); + representativeInfo.put("marketing_phone", partner.getString("marketing_phone")); + representativeInfo.put("marketing_email", partner.getString("marketing_email")); + representativeInfo.put("marketing_job_title", partner.getString("marketing_job")); + representativeInfo.put("marketing_wechatid", partner.getString("marketing_wechatid")); + sysClientLegalPersonMapper.save(representativeInfo); + } + } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 8952c6aee..3beef053f 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -1,15 +1,15 @@ spring: datasource: master: - host: 119.28.3.196:3310 + host: 192.168.0.84:3306 jdbc-url: jdbc:mysql://${spring.datasource.master.host}/${spring.datasource.master.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false - password: read0nly - schema-name: royalpay_production - username: readonly + password: rpayplus + schema-name: royalpay + username: root slave: - host: 119.28.3.196:3310 + host: 192.168.0.84:3306 jdbc-url: jdbc:mysql://${spring.datasource.slave.host}/${spring.datasource.slave.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false - password: read0nly - schema-name: royalpay_production - username: readonly + password: rpayplus + schema-name: royalpay + username: root type: com.zaxxer.hikari.HikariDataSource diff --git a/src/main/ui/static/commons/commons.js b/src/main/ui/static/commons/commons.js index 1f764d66c..51e7b3204 100644 --- a/src/main/ui/static/commons/commons.js +++ b/src/main/ui/static/commons/commons.js @@ -13,6 +13,7 @@ define(['./app', './services/yeepayIndustryMap', './services/stateMap', './services/industryMap', + './services/upayIndustryMap', './services/wechatGoodMcc', './services/sectorMap', './services/countryMap', diff --git a/src/main/ui/static/commons/services/upayIndustryMap.js b/src/main/ui/static/commons/services/upayIndustryMap.js new file mode 100644 index 000000000..ebc3c6cfb --- /dev/null +++ b/src/main/ui/static/commons/services/upayIndustryMap.js @@ -0,0 +1,81 @@ +define(['../app'], function (app) { + 'use strict'; + + var upayIndustry = [ + { + "label": "Professional Services", + "value": "Professional Services" + }, + { + "label": "Mail/Telephone Order", + "value": "Mail/Telephone Order" + }, + { + "label": "Business Services", + "value": "Business Services" + }, + { + "label": "Retail Store", + "value": "Retail Store" + }, + { + "label": "Airline Services", + "value": "Airline Services" + }, + { + "label": "Entertainment", + "value": "Entertainment" + }, + { + "label": "Automobiles", + "value": "Automobiles" + }, + { + "label": "Clothing", + "value": "Clothing" + }, + { + "label": "Contracted Services", + "value": "Contracted Services" + }, + { + "label": "Government", + "value": "Government" + }, + { + "label": "Hotel", + "value": "Hotel" + }, + { + "label": "Personal Services", + "value": "Personal Services" + }, + { + "label": "Repair Services", + "value": "Repair Services" + }, + { + "label": "Transportation", + "value": "Transportation" + }, + { + "label": "Utilities", + "value": "Utilities" + }, + { + "label": "Wholesale", + "value": "Wholesale" + }, + { + "label": "Other", + "value": "Other" + } + ]; + app.factory('upayIndustryMap', function () { + return { + configs: function () { + return upayIndustry; + } + } + }); +}); diff --git a/src/main/ui/static/payment/partner/add-partner.js b/src/main/ui/static/payment/partner/add-partner.js new file mode 100644 index 000000000..8f2e8ae34 --- /dev/null +++ b/src/main/ui/static/payment/partner/add-partner.js @@ -0,0 +1,884 @@ +/** + * Created by yixian on 2016-06-29. + */ +define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiSelect'], function (angular, Decimal) { + 'use strict'; + var removeClientPayDesc = function (items, key) { + for (var i = 0; i < items.length; i++) { + var item = items[i]; + if (item.indexOf(key) >= 0) { + items.splice(items.indexOf(item), 1); + i = i - 1; + } + } + }; + + + var app = angular.module('addPartnerApp', ['ui.bootstrap', 'ui.router', 'frapontillo.bootstrap-switch', 'ui.select', 'ngFileUpload']); + app.config(['$stateProvider', function ($stateProvider) { + $stateProvider.state('newPartners', { + url: '/partners/new', + templateUrl: '/static/payment/partner/templates/add_partner.html', + controller: 'addPartnerCtrl' + }).state('partners.edit', { + url: '/{clientMoniker}/edit', + templateUrl: '/static/payment/partner/templates/partner_edit.html', + controller: 'partnerEditCtrl', + resolve: { + partner: ['$http', '$stateParams', function ($http, $stateParams) { + return $http.get('/sys/partners/' + $stateParams.clientMoniker); + }] + } + }) + }]); + app.controller('addPartnerCtrl', ['$rootScope', '$scope', '$http', '$state', 'Upload', 'commonDialog', 'timezone', 'businessStructuresMap', 'upayIndustryMap', 'industryMap', 'stateMap', 'sectorMap', 'countryMap', function ($rootScope, $scope, $http, $state, Upload, commonDialog, timezone, businessStructuresMap, upayIndustryMap, industryMap, stateMap, sectorMap, countryMap) { + if ($scope.partner_application) { + $scope.partner = angular.copy($scope.partner_application); + delete $rootScope.partner_application; + } else { + $scope.partner = {timezone: 'Australia/Melbourne'}; + } + $scope.partner.client_type = 'cross-border'; + $scope.initMerchantCode = function () { + $http.get('/sys/partners/init/merchant_code').then(function (response) { + $scope.partner.client_moniker = response.data.partner_code; + $scope.merchantCodeChecked = true; + $scope.merchantIsValid = true; + }); + }; + $scope.initMerchantCode(); + $scope.partner.company_phone_c = 61; + $scope.partner.contact_phone_c = 61; + $scope.partner.client_pay_type = []; + $scope.partner.client_pay_desc = []; + var resetClientPayDescByTpey = function (type) { + type = parseInt(type); + if (type == 1) { + removeClientPayDesc($scope.partner.client_pay_desc, '10'); + } + if (type == 2) { + removeClientPayDesc($scope.partner.client_pay_desc, '20'); + } + }; + $scope.partner.sameAsContactPerson = false; + $scope.checkboxOnclick = function (){ + $scope.partner.sameAsContactPerson = !($scope.partner.sameAsContactPerson); + if($scope.partner.sameAsContactPerson) { + $scope.partner.legal_representative_person = $scope.partner.contact_person; + $scope.partner.legal_representative_phone_a = $scope.partner.contact_phone_a; + $scope.partner.legal_representative_phone_c = $scope.partner.contact_phone_c; + $scope.partner.legal_representative_phone_p = $scope.partner.contact_phone_p; + $scope.partner.legal_representative_email = $scope.partner.contact_email; + $scope.partner.legal_representative_job = $scope.partner.contact_job; + $scope.partner.legal_representative_wechatid = $scope.partner.contact_wechatid; + } + } + + $scope.partner.marketingSameAsContact = false; + $scope.checkMarketingSameAsContact = function (){ + $scope.partner.marketingSameAsContact = !($scope.partner.marketingSameAsContact); + if($scope.partner.marketingSameAsContact) { + $scope.partner.marketing_person = $scope.partner.contact_person; + $scope.partner.marketing_phone_a = $scope.partner.contact_phone_a; + $scope.partner.marketing_phone_c = $scope.partner.contact_phone_c; + $scope.partner.marketing_phone_p = $scope.partner.contact_phone_p; + $scope.partner.marketing_email = $scope.partner.contact_email; + $scope.partner.marketing_job = $scope.partner.contact_job; + $scope.partner.marketing_wechatid = $scope.partner.contact_wechatid; + } + } + + $scope.partner.sameAsAddress=false; + $scope.sameAddress = function (){ + $scope.partner.sameAsAddress = !($scope.partner.sameAsAddress); + if($scope.partner.sameAsAddress) { + $scope.partner.registered_address = $scope.partner.address; + $scope.partner.registered_suburb = $scope.partner.suburb; + $scope.partner.registered_postcode = $scope.partner.postcode; + $scope.partner.registered_state = $scope.partner.state; + } + } + + var compare = function (x, y) { + x = parseInt(x); + y = parseInt(y); + if (x < y) { + return -1; + } else if (x > y) { + return 1; + } else { + return 0; + } + } + $scope.toggleClientPayType = function (type) { + if ($scope.partner.client_pay_type == null || $scope.partner.client_pay_type == undefined) { + $scope.partner.client_pay_type = []; + } + var $idx = $scope.partner.client_pay_type.indexOf(type); + if ($idx >= 0) { + $scope.partner.client_pay_type.splice($idx, 1); + resetClientPayDescByTpey(type); + } else { + $scope.partner.client_pay_type.push(type); + $scope.partner.client_pay_type.sort(compare); + } + }; + $scope.toggleClientPayDesc = function (type) { + if ($scope.partner.client_pay_desc == null || $scope.partner.client_pay_desc == undefined) { + $scope.partner.client_pay_desc = []; + } + var $idx = $scope.partner.client_pay_desc.indexOf(type); + if ($idx >= 0) { + if (type == '203') { + removeClientPayDesc($scope.partner.client_pay_desc, '2030') + } + $scope.partner.client_pay_desc.splice($idx, 1); + } else { + $scope.partner.client_pay_desc.push(type); + $scope.partner.client_pay_desc.sort(compare); + } + }; + $scope.pagination = {}; + $scope.industries = industryMap.configs(); + $scope.upayIndustrys = upayIndustryMap.configs(); + $scope.states = stateMap.configs(); + $scope.countries = countryMap.configs(); + $scope.sectors = sectorMap.configs(); + $scope.business_structures = businessStructuresMap.configs(); + $scope.params = {textType: 'all', org_name: 'ALL'}; + $scope.merchantIsValid = false; + $scope.merchantCodeChecked = false; + + function remove(arr, val) { + if (angular.isArray(arr)) { + for (var i = arr.length; i--;) { + if (arr[i].value == val) { + arr.splice(i, 1); + break; + } + } + } + return arr; + } + + var industries = angular.copy($scope.industries); + $scope.industries = remove(industries, 331); + + $scope.listReferrers = function () { + $http.get('/sys/orgs/referrer').then(function (resp) { + $scope.referrers = resp.data; + }) + }; + $scope.listReferrers(); + + $scope.loadAlipayCategory = function () { + $http.get('/static/data/alipayMcc.json').then(function (resp) { + $scope.alipayMccCategory = resp.data; + }) + }; + $scope.loadAlipayCategory(); + $scope.loadJDindustry = function () { + $http.get('/static/data/jdindustry.json').then(function (resp) { + $scope.jdindustry = resp.data; + }) + }; + $scope.loadJDindustry(); + + $scope.loadLakalaPayindustry = function () { + $http.get('/static/data/lakalapayindustry.json').then(function (resp) { + $scope.lakalapayindustry = resp.data; + }) + }; + $scope.loadLakalaPayindustry(); + + $scope.loadLakalaPaySettle = function () { + $http.get('/static/data/lakalapaysettle.json').then(function (resp) { + $scope.lakalapaysettle = resp.data; + }) + }; + $scope.loadLakalaPaySettle(); + + $scope.loadLakalaPayGoods = function () { + $http.get('/static/data/lakalapaygoods.json').then(function (resp) { + $scope.lakalapaygoods = resp.data; + }) + }; + $scope.loadLakalaPayGoods(); + + $scope.loadRoyalpayindustry = function () { + $http.get('/static/data/royalpayindustry.json').then(function (resp) { + $scope.royalpayindustry = resp.data; + }) + }; + $scope.loadRoyalpayindustry(); + + $scope.loadHfindustry = function () { + $http.get('/static/data/hfindustry.json').then(function (resp) { + $scope.hfindustry = resp.data; + }) + }; + $scope.loadHfindustry(); + + $scope.onAlipayMccSelect = function (selectedItem) { + $scope.partner.alipay_category = selectedItem.label; + $scope.partner.alipayindustry = selectedItem.mccCode; + }; + + $scope.onRoyalPayIndustrySelect = function (selectedItem) { + $scope.partner.royalpay_label = selectedItem.label; + $scope.partner.royalpayindustry = selectedItem.mccCode; + }; + + $scope.onHfIndustrySelect = function (selectedItem) { + $scope.partner.hf_label = selectedItem.label; + $scope.partner.hfindustry = selectedItem.mccCode; + }; + + // $scope.t2city_map = angular.copy(t2city_map); + + $scope.timezones = timezone.configs(); + $scope.checkMerchantCodeIsValid = function (code) { + if (code.length != 4) { + $scope.merchantCodeChecked = false; + $scope.merchantIsValid = false; + return; + } + $http.get('/sys/partners/init/check_code_isvalid', {params: {clientMoniker: code}}).then(function (response) { + $scope.merchantIsValid = response.data; + $scope.merchantCodeChecked = true; + }); + }; + $scope.save = function (form) { + if (form.$invalid) { + angular.forEach(form, function (item, key) { + if (key.indexOf('$') < 0) { + item.$dirty = true; + } + }); + return; + } + + if ($scope.partner.company_name.indexOf("Migration") != -1) { + alert("Company Name包含敏感词汇,请检查后重新提交!"); + return; + } + if ($scope.partner.company_phone_a && ('' + $scope.partner.company_phone_a != '')) { + if ($scope.partner.company_phone_a.indexOf('0') == 0) { + alert("Please remove the first character '0' of area code"); + return; + } + } + if ($scope.partner.contact_phone && ('' + $scope.partner.contact_phone != '')) { + if ($scope.partner.contact_phone.indexOf('0') == 0) { + alert("Please remove the first character '0' of area code"); + return; + } + } + $scope.partner.company_phone = '+' + $scope.partner.company_phone_c + ($scope.partner.company_phone_a || '') + $scope.partner.company_phone_p; + $scope.partner.contact_phone = '+' + $scope.partner.contact_phone_c + ($scope.partner.contact_phone_a || '') + $scope.partner.contact_phone_p; + $scope.partner.legal_representative_phone = '+' + $scope.partner.legal_representative_phone_c + ( $scope.partner.legal_representative_phone_a || '') + $scope.partner.legal_representative_phone_p; + $scope.partner.marketing_phone = '+' + $scope.partner.marketing_phone_c + ( $scope.partner.marketing_phone_a || '') + $scope.partner.marketing_phone_p; + if ($scope.partner.company_phone.indexOf(' ') != -1) { + alert('Company Phone can not contain space character'); + return; + } + if ($scope.partner.contact_phone.indexOf(' ') != -1) { + alert('Contact Phone can not contain space character'); + return; + } + if ($scope.partner.legal_representative_phone.indexOf(' ') != -1) { + alert('Representative phone can not contain space character'); + return; + } + if ($scope.partner.marketing_phone.indexOf(' ') != -1) { + alert('Marketing phone can not contain space character'); + return; + } + if ($scope.partner.contact_email.indexOf(' ') != -1) { + alert('Contact email Phone can not contain space character'); + return; + } + if ($scope.partner.legal_representative_email.indexOf(' ') != -1) { + alert('Representative email Phone can not contain space character'); + return; + } + + if ($scope.partner.marketing_email && $scope.partner.marketing_email.indexOf(' ') != -1) { + alert('Marketing email Phone can not contain space character'); + return; + } + if ($scope.partner.suburb.indexOf(' ') != -1) { + alert('suburb can not contain two and more continuous space characters'); + return; + } + if ($scope.partner.registered_suburb.indexOf(' ') != -1) { + alert('Registered suburb can not contain two and more continuous space characters'); + return; + } + if ($scope.partner.acn && $scope.partner.business_structure == 'Company') { + if ($scope.partner.acn.length != 9) { + alert('Acn is not valid'); + return; + } + } + if (!$scope.partner.logo_url) { + alert("Logo is necessary!"); + return; + } + if ($scope.partner.client_pay_type.indexOf('2') >= 0) { + if (!$scope.partner.company_photo) { + alert('Shop Photo1 is necessary'); + return; + } + if (!$scope.partner.store_photo) { + alert('Shop Photo2 is necessary'); + return; + } + } + + if ($scope.partner.referrer_id) { + $scope.referrers.forEach(function (e) { + if ($scope.partner.referrer_id == e.org_id) { + $scope.partner.referrer_name = e.name; + return; + } + }) + } + + if ($scope.partner.client_pay_type.length == 0) { + alert('请选择商户支付场景') + return; + } + if ($scope.partner.client_pay_desc.length == 0) { + alert('请选择商户支付方式') + return; + } + if (typeof ($scope.partner.client_pay_type) == 'string' || typeof ($scope.partner.client_pay_desc) == 'string') { + $scope.partner.client_pay_type = $scope.partner.client_pay_type.split(","); + $scope.partner.client_pay_desc = $scope.partner.client_pay_desc.split(","); + + } + if ($scope.partner.client_pay_type.indexOf('1') >= 0) { + if ($scope.partner.client_pay_desc.join(',').indexOf('10') < 0) { + alert("请检查线上支付场景是否已选择支付方式"); + return; + } + } + if ($scope.partner.client_pay_type.indexOf('2') >= 0) { + if ($scope.partner.client_pay_desc.join(',').indexOf('20') < 0) { + alert("请检查线下支付场景是否已选择支付方式"); + return; + } + } + if ($scope.partner.client_pay_desc.join(',').indexOf('203') >= 0) { + if ($scope.partner.client_pay_desc.join(',').indexOf('2030') < 0 && $scope.partner.client_pay_desc.join(',').indexOf('20399') < 0) { + alert("请检查线下支付是否已选择收银系统类型"); + return; + } + } + $scope.partner.client_pay_type = $scope.partner.client_pay_type.join(','); + $scope.partner.client_pay_desc = $scope.partner.client_pay_desc.join(','); + $http.post('/sys/partners', $scope.partner).then(function (resp) { + commonDialog.alert({title: 'Success', content: 'Register new partner successfully', type: 'success'}); + $scope.updateMerchantLocation(); + // $scope.loadPartners(); + $state.go('partners.detail', {clientMoniker: resp.data.client_moniker}) + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + }); + }; + $scope.uploadLogo = function (file) { + if (file != null) { + if (file.size > 1 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过1MB,请压缩后重试', type: 'error'}) + } else { + $scope.logoProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.logoProgress; + $scope.partner.logo_id = resp.data.fileid; + $scope.partner.logo_url = resp.data.url; + }, function (resp) { + delete $scope.logoProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + + $scope.uploadShopPhoto = function (file) { + if (file != null) { + if (file.size > 2 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'}) + } else { + $scope.shopPhotoProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.shopPhotoProgress; + $scope.partner.company_photo = resp.data.url; + }, function (resp) { + delete $scope.shopPhotoProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + + $scope.uploadStorePhoto = function (file) { + if (file != null) { + if (file.size > 2 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'}) + } else { + $scope.storePhotoProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.storePhotoProgress; + $scope.partner.store_photo = resp.data.url; + }, function (resp) { + delete $scope.storePhotoProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + + $scope.updateMerchantLocation = function () { + var params = window.frames['merchant_detail'].merchant_location; + if (params) { + $http.put('/sys/partners/modify/' + $scope.partner.client_moniker + '/location', params).then(function () { + }); + } + } + }]); + app.controller('partnerEditCtrl', ['$scope', '$http', '$state', 'Upload', 'commonDialog', 'timezone', 'partner','upayIndustryMap', + function ($scope, $http, $state, Upload, commonDialog, timezone, partner,upayIndustryMap) { + $scope.upayIndustrys = upayIndustryMap.configs(); + $scope.timezones = timezone.configs(); + $scope.partner = partner.data; + if (!$scope.partner.client_type) { + $scope.partner.client_type = 'cross-border'; + } + if($scope.partner.representativeInfo != null) + { + $scope.partner.registered_address = $scope.partner.representativeInfo.address; + $scope.partner.registered_suburb = $scope.partner.representativeInfo.suburb; + $scope.partner.registered_postcode = $scope.partner.representativeInfo.postcode; + $scope.partner.registered_state = $scope.partner.representativeInfo.state; + $scope.partner.legal_representative_person = $scope.partner.representativeInfo.representative_person; + $scope.partner.legal_representative_phone = $scope.partner.representativeInfo.phone; + $scope.partner.legal_representative_email = $scope.partner.representativeInfo.email; + $scope.partner.legal_representative_job = $scope.partner.representativeInfo.job_title; + + $scope.partner.marketing_person = $scope.partner.representativeInfo.marketing_person; + $scope.partner.marketing_phone = $scope.partner.representativeInfo.marketing_phone; + $scope.partner.marketing_email = $scope.partner.representativeInfo.marketing_email; + $scope.partner.marketing_job = $scope.partner.representativeInfo.marketing_job_title; + + $scope.partner.legal_representative_wechatid = $scope.partner.representativeInfo.legal_representative_wechatid; + $scope.partner.marketing_wechatid = $scope.partner.representativeInfo.marketing_wechatid; + } + + function hasRole() { + var rolenum; + switch (sessionStorage.getItem('role')) { + case "administrator": + rolenum = 1; + break; + case "bduser": + rolenum = 4; + break; + case "salesmanager": + rolenum = 8192; + break; + case "accountant": + rolenum = 8; + break; + case "sitemanager": + rolenum = 128; + break; + case "director": + rolenum = 64; + break; + case "developer": + rolenum = 256; + break; + case "compliance": + rolenum = 2; + break; + case "guest": + rolenum = 2048; + break; + case "orgmanager": + rolenum = 4096; + break; + case "riskmanager": + rolenum = 1024; + break; + default: + break; + } + if ((window.currentUser.role & rolenum) >0) { + return true; + }else { + sessionStorage.removeItem('role'); + return false; + } + } + + if (hasRole()) { + $scope.role = sessionStorage.getItem('role'); + } + + var origin_referrer_id = angular.copy($scope.partner.referrer_id); + var resetClientPayDescByTpey = function (type) { + type = parseInt(type); + if (type == 1) { + removeClientPayDesc($scope.partner.client_pay_desc, '10'); + } + if (type == 2) { + removeClientPayDesc($scope.partner.client_pay_desc, '20'); + } + }; + var compare = function (x, y) { + x = parseInt(x); + y = parseInt(y); + if (x < y) { + return -1; + } else if (x > y) { + return 1; + } else { + return 0; + } + } + $scope.toggleClientPayType = function (type) { + if (!$scope.partner.client_pay_type) { + $scope.partner.client_pay_type = []; + } + var $idx = $scope.partner.client_pay_type.indexOf(type); + if ($idx >= 0) { + $scope.partner.client_pay_type.splice($idx, 1); + resetClientPayDescByTpey(type); + } else { + $scope.partner.client_pay_type.push(type); + $scope.partner.client_pay_type.sort(compare); + } + }; + $scope.toggleClientPayDesc = function (type) { + if (!$scope.partner.client_pay_desc) { + $scope.partner.client_pay_desc = []; + } + var $idx = $scope.partner.client_pay_desc.indexOf(type); + if ($idx >= 0) { + if (type == '203') { + removeClientPayDesc($scope.partner.client_pay_desc, '2030') + } + $scope.partner.client_pay_desc.splice($idx, 1); + } else { + $scope.partner.client_pay_desc.push(type); + $scope.partner.client_pay_desc.sort(compare); + } + }; + + $scope.partner.sameAsContactPerson = false; + $scope.checkboxOnclick = function (){ + $scope.partner.sameAsContactPerson = !($scope.partner.sameAsContactPerson); + if($scope.partner.sameAsContactPerson) { + $scope.partner.legal_representative_person = $scope.partner.contact_person; + $scope.partner.legal_representative_phone = $scope.partner.contact_phone; + $scope.partner.legal_representative_email = $scope.partner.contact_email; + $scope.partner.legal_representative_job = $scope.partner.contact_job; + $scope.partner.legal_representative_wechatid = $scope.partner.contact_wechatid; + } + } + + $scope.partner.marketingSameAsContact = false; + $scope.checkMarketingSameAsContact = function (){ + $scope.partner.marketingSameAsContact = !($scope.partner.marketingSameAsContact); + if($scope.partner.marketingSameAsContact) { + $scope.partner.marketing_person = $scope.partner.contact_person; + $scope.partner.marketing_phone = $scope.partner.contact_phone; + $scope.partner.marketing_email = $scope.partner.contact_email; + $scope.partner.marketing_job = $scope.partner.contact_job; + $scope.partner.marketing_wechatid = $scope.partner.contact_wechatid; + } + } + + $scope.partner.sameAsAddress=false; + $scope.sameAddress = function (){ + $scope.partner.sameAsAddress=!($scope.partner.sameAsAddress); + if($scope.partner.sameAsAddress) { + $scope.partner.registered_address = $scope.partner.address; + $scope.partner.registered_suburb = $scope.partner.suburb; + $scope.partner.registered_postcode = $scope.partner.postcode; + $scope.partner.registered_state = $scope.partner.state; + } + } + + $scope.listReferrers = function () { + $http.get('/sys/orgs/referrer').then(function (resp) { + $scope.referrers = resp.data; + }) + }; + $scope.listReferrers(); + + $scope.loadAlipayCategory = function () { + $http.get('/static/data/alipayMcc.json').then(function (resp) { + $scope.alipayMccCategory = resp.data; + }) + }; + $scope.loadAlipayCategory(); + $scope.loadJDindustry = function () { + $http.get('/static/data/jdindustry.json').then(function (resp) { + $scope.jdindustry = resp.data; + }) + }; + $scope.loadJDindustry(); + + $scope.loadLakalaPayindustry = function () { + $http.get('/static/data/lakalapayindustry.json').then(function (resp) { + $scope.lakalapayindustry = resp.data; + }) + }; + $scope.loadLakalaPayindustry(); + + $scope.loadLakalaPaySettle = function () { + $http.get('/static/data/lakalapaysettle.json').then(function (resp) { + $scope.lakalapaysettle = resp.data; + }) + }; + $scope.loadLakalaPaySettle(); + + $scope.loadLakalaPayGoods = function () { + $http.get('/static/data/lakalapaygoods.json').then(function (resp) { + $scope.lakalapaygoods = resp.data; + }) + }; + $scope.loadLakalaPayGoods(); + + $scope.loadRoyalpayindustry = function () { + $http.get('/static/data/royalpayindustry.json').then(function (resp) { + $scope.royalpayindustry = resp.data; + }) + }; + $scope.loadRoyalpayindustry(); + + $scope.loadHfindustry = function () { + $http.get('/static/data/hfindustry.json').then(function (resp) { + $scope.hfindustry = resp.data; + }) + }; + $scope.loadHfindustry(); + + $scope.onAlipayMccSelect = function (selectedItem) { + $scope.partner.alipay_category = selectedItem.label; + $scope.partner.alipayindustry = selectedItem.mccCode; + }; + $scope.onRoyalPayIndustrySelect = function (selectedItem) { + $scope.partner.royalpay_label = selectedItem.label; + $scope.partner.royalpayindustry = selectedItem.mccCode; + }; + $scope.onHfIndustrySelect = function (selectedItem) { + $scope.partner.hf_label = selectedItem.label; + $scope.partner.hfindustry = selectedItem.mccCode; + }; + + + $scope.updatePartner = function (form) { + if (form.$invalid) { + angular.forEach(form, function (item, key) { + if (key.indexOf('$') < 0) { + item.$dirty = true; + } + }); + return; + } + + if ($scope.partner.company_name.indexOf("Migration") != -1) { + alert("Company Name包含敏感词汇,请检查后重新提交!"); + return; + } + if ($scope.partner.company_phone.indexOf(' ') != -1) { + alert('Company Phone can not contain space character'); + return; + } + if ($scope.partner.contact_email.indexOf(' ') != -1) { + alert('Contact email Phone can not contain space character'); + return; + } + if ($scope.partner.suburb.indexOf(' ') != -1) { + alert('suburb can not contain two and more continuous space characters'); + return; + } + if ($scope.partner.client_pay_type.indexOf('2') >= 0) { + if (!$scope.partner.company_photo) { + alert('Shop Photo1 is necessary'); + return; + } + if (!$scope.partner.store_photo) { + alert('Shop Photo2 is necessary'); + return; + } + } + + if ($scope.partner.acn && $scope.partner.business_structure == 'Company') { + if ($scope.partner.acn.length != 9) { + alert('Acn is not valid'); + } + } + if ($scope.partner.referrer_id) { + $scope.referrers.forEach(function (e) { + if ($scope.partner.referrer_id == e.org_id) { + $scope.partner.referrer_name = e.name; + return; + } + }) + } + var content = ''; + 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.length == 0) { + alert('请选择商户支付场景') + return; + } + if ($scope.partner.client_pay_desc.length == 0) { + alert('请选择商户支付方式') + return; + } + if ($scope.partner.client_pay_type.indexOf('1') >= 0) { + if ($scope.partner.client_pay_desc.join(',').indexOf('10') < 0) { + alert("请检查线上支付场景是否已选择支付方式"); + return; + } + } + if ($scope.partner.client_pay_type.indexOf('2') >= 0) { + if ($scope.partner.client_pay_desc.join(',').indexOf('20') < 0) { + alert("请检查线下支付场景是否已选择支付方式"); + return; + } + } + if ($scope.partner.client_pay_desc.join(',').indexOf('203') >= 0) { + if ($scope.partner.client_pay_desc.join(',').indexOf('2030') < 0 && $scope.partner.client_pay_desc.join(',').indexOf('20399') < 0) { + alert("请检查线下支付是否已选择收银系统类型"); + return; + } + } + $scope.partner.client_pay_type = $scope.partner.client_pay_type.join(','); + $scope.partner.client_pay_desc = $scope.partner.client_pay_desc.join(','); + $http.put('/sys/partners/' + $scope.partner.client_moniker, $scope.partner).then(function () { + if (content != '') { + commonDialog.alert({ + title: 'Warning', + content: content, + type: 'error' + }); + } else { + commonDialog.alert({ + title: 'Success', + content: 'Update partner information successfully', + type: 'success' + }); + } + $scope.updateMerchantLocation(); + $scope.loadPartners(); + $state.go('^.detail', {clientMoniker: $scope.partner.client_moniker}, {reload: true}); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) + }); + }; + $scope.uploadLogo = function (file) { + if (file != null) { + if (file.size > 1 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过1MB,请压缩后重试', type: 'error'}) + } else { + $scope.logoProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.logoProgress; + $scope.partner.logo_id = resp.data.fileid; + $scope.partner.logo_url = resp.data.url; + }, function (resp) { + delete $scope.logoProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + + $scope.uploadShopPhoto = function (file) { + if (file != null) { + if (file.size > 2 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'}) + } else { + $scope.shopPhotoProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.shopPhotoProgress; + $scope.partner.company_photo = resp.data.url; + }, function (resp) { + delete $scope.shopPhotoProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + + $scope.uploadStorePhoto = function (file) { + if (file != null) { + if (file.size > 2 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'}) + } else { + $scope.storePhotoProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.storePhotoProgress; + $scope.partner.store_photo = resp.data.url; + }, function (resp) { + delete $scope.storePhotoProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + + $scope.getMerchantLocation = function () { + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/location').then(function (resp) { + $scope.merchant_location = resp.data; + }); + }; + $scope.getMerchantLocation(); + + $scope.updateMerchantLocation = function () { + var params = window.frames['merchant_detail'].merchant_location; + if (params) { + $http.put('/sys/partners/modify/' + $scope.partner.client_moniker + '/location', params).then(function () { + }); + } + } + }]); + return app; +}); diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 558192fb3..6f74bc965 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -96,10 +96,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter templateUrl: '/static/payment/partner/templates/partners.html', controller: 'partnerListCtrl', data: {label: '商户列表'} - }).state('newPartners', { - url: '/partners/new', - templateUrl: '/static/payment/partner/templates/add_partner.html', - controller: 'addPartnerCtrl' }).state('businessCompliance', { url: '/partners/compliance', templateUrl: '/static/payment/partner/templates/partner_compliance.html', @@ -117,15 +113,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter return $http.get('/sys/partners/' + $stateParams.clientMoniker); }] } - }).state('partners.edit', { - url: '/{clientMoniker}/edit', - templateUrl: '/static/payment/partner/templates/partner_edit.html', - controller: 'partnerEditCtrl', - resolve: { - partner: ['$http', '$stateParams', function ($http, $stateParams) { - return $http.get('/sys/partners/' + $stateParams.clientMoniker); - }] - } }).state('partners.detail.payment_info', { url: '/payment', templateUrl: '/static/payment/partner/templates/partner_payment_info.html', @@ -161,13 +148,17 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }).state('partners.detail.files', { url: '/files', templateUrl: '/static/payment/partner/templates/partner_auth_files.html', - controller: 'partnerAuthFileCtrl', + controller: 'partnerAuthFileCtrl' + }).state('partners.detail.files.CP_files', { + url: '/cp_files', + templateUrl: '/static/payment/partner/templates/partner_cp_auth_files.html', + controller: 'partnerCPAuthFileCtrl', resolve: { file: ['$http', '$stateParams', function ($http, $stateParams) { return $http.get('/sys/partners/' + $stateParams.clientMoniker + '/file'); }] } - }).state('partners.detail.MW_files', { + }).state('partners.detail.files.MW_files', { url: '/mw_files', templateUrl: '/static/payment/partner/templates/partner_mw_auth_files.html', controller: 'partnerMWAuthFileCtrl', @@ -427,436 +418,6 @@ 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) { - if ($scope.partner_application) { - $scope.partner = angular.copy($scope.partner_application); - delete $rootScope.partner_application; - } else { - $scope.partner = {timezone: 'Australia/Melbourne'}; - } - $scope.initMerchantCode = function () { - $http.get('/sys/partners/init/merchant_code').then(function (response) { - $scope.partner.client_moniker = response.data.partner_code; - $scope.merchantCodeChecked = true; - $scope.merchantIsValid = true; - }); - }; - $scope.initMerchantCode(); - $scope.partner.company_phone_c = 61; - $scope.partner.contact_phone_c = 61; - $scope.partner.client_pay_type = []; - $scope.partner.client_pay_desc = []; - var resetClientPayDescByTpey = function (type) { - type = parseInt(type); - if (type == 1) { - removeClientPayDesc($scope.partner.client_pay_desc, '10'); - } - if (type == 2) { - removeClientPayDesc($scope.partner.client_pay_desc, '20'); - } - }; - $scope.partner.sameAsContactPerson = false; - $scope.checkboxOnclick = function (){ - $scope.partner.sameAsContactPerson = !($scope.partner.sameAsContactPerson); - if($scope.partner.sameAsContactPerson) { - $scope.partner.legal_representative_person = $scope.partner.contact_person; - $scope.partner.legal_representative_phone_a = $scope.partner.contact_phone_a; - $scope.partner.legal_representative_phone_c = $scope.partner.contact_phone_c; - $scope.partner.legal_representative_phone_p = $scope.partner.contact_phone_p; - $scope.partner.legal_representative_email = $scope.partner.contact_email; - $scope.partner.legal_representative_job = $scope.partner.contact_job; - $scope.partner.legal_representative_wechatid = $scope.partner.contact_wechatid; - } - } - - $scope.partner.marketingSameAsContact = false; - $scope.checkMarketingSameAsContact = function (){ - $scope.partner.marketingSameAsContact = !($scope.partner.marketingSameAsContact); - if($scope.partner.marketingSameAsContact) { - $scope.partner.marketing_person = $scope.partner.contact_person; - $scope.partner.marketing_phone_a = $scope.partner.contact_phone_a; - $scope.partner.marketing_phone_c = $scope.partner.contact_phone_c; - $scope.partner.marketing_phone_p = $scope.partner.contact_phone_p; - $scope.partner.marketing_email = $scope.partner.contact_email; - $scope.partner.marketing_job = $scope.partner.contact_job; - $scope.partner.marketing_wechatid = $scope.partner.contact_wechatid; - } - } - - $scope.partner.sameAsAddress=false; - $scope.sameAddress = function (){ - $scope.partner.sameAsAddress = !($scope.partner.sameAsAddress); - if($scope.partner.sameAsAddress) { - $scope.partner.registered_address = $scope.partner.address; - $scope.partner.registered_suburb = $scope.partner.suburb; - $scope.partner.registered_postcode = $scope.partner.postcode; - $scope.partner.registered_state = $scope.partner.state; - } - } - - var compare = function (x, y) { - x = parseInt(x); - y = parseInt(y); - if (x < y) { - return -1; - } else if (x > y) { - return 1; - } else { - return 0; - } - } - $scope.toggleClientPayType = function (type) { - if ($scope.partner.client_pay_type == null || $scope.partner.client_pay_type == undefined) { - $scope.partner.client_pay_type = []; - } - var $idx = $scope.partner.client_pay_type.indexOf(type); - if ($idx >= 0) { - $scope.partner.client_pay_type.splice($idx, 1); - resetClientPayDescByTpey(type); - } else { - $scope.partner.client_pay_type.push(type); - $scope.partner.client_pay_type.sort(compare); - } - }; - $scope.toggleClientPayDesc = function (type) { - if ($scope.partner.client_pay_desc == null || $scope.partner.client_pay_desc == undefined) { - $scope.partner.client_pay_desc = []; - } - var $idx = $scope.partner.client_pay_desc.indexOf(type); - if ($idx >= 0) { - if (type == '203') { - removeClientPayDesc($scope.partner.client_pay_desc, '2030') - } - $scope.partner.client_pay_desc.splice($idx, 1); - } else { - $scope.partner.client_pay_desc.push(type); - $scope.partner.client_pay_desc.sort(compare); - } - }; - $scope.pagination = {}; - $scope.industries = industryMap.configs(); - $scope.states = stateMap.configs(); - $scope.countries = countryMap.configs(); - $scope.sectors = sectorMap.configs(); - $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.merchantIsValid = false; - $scope.merchantCodeChecked = false; - - function remove(arr, val) { - if (angular.isArray(arr)) { - for (var i = arr.length; i--;) { - if (arr[i].value == val) { - arr.splice(i, 1); - break; - } - } - } - return arr; - } - - var industries = angular.copy($scope.industries); - $scope.industries = remove(industries, 331); - - $scope.listReferrers = function () { - $http.get('/sys/orgs/referrer').then(function (resp) { - $scope.referrers = resp.data; - }) - }; - $scope.listReferrers(); - - $scope.loadAlipayCategory = function () { - $http.get('/static/data/alipayMcc.json').then(function (resp) { - $scope.alipayMccCategory = resp.data; - }) - }; - $scope.loadAlipayCategory(); - $scope.loadJDindustry = function () { - $http.get('/static/data/jdindustry.json').then(function (resp) { - $scope.jdindustry = resp.data; - }) - }; - $scope.loadJDindustry(); - - $scope.loadLakalaPayindustry = function () { - $http.get('/static/data/lakalapayindustry.json').then(function (resp) { - $scope.lakalapayindustry = resp.data; - }) - }; - $scope.loadLakalaPayindustry(); - - $scope.loadLakalaPaySettle = function () { - $http.get('/static/data/lakalapaysettle.json').then(function (resp) { - $scope.lakalapaysettle = resp.data; - }) - }; - $scope.loadLakalaPaySettle(); - - $scope.loadLakalaPayGoods = function () { - $http.get('/static/data/lakalapaygoods.json').then(function (resp) { - $scope.lakalapaygoods = resp.data; - }) - }; - $scope.loadLakalaPayGoods(); - - $scope.loadRoyalpayindustry = function () { - $http.get('/static/data/royalpayindustry.json').then(function (resp) { - $scope.royalpayindustry = resp.data; - }) - }; - $scope.loadRoyalpayindustry(); - - $scope.loadHfindustry = function () { - $http.get('/static/data/hfindustry.json').then(function (resp) { - $scope.hfindustry = resp.data; - }) - }; - $scope.loadHfindustry(); - - $scope.onAlipayMccSelect = function (selectedItem) { - $scope.partner.alipay_category = selectedItem.label; - $scope.partner.alipayindustry = selectedItem.mccCode; - }; - - $scope.onRoyalPayIndustrySelect = function (selectedItem) { - $scope.partner.royalpay_label = selectedItem.label; - $scope.partner.royalpayindustry = selectedItem.mccCode; - }; - - $scope.onHfIndustrySelect = function (selectedItem) { - $scope.partner.hf_label = selectedItem.label; - $scope.partner.hfindustry = selectedItem.mccCode; - }; - - // $scope.t2city_map = angular.copy(t2city_map); - - $scope.timezones = timezone.configs(); - $scope.checkMerchantCodeIsValid = function (code) { - if (code.length != 4) { - $scope.merchantCodeChecked = false; - $scope.merchantIsValid = false; - return; - } - $http.get('/sys/partners/init/check_code_isvalid', {params: {clientMoniker: code}}).then(function (response) { - $scope.merchantIsValid = response.data; - $scope.merchantCodeChecked = true; - }); - }; - $scope.save = function (form) { - if (form.$invalid) { - angular.forEach(form, function (item, key) { - if (key.indexOf('$') < 0) { - item.$dirty = true; - } - }); - return; - } - - if ($scope.partner.company_name.indexOf("Migration") != -1) { - alert("Company Name包含敏感词汇,请检查后重新提交!"); - return; - } - if ($scope.partner.company_phone_a && ('' + $scope.partner.company_phone_a != '')) { - if ($scope.partner.company_phone_a.indexOf('0') == 0) { - alert("Please remove the first character '0' of area code"); - return; - } - } - if ($scope.partner.contact_phone && ('' + $scope.partner.contact_phone != '')) { - if ($scope.partner.contact_phone.indexOf('0') == 0) { - alert("Please remove the first character '0' of area code"); - return; - } - } - $scope.partner.company_phone = '+' + $scope.partner.company_phone_c + ($scope.partner.company_phone_a || '') + $scope.partner.company_phone_p; - $scope.partner.contact_phone = '+' + $scope.partner.contact_phone_c + ($scope.partner.contact_phone_a || '') + $scope.partner.contact_phone_p; - $scope.partner.legal_representative_phone = '+' + $scope.partner.legal_representative_phone_c + ( $scope.partner.legal_representative_phone_a || '') + $scope.partner.legal_representative_phone_p; - $scope.partner.marketing_phone = '+' + $scope.partner.marketing_phone_c + ( $scope.partner.marketing_phone_a || '') + $scope.partner.marketing_phone_p; - if ($scope.partner.company_phone.indexOf(' ') != -1) { - alert('Company Phone can not contain space character'); - return; - } - if ($scope.partner.contact_phone.indexOf(' ') != -1) { - alert('Contact Phone can not contain space character'); - return; - } - if ($scope.partner.legal_representative_phone.indexOf(' ') != -1) { - alert('Representative phone can not contain space character'); - return; - } - if ($scope.partner.marketing_phone.indexOf(' ') != -1) { - alert('Marketing phone can not contain space character'); - return; - } - if ($scope.partner.contact_email.indexOf(' ') != -1) { - alert('Contact email Phone can not contain space character'); - return; - } - if ($scope.partner.legal_representative_email.indexOf(' ') != -1) { - alert('Representative email Phone can not contain space character'); - return; - } - if ($scope.partner.marketing_email.indexOf(' ') != -1) { - alert('Marketing email Phone can not contain space character'); - return; - } - if ($scope.partner.suburb.indexOf(' ') != -1) { - alert('suburb can not contain two and more continuous space characters'); - return; - } - if ($scope.partner.registered_suburb.indexOf(' ') != -1) { - alert('Registered suburb can not contain two and more continuous space characters'); - return; - } - if ($scope.partner.acn && $scope.partner.business_structure == 'Company') { - if ($scope.partner.acn.length != 9) { - alert('Acn is not valid'); - return; - } - } - if (!$scope.partner.logo_url) { - alert("Logo is necessary!"); - return; - } - if ($scope.partner.client_pay_type.indexOf('2') >= 0) { - if (!$scope.partner.company_photo) { - alert('Shop Photo1 is necessary'); - return; - } - if (!$scope.partner.store_photo) { - alert('Shop Photo2 is necessary'); - return; - } - } - - if ($scope.partner.referrer_id) { - $scope.referrers.forEach(function (e) { - if ($scope.partner.referrer_id == e.org_id) { - $scope.partner.referrer_name = e.name; - return; - } - }) - } - - if ($scope.partner.client_pay_type.length == 0) { - alert('请选择商户支付场景') - return; - } - if ($scope.partner.client_pay_desc.length == 0) { - alert('请选择商户支付方式') - return; - } - if (typeof ($scope.partner.client_pay_type) == 'string' || typeof ($scope.partner.client_pay_desc) == 'string') { - $scope.partner.client_pay_type = $scope.partner.client_pay_type.split(","); - $scope.partner.client_pay_desc = $scope.partner.client_pay_desc.split(","); - - } - if ($scope.partner.client_pay_type.indexOf('1') >= 0) { - if ($scope.partner.client_pay_desc.join(',').indexOf('10') < 0) { - alert("请检查线上支付场景是否已选择支付方式"); - return; - } - } - if ($scope.partner.client_pay_type.indexOf('2') >= 0) { - if ($scope.partner.client_pay_desc.join(',').indexOf('20') < 0) { - alert("请检查线下支付场景是否已选择支付方式"); - return; - } - } - if ($scope.partner.client_pay_desc.join(',').indexOf('203') >= 0) { - if ($scope.partner.client_pay_desc.join(',').indexOf('2030') < 0 && $scope.partner.client_pay_desc.join(',').indexOf('20399') < 0) { - alert("请检查线下支付是否已选择收银系统类型"); - return; - } - } - $scope.partner.client_pay_type = $scope.partner.client_pay_type.join(','); - $scope.partner.client_pay_desc = $scope.partner.client_pay_desc.join(','); - $http.post('/sys/partners', $scope.partner).then(function (resp) { - commonDialog.alert({title: 'Success', content: 'Register new partner successfully', type: 'success'}); - $scope.updateMerchantLocation(); - // $scope.loadPartners(); - $state.go('partners.detail', {clientMoniker: resp.data.client_moniker}) - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - }); - }; - $scope.uploadLogo = function (file) { - if (file != null) { - if (file.size > 1 * 1024 * 1024) { - commonDialog.alert({title: 'Error', content: '文件大小不能超过1MB,请压缩后重试', type: 'error'}) - } else { - $scope.logoProgress = {value: 0}; - Upload.upload({ - url: '/attachment/files', - data: {file: file} - }).then(function (resp) { - delete $scope.logoProgress; - $scope.partner.logo_id = resp.data.fileid; - $scope.partner.logo_url = resp.data.url; - }, function (resp) { - delete $scope.logoProgress; - commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) - }, function (evt) { - $scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total); - }) - } - } - }; - - $scope.uploadShopPhoto = function (file) { - if (file != null) { - if (file.size > 2 * 1024 * 1024) { - commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'}) - } else { - $scope.shopPhotoProgress = {value: 0}; - Upload.upload({ - url: '/attachment/files', - data: {file: file} - }).then(function (resp) { - delete $scope.shopPhotoProgress; - $scope.partner.company_photo = resp.data.url; - }, function (resp) { - delete $scope.shopPhotoProgress; - commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) - }, function (evt) { - $scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total); - }) - } - } - }; - - $scope.uploadStorePhoto = function (file) { - if (file != null) { - if (file.size > 2 * 1024 * 1024) { - commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'}) - } else { - $scope.storePhotoProgress = {value: 0}; - Upload.upload({ - url: '/attachment/files', - data: {file: file} - }).then(function (resp) { - delete $scope.storePhotoProgress; - $scope.partner.store_photo = resp.data.url; - }, function (resp) { - delete $scope.storePhotoProgress; - commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) - }, function (evt) { - $scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total); - }) - } - } - }; - - $scope.updateMerchantLocation = function () { - var params = window.frames['merchant_detail'].merchant_location; - if (params) { - $http.put('/sys/partners/modify/' + $scope.partner.client_moniker + '/location', params).then(function () { - }); - } - } - }]); app.controller('partnerDetailCtrl', ['$scope', '$http', '$state', '$uibModal', '$rootScope', 'Upload', 'commonDialog', 'partner', '$sce', function ($scope, $http, $state, $uibModal, $rootScope, Upload, commonDialog, partner, $sce) { $scope.init = {wechat_compliance: false, local_merchant: false}; $scope.partner = partner.data; @@ -1135,612 +696,198 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); }) } - }) - }; - $scope.apply2makeAgreeFile = function () { - $http.get('/sys/partners/' + $scope.partner.client_moniker + '/make_agree_file').then(function () { - commonDialog.alert({ - title: 'Success!', - content: '已提交制作合同!', - type: 'success' - }); - $state.reload(); - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - } - ); - }; - - $scope.commit2GreenChannel = function () { - commonDialog.confirm({ - title: 'Audit Partner', - content: 'Are you sure to mark partner ' + $scope.partner.company_name + ' Green Channel?' - }).then(function () { - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/compliance/green_channel').then(function () { - commonDialog.alert({ - title: 'Success', - content: 'Commit to Green Channel successfully', - type: 'success' - }); - $state.reload(); - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - }) - - }) - }; - - $scope.markAuditEmail = function () { - commonDialog.confirm({ - title: 'Warning', - content: 'Make sure you have send the email to client.' - }).then(function () { - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/audit/email_sending_status').then(function () { - $state.reload(); - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - }) - }) - }; - $scope.resendApproveEmail = function () { - commonDialog.confirm({ - title: 'Warning', - content: 'This operation will reset the password of admin user. Are you sure this email is correct ? Or you may update this information first.' - }).then(function () { - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/audit/send_email').then(function () { - $state.reload(); - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - }) - }) - }; - $scope.editBDUser = function () { - $uibModal.open({ - templateUrl: '/static/payment/partner/templates/bd_user_choose_dialog.html', - controller: 'partnerChooseBDUserDialogCtrl', - resolve: { - bdUsers: ['$http', function ($http) { - return $http.get('/sys/manager_accounts/roles/bd_user'); - }], - partner: function () { - return $scope.partner; - }, - type: function () { - return 'edit'; - } - } - }).result.then(function () { - $state.reload(); - }) - }; - $scope.bindBDUser = function () { - $uibModal.open({ - templateUrl: '/static/payment/partner/templates/bd_user_choose_dialog.html', - controller: 'partnerChooseBDUserDialogCtrl', - resolve: { - bdUsers: ['$http', function ($http) { - return $http.get('/sys/manager_accounts/roles/bd_user'); - }], - partner: function () { - return $scope.partner; - }, - type: function () { - return 'add'; - } - } - }).result.then(function () { - $state.reload(); - }) - }; - - $scope.configMasterMerchant = function () { - commonDialog.inputText({title: 'Input Master Merchant Code'}).then(function (text) { - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/master_configuration', {master_merchant: text}).then(function () { - commonDialog.alert({title: 'Success', content: "Master Merchant Code:" + text, type: 'success'}); - }, function (resp) { - commonDialog.alert({ - title: 'Config Master Merchant Failed', - content: resp.data.message, - type: 'error' - }); - }) - }) - }; - - $scope.getMerchantLocation = function () { - $http.get('/sys/partners/' + $scope.partner.client_moniker + '/location').then(function (resp) { - $scope.merchant_location = resp.data; - }); - }; - $scope.getMerchantLocation(); - - - $scope.complianceCheck = function () { - if (!$rootScope.complianceCheck) { - $rootScope.complianceCheck = {}; - } - $rootScope.complianceCheck.client_id = $scope.partner.client_id; - $rootScope.complianceCheck.clientInfo = true; - }; - $scope.complianceChangeCheck = function () { - if ($rootScope.complianceCheck) { - if ($scope.partner.client_id != $rootScope.complianceCheck.client_id) { - delete $rootScope.complianceCheck; - } - } - }; - $scope.complianceChangeCheck(); - - $scope.changeWechatCompliance = function () { - if (!$scope.partner) { - return; - } - if (!$state.is('partners.detail')) { - $scope.init.wechat_compliance = false; - return; - } - if (!$scope.init.wechat_compliance) { - $scope.init.wechat_compliance = true; - return; - } - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/wechat_compliance_permission', {allow: $scope.partner.wechat_compliance}).then(function () { - - }, function (resp) { - commonDialog.alert({ - title: 'failed to change wechat_compliance permission status', - content: resp.data.message, - type: 'error' - }) - }) - }; - $scope.changeLocalMerchant = function () { - if (!$scope.partner) { - return; - } - if (!$state.is('partners.detail')) { - $scope.init.local_merchant = false; - return; - } - if (!$scope.init.local_merchant) { - $scope.init.local_merchant = true; - return; - } - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/local_merchant_permission', {allow: $scope.partner.local_merchant}).then(function () { - - }, function (resp) { - commonDialog.alert({ - title: 'failed to change local_merchant permission status', - content: resp.data.message, - type: 'error' - }) - }) - }; - - $scope.removeSub = function () { - $http.delete('/sys/partners/unsub/' + $scope.partner.client_moniker).then(function (resp) { - $state.reload(); - }); - }; - $scope.addSub = function () { - $http.put('/sys/partners/unsub/' + $scope.partner.client_moniker).then(function (resp) { - $state.reload(); - }); - }; - }]); - app.controller('partnerEditCtrl', ['$scope', '$http', '$state', 'Upload', 'commonDialog', 'timezone', 'partner', - function ($scope, $http, $state, Upload, commonDialog, timezone, partner) { - $scope.timezones = timezone.configs(); - $scope.partner = partner.data; - if($scope.partner.representativeInfo != null) - { - $scope.partner.registered_address = $scope.partner.representativeInfo.address; - $scope.partner.registered_suburb = $scope.partner.representativeInfo.suburb; - $scope.partner.registered_postcode = $scope.partner.representativeInfo.postcode; - $scope.partner.registered_state = $scope.partner.representativeInfo.state; - $scope.partner.legal_representative_person = $scope.partner.representativeInfo.representative_person; - $scope.partner.legal_representative_phone = $scope.partner.representativeInfo.phone; - $scope.partner.legal_representative_email = $scope.partner.representativeInfo.email; - $scope.partner.legal_representative_job = $scope.partner.representativeInfo.job_title; - - $scope.partner.marketing_person = $scope.partner.representativeInfo.marketing_person; - $scope.partner.marketing_phone = $scope.partner.representativeInfo.marketing_phone; - $scope.partner.marketing_email = $scope.partner.representativeInfo.marketing_email; - $scope.partner.marketing_job = $scope.partner.representativeInfo.marketing_job_title; - - $scope.partner.legal_representative_wechatid = $scope.partner.representativeInfo.legal_representative_wechatid; - $scope.partner.marketing_wechatid = $scope.partner.representativeInfo.marketing_wechatid; - } - - function hasRole() { - var rolenum; - switch (sessionStorage.getItem('role')) { - case "administrator": - rolenum = 1; - break; - case "bduser": - rolenum = 4; - break; - case "salesmanager": - rolenum = 8192; - break; - case "accountant": - rolenum = 8; - break; - case "sitemanager": - rolenum = 128; - break; - case "director": - rolenum = 64; - break; - case "developer": - rolenum = 256; - break; - case "compliance": - rolenum = 2; - break; - case "guest": - rolenum = 2048; - break; - case "orgmanager": - rolenum = 4096; - break; - case "riskmanager": - rolenum = 1024; - break; - default: - break; - } - if ((window.currentUser.role & rolenum) >0) { - return true; - }else { - sessionStorage.removeItem('role'); - return false; - } - } - - if (hasRole()) { - $scope.role = sessionStorage.getItem('role'); - } - - var origin_referrer_id = angular.copy($scope.partner.referrer_id); - var resetClientPayDescByTpey = function (type) { - type = parseInt(type); - if (type == 1) { - removeClientPayDesc($scope.partner.client_pay_desc, '10'); - } - if (type == 2) { - removeClientPayDesc($scope.partner.client_pay_desc, '20'); - } - }; - var compare = function (x, y) { - x = parseInt(x); - y = parseInt(y); - if (x < y) { - return -1; - } else if (x > y) { - return 1; - } else { - return 0; - } - } - $scope.toggleClientPayType = function (type) { - if (!$scope.partner.client_pay_type) { - $scope.partner.client_pay_type = []; - } - var $idx = $scope.partner.client_pay_type.indexOf(type); - if ($idx >= 0) { - $scope.partner.client_pay_type.splice($idx, 1); - resetClientPayDescByTpey(type); - } else { - $scope.partner.client_pay_type.push(type); - $scope.partner.client_pay_type.sort(compare); - } - }; - $scope.toggleClientPayDesc = function (type) { - if (!$scope.partner.client_pay_desc) { - $scope.partner.client_pay_desc = []; - } - var $idx = $scope.partner.client_pay_desc.indexOf(type); - if ($idx >= 0) { - if (type == '203') { - removeClientPayDesc($scope.partner.client_pay_desc, '2030') - } - $scope.partner.client_pay_desc.splice($idx, 1); - } else { - $scope.partner.client_pay_desc.push(type); - $scope.partner.client_pay_desc.sort(compare); - } - }; - - $scope.partner.sameAsContactPerson = false; - $scope.checkboxOnclick = function (){ - $scope.partner.sameAsContactPerson = !($scope.partner.sameAsContactPerson); - if($scope.partner.sameAsContactPerson) { - $scope.partner.legal_representative_person = $scope.partner.contact_person; - $scope.partner.legal_representative_phone = $scope.partner.contact_phone; - $scope.partner.legal_representative_email = $scope.partner.contact_email; - $scope.partner.legal_representative_job = $scope.partner.contact_job; - $scope.partner.legal_representative_wechatid = $scope.partner.contact_wechatid; - } - } - - $scope.partner.marketingSameAsContact = false; - $scope.checkMarketingSameAsContact = function (){ - $scope.partner.marketingSameAsContact = !($scope.partner.marketingSameAsContact); - if($scope.partner.marketingSameAsContact) { - $scope.partner.marketing_person = $scope.partner.contact_person; - $scope.partner.marketing_phone = $scope.partner.contact_phone; - $scope.partner.marketing_email = $scope.partner.contact_email; - $scope.partner.marketing_job = $scope.partner.contact_job; - $scope.partner.marketing_wechatid = $scope.partner.contact_wechatid; - } - } - - $scope.partner.sameAsAddress=false; - $scope.sameAddress = function (){ - $scope.partner.sameAsAddress=!($scope.partner.sameAsAddress); - if($scope.partner.sameAsAddress) { - $scope.partner.registered_address = $scope.partner.address; - $scope.partner.registered_suburb = $scope.partner.suburb; - $scope.partner.registered_postcode = $scope.partner.postcode; - $scope.partner.registered_state = $scope.partner.state; - } - } - - $scope.listReferrers = function () { - $http.get('/sys/orgs/referrer').then(function (resp) { - $scope.referrers = resp.data; - }) - }; - $scope.listReferrers(); - - $scope.loadAlipayCategory = function () { - $http.get('/static/data/alipayMcc.json').then(function (resp) { - $scope.alipayMccCategory = resp.data; - }) - }; - $scope.loadAlipayCategory(); - $scope.loadJDindustry = function () { - $http.get('/static/data/jdindustry.json').then(function (resp) { - $scope.jdindustry = resp.data; - }) - }; - $scope.loadJDindustry(); - - $scope.loadLakalaPayindustry = function () { - $http.get('/static/data/lakalapayindustry.json').then(function (resp) { - $scope.lakalapayindustry = resp.data; - }) - }; - $scope.loadLakalaPayindustry(); - - $scope.loadLakalaPaySettle = function () { - $http.get('/static/data/lakalapaysettle.json').then(function (resp) { - $scope.lakalapaysettle = resp.data; - }) - }; - $scope.loadLakalaPaySettle(); - - $scope.loadLakalaPayGoods = function () { - $http.get('/static/data/lakalapaygoods.json').then(function (resp) { - $scope.lakalapaygoods = resp.data; - }) - }; - $scope.loadLakalaPayGoods(); - - $scope.loadRoyalpayindustry = function () { - $http.get('/static/data/royalpayindustry.json').then(function (resp) { - $scope.royalpayindustry = resp.data; - }) - }; - $scope.loadRoyalpayindustry(); - - $scope.loadHfindustry = function () { - $http.get('/static/data/hfindustry.json').then(function (resp) { - $scope.hfindustry = resp.data; - }) - }; - $scope.loadHfindustry(); - - $scope.onAlipayMccSelect = function (selectedItem) { - $scope.partner.alipay_category = selectedItem.label; - $scope.partner.alipayindustry = selectedItem.mccCode; - }; - $scope.onRoyalPayIndustrySelect = function (selectedItem) { - $scope.partner.royalpay_label = selectedItem.label; - $scope.partner.royalpayindustry = selectedItem.mccCode; - }; - $scope.onHfIndustrySelect = function (selectedItem) { - $scope.partner.hf_label = selectedItem.label; - $scope.partner.hfindustry = selectedItem.mccCode; - }; - - - $scope.updatePartner = function (form) { - if (form.$invalid) { - angular.forEach(form, function (item, key) { - if (key.indexOf('$') < 0) { - item.$dirty = true; - } - }); - return; - } - - if ($scope.partner.company_name.indexOf("Migration") != -1) { - alert("Company Name包含敏感词汇,请检查后重新提交!"); - return; - } - if ($scope.partner.company_phone.indexOf(' ') != -1) { - alert('Company Phone can not contain space character'); - return; - } - if ($scope.partner.contact_email.indexOf(' ') != -1) { - alert('Contact email Phone can not contain space character'); - return; - } - if ($scope.partner.suburb.indexOf(' ') != -1) { - alert('suburb can not contain two and more continuous space characters'); - return; - } - if ($scope.partner.client_pay_type.indexOf('2') >= 0) { - if (!$scope.partner.company_photo) { - alert('Shop Photo1 is necessary'); - return; - } - if (!$scope.partner.store_photo) { - alert('Shop Photo2 is necessary'); - return; - } - } - - if ($scope.partner.acn && $scope.partner.business_structure == 'Company') { - if ($scope.partner.acn.length != 9) { - alert('Acn is not valid'); - } - } - if ($scope.partner.referrer_id) { - $scope.referrers.forEach(function (e) { - if ($scope.partner.referrer_id == e.org_id) { - $scope.partner.referrer_name = e.name; - return; - } - }) - } - var content = ''; - 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.length == 0) { - alert('请选择商户支付场景') - return; - } - if ($scope.partner.client_pay_desc.length == 0) { - alert('请选择商户支付方式') - return; - } - if ($scope.partner.client_pay_type.indexOf('1') >= 0) { - if ($scope.partner.client_pay_desc.join(',').indexOf('10') < 0) { - alert("请检查线上支付场景是否已选择支付方式"); - return; - } - } - if ($scope.partner.client_pay_type.indexOf('2') >= 0) { - if ($scope.partner.client_pay_desc.join(',').indexOf('20') < 0) { - alert("请检查线下支付场景是否已选择支付方式"); - return; - } - } - if ($scope.partner.client_pay_desc.join(',').indexOf('203') >= 0) { - if ($scope.partner.client_pay_desc.join(',').indexOf('2030') < 0 && $scope.partner.client_pay_desc.join(',').indexOf('20399') < 0) { - alert("请检查线下支付是否已选择收银系统类型"); - return; - } - } - $scope.partner.client_pay_type = $scope.partner.client_pay_type.join(','); - $scope.partner.client_pay_desc = $scope.partner.client_pay_desc.join(','); - $http.put('/sys/partners/' + $scope.partner.client_moniker, $scope.partner).then(function () { - if (content != '') { - commonDialog.alert({ - title: 'Warning', - content: content, - type: 'error' - }); - } else { - commonDialog.alert({ - title: 'Success', - content: 'Update partner information successfully', - type: 'success' - }); - } - $scope.updateMerchantLocation(); - $scope.loadPartners(); - $state.go('^.detail', {clientMoniker: $scope.partner.client_moniker}, {reload: true}); + }) + }; + $scope.apply2makeAgreeFile = function () { + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/make_agree_file').then(function () { + commonDialog.alert({ + title: 'Success!', + content: '已提交制作合同!', + type: 'success' + }); + $state.reload(); }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) - }); - }; - $scope.uploadLogo = function (file) { - if (file != null) { - if (file.size > 1 * 1024 * 1024) { - commonDialog.alert({title: 'Error', content: '文件大小不能超过1MB,请压缩后重试', type: 'error'}) - } else { - $scope.logoProgress = {value: 0}; - Upload.upload({ - url: '/attachment/files', - data: {file: file} - }).then(function (resp) { - delete $scope.logoProgress; - $scope.partner.logo_id = resp.data.fileid; - $scope.partner.logo_url = resp.data.url; - }, function (resp) { - delete $scope.logoProgress; - commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) - }, function (evt) { - $scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total); - }) - } + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); } - }; + ); + }; - $scope.uploadShopPhoto = function (file) { - if (file != null) { - if (file.size > 2 * 1024 * 1024) { - commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'}) - } else { - $scope.shopPhotoProgress = {value: 0}; - Upload.upload({ - url: '/attachment/files', - data: {file: file} - }).then(function (resp) { - delete $scope.shopPhotoProgress; - $scope.partner.company_photo = resp.data.url; - }, function (resp) { - delete $scope.shopPhotoProgress; - commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) - }, function (evt) { - $scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total); - }) + $scope.commit2GreenChannel = function () { + commonDialog.confirm({ + title: 'Audit Partner', + content: 'Are you sure to mark partner ' + $scope.partner.company_name + ' Green Channel?' + }).then(function () { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/compliance/green_channel').then(function () { + commonDialog.alert({ + title: 'Success', + content: 'Commit to Green Channel successfully', + type: 'success' + }); + $state.reload(); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + }) + + }) + }; + + $scope.markAuditEmail = function () { + commonDialog.confirm({ + title: 'Warning', + content: 'Make sure you have send the email to client.' + }).then(function () { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/audit/email_sending_status').then(function () { + $state.reload(); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + }) + }) + }; + $scope.resendApproveEmail = function () { + commonDialog.confirm({ + title: 'Warning', + content: 'This operation will reset the password of admin user. Are you sure this email is correct ? Or you may update this information first.' + }).then(function () { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/audit/send_email').then(function () { + $state.reload(); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + }) + }) + }; + $scope.editBDUser = function () { + $uibModal.open({ + templateUrl: '/static/payment/partner/templates/bd_user_choose_dialog.html', + controller: 'partnerChooseBDUserDialogCtrl', + resolve: { + bdUsers: ['$http', function ($http) { + return $http.get('/sys/manager_accounts/roles/bd_user'); + }], + partner: function () { + return $scope.partner; + }, + type: function () { + return 'edit'; } } - }; - - $scope.uploadStorePhoto = function (file) { - if (file != null) { - if (file.size > 2 * 1024 * 1024) { - commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'}) - } else { - $scope.storePhotoProgress = {value: 0}; - Upload.upload({ - url: '/attachment/files', - data: {file: file} - }).then(function (resp) { - delete $scope.storePhotoProgress; - $scope.partner.store_photo = resp.data.url; - }, function (resp) { - delete $scope.storePhotoProgress; - commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) - }, function (evt) { - $scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total); - }) + }).result.then(function () { + $state.reload(); + }) + }; + $scope.bindBDUser = function () { + $uibModal.open({ + templateUrl: '/static/payment/partner/templates/bd_user_choose_dialog.html', + controller: 'partnerChooseBDUserDialogCtrl', + resolve: { + bdUsers: ['$http', function ($http) { + return $http.get('/sys/manager_accounts/roles/bd_user'); + }], + partner: function () { + return $scope.partner; + }, + type: function () { + return 'add'; } } - }; - - $scope.getMerchantLocation = function () { - $http.get('/sys/partners/' + $scope.partner.client_moniker + '/location').then(function (resp) { - $scope.merchant_location = resp.data; - }); - }; - $scope.getMerchantLocation(); + }).result.then(function () { + $state.reload(); + }) + }; - $scope.updateMerchantLocation = function () { - var params = window.frames['merchant_detail'].merchant_location; - if (params) { - $http.put('/sys/partners/modify/' + $scope.partner.client_moniker + '/location', params).then(function () { + $scope.configMasterMerchant = function () { + commonDialog.inputText({title: 'Input Master Merchant Code'}).then(function (text) { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/master_configuration', {master_merchant: text}).then(function () { + commonDialog.alert({title: 'Success', content: "Master Merchant Code:" + text, type: 'success'}); + }, function (resp) { + commonDialog.alert({ + title: 'Config Master Merchant Failed', + content: resp.data.message, + type: 'error' }); + }) + }) + }; + + $scope.getMerchantLocation = function () { + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/location').then(function (resp) { + $scope.merchant_location = resp.data; + }); + }; + $scope.getMerchantLocation(); + + + $scope.complianceCheck = function () { + if (!$rootScope.complianceCheck) { + $rootScope.complianceCheck = {}; + } + $rootScope.complianceCheck.client_id = $scope.partner.client_id; + $rootScope.complianceCheck.clientInfo = true; + }; + $scope.complianceChangeCheck = function () { + if ($rootScope.complianceCheck) { + if ($scope.partner.client_id != $rootScope.complianceCheck.client_id) { + delete $rootScope.complianceCheck; } } - }]); + }; + $scope.complianceChangeCheck(); + + $scope.changeWechatCompliance = function () { + if (!$scope.partner) { + return; + } + if (!$state.is('partners.detail')) { + $scope.init.wechat_compliance = false; + return; + } + if (!$scope.init.wechat_compliance) { + $scope.init.wechat_compliance = true; + return; + } + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/wechat_compliance_permission', {allow: $scope.partner.wechat_compliance}).then(function () { + + }, function (resp) { + commonDialog.alert({ + title: 'failed to change wechat_compliance permission status', + content: resp.data.message, + type: 'error' + }) + }) + }; + $scope.changeLocalMerchant = function () { + if (!$scope.partner) { + return; + } + if (!$state.is('partners.detail')) { + $scope.init.local_merchant = false; + return; + } + if (!$scope.init.local_merchant) { + $scope.init.local_merchant = true; + return; + } + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/local_merchant_permission', {allow: $scope.partner.local_merchant}).then(function () { + + }, function (resp) { + commonDialog.alert({ + title: 'failed to change local_merchant permission status', + content: resp.data.message, + type: 'error' + }) + }) + }; + + $scope.removeSub = function () { + $http.delete('/sys/partners/unsub/' + $scope.partner.client_moniker).then(function (resp) { + $state.reload(); + }); + }; + $scope.addSub = function () { + $http.put('/sys/partners/unsub/' + $scope.partner.client_moniker).then(function (resp) { + $state.reload(); + }); + }; + }]); app.controller('partnerPaymentInfoCtrl', ['$scope', '$http', '$state', 'commonDialog', '$uibModal', '$sce', function ($scope, $http, $state, commonDialog, $uibModal, $sce) { $scope.convertExtParams = []; $scope.copyHfLink = function () { @@ -4114,7 +3261,14 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }; $scope.listRedpackLogs(1); }]); - app.controller('partnerAuthFileCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file', function ($scope, $http, $rootScope, commonDialog, $state, Upload, file) { + app.controller('partnerAuthFileCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', function ($scope, $http, $rootScope, commonDialog, $state) { + if ($scope.partner.client_type=='card-payment'){ + $state.go('partners.detail.files.MW_files'); + }else { + $state.go('partners.detail.files.CP_files'); + } + }]); + app.controller('partnerCPAuthFileCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file', function ($scope, $http, $rootScope, commonDialog, $state, Upload, file) { $scope.id_info_form = {edit: false}; $scope.file = file.data || {}; //audit files @@ -4366,7 +3520,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); }) }) -}; + }; $scope.updateFile = function () { @@ -4406,7 +3560,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.complianceChangeCheck(); }]); - app.controller('partnerMWAuthFileCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file', function ($scope, $http, $rootScope, commonDialog, $state, Upload, file) { $scope.id_info_form = {edit: false}; $scope.file = file.data || {}; 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 6ebd8ff88..098a270da 100644 --- a/src/main/ui/static/payment/partner/templates/add_partner.html +++ b/src/main/ui/static/payment/partner/templates/add_partner.html @@ -16,6 +16,13 @@ background-color: #f7bf90; border-color: #adadad; } + .form-control-float { + float: left; + width: 93%; !important; + } + .form-control-span{ + height: 34px; + }

New Partner

@@ -26,11 +33,25 @@
  • New Partner
  • -
    +
    Partner Basic Information
    @@ -112,21 +133,40 @@
    -
    -
    + +
    + +
    +

    Required + Field

    +

    Less + Than 19 + Characters(including symbols and spaces)

    +
    +
    +
    +
    @@ -148,7 +188,7 @@
    -
    @@ -176,31 +216,19 @@
    - - - - - - - - - - - - - -
    - + ng-if="partner.business_structure != 'Company' || partner.client_type=='card-payment' || partner.client_type=='all'"> +
    +

    Required + Field

    Less Than 20 Characters(including symbols and spaces)

    @@ -209,7 +237,7 @@
    + ng-if="partner.business_structure == 'Company' && partner.client_type!='card-payment'">
    - - - - - - - - - - - - - - - - -
    -
    +
    @@ -296,7 +298,6 @@ Than 11 Characters

    -
    @@ -353,7 +354,7 @@ ng-click="toggleClientPayType('1')"> 线上 -
    -
    +
    @@ -420,7 +421,7 @@
    -
    +
    @@ -491,7 +492,7 @@
    -
    +
    1:  @@ -503,9 +504,9 @@ - +
    @@ -518,16 +519,48 @@ - +
    +
    + +
    + + $ +
    +

    Required + Field

    +
    +
    +
    +
    + +
    + + $ +
    +

    Required + Field

    +
    +
    +
    -
    +
    Alipay Information  (Optional)
    @@ -669,16 +702,6 @@ Characters(including symbols and spaces)

    - -
    - -
    - -
    -
    -
    @@ -707,16 +729,26 @@ maxlength="50">
    + +
    + +
    + +
    +
    -
    - -
    + +
    +
    -
    -
    + +
      Legal Representative
    @@ -791,7 +823,7 @@
    + E-mail
    -
    -
      Marketing Person
    -
    +
    +
      Marketing Person
    +
    @@ -1195,105 +1227,6 @@
    - - -
    Industry @@ -1318,7 +1251,7 @@
    -
    @@ -1337,7 +1270,7 @@
    -
    @@ -1356,6 +1289,44 @@
    + +
    + +
    + +
    +

    Required + Field

    +
    +
    +
    +
    + +
    + + + + + + +
    +
    diff --git a/src/main/ui/static/payment/partner/templates/partner_auth_files.html b/src/main/ui/static/payment/partner/templates/partner_auth_files.html index 12bf85c97..c77dffeed 100644 --- a/src/main/ui/static/payment/partner/templates/partner_auth_files.html +++ b/src/main/ui/static/payment/partner/templates/partner_auth_files.html @@ -3,366 +3,18 @@ width: 100%; } -
    -
    Audit Files     - - 一键下载 - +
    + -
    -
    -
    -

    - ID描述信息 - - -

    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    - - - - - -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - {{file.id_type}} -
    -
    -
    -
    - -
    - - - - - -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - - -
    - - - - - - - - - -
    1 - - - - -
    - - -
    -
    -
    -

    Example:请保证图片信息清晰可见,如下图

    - -
    -
    -
    - -
    - -
    -
    - - -
    - - - - - - - -
    1 - - - - -
    -
    -
    -
    -
    -

    Example:公司请提供以下文件图片

    - - -
    -
    -

    sole trade(个体户),partnership(合伙),trust(信托)请在http://abr.business.gov.au,将查询结果截图上传

    - -
    -
    -
    -
    - -
    - -
    -
    - - -
    - - - - - - - - -
    1 - - - - -
    -
    -
    -
    -
    -

    Example:请保证图片(护照或驾照)信息清晰可见,如下图

    - -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - - -
    - - - - - - - - -
    1 - - - - -
    -
    -
    -
    -

    Example:请保证图片信息清晰可见,如下图

    - -
    -
    -
    -
    - -
    -
    - -
    -
    - - -
    - - - - - - - - -
    1 - - - - -
    -
    -
    -
    -

    Example:请保证图片信息清晰可见,如下图

    - -
    -
    -
    -
    - -
    - -
    -
    - -

    - One utility bill (water, electricity or gas) that shows the residential address (*Mandatory if your uploaded ID is a passport)
    - 一份显示常住居所地址的账单(水费、电费或煤气费)(*必须上传 - 如您上传的ID是护照)
    -

    - -
    - - - - - - - - -
    1 - - - -
    -
    -
    -
    -
    -

    Example:请提供水电煤账单文件图片,如示例 - 水费.png -
    电费.jpg -

    -

    - 煤气.png -

    -
    -
    -
    -
    -
    -
    -
    - check -
    -
    - - - - +
    diff --git a/src/main/ui/static/payment/partner/templates/partner_cp_auth_files.html b/src/main/ui/static/payment/partner/templates/partner_cp_auth_files.html new file mode 100644 index 000000000..2d9035b04 --- /dev/null +++ b/src/main/ui/static/payment/partner/templates/partner_cp_auth_files.html @@ -0,0 +1,363 @@ + + +
    Audit Files     + + 一键下载 + +
    +
    +
    +
    +

    + ID描述信息 + + +

    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    + + + + + +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + {{file.id_type}} +
    +
    +
    +
    + +
    + + + + + +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + + +
    + + + + + + + + + +
    1 + + + + +
    + + +
    +
    +
    +

    Example:请保证图片信息清晰可见,如下图

    + +
    +
    +
    + +
    + +
    +
    + + +
    + + + + + + + +
    1 + + + + +
    +
    +
    +
    +
    +

    Example:公司请提供以下文件图片

    + + +
    +
    +

    sole trade(个体户),partnership(合伙),trust(信托)请在http://abr.business.gov.au,将查询结果截图上传

    + +
    +
    +
    +
    + +
    + +
    +
    + + +
    + + + + + + + + +
    1 + + + + +
    +
    +
    +
    +
    +

    Example:请保证图片(护照或驾照)信息清晰可见,如下图

    + +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + + +
    + + + + + + + + +
    1 + + + + +
    +
    +
    +
    +

    Example:请保证图片信息清晰可见,如下图

    + +
    +
    +
    +
    + +
    +
    + +
    +
    + + +
    + + + + + + + + +
    1 + + + + +
    +
    +
    +
    +

    Example:请保证图片信息清晰可见,如下图

    + +
    +
    +
    +
    + +
    + +
    +
    + +

    + One utility bill (water, electricity or gas) that shows the residential address (*Mandatory if your uploaded ID is a passport)
    + 一份显示常住居所地址的账单(水费、电费或煤气费)(*必须上传 - 如您上传的ID是护照)
    +

    + +
    + + + + + + + + +
    1 + + + +
    +
    +
    +
    +
    +

    Example:请提供水电煤账单文件图片,如示例 + 水费.png +
    电费.jpg +

    +

    + 煤气.png +

    +
    +
    +
    +
    +
    +
    +
    + check +
    diff --git a/src/main/ui/static/payment/partner/templates/partner_detail.html b/src/main/ui/static/payment/partner/templates/partner_detail.html index bb9a6182d..5514efada 100644 --- a/src/main/ui/static/payment/partner/templates/partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/partner_detail.html @@ -277,9 +277,6 @@
  • Compliance Files
  • -
  • - Merchant Warrior Compliance Files -
  • diff --git a/src/main/ui/static/payment/partner/templates/partner_edit.html b/src/main/ui/static/payment/partner/templates/partner_edit.html index d9a07d714..0cecd2c54 100644 --- a/src/main/ui/static/payment/partner/templates/partner_edit.html +++ b/src/main/ui/static/payment/partner/templates/partner_edit.html @@ -10,6 +10,13 @@ background-color: #f7bf90; border-color: #adadad; } + .form-control-float { + float: left; + width: 93%; !important; + } + .form-control-span{ + height: 34px; + }

    @@ -26,6 +33,21 @@
    +
    Partner Basic Information
    @@ -82,7 +104,7 @@
    - +
    @@ -93,7 +115,7 @@
    -
    @@ -111,9 +133,7 @@
    -
    -
    @@ -162,7 +182,7 @@
    -
    @@ -181,8 +201,24 @@
    - -
    + +
    + +
    +

    Required + Field

    +

    Less + Than 19 + Characters(including symbols and spaces)

    +
    +
    +
    +
    @@ -206,20 +242,6 @@
    - - - - - - - - - - - - - -
    @@ -319,7 +341,7 @@ ng-click="toggleClientPayType('1')"> 线上 -
    -
    +
    @@ -386,7 +408,7 @@
    -
    +
    @@ -457,7 +479,7 @@
    -
    +
    1:  @@ -488,11 +510,43 @@
    +
    + +
    + + $ +
    +

    Required + Field

    +
    +
    +
    +
    + +
    + + $ +
    +

    Required + Field

    +
    +
    +
    -
    +
    Alipay Information   (Optional)
    @@ -578,16 +632,6 @@ Characters(including symbols and spaces)

    - -
    - -
    - -
    -
    + +
    + +
    + +
    +
    -
    +
    @@ -729,8 +783,8 @@
    -
      Marketing Person
    -
    +
      Marketing Person
    +
    @@ -1080,81 +1134,6 @@
    - -
    Industry
    @@ -1178,7 +1157,7 @@
    -
    @@ -1197,7 +1176,7 @@
    -
    @@ -1216,6 +1195,42 @@
    +
    + +
    + +
    +

    Required + Field

    +
    +
    +
    +
    + +
    + + + + + + +
    diff --git a/src/main/ui/static/payment/partner/templates/partner_mw_auth_files.html b/src/main/ui/static/payment/partner/templates/partner_mw_auth_files.html index 079916613..371b91dbb 100644 --- a/src/main/ui/static/payment/partner/templates/partner_mw_auth_files.html +++ b/src/main/ui/static/payment/partner/templates/partner_mw_auth_files.html @@ -3,82 +3,81 @@ width: 100%; } -
    -
    Audit Files     - - 一键下载 - -
    -
    -
    -
    -

    - Merchant Warrior商户风险评级 - - -

    -
    -
    -
    - -
    -
    - -
    +
    Audit Files     + + 一键下载 + +
    +
    +
    +
    +

    + Merchant Warrior商户风险评级 + + +

    +
    +
    +
    + +
    +
    +
    -
    - -
    -
    - -
    +
    +
    + +
    +
    +
    -
    - -
    -
    - 低风险 - 中风险 - 高风险 -
    +
    +
    + +
    +
    + 低风险 + 中风险 + 高风险
    -
    - -
    -
    - -
    +
    +
    + +
    +
    +
    -
    -
    - -
    -
    - - - -
    - - + + +
    + +
    +
    + + + +
    + +
    -
    @@ -87,108 +86,107 @@
    + +
    +
    + +
    + +
    +
    + + +
    + + + + + + +
    + + +
    +
    +
    + +
    +
    + + + +
    + + + + + +
    + + +
    +
    +
    + +
    - +
    - +
    - + -
    - + +
    +
    +
    - +
    - - -
    - - - - - -
    - - -
    -
    -
    - -
    -
    - -
    -
    - - - -
    - - - - - - -
    - - -
    -
    -
    -
    - -
    -
    - -
    -
    - - - -
    - - - - - - -
    - - -
    + +
    + + + + + + +
    + + +
    -
    +