From 55085ab8d8bfe918058bc87a9a3407e9836498c5 Mon Sep 17 00:00:00 2001 From: harid Date: Wed, 4 Feb 2026 16:32:25 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=81=E0=B8=A3=E0=B8=AD=E0=B8=87=20isDelete?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/CommandController.ts | 1 + src/controllers/PosMasterActController.ts | 2 +- src/controllers/ProfileActpositionEmployeeController.ts | 4 ++-- src/controllers/ProfileActpositionEmployeeTempController.ts | 4 ++-- src/controllers/ProfileController.ts | 2 +- src/controllers/ProfileDevelopmentEmployeeController.ts | 4 ++-- src/controllers/ProfileDevelopmentEmployeeTempController.ts | 4 ++-- src/controllers/ProfileEmployeeController.ts | 2 +- src/controllers/ProfileTrainingEmployeeController.ts | 4 ++-- src/controllers/ProfileTrainingEmployeeTempController.ts | 4 ++-- 10 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index 45bfa186..0c5a8653 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -7502,6 +7502,7 @@ export class CommandController extends Controller { where: { profileId: item.posMasterChild.current_holderId, status: true, + isDeleted: false }, }); diff --git a/src/controllers/PosMasterActController.ts b/src/controllers/PosMasterActController.ts index 061d014e..7c63ede5 100644 --- a/src/controllers/PosMasterActController.ts +++ b/src/controllers/PosMasterActController.ts @@ -599,7 +599,7 @@ export class PosMasterActController extends Controller { "lastUpdatedAt", "dateEnd", ], - where: { profileId, status: true }, + where: { profileId, status: true, isDeleted: false }, }); if (existingActivePositions.length > 0) { diff --git a/src/controllers/ProfileActpositionEmployeeController.ts b/src/controllers/ProfileActpositionEmployeeController.ts index 2ada7dd3..d6afcebe 100644 --- a/src/controllers/ProfileActpositionEmployeeController.ts +++ b/src/controllers/ProfileActpositionEmployeeController.ts @@ -40,7 +40,7 @@ export class ProfileActpositionEmployeeController extends Controller { throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว"); } const getProfileActpositionId = await this.profileActpositionRepo.find({ - where: { profileEmployeeId: profile.id }, + where: { profileEmployeeId: profile.id, isDeleted: false }, order: { createdAt: "ASC" }, }); if (!getProfileActpositionId) { @@ -58,7 +58,7 @@ export class ProfileActpositionEmployeeController extends Controller { if (_workflow == false) await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId); const getProfileActpositionId = await this.profileActpositionRepo.find({ - where: { profileEmployeeId: profileEmployeeId }, + where: { profileEmployeeId: profileEmployeeId, isDeleted: false }, order: { createdAt: "ASC" }, }); if (!getProfileActpositionId) { diff --git a/src/controllers/ProfileActpositionEmployeeTempController.ts b/src/controllers/ProfileActpositionEmployeeTempController.ts index 630cb785..1cf92baa 100644 --- a/src/controllers/ProfileActpositionEmployeeTempController.ts +++ b/src/controllers/ProfileActpositionEmployeeTempController.ts @@ -40,7 +40,7 @@ export class ProfileActpositionEmployeeTempController extends Controller { throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว"); } const getProfileActpositionId = await this.profileActpositionRepo.find({ - where: { profileEmployeeId: profile.id }, + where: { profileEmployeeId: profile.id, isDeleted: false }, order: { createdAt: "ASC" }, }); if (!getProfileActpositionId) { @@ -57,7 +57,7 @@ export class ProfileActpositionEmployeeTempController extends Controller { let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_TEMP"); if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP"); const getProfileActpositionId = await this.profileActpositionRepo.find({ - where: { profileEmployeeId: profileEmployeeId }, + where: { profileEmployeeId: profileEmployeeId, isDeleted: false }, order: { createdAt: "ASC" }, }); if (!getProfileActpositionId) { diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 4fe44943..41fe95e7 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -1505,7 +1505,7 @@ export class ProfileController extends Controller { const actposition_raw = await this.profileActpositionRepo.find({ select: ["dateStart", "dateEnd", "position"], - where: { profileId: id }, + where: { profileId: id, isDeleted: false }, order: { createdAt: "ASC" }, }); const assistance_raw = await this.profileAssistanceRepository.find({ diff --git a/src/controllers/ProfileDevelopmentEmployeeController.ts b/src/controllers/ProfileDevelopmentEmployeeController.ts index 76260a1b..2f5a7715 100644 --- a/src/controllers/ProfileDevelopmentEmployeeController.ts +++ b/src/controllers/ProfileDevelopmentEmployeeController.ts @@ -43,7 +43,7 @@ export class ProfileDevelopmentEmployeeController extends Controller { throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว"); } const lists = await this.developmentRepository.find({ - where: { profileEmployeeId: profile.id }, + where: { profileEmployeeId: profile.id, isDeleted: false }, order: { createdAt: "ASC" }, }); return new HttpSuccess(lists); @@ -65,7 +65,7 @@ export class ProfileDevelopmentEmployeeController extends Controller { let query = await AppDataSource.getRepository(ProfileDevelopment) .createQueryBuilder("profileDevelopment") - .where({ profileEmployeeId: profileId }) + .where({ profileEmployeeId: profileId, isDeleted: false }) .andWhere( new Brackets((qb) => { qb.where( diff --git a/src/controllers/ProfileDevelopmentEmployeeTempController.ts b/src/controllers/ProfileDevelopmentEmployeeTempController.ts index 84cfa074..9e8c2d26 100644 --- a/src/controllers/ProfileDevelopmentEmployeeTempController.ts +++ b/src/controllers/ProfileDevelopmentEmployeeTempController.ts @@ -41,7 +41,7 @@ export class ProfileDevelopmentEmployeeTempController extends Controller { throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว"); } const lists = await this.developmentRepository.find({ - where: { profileEmployeeId: profile.id }, + where: { profileEmployeeId: profile.id, isDeleted: false }, order: { createdAt: "ASC" }, }); return new HttpSuccess(lists); @@ -52,7 +52,7 @@ export class ProfileDevelopmentEmployeeTempController extends Controller { let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_TEMP"); if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP"); const lists = await this.developmentRepository.find({ - where: { profileEmployeeId: profileId }, + where: { profileEmployeeId: profileId, isDeleted: false }, order: { createdAt: "ASC" }, }); return new HttpSuccess(lists); diff --git a/src/controllers/ProfileEmployeeController.ts b/src/controllers/ProfileEmployeeController.ts index 008f0c67..e87adcac 100644 --- a/src/controllers/ProfileEmployeeController.ts +++ b/src/controllers/ProfileEmployeeController.ts @@ -1501,7 +1501,7 @@ export class ProfileEmployeeController extends Controller { const actposition_raw = await this.profileActpositionRepo.find({ select: ["dateStart", "dateEnd", "position"], - where: { profileEmployeeId: id }, + where: { profileEmployeeId: id, isDeleted: false }, order: { createdAt: "ASC" }, }); const assistance_raw = await this.profileAssistanceRepository.find({ diff --git a/src/controllers/ProfileTrainingEmployeeController.ts b/src/controllers/ProfileTrainingEmployeeController.ts index 60f1c2ac..d9f824a8 100644 --- a/src/controllers/ProfileTrainingEmployeeController.ts +++ b/src/controllers/ProfileTrainingEmployeeController.ts @@ -40,7 +40,7 @@ export class ProfileTrainingEmployeeController extends Controller { throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว"); } const record = await this.trainingRepo.find({ - where: { profileEmployeeId: profile.id }, + where: { profileEmployeeId: profile.id, isDeleted: false }, order: { createdAt: "ASC" }, }); return new HttpSuccess(record); @@ -52,7 +52,7 @@ export class ProfileTrainingEmployeeController extends Controller { if (_workflow == false) await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId); const record = await this.trainingRepo.find({ - where: { profileEmployeeId }, + where: { profileEmployeeId, isDeleted: false }, order: { createdAt: "ASC" }, }); return new HttpSuccess(record); diff --git a/src/controllers/ProfileTrainingEmployeeTempController.ts b/src/controllers/ProfileTrainingEmployeeTempController.ts index 64e6fdcd..46e1686e 100644 --- a/src/controllers/ProfileTrainingEmployeeTempController.ts +++ b/src/controllers/ProfileTrainingEmployeeTempController.ts @@ -40,7 +40,7 @@ export class ProfileTrainingEmployeeTempController extends Controller { throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว"); } const record = await this.trainingRepo.find({ - where: { profileEmployeeId: profile.id }, + where: { profileEmployeeId: profile.id, isDeleted: false }, order: { createdAt: "ASC" }, }); return new HttpSuccess(record); @@ -51,7 +51,7 @@ export class ProfileTrainingEmployeeTempController extends Controller { let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_TEMP"); if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP"); const record = await this.trainingRepo.find({ - where: { profileEmployeeId }, + where: { profileEmployeeId, isDeleted: false }, order: { createdAt: "ASC" }, }); return new HttpSuccess(record);