提交 9bd15aa8 编写于 作者: S shiziyuan9527

管理员只能修改成员角色信息 backend

上级 31102c3b
......@@ -53,7 +53,7 @@ public class WorkspaceController {
@PostMapping("special/update")
@RequiresRoles(RoleConstants.ADMIN)
public void updateWorkspaceByAdmin(@RequestBody Workspace workspace) {
workspaceService.updateWorkspacebyAdmin(workspace);
workspaceService.updateWorkspaceByAdmin(workspace);
}
@GetMapping("special/delete/{workspaceId}")
......
......@@ -109,12 +109,8 @@ public class OrganizationService {
}
public void updateOrgMember(OrganizationMemberDTO memberDTO) {
User user = new User();
BeanUtils.copyProperties(memberDTO, user);
userMapper.updateByPrimaryKeySelective(user);
//
String orgId = memberDTO.getOrganizationId();
String userId = user.getId();
String userId = memberDTO.getId();
// 已有角色
List<Role> memberRoles = extUserRoleMapper.getOrganizationMemberRoles(orgId, userId);
// 修改后的角色
......
......@@ -22,6 +22,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
......@@ -200,12 +201,8 @@ public class WorkspaceService {
}
public void updateWorkspaceMember(WorkspaceMemberDTO memberDTO) {
User user = new User();
BeanUtils.copyProperties(memberDTO, user);
userMapper.updateByPrimaryKeySelective(user);
//
String workspaceId = memberDTO.getWorkspaceId();
String userId = user.getId();
String userId = memberDTO.getId();
// 已有角色
List<Role> memberRoles = extUserRoleMapper.getWorkspaceMemberRoles(workspaceId, userId);
// 修改后的角色
......@@ -234,11 +231,11 @@ public class WorkspaceService {
}
}
public Integer checkSourceRole(String orgId, String userId, String roleId) {
return extOrganizationMapper.checkSourceRole(orgId, userId, roleId);
public Integer checkSourceRole(String workspaceId, String userId, String roleId) {
return extOrganizationMapper.checkSourceRole(workspaceId, userId, roleId);
}
public void updateWorkspacebyAdmin(Workspace workspace) {
public void updateWorkspaceByAdmin(Workspace workspace) {
workspace.setCreateTime(null);
workspace.setUpdateTime(System.currentTimeMillis());
workspaceMapper.updateByPrimaryKeySelective(workspace);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册