From 6bd0e158776b43d66deca68d1df60451d856a934 Mon Sep 17 00:00:00 2001 From: Bright Date: Wed, 5 Feb 2025 09:26:12 +0700 Subject: [PATCH 1/6] add field rootDnaId --- src/controllers/CommandController.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index 56a93020..4f765f16 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -4863,7 +4863,8 @@ export class CommandController extends Controller { citizenId: profile.citizenId, root: posMaster.orgRoot.orgRootName, rootId: posMaster.orgRootId, - rootShortName: posMaster.orgRoot.orgRootShortName + rootShortName: posMaster.orgRoot.orgRootShortName, + rootDnaId: posMaster.orgRoot.ancestorDNA, }); await this.profileEmployeeRepository.save(profile); await this.employeePositionRepository.save(positionNew); From 4aae619e90ad104a656ea122b13194340e838050 Mon Sep 17 00:00:00 2001 From: kittapath Date: Wed, 5 Feb 2025 09:31:57 +0700 Subject: [PATCH 2/6] no message --- src/controllers/OrganizationController.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/controllers/OrganizationController.ts b/src/controllers/OrganizationController.ts index edb35874..dd212d5f 100644 --- a/src/controllers/OrganizationController.ts +++ b/src/controllers/OrganizationController.ts @@ -5520,6 +5520,7 @@ export class OrganizationController extends Controller { data1 = _data1.map((y) => ({ name: y.orgRootName, rootId: y.id, + rootDnaId: y.ancestorDNA, child1Id: null, child2Id: null, child3Id: null, @@ -5528,6 +5529,7 @@ export class OrganizationController extends Controller { data2 = _data2.map((y) => ({ name: y.orgRootName, rootId: y.id, + rootDnaId: y.ancestorDNA, child1Id: null, child2Id: null, child3Id: null, @@ -5589,6 +5591,7 @@ export class OrganizationController extends Controller { data1 = _data1.map((y) => ({ name: y.orgRootName, rootId: y.id, + rootDnaId: y.ancestorDNA, child1Id: null, child2Id: null, child3Id: null, @@ -5597,6 +5600,7 @@ export class OrganizationController extends Controller { data2 = _data2.map((y) => ({ name: y.orgRootName, rootId: y.id, + rootDnaId: y.ancestorDNA, child1Id: null, child2Id: null, child3Id: null, From b0b1e06a782b1c5ae6d847bd835845fa7f64126d Mon Sep 17 00:00:00 2001 From: kittapath Date: Wed, 5 Feb 2025 15:38:21 +0700 Subject: [PATCH 3/6] add dna --- src/controllers/CommandController.ts | 12 +- src/controllers/OrganizationController.ts | 296 ++++++++++++++++-- src/controllers/ProfileController.ts | 35 +++ src/controllers/ProfileEmployeeController.ts | 40 +++ .../ProfileEmployeeTempController.ts | 5 + 5 files changed, 350 insertions(+), 38 deletions(-) diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index 4f765f16..e8bf6f17 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -4749,7 +4749,7 @@ export class CommandController extends Controller { const posMaster = await this.employeePosMasterRepository.findOne({ where: { id: profile.posmasterIdTemp }, - relations: ["orgRoot"], + relations: ["orgRoot", "orgChild1", "orgChild2", "orgChild3", "orgChild4"], }); if (posMaster == null) throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งนี้"); @@ -4865,6 +4865,10 @@ export class CommandController extends Controller { rootId: posMaster.orgRootId, rootShortName: posMaster.orgRoot.orgRootShortName, rootDnaId: posMaster.orgRoot.ancestorDNA, + child1DnaId: posMaster.orgChild1.ancestorDNA, + child2DnaId: posMaster.orgChild2.ancestorDNA, + child3DnaId: posMaster.orgChild3.ancestorDNA, + child4DnaId: posMaster.orgChild4.ancestorDNA, }); await this.profileEmployeeRepository.save(profile); await this.employeePositionRepository.save(positionNew); @@ -4872,9 +4876,9 @@ export class CommandController extends Controller { }), ); await new CallAPI() - .PostData(req, - "/placement/appointment/employee-appoint-21/report/excecute", { profileEmps: _reqBody } - ) + .PostData(req, "/placement/appointment/employee-appoint-21/report/excecute", { + profileEmps: _reqBody, + }) .catch((error) => { throw new Error("Failed. Cannot update status. ", error); }); diff --git a/src/controllers/OrganizationController.ts b/src/controllers/OrganizationController.ts index dd212d5f..57e96829 100644 --- a/src/controllers/OrganizationController.ts +++ b/src/controllers/OrganizationController.ts @@ -5522,45 +5522,273 @@ export class OrganizationController extends Controller { rootId: y.id, rootDnaId: y.ancestorDNA, child1Id: null, + child1DnaId: null, child2Id: null, + child2DnaId: null, child3Id: null, + child3DnaId: null, child4Id: null, + child4DnaId: null, })); data2 = _data2.map((y) => ({ name: y.orgRootName, rootId: y.id, rootDnaId: y.ancestorDNA, child1Id: null, + child1DnaId: null, child2Id: null, + child2DnaId: null, child3Id: null, + child3DnaId: null, child4Id: null, + child4DnaId: null, + })); + break; + } + case 1: { + const _data1 = await this.child1Repository.find({ + where: { + id: requestBody.nodeId ?? "", + orgRoot: { + orgRootRankSub: In(orgRootRankSub1), + }, + }, + order: { + orgRoot: { orgRootOrder: "ASC" }, + }, + relations: ["orgRoot"], + }); + const _data2 = await this.child1Repository.find({ + where: [ + { + id: requestBody.nodeId ?? "", + orgRoot: { + orgRootRankSub: In(orgRootRankSub2), + }, + }, + { + id: requestBody.nodeId ?? "", + orgRoot: { + orgRootRankSub: IsNull(), + }, + }, + ], + order: { + orgRoot: { orgRootOrder: "ASC" }, + }, + relations: ["orgRoot"], + }); + data1 = _data1.map((y) => ({ + name: y.orgRoot.orgRootName, + rootId: y.orgRoot.id, + rootDnaId: y.orgRoot.ancestorDNA, + child1Id: y.id, + child1DnaId: y.ancestorDNA, + child2Id: null, + child2DnaId: null, + child3Id: null, + child3DnaId: null, + child4Id: null, + child4DnaId: null, + })); + data2 = _data2.map((y) => ({ + name: y.orgRoot.orgRootName, + rootId: y.orgRoot.id, + rootDnaId: y.orgRoot.ancestorDNA, + child1Id: y.id, + child1DnaId: y.ancestorDNA, + child2Id: null, + child2DnaId: null, + child3Id: null, + child3DnaId: null, + child4Id: null, + child4DnaId: null, + })); + break; + } + case 2: { + const _data1 = await this.child2Repository.find({ + where: { + id: requestBody.nodeId ?? "", + orgRoot: { + orgRootRankSub: In(orgRootRankSub1), + }, + }, + order: { + orgRoot: { orgRootOrder: "ASC" }, + }, + relations: ["orgRoot", "orgChild1"], + }); + const _data2 = await this.child2Repository.find({ + where: [ + { + id: requestBody.nodeId ?? "", + orgRoot: { + orgRootRankSub: In(orgRootRankSub2), + }, + }, + { + id: requestBody.nodeId ?? "", + orgRoot: { + orgRootRankSub: IsNull(), + }, + }, + ], + order: { + orgRoot: { orgRootOrder: "ASC" }, + }, + relations: ["orgRoot", "orgChild1"], + }); + data1 = _data1.map((y) => ({ + name: y.orgRoot.orgRootName, + rootId: y.orgRoot.id, + rootDnaId: y.orgRoot.ancestorDNA, + child1Id: y.orgChild1.id, + child1DnaId: y.orgChild1.ancestorDNA, + child2Id: y.id, + child2DnaId: y.ancestorDNA, + child3Id: null, + child3DnaId: null, + child4Id: null, + child4DnaId: null, + })); + data2 = _data2.map((y) => ({ + name: y.orgRoot.orgRootName, + rootId: y.orgRoot.id, + rootDnaId: y.orgRoot.ancestorDNA, + child1Id: y.orgChild1.id, + child1DnaId: y.orgChild1.ancestorDNA, + child2Id: y.id, + child2DnaId: y.ancestorDNA, + child3Id: null, + child3DnaId: null, + child4Id: null, + child4DnaId: null, + })); + break; + } + case 3: { + const _data1 = await this.child3Repository.find({ + where: { + id: requestBody.nodeId ?? "", + orgRoot: { + orgRootRankSub: In(orgRootRankSub1), + }, + }, + order: { + orgRoot: { orgRootOrder: "ASC" }, + }, + relations: ["orgRoot", "orgChild1", "orgChild2"], + }); + const _data2 = await this.child3Repository.find({ + where: [ + { + id: requestBody.nodeId ?? "", + orgRoot: { + orgRootRankSub: In(orgRootRankSub2), + }, + }, + { + id: requestBody.nodeId ?? "", + orgRoot: { + orgRootRankSub: IsNull(), + }, + }, + ], + order: { + orgRoot: { orgRootOrder: "ASC" }, + }, + relations: ["orgRoot", "orgChild1", "orgChild2"], + }); + data1 = _data1.map((y) => ({ + name: y.orgRoot.orgRootName, + rootId: y.orgRoot.id, + rootDnaId: y.orgRoot.ancestorDNA, + child1Id: y.orgChild1.id, + child1DnaId: y.orgChild1.ancestorDNA, + child2Id: y.orgChild2.id, + child2DnaId: y.orgChild2.ancestorDNA, + child3Id: y.id, + child3DnaId: y.ancestorDNA, + child4Id: null, + child4DnaId: null, + })); + data2 = _data2.map((y) => ({ + name: y.orgRoot.orgRootName, + rootId: y.orgRoot.id, + rootDnaId: y.orgRoot.ancestorDNA, + child1Id: y.orgChild1.id, + child1DnaId: y.orgChild1.ancestorDNA, + child2Id: y.orgChild2.id, + child2DnaId: y.orgChild2.ancestorDNA, + child3Id: y.id, + child3DnaId: y.ancestorDNA, + child4Id: null, + child4DnaId: null, + })); + break; + } + case 4: { + const _data1 = await this.child4Repository.find({ + where: { + id: requestBody.nodeId ?? "", + orgRoot: { + orgRootRankSub: In(orgRootRankSub1), + }, + }, + order: { + orgRoot: { orgRootOrder: "ASC" }, + }, + relations: ["orgRoot", "orgChild1", "orgChild2", "orgChild3"], + }); + const _data2 = await this.child4Repository.find({ + where: [ + { + id: requestBody.nodeId ?? "", + orgRoot: { + orgRootRankSub: In(orgRootRankSub2), + }, + }, + { + id: requestBody.nodeId ?? "", + orgRoot: { + orgRootRankSub: IsNull(), + }, + }, + ], + order: { + orgRoot: { orgRootOrder: "ASC" }, + }, + relations: ["orgRoot", "orgChild1", "orgChild2", "orgChild3"], + }); + data1 = _data1.map((y) => ({ + name: y.orgRoot.orgRootName, + rootId: y.orgRoot.id, + rootDnaId: y.orgRoot.ancestorDNA, + child1Id: y.orgChild1.id, + child1DnaId: y.orgChild1.ancestorDNA, + child2Id: y.orgChild2.id, + child2DnaId: y.orgChild2.ancestorDNA, + child3Id: y.orgChild3.id, + child3DnaId: y.orgChild3.ancestorDNA, + child4Id: y.id, + child4DnaId: y.ancestorDNA, + })); + data2 = _data2.map((y) => ({ + name: y.orgRoot.orgRootName, + rootId: y.orgRoot.id, + rootDnaId: y.orgRoot.ancestorDNA, + child1Id: y.orgChild1.id, + child1DnaId: y.orgChild1.ancestorDNA, + child2Id: y.orgChild2.id, + child2DnaId: y.orgChild2.ancestorDNA, + child3Id: y.orgChild3.id, + child3DnaId: y.orgChild3.ancestorDNA, + child4Id: y.id, + child4DnaId: y.ancestorDNA, })); break; } - // case 1: { - // const data = await this.child1Repository.find({ - // where: { id: requestBody.nodeId }, - // }); - // return new HttpSuccess(data); - // } - // case 2: { - // const data = await this.child2Repository.find({ - // where: { id: requestBody.nodeId }, - // }); - // return new HttpSuccess(data); - // } - // case 3: { - // const data = await this.child3Repository.find({ - // where: { id: requestBody.nodeId }, - // }); - // return new HttpSuccess(data); - // } - // case 4: { - // const data = await this.child4Repository.find({ - // where: { id: requestBody.nodeId }, - // }); - // return new HttpSuccess(data); - // } default: { const orgRevision = await this.orgRevisionRepository.findOne({ where: { @@ -5646,7 +5874,7 @@ export class OrganizationController extends Controller { } return new HttpSuccess({ rootId: data.orgRootId, - rootDnaId: data.ancestorDNA, + rootDnaId: data.orgRoot == null ? null : data.orgRoot.ancestorDNA, root: data.orgRoot == null ? null : data.orgRoot.orgRootName, rootShortName: data.orgRoot == null ? null : data.orgRoot.orgRootShortName, child1Id: data.id, @@ -5668,11 +5896,11 @@ export class OrganizationController extends Controller { } return new HttpSuccess({ rootId: data.orgRootId, - rootDnaId: data.ancestorDNA, + rootDnaId: data.orgRoot == null ? null : data.orgRoot.ancestorDNA, root: data.orgRoot == null ? null : data.orgRoot.orgRootName, rootShortName: data.orgRoot == null ? null : data.orgRoot.orgRootShortName, child1Id: data.orgChild1Id, - child1DnaId: data.ancestorDNA, + child1DnaId: data.orgChild1 == null ? null : data.orgChild1.ancestorDNA, child1: data.orgChild1 == null ? null : data.orgChild1.orgChild1Name, child1ShortName: data.orgChild1 == null ? null : data.orgChild1.orgChild1ShortName, child2Id: data.id, @@ -5695,15 +5923,15 @@ export class OrganizationController extends Controller { } return new HttpSuccess({ rootId: data.orgRootId, - rootDnaId: data.ancestorDNA, + rootDnaId: data.orgRoot == null ? null : data.orgRoot.ancestorDNA, root: data.orgRoot == null ? null : data.orgRoot.orgRootName, rootShortName: data.orgRoot == null ? null : data.orgRoot.orgRootShortName, child1Id: data.orgChild1Id, - child1DnaId: data.ancestorDNA, + child1DnaId: data.orgChild1 == null ? null : data.orgChild1.ancestorDNA, child1: data.orgChild1 == null ? null : data.orgChild1.orgChild1Name, child1ShortName: data.orgChild1 == null ? null : data.orgChild1.orgChild1ShortName, child2Id: data.orgChild2Id, - child2DnaId: data.ancestorDNA, + child2DnaId: data.orgChild2 == null ? null : data.orgChild2.ancestorDNA, child2: data.orgChild2 == null ? null : data.orgChild2.orgChild2Name, child2ShortName: data.orgChild2 == null ? null : data.orgChild2.orgChild2ShortName, child3Id: data.id, @@ -5727,19 +5955,19 @@ export class OrganizationController extends Controller { } return new HttpSuccess({ rootId: data.orgRootId, - rootDnaId: data.ancestorDNA, + rootDnaId: data.orgRoot == null ? null : data.orgRoot.ancestorDNA, root: data.orgRoot == null ? null : data.orgRoot.orgRootName, rootShortName: data.orgRoot == null ? null : data.orgRoot.orgRootShortName, child1Id: data.orgChild1Id, - child1DnaId: data.ancestorDNA, + child1DnaId: data.orgChild1 == null ? null : data.orgChild1.ancestorDNA, child1: data.orgChild1 == null ? null : data.orgChild1.orgChild1Name, child1ShortName: data.orgChild1 == null ? null : data.orgChild1.orgChild1ShortName, child2Id: data.orgChild2Id, - child2DnaId: data.ancestorDNA, + child2DnaId: data.orgChild2 == null ? null : data.orgChild2.ancestorDNA, child2: data.orgChild2 == null ? null : data.orgChild2.orgChild2Name, child2ShortName: data.orgChild2 == null ? null : data.orgChild2.orgChild2ShortName, child3Id: data.orgChild3Id, - child3DnaId: data.ancestorDNA, + child3DnaId: data.orgChild3 == null ? null : data.orgChild3.ancestorDNA, child3: data.orgChild3 == null ? null : data.orgChild3.orgChild3Name, child3ShortName: data.orgChild3 == null ? null : data.orgChild3.orgChild3ShortName, child4Id: data.id, diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 7418a49e..10d7c041 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -6452,18 +6452,23 @@ export class ProfileController extends Controller { posTypeId: profile.posType == null ? null : profile.posType.id, orgRevisionId: root == null ? null : root.orgRevisionId, rootId: root == null ? null : root.id, + rootDnaId: root == null ? null : root.ancestorDNA, root: root == null ? null : root.orgRootName, rootShortName: root == null ? null : root.orgRootShortName, child1Id: child1 == null ? null : child1.id, + child1DnaId: child1 == null ? null : child1.ancestorDNA, child1: child1 == null ? null : child1.orgChild1Name, child1ShortName: child1 == null ? null : child1.orgChild1ShortName, child2Id: child2 == null ? null : child2.id, + child2DnaId: child2 == null ? null : child2.ancestorDNA, child2: child2 == null ? null : child2.orgChild2Name, child2ShortName: child2 == null ? null : child2.orgChild2ShortName, child3Id: child3 == null ? null : child3.id, + child3DnaId: child3 == null ? null : child3.ancestorDNA, child3: child3 == null ? null : child3.orgChild3Name, child3ShortName: child3 == null ? null : child3.orgChild3ShortName, child4Id: child4 == null ? null : child4.id, + child4DnaId: child4 == null ? null : child4.ancestorDNA, child4: child4 == null ? null : child4.orgChild4Name, child4ShortName: child4 == null ? null : child4.orgChild4ShortName, node: null, @@ -8038,6 +8043,12 @@ export class ProfileController extends Controller { profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgRoot == null ? null : profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgRootId, + rootDnaId: + profile.current_holders == null || + profile.current_holders.find((x) => x.orgRevisionId == revisionId) == null || + profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgRoot == null + ? null + : profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.ancestorDNA, root: profile.current_holders == null || profile.current_holders.find((x) => x.orgRevisionId == revisionId) == null || @@ -8050,6 +8061,12 @@ export class ProfileController extends Controller { profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgChild1 == null ? null : profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgChild1Id, + child1DnaId: + profile.current_holders == null || + profile.current_holders.find((x) => x.orgRevisionId == revisionId) == null || + profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgChild1 == null + ? null + : profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.ancestorDNA, child1: profile.current_holders == null || profile.current_holders.find((x) => x.orgRevisionId == revisionId) == null || @@ -8063,6 +8080,12 @@ export class ProfileController extends Controller { profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgChild2 == null ? null : profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgChild2Id, + child2DnaId: + profile.current_holders == null || + profile.current_holders.find((x) => x.orgRevisionId == revisionId) == null || + profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgChild2 == null + ? null + : profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.ancestorDNA, child2: profile.current_holders == null || profile.current_holders.find((x) => x.orgRevisionId == revisionId) == null || @@ -8076,6 +8099,12 @@ export class ProfileController extends Controller { profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgChild3 == null ? null : profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgChild3Id, + child3DnaId: + profile.current_holders == null || + profile.current_holders.find((x) => x.orgRevisionId == revisionId) == null || + profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgChild3 == null + ? null + : profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.ancestorDNA, child3: profile.current_holders == null || profile.current_holders.find((x) => x.orgRevisionId == revisionId) == null || @@ -8089,6 +8118,12 @@ export class ProfileController extends Controller { profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgChild4 == null ? null : profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgChild4Id, + child4DnaId: + profile.current_holders == null || + profile.current_holders.find((x) => x.orgRevisionId == revisionId) == null || + profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgChild4 == null + ? null + : profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.ancestorDNA, child4: profile.current_holders == null || profile.current_holders.find((x) => x.orgRevisionId == revisionId) == null || diff --git a/src/controllers/ProfileEmployeeController.ts b/src/controllers/ProfileEmployeeController.ts index 7631dd4e..f48019b3 100644 --- a/src/controllers/ProfileEmployeeController.ts +++ b/src/controllers/ProfileEmployeeController.ts @@ -2242,18 +2242,23 @@ export class ProfileEmployeeController extends Controller { posExecutiveId: position == null || position.posExecutive == null ? null : position.posExecutive.id, rootId: root == null ? null : root.id, + rootDnaId: root == null ? null : root.ancestorDNA, root: root == null ? null : root.orgRootName, rootShortName: root == null ? null : root.orgRootShortName, child1Id: child1 == null ? null : child1.id, + child1DnaId: child1 == null ? null : child1.ancestorDNA, child1: child1 == null ? null : child1.orgChild1Name, child1ShortName: child1 == null ? null : child1.orgChild1ShortName, child2Id: child2 == null ? null : child2.id, + child2DnaId: child2 == null ? null : child2.ancestorDNA, child2: child2 == null ? null : child2.orgChild2Name, child2ShortName: child2 == null ? null : child2.orgChild2ShortName, child3Id: child3 == null ? null : child3.id, + child3DnaId: child3 == null ? null : child3.ancestorDNA, child3: child3 == null ? null : child3.orgChild3Name, child3ShortName: child3 == null ? null : child3.orgChild3ShortName, child4Id: child4 == null ? null : child4.id, + child4DnaId: child4 == null ? null : child4.ancestorDNA, child4: child4 == null ? null : child4.orgChild4Name, child4ShortName: child4 == null ? null : child4.orgChild4ShortName, node: null, @@ -3607,6 +3612,12 @@ export class ProfileEmployeeController extends Controller { profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgRoot == null ? null : profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgRootId, + rootDnaId: + profile.current_holders == null || + profile.current_holders.find((x) => x.orgRevisionId == revisionId) == null || + profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgRoot == null + ? null + : profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.ancestorDNA, root: profile.current_holders == null || profile.current_holders.find((x) => x.orgRevisionId == revisionId) == null || @@ -3619,6 +3630,12 @@ export class ProfileEmployeeController extends Controller { profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgChild1 == null ? null : profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgChild1Id, + child1DnaId: + profile.current_holders == null || + profile.current_holders.find((x) => x.orgRevisionId == revisionId) == null || + profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgChild1 == null + ? null + : profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.ancestorDNA, child1: profile.current_holders == null || profile.current_holders.find((x) => x.orgRevisionId == revisionId) == null || @@ -3632,6 +3649,12 @@ export class ProfileEmployeeController extends Controller { profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgChild2 == null ? null : profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgChild2Id, + child2DnaId: + profile.current_holders == null || + profile.current_holders.find((x) => x.orgRevisionId == revisionId) == null || + profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgChild2 == null + ? null + : profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.ancestorDNA, child2: profile.current_holders == null || profile.current_holders.find((x) => x.orgRevisionId == revisionId) == null || @@ -3645,6 +3668,12 @@ export class ProfileEmployeeController extends Controller { profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgChild3 == null ? null : profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgChild3Id, + child3DnaId: + profile.current_holders == null || + profile.current_holders.find((x) => x.orgRevisionId == revisionId) == null || + profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgChild3 == null + ? null + : profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.ancestorDNA, child3: profile.current_holders == null || profile.current_holders.find((x) => x.orgRevisionId == revisionId) == null || @@ -3658,6 +3687,12 @@ export class ProfileEmployeeController extends Controller { profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgChild4 == null ? null : profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgChild4Id, + child4DnaId: + profile.current_holders == null || + profile.current_holders.find((x) => x.orgRevisionId == revisionId) == null || + profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.orgChild4 == null + ? null + : profile.current_holders.find((x) => x.orgRevisionId == revisionId)?.ancestorDNA, child4: profile.current_holders == null || profile.current_holders.find((x) => x.orgRevisionId == revisionId) == null || @@ -4550,18 +4585,23 @@ export class ProfileEmployeeController extends Controller { posTypeId: profile.posType == null ? null : profile.posType.id, // posExecutiveName: "", rootId: root == null ? null : root.id, + rootDnaId: root == null ? null : root.ancestorDNA, root: root == null ? null : root.orgRootName, rootShortName: root == null ? null : root.orgRootShortName, child1Id: child1 == null ? null : child1.id, + child1DnaId: child1 == null ? null : child1.ancestorDNA, child1: child1 == null ? null : child1.orgChild1Name, child1ShortName: child1 == null ? null : child1.orgChild1ShortName, child2Id: child2 == null ? null : child2.id, + child2DnaId: child2 == null ? null : child2.ancestorDNA, child2: child2 == null ? null : child2.orgChild2Name, child2ShortName: child2 == null ? null : child2.orgChild2ShortName, child3Id: child3 == null ? null : child3.id, + child3DnaId: child3 == null ? null : child3.ancestorDNA, child3: child3 == null ? null : child3.orgChild3Name, child3ShortName: child3 == null ? null : child3.orgChild3ShortName, child4Id: child4 == null ? null : child4.id, + child4DnaId: child4 == null ? null : child4.ancestorDNA, child4: child4 == null ? null : child4.orgChild4Name, child4ShortName: child4 == null ? null : child4.orgChild4ShortName, node: null, diff --git a/src/controllers/ProfileEmployeeTempController.ts b/src/controllers/ProfileEmployeeTempController.ts index f4bc3cba..47c47902 100644 --- a/src/controllers/ProfileEmployeeTempController.ts +++ b/src/controllers/ProfileEmployeeTempController.ts @@ -3814,18 +3814,23 @@ export class ProfileEmployeeTempController extends Controller { posTypeId: profile.posType == null ? null : profile.posType.id, // posExecutiveName: "", rootId: root == null ? null : root.id, + rootDnaId: root == null ? null : root.ancestorDNA, root: root == null ? null : root.orgRootName, rootShortName: root == null ? null : root.orgRootShortName, child1Id: child1 == null ? null : child1.id, + child1DnaId: child1 == null ? null : child1.ancestorDNA, child1: child1 == null ? null : child1.orgChild1Name, child1ShortName: child1 == null ? null : child1.orgChild1ShortName, child2Id: child2 == null ? null : child2.id, + child2DnaId: child2 == null ? null : child2.ancestorDNA, child2: child2 == null ? null : child2.orgChild2Name, child2ShortName: child2 == null ? null : child2.orgChild2ShortName, child3Id: child3 == null ? null : child3.id, + child3DnaId: child3 == null ? null : child3.ancestorDNA, child3: child3 == null ? null : child3.orgChild3Name, child3ShortName: child3 == null ? null : child3.orgChild3ShortName, child4Id: child4 == null ? null : child4.id, + child4DnaId: child4 == null ? null : child4.ancestorDNA, child4: child4 == null ? null : child4.orgChild4Name, child4ShortName: child4 == null ? null : child4.orgChild4ShortName, node: null, From f02dd07366f66916184eaf3dae11e06414e99458 Mon Sep 17 00:00:00 2001 From: kittapath Date: Wed, 5 Feb 2025 17:43:14 +0700 Subject: [PATCH 4/6] add dna --- .../OrganizationDotnetController.ts | 233 +++++++++++++++++- 1 file changed, 228 insertions(+), 5 deletions(-) diff --git a/src/controllers/OrganizationDotnetController.ts b/src/controllers/OrganizationDotnetController.ts index ed9473f6..e0a4a8e9 100644 --- a/src/controllers/OrganizationDotnetController.ts +++ b/src/controllers/OrganizationDotnetController.ts @@ -1208,6 +1208,36 @@ export class OrganizationDotnetController extends Controller { x.orgRevision?.orgRevisionIsDraft == false && x.orgRevision?.orgRevisionIsCurrent == true, )?.orgChild4Id ?? null, + rootDnaId: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.ancestorDNA ?? null, + child1DnaId: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.ancestorDNA ?? null, + child2DnaId: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.ancestorDNA ?? null, + child3DnaId: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.ancestorDNA ?? null, + child4DnaId: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.ancestorDNA ?? null, commander: fullname, posLevel: profile.posLevel?.posLevelName ?? null, posType: profile.posType?.posTypeName ?? null, @@ -1475,6 +1505,36 @@ export class OrganizationDotnetController extends Controller { x.orgRevision?.orgRevisionIsDraft == false && x.orgRevision?.orgRevisionIsCurrent == true, )?.orgChild4Id ?? null, + rootDnaId: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.ancestorDNA ?? null, + child1DnaId: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.ancestorDNA ?? null, + child2DnaId: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.ancestorDNA ?? null, + child3DnaId: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.ancestorDNA ?? null, + child4DnaId: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.ancestorDNA ?? null, commander: fullname, posLevel: profile.posLevel?.posLevelName ?? null, posType: profile.posType?.posTypeName ?? null, @@ -2211,6 +2271,84 @@ export class OrganizationDotnetController extends Controller { x.orgRevision?.orgRevisionIsDraft == false && x.orgRevision?.orgRevisionIsCurrent == true, )?.orgRootId ?? null, + rootDnaId: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.ancestorDNA ?? null, + child1: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.orgChild1?.orgChild1Name ?? null, + child1Id: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.orgChild1Id ?? null, + child1DnaId: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.ancestorDNA ?? null, + child2: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.orgChild2?.orgChild2Name ?? null, + child2Id: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.orgChild2Id ?? null, + child2DnaId: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.ancestorDNA ?? null, + child3: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.orgChild3?.orgChild3Name ?? null, + child3Id: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.orgChild3Id ?? null, + child3DnaId: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.ancestorDNA ?? null, + child4: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.orgChild4?.orgChild4Name ?? null, + child4Id: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.orgChild4Id ?? null, + child4DnaId: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.ancestorDNA ?? null, posNo: shortName ?? "", }; }); @@ -2500,6 +2638,84 @@ export class OrganizationDotnetController extends Controller { x.orgRevision?.orgRevisionIsDraft == false && x.orgRevision?.orgRevisionIsCurrent == true, )?.orgRootId ?? null, + rootDnaId: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.ancestorDNA ?? null, + child1: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.orgChild1?.orgChild1Name ?? null, + child1Id: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.orgChild1Id ?? null, + child1DnaId: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.ancestorDNA ?? null, + child2: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.orgChild2?.orgChild2Name ?? null, + child2Id: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.orgChild2Id ?? null, + child2DnaId: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.ancestorDNA ?? null, + child3: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.orgChild3?.orgChild3Name ?? null, + child3Id: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.orgChild3Id ?? null, + child3DnaId: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.ancestorDNA ?? null, + child4: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.orgChild4?.orgChild4Name ?? null, + child4Id: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.orgChild4Id ?? null, + child4DnaId: + profile?.current_holders?.find( + (x) => + x.orgRevision?.orgRevisionIsDraft == false && + x.orgRevision?.orgRevisionIsCurrent == true, + )?.ancestorDNA ?? null, posNo: shortName ?? "", }; }); @@ -3078,9 +3294,14 @@ export class OrganizationDotnetController extends Controller { "current_holders.orgChild4", ], }); - if(body.isRetirement){ - profile = await this.profileRepo.find({ - where: { keycloak: Not(IsNull()) || Not(""), isLeave: false, current_holders: typeCondition, isRetirement: true }, + if (body.isRetirement) { + profile = await this.profileRepo.find({ + where: { + keycloak: Not(IsNull()) || Not(""), + isLeave: false, + current_holders: typeCondition, + isRetirement: true, + }, relations: [ "posType", "posLevel", @@ -3093,7 +3314,7 @@ export class OrganizationDotnetController extends Controller { ], }); } - + const findRevision = await this.orgRevisionRepo.findOne({ where: { orgRevisionIsCurrent: true }, }); @@ -3292,7 +3513,9 @@ export class OrganizationDotnetController extends Controller { keycloak: item.keycloak, posNo: shortName, position: item.position, - positionLevel: item.posLevel ? `${item.posType.posTypeShortName} ${item.posLevel.posLevelName}` : "-", + positionLevel: item.posLevel + ? `${item.posType.posTypeShortName} ${item.posLevel.posLevelName}` + : "-", positionType: item.posType?.posTypeName ?? null, oc: Oc, }; From 26a74c1beabde61bcfa5c6505d7e675c1b97d8b0 Mon Sep 17 00:00:00 2001 From: kittapath Date: Wed, 5 Feb 2025 17:55:20 +0700 Subject: [PATCH 5/6] add dna probation --- src/controllers/ProfileController.ts | 50 ++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 10d7c041..e52e5049 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -7523,6 +7523,56 @@ export class ProfileController extends Controller { ? null : item.current_holders.find((x) => x.orgRevisionId == orgRevisionActive?.id) ?.orgChild4?.id, + rootDna: + item.current_holders == null || + item.current_holders.find((x) => x.orgRevisionId == orgRevisionActive?.id) == null || + item.current_holders.find((x) => x.orgRevisionId == orgRevisionActive?.id)?.orgRoot == + null || + item.current_holders.find((x) => x.orgRevisionId == orgRevisionActive?.id)?.orgRoot + ?.orgRootName == null + ? null + : item.current_holders.find((x) => x.orgRevisionId == orgRevisionActive?.id)?.orgRoot + ?.ancestorDNA, + orgChild1Dna: + item.current_holders == null || + item.current_holders.find((x) => x.orgRevisionId == orgRevisionActive?.id) == null || + item.current_holders.find((x) => x.orgRevisionId == orgRevisionActive?.id)?.orgChild1 == + null || + item.current_holders.find((x) => x.orgRevisionId == orgRevisionActive?.id)?.orgChild1 + ?.orgChild1Name == null + ? null + : item.current_holders.find((x) => x.orgRevisionId == orgRevisionActive?.id) + ?.orgChild1?.ancestorDNA, + orgChild2Dna: + item.current_holders == null || + item.current_holders.find((x) => x.orgRevisionId == orgRevisionActive?.id) == null || + item.current_holders.find((x) => x.orgRevisionId == orgRevisionActive?.id)?.orgChild2 == + null || + item.current_holders.find((x) => x.orgRevisionId == orgRevisionActive?.id)?.orgChild2 + ?.orgChild2Name == null + ? null + : item.current_holders.find((x) => x.orgRevisionId == orgRevisionActive?.id) + ?.orgChild2?.ancestorDNA, + orgChild3Dna: + item.current_holders == null || + item.current_holders.find((x) => x.orgRevisionId == orgRevisionActive?.id) == null || + item.current_holders.find((x) => x.orgRevisionId == orgRevisionActive?.id)?.orgChild3 == + null || + item.current_holders.find((x) => x.orgRevisionId == orgRevisionActive?.id)?.orgChild3 + ?.orgChild3Name == null + ? null + : item.current_holders.find((x) => x.orgRevisionId == orgRevisionActive?.id) + ?.orgChild3?.ancestorDNA, + orgChild4Dna: + item.current_holders == null || + item.current_holders.find((x) => x.orgRevisionId == orgRevisionActive?.id) == null || + item.current_holders.find((x) => x.orgRevisionId == orgRevisionActive?.id)?.orgChild4 == + null || + item.current_holders.find((x) => x.orgRevisionId == orgRevisionActive?.id)?.orgChild4 + ?.orgChild4Name == null + ? null + : item.current_holders.find((x) => x.orgRevisionId == orgRevisionActive?.id) + ?.orgChild4?.ancestorDNA, }; }), ); From 72fd4d62e3487571946493b25988e2d3cd897776 Mon Sep 17 00:00:00 2001 From: kittapath Date: Thu, 6 Feb 2025 09:17:35 +0700 Subject: [PATCH 6/6] add dna --- src/controllers/ProfileController.ts | 5 +++++ src/controllers/ProfileEmployeeController.ts | 5 +++++ src/controllers/ProfileEmployeeTempController.ts | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index e52e5049..c6b66f7e 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -6969,18 +6969,23 @@ export class ProfileController extends Controller { salary: item.amount, root: rootHolder?.orgRootName ?? null, rootId: rootHolder?.id ?? null, + rootDnaId: rootHolder?.ancestorDNA ?? null, rootShortName: rootHolder?.orgRootShortName ?? null, child1: child1Holder?.orgChild1Name ?? null, child1Id: child1Holder?.id ?? null, + child1DnaId: child1Holder?.ancestorDNA ?? null, child1ShortName: child1Holder?.orgChild1ShortName ?? null, child2: child2Holder?.orgChild2Name ?? null, child2Id: child2Holder?.id ?? null, + child2DnaId: child2Holder?.ancestorDNA ?? null, child2ShortName: child2Holder?.orgChild2ShortName ?? null, child3: child3Holder?.orgChild3Name ?? null, child3Id: child3Holder?.id ?? null, + child3DnaId: child3Holder?.ancestorDNA ?? null, child3ShortName: child3Holder?.orgChild3ShortName ?? null, child4: child4Holder?.orgChild4Name ?? null, child4Id: child4Holder?.id ?? null, + child4DnaId: child4Holder?.ancestorDNA ?? null, child4ShortName: child4Holder?.orgChild4ShortName ?? null, posMasterNo: posMasterNo ?? null, posTypeId: item.posTypeId, diff --git a/src/controllers/ProfileEmployeeController.ts b/src/controllers/ProfileEmployeeController.ts index f48019b3..553477f4 100644 --- a/src/controllers/ProfileEmployeeController.ts +++ b/src/controllers/ProfileEmployeeController.ts @@ -2601,18 +2601,23 @@ export class ProfileEmployeeController extends Controller { salary: item.amount, root: rootHolder?.orgRootName ?? null, rootId: rootHolder?.id ?? null, + rootDnaId: rootHolder?.ancestorDNA ?? null, rootShortName: rootHolder?.orgRootShortName ?? null, child1: child1Holder?.orgChild1Name ?? null, child1Id: child1Holder?.id ?? null, + child1DnaId: child1Holder?.ancestorDNA ?? null, child1ShortName: child1Holder?.orgChild1ShortName ?? null, child2: child2Holder?.orgChild2Name ?? null, child2Id: child2Holder?.id ?? null, + child2DnaId: child2Holder?.ancestorDNA ?? null, child2ShortName: child2Holder?.orgChild2ShortName ?? null, child3: child3Holder?.orgChild3Name ?? null, child3Id: child3Holder?.id ?? null, + child3DnaId: child3Holder?.ancestorDNA ?? null, child3ShortName: child3Holder?.orgChild3ShortName ?? null, child4: child4Holder?.orgChild4Name ?? null, child4Id: child4Holder?.id ?? null, + child4DnaId: child4Holder?.ancestorDNA ?? null, child4ShortName: child4Holder?.orgChild4ShortName ?? null, posMasterNo: posMasterNo ?? null, posTypeId: item.posTypeId, diff --git a/src/controllers/ProfileEmployeeTempController.ts b/src/controllers/ProfileEmployeeTempController.ts index 47c47902..90a77f81 100644 --- a/src/controllers/ProfileEmployeeTempController.ts +++ b/src/controllers/ProfileEmployeeTempController.ts @@ -2163,18 +2163,23 @@ export class ProfileEmployeeTempController extends Controller { salary: item.amount, root: rootHolder?.orgRootName ?? null, rootId: rootHolder?.id ?? null, + rootDnaId: rootHolder?.ancestorDNA ?? null, rootShortName: rootHolder?.orgRootShortName ?? null, child1: child1Holder?.orgChild1Name ?? null, child1Id: child1Holder?.id ?? null, + child1DnaId: child1Holder?.ancestorDNA ?? null, child1ShortName: child1Holder?.orgChild1ShortName ?? null, child2: child2Holder?.orgChild2Name ?? null, child2Id: child2Holder?.id ?? null, + child2DnaId: child2Holder?.ancestorDNA ?? null, child2ShortName: child2Holder?.orgChild2ShortName ?? null, child3: child3Holder?.orgChild3Name ?? null, child3Id: child3Holder?.id ?? null, + child3DnaId: child3Holder?.ancestorDNA ?? null, child3ShortName: child3Holder?.orgChild3ShortName ?? null, child4: child4Holder?.orgChild4Name ?? null, child4Id: child4Holder?.id ?? null, + child4DnaId: child4Holder?.ancestorDNA ?? null, child4ShortName: child4Holder?.orgChild4ShortName ?? null, posMasterNo: posMasterNo ?? null, posTypeId: item.posTypeId,