update revert partner

master
luoyang 6 years ago
parent bef28c176e
commit 4d1e4b3aa1

@ -222,6 +222,8 @@ public interface ClientManager {
void disableClient(String clientMoniker, JSONObject manager);
void revertClient(String clientMoniker, JSONObject manager);
JSONObject getAuthFiles(JSONObject manager, String clientMoniker);
void uploadAuthFiles(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo);

@ -2636,6 +2636,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientModifySupport.processClientModify(new DisableModify(manager, clientMoniker, false));
}
@Override
public void revertClient(String clientMoniker, JSONObject manager) {
JSONObject client = clientDetail(manager, clientMoniker);
Assert.notEmpty(client);
clientModifySupport.processClientModify(new DisableModify(manager, clientMoniker, true));
}
@Override
public void checkTodo(JSONObject manager, List<TodoNotice> notices) {
if (ManagerRole.OPERATOR.hasRole(manager.getIntValue("role"))) {

@ -66,6 +66,11 @@ public class PartnerManageController {
clientManager.disableClient(clientMoniker, manager);
}
@ManagerMapping(value = "/{clientMoniker}/revert", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR})
public void revertClient(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.revertClient(clientMoniker, manager);
}
@ManagerMapping(value = "/{clientMoniker}/qrcode", method = RequestMethod.GET)
public JSONObject getQrCodeImg(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, QRCodeConfig config) {
return clientManager.getQRCode(manager, clientMoniker, config);

@ -763,6 +763,19 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
})
})
};
$scope.revertClient = function () {
commonDialog.confirm({
title: 'Revert Partner',
content: 'Are you sure to Revert ' + $scope.partner.company_name + '?'
}).then(function () {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/revert').then(function () {
$state.go('^');
commonDialog.alert({title: 'Revert', content: 'Partner Already Revert', type: 'success'});
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
})
};
$scope.commitToCompliance = function () {
commonDialog.confirm({

@ -78,6 +78,7 @@
</b>
<span ng-if="partner.is_valid==0" ng-class="{pass_timeout:partner.is_valid==0}">(已禁用)</span>
</h3>
<button ng-if="!partner.is_valid" type="button" class="btn btn-success" style="float:right;" ng-click="revertClient()">Revert</button>
</div>
<div class="box-body" ng-if="partner.is_valid==1">
<div ng-if="partner.open_status != 5 && partner.open_status!=10">

Loading…
Cancel
Save