ค้นหา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);
let typeCondition: any = {};
if (body.isAll == true) {
if (posMasterMain.orgChild4Id != null) {
typeCondition = {
orgChild4Id: body.posmasterId,
current_holderId: Not(IsNull()),
id: Not(In(posId)),
};
} else if (posMasterMain.orgChild3Id != null) {
typeCondition = {
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)),
};
}
typeCondition = {
orgRootId: posMasterMain.orgRootId,
orgChild1Id: posMasterMain.orgChild1Id,
orgChild2Id: posMasterMain.orgChild2Id,
orgChild3Id: posMasterMain.orgChild3Id,
orgChild4Id: posMasterMain.orgChild4Id,
current_holderId: Not(IsNull()),
id: Not(In(posId)),
};
} else {
typeCondition = {
orgRootId: posMasterMain.orgRootId == null ? IsNull() : posMasterMain.orgRootId,