master
wangning 7 years ago
commit 63f9391f58

@ -150,8 +150,8 @@ public interface ClientManager {
List<JSONObject> listSubClients(int clientId);
// void newSubClient(String clientMoniker, SubClientRegistry registry, JSONObject manager);
// void newSubClient(String clientMoniker, SubClientRegistry registry, JSONObject manager);
void validateClients(int client_id, JSONObject params) throws Exception;
void updateClientBDUsers(JSONObject manager, String clientMoniker, JSONObject data) throws Exception;
@ -193,6 +193,8 @@ public interface ClientManager {
void setClientRetailPaySurCharge(String clientMoniker, boolean paySurcharge);
void setClientTaxInSurcharge(String clientMoniker, boolean taxInSurcharge);
List<JSONObject> listClientsForSettlement();
List<JSONObject> listClientsDetailsForSettlement();

@ -390,6 +390,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
return PageListUtils.buildPageListResult(partners);
}
private void orgIds(JSONObject params, int orgId) {
JSONObject param = new JSONObject();
param.put("parent_org_id", params.getString("org_id"));
@ -1267,23 +1268,27 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
// clientMapper.updateCleanDays(clientId, config.getCleanDays());
}
private void checkModifyRate(JSONObject org, JSONObject configJson, String rateName, String rateValueKey) {
if (configJson.getString("rate_name").equals(rateName)) {
if (org.containsKey(rateValueKey)) {
if (configJson.getDouble("rate_value").compareTo(org.getDouble(rateValueKey)) < 0) {
throw new ForbiddenException("费率参数小于旗下商户最低" + rateName + "费率,请重新输入");
};
}
;
}
}
}
private void checkAddRate(JSONObject config, String channel, String rateKey, JSONObject org, String rateValueKey) {
if (config.containsKey(rateKey)) {
if (org.containsKey(rateValueKey)) {
if (config.getBigDecimal(rateKey).compareTo(org.getBigDecimal(rateValueKey)) < 0) {
throw new ForbiddenException("费率参数小于旗下商户最低" + channel + "费率,请重新输入");
};
}
;
}
}
}
@ -2159,6 +2164,20 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clearClientCache(clientId);
}
@Override
public void setClientTaxInSurcharge(String clientMoniker, boolean taxInSurcharge) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
JSONObject update = new JSONObject();
int clientId = client.getIntValue("client_id");
update.put("client_id", clientId);
update.put("tax_in_surcharge", taxInSurcharge);
clientMapper.update(update);
clearClientCache(clientId);
}
@Override
public List<JSONObject> listClientsForSettlement() {
return clientMapper.listClientsForSettlement();
@ -2994,6 +3013,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
return null;
}
@Override
@CacheEvict(value = ":all_sub_merchant_id_applices:", key = "#clientMoniker")
public String subMerchantApplication(String clientMoniker, SubMerchantIdApply subMerchantApply, JSONObject manager) {

@ -175,6 +175,11 @@ public class PartnerManageController {
clientManager.setClientRetailPaySurCharge(clientMoniker, config.getBooleanValue("retail_surcharge"));
}
@ManagerMapping(value = "/{clientMoniker}/tax_in_surcharge", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN})
public void setClientTaxPayer(@PathVariable String clientMoniker, @RequestBody JSONObject config) {
clientManager.setClientTaxInSurcharge(clientMoniker, config.getBooleanValue("tax_in_surcharge"));
}
@ManagerMapping(value = "/{clientMoniker}/credential_code", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER})
public void updateCredentialCode(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.refreshClientCredentialCode(manager, clientMoniker);

@ -1334,6 +1334,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/skip_clearing', {skip_clearing: skipClearing}).then(function (resp) {
});
};
$scope.taxInSurcharge = function (taxInSurcharge) {
$http.put('/sys/partners/' + $scope.partner.tax_in_surcharge + '/tax_in_surcharge', {tax_in_surcharge: taxInSurcharge}).then(function (resp) {
})
};
$scope.settleHours = [{value: undefined, label: 'Default(24:00, GMT+10)'}];
for (var h = 24; h > 0; h--) {
$scope.settleHours.push({value: h, label: ('00' + h).substr(-2) + ':00, ' + $scope.partner.timezone});

@ -13,6 +13,13 @@
</a>
</h3>
<div class="form-horizontal">
<div class="form-group" ng-if="'modify_tax_in_surcharge'|withFunc">
<label class="col-sm-4">RoyalPay Pay GST</label>
<div class="col-sm-6">
<input type="checkbox" ng-model="partner.tax_in_surcharge" bs-switch
switch-change="taxInSurcharge(partner.tax_in_surcharge)">
</div>
</div>
<div class="form-group" ng-if="'modify_skip_clear'|withFunc">
<label class="col-sm-4">Skip Clearing</label>
<div class="col-sm-6">

@ -100,9 +100,11 @@ $(function () {
dataCache.discounts = [];
dataCache.tax = surchargeData.tax;
dataCache.surcharge = surchargeData.surcharge;
$(window.coupons).each(function () {
price = this.handleDiscount(price, dataCache.price, dataCache.discounts, dataCache.coupons);
});
dataCache.customSurcharge = new Decimal(price).sub(realPrice).toFixed(2,Decimal.ROUND_HALF_UP);
dataCache.finalPrice = new Decimal(price).toFixed(2, Decimal.ROUND_FLOOR);
var rate = 'CNY' == window.currency ? 1 : exchangeRate;
var cnyVal = Decimal.mul(price, rate).toFixed(2, Decimal.ROUND_HALF_UP);
@ -201,11 +203,8 @@ $(function () {
var bd = $('.weui_dialog_bd', dialog);
var currencySymbol = window.currency == 'AUD' ? '$' : '¥';
$('<p></p>').html('Input Price 输入金额:' + currencySymbol + dataCache.price).appendTo(bd);
if (parseFloat(dataCache.surcharge) > 0) {
$('<p></p>').html('Surcharge 手续费(' + window.rateValue + '%):+' + currencySymbol + dataCache.surcharge).appendTo(bd);
}
if (parseFloat(dataCache.tax) > 0) {
$('<p></p>').html('GST(10%):'+currencySymbol+dataCache.tax).appendTo(bd);
if (parseFloat(dataCache.customSurcharge) > 0) {
$('<p></p>').html('Surcharge 手续费(' + window.rateValue + '%):+' + currencySymbol + dataCache.customSurcharge).appendTo(bd);
}
$(dataCache.discounts).each(function () {
$('<p></p>').html(this.title + ':-' + currencySymbol + this.amount).appendTo(bd);

@ -92,6 +92,7 @@ $(function () {
$(window.coupons).each(function () {
price = this.handleDiscount(price, dataCache.price, dataCache.discounts, dataCache.coupons);
});
dataCache.customSurcharge = new Decimal(price).sub(realPrice).toFixed(2,Decimal.ROUND_HALF_UP);
dataCache.finalPrice = new Decimal(price).toFixed(2, Decimal.ROUND_FLOOR);
var rate = 'CNY' == window.currency ? 1 : exchangeRate;
var cnyVal = Decimal.mul(price, rate).toFixed(2, Decimal.ROUND_HALF_UP);
@ -190,11 +191,8 @@ $(function () {
var bd = $('.weui_dialog_bd', dialog);
var currencySymbol = window.currency == 'AUD' ? '$' : '¥';
$('<p></p>').html('Input Price 输入金额:' + currencySymbol + dataCache.price).appendTo(bd);
if (parseFloat(dataCache.surcharge) > 0) {
$('<p></p>').html('Surcharge 手续费(' + window.rateValue + '%):+' + currencySymbol + dataCache.surcharge).appendTo(bd);
}
if (parseFloat(dataCache.tax) > 0) {
$('<p></p>').html('GST(10%):'+currencySymbol+dataCache.tax).appendTo(bd);
if (parseFloat(dataCache.customSurcharge) > 0) {
$('<p></p>').html('Surcharge 手续费(' + window.rateValue + '%):+' + currencySymbol + dataCache.customSurcharge).appendTo(bd);
}
$(dataCache.discounts).each(function () {
$('<p></p>').html(this.title + ':-' + currencySymbol + this.amount).appendTo(bd);

Loading…
Cancel
Save