diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java index f3c7ee7b0..9c91e5a9f 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java @@ -17,8 +17,6 @@ import au.com.royalpay.payment.manage.dev.bean.SendWechatMessage; import au.com.royalpay.payment.manage.dev.core.AliforexcelService; import au.com.royalpay.payment.manage.dev.core.AlipayRegisterService; import au.com.royalpay.payment.manage.dev.core.WechatMessageService; -import au.com.royalpay.payment.manage.management.clearing.beans.CustomizedSettleRequest; -import au.com.royalpay.payment.manage.management.clearing.core.SettleTasksService; import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; import au.com.royalpay.payment.manage.mappers.payment.RefundMapper; import au.com.royalpay.payment.manage.mappers.system.*; @@ -103,8 +101,6 @@ public class TestController { @Resource private PaymentApi paymentApi; @Resource - private SettleTasksService settleTasksService; - @Resource private TradeLogService tradeLogService; @Resource private RetailAppService retailAppService; @@ -433,11 +429,6 @@ public class TestController { aliforexcelService.registerRangeAlipayOnlineMerchant(start, end); } - @ManagerMapping(value = "/customized_settle", method = RequestMethod.POST, role = ManagerRole.DEVELOPER) - public JSONObject sendCustomizedSettle(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody CustomizedSettleRequest req) { - return settleTasksService.submitCustomizedSettle(req, manager); - } - @GetMapping(value = "/register/alipayGms") public void registerAlipayMerchant() { aliforexcelService.registerAlipayMerchant(); diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/SettleTasksController.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/SettleTasksController.java index d2e1d3986..4bff06ba9 100644 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/SettleTasksController.java +++ b/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/SettleTasksController.java @@ -1,5 +1,6 @@ package au.com.royalpay.payment.manage.management.clearing.web; +import au.com.royalpay.payment.manage.management.clearing.beans.CustomizedSettleRequest; import au.com.royalpay.payment.manage.management.clearing.beans.PriorityModifyLog; import au.com.royalpay.payment.manage.management.clearing.core.PriorityListManager; import au.com.royalpay.payment.manage.management.clearing.core.SettleTasksService; @@ -67,4 +68,9 @@ public class SettleTasksController { public List getMerchantsModifyHistory() { return priorityListManager.getMerchantsModifyHistory(); } + + @ManagerMapping(value = "/customized_settle", method = RequestMethod.POST, role = ManagerRole.DEVELOPER) + public JSONObject sendCustomizedSettle(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody CustomizedSettleRequest req) { + return svc.submitCustomizedSettle(req, manager); + } } diff --git a/src/main/ui/static/analysis/settle_tasks.js b/src/main/ui/static/analysis/settle_tasks.js index b8604ed57..4b1fec13a 100644 --- a/src/main/ui/static/analysis/settle_tasks.js +++ b/src/main/ui/static/analysis/settle_tasks.js @@ -42,6 +42,13 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { size: 'lg' }) }; + + $scope.customizedSettleDialog = function () { + $uibModal.open({ + templateUrl: '/static/analysis/templates/settle_tasks_customized_task_dialog.html', + controller: 'newCustomizedSettleDialogCtrl' + }) + } $scope.checkProgressStatus = function () { let defer = $q.defer(); $http.get('/sys/settle_tasks/current_progress').then(function (res) { @@ -95,7 +102,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { size: 'lg' }).result.then(function (merchants) { let arr = $scope.editingTask.whitelist_clients || []; - if(!merchants){ + if (!merchants) { commonDialog.alert({ type: 'error', title: '未选择有效商户', @@ -214,6 +221,50 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { } }]); + app.controller('newCustomizedSettleDialogCtrl', ['$scope', '$http', function ($scope, $http) { + $scope.task = {} + $scope.refreshClient = function () { + if ($scope.task.client_moniker) { + $http.post('/sys/settle_tasks/merchants', {monikers: [$scope.task.client_moniker]}).then(function (resp) { + let merchantsInfo = resp.data + if (merchantsInfo.length) { + $scope.chosenClient = merchantsInfo[0] + } else { + $scope.chosenClient = null + } + }, function () { + $scope.chosenClient = null; + }) + } else { + $scope.chosenClient = null + } + } + $scope.submitSettle = function () { + if (!$scope.chosenClient) { + $scope.errorMsg = 'Invalid Client Moniker' + return + } + if ($scope.submitting) { + $scope.errorMsg = 'Already Submitting' + } + $scope.submitting = true + if(!$scope.task.amount || $scope.task.amount<0){ + $scope.errorMsg = 'Invalid amount' + } + $scope.errorMsg = null + let data = { + client_moniker: $scope.task.client_moniker, + amount: $scope.task.amount + } + $http.post('/sys/settle_tasks/customized_settle', data).then(function (){ + $scope.task = {} + $scope.$dismiss() + },function (resp){ + $scope.errorMsg = resp.data.message + }) + } + }]) + app.controller('settleTasksPriorityListManageCtrl', ['$scope', '$http', '$uibModal', 'commonDialog', function ($scope, $http, $uibModal, commonDialog) { $scope.filters = {client_moniker: null}; diff --git a/src/main/ui/static/analysis/templates/settle_tasks_customized_task_dialog.html b/src/main/ui/static/analysis/templates/settle_tasks_customized_task_dialog.html new file mode 100644 index 000000000..5258cb9f0 --- /dev/null +++ b/src/main/ui/static/analysis/templates/settle_tasks_customized_task_dialog.html @@ -0,0 +1,27 @@ + + + \ No newline at end of file diff --git a/src/main/ui/static/analysis/templates/settle_tasks_index.html b/src/main/ui/static/analysis/templates/settle_tasks_index.html index 209e928a9..597acaa17 100644 --- a/src/main/ui/static/analysis/templates/settle_tasks_index.html +++ b/src/main/ui/static/analysis/templates/settle_tasks_index.html @@ -28,6 +28,7 @@ +