gst in surcharge config

master
yixian 7 years ago
parent c71e629188
commit 138820f1bd

@ -150,8 +150,8 @@ public interface ClientManager {
List<JSONObject> listSubClients(int clientId); 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 validateClients(int client_id, JSONObject params) throws Exception;
void updateClientBDUsers(JSONObject manager, String clientMoniker, JSONObject data) 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 setClientRetailPaySurCharge(String clientMoniker, boolean paySurcharge);
void setClientTaxInSurcharge(String clientMoniker, boolean taxInSurcharge);
List<JSONObject> listClientsForSettlement(); List<JSONObject> listClientsForSettlement();
List<JSONObject> listClientsDetailsForSettlement(); List<JSONObject> listClientsDetailsForSettlement();

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

@ -175,6 +175,11 @@ public class PartnerManageController {
clientManager.setClientRetailPaySurCharge(clientMoniker, config.getBooleanValue("retail_surcharge")); clientManager.setClientRetailPaySurCharge(clientMoniker, config.getBooleanValue("retail_surcharge"));
} }
@ManagerMapping(value = "/{clientMoniker}/tax_in_surcharge", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.SERVANT})
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}) @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) { public void updateCredentialCode(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.refreshClientCredentialCode(manager, clientMoniker); 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) { $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)'}]; $scope.settleHours = [{value: undefined, label: 'Default(24:00, GMT+10)'}];
for (var h = 24; h > 0; h--) { for (var h = 24; h > 0; h--) {
$scope.settleHours.push({value: h, label: ('00' + h).substr(-2) + ':00, ' + $scope.partner.timezone}); $scope.settleHours.push({value: h, label: ('00' + h).substr(-2) + ':00, ' + $scope.partner.timezone});

@ -13,6 +13,13 @@
</a> </a>
</h3> </h3>
<div class="form-horizontal"> <div class="form-horizontal">
<div class="form-group" ng-if="'modify_tax_in_surcharge'|withFunc">
<label class="col-sm-4">Skip Clearing</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"> <div class="form-group" ng-if="'modify_skip_clear'|withFunc">
<label class="col-sm-4">Skip Clearing</label> <label class="col-sm-4">Skip Clearing</label>
<div class="col-sm-6"> <div class="col-sm-6">

Loading…
Cancel
Save