feat(用户身份状态管理): 成员移出组织/项目,原指派给这个成员的工作项/其他该怎么显示
新增远程接口:根据部门Id和用户Id获取所有状态的用户身份
This commit is contained in:
parent
9b8560a33a
commit
e173dbbd8c
|
|
@ -213,4 +213,17 @@ public interface RemoteUserService {
|
|||
R<Set<String>> selectMenuPermissionByRoleKey(@PathVariable("roleKey") String roleKey
|
||||
, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
/**
|
||||
* 根据部门Id和用户Id获取所有状态的用户身份
|
||||
*
|
||||
* @param deptId 组织Id
|
||||
* @param userId 用户Id
|
||||
* @param source 请求来源
|
||||
* @return 用户身份
|
||||
*/
|
||||
@GetMapping("/SysUserDeptRole/dept/{deptId}/user/{userId}/allStatus")
|
||||
R<SysUserDeptRole> getAllStatusUserIdentityByDeptIdAndUserId(
|
||||
@PathVariable("deptId") Long deptId,
|
||||
@PathVariable("userId") Long userId,
|
||||
@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,6 +117,11 @@ public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserServ
|
|||
public R<Set<String>> selectMenuPermissionByRoleKey(String roleKey, String source) {
|
||||
return R.fail("根据角色Key获取菜单权限集合失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<SysUserDeptRole> getAllStatusUserIdentityByDeptIdAndUserId(Long deptId, Long userId, String source) {
|
||||
return R.fail("根据部门Id和用户Id获取所有状态的用户身份失败:" + throwable.getMessage());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,6 +99,21 @@ public class SysUserDeptRoleController extends BaseController {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* 内部接口-根据部门Id和用户Id获取所有状态的用户身份
|
||||
*
|
||||
* @param deptId 组织Id
|
||||
* @param userId 用户Id
|
||||
* @return 用户身份
|
||||
*/
|
||||
@InnerAuth
|
||||
@GetMapping("/dept/{deptId}/user/{userId}/allStatus")
|
||||
public R<SysUserDeptRole> getAllStatusUserIdentityByDeptIdAndUserId(
|
||||
@PathVariable("deptId") Long deptId,
|
||||
@PathVariable("userId") Long userId) {
|
||||
return R.ok(sysUserDeptRoleService.getAllStatusUserIdentityByDeptIdAndUserId(deptId, userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 内部接口-组织下删除用户身份
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -142,5 +142,5 @@ public interface SysUserDeptRoleMapper {
|
|||
* @param deptId 组织Id
|
||||
* @return 用户身份
|
||||
*/
|
||||
SysUserDeptRole selectUserIdentityByAllState(@Param("userId") Long userId, @Param("deptId") Long deptId);
|
||||
SysUserDeptRole selectUserIdentityByAllStatus(@Param("deptId") Long deptId, @Param("userId") Long userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -151,4 +151,6 @@ public interface ISysUserDeptRoleService {
|
|||
void updateUserLoginInfoByDeptId(Long deptId);
|
||||
|
||||
List<SysUserDeptRole> selectZoneUserIdentityListByUser(Long userId, Boolean isContainMember, String deptName, String roleName);
|
||||
|
||||
SysUserDeptRole getAllStatusUserIdentityByDeptIdAndUserId(Long deptId, Long userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -423,7 +423,7 @@ public class SysUserDeptRoleServiceImpl implements ISysUserDeptRoleService {
|
|||
private int insertUserDeptRole(SysUserDeptRole sysUserDeptRoleInput) {
|
||||
int success = 0;
|
||||
SysUserDeptRole sysUserDeptRole =
|
||||
sysUserDeptRoleMapper.selectUserIdentityByAllState(sysUserDeptRoleInput.getUserId(), sysUserDeptRoleInput.getDeptId());
|
||||
sysUserDeptRoleMapper.selectUserIdentityByAllStatus(sysUserDeptRoleInput.getDeptId(), sysUserDeptRoleInput.getUserId());
|
||||
if (sysUserDeptRole == null) {
|
||||
success += insertSysUserDeptRoleDatabase(sysUserDeptRoleInput);
|
||||
updateUserGitLinkRole(
|
||||
|
|
@ -599,6 +599,11 @@ public class SysUserDeptRoleServiceImpl implements ISysUserDeptRoleService {
|
|||
return sysUserDeptRoleList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysUserDeptRole getAllStatusUserIdentityByDeptIdAndUserId(Long deptId, Long userId) {
|
||||
return sysUserDeptRoleMapper.selectUserIdentityByAllStatus(deptId, userId);
|
||||
}
|
||||
|
||||
private SysUser selectSysUserById(Long userId) {
|
||||
SysUser sysUser = sysUserMapper.selectUserById(userId);
|
||||
if (sysUser == null) {
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@
|
|||
WHERE role_id = #{roleId}
|
||||
and state = 'normal'
|
||||
</select>
|
||||
<select id="selectUserIdentityByAllState"
|
||||
<select id="selectUserIdentityByAllStatus"
|
||||
resultMap="SysUserDeptRoleResult">
|
||||
<include refid="selectSysUserDeptRoleDetailVo"/>
|
||||
<where>
|
||||
|
|
|
|||
Loading…
Reference in New Issue