Fix Defect 13/12/66 09:17

This commit is contained in:
Suphonchai Phoonsawat 2023-12-13 09:17:43 +07:00
parent 7fa4ba9750
commit 389a99fce6
6 changed files with 26 additions and 5 deletions

View file

@ -47,7 +47,7 @@ jobs:
username: ${{secrets.DOCKER_USER}} username: ${{secrets.DOCKER_USER}}
password: ${{secrets.DOCKER_PASS}} password: ${{secrets.DOCKER_PASS}}
- name: Build and load local docker image - name: Build and load local docker image
uses: docker/build-push-action@v3 uses: docker/build-push-action@v5
with: with:
context: . context: .
platforms: linux/amd64 platforms: linux/amd64

View file

@ -553,7 +553,7 @@ namespace BMA.EHR.Leave.Service.Controllers
"LATE" : "LATE" :
"NORMAL", "NORMAL",
IsEdit = (d.EditStatus != null || d.EditStatus != "") IsEdit = (d.EditStatus != null && d.EditStatus != "")
//EditReason = d.EditReason ?? "", //EditReason = d.EditReason ?? "",
//EditStatus = d.EditStatus ?? "" //EditStatus = d.EditStatus ?? ""
@ -610,12 +610,20 @@ namespace BMA.EHR.Leave.Service.Controllers
CheckInLon = d.CheckInLon, CheckInLon = d.CheckInLon,
CheckInImage = $"{imgUrl}/{d.CheckInImageUrl}", CheckInImage = $"{imgUrl}/{d.CheckInImageUrl}",
// add from new specification
IsLocationCheckIn = d.IsLocationCheckIn,
CheckInLocationName = d.CheckInLocationName ?? "",
CheckOutDate = d.CheckOut == null ? null : d.CheckOut.Value.Date, CheckOutDate = d.CheckOut == null ? null : d.CheckOut.Value.Date,
CheckOutTime = d.CheckOut == null ? "" : d.CheckOut.Value.ToString("HH:mm:ss"), CheckOutTime = d.CheckOut == null ? "" : d.CheckOut.Value.ToString("HH:mm:ss"),
CheckOutLocation = d.CheckOut == null ? "" : d.CheckOutPOI, CheckOutLocation = d.CheckOut == null ? "" : d.CheckOutPOI,
CheckOutLat = d.CheckOut == null ? null : d.CheckOutLat, CheckOutLat = d.CheckOut == null ? null : d.CheckOutLat,
CheckOutLon = d.CheckOut == null ? null : d.CheckOutLon, CheckOutLon = d.CheckOut == null ? null : d.CheckOutLon,
CheckOutImage = d.CheckOut == null ? "" : $"{imgUrl}/{d.CheckOutImageUrl}", CheckOutImage = d.CheckOut == null ? "" : $"{imgUrl}/{d.CheckOutImageUrl}",
// add from new specification
IsLocationCheckOut = d.IsLocationCheckOut,
CheckOutLocationName = d.CheckOutLocationName ?? ""
}) })
.ToList(); .ToList();

View file

@ -301,6 +301,8 @@ namespace BMA.EHR.Leave.Service.Controllers
approver = list.First().Name; approver = list.First().Name;
} }
var leaveLast = await _leaveRequestRepository.GetLeaveLastByTypeForUserAsync(userId, req.Type);
var result = new GetUserLeaveProfileResultDto var result = new GetUserLeaveProfileResultDto
{ {
DateSendLeave = DateTime.Now.Date, DateSendLeave = DateTime.Now.Date,
@ -318,6 +320,7 @@ namespace BMA.EHR.Leave.Service.Controllers
DateAppoint = profile.DateAppoint == null ? null : profile.DateAppoint.Value.Date, DateAppoint = profile.DateAppoint == null ? null : profile.DateAppoint.Value.Date,
Salary = lastSalary == null ? 0 : (int)lastSalary.Amount.Value, Salary = lastSalary == null ? 0 : (int)lastSalary.Amount.Value,
SalaryText = lastSalary == null ? "" : ((int)lastSalary.Amount.Value).ToThaiBahtText(false), SalaryText = lastSalary == null ? "" : ((int)lastSalary.Amount.Value).ToThaiBahtText(false),
LeaveLast = leaveLast == null ? null : leaveLast
}; };
return Success(result); return Success(result);

View file

@ -18,6 +18,10 @@
public string? CheckInImage { get; set; } = string.Empty; public string? CheckInImage { get; set; } = string.Empty;
public bool IsLocationCheckIn { get; set; } = true;
public string? CheckInLocationName { get; set; } = string.Empty;
public DateTime? CheckOutDate { get; set; } = DateTime.MinValue; public DateTime? CheckOutDate { get; set; } = DateTime.MinValue;
public string? CheckOutTime { get; set; } = "00:00"; public string? CheckOutTime { get; set; } = "00:00";
@ -29,5 +33,9 @@
public double? CheckOutLon { get; set; } = 0; public double? CheckOutLon { get; set; } = 0;
public string? CheckOutImage { get; set; } = string.Empty; public string? CheckOutImage { get; set; } = string.Empty;
public bool IsLocationCheckOut { get; set; } = true;
public string? CheckOutLocationName { get; set; } = string.Empty;
} }
} }

View file

@ -31,5 +31,7 @@
public int Salary { get; set; } public int Salary { get; set; }
public string SalaryText { get; set; } public string SalaryText { get; set; }
public DateTime? LeaveLast { get; set; }
} }
} }

View file

@ -13,10 +13,10 @@ 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.Infrastructure/BMA.EHR.Infrastructure.csproj", "BMA.EHR.Infrastructure/"]
COPY ["BMA.EHR.Leave.Service/BMA.EHR.Leave.Service.csproj", "BMA.EHR.Leave.Service/"] COPY ["BMA.EHR.Leave.Service/BMA.EHR.Leave.Service.csproj", "BMA.EHR.Leave.Service/"]
RUN dotnet restore "BMA.EHR.Leave.Service/BMA.EHR.Leave.Service.csproj" RUN dotnet restore "BMA.EHR.Leave.Service/BMA.EHR.Leave.Service.csproj"
COPY . . COPY . .
WORKDIR "/src/BMA.EHR.Leave.Service" WORKDIR "/src/BMA.EHR.Leave.Service"
RUN dotnet build "BMA.EHR.Leave.Service.csproj" -c Release -o /app/build RUN dotnet build "BMA.EHR.Leave.Service.csproj" -c Release -o /app/build
FROM build AS publish FROM build AS publish
RUN dotnet publish "BMA.EHR.Leave.Service.csproj" -c Release -o /app/publish /p:UseAppHost=false RUN dotnet publish "BMA.EHR.Leave.Service.csproj" -c Release -o /app/publish /p:UseAppHost=false