Browse Source

给用户设置岗位时,不给该用户增加部门关系

dzx 6 months ago
parent
commit
ae7236491f

+ 9 - 9
src/main/java/com/xjrsoft/module/organization/service/impl/UserPostRelationServiceImpl.java

@@ -87,15 +87,15 @@ public class UserPostRelationServiceImpl extends ServiceImpl<UserPostRelationMap
         List<Long> containList = list.stream().map(UserDeptRelation::getUserId).filter(u -> finalUserIds.contains(u)).collect(Collectors.toList());
         //拿userIds和userIdList的差集
         List<Long> subtractList = (List<Long>) CollectionUtil.subtract(userIds, containList);
-        if (subtractList.size() > 0) {
-            for (Long userId : subtractList) {
-                UserDeptRelation userDeptRelation = new UserDeptRelation();
-                userDeptRelation.setUserId(userId);
-                userDeptRelation.setDeptId(deptId);
-                userDeptRelationList.add(userDeptRelation);
-            }
-            userDeptRelationService.saveBatch(userDeptRelationList);
-        }
+//        if (!subtractList.isEmpty()) {
+//            for (Long userId : subtractList) {
+//                UserDeptRelation userDeptRelation = new UserDeptRelation();
+//                userDeptRelation.setUserId(userId);
+//                userDeptRelation.setDeptId(deptId);
+//                userDeptRelationList.add(userDeptRelation);
+//            }
+//            userDeptRelationService.saveBatch(userDeptRelationList);
+//        }
 
         List<Long> finalUserIds1 = userIds;
         finalUserIds1.addAll(userIdList);