master
lujian 6 years ago
parent e576c675fd
commit ebaf807d23

@ -9,4 +9,6 @@ public interface ManagerWechatBindService {
JSONObject newBindRequest(String managerId);
void bindWechatUser(String bindId, String openid);
JSONObject removeBindWechat(String managerId);
}

@ -71,6 +71,14 @@ public class ManagerWechatBindServiceImpl implements ManagerWechatBindService,Ap
publisher.publishEvent(new CommonPageEvent(this, bindId, "manager_bind_success",manager));
}
@Override
public JSONObject removeBindWechat(String managerId) {
JSONObject manager = managerMapper.findById(managerId);
manager.put("wx_openid", null);
managerMapper.update(manager);
return managerMapper.findById(managerId);
}
private void setOpenId(String managerId, String openId) {
JSONObject manager = new JSONObject();
manager.put("manager_id", managerId);

@ -1,6 +1,7 @@
package au.com.royalpay.payment.manage.signin.web;
import au.com.royalpay.payment.manage.permission.manager.RequireManager;
import au.com.royalpay.payment.manage.signin.beans.ManagerInfo;
import au.com.royalpay.payment.manage.signin.core.ManagerWechatBindService;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.connections.mpsupport.beans.WxOauthType;
@ -32,4 +33,11 @@ public class ManagerWechatBindController {
public JSONObject newBindRequest(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return managerWechatBindService.newBindRequest(manager.getString("manager_id"));
}
@PutMapping(value = "/remove/{manager_id}")
@ResponseBody
public JSONObject removeBind(@PathVariable("manager_id") String managerId) {
return managerWechatBindService.removeBindWechat(managerId);
}
}

@ -15,7 +15,7 @@
m.org_id,
m.display_name,
m.username,m.role,m.is_valid,m.create_time,m.last_login,o.name org_name,
m.email,m.phone,m.wechat,
m.email,m.phone,m.wechat,m.wx_openid,
co.headimg,
co.nickname,
o.parent_org_id

@ -71,6 +71,14 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
}).result.then(function () {
$scope.listManagers();
})
};
$scope.removeWechatBind = function (manager) {
$http.put('/system/manager_wechat_binds/remove/' + manager.manager_id).then(function () {
console.log(manager)
$scope.listManagers();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
})
}
}]);
app.controller('modifyManagerDialogCtrl', ['$scope', '$http', 'manager', function ($scope, $http, manager) {

@ -96,7 +96,11 @@
<tr ng-repeat="manager in managers">
<td ng-bind="manager.username"></td>
<td ng-bind="manager.display_name"></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow:ellipsis;"><img ng-src="{{manager.headimg}}" style="height: 30px;width:30px;" class="img-circle" ng-if="manager.headimg"> {{manager.nickname}}</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow:ellipsis;">
<img ng-src="{{manager.headimg}}" style="height: 30px;width:30px;" class="img-circle" ng-if="manager.headimg">
{{manager.nickname}}
<i role="button" class="fa fa-remove text-danger" ng-if="manager.headimg" title="Unbind" ng-click="removeWechatBind(manager)"></i>
</td>
<td ng-bind="manager.create_time|date:'yyyy-MM-dd'"></td>
<td ng-bind="manager.email"></td>
<td ng-bind="manager.org_name"></td>

Loading…
Cancel
Save