fix เพิ่มเติมรายงานแสดงวันลงเวลา
This commit is contained in:
parent
34da86653f
commit
47c1f7dac0
2 changed files with 49 additions and 12 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
using System.Data.Common;
|
||||||
|
using System.Globalization;
|
||||||
using System.IO.Pipelines;
|
using System.IO.Pipelines;
|
||||||
using BMA.EHR.Application.Repositories;
|
using BMA.EHR.Application.Repositories;
|
||||||
using BMA.EHR.Application.Repositories.Commands;
|
using BMA.EHR.Application.Repositories.Commands;
|
||||||
|
|
@ -27,6 +29,8 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
public class LeaveReportController : BaseController
|
public class LeaveReportController : BaseController
|
||||||
{
|
{
|
||||||
#region " Fields "
|
#region " Fields "
|
||||||
|
|
||||||
|
private static CultureInfo _culture = new CultureInfo("th-TH");
|
||||||
private readonly LeaveRequestRepository _leaveRequestRepository;
|
private readonly LeaveRequestRepository _leaveRequestRepository;
|
||||||
private readonly UserProfileRepository _userProfileRepository;
|
private readonly UserProfileRepository _userProfileRepository;
|
||||||
private readonly CommandRepository _commandRepository;
|
private readonly CommandRepository _commandRepository;
|
||||||
|
|
@ -1178,11 +1182,15 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
{
|
{
|
||||||
if (timeStamps == null)
|
if (timeStamps == null)
|
||||||
{
|
{
|
||||||
|
if (dd <= DateTime.Now.Date)
|
||||||
remarkStr = "ขาดราชการ";
|
remarkStr = "ขาดราชการ";
|
||||||
|
else remarkStr = "";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// check status ของการลงเวลา
|
// check status ของการลงเวลา
|
||||||
|
if (timeStamps.CheckOut != null)
|
||||||
|
{
|
||||||
if (timeStamps.CheckOutStatus == "ABSENT")
|
if (timeStamps.CheckOutStatus == "ABSENT")
|
||||||
remarkStr = "ขาดราชการ";
|
remarkStr = "ขาดราชการ";
|
||||||
else if (timeStamps.CheckInStatus == "ABSENT")
|
else if (timeStamps.CheckInStatus == "ABSENT")
|
||||||
|
|
@ -1195,6 +1203,20 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
else
|
else
|
||||||
remarkStr = "";
|
remarkStr = "";
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (timeStamps.CheckInStatus == "ABSENT")
|
||||||
|
remarkStr = "ขาดราชการ";
|
||||||
|
else if (timeStamps.CheckInStatus == "LATE")
|
||||||
|
{
|
||||||
|
remarkStr = "สาย";
|
||||||
|
lateTotal += 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
remarkStr = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var emp = new
|
var emp = new
|
||||||
|
|
@ -1214,8 +1236,8 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
//remark = timeStamps == null ? "ขาดราชการ" : "",
|
//remark = timeStamps == null ? "ขาดราชการ" : "",
|
||||||
remark = remarkStr,
|
remark = remarkStr,
|
||||||
|
|
||||||
checkInDate = timeStamps == null ? "" : timeStamps.CheckIn.Date.ToThaiFullDate2().ToThaiNumber(),
|
checkInDate = timeStamps == null ? dd.Date.ToThaiFullDate2().ToThaiNumber() : timeStamps.CheckIn.Date.ToThaiFullDate2().ToThaiNumber(),
|
||||||
checkedOutDate = timeStamps == null ? "" :
|
checkedOutDate = timeStamps == null ? dd.Date.ToThaiFullDate2().ToThaiNumber() :
|
||||||
timeStamps.CheckOut != null ?
|
timeStamps.CheckOut != null ?
|
||||||
timeStamps.CheckOut.Value.ToThaiFullDate2().ToThaiNumber() :
|
timeStamps.CheckOut.Value.ToThaiFullDate2().ToThaiNumber() :
|
||||||
"",
|
"",
|
||||||
|
|
@ -1255,9 +1277,23 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var dateStamp = "";
|
||||||
|
switch (req.Type.ToUpper())
|
||||||
|
{
|
||||||
|
case "MONTH":
|
||||||
|
{
|
||||||
|
var dd = req.StartDate.Date;
|
||||||
|
dateStamp = $"เดือน {dd.ToString("MMMM", _culture.DateTimeFormat)} พ.ศ. {dd.Year.ToThaiYear()}".ToThaiNumber();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
dateStamp = req.StartDate.Date.ToThaiFullDate().ToThaiNumber();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
var item = new
|
var item = new
|
||||||
{
|
{
|
||||||
DateTimeStamp = date.Date.ToThaiFullDate(),
|
DateTimeStamp = dateStamp,
|
||||||
officerTotal = profile.Count,
|
officerTotal = profile.Count,
|
||||||
workTotal = (count - 1),
|
workTotal = (count - 1),
|
||||||
restTotal = restTotal,
|
restTotal = restTotal,
|
||||||
|
|
|
||||||
|
|
@ -6,5 +6,6 @@ namespace BMA.EHR.Leave.Service.DTOs.Reports
|
||||||
|
|
||||||
public DateTime EndDate { get; set; } = DateTime.MinValue;
|
public DateTime EndDate { get; set; } = DateTime.MinValue;
|
||||||
|
|
||||||
|
public string Type { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue