From 4fa62f182223a472e513409ec7c2d6a4eb8ad58b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E6=B5=A9=E6=9E=97?= Date: Fri, 19 Apr 2024 11:52:13 +0800 Subject: [PATCH] =?UTF-8?q?[Bug]:=20=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=9C=A8=E6=9F=90=E4=BA=9B=E6=83=85=E5=86=B5=E4=B8=8B=E2=80=9C?= =?UTF-8?q?=E9=83=A8=E9=97=A8(=E5=90=AB=E4=B8=8A=E7=BA=A7)=E2=80=9D?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E8=AE=A1=E7=AE=97=E9=94=99=E8=AF=AF=20#6646?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/default/triggers/organizations.trigger.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/services/standard-space/main/default/triggers/organizations.trigger.js b/services/standard-space/main/default/triggers/organizations.trigger.js index 05b5cd18a5..e62b4e9988 100644 --- a/services/standard-space/main/default/triggers/organizations.trigger.js +++ b/services/standard-space/main/default/triggers/organizations.trigger.js @@ -1,8 +1,8 @@ /* * @Author: sunhaolin@hotoa.com * @Date: 2022-12-06 15:30:08 - * @LastEditors: sunhaolin@hotoa.com - * @LastEditTime: 2023-03-28 16:50:27 + * @LastEditors: 孙浩林 sunhaolin@steedos.com + * @LastEditTime: 2024-04-19 10:45:22 * @Description: */ "use strict"; @@ -273,8 +273,7 @@ module.exports = { const afterUpdateDoc = await orgObj.findOne(id) var added_space_users, added_users, children, newParent, new_users, obj, oldParent, old_users, removed_space_users, removed_users, rootOrg, sUser, updateFields, updatedDoc; updateFields = {}; - obj = orgObj.findOne(id); - if (obj.parent) { + if (afterUpdateDoc.parent) { updateFields.parents = await broker.call('organizations.calculateParents', { orgId: id }) } if (doc.parent) { @@ -406,6 +405,8 @@ module.exports = { ], fields: ['_id'] }); + // 考虑本组织的人员 + children.push(afterUpdateDoc) for (const child of children) { let childUsers = await suObj.find({ filters: [