From acba2db63fbcfc628c445d7fe953a02b5744bd5b Mon Sep 17 00:00:00 2001 From: kittapath Date: Wed, 12 Mar 2025 22:43:45 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=AD=E0=B8=AD=E0=B8=81=E0=B8=84=E0=B8=B3?= =?UTF-8?q?=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87=E0=B8=A7=E0=B8=B4=E0=B8=99?= =?UTF-8?q?=E0=B8=B1=E0=B8=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yaml | 72 ++++++++++++++-------------- src/controllers/CommandController.ts | 17 +++++-- 2 files changed, 49 insertions(+), 40 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c4b02bcc..21dc9ba3 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/controllers/CommandController.ts b/src/controllers/CommandController.ts index 2d7d775f..3e6be6b8 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -3473,6 +3473,9 @@ export class CommandController extends Controller { const dataDis = new ProfileDiscipline(); const metaDis = { + date: item.commandDateAffect, + refCommandDate: item.commandDateSign, + refCommandNo: item.commandNo, createdUserId: req.user.sub, createdFullName: req.user.name, lastUpdateUserId: req.user.sub, @@ -3481,7 +3484,7 @@ export class CommandController extends Controller { lastUpdatedAt: new Date(), }; - Object.assign(dataDis, { ...body, ...metaDis }); + Object.assign(dataDis, { ...item, ...metaDis }); const historyDis = new ProfileDisciplineHistory(); Object.assign(historyDis, { ...dataDis, id: undefined }); @@ -3670,8 +3673,11 @@ export class CommandController extends Controller { }; Object.assign(dataDis, { - ...body, + ...item, ...metaDis, + date: item.commandDateAffect, + refCommandDate: item.commandDateSign, + refCommandNo: item.commandNo, profileEmployeeId: item.profileId, profileId: undefined, }); @@ -3899,8 +3905,11 @@ export class CommandController extends Controller { }; Object.assign(dataDis, { - ...body, + ...item, ...metaDis, + date: item.commandDateAffect, + refCommandDate: item.commandDateSign, + refCommandNo: item.commandNo, profileEmployeeId: item.profileId, profileId: undefined, }); @@ -5059,7 +5068,7 @@ export class CommandController extends Controller { commandName: body.refIds[0].commandName, remark: body.refIds[0].remark, }; - + const dataAct = new ProfileActposition(); Object.assign(dataAct, metaAct); const historyAct = new ProfileActpositionHistory();