From dcbda3b94e7d66ddf98c9d920133a678ed32d079 Mon Sep 17 00:00:00 2001 From: Bright Date: Wed, 25 Dec 2024 10:46:04 +0700 Subject: [PATCH 1/5] =?UTF-8?q?fix=20issue=20#880=20=E0=B8=84=E0=B8=B3?= =?UTF-8?q?=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87=E0=B9=80=E0=B8=A5=E0=B8=B7?= =?UTF-8?q?=E0=B9=88=E0=B8=AD=E0=B8=99=E0=B8=84=E0=B9=88=E0=B8=B2=E0=B8=88?= =?UTF-8?q?=E0=B9=89=E0=B8=B2=E0=B8=87=E0=B8=A5=E0=B8=B9=E0=B8=81=E0=B8=88?= =?UTF-8?q?=E0=B9=89=E0=B8=B2=E0=B8=87=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=88?= =?UTF-8?q?=E0=B8=B3=20>=20=E0=B9=84=E0=B8=A1=E0=B9=88=E0=B9=81=E0=B8=AA?= =?UTF-8?q?=E0=B8=94=E0=B8=87=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=8A=E0=B8=B7?= =?UTF-8?q?=E0=B9=88=E0=B8=AD=E0=B8=9C=E0=B8=B9=E0=B9=89=E0=B9=84=E0=B8=94?= =?UTF-8?q?=E0=B9=89=E0=B8=A3=E0=B8=B1=E0=B8=9A=E0=B8=AA=E0=B8=B3=E0=B9=80?= =?UTF-8?q?=E0=B8=99=E0=B8=B2=E0=B8=84=E0=B8=B3=E0=B8=AA=E0=B8=B1=E0=B9=88?= =?UTF-8?q?=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/CommandController.ts | 31 ++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index 3c91dd85..20f7b230 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -1771,18 +1771,31 @@ export class CommandController extends Controller { .catch(() => {}); if (requestBody.persons != undefined && requestBody.persons.length > 0) { - const posMaster = await this.posMasterRepository.find({ - where: { - current_holderId: In(requestBody.persons.map((x) => x.profileId)), - orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true }, - }, - select: ["orgRootId"], - }); + let posMaster: any; + if (["C-PM-36", "C-PM-37"].includes(commandCode)) { + posMaster = await this.employeePosMasterRepository.find({ + where: { + current_holderId: In(requestBody.persons.map((x) => x.profileId)), + orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true }, + }, + select: ["orgRootId"], + }); + } + else { + posMaster = await this.posMasterRepository.find({ + where: { + current_holderId: In(requestBody.persons.map((x) => x.profileId)), + orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true }, + }, + 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) => x.orgRootId)), + orgRootId: In(posMaster.map((x:any) => x.orgRootId)), orgChild1: IsNull(), orgChild2: IsNull(), orgChild3: IsNull(), @@ -1796,7 +1809,7 @@ export class CommandController extends Controller { } else { _posMaster = await this.posMasterRepository.find({ where: { - orgRootId: In(posMaster.map((x) => x.orgRootId)), + orgRootId: In(posMaster.map((x:any) => x.orgRootId)), orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true }, isDirector: true, current_holderId: Not(IsNull()), From 12ae8172d5c79e5028a12059f38b1cdcec21b0f9 Mon Sep 17 00:00:00 2001 From: Bright Date: Wed, 25 Dec 2024 12:24:32 +0700 Subject: [PATCH 2/5] =?UTF-8?q?fix=20=E0=B8=A5=E0=B8=9A=E0=B8=A3=E0=B8=B2?= =?UTF-8?q?=E0=B8=A2=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=81=E0=B8=A5=E0=B8=B8?= =?UTF-8?q?=E0=B9=88=E0=B8=A1=E0=B8=87=E0=B8=B2=E0=B8=99=E0=B8=A5=E0=B8=B9?= =?UTF-8?q?=E0=B8=81=E0=B8=88=E0=B9=89=E0=B8=B2=E0=B8=87=E0=B8=9B=E0=B8=A3?= =?UTF-8?q?=E0=B8=B0=E0=B8=88=E0=B8=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/EmployeePosTypeController.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/controllers/EmployeePosTypeController.ts b/src/controllers/EmployeePosTypeController.ts index aedabafe..a7600a10 100644 --- a/src/controllers/EmployeePosTypeController.ts +++ b/src/controllers/EmployeePosTypeController.ts @@ -141,10 +141,11 @@ export class EmployeePosTypeController extends Controller { async deleteType(@Path() id: string, @Request() request: RequestWithUser) { let result: any; try { - result = await this.employeePosTypeRepository.findOne({ - where: { id: id }, - }); - await this.employeePosTypeRepository.remove(result, { data: request }); + // result = await this.employeePosTypeRepository.findOne({ + // where: { id: id }, + // }); + // await this.employeePosTypeRepository.remove(result, { data: request }); + result = await this.employeePosTypeRepository.delete({ id: id }); } catch { throw new HttpError( HttpStatusCode.NOT_FOUND, From 6dc7f9bd7e3f20aa3528ec8560373adf99b79b95 Mon Sep 17 00:00:00 2001 From: Bright Date: Wed, 25 Dec 2024 13:25:26 +0700 Subject: [PATCH 3/5] =?UTF-8?q?fix=20=E0=B8=81=E0=B8=A3=E0=B8=93=E0=B8=B5?= =?UTF-8?q?=E0=B8=84=E0=B8=B0=E0=B9=81=E0=B8=99=E0=B8=99=E0=B9=80=E0=B8=81?= =?UTF-8?q?=E0=B8=B4=E0=B8=99=20100=20=E0=B8=9C=E0=B8=A5=E0=B8=9B=E0=B8=A3?= =?UTF-8?q?=E0=B8=B0=E0=B9=80=E0=B8=A1=E0=B8=B4=E0=B8=99=E0=B9=81=E0=B8=AA?= =?UTF-8?q?=E0=B8=94=E0=B8=87=20(-)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/OrganizationUnauthorizeController.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/controllers/OrganizationUnauthorizeController.ts b/src/controllers/OrganizationUnauthorizeController.ts index 216e2f8f..efa49a38 100644 --- a/src/controllers/OrganizationUnauthorizeController.ts +++ b/src/controllers/OrganizationUnauthorizeController.ts @@ -947,6 +947,7 @@ export class OrganizationUnauthorizeController extends Controller { if (val >= 70 && val <= 79) return "ดี"; if (val >= 80 && val <= 89) return "ดีมาก"; if (val >= 90 && val <= 100) return "ดีเด่น"; + if (val > 101 ) return "ดีเด่น"; else return "-"; } From 2d6cf2524b8c63a99382d3ef7c4ad311face09f6 Mon Sep 17 00:00:00 2001 From: Bright Date: Wed, 25 Dec 2024 16:00:33 +0700 Subject: [PATCH 4/5] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88?= =?UTF-8?q?=E0=B8=A1=E0=B8=9F=E0=B8=B4=E0=B8=A5=E0=B8=94=E0=B9=8C=20posNo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/ProfileController.ts | 6 ++++++ src/controllers/ProfileEmployeeController.ts | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index a26979ad..2c763f0d 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -4810,6 +4810,9 @@ export class ProfileController extends Controller { nodeId: null, type: profile.employeeClass, salary: profile.amount, + posNo : root?.orgRootShortName && posMaster?.posMasterNo + ? `${root?.orgRootShortName}${posMaster?.posMasterNo}` + : "" }; if (_profile.child4Id != null) { _profile.node = 4; @@ -4951,6 +4954,9 @@ export class ProfileController extends Controller { nodeId: null, salary: profile ? profile.amount : null, amountSpecial: profile ? profile.amountSpecial : null, + posNo : root?.orgRootShortName && posMaster?.posMasterNo + ? `${root?.orgRootShortName}${posMaster?.posMasterNo}` + : "" }; if (_profile.child4Id != null) { diff --git a/src/controllers/ProfileEmployeeController.ts b/src/controllers/ProfileEmployeeController.ts index 60f75640..02cf1e6e 100644 --- a/src/controllers/ProfileEmployeeController.ts +++ b/src/controllers/ProfileEmployeeController.ts @@ -2153,6 +2153,9 @@ export class ProfileEmployeeController extends Controller { nodeId: null, salary: profile ? profile.amount : null, amountSpecial: profile ? profile.amountSpecial : null, + posNo : root?.orgRootShortName && posMaster?.posMasterNo + ? `${root?.orgRootShortName}${posMaster?.posMasterNo}` + : "" }; return new HttpSuccess(_profile); } From 389bec8ec8dd4e439eb2b886428ed4e0a9d62163 Mon Sep 17 00:00:00 2001 From: kittapath Date: Wed, 25 Dec 2024 20:59:03 +0700 Subject: [PATCH 5/5] no message --- .../OrganizationDotnetController.ts | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/controllers/OrganizationDotnetController.ts b/src/controllers/OrganizationDotnetController.ts index 12da3cec..47bddb35 100644 --- a/src/controllers/OrganizationDotnetController.ts +++ b/src/controllers/OrganizationDotnetController.ts @@ -2113,12 +2113,12 @@ export class OrganizationDotnetController extends Controller { id: profile.id, avatar: profile.avatar, avatarName: profile.avatarName, - rank: profile.rank, - prefix: profile.prefix, - firstName: profile.firstName, - lastName: profile.lastName, - citizenId: profile.citizenId, - position: profile.position, + rank: profile.rank ?? "", + prefix: profile.prefix ?? "", + firstName: profile.firstName ?? "", + lastName: profile.lastName ?? "", + citizenId: profile.citizenId ?? "", + position: profile.position ?? "", posLevelId: profile.posLevelId, posTypeId: profile.posTypeId, email: profile.email, @@ -2137,10 +2137,10 @@ export class OrganizationDotnetController extends Controller { reasonSameDate: profile.reasonSameDate, telephoneNumber: profile.telephoneNumber, nationality: profile.nationality, - gender: profile.gender, - relationship: profile.relationship, - religion: profile.religion, - bloodGroup: profile.bloodGroup, + gender: profile.gender ?? "", + relationship: profile.relationship ?? "", + religion: profile.religion ?? "", + bloodGroup: profile.bloodGroup ?? "", registrationAddress: profile.registrationAddress, registrationProvinceId: profile.registrationProvinceId, registrationDistrictId: profile.registrationDistrictId, @@ -2152,8 +2152,8 @@ export class OrganizationDotnetController extends Controller { currentZipCode: profile.currentZipCode, dutyTimeId: profile.dutyTimeId, dutyTimeEffectiveDate: profile.dutyTimeEffectiveDate, - posLevel: profile.posLevel?.posLevelName ?? null, - posType: profile.posType?.posTypeName ?? null, + posLevel: profile.posLevel?.posLevelName ?? "", + posType: profile.posType?.posTypeName ?? "", profileSalary: profile.profileSalary, profileInsignia: profile.profileInsignias.map((x) => { return { ...x, insignia: x.insignia.name }; @@ -2174,7 +2174,7 @@ export class OrganizationDotnetController extends Controller { x.orgRevision?.orgRevisionIsDraft == false && x.orgRevision?.orgRevisionIsCurrent == true, )?.orgRootId ?? null, - posNo: shortName, + posNo: shortName ?? "", }; });