diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index dd369b64..5911940e 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -219,7 +219,8 @@ export class CommandController extends Controller { _data.child1 != undefined && _data.child1 != null ? _data.child1[0] != null ? `current_holders.orgChild1Id IN (:...child1)` - : `current_holders.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + // : `current_holders.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + : `current_holders.orgChild1Id is null` : "1=1", { child1: _data.child1, diff --git a/src/controllers/DevelopmentRequestController.ts b/src/controllers/DevelopmentRequestController.ts index f02b3049..14c485c4 100644 --- a/src/controllers/DevelopmentRequestController.ts +++ b/src/controllers/DevelopmentRequestController.ts @@ -165,7 +165,8 @@ export class DevelopmentRequestController extends Controller { data.child1 != undefined && data.child1 != null ? data.child1[0] != null ? `current_holders.orgChild1Id IN (:...child1)` - : `current_holders.orgChild1Id is ${data.privilege == "PARENT" ? "not null" : "null"}` + // : `current_holders.orgChild1Id is ${data.privilege == "PARENT" ? "not null" : "null"}` + : `current_holders.orgChild1Id is null` : "1=1", { child1: data.child1, diff --git a/src/controllers/EmployeePositionController.ts b/src/controllers/EmployeePositionController.ts index 4f679477..8007ac42 100644 --- a/src/controllers/EmployeePositionController.ts +++ b/src/controllers/EmployeePositionController.ts @@ -1154,7 +1154,8 @@ export class EmployeePositionController extends Controller { _data.child1 != undefined && _data.child1 != null ? _data.child1[0] != null ? `posMaster.orgChild1Id IN (:...child1)` - : `posMaster.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + // : `posMaster.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + : `posMaster.orgChild1Id is null` : "1=1", { child1: _data.child1, diff --git a/src/controllers/EmployeeTempPositionController.ts b/src/controllers/EmployeeTempPositionController.ts index db110dce..bbb06cea 100644 --- a/src/controllers/EmployeeTempPositionController.ts +++ b/src/controllers/EmployeeTempPositionController.ts @@ -901,7 +901,8 @@ export class EmployeeTempPositionController extends Controller { _data.child1 != undefined && _data.child1 != null ? _data.child1[0] != null ? `posMaster.orgChild1Id IN (:...child1)` - : `posMaster.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + // : `posMaster.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + : `posMaster.orgChild1Id is null` : "1=1", { child1: _data.child1, diff --git a/src/controllers/OrganizationDotnetController.ts b/src/controllers/OrganizationDotnetController.ts index 8f5dd6ac..90633992 100644 --- a/src/controllers/OrganizationDotnetController.ts +++ b/src/controllers/OrganizationDotnetController.ts @@ -157,8 +157,8 @@ export class OrganizationDotnetController extends Controller { condition = "orgRoot.ancestorDNA = :nodeId"; conditionParams = { nodeId: body.nodeId }; } else if (body.role === "PARENT") { - condition = "orgRoot.ancestorDNA = :nodeId AND current_holders.orgChild1 IS NOT NULL"; - conditionParams = { nodeId: body.nodeId }; + // condition = "orgRoot.ancestorDNA = :nodeId AND current_holders.orgChild1 IS NOT NULL"; + // conditionParams = { nodeId: body.nodeId }; } else if (body.role === "NORMAL") { switch (body.node) { case 0: @@ -298,8 +298,8 @@ export class OrganizationDotnetController extends Controller { condition = "orgRoot.ancestorDNA = :nodeId"; conditionParams = { nodeId: body.nodeId }; } else if (body.role === "PARENT") { - condition = "orgRoot.ancestorDNA = :nodeId AND current_holders.orgChild1 IS NOT NULL"; - conditionParams = { nodeId: body.nodeId }; + // condition = "orgRoot.ancestorDNA = :nodeId AND current_holders.orgChild1 IS NOT NULL"; + // conditionParams = { nodeId: body.nodeId }; } else if (body.role === "NORMAL") { switch (body.node) { case 0: @@ -5743,7 +5743,7 @@ export class OrganizationDotnetController extends Controller { }, ) { let typeCondition: any = {}; - if (body.role === "CHILD" || body.role === "PARENT" || body.role === "BROTHER") { + if (body.role === "CHILD" || /*body.role === "PARENT" ||*/ body.role === "BROTHER") { if (body.role === "CHILD") { switch (body.node) { case 0: @@ -5785,7 +5785,8 @@ export class OrganizationDotnetController extends Controller { typeCondition = {}; break; } - } else if (body.role === "BROTHER") { + } + else if (body.role === "BROTHER") { switch (body.node) { case 0: typeCondition = { @@ -5826,15 +5827,16 @@ export class OrganizationDotnetController extends Controller { typeCondition = {}; break; } - } else if (body.role === "PARENT") { - typeCondition = { - orgRoot: { - ancestorDNA: body.nodeId, - }, - orgChild1: Not(IsNull()), - }; - } - } else if (body.role === "OWNER" || body.role === "ROOT") { + } + // else if (body.role === "PARENT") { + // typeCondition = { + // orgRoot: { + // ancestorDNA: body.nodeId, + // }, + // orgChild1: Not(IsNull()), + // }; + // } + } else if (body.role === "OWNER" || body.role === "ROOT" || body.role === "PARENT") { switch (body.reqNode) { case 0: typeCondition = { @@ -6390,7 +6392,7 @@ export class OrganizationDotnetController extends Controller { }, ) { let typeCondition: any = {}; - if (body.role === "CHILD" || body.role === "PARENT" || body.role === "BROTHER") { + if (body.role === "CHILD" || /*body.role === "PARENT" ||*/ body.role === "BROTHER") { if (body.role === "CHILD") { switch (body.node) { case 0: @@ -6432,7 +6434,8 @@ export class OrganizationDotnetController extends Controller { typeCondition = {}; break; } - } else if (body.role === "BROTHER") { + } + else if (body.role === "BROTHER") { switch (body.node) { case 0: typeCondition = { @@ -6473,15 +6476,16 @@ export class OrganizationDotnetController extends Controller { typeCondition = {}; break; } - } else if (body.role === "PARENT") { - typeCondition = { - orgRoot: { - ancestorDNA: body.nodeId, - }, - orgChild1: Not(IsNull()), - }; - } - } else if (body.role === "OWNER" || body.role === "ROOT") { + } + // else if (body.role === "PARENT") { + // typeCondition = { + // orgRoot: { + // ancestorDNA: body.nodeId, + // }, + // orgChild1: Not(IsNull()), + // }; + // } + } else if (body.role === "OWNER" || body.role === "ROOT" || body.role === "PARENT") { switch (body.reqNode) { case 0: typeCondition = { @@ -7800,7 +7804,7 @@ export class OrganizationDotnetController extends Controller { }, ) { let typeCondition: any = {}; - if (body.role === "CHILD" || body.role === "PARENT" || body.role === "BROTHER") { + if (body.role === "CHILD" || /*body.role === "PARENT" ||*/ body.role === "BROTHER") { if (body.role === "CHILD") { switch (body.node) { case 0: @@ -7832,7 +7836,8 @@ export class OrganizationDotnetController extends Controller { typeCondition = {}; break; } - } else if (body.role === "BROTHER") { + } + else if (body.role === "BROTHER") { switch (body.node) { case 0: typeCondition = { @@ -7863,13 +7868,14 @@ export class OrganizationDotnetController extends Controller { typeCondition = {}; break; } - } else if (body.role === "PARENT") { - typeCondition = { - rootDnaId: body.nodeId, - child1DnaId: Not(IsNull()), - }; - } - } else if (body.role === "OWNER" || body.role === "ROOT") { + } + // else if (body.role === "PARENT") { + // typeCondition = { + // rootDnaId: body.nodeId, + // child1DnaId: Not(IsNull()), + // }; + // } + } else if (body.role === "OWNER" || body.role === "ROOT" || body.role === "PARENT") { switch (body.reqNode) { case 0: typeCondition = { @@ -8025,7 +8031,7 @@ export class OrganizationDotnetController extends Controller { }, ) { let typeCondition: any = {}; - if (body.role === "CHILD" || body.role === "PARENT" || body.role === "BROTHER") { + if (body.role === "CHILD" || /*body.role === "PARENT" ||*/ body.role === "BROTHER") { if (body.role === "CHILD") { switch (body.node) { case 0: @@ -8067,7 +8073,8 @@ export class OrganizationDotnetController extends Controller { typeCondition = {}; break; } - } else if (body.role === "BROTHER") { + } + else if (body.role === "BROTHER") { switch (body.node) { case 0: typeCondition = { @@ -8108,15 +8115,16 @@ export class OrganizationDotnetController extends Controller { typeCondition = {}; break; } - } else if (body.role === "PARENT") { - typeCondition = { - orgRoot: { - ancestorDNA: body.nodeId, - }, - orgChild1: Not(IsNull()), - }; - } - } else if (body.role === "OWNER" || body.role === "ROOT") { + } + // else if (body.role === "PARENT") { + // typeCondition = { + // orgRoot: { + // ancestorDNA: body.nodeId, + // }, + // orgChild1: Not(IsNull()), + // }; + // } + } else if (body.role === "OWNER" || body.role === "ROOT" || body.role === "PARENT") { switch (body.reqNode) { case 0: typeCondition = { @@ -8369,7 +8377,7 @@ export class OrganizationDotnetController extends Controller { }, ) { let typeCondition: any = {}; - if (body.role === "CHILD" || body.role === "PARENT" || body.role === "BROTHER") { + if (body.role === "CHILD" || /*body.role === "PARENT" ||*/ body.role === "BROTHER") { if (body.role === "CHILD") { switch (body.node) { case 0: @@ -8401,7 +8409,8 @@ export class OrganizationDotnetController extends Controller { typeCondition = {}; break; } - } else if (body.role === "BROTHER") { + } + else if (body.role === "BROTHER") { switch (body.node) { case 0: typeCondition = { @@ -8432,13 +8441,14 @@ export class OrganizationDotnetController extends Controller { typeCondition = {}; break; } - } else if (body.role === "PARENT") { - typeCondition = { - rootDnaId: body.nodeId, - child1DnaId: Not(IsNull()), - }; - } - } else if (body.role === "OWNER" || body.role === "ROOT") { + } + // else if (body.role === "PARENT") { + // typeCondition = { + // rootDnaId: body.nodeId, + // child1DnaId: Not(IsNull()), + // }; + // } + } else if (body.role === "OWNER" || body.role === "ROOT" || body.role === "PARENT") { switch (body.reqNode) { case 0: typeCondition = { diff --git a/src/controllers/PermissionController.ts b/src/controllers/PermissionController.ts index b082f0fd..801d4b97 100644 --- a/src/controllers/PermissionController.ts +++ b/src/controllers/PermissionController.ts @@ -734,8 +734,10 @@ export class PermissionController extends Controller { }; } else if (privilege == "PARENT") { data = { - root: [x.orgRootId], - child1: [null], + // root: [x.orgRootId], + // child1: [null], + root: null, + child1: null, child2: null, child3: null, child4: null, diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index 3a42acce..a71e8bbf 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -2390,7 +2390,8 @@ export class PositionController extends Controller { _data.child1 != undefined && _data.child1 != null ? _data.child1[0] != null ? "posMaster.orgChild1Id IN (:...child1)" - : `posMaster.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + // : `posMaster.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + : `posMaster.orgChild1Id is null` : "1=1", { child1: _data.child1 } ) diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 14a77d7f..8f428180 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -2267,7 +2267,8 @@ export class ProfileController extends Controller { _data.child1 != undefined && _data.child1 != null ? _data.child1[0] != null ? `current_holders.orgChild1Id IN (:...child1)` - : `current_holders.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + // : `current_holders.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + : `current_holders.orgChild1Id is null` : "1=1", { child1: _data.child1, @@ -6243,7 +6244,8 @@ export class ProfileController extends Controller { _data.child1 != undefined && _data.child1 != null ? _data.child1[0] != null ? `current_holders.orgChild1Id IN (:...child1)` - : `current_holders.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + // : `current_holders.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + : `current_holders.orgChild1Id is null` : "1=1", { child1: _data.child1 }, ) @@ -6630,7 +6632,8 @@ export class ProfileController extends Controller { _data.child1 != undefined && _data.child1 != null ? _data.child1[0] != null ? `current_holders.orgChild1Id IN (:...child1)` - : `current_holders.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + // : `current_holders.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + : `current_holders.orgChild1Id is null` : "1=1", { child1: _data.child1 }, ) @@ -8984,7 +8987,8 @@ export class ProfileController extends Controller { _data.child1 != undefined && _data.child1 != null ? _data.child1[0] != null ? `current_holders.orgChild1Id IN (:...child1)` - : `current_holders.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + // : `current_holders.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + : `current_holders.orgChild1Id is null` : "1=1", { child1: _data.child1 }, ) @@ -9507,7 +9511,8 @@ export class ProfileController extends Controller { _data.child1 != undefined && _data.child1 != null ? _data.child1[0] != null ? `current_holders.orgChild1Id IN (:...child1)` - : `current_holders.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + // : `current_holders.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + : `current_holders.orgChild1Id is null` : "1=1", { child1: _data.child1, diff --git a/src/controllers/ProfileEditController.ts b/src/controllers/ProfileEditController.ts index 013a2e9d..a1e081f3 100644 --- a/src/controllers/ProfileEditController.ts +++ b/src/controllers/ProfileEditController.ts @@ -151,7 +151,8 @@ export class ProfileEditController extends Controller { data.child1 != undefined && data.child1 != null ? data.child1[0] != null ? `current_holders.orgChild1Id IN (:...child1)` - : `current_holders.orgChild1Id is ${data.privilege == "PARENT" ? "not null" : "null"}` + // : `current_holders.orgChild1Id is ${data.privilege == "PARENT" ? "not null" : "null"}` + : `current_holders.orgChild1Id is null` : "1=1", { child1: data.child1, diff --git a/src/controllers/ProfileEditEmployeeController.ts b/src/controllers/ProfileEditEmployeeController.ts index 86c364d5..87bba20a 100644 --- a/src/controllers/ProfileEditEmployeeController.ts +++ b/src/controllers/ProfileEditEmployeeController.ts @@ -150,7 +150,8 @@ export class ProfileEditEmployeeController extends Controller { data.child1 != undefined && data.child1 != null ? data.child1[0] != null ? `current_holders.orgChild1Id IN (:...child1)` - : `current_holders.orgChild1Id is ${data.privilege == "PARENT" ? "not null" : "null"}` + // : `current_holders.orgChild1Id is ${data.privilege == "PARENT" ? "not null" : "null"}` + : `current_holders.orgChild1Id is null` : "1=1", { child1: data.child1, diff --git a/src/controllers/ProfileEmployeeController.ts b/src/controllers/ProfileEmployeeController.ts index 6b2e6688..0d01f7ab 100644 --- a/src/controllers/ProfileEmployeeController.ts +++ b/src/controllers/ProfileEmployeeController.ts @@ -2888,7 +2888,8 @@ export class ProfileEmployeeController extends Controller { _data.child1 != undefined && _data.child1 != null ? _data.child1[0] != null ? `current_holders.orgChild1Id IN (:...child1)` - : `current_holders.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + // : `current_holders.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + : `current_holders.orgChild1Id is null` : "1=1", { child1: _data.child1, @@ -3767,7 +3768,8 @@ export class ProfileEmployeeController extends Controller { _data.child1 != undefined && _data.child1 != null ? _data.child1[0] != null ? `current_holders.orgChild1Id IN (:...child1)` - : `current_holders.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + // : `current_holders.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + : `current_holders.orgChild1Id is null` : "1=1", { child1: _data.child1 }, ) @@ -4325,7 +4327,8 @@ export class ProfileEmployeeController extends Controller { _data.child1 != undefined && _data.child1 != null ? _data.child1[0] != null ? `current_holders.orgChild1Id IN (:...child1)` - : `current_holders.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + // : `current_holders.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + : `current_holders.orgChild1Id is null` : "1=1", { child1: _data.child1, diff --git a/src/controllers/ProfileEmployeeTempController.ts b/src/controllers/ProfileEmployeeTempController.ts index 6bde1171..99e0754d 100644 --- a/src/controllers/ProfileEmployeeTempController.ts +++ b/src/controllers/ProfileEmployeeTempController.ts @@ -1105,7 +1105,8 @@ export class ProfileEmployeeTempController extends Controller { _dataOrg.child1 != undefined && _dataOrg.child1 != null ? _dataOrg.child1[0] != null ? `current_holderTemps.orgChild1Id IN (:...child1)` - : `current_holderTemps.orgChild1Id is ${_dataOrg.privilege == "PARENT" ? "not null" : "null"}` + // : `current_holderTemps.orgChild1Id is ${_dataOrg.privilege == "PARENT" ? "not null" : "null"}` + : `current_holders.orgChild1Id is null` : "1=1", { child1: _dataOrg.child1, @@ -1560,7 +1561,8 @@ export class ProfileEmployeeTempController extends Controller { _data.child1 != undefined && _data.child1 != null ? _data.child1[0] != null ? `current_holderTemps.orgChild1Id IN (:...child1)` - : `current_holderTemps.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + // : `current_holderTemps.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + : `current_holders.orgChild1Id is null` : "1=1", { child1: _data.child1, @@ -2271,7 +2273,8 @@ export class ProfileEmployeeTempController extends Controller { _data.child1 != undefined && _data.child1 != null ? _data.child1[0] != null ? `current_holderTemps.orgChild1Id IN (:...child1)` - : `current_holderTemps.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + // : `current_holderTemps.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + : `current_holders.orgChild1Id is null` : "1=1", { child1: _data.child1 }, ) diff --git a/src/controllers/ProfileSalaryTempController.ts b/src/controllers/ProfileSalaryTempController.ts index 33d6a835..fc6a9df5 100644 --- a/src/controllers/ProfileSalaryTempController.ts +++ b/src/controllers/ProfileSalaryTempController.ts @@ -133,7 +133,8 @@ export class ProfileSalaryTempController extends Controller { _data.child1 != undefined && _data.child1 != null ? _data.child1[0] != null ? `current_holders.orgChild1Id IN (:...child1)` - : `current_holders.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + // : `current_holders.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + : `current_holders.orgChild1Id is null` : "1=1", { child1: _data.child1, @@ -544,7 +545,8 @@ export class ProfileSalaryTempController extends Controller { _data.child1 != undefined && _data.child1 != null ? _data.child1[0] != null ? `current_holders.orgChild1Id IN (:...child1)` - : `current_holders.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + // : `current_holders.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}` + : `current_holders.orgChild1Id is null` : "1=1", { child1: _data.child1, diff --git a/src/interfaces/permission.ts b/src/interfaces/permission.ts index fa61df3d..4c3063de 100644 --- a/src/interfaces/permission.ts +++ b/src/interfaces/permission.ts @@ -96,8 +96,10 @@ class CheckAuth { }; } else if (privilege == "PARENT") { data = { - root: [x.orgRootId], - child1: [null], + // root: [x.orgRootId], + // child1: [null], + root: null, + child1: null, child2: null, child3: null, child4: null,