-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bug]: 人员信息在某些情况下“部门(含上级)”字段计算错误 #6646
- Loading branch information
Showing
1 changed file
with
5 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
/* | ||
* @Author: [email protected] | ||
* @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: [ | ||
|