From ce39e89ccebe71f2e389a13997365840630d28af Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Wed, 16 Jul 2025 11:11:48 +0700 Subject: [PATCH 01/10] update --- src/controllers/DevelopmentController.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/controllers/DevelopmentController.ts b/src/controllers/DevelopmentController.ts index 77986d2..5aa9632 100644 --- a/src/controllers/DevelopmentController.ts +++ b/src/controllers/DevelopmentController.ts @@ -2678,6 +2678,7 @@ export class DevelopmentController extends Controller { startDate: x.dateStart, endDate: x.dateEnd, isDate: true, + isEntry: false, developmentId: id, }) .then((x) => { @@ -2701,6 +2702,7 @@ export class DevelopmentController extends Controller { startDate: x.dateStart, endDate: x.dateEnd, isDate: true, + isEntry: false, developmentId: id, }) .then((x) => { From b95d59783b50ba3d30eb1540fcf26ab24d265eaa Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Wed, 16 Jul 2025 14:26:48 +0700 Subject: [PATCH 02/10] update --- src/controllers/DevelopmentController.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/controllers/DevelopmentController.ts b/src/controllers/DevelopmentController.ts index 5aa9632..77986d2 100644 --- a/src/controllers/DevelopmentController.ts +++ b/src/controllers/DevelopmentController.ts @@ -2678,7 +2678,6 @@ export class DevelopmentController extends Controller { startDate: x.dateStart, endDate: x.dateEnd, isDate: true, - isEntry: false, developmentId: id, }) .then((x) => { @@ -2702,7 +2701,6 @@ export class DevelopmentController extends Controller { startDate: x.dateStart, endDate: x.dateEnd, isDate: true, - isEntry: false, developmentId: id, }) .then((x) => { From e78811dfd6bf5e903189964422180028d7afef6f Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Wed, 16 Jul 2025 15:10:37 +0700 Subject: [PATCH 03/10] #963 , #964 --- src/controllers/DevelopmentEmployeeHistoryController.ts | 1 + src/controllers/DevelopmentHistoryController.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/controllers/DevelopmentEmployeeHistoryController.ts b/src/controllers/DevelopmentEmployeeHistoryController.ts index 2b8054f..2fb81f3 100644 --- a/src/controllers/DevelopmentEmployeeHistoryController.ts +++ b/src/controllers/DevelopmentEmployeeHistoryController.ts @@ -403,6 +403,7 @@ export class DevelopmentEmployeeHistoryController extends Controller { dateStart: getDevelopment.development != null ? getDevelopment.development.dateStart : null, dateEnd: getDevelopment.development != null ? getDevelopment.development.dateEnd : null, totalDate: getDevelopment.development != null ? getDevelopment.development.totalDate : null, + trainingDays: getDevelopment.development != null ? getDevelopment.trainingDays : null, // addressAcademic: // getDevelopment.development != null ? getDevelopment.development.addressAcademic : null, // topicAcademic: diff --git a/src/controllers/DevelopmentHistoryController.ts b/src/controllers/DevelopmentHistoryController.ts index 5ab0f55..edb65eb 100644 --- a/src/controllers/DevelopmentHistoryController.ts +++ b/src/controllers/DevelopmentHistoryController.ts @@ -390,6 +390,7 @@ export class DevelopmentOfficerHistoryController extends Controller { dateStart: getDevelopment.development != null ? getDevelopment.development.dateStart : null, dateEnd: getDevelopment.development != null ? getDevelopment.development.dateEnd : null, totalDate: getDevelopment.development != null ? getDevelopment.development.totalDate : null, + trainingDays: getDevelopment.development != null ? getDevelopment.trainingDays : null, // addressAcademic: // getDevelopment.development != null ? getDevelopment.development.addressAcademic : null, // topicAcademic: From 06385990b56e691ea45e0652675d5996e8d38a2f Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Wed, 16 Jul 2025 16:36:14 +0700 Subject: [PATCH 04/10] #1635 --- src/controllers/DevelopmentController.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/DevelopmentController.ts b/src/controllers/DevelopmentController.ts index 77986d2..8bc84cf 100644 --- a/src/controllers/DevelopmentController.ts +++ b/src/controllers/DevelopmentController.ts @@ -1551,7 +1551,7 @@ export class DevelopmentController extends Controller { if (!development) { throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลโครงการ/หลักสูตรการฝึกอบรมนี้"); } - Object.assign(development, { ...requestBody, developmentAddresss: [] }); + Object.assign(development, { ...requestBody}); development.lastUpdateUserId = request.user.sub; development.lastUpdateFullName = request.user.name; development.lastUpdatedAt = new Date(); From 9f21a4d49866b1e921c556ebdb59b15f4c132d85 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Thu, 17 Jul 2025 18:21:01 +0700 Subject: [PATCH 05/10] #1412 --- src/controllers/DevelopmentController.ts | 75 ++++++------------------ 1 file changed, 19 insertions(+), 56 deletions(-) diff --git a/src/controllers/DevelopmentController.ts b/src/controllers/DevelopmentController.ts index 8bc84cf..1bb0417 100644 --- a/src/controllers/DevelopmentController.ts +++ b/src/controllers/DevelopmentController.ts @@ -1946,6 +1946,9 @@ export class DevelopmentController extends Controller { developmentProjectTechniqueActuals: true, developmentEvaluations: true, developmentAddresss: true, + developmentRisks: true, + developmentHistorys: true, + developmentOthers: true, }, }); if (!development) { @@ -1959,92 +1962,46 @@ export class DevelopmentController extends Controller { const plannedGoalPosition = await this.plannedGoalPositionRepository.find({ where: { plannedGoalId: In(development.developmentPlannedGoals.map((x) => x.id)) }, }); - // addLogSequence(request, { - // action: "remove", - // status: "success", - // description: "Remove PlannedGoalPosition.", - // }); await this.plannedGoalPositionRepository.remove(plannedGoalPosition, { data: request }); } - // addLogSequence(request, { - // action: "remove", - // status: "success", - // description: "Remove ActualPeople.", - // }); await this.actualPeopleRepository.remove(development.developmentActualPeoples, { data: request, }); - // addLogSequence(request, { - // action: "remove", - // status: "success", - // description: "Remove PlannedPeople.", - // }); await this.plannedPeopleRepository.remove(development.developmentPlannedPeoples, { data: request, }); - // addLogSequence(request, { - // action: "remove", - // status: "success", - // description: "Remove ActualGoal.", - // }); await this.actualGoalRepository.remove(development.developmentActualGoals, { data: request }); - // addLogSequence(request, { - // action: "remove", - // status: "success", - // description: "Remove PlannedGoal.", - // }); await this.plannedGoalRepository.remove(development.developmentPlannedGoals, { data: request }); - // addLogSequence(request, { - // action: "remove", - // status: "success", - // description: "Remove DevelopmentProjectType.", - // }); await this.developmentProjectTypeRepository.remove(development.developmentProjectTypes, { data: request, }); - // addLogSequence(request, { - // action: "remove", - // status: "success", - // description: "Remove DevelopmentProjectTechniquePlanned.", - // }); await this.developmentProjectTechniquePlannedRepository.remove( development.developmentProjectTechniquePlanneds, { data: request, }, ); - // addLogSequence(request, { - // action: "remove", - // status: "success", - // description: "Remove DevelopmentProjectTechniqueActuals.", - // }); await this.developmentProjectTechniqueActualRepository.remove( development.developmentProjectTechniqueActuals, { data: request, }, ); - // addLogSequence(request, { - // action: "remove", - // status: "success", - // description: "Remove DevelopmentEvaluation.", - // }); await this.developmentEvaluationRepository.remove(development.developmentEvaluations, { data: request, }); - // addLogSequence(request, { - // action: "remove", - // status: "success", - // description: "Remove DevelopmentAddresss.", - // }); await this.developmentAddresssRepository.remove(development.developmentAddresss, { data: request, }); - // addLogSequence(request, { - // action: "remove", - // status: "success", - // description: "Remove Development.", - // }); + await this.developmentRiskRepository.remove(development.developmentRisks, { + data: request, + }); + await this.developmentHistoryRepository.remove(development.developmentHistorys, { + data: request, + }); + await this.developmentOtherRepository.remove(development.developmentOthers, { + data: request, + }); await this.developmentRepository.remove(development, { data: request }); return new HttpSuccess(); } @@ -2786,7 +2743,13 @@ export class DevelopmentController extends Controller { techniqueActuals.length > 0 && dev20Lists.some((item) => techniqueActuals.includes(item)); isDevelopment10 = techniqueActuals.length > 0 && dev10Lists.some((item) => techniqueActuals.includes(item)); - + + console.log("x.development?.developmentProjectTechniqueActuals",x.development?.developmentProjectTechniqueActuals); + console.log("techniqueActuals",techniqueActuals); + console.log("isDevelopment70",isDevelopment70); + console.log("isDevelopment20",isDevelopment20); + console.log("isDevelopment10",isDevelopment10); + if (x.type == "OFFICER") { await new CallAPI() .PostData(request, "/org/profile/development", { From 8c51bcc920c77a48f2a7500cb974577739836001 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Thu, 24 Jul 2025 13:41:09 +0700 Subject: [PATCH 06/10] delete log --- src/controllers/DevelopmentController.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/controllers/DevelopmentController.ts b/src/controllers/DevelopmentController.ts index 1bb0417..0642d60 100644 --- a/src/controllers/DevelopmentController.ts +++ b/src/controllers/DevelopmentController.ts @@ -2743,12 +2743,6 @@ export class DevelopmentController extends Controller { techniqueActuals.length > 0 && dev20Lists.some((item) => techniqueActuals.includes(item)); isDevelopment10 = techniqueActuals.length > 0 && dev10Lists.some((item) => techniqueActuals.includes(item)); - - console.log("x.development?.developmentProjectTechniqueActuals",x.development?.developmentProjectTechniqueActuals); - console.log("techniqueActuals",techniqueActuals); - console.log("isDevelopment70",isDevelopment70); - console.log("isDevelopment20",isDevelopment20); - console.log("isDevelopment10",isDevelopment10); if (x.type == "OFFICER") { await new CallAPI() From 0f5b9401adc7c5d045a2c9114c5471b5542daaf6 Mon Sep 17 00:00:00 2001 From: kittapath-Jool Date: Fri, 1 Aug 2025 15:50:28 +0700 Subject: [PATCH 07/10] delete dna post --- .github/workflows/release.yaml | 72 +++++++++++++------------- src/entities/DevelopmentScholarship.ts | 2 +- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0d19c5a..6916881 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -67,40 +67,40 @@ jobs: docker compose pull docker compose up -d echo "${{ steps.gen_ver.outputs.image_ver }}"> success - - name: Notify Discord Success - if: success() - run: | - curl -H "Content-Type: application/json" \ - -X POST \ - -d '{ - "embeds": [{ - "title": "✅ Deployment Success!", - "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", - "color": 3066993, - "footer": { - "text": "Release Notification", - "icon_url": "https://example.com/success-icon.png" - }, - "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" - }] - }' \ - ${{ secrets.DISCORD_WEBHOOK }} + # - name: Notify Discord Success + # if: success() + # run: | + # curl -H "Content-Type: application/json" \ + # -X POST \ + # -d '{ + # "embeds": [{ + # "title": "✅ Deployment Success!", + # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", + # "color": 3066993, + # "footer": { + # "text": "Release Notification", + # "icon_url": "https://example.com/success-icon.png" + # }, + # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + # }] + # }' \ + # ${{ secrets.DISCORD_WEBHOOK }} - - name: Notify Discord Failure - if: failure() - run: | - curl -H "Content-Type: application/json" \ - -X POST \ - -d '{ - "embeds": [{ - "title": "❌ Deployment Failed!", - "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", - "color": 15158332, - "footer": { - "text": "Release Notification", - "icon_url": "https://example.com/failure-icon.png" - }, - "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" - }] - }' \ - ${{ secrets.DISCORD_WEBHOOK }} + # - name: Notify Discord Failure + # if: failure() + # run: | + # curl -H "Content-Type: application/json" \ + # -X POST \ + # -d '{ + # "embeds": [{ + # "title": "❌ Deployment Failed!", + # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", + # "color": 15158332, + # "footer": { + # "text": "Release Notification", + # "icon_url": "https://example.com/failure-icon.png" + # }, + # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + # }] + # }' \ + # ${{ secrets.DISCORD_WEBHOOK }} diff --git a/src/entities/DevelopmentScholarship.ts b/src/entities/DevelopmentScholarship.ts index cd1c614..24745ae 100644 --- a/src/entities/DevelopmentScholarship.ts +++ b/src/entities/DevelopmentScholarship.ts @@ -606,7 +606,7 @@ export class CreateDevelopmentScholarship { posExecutive: string | null; posLevelId: string | null; posTypeId: string | null; - guarantorRootDnaId: string | null; + guarantorRootDnaId?: string | null; guarantorRootId: string | null; guarantorRoot: string | null; guarantorOrg: string | null; From d93edbf97addd025eefbcd5f8a6d36eeca498720 Mon Sep 17 00:00:00 2001 From: kittapath-Jool Date: Fri, 1 Aug 2025 15:54:00 +0700 Subject: [PATCH 08/10] add noti --- .github/workflows/release.yaml | 72 +++++++++++++++++----------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6916881..0d19c5a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -67,40 +67,40 @@ jobs: docker compose pull docker compose up -d echo "${{ steps.gen_ver.outputs.image_ver }}"> success - # - name: Notify Discord Success - # if: success() - # run: | - # curl -H "Content-Type: application/json" \ - # -X POST \ - # -d '{ - # "embeds": [{ - # "title": "✅ Deployment Success!", - # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", - # "color": 3066993, - # "footer": { - # "text": "Release Notification", - # "icon_url": "https://example.com/success-icon.png" - # }, - # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" - # }] - # }' \ - # ${{ secrets.DISCORD_WEBHOOK }} + - name: Notify Discord Success + if: success() + run: | + curl -H "Content-Type: application/json" \ + -X POST \ + -d '{ + "embeds": [{ + "title": "✅ Deployment Success!", + "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", + "color": 3066993, + "footer": { + "text": "Release Notification", + "icon_url": "https://example.com/success-icon.png" + }, + "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + }] + }' \ + ${{ secrets.DISCORD_WEBHOOK }} - # - name: Notify Discord Failure - # if: failure() - # run: | - # curl -H "Content-Type: application/json" \ - # -X POST \ - # -d '{ - # "embeds": [{ - # "title": "❌ Deployment Failed!", - # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", - # "color": 15158332, - # "footer": { - # "text": "Release Notification", - # "icon_url": "https://example.com/failure-icon.png" - # }, - # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" - # }] - # }' \ - # ${{ secrets.DISCORD_WEBHOOK }} + - name: Notify Discord Failure + if: failure() + run: | + curl -H "Content-Type: application/json" \ + -X POST \ + -d '{ + "embeds": [{ + "title": "❌ Deployment Failed!", + "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", + "color": 15158332, + "footer": { + "text": "Release Notification", + "icon_url": "https://example.com/failure-icon.png" + }, + "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + }] + }' \ + ${{ secrets.DISCORD_WEBHOOK }} From 217354f65319b344df0ee163d21364e6aaae136f Mon Sep 17 00:00:00 2001 From: Bright Date: Wed, 6 Aug 2025 10:53:06 +0700 Subject: [PATCH 09/10] =?UTF-8?q?api=20=E0=B8=A3=E0=B8=B2=E0=B8=A2?= =?UTF-8?q?=E0=B8=A5=E0=B8=B0=E0=B9=80=E0=B8=AD=E0=B8=B5=E0=B8=A2=E0=B8=94?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=9C?= =?UTF-8?q?=E0=B8=A5=E0=B8=87=E0=B8=B2=E0=B8=99=20=E0=B9=83=E0=B8=8A?= =?UTF-8?q?=E0=B9=89.o=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=87=E0=B8=B2?= =?UTF-8?q?=E0=B8=99=20=E0=B8=81.=E0=B8=9E.7/=E0=B8=81.=E0=B8=81.1=20#1642?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/PortfolioController.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/controllers/PortfolioController.ts b/src/controllers/PortfolioController.ts index 294b7f6..eecf28a 100644 --- a/src/controllers/PortfolioController.ts +++ b/src/controllers/PortfolioController.ts @@ -103,6 +103,32 @@ export class PortfolioController extends Controller { return new HttpSuccess(_portfolio); } + /** + * API รายละเอียดรายการผลงาน ใช้แสดงในรายงาน ก.พ.7/ก.ก.1 + * + * @summary รายละเอียดรายการผลงาน ใช้แสดงในรายงาน ก.พ.7/ก.ก.1 + * + */ + @Get("kk1/{keycloak}") + async GetPortfolio(@Path() keycloak: string, @Request() request: RequestWithUser) { + const _portfolio = await this.portfolioRepository.find({ + where: { createdUserId: keycloak }, + select: [ + "name", + "createdAt" + ], + order: { createdAt: "DESC" }, + }); + const result = + _portfolio.map(x => ({ + name: x.name, + year: x.createdAt.getFullYear() > 2500 + ? x.createdAt.getFullYear() + : x.createdAt.getFullYear()+543 + })); + return new HttpSuccess(result); + } + /** * API สร้างรายการ body ผลงาน * From 0f4b9778eeac59ee99e38c051c9b4d1fefd02533 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Mon, 18 Aug 2025 16:36:23 +0700 Subject: [PATCH 10/10] update search --- src/controllers/DevelopmentEmployeeHistoryController.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/controllers/DevelopmentEmployeeHistoryController.ts b/src/controllers/DevelopmentEmployeeHistoryController.ts index 2fb81f3..007d978 100644 --- a/src/controllers/DevelopmentEmployeeHistoryController.ts +++ b/src/controllers/DevelopmentEmployeeHistoryController.ts @@ -276,6 +276,14 @@ export class DevelopmentEmployeeHistoryController extends Controller { keyword: `%${body.keyword}%`, }, ) + .orWhere( + body.keyword != null && body.keyword != "" + ? "CONCAT(employeePosType.posTypeShortName,' ',employeePosLevel.posLevelName) LIKE :keyword" + : "1=1", + { + keyword: `%${body.keyword}%`, + }, + ) .orWhere( body.keyword != null && body.keyword != "" ? "developmentHistory.position LIKE :keyword"