Upd:商户的ext_params在商户支付配置中做面板/

enable_presettle 在清算设置中添加选项
master
dulingling 5 years ago
parent 1d2b48dc57
commit 04fa2d00d1

@ -9,7 +9,7 @@
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId> <artifactId>manage</artifactId>
<version>1.4.27</version> <version>1.4.28</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.8.0</jib-maven-plugin.version> <jib-maven-plugin.version>1.8.0</jib-maven-plugin.version>

@ -234,6 +234,8 @@ public interface ClientManager {
void setClientTaxInSurcharge(JSONObject account, String clientMoniker, boolean taxInSurcharge); void setClientTaxInSurcharge(JSONObject account, String clientMoniker, boolean taxInSurcharge);
void setClientPreSettle(JSONObject manager, String clientMoniker, boolean presettle);
void setClientCustomerTaxFree(JSONObject account, String clientMoniker, boolean customerTaxFree); void setClientCustomerTaxFree(JSONObject account, String clientMoniker, boolean customerTaxFree);
List<JSONObject> listClientsForSettlement(); List<JSONObject> listClientsForSettlement();
@ -560,4 +562,6 @@ public interface ClientManager {
void queryModifyClientIds(int clientId, JSONObject params); void queryModifyClientIds(int clientId, JSONObject params);
boolean getMergeSettleStatus(JSONObject client); boolean getMergeSettleStatus(JSONObject client);
void changeExtParams(String clientMoniker,JSONObject manager, JSONObject params);
} }

@ -3443,6 +3443,15 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "tax_in_surcharge", taxInSurcharge)); clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "tax_in_surcharge", taxInSurcharge));
} }
@Override
public void setClientPreSettle(JSONObject account, String clientMoniker, boolean presettle) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "enable_presettle", presettle));
}
@Override @Override
public void setClientCustomerTaxFree(JSONObject account, String clientMoniker, boolean customerTaxFree) { public void setClientCustomerTaxFree(JSONObject account, String clientMoniker, boolean customerTaxFree) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
@ -6780,4 +6789,21 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
} }
@Override
public void changeExtParams(String clientMoniker,JSONObject manager, JSONObject params){
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
JSONObject clientConfig = clientConfigMapper.find(client.getInteger("client_id"));
JSONObject extParmas = JSONObject.parseObject(clientConfig.getString("ext_params"));
if("true".equals(params.getString("value"))||"false".equals(params.getString("value"))){
extParmas.put(params.getString("key"),params.getBoolean("value"));
}else{
extParmas.put(params.getString("key"),params.getString("value"));
}
clientConfig.put("ext_params",extParmas.toString());
clientConfigMapper.update(clientConfig);
}
} }

@ -253,6 +253,11 @@ public class PartnerManageController {
clientManager.setClientTaxInSurcharge(manager, clientMoniker, config.getBooleanValue("tax_in_surcharge")); clientManager.setClientTaxInSurcharge(manager, clientMoniker, config.getBooleanValue("tax_in_surcharge"));
} }
@ManagerMapping(value = "/{clientMoniker}/presettle", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN})
public void setClientPreSettle(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject config) {
clientManager.setClientPreSettle(manager, clientMoniker, config.getBooleanValue("enable_presettle"));
}
@ManagerMapping(value = "/{clientMoniker}/customer_tax_free", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR}) @ManagerMapping(value = "/{clientMoniker}/customer_tax_free", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR})
public void setClientCustomerTaxFree(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject config) { public void setClientCustomerTaxFree(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject config) {
clientManager.setClientCustomerTaxFree(manager, clientMoniker, config.getBooleanValue("customer_tax_free")); clientManager.setClientCustomerTaxFree(manager, clientMoniker, config.getBooleanValue("customer_tax_free"));
@ -868,4 +873,11 @@ public class PartnerManageController {
public void switchClientIncrementalService(@PathVariable("clientMoniker") String clientMoniker,@RequestBody JSONObject incrementalService, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager){ public void switchClientIncrementalService(@PathVariable("clientMoniker") String clientMoniker,@RequestBody JSONObject incrementalService, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager){
clientManager.changeSwitchIncrementalService(clientMoniker,incrementalService,manager); clientManager.changeSwitchIncrementalService(clientMoniker,incrementalService,manager);
} }
@ManagerMapping(value = "/{clientMoniker}/ext_config", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR})
public void changeClientExtConfigs(@PathVariable("clientMoniker")String clientMoniker,
@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,
@RequestBody JSONObject params){
clientManager.changeExtParams(clientMoniker,manager,params);
}
} }

