face เลือกหัวหน้าทั้งหน่วยงาน #1597
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m11s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m11s
This commit is contained in:
parent
ca5b11e36b
commit
db36b250e3
1 changed files with 41 additions and 32 deletions
|
|
@ -865,6 +865,7 @@ export class WorkflowController extends Controller {
|
|||
type?: string | null;
|
||||
sortBy?: string | null;
|
||||
descending?: boolean;
|
||||
isAllDirector?: boolean;
|
||||
},
|
||||
) {
|
||||
const userKeycloak = body.keycloakId ?? request.user.sub;
|
||||
|
|
@ -953,38 +954,46 @@ export class WorkflowController extends Controller {
|
|||
let mainConditions: any[] = [];
|
||||
|
||||
if (type.trim().toUpperCase() === "OPERATE" || body.type === "employee") {
|
||||
mainConditions = [
|
||||
{ ...baseCondition, orgRootId: In(roodIds), orgChild1Id: IsNull() },
|
||||
{
|
||||
...baseCondition,
|
||||
orgRootId: In(roodIds),
|
||||
orgChild1Id: posMasterUser.orgChild1Id,
|
||||
orgChild2Id: IsNull(),
|
||||
},
|
||||
{
|
||||
...baseCondition,
|
||||
orgRootId: In(roodIds),
|
||||
orgChild1Id: posMasterUser.orgChild1Id,
|
||||
orgChild2Id: posMasterUser.orgChild2Id,
|
||||
orgChild3Id: IsNull(),
|
||||
},
|
||||
{
|
||||
...baseCondition,
|
||||
orgRootId: In(roodIds),
|
||||
orgChild1Id: posMasterUser.orgChild1Id,
|
||||
orgChild2Id: posMasterUser.orgChild2Id,
|
||||
orgChild3Id: posMasterUser.orgChild3Id,
|
||||
orgChild4Id: IsNull(),
|
||||
},
|
||||
{
|
||||
...baseCondition,
|
||||
orgRootId: In(roodIds),
|
||||
orgChild1Id: posMasterUser.orgChild1Id,
|
||||
orgChild2Id: posMasterUser.orgChild2Id,
|
||||
orgChild3Id: posMasterUser.orgChild3Id,
|
||||
orgChild4Id: posMasterUser.orgChild4Id,
|
||||
},
|
||||
];
|
||||
|
||||
if (body.isAllDirector === true) {
|
||||
mainConditions = [
|
||||
{ ...baseCondition, orgRootId: In(roodIds) }
|
||||
];
|
||||
}
|
||||
else {
|
||||
mainConditions = [
|
||||
{ ...baseCondition, orgRootId: In(roodIds), orgChild1Id: IsNull() },
|
||||
{
|
||||
...baseCondition,
|
||||
orgRootId: In(roodIds),
|
||||
orgChild1Id: posMasterUser.orgChild1Id,
|
||||
orgChild2Id: IsNull(),
|
||||
},
|
||||
{
|
||||
...baseCondition,
|
||||
orgRootId: In(roodIds),
|
||||
orgChild1Id: posMasterUser.orgChild1Id,
|
||||
orgChild2Id: posMasterUser.orgChild2Id,
|
||||
orgChild3Id: IsNull(),
|
||||
},
|
||||
{
|
||||
...baseCondition,
|
||||
orgRootId: In(roodIds),
|
||||
orgChild1Id: posMasterUser.orgChild1Id,
|
||||
orgChild2Id: posMasterUser.orgChild2Id,
|
||||
orgChild3Id: posMasterUser.orgChild3Id,
|
||||
orgChild4Id: IsNull(),
|
||||
},
|
||||
{
|
||||
...baseCondition,
|
||||
orgRootId: In(roodIds),
|
||||
orgChild1Id: posMasterUser.orgChild1Id,
|
||||
orgChild2Id: posMasterUser.orgChild2Id,
|
||||
orgChild3Id: posMasterUser.orgChild3Id,
|
||||
orgChild4Id: posMasterUser.orgChild4Id,
|
||||
},
|
||||
];
|
||||
}
|
||||
} else if (isLowLevel) {
|
||||
mainConditions = [
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue