no message

This commit is contained in:
kittapath 2025-01-08 16:46:22 +07:00
parent e3275e0b79
commit eac620fb15

View file

@ -1307,25 +1307,26 @@ export class ProfileController extends Controller {
if (!posMaster) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลการครองตำแหน่ง"); if (!posMaster) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลการครองตำแหน่ง");
let condition: any = { let condition: any = {
orgRootId: posMaster.orgRootId || "", orgRootId: posMaster.orgRootId,
id: Not(posMaster.current_holderId || ""), id: Not(posMaster.current_holderId || ""),
}; };
let conditionNow: any = { let conditionNow: any = {
orgRootId: posMaster.orgRootId || "", orgRootId: posMaster.orgRootId,
orgChild1Id: posMaster.orgChild1Id || "", orgChild1Id: posMaster.orgChild1Id,
orgChild2Id: posMaster.orgChild2Id || "", orgChild2Id: posMaster.orgChild2Id,
orgChild3Id: posMaster.orgChild3Id || "", orgChild3Id: posMaster.orgChild3Id,
orgChild4Id: posMaster.orgChild4Id || "", orgChild4Id: posMaster.orgChild4Id,
id: Not(posMaster.current_holderId || ""), id: Not(posMaster.current_holderId),
}; };
if (posMaster.orgChild2Id == null) { if (posMaster.orgChild1Id == null) {
condition.orgChild1Id = ""; } else if (posMaster.orgChild2Id == null) {
condition.orgChild1Id = null;
} else if (posMaster.orgChild3Id == null) { } else if (posMaster.orgChild3Id == null) {
condition.orgChild2Id = ""; condition.orgChild2Id = null;
} else if (posMaster.orgChild4Id == null) { } else if (posMaster.orgChild4Id == null) {
condition.orgChild3Id = ""; condition.orgChild3Id = null;
} else { } else {
condition.orgChild4Id = ""; condition.orgChild4Id = null;
} }
if (body.isDirector == true) { if (body.isDirector == true) {
condition.isDirector = true; condition.isDirector = true;
@ -1422,25 +1423,26 @@ export class ProfileController extends Controller {
if (!posMaster) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลการครองตำแหน่ง"); if (!posMaster) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลการครองตำแหน่ง");
let condition: any = { let condition: any = {
orgRootId: posMaster.orgRootId || "", orgRootId: posMaster.orgRootId,
id: Not(posMaster.current_holderId || ""), id: Not(posMaster.current_holderId || ""),
}; };
let conditionNow: any = { let conditionNow: any = {
orgRootId: posMaster.orgRootId || "", orgRootId: posMaster.orgRootId,
orgChild1Id: posMaster.orgChild1Id || "", orgChild1Id: posMaster.orgChild1Id,
orgChild2Id: posMaster.orgChild2Id || "", orgChild2Id: posMaster.orgChild2Id,
orgChild3Id: posMaster.orgChild3Id || "", orgChild3Id: posMaster.orgChild3Id,
orgChild4Id: posMaster.orgChild4Id || "", orgChild4Id: posMaster.orgChild4Id,
id: Not(posMaster.current_holderId || ""), id: Not(posMaster.current_holderId),
}; };
if (posMaster.orgChild2Id == null) { if (posMaster.orgChild1Id == null) {
condition.orgChild1Id = ""; } else if (posMaster.orgChild2Id == null) {
condition.orgChild1Id = null;
} else if (posMaster.orgChild3Id == null) { } else if (posMaster.orgChild3Id == null) {
condition.orgChild2Id = ""; condition.orgChild2Id = null;
} else if (posMaster.orgChild4Id == null) { } else if (posMaster.orgChild4Id == null) {
condition.orgChild3Id = ""; condition.orgChild3Id = null;
} else { } else {
condition.orgChild4Id = ""; condition.orgChild4Id = null;
} }
if (body.isDirector == true) { if (body.isDirector == true) {
condition.isDirector = true; condition.isDirector = true;
@ -1512,25 +1514,26 @@ export class ProfileController extends Controller {
if (!posMaster) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลการครองตำแหน่ง"); if (!posMaster) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลการครองตำแหน่ง");
let condition: any = { let condition: any = {
orgRootId: posMaster.orgRootId || "", orgRootId: posMaster.orgRootId,
id: Not(posMaster.current_holderId || ""), id: Not(posMaster.current_holderId || ""),
}; };
let conditionNow: any = { let conditionNow: any = {
orgRootId: posMaster.orgRootId || "", orgRootId: posMaster.orgRootId,
orgChild1Id: posMaster.orgChild1Id || "", orgChild1Id: posMaster.orgChild1Id,
orgChild2Id: posMaster.orgChild2Id || "", orgChild2Id: posMaster.orgChild2Id,
orgChild3Id: posMaster.orgChild3Id || "", orgChild3Id: posMaster.orgChild3Id,
orgChild4Id: posMaster.orgChild4Id || "", orgChild4Id: posMaster.orgChild4Id,
id: Not(posMaster.current_holderId || ""), id: Not(posMaster.current_holderId),
}; };
if (posMaster.orgChild2Id == null) { if (posMaster.orgChild1Id == null) {
condition.orgChild1Id = ""; } else if (posMaster.orgChild2Id == null) {
condition.orgChild1Id = null;
} else if (posMaster.orgChild3Id == null) { } else if (posMaster.orgChild3Id == null) {
condition.orgChild2Id = ""; condition.orgChild2Id = null;
} else if (posMaster.orgChild4Id == null) { } else if (posMaster.orgChild4Id == null) {
condition.orgChild3Id = ""; condition.orgChild3Id = null;
} else { } else {
condition.orgChild4Id = ""; condition.orgChild4Id = null;
} }
if (body.isDirector == true) { if (body.isDirector == true) {
condition.isDirector = true; condition.isDirector = true;