This commit is contained in:
kittapath 2025-02-05 15:38:21 +07:00
parent 4aae619e90
commit b0b1e06a78
5 changed files with 350 additions and 38 deletions

View file

@ -4749,7 +4749,7 @@ export class CommandController extends Controller {
const posMaster = await this.employeePosMasterRepository.findOne({
where: { id: profile.posmasterIdTemp },
relations: ["orgRoot"],
relations: ["orgRoot", "orgChild1", "orgChild2", "orgChild3", "orgChild4"],
});
if (posMaster == null)
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งนี้");
@ -4865,6 +4865,10 @@ export class CommandController extends Controller {
rootId: posMaster.orgRootId,
rootShortName: posMaster.orgRoot.orgRootShortName,
rootDnaId: posMaster.orgRoot.ancestorDNA,
child1DnaId: posMaster.orgChild1.ancestorDNA,
child2DnaId: posMaster.orgChild2.ancestorDNA,
child3DnaId: posMaster.orgChild3.ancestorDNA,
child4DnaId: posMaster.orgChild4.ancestorDNA,
});
await this.profileEmployeeRepository.save(profile);
await this.employeePositionRepository.save(positionNew);
@ -4872,9 +4876,9 @@ export class CommandController extends Controller {
}),
);
await new CallAPI()
.PostData(req,
"/placement/appointment/employee-appoint-21/report/excecute", { profileEmps: _reqBody }
)
.PostData(req, "/placement/appointment/employee-appoint-21/report/excecute", {
profileEmps: _reqBody,
})
.catch((error) => {
throw new Error("Failed. Cannot update status. ", error);
});