From 3fb223f992e213f179885f63ea9f49106be96ae7 Mon Sep 17 00:00:00 2001 From: kittapath Date: Thu, 26 Dec 2024 19:35:39 +0700 Subject: [PATCH] no message --- src/controllers/CommandController.ts | 47 ++++++++++++++-------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index 20f7b230..7537cc0c 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -1780,8 +1780,7 @@ export class CommandController extends Controller { }, select: ["orgRootId"], }); - } - else { + } else { posMaster = await this.posMasterRepository.find({ where: { current_holderId: In(requestBody.persons.map((x) => x.profileId)), @@ -1790,12 +1789,12 @@ export class CommandController extends Controller { select: ["orgRootId"], }); } - + let _posMaster: any; if (["C-PM-38", "C-PM-40"].includes(commandCode)) { _posMaster = await this.posMasterRepository.find({ where: { - orgRootId: In(posMaster.map((x:any) => x.orgRootId)), + orgRootId: In(posMaster.map((x: any) => x.orgRootId)), orgChild1: IsNull(), orgChild2: IsNull(), orgChild3: IsNull(), @@ -1809,7 +1808,7 @@ export class CommandController extends Controller { } else { _posMaster = await this.posMasterRepository.find({ where: { - orgRootId: In(posMaster.map((x:any) => x.orgRootId)), + orgRootId: In(posMaster.map((x: any) => x.orgRootId)), orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true }, isDirector: true, current_holderId: Not(IsNull()), @@ -4166,28 +4165,28 @@ export class CommandController extends Controller { history.profileSalaryId = data.id; await this.salaryHistoryRepo.save(history, { data: req }); - if (profile != null) { - profile.position = position?.positionName ?? ""; - profile.posTypeId = position?.posTypeId ?? ""; - profile.posLevelId = position?.posLevelId ?? ""; - profile.lastUpdateUserId = req.user.sub; - profile.lastUpdateFullName = req.user.name; - profile.lastUpdatedAt = new Date(); - await this.profileRepository.save(profile); - } + // if (profile != null) { + // profile.position = position?.positionName ?? ""; + // profile.posTypeId = position?.posTypeId ?? ""; + // profile.posLevelId = position?.posLevelId ?? ""; + // profile.lastUpdateUserId = req.user.sub; + // profile.lastUpdateFullName = req.user.name; + // profile.lastUpdatedAt = new Date(); + // await this.profileRepository.save(profile); + // } } }), ); - const posMasters = await this.posMasterRepository.find({ - where: { id: In(body.refIds.map((x) => x.refId)) }, - }); - const data = posMasters.map((_data) => ({ - ..._data, - current_holderId: _data.next_holderId, - next_holderId: null, - statusReport: "PENDING", - })); - await this.posMasterRepository.save(data); + // const posMasters = await this.posMasterRepository.find({ + // where: { id: In(body.refIds.map((x) => x.refId)) }, + // }); + // const data = posMasters.map((_data) => ({ + // ..._data, + // current_holderId: _data.next_holderId, + // next_holderId: null, + // statusReport: "PENDING", + // })); + // await this.posMasterRepository.save(data); return new HttpSuccess(); }