ออกคำสั่งทดลองงาน

This commit is contained in:
mamoss 2025-05-08 12:29:06 +07:00
parent 5584124772
commit 90f6b5061a

View file

@ -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,
});
}
}
}),