|
|
@@ -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);
|