From 6d13f7b598ef77425b64d0be17230b08b4e2c148 Mon Sep 17 00:00:00 2001 From: Bright Date: Fri, 8 Nov 2024 12:11:01 +0700 Subject: [PATCH] add field commandDate & education --- src/controllers/CommandController.ts | 1 + src/controllers/ProfileController.ts | 13 ++++++++++--- src/controllers/ProfileEmployeeController.ts | 13 ++++++++++--- src/controllers/ProfileEmployeeTempController.ts | 10 +++++++++- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index f870a28f..17937242 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -1324,6 +1324,7 @@ export class CommandController extends Controller { RemarkHorizontal: x.remarkHorizontal, RemarkVertical: x.remarkVertical, CommandYear: command.commandYear, + CommandExcecuteDate: command.commandExcecuteDate })), }) .then(async (res) => { diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 4a250df9..708b5fc0 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -5278,11 +5278,15 @@ export class ProfileController extends Controller { "current_holders", "current_holders.orgRoot", "profileSalary", + "profileEducations" ], order: { - profileSalary: { - order: "DESC", - }, + // profileSalary: { + // order: "DESC", + // }, + profileEducations: { + createdAt: "DESC" + } }, }); if (!profile) { @@ -5461,6 +5465,9 @@ export class ProfileController extends Controller { isPosmasterAct: data.length > 0, posmasterAct: data, salary: profile ? profile.amount : null, + education: profile && profile.profileEducations.length > 0 + ? `${profile.profileEducations[0].degree ?? ""}-${profile.profileEducations[0].field ?? ""}` + : "-" }; if (_profile.child4Id != null) { diff --git a/src/controllers/ProfileEmployeeController.ts b/src/controllers/ProfileEmployeeController.ts index 4d66fceb..798f7ed1 100644 --- a/src/controllers/ProfileEmployeeController.ts +++ b/src/controllers/ProfileEmployeeController.ts @@ -3833,11 +3833,15 @@ export class ProfileEmployeeController extends Controller { "current_holders", "current_holders.orgRoot", "profileSalary", + "profileEducations" ], order: { - profileSalary: { - order: "DESC", - }, + // profileSalary: { + // order: "DESC", + // }, + profileEducations: { + createdAt: "DESC" + } }, }); if (!profile) { @@ -3961,6 +3965,9 @@ export class ProfileEmployeeController extends Controller { posNo: shortName, salary: profile && profile.profileSalary.length > 0 ? profile.profileSalary[0].amount : null, + education: profile && profile.profileEducations.length > 0 + ? `${profile.profileEducations[0].degree ?? ""}-${profile.profileEducations[0].field ?? ""}` + : "-" }; if (_profile.child4Id != null) { diff --git a/src/controllers/ProfileEmployeeTempController.ts b/src/controllers/ProfileEmployeeTempController.ts index 41d3a162..e185420d 100644 --- a/src/controllers/ProfileEmployeeTempController.ts +++ b/src/controllers/ProfileEmployeeTempController.ts @@ -3416,7 +3416,12 @@ export class ProfileEmployeeTempController extends Controller { // await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน const profile = await this.profileRepo.findOne({ where: { id: id }, - relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot"], + relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot", "profileEducations"], + order: { + profileEducations: { + createdAt: "DESC" + } + } }); if (!profile) { throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ"); @@ -3536,6 +3541,9 @@ export class ProfileEmployeeTempController extends Controller { node: null, nodeId: null, posNo: shortName, + education: profile && profile.profileEducations.length > 0 + ? `${profile.profileEducations[0].degree ?? ""}-${profile.profileEducations[0].field ?? ""}` + : "-" }; if (_profile.child4Id != null) {