ค้นหา3 ระดับ

This commit is contained in:
Kittapath 2024-06-26 15:14:12 +07:00
parent 2128857d10
commit d12ccd88fb

View file

@ -3256,37 +3256,15 @@ export class PositionController extends Controller {
posId.push(body.posmasterId); posId.push(body.posmasterId);
let typeCondition: any = {}; let typeCondition: any = {};
if (body.isAll == true) { if (body.isAll == true) {
if (posMasterMain.orgChild4Id != null) { typeCondition = {
typeCondition = { orgRootId: posMasterMain.orgRootId,
orgChild4Id: body.posmasterId, orgChild1Id: posMasterMain.orgChild1Id,
current_holderId: Not(IsNull()), orgChild2Id: posMasterMain.orgChild2Id,
id: Not(In(posId)), orgChild3Id: posMasterMain.orgChild3Id,
}; orgChild4Id: posMasterMain.orgChild4Id,
} else if (posMasterMain.orgChild3Id != null) { current_holderId: Not(IsNull()),
typeCondition = { id: Not(In(posId)),
orgChild3Id: body.posmasterId, };
current_holderId: Not(IsNull()),
id: Not(In(posId)),
};
} else if (posMasterMain.orgChild2Id != null) {
typeCondition = {
orgChild2Id: body.posmasterId,
current_holderId: Not(IsNull()),
id: Not(In(posId)),
};
} else if (posMasterMain.orgChild1Id != null) {
typeCondition = {
orgChild1Id: body.posmasterId,
current_holderId: Not(IsNull()),
id: Not(In(posId)),
};
} else if (posMasterMain.orgRootId != null) {
typeCondition = {
orgRootId: body.posmasterId,
current_holderId: Not(IsNull()),
id: Not(In(posId)),
};
}
} else { } else {
typeCondition = { typeCondition = {
orgRootId: posMasterMain.orgRootId == null ? IsNull() : posMasterMain.orgRootId, orgRootId: posMasterMain.orgRootId == null ? IsNull() : posMasterMain.orgRootId,