face เลือกหัวหน้าทั้งหน่วยงาน #1597
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m11s

This commit is contained in:
harid 2026-06-16 15:50:15 +07:00
parent ca5b11e36b
commit db36b250e3

View file

@ -865,6 +865,7 @@ export class WorkflowController extends Controller {
type?: string | null; type?: string | null;
sortBy?: string | null; sortBy?: string | null;
descending?: boolean; descending?: boolean;
isAllDirector?: boolean;
}, },
) { ) {
const userKeycloak = body.keycloakId ?? request.user.sub; const userKeycloak = body.keycloakId ?? request.user.sub;
@ -953,6 +954,13 @@ export class WorkflowController extends Controller {
let mainConditions: any[] = []; let mainConditions: any[] = [];
if (type.trim().toUpperCase() === "OPERATE" || body.type === "employee") { if (type.trim().toUpperCase() === "OPERATE" || body.type === "employee") {
if (body.isAllDirector === true) {
mainConditions = [
{ ...baseCondition, orgRootId: In(roodIds) }
];
}
else {
mainConditions = [ mainConditions = [
{ ...baseCondition, orgRootId: In(roodIds), orgChild1Id: IsNull() }, { ...baseCondition, orgRootId: In(roodIds), orgChild1Id: IsNull() },
{ {
@ -985,6 +993,7 @@ export class WorkflowController extends Controller {
orgChild4Id: posMasterUser.orgChild4Id, orgChild4Id: posMasterUser.orgChild4Id,
}, },
]; ];
}
} else if (isLowLevel) { } else if (isLowLevel) {
mainConditions = [ mainConditions = [
{ {