From 5319aa607b58ef3d9029292d1867a312be4c2051 Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Mon, 26 Aug 2024 11:58:42 +0700 Subject: [PATCH] fix code leave and insignia --- .idea/.idea.BMA.EHR.Solution/.idea/.name | 1 + .../.idea/encodings.xml | 4 + .../.idea/indexLayout.xml | 8 + .../.idea/projectSettingsUpdater.xml | 6 + .idea/.idea.BMA.EHR.Solution/.idea/vcs.xml | 6 + .../.idea/workspace.xml | 552 ++++++++++++++++++ .../Controllers/InsigniaRequestController.cs | 15 +- BMA.EHR.Insignia/appsettings.json | 3 +- BMA.EHR.Leave/Controllers/LeaveController.cs | 12 +- BMA.EHR.Leave/appsettings.json | 6 +- 10 files changed, 597 insertions(+), 16 deletions(-) create mode 100644 .idea/.idea.BMA.EHR.Solution/.idea/.name create mode 100644 .idea/.idea.BMA.EHR.Solution/.idea/encodings.xml create mode 100644 .idea/.idea.BMA.EHR.Solution/.idea/indexLayout.xml create mode 100644 .idea/.idea.BMA.EHR.Solution/.idea/projectSettingsUpdater.xml create mode 100644 .idea/.idea.BMA.EHR.Solution/.idea/vcs.xml create mode 100644 .idea/.idea.BMA.EHR.Solution/.idea/workspace.xml diff --git a/.idea/.idea.BMA.EHR.Solution/.idea/.name b/.idea/.idea.BMA.EHR.Solution/.idea/.name new file mode 100644 index 00000000..888d8763 --- /dev/null +++ b/.idea/.idea.BMA.EHR.Solution/.idea/.name @@ -0,0 +1 @@ +BMA.EHR.Solution \ No newline at end of file diff --git a/.idea/.idea.BMA.EHR.Solution/.idea/encodings.xml b/.idea/.idea.BMA.EHR.Solution/.idea/encodings.xml new file mode 100644 index 00000000..df87cf95 --- /dev/null +++ b/.idea/.idea.BMA.EHR.Solution/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/.idea.BMA.EHR.Solution/.idea/indexLayout.xml b/.idea/.idea.BMA.EHR.Solution/.idea/indexLayout.xml new file mode 100644 index 00000000..7b08163c --- /dev/null +++ b/.idea/.idea.BMA.EHR.Solution/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.BMA.EHR.Solution/.idea/projectSettingsUpdater.xml b/.idea/.idea.BMA.EHR.Solution/.idea/projectSettingsUpdater.xml new file mode 100644 index 00000000..4bb9f4d2 --- /dev/null +++ b/.idea/.idea.BMA.EHR.Solution/.idea/projectSettingsUpdater.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/.idea.BMA.EHR.Solution/.idea/vcs.xml b/.idea/.idea.BMA.EHR.Solution/.idea/vcs.xml new file mode 100644 index 00000000..35eb1ddf --- /dev/null +++ b/.idea/.idea.BMA.EHR.Solution/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/.idea.BMA.EHR.Solution/.idea/workspace.xml b/.idea/.idea.BMA.EHR.Solution/.idea/workspace.xml new file mode 100644 index 00000000..3a284eaf --- /dev/null +++ b/.idea/.idea.BMA.EHR.Solution/.idea/workspace.xml @@ -0,0 +1,552 @@ + + + + BMA.EHR.CheckInConsumer/BMA.EHR.CheckInConsumer.csproj + BMA.EHR.CheckInConsumer/BMA.EHR.CheckInConsumer.csproj + BMA.EHR.Command.Service/BMA.EHR.Command.Service.csproj + BMA.EHR.Command.Service/BMA.EHR.Command.Service.csproj + BMA.EHR.Command.Service/BMA.EHR.Command.Service.csproj + BMA.EHR.Discipline.Service/BMA.EHR.Discipline.Service.csproj + BMA.EHR.Discipline.Service/BMA.EHR.Discipline.Service.csproj + BMA.EHR.Insignia/BMA.EHR.Insignia.csproj + BMA.EHR.Insignia/BMA.EHR.Insignia.csproj + BMA.EHR.Insignia/BMA.EHR.Insignia.csproj + BMA.EHR.Leave/BMA.EHR.Leave.csproj + BMA.EHR.Leave/BMA.EHR.Leave.csproj + BMA.EHR.Leave/BMA.EHR.Leave.csproj + BMA.EHR.MetaData.Service/BMA.EHR.MetaData.Service.csproj + BMA.EHR.MetaData.Service/BMA.EHR.MetaData.Service.csproj + BMA.EHR.MetaData.Service/BMA.EHR.MetaData.Service.csproj + BMA.EHR.OrganizationEmployee.Service/BMA.EHR.OrganizationEmployee.Service.csproj + BMA.EHR.OrganizationEmployee.Service/BMA.EHR.OrganizationEmployee.Service.csproj + BMA.EHR.OrganizationEmployee.Service/BMA.EHR.OrganizationEmployee.Service.csproj + BMA.EHR.Placement.Service/BMA.EHR.Placement.Service.csproj + BMA.EHR.Placement.Service/BMA.EHR.Placement.Service.csproj + BMA.EHR.Placement.Service/BMA.EHR.Placement.Service.csproj + BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj + BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj + BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj + BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj + BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj + BMA.EHR.Retirement.Service/BMA.EHR.Retirement.Service.csproj + BMA.EHR.Retirement.Service/BMA.EHR.Retirement.Service.csproj + BMA.EHR.Retirement.Service/BMA.EHR.Retirement.Service.csproj + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1724638841465 + + + + + + + + + + + + + file://$PROJECT_DIR$/BMA.EHR.Leave/Controllers/LeaveController.cs + 1152 + + + + + + + + + + + \ No newline at end of file diff --git a/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs b/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs index 05a9ef09..567c38c5 100644 --- a/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs +++ b/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs @@ -974,17 +974,18 @@ namespace BMA.EHR.Insignia.Service.Controllers .Where(x => x.RequestStatus == "st1") .Select(x => x.OrganizationId) .ToListAsync(); - var orgAllCount = await _context.Organizations - .Where(x => x.OrganizationOrganization != null) - .Where(x => x.OrganizationType != null) - .Where(x => x.OrganizationType.Name == "หน่วยงาน") - .Where(x => orgIdSend.Contains(x.Id)) + + + var organizations = await _userProfileRepository.GetActiveRootAsync(AccessToken); + + var orgAllCount = organizations + .Where(x => !orgIdSend.Contains(x.Id)) .Select(x => new { OrgId = x.Id, - OrgName = x.OrganizationOrganization.Name + OrgName = x.OrgRootName }) - .ToListAsync(); + .ToList(); return Success(orgAllCount); } diff --git a/BMA.EHR.Insignia/appsettings.json b/BMA.EHR.Insignia/appsettings.json index 721d7fd2..c941aa71 100644 --- a/BMA.EHR.Insignia/appsettings.json +++ b/BMA.EHR.Insignia/appsettings.json @@ -15,7 +15,8 @@ "ConnectionStrings": { //"DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB", //"DefaultConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" - "DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + //"DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "DefaultConnection": "server=192.168.1.81;user=root;password=adminVM123;port=4063;database=bma_ehr;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", "ExamConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", "LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_leave_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", "DisciplineConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_discipline_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" diff --git a/BMA.EHR.Leave/Controllers/LeaveController.cs b/BMA.EHR.Leave/Controllers/LeaveController.cs index eb51780d..5461908d 100644 --- a/BMA.EHR.Leave/Controllers/LeaveController.cs +++ b/BMA.EHR.Leave/Controllers/LeaveController.cs @@ -993,7 +993,7 @@ namespace BMA.EHR.Leave.Service.Controllers { Id = d.Id, //FullName = _userProfileRepository.GetUserFullName(d.KeycloakUserId, AccessToken), - FullName = $"{d.Prefix}{d.FirstName} {d.LastName}", + FullName = $"{d.Prefix ?? ""}{d.FirstName ?? ""} {d.LastName ?? ""}", CheckInDate = d.CheckIn.Date, CheckInTime = d.CheckIn.ToString("HH:mm:ss"), @@ -1006,7 +1006,7 @@ namespace BMA.EHR.Leave.Service.Controllers IsLocationCheckIn = d.IsLocationCheckIn, CheckInLocationName = d.CheckInLocationName ?? "", - CheckOutDate = d.CheckOut == null ? null : d.CheckOut.Value.Date, + CheckOutDate = d.CheckOut?.Date, CheckOutTime = d.CheckOut == null ? "" : d.CheckOut.Value.ToString("HH:mm:ss"), CheckOutLocation = d.CheckOut == null ? "" : d.CheckOutPOI, CheckOutLat = d.CheckOut == null ? null : d.CheckOutLat, @@ -1201,7 +1201,7 @@ namespace BMA.EHR.Leave.Service.Controllers data.Add(new CheckInProcessHistoryForAdminDto { Id = d.Id, - FullName = $"{d.Prefix}{d.FirstName} {d.LastName}", + FullName = $"{d.Prefix ?? ""}{d.FirstName ?? ""} {d.LastName ?? ""}", CheckInDate = d.CheckIn.Date, CheckInTime = d.CheckIn.ToString("HH:mm"), CheckInLocation = d.CheckInPOI, @@ -1217,10 +1217,10 @@ namespace BMA.EHR.Leave.Service.Controllers "LATE" : "NORMAL", CheckInIsLocation = d.IsLocationCheckIn, - CheckInLocationName = d.CheckInLocationName, + CheckInLocationName = d.CheckInLocationName ?? "", //CheckInImageUrl = $"{imgUrl}/{d.CheckInImageUrl}", - CheckOutDate = d.CheckOut == null ? null : d.CheckOut.Value.Date, + CheckOutDate = d.CheckOut?.Date, CheckOutTime = d.CheckOut == null ? "" : d.CheckOut.Value.ToString("HH:mm"), CheckOutLocation = d.CheckOut == null ? "" : d.CheckOutPOI, CheckOutLat = d.CheckOut == null ? null : d.CheckOutLat, @@ -1234,7 +1234,7 @@ namespace BMA.EHR.Leave.Service.Controllers "ABSENT" : "NORMAL", CheckOutIsLocation = d.IsLocationCheckOut, - CheckOutLocationName = d.CheckOutLocationName + CheckOutLocationName = d.CheckOutLocationName ?? "" //CheckOutImageUrl = d.CheckOut == null ? "" : $"{imgUrl}/{d.CheckOutImageUrl}", }); } diff --git a/BMA.EHR.Leave/appsettings.json b/BMA.EHR.Leave/appsettings.json index 70c27f13..6d09ce83 100644 --- a/BMA.EHR.Leave/appsettings.json +++ b/BMA.EHR.Leave/appsettings.json @@ -15,10 +15,12 @@ "ConnectionStrings": { //"DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB", //"DefaultConnection": "server=192.168.1.81;user=root;password=adminVM123;port=4061;database=bma_ehr;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "DefaultConnection": "server=192.168.1.81;user=root;password=adminVM123;port=4063;database=bma_ehr;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + //"DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", "ExamConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", //"LeaveConnection": "server=192.168.4.11;user=root;password=P@ssw0rd;port=3306;database=bma_ehr_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" - "LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_leave_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" + //"LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_leave_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "LeaveConnection": "server=192.168.1.81;user=root;password=adminVM123;port=4063;database=bma_ehr_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" }, "Jwt": { "Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",