add 新增aps渠道费率配置

master
Todking 3 years ago
parent 4cb08e0cb6
commit a0d059ee9d

@ -2021,12 +2021,15 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
checkAddRate(config, "AlipayOnline", "alipayonline_rate_value", org, "min_alipayonline_rate"); checkAddRate(config, "AlipayOnline", "alipayonline_rate_value", org, "min_alipayonline_rate");
checkAddRate(config, "Rpay", "Rpay_rate_value", org, "min_Rpay_rate"); checkAddRate(config, "Rpay", "Rpay_rate_value", org, "min_Rpay_rate");
checkAddRate(config, "CB_BankPay", "min_cb_bankpay_value", org, "min_cb_bankpay_rate"); checkAddRate(config, "CB_BankPay", "min_cb_bankpay_value", org, "min_cb_bankpay_rate");
checkAddRate(config, "AlipayAps Interchange Fee", "interchange_fee_value", org, "min_interchange_fee_rate");
checkAddRate(config, "AlipayAps Serivce Fee", "service_fee_value", org, "min_service_fee_rate");
configNewClientRate(config, clientId, "Wechat", "wechat_rate_value", org, "min_wechat_rate"); configNewClientRate(config, clientId, "Wechat", "wechat_rate_value", org, "min_wechat_rate");
configNewClientRate(config, clientId, "Alipay", "alipay_rate_value", org, "min_alipay_rate"); configNewClientRate(config, clientId, "Alipay", "alipay_rate_value", org, "min_alipay_rate");
configNewClientRate(config, clientId, "AlipayOnline", "alipayonline_rate_value", org, "min_alipayonline_rate"); configNewClientRate(config, clientId, "AlipayOnline", "alipayonline_rate_value", org, "min_alipayonline_rate");
configNewClientRate(config, clientId, "Rpay", "Rpay_rate_value", org, "min_Rpay_rate"); configNewClientRate(config, clientId, "Rpay", "Rpay_rate_value", org, "min_Rpay_rate");
configNewClientRate(config, clientId, "CB_BankPay", "cb_bankpay_rate_value", org, "min_cb_bankpay_rate"); configNewClientRate(config, clientId, "CB_BankPay", "cb_bankpay_rate_value", org, "min_cb_bankpay_rate");
configNewClientRate(config, clientId, "AlipayAps", "interchange_fee_value", null, "");
addAlipayPlusRateConfig(config, clientId, PayChannel.ALIPAY_PLUS.getChannelCode()); addAlipayPlusRateConfig(config, clientId, PayChannel.ALIPAY_PLUS.getChannelCode());
} }
@ -2082,6 +2085,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (newConfig.getBigDecimal("cb_bankpay_rate_value") != null) { if (newConfig.getBigDecimal("cb_bankpay_rate_value") != null) {
clientRateMapper.saveRate(newConfig); clientRateMapper.saveRate(newConfig);
} }
} else if("AlipayAps".equalsIgnoreCase(channel)){
newConfig.put("transaction_fee",newConfig.getFloatValue("service_fee_value"));
clientRateMapper.saveRate(newConfig);
} else { } else {
clientRateMapper.saveRate(newConfig); clientRateMapper.saveRate(newConfig);
} }

