From 59c5cfb9bf028f110c6f6d1e0f248380f800b926 Mon Sep 17 00:00:00 2001 From: Adisak Date: Wed, 27 May 2026 11:13:40 +0700 Subject: [PATCH] #2527 --- src/controllers/CommandController.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index 5fda4063..824773f1 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -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,