|
@@ -555,6 +555,11 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
if (userId == null || userId == 0) {
|
|
if (userId == null || userId == 0) {
|
|
throw ExceptionResultEnum.ERROR.exception("无法获取当前登录人id");
|
|
throw ExceptionResultEnum.ERROR.exception("无法获取当前登录人id");
|
|
}
|
|
}
|
|
|
|
+ SysUser sysUser = this.getById(userId);
|
|
|
|
+ if (Objects.isNull(sysUser)) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("缺少用户信息");
|
|
|
|
+ }
|
|
|
|
+
|
|
List<SysRole> sysRoleList = sysUserRoleService.listRoleByUserId(userId);
|
|
List<SysRole> sysRoleList = sysUserRoleService.listRoleByUserId(userId);
|
|
List<RoleTypeEnum> roleTypeList = sysRoleList.stream().map(SysRole::getType).distinct().collect(Collectors.toList());
|
|
List<RoleTypeEnum> roleTypeList = sysRoleList.stream().map(SysRole::getType).distinct().collect(Collectors.toList());
|
|
DataPermissionDto dto = new DataPermissionDto();
|
|
DataPermissionDto dto = new DataPermissionDto();
|
|
@@ -571,6 +576,14 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
dto.setHasAccountManager(roleTypeList.contains(RoleTypeEnum.ACCOUNT_MANAGER));
|
|
dto.setHasAccountManager(roleTypeList.contains(RoleTypeEnum.ACCOUNT_MANAGER));
|
|
dto.setHasThirdPmo(roleTypeList.contains(RoleTypeEnum.THIRD_PMO));
|
|
dto.setHasThirdPmo(roleTypeList.contains(RoleTypeEnum.THIRD_PMO));
|
|
dto.setHasDeviceDelivery(roleTypeList.contains(RoleTypeEnum.DEVICE_DELIVERY));
|
|
dto.setHasDeviceDelivery(roleTypeList.contains(RoleTypeEnum.DEVICE_DELIVERY));
|
|
|
|
+ if (dto.getHasThirdPmo() || dto.getHasDeviceDelivery()) {
|
|
|
|
+ Long supplierId = sysUser.getSupplierId();
|
|
|
|
+ if (supplierId == null || supplierId == 0) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception(
|
|
|
|
+ String.format("包含[%s]或[%s]角色的用户,请先联系管理员在用户管理中绑定该用户所管辖的供应商.", RoleTypeEnum.THIRD_PMO.getDesc(),
|
|
|
|
+ RoleTypeEnum.DEVICE_DELIVERY.getDesc()));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
return dto;
|
|
return dto;
|
|
}
|
|
}
|
|
|
|
|