fix issue #1175 (ข้อมูลตัวย่อตำแหน่ง ไม่บันทึกลงทะเบียนประวัติหลังจากออกคำสั่ง)
This commit is contained in:
parent
ec14148d72
commit
a7e12be51f
1 changed files with 32 additions and 2 deletions
|
|
@ -4707,7 +4707,37 @@ export class CommandController extends Controller {
|
|||
if (!profile) {
|
||||
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
|
||||
}
|
||||
|
||||
const _posMaster = await this.employeePosMasterRepository.findOne({
|
||||
where: {
|
||||
orgRevision: {
|
||||
orgRevisionIsCurrent: true,
|
||||
orgRevisionIsDraft: false,
|
||||
},
|
||||
current_holderId: profile.id,
|
||||
},
|
||||
order: { createdAt: "DESC" },
|
||||
relations: {
|
||||
orgRoot: true,
|
||||
orgChild1: true,
|
||||
orgChild2: true,
|
||||
orgChild3: true,
|
||||
orgChild4: true,
|
||||
},
|
||||
});
|
||||
let orgShortName = "";
|
||||
if (_posMaster != null) {
|
||||
if (_posMaster.orgChild1Id === null) {
|
||||
orgShortName = _posMaster.orgRoot?.orgRootShortName;
|
||||
} else if (_posMaster.orgChild2Id === null) {
|
||||
orgShortName = _posMaster.orgChild1?.orgChild1ShortName;
|
||||
} else if (_posMaster.orgChild3Id === null) {
|
||||
orgShortName = _posMaster.orgChild2?.orgChild2ShortName;
|
||||
} else if (_posMaster.orgChild4Id === null) {
|
||||
orgShortName = _posMaster.orgChild3?.orgChild3ShortName;
|
||||
} else {
|
||||
orgShortName = _posMaster.orgChild4?.orgChild4ShortName;
|
||||
}
|
||||
}
|
||||
const dest_item = await this.salaryRepo.findOne({
|
||||
where: { profileEmployeeId: item.refId },
|
||||
order: { order: "DESC" },
|
||||
|
|
@ -4723,7 +4753,7 @@ export class CommandController extends Controller {
|
|||
commandId: item.commandId,
|
||||
positionSalaryAmount: item.positionSalaryAmount,
|
||||
mouthSalaryAmount: item.mouthSalaryAmount,
|
||||
posNo: profile.posMasterNoTemp,
|
||||
posNo: `${orgShortName ?? ""} ${profile.posMasterNoTemp ?? ""}`,
|
||||
position: profile.positionTemp,
|
||||
positionType: profile.posTypeNameTemp,
|
||||
positionLevel: profile.posLevelNameTemp,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue