mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
Merge branch 'main' of ssh://192.168.1.205:9922/cf_devdept2/cf_imes_server
This commit is contained in:
+1
-1
@@ -159,7 +159,7 @@
|
|||||||
join order_body ob on oi.body_id = ob.id and oi.organ_id = ob.organ_id
|
join order_body ob on oi.body_id = ob.id and oi.organ_id = ob.organ_id
|
||||||
left join order_group og on oi.group_id = og.id and ob.organ_id = og.organ_id
|
left join order_group og on oi.group_id = og.id and ob.organ_id = og.organ_id
|
||||||
where
|
where
|
||||||
oi.order_id = #{orderNo} and oi.organ_id = #{organId}
|
oi.order_id = #{orderNo} and oi.organ_id = #{organId} and oi.package_id = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+8
-9
@@ -346,19 +346,13 @@ public class PermissionServiceImpl implements PermissionService {
|
|||||||
}
|
}
|
||||||
// 前端没传或者查一次后切换了组织导致跟角色组织不一致的统一为角色的组织
|
// 前端没传或者查一次后切换了组织导致跟角色组织不一致的统一为角色的组织
|
||||||
Long roleOrganId = role.getOrganId();
|
Long roleOrganId = role.getOrganId();
|
||||||
if (Objects.isNull(organId) || ObjectUtil.notEqual(roleOrganId, organId)) {
|
boolean isOrganRole = Objects.equals(roleId, InternalRoleConstants.ORGAN_ADMIN_ROLE_ID) || Objects.equals(roleId, InternalRoleConstants.ORGAN_STAFF_ROLE_ID);
|
||||||
|
// 内置角色还是按照机构来存
|
||||||
|
if (!isOrganRole && (Objects.isNull(organId) || ObjectUtil.notEqual(roleOrganId, organId))) {
|
||||||
organId = roleOrganId;
|
organId = roleOrganId;
|
||||||
}
|
}
|
||||||
final Long finalOrganId = organId;
|
final Long finalOrganId = organId;
|
||||||
|
|
||||||
// 当前用户不能操作含有自己的角色
|
|
||||||
if (CollectionUtil.isNotEmpty(userIds)) {
|
|
||||||
Long incloudSelf = userIds.stream().filter(userId -> userId.equals(loginUser.getId())).findAny().orElse(null);
|
|
||||||
if (incloudSelf != null) {
|
|
||||||
throw new ServiceException(ROLE_ME_ERROR);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获得角色下的角色用户列表
|
// 获得角色下的角色用户列表
|
||||||
Set<Long> roleUserIds = convertSet(userRoleMapper.selectList(new LambdaQueryWrapperX<UserRoleDO>()
|
Set<Long> roleUserIds = convertSet(userRoleMapper.selectList(new LambdaQueryWrapperX<UserRoleDO>()
|
||||||
.eqIfPresent(UserRoleDO::getOrganId, organId)
|
.eqIfPresent(UserRoleDO::getOrganId, organId)
|
||||||
@@ -378,6 +372,11 @@ public class PermissionServiceImpl implements PermissionService {
|
|||||||
// 筛选要删除的userRole:前端没有,数据库有
|
// 筛选要删除的userRole:前端没有,数据库有
|
||||||
Collection<Long> deleteRoleUserIds = CollUtil.subtract(roleUserIds, userIds);
|
Collection<Long> deleteRoleUserIds = CollUtil.subtract(roleUserIds, userIds);
|
||||||
if (!CollectionUtil.isEmpty(deleteRoleUserIds)) {
|
if (!CollectionUtil.isEmpty(deleteRoleUserIds)) {
|
||||||
|
// 当前用户不能移除自身的角色
|
||||||
|
Long incloudSelf = deleteRoleUserIds.stream().filter(userId -> userId.equals(loginUser.getId())).findAny().orElse(null);
|
||||||
|
if (incloudSelf != null) {
|
||||||
|
throw new ServiceException(ROLE_ME_ERROR);
|
||||||
|
}
|
||||||
userRoleMapper.deleteListByRoleIdAndUserIds(roleId, deleteRoleUserIds);
|
userRoleMapper.deleteListByRoleIdAndUserIds(roleId, deleteRoleUserIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user