Skip to content

Commit

Permalink
[Bug]: 人员信息在某些情况下“部门(含上级)”字段计算错误 #6646
Browse files Browse the repository at this point in the history
  • Loading branch information
sunhaolin committed Jul 29, 2024
1 parent 2ce4e20 commit 4fa62f1
Showing 1 changed file with 5 additions and 4 deletions.
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";
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -406,6 +405,8 @@ module.exports = {
],
fields: ['_id']
});
// 考虑本组织的人员
children.push(afterUpdateDoc)
for (const child of children) {
let childUsers = await suObj.find({
filters: [
Expand Down

0 comments on commit 4fa62f1

Please sign in to comment.