master
wangning 7 years ago
commit 65baad8331

@ -60,6 +60,9 @@ public interface ClientManager {
@Transactional
void updateClientPaymentConfig(JSONObject manager, String clientMoniker, JSONObject subMerchantInfo);
@Transactional
void updateAliSubMerchantId(JSONObject manager, String clientMoniker, JSONObject aliSubMerchantInfo);
@Transactional(noRollbackFor = EmailException.class)
void auditClient(JSONObject manager, String clientMoniker, int pass);
@ -258,6 +261,8 @@ public interface ClientManager {
void enableGatewayUpgrade(JSONObject account,String clientMoniker, boolean gatewayUpgrade);
void enableGatewayAlipayOnline(JSONObject account,String clientMoniker, boolean gatewayAlipayOnline);
void setCustomerSurchargeRate(JSONObject account,String clientMoniker, BigDecimal customer_surcharge_rate);
void setOrderExpiryConfig(JSONObject account,String clientMoniker, String orderExpiryConfig);

@ -711,6 +711,21 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientInfoCacheSupport.clearClientCache(clientId);
}
@Override
public void updateAliSubMerchantId(JSONObject manager, String clientMoniker, JSONObject aliSubMerchantInfo) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
checkOrgPermission(manager, client);
JSONObject update = new JSONObject();
int clientId = client.getIntValue("client_id");
update.put("client_id", clientId);
update.put("ali_sub_merchant_id", aliSubMerchantInfo.getString("ali_sub_merchant_id"));
clientMapper.update(update);
clientInfoCacheSupport.clearClientCache(clientId);
}
private void recordSubMerchantLog(JSONObject client, JSONObject subMerchantInfo, JSONObject manager) {
JSONObject log = new JSONObject();
log.put("sub_merchant_id_after", subMerchantInfo.getString("sub_merchant_id"));
@ -3050,6 +3065,15 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "gateway_upgrade", gatewayUpgrade));
}
@Override
public void enableGatewayAlipayOnline(JSONObject account, String clientMoniker, boolean gatewayAlipayOnline) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "gateway_alipay_online", gatewayAlipayOnline));
}
private void sendMessagetoCompliance(JSONObject client, String bd_user_name) {
List<JSONObject> complianceList = managerMapper.getOnlyCompliance();
if (complianceList != null && complianceList.size() > 0) {

@ -154,6 +154,10 @@ public class PartnerManageController {
public void updatePartnerPaymentConfig(@PathVariable String clientMoniker, @RequestBody JSONObject subMerchantInfo, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.updateClientPaymentConfig(manager, clientMoniker, subMerchantInfo);
}
@ManagerMapping(value = "/{clientMoniker}/ali_sub_merchant_id", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR})
public void updateAliSubMerchantId(@PathVariable String clientMoniker, @RequestBody JSONObject aliSubMerchantInfo, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.updateAliSubMerchantId(manager, clientMoniker, aliSubMerchantInfo);
}
@ManagerMapping(value = "/{clientMoniker}/qrcode_surcharge", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.SERVANT})
public void setClientPaySurCharge(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,@PathVariable String clientMoniker, @RequestBody JSONObject config) {
@ -165,6 +169,11 @@ public class PartnerManageController {
clientManager.enableGatewayUpgrade(manager,clientMoniker, config.getBooleanValue("gateway_upgrade"));
}
@ManagerMapping(value = "/{clientMoniker}/gateway_alipay_online", method = RequestMethod.PUT, role = {ManagerRole.DEVELOPER})
public void enableGatewayAlipayOnline(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,@PathVariable String clientMoniker, @RequestBody JSONObject config) {
clientManager.enableGatewayAlipayOnline(manager,clientMoniker, config.getBooleanValue("gateway_alipay_online"));
}
@ManagerMapping(value = "/{clientMoniker}/api_surcharge", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.SERVANT})
public void setClientApiPaySurCharge(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,@PathVariable String clientMoniker, @RequestBody JSONObject config) {
clientManager.setClientApiPaySurCharge(manager,clientMoniker, config.getBooleanValue("api_surcharge"));

@ -1079,6 +1079,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$http.get('/sys/partners/' + $scope.partner.client_moniker).then(function (resp) {
$scope.paymentInfo = resp.data;
$scope.ctrl.editSubMerchant = false;
$scope.ctrl.editAliSubMerchant = false;
$scope.ctrl.editMaxOrderAmount = false;
$scope.ctrl.editOrderExpiryConfig = false;
})
@ -1209,6 +1210,18 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
};
$scope.saveAliSubMerchantId = function () {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/ali_sub_merchant_id', {ali_sub_merchant_id: $scope.paymentInfo.ali_sub_merchant_id}).then(function (resp) {
commonDialog.alert({
title: 'Success',
content: 'Modify Ali Sub Merchant ID successfully',
type: 'success'
});
$scope.loadPartnerPaymentInfo();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
};
$scope.refreshCredential = function () {
commonDialog.confirm({
title: 'Warning',
@ -1221,7 +1234,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
})
})
};
$scope.init = {jsapi: false, gateway: false, offline: false, refund: false,common_sub_merchant_id:false, channel: {}};
$scope.init = {jsapi: false, gateway: false, offline: false, refund: false,common_sub_merchant_id:false, channel: {},gateway_alipay_online:false};
$scope.switchCommonSubMerchantId = function () {
if (!$scope.paymentInfo) {
return;
@ -1315,6 +1328,24 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
})
})
};
$scope.toggleGatewayAlipayOnline = function () {
if (!$scope.paymentInfo) {
return;
}
if (!$scope.init.gateway_alipay_online) {
$scope.init.gateway_alipay_online = true;
return;
}
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/gateway_alipay_online', {gateway_alipay_online: $scope.paymentInfo.gateway_alipay_online}).then(function () {
$scope.loadPartnerPaymentInfo();
}, function (resp) {
commonDialog.alert({
title: 'failed to change Gateway Alipay Online status',
content: resp.data.message,
type: 'error'
})
})
};
$scope.toggleRefund = function () {
if (!$scope.paymentInfo) {
return;

@ -39,6 +39,29 @@
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">Ali Sub Merchant Id</label>
<div class="col-sm-9">
<p ng-if="!ctrl.editAliSubMerchant" class="form-control-static">
{{paymentInfo.ali_sub_merchant_id||'Not Configure'}}
<a role="button" ng-click="ctrl.editAliSubMerchant=true" ng-if="'10'|withRole"><i class="fa fa-edit"></i></a>
</p>
<div class="input-group" ng-if="ctrl.editAliSubMerchant">
<input type="text" class="form-control" ng-model="paymentInfo.ali_sub_merchant_id"
title="Ali Sub Merchant Id">
<div class="input-group-btn">
<button class="btn btn-success" ng-click="saveAliSubMerchantId()">
<i class="fa fa-check"></i>
</button>
</div>
<div class="input-group-btn">
<button class="btn btn-danger" ng-click="ctrl.editAliSubMerchant=false">
<i class="fa fa-remove"></i>
</button>
</div>
</div>
</div>
</div>
<div class="form-group" ng-if="'10'|withRole">
<label class="col-sm-3 control-label">Common Sub Merchant Id</label>
<div class="col-xs-9">
@ -255,6 +278,12 @@
<input type="checkbox" ng-model="paymentInfo.gateway_upgrade" bs-switch switch-change="toggleGatewayUpgrade()">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Enable Alipay Online</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.gateway_alipay_online" bs-switch switch-change="toggleGatewayAlipayOnline()">
</div>
</div>
<div class="form-group" ng-if="'api_surcharge'|withFunc">
<label class="col-sm-2 control-label">Customer Pay for Surcharge On Gateway</label>
<div class="col-sm-10">

Loading…
Cancel
Save