@ -2487,7 +2487,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
// $scope.init.channel[channel] = true // $scope.init.channel[channel] = true
// return // return
// } // }
if($scope.paymentInfo.alipay_cn_switch){ if ($scope.paymentInfo.alipay_cn_switch) {
commonDialog.alert({ commonDialog.alert({
title: 'ERROR', title: 'ERROR',
content: "Please switch AlipayCN to Alipay channel, and then close Alipay+(APS) channel", content: "Please switch AlipayCN to Alipay channel, and then close Alipay+(APS) channel",
@ -3383,6 +3383,27 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
} }
) )
} }
$scope.newAlipayApsRate = function () {
$uibModal
.open({
templateUrl: '/static/payment/partner/templates/partner_new_alipay_aps_rate.html',
controller: 'newAlipayApsRateDialogCtrl',
resolve: {
rate: function () {
return {rate_name: "AlipayAps", clean_days: 3}
},
sys_common_rate: function () {
return $http.get('/sys/partners/sys_rates')
},
clientMoniker: function () {
return $scope.partner.client_moniker
},
},
})
.result.then(function () {
$scope.getRates()
})
}
$scope.newCardPaymentRates = function () { $scope.newCardPaymentRates = function () {
$uibModal $uibModal
.open({ .open({
@ -3688,6 +3709,61 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
} }
}, },
]) ])
app.controller('newAlipayApsRateDialogCtrl', [
'$scope',
'$http',
'rate',
'sys_common_rate',
'clientMoniker',
function ($scope, $http, rate, sys_common_rate, clientMoniker) {
$scope.rate = angular.copy(rate)
$scope.sysRateConfig = angular.copy(sys_common_rate.data)
$scope.ctrl = {sending: false}
$scope.saveRate = function (form) {
if (form.$invalid) {
angular.forEach(form, function (item, key) {
if (key.indexOf('$') < 0) {
item.$dirty = true
}
})
return
}
$scope.errmsg = null
$scope.ctrl.sending = true
$http.post('/sys/partners/' + clientMoniker + '/rates', $scope.rate).then(
function () {
$scope.ctrl.sending = false
$scope.$close()
},
function (resp) {
$scope.ctrl.sending = false
$scope.errmsg = resp.data.message
}
)
// $scope.changeDays = function () {
// if ($scope.rate.clean_days) {
// switch ($scope.rate.clean_days) {
// case '1': {
// $scope.rate.wechat_rate_value = parseFloat($scope.sysRateConfig.t1.Wechat)
// $scope.rate.transaction_fee = 0
// break
// }
// case '2': {
// $scope.rate.wechat_rate_value = parseFloat($scope.sysRateConfig.t2.Wechat)
// $scope.rate.transaction_fee = 0
// break
// }
// case '3': {
// $scope.rate.wechat_rate_value = parseFloat($scope.sysRateConfig.t3.Wechat)
// $scope.rate.transaction_fee = 0
// break
// }
// }
// }
// }
}
}
])
app.controller('newRateDialogCtrl', [ app.controller('newRateDialogCtrl', [
'$scope', '$scope',
'$http', '$http',

@ -255,6 +255,9 @@
<li role="presentation" ng-class="{active:bankCtrl.rate_name=='AlipayOnline'}"><a role="button" <li role="presentation" ng-class="{active:bankCtrl.rate_name=='AlipayOnline'}"><a role="button"
ng-click="bankCtrl.rate_name='AlipayOnline'">Alipay(Online)</a> ng-click="bankCtrl.rate_name='AlipayOnline'">Alipay(Online)</a>
</li> </li>
<li role="presentation" ng-class="{active:bankCtrl.rate_name=='AlipayAps'}"><a role="button"
ng-click="bankCtrl.rate_name='AlipayAps'">A+(APS)</a>
</li>
<!-- <li role="presentation" ng-class="{active:bankCtrl.rate_name=='Bestpay'}"><a role="button" <!-- <li role="presentation" ng-class="{active:bankCtrl.rate_name=='Bestpay'}"><a role="button"
ng-click="bankCtrl.rate_name='Bestpay'">Bestpay</a> ng-click="bankCtrl.rate_name='Bestpay'">Bestpay</a>
</li> </li>
@ -281,10 +284,15 @@
ng-if="(partner.card_rate_editable && ('100'|withRole)) || ('11'|withRole)"> ng-if="(partner.card_rate_editable && ('100'|withRole)) || ('11'|withRole)">
Add Card Payment Rates Add Card Payment Rates
</a> </a>
<a id="addAlipayApsRate" class="btn btn-info" style="float: right;margin-right: 10px" type="button"
ng-if="bankCtrl.rate_name=='AlipayAps'"
ng-click="newAlipayApsRate()">
Add Alipay+(APS) Rate
</a>
</ul> </ul>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-bordered"> <table class="table table-bordered">
<thead> <thead ng-if="bankCtrl.rate_name != 'AlipayAps'">
<tr> <tr>
<th>Rate Name</th> <th>Rate Name</th>
<th ng-if="bankCtrl.rate_name!='rpaypmt_card'">Rate Value</th> <th ng-if="bankCtrl.rate_name!='rpaypmt_card'">Rate Value</th>
@ -303,6 +311,19 @@
<th style="text-align: center">Operation</th> <th style="text-align: center">Operation</th>
</tr> </tr>
</thead> </thead>
<thead ng-if="bankCtrl.rate_name == 'AlipayAps'">
<tr>
<th>Rate Name</th>
<th>Interchange Fee</th>
<th>Service Fee</th>
<th>Active Time</th>
<th>Expire Time</th>
<th>Update Time</th>
<th>Operator</th>
<th>Remark</th>
<th style="text-align: center">Operation</th>
</tr>
</thead>
<tbody> <tbody>
<tr ng-repeat="rate in rates|filter:{rate_name:bankCtrl.rate_name}:true" <tr ng-repeat="rate in rates|filter:{rate_name:bankCtrl.rate_name}:true"
ng-class="{'text-bold':rate.current,'success':rate.active}"> ng-class="{'text-bold':rate.current,'success':rate.active}">
@ -312,7 +333,8 @@
<td ng-if="bankCtrl.rate_name=='rpaypmt_card'" <td ng-if="bankCtrl.rate_name=='rpaypmt_card'"
ng-bind="rate.ext_rates.overseas_rate_value.rate + ' %/T+'+rate.ext_rates.overseas_rate_value.clean_days"> ng-bind="rate.ext_rates.overseas_rate_value.rate + ' %/T+'+rate.ext_rates.overseas_rate_value.clean_days">
</td> </td>
<td ng-bind="'$ '+rate.transaction_fee"></td> <td ng-if="bankCtrl.rate_name !='AlipayAps'" ng-bind="'$ '+rate.transaction_fee"></td>
<td ng-if="bankCtrl.rate_name =='AlipayAps'" ng-bind="rate.transaction_fee + ' %'"></td>
<td ng-bind="rate.active_time|date:'yyyy-MM-dd'"></td> <td ng-bind="rate.active_time|date:'yyyy-MM-dd'"></td>
<td ng-bind="rate.expiry_time|date:'yyyy-MM-dd'"></td> <td ng-bind="rate.expiry_time|date:'yyyy-MM-dd'"></td>
<td <td
@ -339,7 +361,7 @@
</div> </div>
</div> </div>
<!-- AlipayPlus费率设置 --> <!-- AlipayPlus费率设置 -->
<div class="row"> <div class="row" ng-if="false">
<div class="col-sm-12"> <div class="col-sm-12">
<h4>AlipayPlus Rates <a class="text-success" role="button" <h4>AlipayPlus Rates <a class="text-success" role="button"
ng-if="partner.rate_editable && (('11'|withRole)||((!partner.approve_result||partner.approve_result>4||(partner.approve_result==4&&partner.open_status==3)) && ('111'|withRole)))" ng-if="partner.rate_editable && (('11'|withRole)||((!partner.approve_result||partner.approve_result>4||(partner.approve_result==4&&partner.open_status==3)) && ('111'|withRole)))"

@ -0,0 +1,126 @@
<div class="modal-header">
<h4>New Alipay APS Rate</h4>
</div>
<div class="modal-body">
<div class="alert alert-danger" ng-if="errmsg" ng-bind="errmsg"></div>
<div class="row">
<div class="col-sm-12">
<form class="form-horizontal" novalidate name="rate_form">
<div class="form-group">
<label class="control-label col-sm-4">Clear Days</label>
<div class="col-sm-6">
<div class="input-group">
<select class="form-control" ng-model="rate.clean_days" id="citySelect" ng-change="changeDays()">
<option value="1">T+1</option>
<option value="2">T+2</option>
<option value="3">T+3</option>
</select>
<div>{{rateConfig}}</div>
</div>
</div>
</div>
<!-- interchange fee -->
<div class="form-group"
ng-class="{'has-error':rate_from.interchange_fee_value.$invalid && rate_from.interchange_fee_value.$dirty}">
<label class="control-label col-sm-4" for="interchange_fee_value_input">Interchange Fee</label>
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="interchange_fee_value" stringToNumber2 class="form-control" ng-model="rate.interchange_fee_value"
min="0.6" max="10" step="0.1" id="interchange_fee_value_input" required>
<div class="input-group-addon">%</div>
</div>
<div ng-messages="rate_from.interchange_fee_value.$error" ng-if="rate_from.interchange_fee_value.$dirty">
<div class="small text-danger" ng-message="max">
<i class="glyphicon glyphicon-alert"></i> No more than 10.0%
</div>
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.6%
</div>
<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field
</div>
</div>
</div>
</div>
<!-- service fee -->
<div class="form-group"
ng-class="{'has-error':rate_from.service_fee_value.$invalid && rate_from.service_fee_value.$dirty}">
<label class="control-label col-sm-4" for="service_fee_value_input">Service Fee</label>
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="service_fee_value" stringToNumber2 class="form-control" ng-model="rate.service_fee_value"
min="0.6" max="10" step="0.1" id="service_fee_value_input" required>
<div class="input-group-addon">%</div>
</div>
<div ng-messages="rate_from.service_fee_value.$error" ng-if="rate_from.service_fee_value.$dirty">
<div class="small text-danger" ng-message="max">
<i class="glyphicon glyphicon-alert"></i> No more than 10.0%
</div>
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.6%
</div>
<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field
</div>
</div>
</div>
</div>
<!-- 新增transaction_fee -->
<!-- <div class="form-group"-->
<!-- ng-class="{'has-error':rate_form.transaction_fee.$invalid && rate_form.transaction_fee.$dirty}">-->
<!-- <label class="control-label col-sm-4" for="transaction_fee_input">Transaction Fee</label>-->
<!-- <div class="col-sm-6">-->
<!-- <div class="input-group">-->
<!-- <input type="number" name="Transaction_fee_value" stringToNumber2 class="form-control" ng-model="rate.transaction_fee"-->
<!-- min="0" step="0.1" max="1" id="transaction_fee_input" required>-->
<!-- <div class="input-group-addon">$</div>-->
<!-- </div>-->
<!-- <div ng-messages="rate_form.transaction_fee.$error" ng-if="rate_form.transaction_fee.$dirty">-->
<!-- <div class="small text-danger" ng-message="min">-->
<!-- <i class="glyphicon glyphicon-alert"></i> No less than 0-->
<!-- </div>-->
<!-- <div class="small text-danger" ng-message="required">-->
<!-- <i class="glyphicon glyphicon-alert"></i> Required Field-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="control-label col-sm-4" for="active_time_input">Active Date</label>
<div class="col-sm-6">
<input class="form-control" ng-model="rate.active_time" id="active_time_input"
uib-datepicker-popup size="10" placeholder="Active Date"
is-open="activeDate.open" ng-click="activeDate.open=true"
datepicker-options="{maxDate:rate.expiry_time}" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" for="expire_time_input">Expire Date</label>
<div class="col-sm-6">
<input class="form-control" ng-model="rate.expiry_time" id="expire_time_input"
uib-datepicker-popup size="10" placeholder="Expire Date"
is-open="expireDate.open" ng-click="expireDate.open=true"
datepicker-options="{minDate:rate.active_time}" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" for="remark_text">Remark</label>
<div class="col-sm-6">
<input class="form-control" ng-model="rate.remark" id="remark_text" type="text">
</div>
</div>
</form>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-success" type="button" ng-click="saveRate(rate_form)" ng-disabled="ctrl.sending">Submit</button>
<button class="btn btn-danger" type="button" ng-click="$dismiss()">Cancel</button>
</div>

@ -14,9 +14,11 @@
</div> </div>
<div class="form-group" <div class="form-group"
ng-class="{'has-error':rate_form.rate_value.$invalid && rate_form.rate_value.$dirty}"> ng-class="{'has-error':rate_form.rate_value.$invalid && rate_form.rate_value.$dirty}">
<label class="control-label col-sm-4" for="rate_value_input"> <label ng-if="rate.rate_name != 'AlipayAps'" class="control-label col-sm-4" for="rate_value_input">
<span ng-if="rate.rate_name=='rpaypmt_card'">Domestic </span> <span ng-if="rate.rate_name=='rpaypmt_card'">Domestic </span>
Rate Value</label> Rate Value</label>
<label ng-if="rate.rate_name == 'AlipayAps'" class="control-label col-sm-4" for="rate_value_input">
Interchange Fee</label>
<div class="col-sm-6"> <div class="col-sm-6">
<div class="input-group"> <div class="input-group">
<input type="number" name="rate_value" class="form-control" ng-model="rate.rate_value" <input type="number" name="rate_value" class="form-control" ng-model="rate.rate_value"
@ -36,7 +38,8 @@
</div> </div>
<div class="form-group" ng-if="rate.rate_name=='rpaypmt_card'" <div class="form-group" ng-if="rate.rate_name=='rpaypmt_card'"
ng-class="{'has-error':rate_form.international_rate_value.$invalid && rate_form.international_rate_value.$dirty}"> ng-class="{'has-error':rate_form.international_rate_value.$invalid && rate_form.international_rate_value.$dirty}">
<label class="control-label col-sm-4" for="international_rate_value_input">International Rate Value</label> <label class="control-label col-sm-4" for="international_rate_value_input">International Rate
Value</label>
<div class="col-sm-6"> <div class="col-sm-6">
<div class="input-group"> <div class="input-group">
<input type="number" name="international_rate_value" stringToNumber2 class="form-control" <input type="number" name="international_rate_value" stringToNumber2 class="form-control"
@ -44,7 +47,8 @@
min="0" max="5" step="0.1" id="international_rate_value_input" required> min="0" max="5" step="0.1" id="international_rate_value_input" required>
<div class="input-group-addon">%</div> <div class="input-group-addon">%</div>
</div> </div>
<div ng-messages="rate_form.international_rate_value.$error" ng-if="rate_form.international_rate_value.$dirty"> <div ng-messages="rate_form.international_rate_value.$error"
ng-if="rate_form.international_rate_value.$dirty">
<div class="small text-danger" ng-message="max"> <div class="small text-danger" ng-message="max">
<i class="glyphicon glyphicon-alert"></i> No more than 5.0% <i class="glyphicon glyphicon-alert"></i> No more than 5.0%
</div> </div>
@ -61,10 +65,12 @@
<!-- 新增transaction_fee字段 --> <!-- 新增transaction_fee字段 -->
<div class="form-group" <div class="form-group"
ng-class="{'has-error':rate_form.transaction_fee.$invalid && rate_form.transaction_fee.$dirty}"> ng-class="{'has-error':rate_form.transaction_fee.$invalid && rate_form.transaction_fee.$dirty}">
<label class="control-label col-sm-4" for="transaction_fee_input">Transaction Fee</label> <label ng-if="rate.rate_name != 'AlipayAps'" class="control-label col-sm-4" for="transaction_fee_input">Transaction Fee</label>
<label ng-if="rate.rate_name == 'AlipayAps'" class="control-label col-sm-4" for="transaction_fee_input">Service Fee</label>
<div class="col-sm-6"> <div class="col-sm-6">
<div class="input-group"> <div class="input-group">
<input type="number" name="transaction_fee" class="form-control" ng-model="rate.transaction_fee" <input type="number" name="transaction_fee" class="form-control"
ng-model="rate.transaction_fee"
min="0" step="0.1" max="1" id="transaction_fee_input" required> min="0" step="0.1" max="1" id="transaction_fee_input" required>
<div class="input-group-addon">$</div> <div class="input-group-addon">$</div>
</div> </div>

Loading…
Cancel
Save