From f4e8ec277e458138606f601414c3edfe219d76c8 Mon Sep 17 00:00:00 2001 From: kittapath Date: Mon, 3 Feb 2025 15:40:44 +0700 Subject: [PATCH] add dna profile --- src/controllers/ProfileController.ts | 11 +++++++++++ src/controllers/ProfileEmployeeController.ts | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 4370e327..7418a49e 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -6272,22 +6272,28 @@ export class ProfileController extends Controller { ? null : position.posExecutive.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, nodeId: null, + nodeDnaId: null, posNo: shortName, isPosmasterAct: data.length > 0, posmasterAct: data, @@ -6301,22 +6307,27 @@ export class ProfileController extends Controller { if (_profile.child4Id != null) { _profile.node = 4; _profile.nodeId = _profile.child4Id; + _profile.nodeDnaId = _profile.child4DnaId; _profile.nodeShortName = _profile.child4ShortName; } else if (_profile.child3Id != null) { _profile.node = 3; _profile.nodeId = _profile.child3Id; + _profile.nodeDnaId = _profile.child3DnaId; _profile.nodeShortName = _profile.child3ShortName; } else if (_profile.child2Id != null) { _profile.node = 2; _profile.nodeId = _profile.child2Id; + _profile.nodeDnaId = _profile.child2DnaId; _profile.nodeShortName = _profile.child2ShortName; } else if (_profile.child1Id != null) { _profile.node = 1; _profile.nodeId = _profile.child1Id; + _profile.nodeDnaId = _profile.child1DnaId; _profile.nodeShortName = _profile.child1ShortName; } else if (_profile.rootId != null) { _profile.node = 0; _profile.nodeId = _profile.rootId; + _profile.nodeDnaId = _profile.rootDnaId; _profile.nodeShortName = _profile.rootShortName; } return new HttpSuccess(_profile); diff --git a/src/controllers/ProfileEmployeeController.ts b/src/controllers/ProfileEmployeeController.ts index 3ef3ca29..85290143 100644 --- a/src/controllers/ProfileEmployeeController.ts +++ b/src/controllers/ProfileEmployeeController.ts @@ -1626,7 +1626,7 @@ export class ProfileEmployeeController extends Controller { : isRetire == true && retireType != undefined && retireType != null ? `profileEmployee.dateLeave IS NOT NULL AND profileEmployee.leaveType = '${retireType}'` : `profileEmployee.dateLeave IS NOT NULL` - : "1=1" + : "1=1", ) .andWhere("profileEmployee.employeeClass LIKE :type", { type: "PERM", @@ -2258,6 +2258,7 @@ export class ProfileEmployeeController extends Controller { child4ShortName: child4 == null ? null : child4.orgChild4ShortName, node: null, nodeId: null, + nodeDnaId: null, salary: profile ? profile.amount : null, amountSpecial: profile ? profile.amountSpecial : null, posNo: