From 90f6b5061a5c5603c815e75d8031b6b42193b618 Mon Sep 17 00:00:00 2001 From: mamoss <> Date: Thu, 8 May 2025 12:29:06 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=AD=E0=B8=AD=E0=B8=81=E0=B8=84=E0=B8=B3?= =?UTF-8?q?=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87=E0=B8=97=E0=B8=94=E0=B8=A5?= =?UTF-8?q?=E0=B8=AD=E0=B8=87=E0=B8=87=E0=B8=B2=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/CommandController.ts | 74 ++++++++++++++++++++-------- 1 file changed, 54 insertions(+), 20 deletions(-) diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index c5e4ae57..4717e959 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -4759,8 +4759,8 @@ export class CommandController extends Controller { mouthSalaryAmount?: Double | null; commandNo: string | null; commandYear: number | null; - posNo: string | null; - posNoAbb: string | null; + // posNo: string | null; + // posNoAbb: string | null; commandDateAffect?: Date | null; commandDateSign?: Date | null; positionName: string | null; @@ -5458,17 +5458,49 @@ export class CommandController extends Controller { profile.lastUpdatedAt = new Date(); //เพิ่มใหม่จากรับโอน - profile.prefix = item.bodyProfile.prefix && item.bodyProfile.prefix != "" ? item.bodyProfile.prefix : profile.prefix; - profile.firstName = item.bodyProfile.firstName && item.bodyProfile.firstName != "" ? item.bodyProfile.firstName : profile.firstName; - profile.lastName = item.bodyProfile.lastName && item.bodyProfile.lastName != "" ? item.bodyProfile.lastName : profile.lastName; - profile.birthDate = item.bodyProfile.birthDate ? item.bodyProfile.birthDate : profile.birthDate; - profile.gender = item.bodyProfile.gender && item.bodyProfile.gender != "" ? item.bodyProfile.gender : profile.gender; - profile.relationship = item.bodyProfile.relationship && item.bodyProfile.relationship != "" ? item.bodyProfile.relationship : profile.relationship; - profile.religion = item.bodyProfile.religion && item.bodyProfile.religion != "" ? item.bodyProfile.religion : profile.religion; - profile.ethnicity = item.bodyProfile.ethnicity && item.bodyProfile.ethnicity != "" ? item.bodyProfile.ethnicity : profile.ethnicity; - profile.nationality = item.bodyProfile.nationality && item.bodyProfile.nationality != "" ? item.bodyProfile.nationality : profile.nationality; - profile.bloodGroup = item.bodyProfile.bloodGroup && item.bodyProfile.bloodGroup != "" ? item.bodyProfile.bloodGroup : profile.bloodGroup; - profile.phone = item.bodyProfile.phone && item.bodyProfile.phone != "" ? item.bodyProfile.phone : profile.phone; + profile.prefix = + item.bodyProfile.prefix && item.bodyProfile.prefix != "" + ? item.bodyProfile.prefix + : profile.prefix; + profile.firstName = + item.bodyProfile.firstName && item.bodyProfile.firstName != "" + ? item.bodyProfile.firstName + : profile.firstName; + profile.lastName = + item.bodyProfile.lastName && item.bodyProfile.lastName != "" + ? item.bodyProfile.lastName + : profile.lastName; + profile.birthDate = item.bodyProfile.birthDate + ? item.bodyProfile.birthDate + : profile.birthDate; + profile.gender = + item.bodyProfile.gender && item.bodyProfile.gender != "" + ? item.bodyProfile.gender + : profile.gender; + profile.relationship = + item.bodyProfile.relationship && item.bodyProfile.relationship != "" + ? item.bodyProfile.relationship + : profile.relationship; + profile.religion = + item.bodyProfile.religion && item.bodyProfile.religion != "" + ? item.bodyProfile.religion + : profile.religion; + profile.ethnicity = + item.bodyProfile.ethnicity && item.bodyProfile.ethnicity != "" + ? item.bodyProfile.ethnicity + : profile.ethnicity; + profile.nationality = + item.bodyProfile.nationality && item.bodyProfile.nationality != "" + ? item.bodyProfile.nationality + : profile.nationality; + profile.bloodGroup = + item.bodyProfile.bloodGroup && item.bodyProfile.bloodGroup != "" + ? item.bodyProfile.bloodGroup + : profile.bloodGroup; + profile.phone = + item.bodyProfile.phone && item.bodyProfile.phone != "" + ? item.bodyProfile.phone + : profile.phone; await this.profileRepository.save(profile); setLogDataDiff(req, { before, after: profile }); } @@ -5868,11 +5900,11 @@ export class CommandController extends Controller { positionType: profile.posTypeNameTemp, positionLevel: profile.posLevelNameTemp, order: dest_item == null ? 1 : dest_item.order + 1, - orgRoot: orgRootRef?.orgRootName??null, - orgChild1: orgChild1Ref?.orgChild1Name??null, - orgChild2: orgChild2Ref?.orgChild2Name??null, - orgChild3: orgChild3Ref?.orgChild3Name??null, - orgChild4: orgChild4Ref?.orgChild4Name??null, + orgRoot: orgRootRef?.orgRootName ?? null, + orgChild1: orgChild1Ref?.orgChild1Name ?? null, + orgChild2: orgChild2Ref?.orgChild2Name ?? null, + orgChild3: orgChild3Ref?.orgChild3Name ?? null, + orgChild4: orgChild4Ref?.orgChild4Name ?? null, createdUserId: req.user.sub, createdFullName: req.user.name, lastUpdateUserId: req.user.sub, @@ -6070,8 +6102,10 @@ export class CommandController extends Controller { current_holderId: profile.id, }, }); - if(posMasterTemp){ - await this.employeeTempPosMasterRepository.update(posMasterTemp.id,{current_holderId: _null}); + if (posMasterTemp) { + await this.employeeTempPosMasterRepository.update(posMasterTemp.id, { + current_holderId: _null, + }); } } }),