feature: new customized settle dialog

master
Yixian 3 years ago
parent 11430810eb
commit 1bf070c4b0

@ -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();

@ -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<PriorityModifyLog> 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);
}
}

@ -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};

@ -0,0 +1,27 @@
<div class="modal-header">Customized Task</div>
<div class="modal-body">
<div class="form-group">
<label class="control-label" for="clientMonikerInput">Client Moniker</label>
<input ng-model="task.client_moniker" class="form-control" type="text" id="clientMonikerInput" ng-blur="refreshClient()">
</div>
<dl class="dl-horizontal" ng-if="chosenClient">
<dt>Client Moniker</dt>
<dd ng-bind="chosenClient.client_moniker"></dd>
<dt>Company Name</dt>
<dd ng-bind="chosenClient.company_name"></dd>
<dt>BD</dt>
<dd ng-bind="chosenClient.bd_user_name"></dd>
</dl>
<div class="form-group">
<label class="control-label" for="customizeSettleAmtInput">Amount</label>
<div class="input-group">
<div class="input-group-addon">AU$</div>
<input class="form-control" id="customizeSettleAmtInput" type="number" ng-model="task.amount">
</div>
</div>
<div class="alert alert-danger" ng-bind="errorMsg" ng-if="errorMsg"></div>
</div>
<div class="modal-footer">
<button class="btn btn-success" ng-click="submitSettle()" ng-disabled="submitting">Submit</button>
<button class="btn btn-danger" ng-click="$dismiss()">Cancel</button>
</div>

@ -28,6 +28,7 @@
<button type="button" class="btn btn-primary" ng-click="displayYesterdayTransaction()">Yesterday
Transaction Funds
</button>
<button type="button" class="btn btn-primary" ng-if="'new_customized_settle'|withFunc" ng-click="customizedSettleDialog()">Customized Settle</button>
</div>
</div>
<div class="box box-info">

Loading…
Cancel
Save