RollCall first upload - task and ticket changes - client changes

This commit is contained in:
SamSys
2024-09-08 21:51:54 +03:30
parent 8d9cf99e5f
commit 9077346afc
49 changed files with 3552 additions and 752 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -54,30 +55,6 @@ public class RollCallApplication : IRollCallApplication
{
return _rollCallRepository.GetByEmployeeIdAndWorkshopId(employeeId, workshopId);
}
public EmployeeRollCallsByMonthViewModel GetEmployeeRollCallsHistory(long employeeId, long workshopId, string startDateTime, string endDateTime, string exactDateTime,
string dateIndex)
{
DateTime? startDateTimeGr = null;
DateTime? endDateTimeGr = null;
if (!string.IsNullOrWhiteSpace(startDateTime) && !string.IsNullOrWhiteSpace(endDateTime))
{
startDateTimeGr = startDateTime.ToGeorgianDateTime();
endDateTimeGr = endDateTime.ToGeorgianDateTime();
}
DateTime? exactDateTimeGr =
!string.IsNullOrWhiteSpace(exactDateTime) ? exactDateTime.ToGeorgianDateTime() : null;
DateTime? index;
try
{
index = DateTime.Parse(dateIndex);
}
catch
{
index = null;
}
return _rollCallRepository.GetEmployeeRollCallsHistory(employeeId, workshopId, startDateTimeGr, endDateTimeGr, exactDateTimeGr, index);
}
@@ -91,43 +68,70 @@ public class RollCallApplication : IRollCallApplication
return _rollCallRepository.Search(searchModel);
}
public List<RollCallViewModel> GetCurrentDay(RollCallSearchModel searchModel)
{
return _rollCallRepository.GetCurrentDay(searchModel);
}
public List<RollCallViewModel> GetHistoryCase(RollCallSearchModel searchModel)
{
return _rollCallRepository.GetCurrentDay(searchModel);
}
public RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel)
{
return _rollCallRepository.GetWorkshopRollCallHistory(searchModel);
}
public CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId)
{
return _rollCallRepository.GetWorkshopCurrentDayRollCalls(workshopId);
}
#region Pooya
public RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel)
{
return _rollCallRepository.GetWorkshopRollCallHistory(searchModel);
}
public CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId)
{
return _rollCallRepository.GetWorkshopCurrentDayRollCalls(workshopId);
}
public List<CheckoutDailyRollCallViewModel> GetActiveEmployeeRollCallsForDuration(long employeeId, long workshopId, string startDate,
string endDate)
{
if (!string.IsNullOrWhiteSpace(startDate) || !string.IsNullOrWhiteSpace(endDate))
return new();
string endDate)
{
if (!string.IsNullOrWhiteSpace(startDate) || !string.IsNullOrWhiteSpace(endDate))
return new();
var startDateGr = startDate.ToGeorgianDateTime();
var endDateGr = endDate.ToGeorgianDateTime();
var startDateGr = startDate.ToGeorgianDateTime();
var endDateGr = endDate.ToGeorgianDateTime();
if (startDateGr >= endDateGr)
return new();
if (startDateGr >= endDateGr)
return new();
//if (!_rollCallEmployeeRepository.Exists(x => x.EmployeeId == employeeId &&
// x.WorkshopId == workshopId && x.IsActiveString == "true"))
// return new();
return _rollCallRepository.GetEmployeeRollCallsForMonth(employeeId, workshopId, startDateGr, endDateGr);
}
//if (!_rollCallEmployeeRepository.Exists(x => x.EmployeeId == employeeId &&
// x.WorkshopId == workshopId && x.IsActiveString == "true"))
// return new();
return _rollCallRepository.GetEmployeeRollCallsForMonth(employeeId, workshopId, startDateGr, endDateGr);
}
public EmployeeRollCallsByMonthViewModel GetEmployeeRollCallsHistory(long employeeId, long workshopId, string startDateTime, string endDateTime, string exactDateTime,
string dateIndex)
{
DateTime? startDateTimeGr = null;
DateTime? endDateTimeGr = null;
if (!string.IsNullOrWhiteSpace(startDateTime) && !string.IsNullOrWhiteSpace(endDateTime))
{
startDateTimeGr = startDateTime.ToGeorgianDateTime();
endDateTimeGr = endDateTime.ToGeorgianDateTime();
if (endDateTimeGr <= startDateTimeGr)
{
return new();
}
}
DateTime? exactDateTimeGr =
!string.IsNullOrWhiteSpace(exactDateTime) ? exactDateTime.ToGeorgianDateTime() : null;
DateTime? index = null;
if (!string.IsNullOrWhiteSpace(dateIndex))
{
index = dateIndex.ToGeorgianDateTime();
index = (index.Value.Date >= DateTime.Now) || (index.Value == new DateTime(3000, 12, 20, new PersianCalendar())) ? null : index;
}
return _rollCallRepository.GetEmployeeRollCallsHistory(employeeId, workshopId, startDateTimeGr, endDateTimeGr, exactDateTimeGr, index);
}
#endregion
public long Flag(long employeeId, long workshopId)
{
return _rollCallRepository.Flag(employeeId, workshopId);