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}}
password: ${{secrets.DOCKER_PASS}}
- name: Build and load local docker image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64

View file

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

View file

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

View file

@ -1,5 +1,5 @@
namespace BMA.EHR.Leave.Service.DTOs.CheckIn
{
{
public class CheckInHistoryForAdminDto
{
public Guid Id { get; set; } = Guid.Empty;
@ -18,6 +18,10 @@
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 string? CheckOutTime { get; set; } = "00:00";
@ -29,5 +33,9 @@
public double? CheckOutLon { get; set; } = 0;
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 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.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 . .
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
RUN dotnet publish "BMA.EHR.Leave.Service.csproj" -c Release -o /app/publish /p:UseAppHost=false