#2527
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m1s

This commit is contained in:
Adisak 2026-05-27 11:13:40 +07:00
parent 238c4c092f
commit 59c5cfb9bf

View file

@ -7560,13 +7560,13 @@ export class CommandController extends Controller {
// }
// }
// อัพเดท org และ posMasterNo ตลอดไม่ต้องดัก isSit
profile.posMasterNo = getPosMasterNo(posMaster);
profile.org = getOrgFullName(posMaster);
// ถ้าไม่ใช่ตำแหน่งนั่งทับ (isSit = false) ถึงจะอัพเดทตำแหน่งในทะเบียนประวัติ
if (positionNew != null) {
console.log("[Excexute/CreateOfficerProfile] Final position assignment, isSit:", posMaster.isSit, "positionId:", positionNew.id);
positionNew.positionIsSelected = true;
// อัพเดท org และ posMasterNo ตลอดไม่ต้องดัก isSit
profile.posMasterNo = getPosMasterNo(posMaster);
profile.org = getOrgFullName(posMaster);
if (!posMaster.isSit) {
profile.posLevelId = positionNew.posLevelId;
profile.posTypeId = positionNew.posTypeId;
@ -7577,10 +7577,10 @@ export class CommandController extends Controller {
profile.positionExecutiveField = positionNew.positionExecutiveField ?? null;
// profile.dateStart = new Date();
}
await this.profileRepository.save(profile, { data: req });
setLogDataDiff(req, { before, after: profile });
await this.positionRepository.save(positionNew, { data: req });
}
await this.profileRepository.save(profile, { data: req });
setLogDataDiff(req, { before, after: profile });
// await CreatePosMasterHistoryOfficer(posMaster.id, req);
await CreatePosMasterHistoryOfficer(posMaster.id, req, null, {
positionId: positionNew?.id,