|
@@ -1,6 +1,7 @@
|
|
|
package com.imed.costaccount.service.impl;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.imed.costaccount.common.util.PageUtils;
|
|
|
import com.imed.costaccount.mapper.UserRoleMapper;
|
|
@@ -65,8 +66,11 @@ public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> i
|
|
|
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Throwable.class)
|
|
|
public void saveRoleUser(RoleUserDTO roleUserDTO, Long hospId) {
|
|
|
Long roleId = roleUserDTO.getRoleId();
|
|
|
- this.removeById(roleId);
|
|
|
+// this.removeById(roleId);
|
|
|
List<Long> userIds = roleUserDTO.getUserIds();
|
|
|
+ this.remove(
|
|
|
+ new LambdaQueryWrapper<UserRole>().in(UserRole::getUserId, userIds).eq(UserRole::getRoleId, roleId)
|
|
|
+ );
|
|
|
if (CollUtil.isNotEmpty(userIds)) {
|
|
|
List<UserRole> userRoles = userIds.stream().map(i -> {
|
|
|
UserRole userRole = new UserRole();
|