@ -1733,6 +1733,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
} }
}]); }]);
app.controller('partnerPaymentInfoCtrl', ['$scope', '$http', '$state', 'commonDialog', '$uibModal', '$sce', function ($scope, $http, $state, commonDialog, $uibModal, $sce) { app.controller('partnerPaymentInfoCtrl', ['$scope', '$http', '$state', 'commonDialog', '$uibModal', '$sce', function ($scope, $http, $state, commonDialog, $uibModal, $sce) {
$scope.convertExtParams = [];
$scope.copyHfLink = function () { $scope.copyHfLink = function () {
var e = document.getElementById("cpbt"); var e = document.getElementById("cpbt");
e.select(); e.select();
@ -1765,7 +1766,10 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}; };
$scope.loadPartnerPaymentInfo = function () { $scope.loadPartnerPaymentInfo = function () {
$http.get('/sys/partners/' + $scope.partner.client_moniker).then(function (resp) { $http.get('/sys/partners/' + $scope.partner.client_moniker).then(function (resp) {
$scope.extParams = {};
$scope.paymentInfo = resp.data; $scope.paymentInfo = resp.data;
$scope.extParams = $scope.paymentInfo?JSON.parse($scope.paymentInfo.ext_params):null;
$scope.convertExtParams = $scope.extParamsEditFlags()
$scope.ctrl.editSubMerchant = false; $scope.ctrl.editSubMerchant = false;
$scope.ctrl.editAliSubMerchant = false; $scope.ctrl.editAliSubMerchant = false;
$scope.ctrl.editMaxOrderAmount = false; $scope.ctrl.editMaxOrderAmount = false;
@ -1774,6 +1778,27 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.ctrl.editRefundCreditLine = false; $scope.ctrl.editRefundCreditLine = false;
}) })
}; };
$scope.extParamsEditFlags = function(){
var paramList = []
if($scope.extParams != null){
for(var key in $scope.extParams){
var obj = {}
console.log(1)
if(typeof $scope.extParams[key] != 'boolean'){
obj.name = key;
obj.value = $scope.extParams[key];
obj.type = 'string';
obj.flag =false;
}else{
obj.name = key;
obj.value = $scope.extParams[key];
obj.type = 'boolean'
}
paramList.push(obj)
}
}
return paramList;
};
$scope.qrConfig = {currency: 'AUD'}; $scope.qrConfig = {currency: 'AUD'};
$scope.reloadQRCode = function () { $scope.reloadQRCode = function () {
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/qrcode', {params: $scope.qrConfig}).then(function (resp) { $http.get('/sys/partners/' + $scope.partner.client_moniker + '/qrcode', {params: $scope.qrConfig}).then(function (resp) {
@ -2462,6 +2487,21 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}) })
}; };
$scope.extChangeParam = function(name,value){
var flag = true;
$scope.convertExtParams.forEach(function (params) {
if(params.name == name && value=='' && params.type == 'string'){
flag = false;
}
})
if(flag){
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/ext_config',{key:name,value:value}).then(function () {
$scope.loadPartnerPaymentInfo();
})
}
}
}]); }]);
app.controller('clientSubMerchantIdLogCtrl', ['$scope', '$http', 'logs', function ($scope, $http, logs) { app.controller('clientSubMerchantIdLogCtrl', ['$scope', '$http', 'logs', function ($scope, $http, logs) {
$scope.logs = logs.data; $scope.logs = logs.data;
@ -2689,6 +2729,17 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.getBankAccount(); $scope.getBankAccount();
}) })
}; };
$scope.switchPreSettle = function (presettle) {
if (!$scope.init.enable_presettle) {
$scope.init.enable_presettle = true;
return;
}
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/presettle', {enable_presettle: presettle}).then(function (resp) {
$scope.getBankAccount();
})
};
$scope.customerTaxFree = function (customerTaxFree) { $scope.customerTaxFree = function (customerTaxFree) {
if (!$scope.init.customer_tax_free) { if (!$scope.init.customer_tax_free) {
$scope.init.customer_tax_free = true; $scope.init.customer_tax_free = true;

@ -65,6 +65,13 @@
switch-change="skipClearing(partner.skip_clearing)"> switch-change="skipClearing(partner.skip_clearing)">
</div> </div>
</div> </div>
<div class="form-group" ng-if="'modify_skip_clear'|withFunc">
<label class="col-sm-4">Pre Settle</label>
<div class="col-sm-6">
<input type="checkbox" ng-model="partner.enable_presettle" bs-switch
switch-change="switchPreSettle(partner.enable_presettle)">
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-4">Manual Settle</label> <label class="col-sm-4">Manual Settle</label>

@ -553,7 +553,7 @@
class="fa fa-edit"></i></a> class="fa fa-edit"></i></a>
</p> </p>
<div class="input-group" ng-if="ctrl.editRefundPwd"> <div class="input-group" ng-if="ctrl.editRefundPwd">
<input type="text" class="form-control" maxlength="6" ng-model="paymentInfo.new_refund_password"> <input type="text" class="form-control" maxlength="6" minlength="1" ng-model="paymentInfo.new_refund_password">
<div class="input-group-btn"> <div class="input-group-btn">
<button class="btn btn-success" <button class="btn btn-success"
ng-click="resetRefundPwd(paymentInfo.new_refund_password)"> ng-click="resetRefundPwd(paymentInfo.new_refund_password)">
@ -594,6 +594,44 @@
</div> </div>
</div> </div>
</div> </div>
<div class="panel panel-default" ng-if="paymentInfo.ext_params">
<div class="panel-heading">Ext Config</div>
<div class="panel-body">
<div class="form-horizontal" >
<!-- 此处 遍历 循环 -->
<div class="form-group" ng-repeat="param in convertExtParams">
<label class="col-sm-2 control-label">{{param.name.toUpperCase()}}</label>
<div class="col-sm-10">
<div ng-if="param.type=='boolean'">
<input type="checkbox" ng-model="param.value" bs-switch
ng-change="extChangeParam(param.name,param.value)">
</div>
<div ng-if="param.type == 'string'">
<p ng-if="!param.flag" class="form-control-static">
{{param.value}}
<a role="button" ng-click="param.flag=true" ng-if="'01'|withRole"><i class="fa fa-edit"></i></a>
</p>
<div class="input-group" ng-if="param.flag">
<input type="text" class="form-control" ng-model="param.value"
title="Prevent not enough refund">
<div class="input-group-btn">
<button class="btn btn-success" ng-click="extChangeParam(param.name,param.value)">
<i class="fa fa-check"></i>
</button>
</div>
<div class="input-group-btn">
<button class="btn btn-danger" ng-click="param.flag=false">
<i class="fa fa-remove"></i>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default" ng-if="'1000000000111'|withRole"> <div class="panel panel-default" ng-if="'1000000000111'|withRole">

Loading…
Cancel
Save