From 49548f0137666348a3f4c6e1c03c128fe47e7148 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 18 Sep 2018 11:14:30 +0800 Subject: [PATCH 1/7] add 5% --- .../system/SysRpayMerchantApplyMapper.java | 4 +- .../core/impls/ClientManagerImpl.java | 4 +- .../static/payment/partner/partner-manage.js | 87 ++++++++-- .../templates/apply_rpay_sub_merchant_id.html | 164 ++++++++++++++++++ 4 files changed, 241 insertions(+), 18 deletions(-) create mode 100644 src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysRpayMerchantApplyMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysRpayMerchantApplyMapper.java index 9aa1cdbff..898ac3661 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysRpayMerchantApplyMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysRpayMerchantApplyMapper.java @@ -10,7 +10,7 @@ import org.apache.ibatis.annotations.Param; import java.util.List; /** - * Created by yangluo on 2017-03-14. + * Created by yangluo on 2018-09-18. */ @AutoMapper(tablename = "sys_rpay_merchant_apply",pkName = "merchant_app_id") public interface SysRpayMerchantApplyMapper { @@ -21,6 +21,6 @@ public interface SysRpayMerchantApplyMapper { void insertRpayMerchantApply(JSONObject params); @AutoSql(type = SqlType.SELECT) - List selectByShortName(@Param("client_id") int client_id,@Param("merchant_shortname") String shortName); + List listByShortName(@Param("client_id") int client_id,@Param("merchant_shortname") String shortName); } 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 4defc9826..870653d59 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 @@ -3582,9 +3582,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } checkOrgPermission(manager, client); - List selectByshortName = sysRpayMerchantApplyMapper.selectByShortName(client.getIntValue("client_id"),client.getString("short_name")); + List listByshortName = sysRpayMerchantApplyMapper.listByShortName(client.getIntValue("client_id"),client.getString("short_name")); - if (selectByshortName.size()>0) { + if (listByshortName.size()>0) { throw new BadRequestException("请修改【" + clientMoniker + "】的Company shortName信息(请避免和Rpay+商务号列表内的Company Short Name重复)"); } diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index b855dae98..8de911884 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -3129,20 +3129,29 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }) }; $scope.applyRpaySubMerchantId = function () { - $http.post('/sys/partners/' + $scope.partner.client_moniker + '/registRpaySubMerchantId').then(function (resp) { - commonDialog.alert({ - title: 'Success', - content: 'Modify Rpay+ Sub Merchant ID successfully', - type: 'success' - }); - $state.reload(); - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) - }); - - - - + $uibModal.open({ + templateUrl: '/static/payment/partner/templates/apply_rpay_sub_merchant_id', + controller: 'applyRpaySubMerchantIdCtrl', + resolve: { + subMerchantInfo: function () { + return $scope.partner; + }, + merchantIds: ['$http', '$stateParams', function ($http) { + $http.post('/sys/partners/' + $scope.partner.client_moniker + '/registRpaySubMerchantId').then(function (resp) { + commonDialog.alert({ + title: 'Success', + content: 'Modify Rpay+ Sub Merchant ID successfully', + type: 'success' + }); + $state.reload(); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) + }); + }] + } + }).result.then(function () { + $scope.loadSubMerchantInfos(); + }) }; $scope.loadSubMerchantInfos(); }]); @@ -3194,6 +3203,56 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }) } }]); + + app.controller('applyRpaySubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', '$filter', 'merchantIds', 'commonDialog', function ($scope, $http, $uibModal, $state, subMerchantInfo, $filter, merchantIds, commonDialog) { + $scope.wxIndustries = angular.copy(wxMerchantIndustries); + $scope.subMerchantInfo = angular.copy(subMerchantInfo); + $scope.merchantIds = merchantIds.data; + $scope.subMerchantInfo.industry = $filter('wxindustries')($scope.subMerchantInfo.industry); + $scope.saveAppliy = function (form) { + $scope.errmsg = null; + if (form.$invalid) { + angular.forEach(form, function (item, key) { + if (key.indexOf('$') < 0) { + item.$dirty = true; + } + }); + return; + } + $http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/registRpaySubMerchantId', $scope.subMerchantInfo).then(function (resp) { + $scope.apply_sub_merchant_id = resp.data; + $scope.$close(); + if (subMerchantInfo.sub_merchant_id != null) { + commonDialog.confirm({title: 'Confirm', content: '已申请成功,是否确认使用'}).then(function () { + $http.put('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/payment_config', {sub_merchant_id: $scope.apply_sub_merchant_id}).then(function (resp) { + commonDialog.alert({ + title: 'Success', + content: 'Modify Wechat Sub Merchant ID successfully', + type: 'success' + }); + $state.reload(); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) + }); + }) + } else { + $http.put('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/payment_config', {sub_merchant_id: $scope.apply_sub_merchant_id}).then(function (resp) { + commonDialog.alert({ + title: 'Success', + content: 'Apply Success And Modify Wechat Sub Merchant ID successfully', + type: 'success' + }); + $state.reload(); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) + }); + } + }, function (resp) { + $scope.errmsg = resp.data.message; + }) + } + }]); + app.controller('permissionClientCtrl', ['$scope', '$http', '$uibModal', '$state', '$filter', 'commonDialog', function ($scope, $http, $uibModal, $state, $filter, commonDialog) { $scope.clientPermission = {client_moniker:$scope.partner.client_moniker}; $scope.loadPermissionList = function () { diff --git a/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html b/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html new file mode 100644 index 000000000..34b94f7d4 --- /dev/null +++ b/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html @@ -0,0 +1,164 @@ +
+
+
+
+
+
Apply Sub Merchant Id
+
+
+
+ +
+ +
+

Required Field

+

Length is more than 50

+
+
+
+ +
+ +
+ +
+

Required Field

+
+
+
+

More than 50

+
+
+ +
+ +
+ +
+

Required Field

+

Length is more than 50

+
+
+
+ +
+ +
+ +
+

Required Field

+
+
+
+

More than 50

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

Required Field

+

Length is more than 20

+
+
+
+ +
+ +
+ +
+

Required Field

+

Length is more than 256

+

Length is less than 10

+
+
+
+ +
+ +
+ +
+

Required Field

+
+
+ +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + + + + + + + +
+ +
+
+
+
+
\ No newline at end of file From 8c5e51982d700b2f10dbbbc6ea80f9a12b7fa417 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 18 Sep 2018 14:33:00 +0800 Subject: [PATCH 2/7] add 10% --- .../static/payment/partner/partner-manage.js | 52 ++---- .../templates/apply_rpay_sub_merchant_id.html | 169 ++++++++++++++---- 2 files changed, 142 insertions(+), 79 deletions(-) diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 8de911884..63b2127d4 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -3130,24 +3130,12 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }; $scope.applyRpaySubMerchantId = function () { $uibModal.open({ - templateUrl: '/static/payment/partner/templates/apply_rpay_sub_merchant_id', + templateUrl: '/static/payment/partner/templates/apply_rpay_sub_merchant_id.html', controller: 'applyRpaySubMerchantIdCtrl', resolve: { subMerchantInfo: function () { return $scope.partner; - }, - merchantIds: ['$http', '$stateParams', function ($http) { - $http.post('/sys/partners/' + $scope.partner.client_moniker + '/registRpaySubMerchantId').then(function (resp) { - commonDialog.alert({ - title: 'Success', - content: 'Modify Rpay+ Sub Merchant ID successfully', - type: 'success' - }); - $state.reload(); - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) - }); - }] + } } }).result.then(function () { $scope.loadSubMerchantInfos(); @@ -3199,17 +3187,18 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }); } }, function (resp) { - $scope.errmsg = resp.data.message; + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) }) } }]); - app.controller('applyRpaySubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', '$filter', 'merchantIds', 'commonDialog', function ($scope, $http, $uibModal, $state, subMerchantInfo, $filter, merchantIds, commonDialog) { + app.controller('applyRpaySubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', 'businessStructuresMap','$filter', 'commonDialog','timezone', function ($scope, $http, $uibModal, $state, subMerchantInfo, businessStructuresMap,$filter, commonDialog,timezone) { $scope.wxIndustries = angular.copy(wxMerchantIndustries); $scope.subMerchantInfo = angular.copy(subMerchantInfo); - $scope.merchantIds = merchantIds.data; $scope.subMerchantInfo.industry = $filter('wxindustries')($scope.subMerchantInfo.industry); - $scope.saveAppliy = function (form) { + $scope.business_structures = businessStructuresMap.configs(); + + $scope.saveRpayAppliy = function (form) { $scope.errmsg = null; if (form.$invalid) { angular.forEach(form, function (item, key) { @@ -3223,29 +3212,12 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.apply_sub_merchant_id = resp.data; $scope.$close(); if (subMerchantInfo.sub_merchant_id != null) { - commonDialog.confirm({title: 'Confirm', content: '已申请成功,是否确认使用'}).then(function () { - $http.put('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/payment_config', {sub_merchant_id: $scope.apply_sub_merchant_id}).then(function (resp) { - commonDialog.alert({ - title: 'Success', - content: 'Modify Wechat Sub Merchant ID successfully', - type: 'success' - }); - $state.reload(); - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) - }); - }) - } else { - $http.put('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/payment_config', {sub_merchant_id: $scope.apply_sub_merchant_id}).then(function (resp) { - commonDialog.alert({ - title: 'Success', - content: 'Apply Success And Modify Wechat Sub Merchant ID successfully', - type: 'success' - }); - $state.reload(); - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) + commonDialog.alert({ + title: 'Success', + content: 'Modify Rpay+ Sub Merchant ID successfully', + type: 'success' }); + $state.reload(); } }, function (resp) { $scope.errmsg = resp.data.message; diff --git a/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html b/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html index 34b94f7d4..84d908278 100644 --- a/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html +++ b/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html @@ -8,7 +8,7 @@
- +
@@ -21,30 +21,24 @@
- +
- -
+ +

Required Field

+

Length is more than 50

-
-
-

More than 50

-
+
- + ng-class="{'has-error':subForm.company_shortname.$invalid && subForm.company_shortname.$dirty}"> +
-
+ type="text" name="company_shortname" id="company_shortname_input" required maxlength="50"> +

Required Field

Length is more than 50

@@ -78,70 +72,167 @@
+
- + ng-class="{'has-error':subForm.description.$invalid && subForm.description.$dirty}"> +
- -
+ +

Required Field

-

Length is more than 20

+

Length is more than 256

+

Length is less than 10

-
- +
+
- -
+ +

Required Field

-

Length is more than 256

-

Length is less than 10

+

Length is more than 10

+
+
+
+ +
+ +
+ +
+

Required Field

+

Length is more than 10

- + ng-class="{'has-error':subForm.business_structure.$invalid && subForm.business_structure.$dirty}"> + +
+ +
+
+ + +
+
-
+ type="tel" name="company_phone" id="company_phone_input" required> +

Required Field

-
+
+
+

Required Field

+
-
+
+
+

Required Field

+
-
+
+
+

Required Field

+
+
+
+ +
+ +
+ +
+

Required Field

+
+
+
+ +
+ +
+ +
+

Required Field

+

Length is more than 50

+
+
+ +
+ +
+

Required Field

+

Length is more than 10

+
+
+
+ +
+ +
+ +
+

Required Field

+

Length is more than 10

+
+
+
+ +
+ +
+ +
+

Required Field

+

Length is more than 10

+
+
+
+ + + + +
@@ -155,7 +246,7 @@
From 48247667efbe4a081acf0bdf625fddcfb5a20107 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 18 Sep 2018 18:15:52 +0800 Subject: [PATCH 3/7] add 40% --- .../manage/mappers/system/ClientMapper.java | 3 ++ .../manage/merchants/core/ClientManager.java | 2 +- .../core/impls/ClientManagerImpl.java | 5 +- .../static/payment/partner/partner-manage.js | 46 ++++++++++++------- .../templates/apply_rpay_sub_merchant_id.html | 37 ++++++--------- 5 files changed, 49 insertions(+), 44 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java index da095448a..f42b842c5 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java @@ -99,4 +99,7 @@ public interface ClientMapper { List findByhfPayUrlNotNull(); + @AutoSql(type = SqlType.UPDATE) + void updateRpayEnterpriseId(@Param("client_id") int clientId, @Param("rpay_enterprise_id") String rpayEnterpriseId); + } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java index 0604c11e3..925136d37 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java @@ -336,6 +336,6 @@ public interface ClientManager { void updateAllPartnerPassword(String clientMoniker, List emails); - String subRpayMerchantApplication(String clientMoniker, JSONObject manager); + void subRpayMerchantApplication(String clientMoniker, JSONObject manager); } 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 870653d59..f7374de7b 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 @@ -3575,7 +3575,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } @Override - public String subRpayMerchantApplication(String clientMoniker, JSONObject manager) { + public void subRpayMerchantApplication(String clientMoniker, JSONObject manager) { JSONObject client = getClientInfoByMoniker(clientMoniker); if (client == null) { throw new InvalidShortIdException(); @@ -3602,11 +3602,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid merchantApply.put("business_category", client.getString("royalpayindustry")); merchantApply.put("merchant_shortname", client.getString("short_name")); sysRpayMerchantApplyMapper.insertRpayMerchantApply(merchantApply); + clientMapper.updateRpayEnterpriseId(client.getIntValue("client_id"), rpayMerchantInfo.getString("merchantId")); }else { throw new BadRequestException("请求失败"); } - - return null; } @Override diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 63b2127d4..8a65a6128 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -3193,13 +3193,14 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }]); app.controller('applyRpaySubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', 'businessStructuresMap','$filter', 'commonDialog','timezone', function ($scope, $http, $uibModal, $state, subMerchantInfo, businessStructuresMap,$filter, commonDialog,timezone) { - $scope.wxIndustries = angular.copy(wxMerchantIndustries); $scope.subMerchantInfo = angular.copy(subMerchantInfo); - $scope.subMerchantInfo.industry = $filter('wxindustries')($scope.subMerchantInfo.industry); $scope.business_structures = businessStructuresMap.configs(); + $scope.timezone = timezone.configs(); + $scope.saveRpayAppliy = function (form) { - $scope.errmsg = null; + $scope.merchantInfo = angular.copy(form); + $scope.errmsg = null; if (form.$invalid) { angular.forEach(form, function (item, key) { if (key.indexOf('$') < 0) { @@ -3208,20 +3209,31 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }); return; } - $http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/registRpaySubMerchantId', $scope.subMerchantInfo).then(function (resp) { - $scope.apply_sub_merchant_id = resp.data; - $scope.$close(); - if (subMerchantInfo.sub_merchant_id != null) { - commonDialog.alert({ - title: 'Success', - content: 'Modify Rpay+ Sub Merchant ID successfully', - type: 'success' - }); - $state.reload(); - } - }, function (resp) { - $scope.errmsg = resp.data.message; - }) + + angular.forEach(form, function (item, key) { + if(item !=null) { + console.log("++++" + key + item.$name) + + } + }); + + // var str = angular.toJson(form, true); + // console.log("----------" + str); + + // $http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/registRpaySubMerchantId', $scope.merchantInfo).then(function (resp) { + // $scope.apply_sub_merchant_id = resp.data; + // $scope.$close(); + // if (subMerchantInfo.sub_merchant_id != null) { + // commonDialog.alert({ + // title: 'Success', + // content: 'Modify Rpay+ Sub Merchant ID successfully', + // type: 'success' + // }); + // $state.reload(); + // } + // }, function (resp) { + // $scope.errmsg = resp.data.message; + // }) } }]); diff --git a/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html b/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html index 84d908278..d13ba4af6 100644 --- a/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html +++ b/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html @@ -8,6 +8,7 @@
+
-
- -
- -
-

Required Field

-
-
-
-

More than 50

-
-
-
+ type="text" name="website" id="website_input">
-
-
@@ -113,7 +93,7 @@
- +
+ + +
+
+ From 086873f98ae4f9690cbefc4db94e66319eaae7b4 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 18 Sep 2018 19:15:40 +0800 Subject: [PATCH 4/7] add 55% --- .../web/PartnerManageController.java | 4 +- .../static/payment/partner/partner-manage.js | 42 ++++++++++--------- .../templates/apply_rpay_sub_merchant_id.html | 2 +- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java index c228f5995..2b7e1a2ec 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java @@ -564,8 +564,8 @@ public class PartnerManageController { } @ManagerMapping(value = "/{clientMoniker}/registRpaySubMerchantId", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public String subRpayMerchantApplication(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.subRpayMerchantApplication(clientMoniker, manager); + public void subRpayMerchantApplication(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + clientManager.subRpayMerchantApplication(clientMoniker, manager); } diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 8a65a6128..c7652834b 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -3199,7 +3199,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.saveRpayAppliy = function (form) { - $scope.merchantInfo = angular.copy(form); + var merchantInfo = {}; $scope.errmsg = null; if (form.$invalid) { angular.forEach(form, function (item, key) { @@ -3212,28 +3212,30 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter angular.forEach(form, function (item, key) { if(item !=null) { - console.log("++++" + key + item.$name) - + if(item.$name !=null) { + var name = item.$name; + merchantInfo.name = item.$modelValue; + console.log("++++" + item.$name + "++++" + item.$modelValue); + } } }); + // var str = angular.toJson(form, true); + // console.log("----------" + str); - // var str = angular.toJson(form, true); - // console.log("----------" + str); - - // $http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/registRpaySubMerchantId', $scope.merchantInfo).then(function (resp) { - // $scope.apply_sub_merchant_id = resp.data; - // $scope.$close(); - // if (subMerchantInfo.sub_merchant_id != null) { - // commonDialog.alert({ - // title: 'Success', - // content: 'Modify Rpay+ Sub Merchant ID successfully', - // type: 'success' - // }); - // $state.reload(); - // } - // }, function (resp) { - // $scope.errmsg = resp.data.message; - // }) + $http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/registRpaySubMerchantId', merchantInfo).then(function (resp) { + $scope.apply_sub_merchant_id = resp.data; + $scope.$close(); + if (subMerchantInfo.sub_merchant_id != null) { + commonDialog.alert({ + title: 'Success', + content: 'Modify Rpay+ Sub Merchant ID successfully', + type: 'success' + }); + $state.reload(); + } + }, function (resp) { + $scope.errmsg = resp.data.message; + }) } }]); diff --git a/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html b/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html index d13ba4af6..d898d0af8 100644 --- a/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html +++ b/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html @@ -214,7 +214,7 @@
From 1a4d406f03389b980130458a03e7a1925cd99511 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 18 Sep 2018 20:25:54 +0800 Subject: [PATCH 5/7] add 65% --- .../ui/static/payment/partner/partner-manage.js | 5 ++--- .../templates/apply_rpay_sub_merchant_id.html | 16 ++++++++-------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index c7652834b..575637bcf 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -3209,12 +3209,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }); return; } - + var option = []; angular.forEach(form, function (item, key) { if(item !=null) { if(item.$name !=null) { - var name = item.$name; - merchantInfo.name = item.$modelValue; + merchantInfo[key] = item.$modelValue; console.log("++++" + item.$name + "++++" + item.$modelValue); } } diff --git a/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html b/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html index d898d0af8..90806d504 100644 --- a/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html +++ b/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html @@ -12,7 +12,7 @@
+ type="text" name="company_name" id="merchant_name_input" required maxlength="50">

Required Field

Length is more than 50

@@ -47,10 +47,10 @@
- +
+ type="text" name="company_website" id="company_website_input">
-
- +
+
-
+ type="text" name="country" id="country_input"> +

Required Field

@@ -165,7 +165,7 @@
+ type="text" name="address" id="company_address_input">

Required Field

Length is more than 50

From 93a4ff7bed00b45b45c3e4bc3af9f0e979a5b4d5 Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 19 Sep 2018 11:29:14 +0800 Subject: [PATCH 6/7] add 100% --- .../manage/merchants/core/ClientManager.java | 4 +- .../core/impls/ClientManagerImpl.java | 29 ++++---- .../web/PartnerManageController.java | 4 +- .../static/payment/partner/partner-manage.js | 10 +-- .../templates/apply_rpay_sub_merchant_id.html | 73 +++++++++---------- 5 files changed, 58 insertions(+), 62 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java index 925136d37..43b3eec38 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java @@ -334,8 +334,8 @@ public interface ClientManager { void sendHfEmailNotice(JSONObject order); - void updateAllPartnerPassword(String clientMoniker, List emails); + void subRpayMerchantApplication(String clientMoniker,JSONObject merchantInfo, JSONObject manager); - void subRpayMerchantApplication(String clientMoniker, JSONObject manager); + void updateAllPartnerPassword(String clientMoniker, List emails); } 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 f7374de7b..85d4c6ff5 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 @@ -3575,33 +3575,32 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } @Override - public void subRpayMerchantApplication(String clientMoniker, JSONObject manager) { + public void subRpayMerchantApplication(String clientMoniker, JSONObject merchantInfo,JSONObject manager) { JSONObject client = getClientInfoByMoniker(clientMoniker); if (client == null) { throw new InvalidShortIdException(); } checkOrgPermission(manager, client); - List listByshortName = sysRpayMerchantApplyMapper.listByShortName(client.getIntValue("client_id"),client.getString("short_name")); + List listByshortName = sysRpayMerchantApplyMapper.listByShortName(client.getIntValue("client_id"),merchantInfo.getString("company_shortname")); - if (listByshortName.size()>0) { - throw new BadRequestException("请修改【" + clientMoniker + "】的Company shortName信息(请避免和Rpay+商务号列表内的Company Short Name重复)"); - } +// if (listByshortName.size()>0) { +// throw new BadRequestException("请修改【" + clientMoniker + "】的Company shortName信息(请避免和Rpay+商务号列表内的Company Short Name重复)"); +// } - SubRpayMerchantInfo subRpayMerchantInfo = JSONObject.toJavaObject(client, SubRpayMerchantInfo.class); + SubRpayMerchantInfo subRpayMerchantInfo = JSONObject.toJavaObject(merchantInfo, SubRpayMerchantInfo.class); subRpayMerchantInfo.CheckEmpty(); JSONObject rpayMerchantInfo = rpayApi.registerMerchant(client.getIntValue("client_id"), subRpayMerchantInfo); if (rpayMerchantInfo != null) { - JSONObject merchantApply = new JSONObject(); - merchantApply.put("merchant_id", rpayMerchantInfo.getString("rpay_order_id")); - merchantApply.put("client_id", client.getString("client_id")); - merchantApply.put("create_time", new Date()); - merchantApply.put("operator", manager.getString("display_name")); - merchantApply.put("sub_merchant_id", rpayMerchantInfo.getString("merchantId")); - merchantApply.put("business_category", client.getString("royalpayindustry")); - merchantApply.put("merchant_shortname", client.getString("short_name")); - sysRpayMerchantApplyMapper.insertRpayMerchantApply(merchantApply); + merchantInfo.put("merchant_id", rpayMerchantInfo.getString("rpay_order_id")); + merchantInfo.put("client_id", client.getString("client_id")); + merchantInfo.put("create_time", new Date()); + merchantInfo.put("operator", manager.getString("display_name")); + merchantInfo.put("sub_merchant_id", rpayMerchantInfo.getString("merchantId")); + merchantInfo.put("business_category", client.getString("royalpayindustry")); + merchantInfo.put("merchant_shortname", merchantInfo.getString("company_shortname")); + sysRpayMerchantApplyMapper.insertRpayMerchantApply(merchantInfo); clientMapper.updateRpayEnterpriseId(client.getIntValue("client_id"), rpayMerchantInfo.getString("merchantId")); }else { throw new BadRequestException("请求失败"); diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java index 2b7e1a2ec..1e5ada8bc 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java @@ -564,8 +564,8 @@ public class PartnerManageController { } @ManagerMapping(value = "/{clientMoniker}/registRpaySubMerchantId", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public void subRpayMerchantApplication(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.subRpayMerchantApplication(clientMoniker, manager); + public void subRpayMerchantApplication(@PathVariable String clientMoniker,@RequestBody JSONObject merchantInfo,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + clientManager.subRpayMerchantApplication(clientMoniker, merchantInfo,manager); } diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 575637bcf..c536102ee 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -3209,17 +3209,13 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }); return; } - var option = []; angular.forEach(form, function (item, key) { if(item !=null) { if(item.$name !=null) { merchantInfo[key] = item.$modelValue; - console.log("++++" + item.$name + "++++" + item.$modelValue); } } }); - // var str = angular.toJson(form, true); - // console.log("----------" + str); $http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/registRpaySubMerchantId', merchantInfo).then(function (resp) { $scope.apply_sub_merchant_id = resp.data; @@ -3233,7 +3229,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $state.reload(); } }, function (resp) { - $scope.errmsg = resp.data.message; + commonDialog.alert({ + title: 'Error', + content: resp.data.message, + type: 'error' + }); }) } }]); diff --git a/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html b/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html index 90806d504..ecc2e3069 100644 --- a/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html +++ b/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html @@ -7,13 +7,12 @@
-
- + ng-class="{'has-error':subForm.company_name.$invalid && subForm.company_name.$dirty}"> +
-
+ type="text" name="company_name" id="company_name_input" required maxlength="50"> +

Required Field

Length is more than 50

@@ -21,7 +20,7 @@
+ ng-class="{'has-error':subForm.business_name.$invalid && subForm.business_name.$dirty}">
* Company description
+ type="text" name="description" id="description_input" required maxlength="256">

Required Field

Length is more than 256

-

Length is less than 10

-
- +
+
+ type="text" name="abn" id="abn_input" required maxlength="256">

Required Field

-

Length is more than 10

-
- +
+
+ type="text" name="acn" id="acn_input" required maxlength="256">

Required Field

-

Length is more than 10

+
- +
+ type="tel" name="company_phone" id="company_phone_input" required maxlength="256">

Required Field

@@ -118,10 +117,10 @@
- +
+ type="text" name="contact_name" id="contact_name_input" required maxlength="256">

Required Field

@@ -129,10 +128,10 @@
- +
+ type="text" name="contact_phone" id="contact_phone_input" required maxlength="256">

Required Field

@@ -140,10 +139,10 @@
- +
+ type="text" name="contact_email" id="contact_email_input" required maxlength="256">

Required Field

@@ -151,22 +150,22 @@
- +
+ type="text" name="country" id="country_input" required maxlength="256">

Required Field

-
- +
+
-
+ type="text" name="address" id="company_address_input" required maxlength="256"> +

Required Field

Length is more than 50

@@ -174,34 +173,32 @@
- +
+ type="text" name="suburb" id="company_suburb_input" required maxlength="256">

Required Field

-

Length is more than 10

- +
+ type="text" name="postcode" id="company_postcode_input" required maxlength="256">

Required Field

-

Length is more than 10

- +
+ type="text" name="state" id="state_input" required maxlength="256">

Required Field

Length is more than 10

From f72b439353cc925edf109594a1350bd87fbc3a7a Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 19 Sep 2018 12:03:46 +0800 Subject: [PATCH 7/7] change Rpay merchant --- .../payment/partner/templates/apply_rpay_sub_merchant_id.html | 2 +- ...apply_sub_merchant_id.html => apply_wx_sub_merchant_id.html} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename src/main/ui/static/payment/partner/templates/{apply_sub_merchant_id.html => apply_wx_sub_merchant_id.html} (99%) diff --git a/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html b/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html index ecc2e3069..bf36efcf3 100644 --- a/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html +++ b/src/main/ui/static/payment/partner/templates/apply_rpay_sub_merchant_id.html @@ -3,7 +3,7 @@
-
Apply Sub Merchant Id
+
Apply Rpay+ Sub Merchant Id
-
Apply Sub Merchant Id
+
Apply Wechat Sub Merchant Id