From 10196f44a80e7b0eac049fb94c85b36413cef51b Mon Sep 17 00:00:00 2001 From: Suchin Sapphasitthatha Date: Sun, 15 Dec 2024 10:39:09 +0700 Subject: [PATCH 01/20] modify dockerfile for CheckInConsumer --- BMA.EHR.CheckInConsumer/Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/BMA.EHR.CheckInConsumer/Dockerfile b/BMA.EHR.CheckInConsumer/Dockerfile index 5bab7aad..425ff61f 100644 --- a/BMA.EHR.CheckInConsumer/Dockerfile +++ b/BMA.EHR.CheckInConsumer/Dockerfile @@ -40,8 +40,10 @@ COPY . ./ RUN dotnet restore # คัดลอกไฟล์ทั้งหมดและ build -COPY . ./ -RUN dotnet build -c Release -o /app/build +# COPY . ./ +# RUN dotnet build -c Release -o /app/build +WORKDIR "/src/BMA.EHR.CheckInConsumer" +RUN dotnet build "BMA.EHR.CheckInConsumer.csproj" -c Release -o /app/build # ใช้ stage ใหม่สำหรับการ runtime FROM mcr.microsoft.com/dotnet/runtime:8.0 AS runtime @@ -53,4 +55,4 @@ WORKDIR /app COPY --from=build /app/build . # ระบุ entry point ของแอปพลิเคชัน -ENTRYPOINT ["dotnet", "BMA.EHR.CheckInConsumer.dll"] \ No newline at end of file +ENTRYPOINT ["dotnet", "BMA.EHR.CheckInConsumer.dll"] From 76ddcfc6146806f9390bdbc054d7e67137fedb1d Mon Sep 17 00:00:00 2001 From: Suchin Sapphasitthatha Date: Sun, 15 Dec 2024 09:29:56 +0000 Subject: [PATCH 02/20] modify CI to include build leave api --- .onedev-buildspec.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.onedev-buildspec.yml b/.onedev-buildspec.yml index 91d7f220..ddcfad0a 100644 --- a/.onedev-buildspec.yml +++ b/.onedev-buildspec.yml @@ -1,6 +1,6 @@ version: 37 jobs: -- name: CI for Checkin [UAT] +- name: CI for CheckinLeave [UAT] steps: - !CheckoutStep name: checkout code @@ -33,29 +33,35 @@ jobs: dotnet test -l trx --collect:"XPlat Code Coverage" #/root/.dotnet/tools/roslynator analyze -o roslynator-analysis.xml useTTY: true - condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + condition: NEVER - !PublishTRXReportStep name: publish unit test report reportName: Unit Test filePatterns: '**/*.trx' - condition: ALWAYS + condition: NEVER - !PublishCoberturaReportStep name: publish code coverage report reportName: Code Coverage filePatterns: '**/coverage.cobertura.xml' - condition: ALWAYS + condition: NEVER - !PublishRoslynatorReportStep name: publish code problem report reportName: Code Problems filePatterns: roslynator-analysis.xml failThreshold: HIGH - condition: ALWAYS + condition: NEVER - !SetBuildVersionStep name: set build version buildVersion: '@tag@' condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL - !BuildImageStep - name: build docker image + name: build docker image - Leave + dockerfile: ./BMA.EHR.Leave/Dockerfile + output: !RegistryOutput + tags: hrms-git.chin.in.th/bma-hrms/hrms-api-leave:@build_version@ hrms-git.chin.in.th/bma-hrms/hrms-api-leave:latest + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !BuildImageStep + name: build docker image - Checkin dockerfile: ./BMA.EHR.CheckInConsumer/Dockerfile output: !RegistryOutput tags: hrms-git.chin.in.th/bma-hrms/hrms-api-checkin:@build_version@ hrms-git.chin.in.th/bma-hrms/hrms-api-checkin:latest From 3e4299fb4cf20650cea335ce126a1a57b3991b42 Mon Sep 17 00:00:00 2001 From: Suchin Sapphasitthatha Date: Sun, 15 Dec 2024 17:56:38 +0700 Subject: [PATCH 03/20] Test Change Docker file for Leave --- BMA.EHR.Leave/Dockerfile | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/BMA.EHR.Leave/Dockerfile b/BMA.EHR.Leave/Dockerfile index a6899e01..8cd9e73b 100644 --- a/BMA.EHR.Leave/Dockerfile +++ b/BMA.EHR.Leave/Dockerfile @@ -8,15 +8,27 @@ EXPOSE 443 FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build WORKDIR /src -COPY ["BMA.EHR.Domain/BMA.EHR.Domain.csproj", "BMA.EHR.Domain/"] -COPY ["BMA.EHR.Application/BMA.EHR.Application.csproj", "BMA.EHR.Application/"] -COPY ["BMA.EHR.Infrastructure/BMA.EHR.Infrastructure.csproj", "BMA.EHR.Infrastructure/"] -COPY ["BMA.EHR.Leave/BMA.EHR.Leave.csproj", "BMA.EHR.Leave/"] +# -- BEGIN: Old Build -- +# COPY ["BMA.EHR.Domain/BMA.EHR.Domain.csproj", "BMA.EHR.Domain/"] +# COPY ["BMA.EHR.Application/BMA.EHR.Application.csproj", "BMA.EHR.Application/"] +# COPY ["BMA.EHR.Infrastructure/BMA.EHR.Infrastructure.csproj", "BMA.EHR.Infrastructure/"] +# COPY ["BMA.EHR.Leave/BMA.EHR.Leave.csproj", "BMA.EHR.Leave/"] -RUN dotnet restore "BMA.EHR.Leave/BMA.EHR.Leave.csproj" -COPY . . +# RUN dotnet restore "BMA.EHR.Leave/BMA.EHR.Leave.csproj" +# COPY . . +# WORKDIR "/src/BMA.EHR.Leave" +# RUN dotnet build "BMA.EHR.Leave.csproj" -c Release -o /app/build +# -- END: Old Build -- + +# -- BEGIN: Test New Build -- +# คัดลอกไฟล์ .csproj และ restore dependencies +COPY . ./ +RUN dotnet restore + +# คัดลอกไฟล์ทั้งหมดและ build WORKDIR "/src/BMA.EHR.Leave" -RUN dotnet build "BMA.EHR.Leave.csproj" -c Release -o /app/build +RUN dotnet build "BMA.EHR.Leave.csproj" -c Release -o /app/build +# -- END: Test New Build FROM build AS publish RUN dotnet publish "BMA.EHR.Leave.csproj" -c Release -o /app/publish /p:UseAppHost=false @@ -24,4 +36,4 @@ RUN dotnet publish "BMA.EHR.Leave.csproj" -c Release -o /app/publish /p:UseAppHo FROM base AS final WORKDIR /app COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "BMA.EHR.Leave.dll"] \ No newline at end of file +ENTRYPOINT ["dotnet", "BMA.EHR.Leave.dll"] From ae3d705187c0853b5c37f0b41fd30078135b562d Mon Sep 17 00:00:00 2001 From: Suchin Sapphasitthatha Date: Sun, 15 Dec 2024 18:10:49 +0700 Subject: [PATCH 04/20] exp: test dockerfile again --- BMA.EHR.Leave/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BMA.EHR.Leave/Dockerfile b/BMA.EHR.Leave/Dockerfile index 8cd9e73b..8ece9365 100644 --- a/BMA.EHR.Leave/Dockerfile +++ b/BMA.EHR.Leave/Dockerfile @@ -21,8 +21,10 @@ WORKDIR /src # -- END: Old Build -- # -- BEGIN: Test New Build -- -# คัดลอกไฟล์ .csproj และ restore dependencies -COPY . ./ +COPY ["BMA.EHR.Domain/BMA.EHR.Domain.csproj", "BMA.EHR.Domain/"] +COPY ["BMA.EHR.Application/BMA.EHR.Application.csproj", "BMA.EHR.Application/"] +COPY ["BMA.EHR.Infrastructure/BMA.EHR.Infrastructure.csproj", "BMA.EHR.Infrastructure/"] +COPY ["BMA.EHR.Leave/BMA.EHR.Leave.csproj", "BMA.EHR.Leave/"] RUN dotnet restore # คัดลอกไฟล์ทั้งหมดและ build From 00c2370b19382694700321cf6ec59ffdba170285 Mon Sep 17 00:00:00 2001 From: Suchin Sapphasitthatha Date: Sun, 15 Dec 2024 18:25:56 +0700 Subject: [PATCH 05/20] exp: test dockerfile --- BMA.EHR.Leave/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BMA.EHR.Leave/Dockerfile b/BMA.EHR.Leave/Dockerfile index 8ece9365..208f9b00 100644 --- a/BMA.EHR.Leave/Dockerfile +++ b/BMA.EHR.Leave/Dockerfile @@ -25,7 +25,7 @@ COPY ["BMA.EHR.Domain/BMA.EHR.Domain.csproj", "BMA.EHR.Domain/"] COPY ["BMA.EHR.Application/BMA.EHR.Application.csproj", "BMA.EHR.Application/"] COPY ["BMA.EHR.Infrastructure/BMA.EHR.Infrastructure.csproj", "BMA.EHR.Infrastructure/"] COPY ["BMA.EHR.Leave/BMA.EHR.Leave.csproj", "BMA.EHR.Leave/"] -RUN dotnet restore +RUN dotnet restore "BMA.EHR.Leave/BMA.EHR.Leave.csproj" # คัดลอกไฟล์ทั้งหมดและ build WORKDIR "/src/BMA.EHR.Leave" From af420225d844b0f3d8d65d572736b0d700810fe2 Mon Sep 17 00:00:00 2001 From: Suchin Sapphasitthatha Date: Sun, 15 Dec 2024 18:48:31 +0700 Subject: [PATCH 06/20] exp: test dockerfile --- BMA.EHR.Leave/Dockerfile | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/BMA.EHR.Leave/Dockerfile b/BMA.EHR.Leave/Dockerfile index 208f9b00..96460406 100644 --- a/BMA.EHR.Leave/Dockerfile +++ b/BMA.EHR.Leave/Dockerfile @@ -21,13 +21,8 @@ WORKDIR /src # -- END: Old Build -- # -- BEGIN: Test New Build -- -COPY ["BMA.EHR.Domain/BMA.EHR.Domain.csproj", "BMA.EHR.Domain/"] -COPY ["BMA.EHR.Application/BMA.EHR.Application.csproj", "BMA.EHR.Application/"] -COPY ["BMA.EHR.Infrastructure/BMA.EHR.Infrastructure.csproj", "BMA.EHR.Infrastructure/"] -COPY ["BMA.EHR.Leave/BMA.EHR.Leave.csproj", "BMA.EHR.Leave/"] +COPY . ./ RUN dotnet restore "BMA.EHR.Leave/BMA.EHR.Leave.csproj" - -# คัดลอกไฟล์ทั้งหมดและ build WORKDIR "/src/BMA.EHR.Leave" RUN dotnet build "BMA.EHR.Leave.csproj" -c Release -o /app/build # -- END: Test New Build From a1815ed7e7249586ffac1a2ef11bdf04a12de787 Mon Sep 17 00:00:00 2001 From: Suchin Sapphasitthatha Date: Sun, 15 Dec 2024 19:29:56 +0700 Subject: [PATCH 07/20] exp: test sdk 8 --- BMA.EHR.Leave/Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/BMA.EHR.Leave/Dockerfile b/BMA.EHR.Leave/Dockerfile index 96460406..af920212 100644 --- a/BMA.EHR.Leave/Dockerfile +++ b/BMA.EHR.Leave/Dockerfile @@ -5,7 +5,7 @@ WORKDIR /app EXPOSE 80 EXPOSE 443 -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src # -- BEGIN: Old Build -- @@ -21,7 +21,10 @@ WORKDIR /src # -- END: Old Build -- # -- BEGIN: Test New Build -- -COPY . ./ +COPY ["BMA.EHR.Domain/BMA.EHR.Domain.csproj", "BMA.EHR.Domain/"] +COPY ["BMA.EHR.Application/BMA.EHR.Application.csproj", "BMA.EHR.Application/"] +COPY ["BMA.EHR.Infrastructure/BMA.EHR.Infrastructure.csproj", "BMA.EHR.Infrastructure/"] +COPY ["BMA.EHR.Leave/BMA.EHR.Leave.csproj", "BMA.EHR.Leave/"] RUN dotnet restore "BMA.EHR.Leave/BMA.EHR.Leave.csproj" WORKDIR "/src/BMA.EHR.Leave" RUN dotnet build "BMA.EHR.Leave.csproj" -c Release -o /app/build From 035395f5a56b66beacce64315fa4dc043c5797ce Mon Sep 17 00:00:00 2001 From: Suchin Sapphasitthatha Date: Mon, 16 Dec 2024 09:14:06 +0000 Subject: [PATCH 08/20] disable CI --- .onedev-buildspec.yml | 54 ++----------------------------------------- 1 file changed, 2 insertions(+), 52 deletions(-) diff --git a/.onedev-buildspec.yml b/.onedev-buildspec.yml index ddcfad0a..d5e0a732 100644 --- a/.onedev-buildspec.yml +++ b/.onedev-buildspec.yml @@ -59,13 +59,13 @@ jobs: dockerfile: ./BMA.EHR.Leave/Dockerfile output: !RegistryOutput tags: hrms-git.chin.in.th/bma-hrms/hrms-api-leave:@build_version@ hrms-git.chin.in.th/bma-hrms/hrms-api-leave:latest - condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + condition: NEVER - !BuildImageStep name: build docker image - Checkin dockerfile: ./BMA.EHR.CheckInConsumer/Dockerfile output: !RegistryOutput tags: hrms-git.chin.in.th/bma-hrms/hrms-api-checkin:@build_version@ hrms-git.chin.in.th/bma-hrms/hrms-api-checkin:latest - condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + condition: NEVER triggers: - !TagCreateTrigger tags: uat-* @@ -74,53 +74,3 @@ jobs: maxRetries: 3 retryDelay: 30 timeout: 14400 -- name: CI for PROD - steps: - - !CheckoutStep - name: checkout code - cloneCredential: !DefaultCredential {} - withLfs: false - withSubmodules: false - condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL - - !GenerateChecksumStep - name: generate package checksum - files: package-lock.json yarn.lock - targetFile: checksum - condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL - - !SetupCacheStep - name: set up npm cache - key: node_modules_@file:checksum@ - loadKeys: - - node_modules - paths: - - node_modules - uploadStrategy: UPLOAD_IF_NOT_HIT - condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL - - !SetBuildVersionStep - name: set build version - buildVersion: '@tag@' - condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL - - !CommandStep - name: build & test - runInContainer: true - image: node - interpreter: !DefaultInterpreter - commands: | - npm install - npm run build - useTTY: true - condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL - - !BuildImageStep - name: build docker image - dockerfile: ./docker/Dockerfile - output: !RegistryOutput - tags: hrms-git.bangkok.go.th/bma-hrms/hrms-api-checkin:@build_version@ hrms-git.bangkok.go.th/bma-hrms/hrms-api-checkin:latest - condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL - triggers: - - !TagCreateTrigger - tags: prod-* - branches: main - retryCondition: never - maxRetries: 3 - retryDelay: 30 - timeout: 14400 From 1afe331397d8a4f5cfc8e31d6e30e8a516ecb494 Mon Sep 17 00:00:00 2001 From: Suchin Sapphasitthatha Date: Mon, 16 Dec 2024 16:15:47 +0700 Subject: [PATCH 09/20] Reverse CI for CheckIn & Leave --- BMA.EHR.CheckInConsumer/Dockerfile | 8 ++++---- BMA.EHR.Leave/Dockerfile | 20 ++++---------------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/BMA.EHR.CheckInConsumer/Dockerfile b/BMA.EHR.CheckInConsumer/Dockerfile index 425ff61f..1c90d6f2 100644 --- a/BMA.EHR.CheckInConsumer/Dockerfile +++ b/BMA.EHR.CheckInConsumer/Dockerfile @@ -40,10 +40,10 @@ COPY . ./ RUN dotnet restore # คัดลอกไฟล์ทั้งหมดและ build -# COPY . ./ -# RUN dotnet build -c Release -o /app/build -WORKDIR "/src/BMA.EHR.CheckInConsumer" -RUN dotnet build "BMA.EHR.CheckInConsumer.csproj" -c Release -o /app/build +COPY . ./ +RUN dotnet build -c Release -o /app/build +# WORKDIR "/src/BMA.EHR.CheckInConsumer" +# RUN dotnet build "BMA.EHR.CheckInConsumer.csproj" -c Release -o /app/build # ใช้ stage ใหม่สำหรับการ runtime FROM mcr.microsoft.com/dotnet/runtime:8.0 AS runtime diff --git a/BMA.EHR.Leave/Dockerfile b/BMA.EHR.Leave/Dockerfile index af920212..3c211ab3 100644 --- a/BMA.EHR.Leave/Dockerfile +++ b/BMA.EHR.Leave/Dockerfile @@ -5,30 +5,18 @@ WORKDIR /app EXPOSE 80 EXPOSE 443 -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build WORKDIR /src -# -- BEGIN: Old Build -- -# COPY ["BMA.EHR.Domain/BMA.EHR.Domain.csproj", "BMA.EHR.Domain/"] -# COPY ["BMA.EHR.Application/BMA.EHR.Application.csproj", "BMA.EHR.Application/"] -# COPY ["BMA.EHR.Infrastructure/BMA.EHR.Infrastructure.csproj", "BMA.EHR.Infrastructure/"] -# COPY ["BMA.EHR.Leave/BMA.EHR.Leave.csproj", "BMA.EHR.Leave/"] - -# RUN dotnet restore "BMA.EHR.Leave/BMA.EHR.Leave.csproj" -# COPY . . -# WORKDIR "/src/BMA.EHR.Leave" -# RUN dotnet build "BMA.EHR.Leave.csproj" -c Release -o /app/build -# -- END: Old Build -- - -# -- BEGIN: Test New Build -- COPY ["BMA.EHR.Domain/BMA.EHR.Domain.csproj", "BMA.EHR.Domain/"] COPY ["BMA.EHR.Application/BMA.EHR.Application.csproj", "BMA.EHR.Application/"] COPY ["BMA.EHR.Infrastructure/BMA.EHR.Infrastructure.csproj", "BMA.EHR.Infrastructure/"] COPY ["BMA.EHR.Leave/BMA.EHR.Leave.csproj", "BMA.EHR.Leave/"] + RUN dotnet restore "BMA.EHR.Leave/BMA.EHR.Leave.csproj" +COPY . . WORKDIR "/src/BMA.EHR.Leave" -RUN dotnet build "BMA.EHR.Leave.csproj" -c Release -o /app/build -# -- END: Test New Build +RUN dotnet build "BMA.EHR.Leave.csproj" -c Release -o /app/build FROM build AS publish RUN dotnet publish "BMA.EHR.Leave.csproj" -c Release -o /app/publish /p:UseAppHost=false From 6b2348f07093de4d4cbf90780acd918397e344b7 Mon Sep 17 00:00:00 2001 From: Suchin Sapphasitthatha Date: Mon, 16 Dec 2024 09:17:05 +0000 Subject: [PATCH 10/20] add Insignia CI --- .onedev-buildspec.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.onedev-buildspec.yml b/.onedev-buildspec.yml index d5e0a732..bd58b796 100644 --- a/.onedev-buildspec.yml +++ b/.onedev-buildspec.yml @@ -1,6 +1,6 @@ version: 37 jobs: -- name: CI for CheckinLeave [UAT] +- name: CI for UAT steps: - !CheckoutStep name: checkout code @@ -66,6 +66,12 @@ jobs: output: !RegistryOutput tags: hrms-git.chin.in.th/bma-hrms/hrms-api-checkin:@build_version@ hrms-git.chin.in.th/bma-hrms/hrms-api-checkin:latest condition: NEVER + - !BuildImageStep + name: build docker image - Insignia + dockerfile: ./BMA.EHR.Insignia/Dockerfile + output: !RegistryOutput + tags: hrms-git.chin.in.th/bma-hrms/hrms-api-insignia:@build_version@ hrms-git.chin.in.th/bma-hrms/hrms-api-insignia:latest + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL triggers: - !TagCreateTrigger tags: uat-* From 910dc538086b714545401da1f62fd5172438aba4 Mon Sep 17 00:00:00 2001 From: kittapath Date: Tue, 7 Jan 2025 00:00:56 +0700 Subject: [PATCH 11/20] add edu placement --- .../PlacementAppointmentController.cs | 31 +++++++++++-------- .../Controllers/PlacementReceiveController.cs | 4 +-- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs index fc25fa13..610b0e7f 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs @@ -341,7 +341,7 @@ namespace BMA.EHR.Placement.Service.Controllers data.CreatedAt, data.Reason, - educationOld = data.EducationOld == "/" || data.EducationOld == null ? null : data.EducationOld, + data.EducationOld, data.salary, data.PositionTypeOld, data.PositionLevelOld, @@ -844,7 +844,8 @@ namespace BMA.EHR.Placement.Service.Controllers { result.Add(r); string? _null = null; - if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") { + if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") + { result.Add(new { No = _null, @@ -1056,7 +1057,8 @@ namespace BMA.EHR.Placement.Service.Controllers { result.Add(r); string? _null = null; - if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") { + if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") + { result.Add(new { No = _null, @@ -1265,7 +1267,8 @@ namespace BMA.EHR.Placement.Service.Controllers { result.Add(r); string? _null = null; - if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") { + if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") + { result.Add(new { No = _null, @@ -1470,7 +1473,8 @@ namespace BMA.EHR.Placement.Service.Controllers { result.Add(r); string? _null = null; - if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") { + if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") + { result.Add(new { No = _null, @@ -1618,13 +1622,13 @@ namespace BMA.EHR.Placement.Service.Controllers { try { - var report_data = (from p in _context.PlacementAppointments - //.Include(x => x.PlacementEducation) - // .ThenInclude(x => x.PlacementType) - .Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString())) - // .Where(x => x.Placement!.PlacementType!.Name == "เลื่อนข้าราชการ") - // .Where(x => x.typeCommand.Trim().ToUpper() == "SLIP") - .ToList() + var report_data = (from p in _context.PlacementAppointments + //.Include(x => x.PlacementEducation) + // .ThenInclude(x => x.PlacementType) + .Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString())) + // .Where(x => x.Placement!.PlacementType!.Name == "เลื่อนข้าราชการ") + // .Where(x => x.typeCommand.Trim().ToUpper() == "SLIP") + .ToList() join r in req.refIds on p.Id.ToString() equals r.refId orderby r.Sequence @@ -1686,7 +1690,8 @@ namespace BMA.EHR.Placement.Service.Controllers { result.Add(r); string? _null = null; - if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") { + if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") + { result.Add(new { No = _null, diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs index 33e31c73..731564a2 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs @@ -335,7 +335,7 @@ namespace BMA.EHR.Placement.Service.Controllers data.CreatedAt, data.Reason, - educationOld = data.EducationOld == "/" || data.EducationOld == null ? null : data.EducationOld, + data.EducationOld, data.AmountOld, data.PositionOld, organizationOld = data.OrganizationOld == "/" || data.OrganizationOld == null ? null : data.OrganizationOld, @@ -488,7 +488,7 @@ namespace BMA.EHR.Placement.Service.Controllers placementReceive.posLevelOldId = org.result.posLevelId; placementReceive.posLevelNameOld = org.result.posLevelName; - // placementReceive.EducationOld = profile.Educations.Count() == 0 ? null : $"{profile.Educations.OrderByDescending(x => x.FinishDate).FirstOrDefault().Degree}-{profile.Educations.OrderByDescending(x => x.FinishDate).FirstOrDefault().Field}"; + placementReceive.EducationOld = org.result.education; placementReceive.AmountOld = org.result.Amount; placementReceive.PositionOld = org.result.position; From 67d88228c8dcc1973b46170ecada8780ee269592 Mon Sep 17 00:00:00 2001 From: kittapath Date: Tue, 7 Jan 2025 21:34:55 +0700 Subject: [PATCH 12/20] =?UTF-8?q?=E0=B9=80=E0=B8=8A=E0=B9=87=E0=B8=84?= =?UTF-8?q?=E0=B8=AA=E0=B8=B3=E0=B8=99=E0=B8=B1=E0=B8=81=E0=B9=83=E0=B8=AB?= =?UTF-8?q?=E0=B9=89=E0=B8=AD=E0=B8=AD=E0=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/RetirementOtherController.cs | 10 ++++++---- .../Controllers/RetirementOutController.cs | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs index 81bc5bce..bcc5d787 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs @@ -103,7 +103,7 @@ namespace BMA.EHR.Retirement.Service.Controllers var retirementOthers = await _context.RetirementOthers.AsQueryable() .OrderByDescending(x => x.CreatedAt) - .Where(x => rootId == "" ? true : (child1Id == "" ? x.rootOldId == rootId : (child2Id == "" ? x.child1OldId == child1Id : (child3Id == "" ? x.child2OldId == child2Id : (child4Id == "" ? x.child3OldId == child3Id : x.child4OldId == child4Id))))) + // .Where(x => rootId == "" ? true : (child1Id == "" ? x.rootOldId == rootId : (child2Id == "" ? x.child1OldId == child1Id : (child3Id == "" ? x.child2OldId == child2Id : (child4Id == "" ? x.child3OldId == child3Id : x.child4OldId == child4Id))))) .Select(p => new { p.Id, @@ -721,7 +721,8 @@ namespace BMA.EHR.Retirement.Service.Controllers { result.Add(r); string? _null = null; - if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") { + if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") + { result.Add(new { No = _null, @@ -742,7 +743,7 @@ namespace BMA.EHR.Retirement.Service.Controllers CommandExcecuteDate = _null, RemarkHorizontal = _null, RemarkVertical = _null, - }); + }); } } return Success(result); @@ -927,7 +928,8 @@ namespace BMA.EHR.Retirement.Service.Controllers { result.Add(r); string? _null = null; - if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") { + if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") + { result.Add(new { No = _null, diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs index 35b274fe..b6468e2b 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs @@ -103,7 +103,7 @@ namespace BMA.EHR.Retirement.Service.Controllers var retirementOuts = await _context.RetirementOuts.AsQueryable() .OrderByDescending(x => x.CreatedAt) - .Where(x => rootId == "" ? true : (child1Id == "" ? x.rootOldId == rootId : (child2Id == "" ? x.child1OldId == child1Id : (child3Id == "" ? x.child2OldId == child2Id : (child4Id == "" ? x.child3OldId == child3Id : x.child4OldId == child4Id))))) + // .Where(x => rootId == "" ? true : (child1Id == "" ? x.rootOldId == rootId : (child2Id == "" ? x.child1OldId == child1Id : (child3Id == "" ? x.child2OldId == child2Id : (child4Id == "" ? x.child3OldId == child3Id : x.child4OldId == child4Id))))) .Select(p => new { p.Id, From 66d44bdb9364fa5b6ebb73b556bc6a3622a38b25 Mon Sep 17 00:00:00 2001 From: kittapath Date: Tue, 7 Jan 2025 21:59:06 +0700 Subject: [PATCH 13/20] no message --- .github/workflows/release_report.yaml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release_report.yaml b/.github/workflows/release_report.yaml index 6dbacca1..01f06dce 100644 --- a/.github/workflows/release_report.yaml +++ b/.github/workflows/release_report.yaml @@ -1,13 +1,10 @@ name: release-dev run-name: release-dev ${{ github.actor }} on: - # push: - # tags: - # - 'v[0-9]+.[0-9]+.[0-9]+' - # tags-ignore: - # - '2.*' - # Allow run workflow manually from Action tab - workflow_dispatch: + push: + tags: + - "reportv1-[0-9]+.[0-9]+.[0-9]+" + workflow_dispatch: env: REGISTRY: docker.frappet.com IMAGE_NAME: ehr/bma-ehr-report-v2-service From e170061cffa58ec18ca7a766692f4fe4c4265fb4 Mon Sep 17 00:00:00 2001 From: kittapath Date: Tue, 7 Jan 2025 21:59:48 +0700 Subject: [PATCH 14/20] no message --- .github/workflows/release_report.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_report.yaml b/.github/workflows/release_report.yaml index 01f06dce..4ec1903a 100644 --- a/.github/workflows/release_report.yaml +++ b/.github/workflows/release_report.yaml @@ -3,7 +3,7 @@ run-name: release-dev ${{ github.actor }} on: push: tags: - - "reportv1-[0-9]+.[0-9]+.[0-9]+" + - "reportv2-[0-9]+.[0-9]+.[0-9]+" workflow_dispatch: env: REGISTRY: docker.frappet.com From febc07623bc5120d16dbf4082cc11c6ab46e10b1 Mon Sep 17 00:00:00 2001 From: kittapath Date: Tue, 7 Jan 2025 22:01:41 +0700 Subject: [PATCH 15/20] build report v2 --- .github/workflows/release_report.yaml | 75 +++++++++++++++++---------- 1 file changed, 48 insertions(+), 27 deletions(-) diff --git a/.github/workflows/release_report.yaml b/.github/workflows/release_report.yaml index 4ec1903a..9ba5a7c4 100644 --- a/.github/workflows/release_report.yaml +++ b/.github/workflows/release_report.yaml @@ -20,20 +20,22 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - # skip Set up QEMU because it fail on act and container + - name: Set output tags + id: vars + run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT - name: Gen Version id: gen_ver run: | - if [[ $GITHUB_REF == 'refs/tags/'* ]]; then - IMAGE_VER='${GITHUB_REF/refs\/tags\//}' - else - IMAGE_VER=${{ github.event.inputs.IMAGE_VER }} - fi - if [[ $IMAGE_VER == '' ]]; then - IMAGE_VER='test-vBeta' - fi - echo '::set-output name=image_ver::'$IMAGE_VER - - name: Test Version + if [[ $GITHUB_REF == 'refs/tags/'* ]]; then + IMAGE_VER=${{ steps.vars.outputs.tag }} + else + IMAGE_VER=${{ github.event.inputs.IMAGE_VER }} + fi + if [[ $IMAGE_VER == '' ]]; then + IMAGE_VER='test-vBeta' + fi + echo '::set-output name=image_ver::'$IMAGE_VER + - name: Check Version run: | echo $GITHUB_REF echo ${{ steps.gen_ver.outputs.image_ver }} @@ -66,21 +68,40 @@ jobs: docker compose pull docker compose up -d echo "${{ steps.gen_ver.outputs.image_ver }}"> success - - uses: snow-actions/line-notify@v1.1.0 + - name: Notify Discord Success if: success() - with: - access_token: ${{ env.TOKEN_LINE }} - message: | - -Success✅✅✅ - Image: ${{env.IMAGE_NAME}} - Version: ${{ github.event.inputs.IMAGE_VER }} - By: ${{secrets.DOCKER_USER}} - - uses: snow-actions/line-notify@v1.1.0 + 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() - with: - access_token: ${{ env.TOKEN_LINE }} - message: | - -Failure❌❌❌ - Image: ${{env.IMAGE_NAME}} - Version: ${{ github.event.inputs.IMAGE_VER }} - By: ${{secrets.DOCKER_USER}} + 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 74f05fccfe29feee015d7b6e4219b173b876a691 Mon Sep 17 00:00:00 2001 From: kittapath Date: Wed, 8 Jan 2025 19:20:29 +0700 Subject: [PATCH 16/20] update report --- .../Controllers/CandidateReportController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BMA.EHR.Report.Service/Controllers/CandidateReportController.cs b/BMA.EHR.Report.Service/Controllers/CandidateReportController.cs index 9952d6d0..8d0444fb 100644 --- a/BMA.EHR.Report.Service/Controllers/CandidateReportController.cs +++ b/BMA.EHR.Report.Service/Controllers/CandidateReportController.cs @@ -78,7 +78,7 @@ namespace BMA.EHR.Report.Service.Controllers // try // { // // Get avatar Image - //var picContent = await _minIOExamService.DownloadFileAsync(avatar); + var picContent = avatar == null ? null : await _minIOExamService.ImagesPath(avatar); //var pictureBox = (Telerik.Reporting.PictureBox)report.Items["detailSection1"].Items["picAvatar"]; //pictureBox.Value = Image.FromStream(new MemoryStream(picContent.FileContent)); // } @@ -141,7 +141,7 @@ namespace BMA.EHR.Report.Service.Controllers ContactRelations = candidate.GetType().GetProperty("ContactRelations").GetValue(candidate), ContactTel = candidate.GetType().GetProperty("ContactTel").GetValue(candidate), RegisterDate = candidate.GetType().GetProperty("RegisterDate").GetValue(candidate), - Url = "https://bma-ehr.frappet.synology.me/assets/avatar_user-89f22423.jpg", + Url = picContent ?? "https://bma-ehr.frappet.synology.me/assets/avatar_user-89f22423.jpg", Careers = careers, }; From 5604d7076e4a6460a13f2acb5f736dd6dfca60c8 Mon Sep 17 00:00:00 2001 From: kittapath Date: Thu, 9 Jan 2025 11:50:36 +0700 Subject: [PATCH 17/20] no message --- .../Controllers/DisciplineResultController.cs | 48 ++++++++++++++----- .../Requests/ReportExecuteRequest.cs | 2 + .../PlacementAppointmentController.cs | 10 ++++ .../Controllers/PlacementController.cs | 14 +++++- .../Controllers/PlacementOfficerController.cs | 5 +- .../Controllers/PlacementReceiveController.cs | 4 +- .../PlacementRepatriationController.cs | 2 + .../PlacementTransferController.cs | 5 +- .../Requests/ReportExecuteRequest.cs | 2 + .../Controllers/RetirementOtherController.cs | 6 ++- .../Controllers/RetirementOutController.cs | 4 +- .../Controllers/RetirementResignController.cs | 4 ++ .../RetirementResignEmployeeController.cs | 4 ++ .../Requests/ReportExecuteRequest.cs | 2 + 14 files changed, 92 insertions(+), 20 deletions(-) diff --git a/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs b/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs index 9662aa45..22f8335e 100644 --- a/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs +++ b/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs @@ -824,6 +824,8 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers mouthSalaryAmount = r.mouthSalaryAmount, isGovernment = false, profileType = p.profileType, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -922,6 +924,8 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers mouthSalaryAmount = r.mouthSalaryAmount, isGovernment = false, profileType = p.profileType, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1021,17 +1025,17 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers .ToListAsync(); var report_data = (from p in data - join r in req.refIds - on p.Id.ToString() equals r.refId - select new - { - fullName = $"{r.Prefix}{r.FirstName} {r.LastName}", - positionname = p.Position, - positionno = p.PosNo, - organizationname = p.Organization, - salary = r.Amount, - RemarkHorizontal = r.RemarkHorizontal - }).ToList(); + join r in req.refIds + on p.Id.ToString() equals r.refId + select new + { + fullName = $"{r.Prefix}{r.FirstName} {r.LastName}", + positionname = p.Position, + positionno = p.PosNo, + organizationname = p.Organization, + salary = r.Amount, + RemarkHorizontal = r.RemarkHorizontal + }).ToList(); var result = new List(); @@ -1039,8 +1043,10 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers { result.Add(r); string? _null = null; - if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") { - result.Add(new { + if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") + { + result.Add(new + { fullName = _null, positionname = r.RemarkHorizontal, positionno = _null, @@ -1095,6 +1101,8 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers mouthSalaryAmount = r.mouthSalaryAmount, isGovernment = false, profileType = p.profileType, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1209,6 +1217,8 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers mouthSalaryAmount = r.mouthSalaryAmount, isGovernment = false, profileType = p.profileType, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1321,6 +1331,8 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, profileType = p.profileType, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1433,6 +1445,8 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, profileType = p.profileType, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1545,6 +1559,8 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, profileType = p.profileType, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1657,6 +1673,8 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, profileType = p.profileType, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1769,6 +1787,8 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, profileType = p.profileType, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1897,6 +1917,8 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, profileType = p.profileType, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline"; diff --git a/BMA.EHR.Discipline.Service/Requests/ReportExecuteRequest.cs b/BMA.EHR.Discipline.Service/Requests/ReportExecuteRequest.cs index 2c685ac6..5ed2cb4a 100644 --- a/BMA.EHR.Discipline.Service/Requests/ReportExecuteRequest.cs +++ b/BMA.EHR.Discipline.Service/Requests/ReportExecuteRequest.cs @@ -18,5 +18,7 @@ namespace BMA.EHR.Discipline.Service.Requests public double? amount { get; set; } public double? positionSalaryAmount { get; set; } public double? mouthSalaryAmount { get; set; } + public string? refCommandCode { get; set; } + public string? refCommandName { get; set; } } } diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs index 610b0e7f..51bec560 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs @@ -919,6 +919,8 @@ namespace BMA.EHR.Placement.Service.Controllers templateDoc = r.templateDoc, posmasterId = p.posmasterId, positionId = p.positionId, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1132,6 +1134,8 @@ namespace BMA.EHR.Placement.Service.Controllers templateDoc = r.templateDoc, posmasterId = p.posmasterId, positionId = p.positionId, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1333,6 +1337,8 @@ namespace BMA.EHR.Placement.Service.Controllers templateDoc = r.templateDoc, posmasterId = p.posmasterId, positionId = p.positionId, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1539,6 +1545,8 @@ namespace BMA.EHR.Placement.Service.Controllers templateDoc = r.templateDoc, posmasterId = p.posmasterId, positionId = p.positionId, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1764,6 +1772,8 @@ namespace BMA.EHR.Placement.Service.Controllers templateDoc = r.templateDoc, posmasterId = p.posmasterId, positionId = p.positionId, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs index 651ab875..dd75b93a 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs @@ -1735,7 +1735,9 @@ namespace BMA.EHR.Placement.Service.Controllers positionLevel = p.posLevelName == null ? string.Empty : p.posLevelName, refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", templateDoc = r.templateDoc, - isGovernment = true + isGovernment = true, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }, bodyPosition = new { @@ -2040,7 +2042,9 @@ namespace BMA.EHR.Placement.Service.Controllers positionLevel = p.posLevelName == null ? string.Empty : p.posLevelName, refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", templateDoc = r.templateDoc, - isGovernment = true + isGovernment = true, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }, bodyPosition = new { @@ -2285,6 +2289,8 @@ namespace BMA.EHR.Placement.Service.Controllers templateDoc = r.templateDoc, posmasterId = p.posmasterId, positionId = p.positionId, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -2514,6 +2520,8 @@ namespace BMA.EHR.Placement.Service.Controllers templateDoc = r.templateDoc, posmasterId = p.posmasterId, positionId = p.positionId, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -2732,6 +2740,8 @@ namespace BMA.EHR.Placement.Service.Controllers templateDoc = r.templateDoc, posmasterId = p.posmasterId, positionId = p.positionId, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs index 217a2d06..94684221 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs @@ -628,7 +628,8 @@ namespace BMA.EHR.Placement.Service.Controllers { result.Add(r); string? _null = null; - if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") { + if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") + { result.Add(new { No = _null, @@ -685,6 +686,8 @@ namespace BMA.EHR.Placement.Service.Controllers positionLevel = p.PositionLevelOld, refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", templateDoc = r.templateDoc, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs index 731564a2..3ec81c32 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs @@ -1089,7 +1089,9 @@ namespace BMA.EHR.Placement.Service.Controllers positionType = p.posTypeName == null ? string.Empty : p.posTypeName, positionLevel = p.posLevelName == null ? string.Empty : p.posLevelName, refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", - templateDoc = r.templateDoc + templateDoc = r.templateDoc, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }, bodyPosition = new { diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs index 48c4e553..cd90224f 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs @@ -511,6 +511,8 @@ namespace BMA.EHR.Placement.Service.Controllers positionLevel = p.PositionLevelOld, refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", templateDoc = r.templateDoc, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs index 045be807..90e61efe 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs @@ -838,7 +838,8 @@ namespace BMA.EHR.Placement.Service.Controllers { result.Add(r); string? _null = null; - if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") { + if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") + { result.Add(new { No = _null, @@ -903,6 +904,8 @@ namespace BMA.EHR.Placement.Service.Controllers leaveReason = "โอนออก", dateLeave = r.commandAffectDate, isLeave = true, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; diff --git a/BMA.EHR.Placement.Service/Requests/ReportExecuteRequest.cs b/BMA.EHR.Placement.Service/Requests/ReportExecuteRequest.cs index 999b663d..ddfe4004 100644 --- a/BMA.EHR.Placement.Service/Requests/ReportExecuteRequest.cs +++ b/BMA.EHR.Placement.Service/Requests/ReportExecuteRequest.cs @@ -19,5 +19,7 @@ namespace BMA.EHR.Placement.Service.Requests public double? amountSpecial { get; set; } public double? positionSalaryAmount { get; set; } public double? mouthSalaryAmount { get; set; } + public string? refCommandCode { get; set; } + public string? refCommandName { get; set; } } } diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs index bcc5d787..6bfb98e4 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs @@ -794,6 +794,8 @@ namespace BMA.EHR.Retirement.Service.Controllers leaveReason = _null, dateLeave = _null, isGovernment = true, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1001,7 +1003,9 @@ namespace BMA.EHR.Retirement.Service.Controllers isLeave = false, leaveReason = _null, dateLeave = _null, - isGovernment = true + isGovernment = true, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs index b6468e2b..cb6c5399 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs @@ -547,7 +547,9 @@ namespace BMA.EHR.Retirement.Service.Controllers isLeave = true, leaveReason = "ให้ออกจากราชการ", dateLeave = r.commandAffectDate, - isGovernment = false + isGovernment = false, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs index 960075ed..9d55c91d 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs @@ -2460,6 +2460,8 @@ namespace BMA.EHR.Retirement.Service.Controllers isGovernment = false, leaveReason = "ออกจากราชการ", dateLeave = r.commandAffectDate, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -2645,6 +2647,8 @@ namespace BMA.EHR.Retirement.Service.Controllers isLeave = false, leaveReason = _null, dateLeave = _null, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs index 001a020c..a86d1250 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs @@ -2403,6 +2403,8 @@ namespace BMA.EHR.Retirement.Service.Controllers isGovernment = false, leaveReason = "ออกจากราชการ", dateLeave = r.commandAffectDate, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -2588,6 +2590,8 @@ namespace BMA.EHR.Retirement.Service.Controllers isLeave = false, leaveReason = _null, dateLeave = _null, + refCommandCode = r.refCommandCode, + refCommandName = r.refCommandName, }).ToList(); var baseAPIOrg = _configuration["API"]; diff --git a/BMA.EHR.Retirement.Service/Requests/ReportExecuteRequest.cs b/BMA.EHR.Retirement.Service/Requests/ReportExecuteRequest.cs index cf161c9c..c90e92ca 100644 --- a/BMA.EHR.Retirement.Service/Requests/ReportExecuteRequest.cs +++ b/BMA.EHR.Retirement.Service/Requests/ReportExecuteRequest.cs @@ -19,5 +19,7 @@ namespace BMA.EHR.Retirement.Service.Requests public double? amountSpecial { get; set; } public double? positionSalaryAmount { get; set; } public double? mouthSalaryAmount { get; set; } + public string? refCommandCode { get; set; } + public string? refCommandName { get; set; } } } From 4dc69285eaa71b344a4e519ada01d6cdf1949f74 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Fri, 10 Jan 2025 15:23:38 +0700 Subject: [PATCH 18/20] updated report probation --- .../Reports/ProbationReportRepository.cs | 27 +++++++------------ .../Responses/EvaluateAssignResponse.cs | 2 ++ .../EvaluateChairmanAssignResponse.cs | 1 + .../Responses/EvaluateRecordAssignResponse.cs | 5 +++- .../Responses/EvaluateResultAssignResponse.cs | 1 + .../Responses/ProbationAssignResponse.cs | 1 + 6 files changed, 18 insertions(+), 19 deletions(-) diff --git a/BMA.EHR.Application/Repositories/Reports/ProbationReportRepository.cs b/BMA.EHR.Application/Repositories/Reports/ProbationReportRepository.cs index c4f3fe8c..68857412 100644 --- a/BMA.EHR.Application/Repositories/Reports/ProbationReportRepository.cs +++ b/BMA.EHR.Application/Repositories/Reports/ProbationReportRepository.cs @@ -94,6 +94,7 @@ namespace BMA.EHR.Application.Repositories.Reports { Name = string.IsNullOrEmpty(probation_assign.result.profile.name) ? "-" : probation_assign.result.profile.name, Position = string.IsNullOrEmpty(probation_assign.result.profile.Position) ? "-" : probation_assign.result.profile.Position, + PositionLevel = string.IsNullOrEmpty(probation_assign.result.profile.PositionLevelName) ? "-" : probation_assign.result.profile.PositionLevelName, Department = string.IsNullOrEmpty(probation_assign.result.profile.Department) ? "-" : probation_assign.result.profile.Department, OrganizationOrganization = string.IsNullOrEmpty(probation_assign.result.profile.OrganizationOrganization) ? "-" : probation_assign.result.profile.OrganizationOrganization, Oc = string.IsNullOrEmpty(probation_assign.result.profile.Oc) ? "-" : probation_assign.result.profile.Oc, @@ -147,25 +148,11 @@ namespace BMA.EHR.Application.Repositories.Reports var training_seminar = evaluate_record.result.evaluate.training_seminar == "1" ? "🗹 ดำเนินการแล้ว ☐ ยังไม่ได้ดำเนินการ" : "☐ ดำเนินการแล้ว 🗹 ยังไม่ได้ดำเนินการ"; var other_training = evaluate_record.result.evaluate.other_training == "1" ? "🗹 ดำเนินการแล้ว ☐ ยังไม่ได้ดำเนินการ" : "☐ ดำเนินการแล้ว 🗹 ยังไม่ได้ดำเนินการ"; - var expects = evaluate_record.result.evaluate != null && evaluate_record.result.evaluate.achievements.Count > 0 - ? new - { - col1 = evaluate_record.result.evaluate.achievements[0].evaluate_expect_level.col1 == "/" ? "✓" : string.Empty, - col2 = evaluate_record.result.evaluate.achievements[0].evaluate_expect_level.col2 == "/" ? "✓" : string.Empty, - col3 = evaluate_record.result.evaluate.achievements[0].evaluate_expect_level.col3 == "/" ? "✓" : string.Empty, - col4 = evaluate_record.result.evaluate.achievements[0].evaluate_expect_level.col4 == "/" ? "✓" : string.Empty, - col5 = evaluate_record.result.evaluate.achievements[0].evaluate_expect_level.col5 == "/" ? "✓" : string.Empty, - } + var expects = evaluate_record.result.evaluate != null && evaluate_record.result.evaluate.achievements.evaluate_expect_level + ? evaluate_record.result.evaluate.achievements.evaluate_expect_level : null; - var outputs = evaluate_record.result.evaluate != null && evaluate_record.result.evaluate.achievements.Count > 0 - ? new - { - col1 = evaluate_record.result.evaluate.achievements[0].evaluate_output_level.col1 == "/" ? "✓" : string.Empty, - col2 = evaluate_record.result.evaluate.achievements[0].evaluate_output_level.col2 == "/" ? "✓" : string.Empty, - col3 = evaluate_record.result.evaluate.achievements[0].evaluate_output_level.col3 == "/" ? "✓" : string.Empty, - col4 = evaluate_record.result.evaluate.achievements[0].evaluate_output_level.col4 == "/" ? "✓" : string.Empty, - col5 = evaluate_record.result.evaluate.achievements[0].evaluate_output_level.col5 == "/" ? "✓" : string.Empty, - } + var outputs = evaluate_record.result.evaluate != null && evaluate_record.result.evaluate.achievements.evaluate_output_level + ? evaluate_record.result.evaluate.achievements.evaluate_output_level : null; var knows = evaluate_record.result.evaluate != null ? new @@ -365,6 +352,7 @@ namespace BMA.EHR.Application.Repositories.Reports DirectorDated = string.IsNullOrEmpty(evaluate_record.result.evaluate.sign_dated.ToString()) ? "-" : evaluate_record.result.evaluate.sign_dated.ToThaiFullDate().ToString().ToThaiNumber(), Name = string.IsNullOrEmpty(evaluate_record.result.experimentee.name) ? string.Empty : evaluate_record.result.experimentee.name, Position = string.IsNullOrEmpty(evaluate_record.result.experimentee.Position) ? string.Empty : evaluate_record.result.experimentee.Position, + PositionLevel = string.IsNullOrEmpty(evaluate_record.result.experimentee.PositionLevelName) ? "-" : evaluate_record.result.experimentee.PositionLevelName, Department = string.IsNullOrEmpty(evaluate_record.result.experimentee.Department) ? string.Empty : evaluate_record.result.experimentee.Department, Organization = string.IsNullOrEmpty(evaluate_record.result.experimentee.OrganizationOrganization) ? string.Empty : evaluate_record.result.experimentee.OrganizationOrganization, Oc = string.IsNullOrEmpty(evaluate_record.result.experimentee.Oc) ? string.Empty : evaluate_record.result.experimentee.Oc, @@ -592,6 +580,7 @@ namespace BMA.EHR.Application.Repositories.Reports EvaluateDateFinish = string.IsNullOrEmpty(evaluate_assign.result.evaluate.date_finish.ToString()) ? "-" : evaluate_assign.result.evaluate.date_finish.ToThaiFullDate().ToString().ToThaiNumber(), Name = string.IsNullOrEmpty(evaluate_assign.result.experimentee.name) ? string.Empty : evaluate_assign.result.experimentee.name, Position = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Position) ? string.Empty : evaluate_assign.result.experimentee.Position, + PositionLevel = string.IsNullOrEmpty(evaluate_assign.result.experimentee.PositionLevelName) ? "-" : evaluate_assign.result.experimentee.PositionLevelName, Department = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Department) ? string.Empty : evaluate_assign.result.experimentee.Department, Organization = string.IsNullOrEmpty(evaluate_assign.result.experimentee.OrganizationOrganization) ? string.Empty : evaluate_assign.result.experimentee.OrganizationOrganization, Oc = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Oc) ? string.Empty : evaluate_assign.result.experimentee.Oc, @@ -822,6 +811,7 @@ namespace BMA.EHR.Application.Repositories.Reports EvaluateDateFinish = string.IsNullOrEmpty(evaluate_assign.result.evaluate.date_finish.ToString()) ? "-" : evaluate_assign.result.evaluate.date_finish.ToThaiFullDate().ToString().ToThaiNumber(), Name = string.IsNullOrEmpty(evaluate_assign.result.experimentee.name) ? string.Empty : evaluate_assign.result.experimentee.name, Position = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Position) ? string.Empty : evaluate_assign.result.experimentee.Position, + PositionLevel = string.IsNullOrEmpty(evaluate_assign.result.experimentee.PositionLevelName) ? "-" : evaluate_assign.result.experimentee.PositionLevelName, Department = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Department) ? string.Empty : evaluate_assign.result.experimentee.Department, Organization = string.IsNullOrEmpty(evaluate_assign.result.experimentee.OrganizationOrganization) ? string.Empty : evaluate_assign.result.experimentee.OrganizationOrganization, Oc = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Oc) ? string.Empty : evaluate_assign.result.experimentee.Oc, @@ -933,6 +923,7 @@ namespace BMA.EHR.Application.Repositories.Reports EvaluateDateStart = string.IsNullOrEmpty(evaluate_assign.result.evaluate.date_start.ToString()) ? "-" : evaluate_assign.result.evaluate.date_start.ToThaiFullDate().ToString().ToThaiNumber(), EvaluateDateFinish = string.IsNullOrEmpty(evaluate_assign.result.evaluate.date_start.ToString()) ? "-" : evaluate_assign.result.evaluate.date_start.ToThaiFullDate().ToString().ToThaiNumber(), Position = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Position) ? string.Empty : evaluate_assign.result.experimentee.Position, + PositionLevel = string.IsNullOrEmpty(evaluate_assign.result.experimentee.PositionLevelName) ? "-" : evaluate_assign.result.experimentee.PositionLevelName, Department = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Department) ? string.Empty : evaluate_assign.result.experimentee.Department, Organization = string.IsNullOrEmpty(evaluate_assign.result.experimentee.OrganizationOrganization) ? string.Empty : evaluate_assign.result.experimentee.OrganizationOrganization, Oc = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Oc) ? string.Empty : evaluate_assign.result.experimentee.Oc, diff --git a/BMA.EHR.Application/Responses/EvaluateAssignResponse.cs b/BMA.EHR.Application/Responses/EvaluateAssignResponse.cs index a1dc9e7f..08ce18dd 100644 --- a/BMA.EHR.Application/Responses/EvaluateAssignResponse.cs +++ b/BMA.EHR.Application/Responses/EvaluateAssignResponse.cs @@ -26,6 +26,8 @@ namespace BMA.EHR.Application.Responses public string Position { get; set; } = string.Empty; public string Department { get; set; } = string.Empty; public string Oc { get; set; } = string.Empty; + public string PositionLevelName { get; set; } = string.Empty; + } public class Commander diff --git a/BMA.EHR.Application/Responses/EvaluateChairmanAssignResponse.cs b/BMA.EHR.Application/Responses/EvaluateChairmanAssignResponse.cs index 33ffa03e..7866aef5 100644 --- a/BMA.EHR.Application/Responses/EvaluateChairmanAssignResponse.cs +++ b/BMA.EHR.Application/Responses/EvaluateChairmanAssignResponse.cs @@ -26,6 +26,7 @@ namespace BMA.EHR.Application.Responses public string PositionLineId { get; set; } = string.Empty; public string OrganizationOrganization { get; set; } = string.Empty; public string Position { get; set; } = string.Empty; + public string PositionLevelName { get; set; } = string.Empty; public string Department { get; set; } = string.Empty; public string Oc { get; set; } = string.Empty; } diff --git a/BMA.EHR.Application/Responses/EvaluateRecordAssignResponse.cs b/BMA.EHR.Application/Responses/EvaluateRecordAssignResponse.cs index 023a75c2..e0a8d017 100644 --- a/BMA.EHR.Application/Responses/EvaluateRecordAssignResponse.cs +++ b/BMA.EHR.Application/Responses/EvaluateRecordAssignResponse.cs @@ -26,6 +26,7 @@ namespace BMA.EHR.Application.Responses public string Department { get; set; } public string OrganizationOrganization { get; set; } public string Oc { get; set; } + public string PositionLevelName { get; set; } } public class Director @@ -89,7 +90,7 @@ namespace BMA.EHR.Application.Responses public string role { get; set; } public DateTime createdAt { get; set; } public DateTime updatedAt { get; set; } - public List achievements { get; set; } + public Achievement achievements { get; set; } } public class Achievement @@ -102,6 +103,7 @@ namespace BMA.EHR.Application.Responses public class EvaluateExpectLevel { + public string? title { get; set; } public string col1 { get; set; } public string col2 { get; set; } public string col3 { get; set; } @@ -111,6 +113,7 @@ namespace BMA.EHR.Application.Responses public class EvaluateOutputLevel { + public string? title { get; set; } public string col1 { get; set; } public string col2 { get; set; } public string col3 { get; set; } diff --git a/BMA.EHR.Application/Responses/EvaluateResultAssignResponse.cs b/BMA.EHR.Application/Responses/EvaluateResultAssignResponse.cs index b3343c77..5db0ce18 100644 --- a/BMA.EHR.Application/Responses/EvaluateResultAssignResponse.cs +++ b/BMA.EHR.Application/Responses/EvaluateResultAssignResponse.cs @@ -64,6 +64,7 @@ namespace BMA.EHR.Application.Responses public string PositionLevelId { get; set; } public string PositionLineId { get; set; } public string Position { get; set; } + public string PositionLevelName { get; set; } public string Department { get; set; } public string OrganizationOrganization { get; set; } public string Oc { get; set; } diff --git a/BMA.EHR.Application/Responses/ProbationAssignResponse.cs b/BMA.EHR.Application/Responses/ProbationAssignResponse.cs index 88314d87..a96a9204 100644 --- a/BMA.EHR.Application/Responses/ProbationAssignResponse.cs +++ b/BMA.EHR.Application/Responses/ProbationAssignResponse.cs @@ -28,6 +28,7 @@ public string Position { get; set; } = string.Empty; public string Department { get; set; } = string.Empty; public string Oc { get; set; } = string.Empty; + public string PositionLevelName { get; set; } = string.Empty; } public class Assign From 294fc7942578e41d85a98bf5e5c6cfc7c8005d9f Mon Sep 17 00:00:00 2001 From: kittapath Date: Fri, 10 Jan 2025 16:51:04 +0700 Subject: [PATCH 19/20] no message --- .../Reports/ProbationReportRepository.cs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/BMA.EHR.Application/Repositories/Reports/ProbationReportRepository.cs b/BMA.EHR.Application/Repositories/Reports/ProbationReportRepository.cs index 68857412..29de906b 100644 --- a/BMA.EHR.Application/Repositories/Reports/ProbationReportRepository.cs +++ b/BMA.EHR.Application/Repositories/Reports/ProbationReportRepository.cs @@ -148,12 +148,8 @@ namespace BMA.EHR.Application.Repositories.Reports var training_seminar = evaluate_record.result.evaluate.training_seminar == "1" ? "🗹 ดำเนินการแล้ว ☐ ยังไม่ได้ดำเนินการ" : "☐ ดำเนินการแล้ว 🗹 ยังไม่ได้ดำเนินการ"; var other_training = evaluate_record.result.evaluate.other_training == "1" ? "🗹 ดำเนินการแล้ว ☐ ยังไม่ได้ดำเนินการ" : "☐ ดำเนินการแล้ว 🗹 ยังไม่ได้ดำเนินการ"; - var expects = evaluate_record.result.evaluate != null && evaluate_record.result.evaluate.achievements.evaluate_expect_level - ? evaluate_record.result.evaluate.achievements.evaluate_expect_level - : null; - var outputs = evaluate_record.result.evaluate != null && evaluate_record.result.evaluate.achievements.evaluate_output_level - ? evaluate_record.result.evaluate.achievements.evaluate_output_level - : null; + var expects = evaluate_record?.result?.evaluate?.achievements?.evaluate_expect_level ?? null; + var outputs = evaluate_record?.result?.evaluate?.achievements?.evaluate_output_level ?? null; var knows = evaluate_record.result.evaluate != null ? new { @@ -363,13 +359,7 @@ namespace BMA.EHR.Application.Repositories.Reports EvaluateDateFinish = string.IsNullOrEmpty(evaluate_record.result.evaluate.date_finish.ToString()) ? string.Empty : evaluate_record.result.evaluate.date_finish.ToThaiFullDate().ToString().ToThaiNumber(), Role = evaluate_record.result.evaluate.role == "mentor" ? "ผู้ดูแลการทดลองปฏิบัติหน้าที่ราชการ" : "ผู้บังคับบัญชา", Expects = expects, - ExpectDesc = evaluate_record.result.evaluate != null && evaluate_record.result.evaluate.achievements.Count > 0 - ? evaluate_record.result.evaluate.achievements[0].evaluate_expect_desc - : string.Empty, Outputs = outputs, - OutputDesc = evaluate_record.result.evaluate != null && evaluate_record.result.evaluate.achievements.Count > 0 - ? evaluate_record.result.evaluate.achievements[0].evaluate_output_desc - : string.Empty, AchievementOtherDesc = evaluate_record.result.evaluate.achievement_other_desc, AchievementStrengthDesc = evaluate_record.result.evaluate.achievement_strength_desc, AchievementImproveDesc = evaluate_record.result.evaluate.achievement_improve_desc, From 223e8761525562de7b9e3e00564556a09d7f5278 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Fri, 10 Jan 2025 18:31:27 +0700 Subject: [PATCH 20/20] add law & skill --- .../Reports/ProbationReportRepository.cs | 11 +++++++++++ .../Responses/ProbationAssignResponse.cs | 16 ++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/BMA.EHR.Application/Repositories/Reports/ProbationReportRepository.cs b/BMA.EHR.Application/Repositories/Reports/ProbationReportRepository.cs index 29de906b..102c256d 100644 --- a/BMA.EHR.Application/Repositories/Reports/ProbationReportRepository.cs +++ b/BMA.EHR.Application/Repositories/Reports/ProbationReportRepository.cs @@ -89,6 +89,17 @@ namespace BMA.EHR.Application.Repositories.Reports output_desc = string.IsNullOrEmpty(x.output_desc) ? string.Empty : x.output_desc.ToThaiNumber(), }).ToList(); + var skills = probation_assign.result.skills.Select(x => new + { + id = string.IsNullOrEmpty(x.id.ToString()) ? string.Empty : x.id.ToString().ToThaiNumber(), + title = string.IsNullOrEmpty(x.title) ? string.Empty : x.title.ToThaiNumber(), + description = string.IsNullOrEmpty(x.description) ? string.Empty : x.description.ToThaiNumber(), + }).ToList(); + + var laws = probation_assign.result.laws.Where(x => x.selected == true).Select((x, Index) => new + { + title = string.IsNullOrEmpty(x.description) ? string.Empty : $"{Index + 1}. {x.description.ToThaiNumber()}", + }).ToList(); return new { diff --git a/BMA.EHR.Application/Responses/ProbationAssignResponse.cs b/BMA.EHR.Application/Responses/ProbationAssignResponse.cs index a96a9204..1a5a0e15 100644 --- a/BMA.EHR.Application/Responses/ProbationAssignResponse.cs +++ b/BMA.EHR.Application/Responses/ProbationAssignResponse.cs @@ -15,6 +15,8 @@ public List knowledges { get; set; } public List competencys { get; set; } public List outputs { get; set; } + public List laws { get; set; } + public List skills { get; set; } } public class Profile @@ -73,6 +75,20 @@ public string description { get; set; } = string.Empty; } + public class Skill + { + public int id { get; set; } + public string title { get; set; } = string.Empty; + public string description { get; set; } = string.Empty; + } + + public class Law + { + public int id { get; set; } + public string description { get; set; } = string.Empty; + public bool selected { get; set; } + } + public class Competency { public string id { get; set; } = string.Empty;