ADD and EDIT RollCall - EmployeeUploadPicture Bug Fixed - RollCallHistory Fast Searching
@@ -30,4 +30,25 @@ public class OperationResult
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class OperationResult<T>
|
||||
{
|
||||
public T Data { get; set; }
|
||||
public bool IsSuccedded { get; set; }
|
||||
public string Message { get; set; }
|
||||
|
||||
public OperationResult<T> Succcedded(T data, string message = "عملیات با موفقیت انجام شد")
|
||||
{
|
||||
IsSuccedded = true;
|
||||
Message = message;
|
||||
Data = data;
|
||||
return this;
|
||||
}
|
||||
public OperationResult<T> Failed(string message)
|
||||
{
|
||||
IsSuccedded = false;
|
||||
Message = message;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,14 @@ public interface ILeaveRepository : IRepository<long, Leave>
|
||||
EditLeave GetDetails(long id);
|
||||
List<LeaveViewModel> search(LeaveSearchModel searchModel);
|
||||
OperationResult RemoveLeave(long id);
|
||||
|
||||
#region Pooya
|
||||
/// <summary>
|
||||
/// چک می کند که آیا پرسنل مرخصی روزانه استحقاقی دارد یا خیر
|
||||
/// </summary>
|
||||
bool HasLeave(long employeeId, long workshopId, DateTime date);
|
||||
#endregion
|
||||
|
||||
bool CheckContractExist(DateTime myDate,long employeeId, long workshopId);
|
||||
|
||||
LeavErrorViewModel CheckErrors(DateTime startLeav, DateTime endLeav, long employeeId, long workshopId);
|
||||
|
||||
@@ -13,13 +13,27 @@ namespace Company.Domain.RollCallAgg
|
||||
{
|
||||
EditRollCall GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId);
|
||||
EditRollCall GetById(long id);
|
||||
RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel);
|
||||
|
||||
List<RollCallViewModel> Search(RollCallSearchModel searchModel);
|
||||
|
||||
|
||||
|
||||
|
||||
#region Pooya
|
||||
void RemoveEmployeeRollCallsInDate(long workshopId, long employeeId, DateTime date);
|
||||
RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel);
|
||||
CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId);
|
||||
List<CheckoutDailyRollCallViewModel> GetEmployeeRollCallsForMonth(long employeeId, long workshopId, DateTime startDate, DateTime endDate);
|
||||
|
||||
EmployeeRollCallsByMonthViewModel GetEmployeeRollCallsHistory(long employeeId, long workshopId,
|
||||
DateTime? startDateTime, DateTime? endDateTime, DateTime? exactDateTime, DateTime? monthIndex);
|
||||
long Flag(long employeeId, long workshopId);
|
||||
DateTime? startDateTime, DateTime? endDateTime, DateTime? exactDateTime, DateTime? monthIndex);
|
||||
|
||||
void AddRange(List<RollCall> rollCalls);
|
||||
|
||||
|
||||
List<RollCallViewModel> GetWorkshopEmployeeRollCallsForDate(long workshopId, long employeeId, DateTime date);
|
||||
#endregion
|
||||
long Flag(long employeeId, long workshopId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -15,12 +15,20 @@ public interface IRollCallEmployeeRepository : IRepository<long, RollCallEmploye
|
||||
int activedPerson(long workshopId);
|
||||
|
||||
#region Pooya
|
||||
|
||||
List<RollCallEmployeeViewModel> GetRollCallEmployeesByWorkshopId(long workshopId);
|
||||
List<RollCallEmployeeViewModel> GetByEmployeeIdWithStatuses(long employeeId);
|
||||
bool HasEmployees(long workshopId);
|
||||
|
||||
List<RollCallEmployeeViewModel> GetActivePersonnelByWorkshopId(long workshopId);
|
||||
List<RollCallEmployeeViewModel> GetEmployeeRollCalls(long workshopId);
|
||||
|
||||
List<RollCallEmployeeViewModel> GetPersonnelRollCallListAll(long workshopId);
|
||||
#endregion
|
||||
|
||||
#region Farokhi&Mahan
|
||||
|
||||
bool HasEmployees(long workshopId);
|
||||
(int activeEmployees, int deActiveEmployees) GetActiveAndDeActiveRollCallEmployees(long workshopId);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.RollCallEmployee;
|
||||
using CompanyManagment.App.Contracts.RollCallEmployeeStatus;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Company.Domain.RollCallEmployeeStatusAgg
|
||||
@@ -8,6 +9,18 @@ namespace Company.Domain.RollCallEmployeeStatusAgg
|
||||
public interface IRollCallEmployeeStatusRepository : IRepository<long, RollCallEmployeeStatus>
|
||||
{
|
||||
List<RollCallEmployeeStatusViewModel> GetAll();
|
||||
void AdjustRollCallStatusEndDates(List<AdjustRollCallEmployeesWithEmployeeLeftWork> command);
|
||||
}
|
||||
/// <summary>
|
||||
/// تغییر بازه فعالیت هنگام ترک کار پرسنل
|
||||
/// </summary>
|
||||
///
|
||||
/// <returns></returns>
|
||||
void AdjustRollCallStatusEndDates(List<AdjustRollCallEmployeesWithEmployeeLeftWork> command);
|
||||
/// <summary>
|
||||
/// دریافت وضعیت حضور غیاب پرسنل در تاریخ مشخص
|
||||
/// </summary>
|
||||
/// <param name="rollCallEmployeeId"></param>
|
||||
/// <param name="date"></param>
|
||||
/// <returns></returns>
|
||||
RollCallEmployeeStatus GetByRollCallEmployeeIdAndDate(long rollCallEmployeeId, DateTime date);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,4 +26,5 @@ public interface ILeaveApplication
|
||||
|
||||
#endregion
|
||||
bool CheckIfValidToEdit(long id);
|
||||
OperationResult<bool> HasLeave(long workshopId, long employeeId, string dateFa);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.RollCall
|
||||
{
|
||||
public class CreateOrEditEmployeeRollCall
|
||||
{
|
||||
public long EmployeeId { get; set; }
|
||||
public long WorkshopId { get; set; }
|
||||
public string DateFa { get; set; }
|
||||
public List<EmployeeRollCallRecord> RollCallRecords { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.RollCall
|
||||
{
|
||||
public class EmployeeRollCallRecord
|
||||
{
|
||||
public long RollCallId { get; set; }
|
||||
public DateTime Date { get; set; }
|
||||
public string StartTime { get; set; }
|
||||
public string EndTime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.RollCall
|
||||
{
|
||||
public class EmployeeRollCallsViewModel
|
||||
{
|
||||
public long EmployeeId { get; set; }
|
||||
public string EmployeeFullName { get; set; }
|
||||
public string DateFa { get; set; }
|
||||
public List<RollCallViewModel> RollCalls { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -13,16 +13,59 @@ namespace CompanyManagment.App.Contracts.RollCall
|
||||
OperationResult Edit(long id);
|
||||
|
||||
EditRollCall GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId);
|
||||
List<CheckoutDailyRollCallViewModel> GetActiveEmployeeRollCallsForDuration(long employeeId, long workshopId,
|
||||
string startDate, string endDate);
|
||||
EmployeeRollCallsByMonthViewModel GetEmployeeRollCallsHistory(long employeeId, long workshopId,
|
||||
string startDateTime, string endDateTime, string exactDateTime, string dateIndex);
|
||||
|
||||
|
||||
|
||||
EditRollCall GetById(long id);
|
||||
List<RollCallViewModel> Search(RollCallSearchModel searchModel);
|
||||
|
||||
CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId);
|
||||
RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel);
|
||||
|
||||
|
||||
long Flag(long employeeId, long workshopId);
|
||||
|
||||
#region Pooya
|
||||
|
||||
OperationResult RemoveEmployeeRollCallsInDate(long workshopId, long employeeId, string dateFa);
|
||||
/// <summary>
|
||||
/// برای صدور فیش حقوقی
|
||||
/// </summary>
|
||||
List<CheckoutDailyRollCallViewModel> GetActiveEmployeeRollCallsForDuration(long employeeId, long workshopId,
|
||||
string startDate, string endDate);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// برای دریافت سوابق حضور غیاب پرسنل انتخاب شده بر اساس ماه
|
||||
/// </summary>
|
||||
/// <param name="employeeId">پرسنل مورد نظر</param>
|
||||
/// <param name="workshopId">کارگاه مورد نظر</param>
|
||||
/// <param name="startDateTime">شروع بازه جستجو، می تواند خالی باشد</param>
|
||||
/// <param name="endDateTime">پایان بازه جستجو، می تواند خالی باشد</param>
|
||||
/// <param name="exactDateTime">جستجو بر اساس مقطع زمانی، میتواند خالی باشد</param>
|
||||
/// <param name="dateIndex">با اسکرول کاربر این مقدار افزایش پیدا می کند</param>
|
||||
EmployeeRollCallsByMonthViewModel GetEmployeeRollCallsHistory(long employeeId, long workshopId,
|
||||
string startDateTime, string endDateTime, string exactDateTime, string dateIndex);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// گزارش آنلاین حضور غیاب
|
||||
/// </summary>
|
||||
CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId);
|
||||
|
||||
/// <summary>
|
||||
/// گزارش آفلاین حضور غیاب کارگاه
|
||||
/// </summary>
|
||||
RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست حضور غیاب کارمند در تاریخ مشخص
|
||||
/// </summary>
|
||||
List<RollCallViewModel> GetWorkshopEmployeeRollCallsForDate(long workshopId, long employeeId, string date);
|
||||
|
||||
/// <summary>
|
||||
/// اضافه کردن یا ویرایش دستی حضور غیاب
|
||||
/// </summary>
|
||||
OperationResult ManualEdit(CreateOrEditEmployeeRollCall command);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,4 +30,6 @@ public class RollCallViewModel
|
||||
public bool HasLeave { get; set; }
|
||||
public string DayOfWeekFa { get; set; }
|
||||
public bool IsHoliday { get; set; }
|
||||
public string EndTimeString { get; set; }
|
||||
public string StartTimeString { get; set; }
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using _0_Framework.Application;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.RollCallEmployee;
|
||||
|
||||
@@ -8,7 +9,7 @@ public interface IRollCallEmployeeApplication
|
||||
OperationResult Create(CreateRollCallEmployee command);
|
||||
OperationResult Active(long id);
|
||||
OperationResult DeActive(long id);
|
||||
OperationResult UploadedImage(long Employeeid,long WorkshopId);
|
||||
OperationResult UploadedImage(long Employeeid, long WorkshopId);
|
||||
List<RollCallEmployeeViewModel> GetByWorkshopId(long workshopId);
|
||||
EditRollCallEmployee GetDetails(long id);
|
||||
RollCallEmployeeViewModel GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId);
|
||||
@@ -16,12 +17,25 @@ public interface IRollCallEmployeeApplication
|
||||
List<RollCallEmployeeViewModel> GetActivePersonnelByWorkshopId(long workshopId);
|
||||
bool IsEmployeeRollCallActive(long employeeId, long workshopId);
|
||||
int activedPerson(long workshopId);
|
||||
|
||||
#region pooya
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست پرسنل کارگاه برای حضور غیاب دستی
|
||||
/// </summary>
|
||||
List<RollCallEmployeeViewModel> GetRollCallEmployeesByWorkshopId(long workshopId);
|
||||
|
||||
List<RollCallEmployeeViewModel> GetEmployeeRollCalls(long workshopId);
|
||||
|
||||
List<RollCallEmployeeViewModel> GetPersonnelRollCallListAll(long workshopId);
|
||||
//List<RollCallEmployeeViewModel> GetPersonnelRollCallListAll(long workshopId);
|
||||
|
||||
|
||||
OperationResult ChangeEmployeeRollCallName(long rollCallEmployeeId, string fName, string lName);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Farpkhi&Mahan
|
||||
(int activeEmployees, int deActiveEmployees) GetActiveAndDeActiveRollCallEmployees(long workshopId);
|
||||
bool HasEmployees(long workshopId);
|
||||
#endregion
|
||||
}
|
||||
@@ -544,9 +544,9 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
switch (item.EmployeeId)
|
||||
{
|
||||
|
||||
case 3812://ثابت
|
||||
countWorkingDays = 15;
|
||||
break;
|
||||
//case 3812://ثابت- کسری حاجی پور
|
||||
// countWorkingDays = 15;
|
||||
// break;
|
||||
case 40463://ثابت
|
||||
countWorkingDays = 10;
|
||||
break;
|
||||
@@ -1488,9 +1488,9 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
switch (item.EmployeeId)
|
||||
{
|
||||
|
||||
case 3812://ثابت
|
||||
countWorkingDays = 15;
|
||||
break;
|
||||
//case 3812://ثابت
|
||||
// countWorkingDays = 15;
|
||||
// break;
|
||||
case 40463://ثابت
|
||||
countWorkingDays = 10;
|
||||
break;
|
||||
@@ -1622,8 +1622,6 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
//farokhiChanges
|
||||
public (double basic, int totalYear) BasicYear(long employeeId, long worshopId, DateTime startDate)
|
||||
|
||||
@@ -326,6 +326,16 @@ public class LeaveApplication : ILeaveApplication
|
||||
return _leaveRepository.CheckIfValidToEdit(id);
|
||||
}
|
||||
|
||||
public OperationResult<bool> HasLeave(long workshopId, long employeeId, string dateFa)
|
||||
{
|
||||
OperationResult<bool> op = new();
|
||||
DateTime date = dateFa.ToGeorgianDateTime();
|
||||
if (date == Tools.GetUndefinedDateTime())
|
||||
return op.Failed("تاریخ وارد شده صحیح نمی باشد");
|
||||
var result = _leaveRepository.HasLeave(employeeId, workshopId, date);
|
||||
return op.Succcedded(result);
|
||||
}
|
||||
|
||||
public LeavePrintViewModel PrintOne(long id)
|
||||
{
|
||||
return _leaveRepository.PrintOne(id);
|
||||
|
||||
@@ -5,6 +5,8 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
using Company.Domain.LeaveAgg;
|
||||
using Company.Domain.RollCallAgg;
|
||||
using Company.Domain.RollCallEmployeeAgg;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
@@ -17,11 +19,16 @@ public class RollCallApplication : IRollCallApplication
|
||||
private readonly IRollCallRepository _rollCallRepository;
|
||||
private readonly IEmployeeApplication _employeeApplication;
|
||||
private readonly IRollCallEmployeeRepository _rollCallEmployeeRepository;
|
||||
public RollCallApplication(IRollCallRepository rollCallRepository, IEmployeeApplication employeeApplication, IRollCallEmployeeRepository rollCallEmployeeRepository)
|
||||
private readonly IEmployeeRepository _employeeRepository;
|
||||
private readonly ILeaveRepository _leaveRepository;
|
||||
|
||||
public RollCallApplication(IRollCallRepository rollCallRepository, IEmployeeApplication employeeApplication, IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, ILeaveRepository leaveRepository)
|
||||
{
|
||||
_rollCallRepository = rollCallRepository;
|
||||
_employeeApplication = employeeApplication;
|
||||
_rollCallEmployeeRepository = rollCallEmployeeRepository;
|
||||
_employeeRepository = employeeRepository;
|
||||
_leaveRepository = leaveRepository;
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateRollCall command)
|
||||
@@ -69,70 +76,210 @@ public class RollCallApplication : IRollCallApplication
|
||||
}
|
||||
|
||||
|
||||
#region Pooya
|
||||
public OperationResult RemoveEmployeeRollCallsInDate(long workshopId, long employeeId, string dateFa)
|
||||
{
|
||||
OperationResult op = new();
|
||||
var date = dateFa.ToGeorgianDateTime();
|
||||
if (date == Tools.GetUndefinedDateTime())
|
||||
return op.Failed("خطای سیستمی");
|
||||
_rollCallRepository.RemoveEmployeeRollCallsInDate(workshopId, employeeId, date);
|
||||
_rollCallRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
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();
|
||||
|
||||
var startDateGr = startDate.ToGeorgianDateTime();
|
||||
var endDateGr = endDate.ToGeorgianDateTime();
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
#region Pooya
|
||||
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();
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
var startDateGr = startDate.ToGeorgianDateTime();
|
||||
var endDateGr = endDate.ToGeorgianDateTime();
|
||||
|
||||
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);
|
||||
}
|
||||
DateTime? exactDateTimeGr =
|
||||
!string.IsNullOrWhiteSpace(exactDateTime) ? exactDateTime.ToGeorgianDateTime() : null;
|
||||
|
||||
|
||||
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? 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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
DateTime? exactDateTimeGr =
|
||||
!string.IsNullOrWhiteSpace(exactDateTime) ? exactDateTime.ToGeorgianDateTime() : null;
|
||||
return _rollCallRepository.GetEmployeeRollCallsHistory(employeeId, workshopId, startDateTimeGr, endDateTimeGr, exactDateTimeGr, index);
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
/// <summary>
|
||||
/// افزودن حضور غیاب به صورت دستی. اگر آیدی رکورد صفر باشد رکورد جدید، در غیر این صورت ویرایش می کند
|
||||
/// </summary>
|
||||
public OperationResult ManualEdit(CreateOrEditEmployeeRollCall command)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
|
||||
}
|
||||
|
||||
return _rollCallRepository.GetEmployeeRollCallsHistory(employeeId, workshopId, startDateTimeGr, endDateTimeGr, exactDateTimeGr, index);
|
||||
}
|
||||
#endregion
|
||||
public long Flag(long employeeId, long workshopId)
|
||||
DateTime date = command.DateFa.ToGeorgianDateTime();
|
||||
if (date == Tools.GetUndefinedDateTime())
|
||||
return operation.Failed("فرمت تاریخ وارد شده صحیح نمی باشد");
|
||||
|
||||
if (date >= DateTime.Now.Date)
|
||||
{
|
||||
return operation.Failed("امکان اضافه کردن حضور غیاب برای روز جاری و روز های آینده وجود ندارد");
|
||||
}
|
||||
|
||||
if (command.WorkshopId < 1)
|
||||
{
|
||||
return operation.Failed("خطای سیستمی");
|
||||
}
|
||||
|
||||
if (command.RollCallRecords == null || command.RollCallRecords.Count == 0)
|
||||
return operation.Failed("خطای سیستمی");
|
||||
|
||||
if (_leaveRepository.HasLeave(command.EmployeeId, command.WorkshopId, date))
|
||||
return operation.Failed("در روز مرخصی کارمند نمی توانید حضور غیاب ثبت کنید");
|
||||
|
||||
var employeeStatuses = _rollCallEmployeeRepository.GetByEmployeeIdWithStatuses(command.EmployeeId)
|
||||
.FirstOrDefault(x => x.WorkshopId == command.WorkshopId)?.Statuses;
|
||||
|
||||
var employeeRollCalls = _rollCallRepository.GetWorkshopEmployeeRollCallsForDate(command.WorkshopId, command.EmployeeId, date);
|
||||
|
||||
if (employeeRollCalls.Any(x => x.EndDate == null))
|
||||
return operation.Failed("به دلیل عدم ثبت خروج پرسنل در این تاریخ، شما قادر به افزودن رکورد جدید نمی باشید");
|
||||
|
||||
if (command.RollCallRecords.Any(x => string.IsNullOrWhiteSpace(x.StartTime) || string.IsNullOrWhiteSpace(x.EndTime)))
|
||||
return operation.Failed("ساعات شروع و پایان نمیتوانند خالی باشد");
|
||||
|
||||
#region RollCallTimes validation and parse to DateTime
|
||||
|
||||
List<(TimeOnly start, TimeOnly end, long rollCallId)> preprocessedRollCalls = new();
|
||||
try
|
||||
{
|
||||
preprocessedRollCalls = command.RollCallRecords.Select(x =>
|
||||
{
|
||||
|
||||
if (!TimeOnly.TryParseExact(x.StartTime, "HH:mm", out TimeOnly start))
|
||||
throw new Exception();
|
||||
if (!TimeOnly.TryParseExact(x.EndTime, "HH:mm", out TimeOnly end))
|
||||
throw new Exception();
|
||||
return (start, end, x.RollCallId);
|
||||
|
||||
}).ToList();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
return operation.Failed("فرمت ساعات ورودی نادرست می باشد");
|
||||
}
|
||||
|
||||
DateTime day = command.DateFa.ToGeorgianDateTime();
|
||||
if (day == Tools.GetUndefinedDateTime())
|
||||
return operation.Failed("خطای سیستمی");
|
||||
DateTime previousEnd = new DateTime();
|
||||
preprocessedRollCalls = preprocessedRollCalls.OrderBy(x => x.start).ToList();
|
||||
List<(DateTime Start, DateTime End, long RollCallId)> result = new();
|
||||
|
||||
|
||||
foreach (var item in preprocessedRollCalls)
|
||||
{
|
||||
(DateTime Start, DateTime End, long RollCallId) rollCallWithDateTime =
|
||||
new()
|
||||
{
|
||||
Start = new DateTime(DateOnly.FromDateTime(day), item.start),
|
||||
End = new DateTime(DateOnly.FromDateTime(day), item.end),
|
||||
RollCallId = item.rollCallId
|
||||
|
||||
};
|
||||
|
||||
if (previousEnd != new DateTime())
|
||||
{
|
||||
if (rollCallWithDateTime.Start < previousEnd)
|
||||
{
|
||||
rollCallWithDateTime.Start = rollCallWithDateTime.Start.AddDays(1);
|
||||
}
|
||||
}
|
||||
while (rollCallWithDateTime.Start >= rollCallWithDateTime.End)
|
||||
{
|
||||
rollCallWithDateTime.End = rollCallWithDateTime.End.AddDays(1);
|
||||
}
|
||||
result.Add(rollCallWithDateTime);
|
||||
previousEnd = rollCallWithDateTime.End;
|
||||
}
|
||||
var firstShiftStart = result.OrderBy(x => x.Start).FirstOrDefault().Start;
|
||||
var lastShiftEnd = result.OrderByDescending(x => x.Start).FirstOrDefault().End;
|
||||
var lastShiftStart = result.OrderByDescending(x => x.Start).FirstOrDefault().Start;
|
||||
|
||||
if (firstShiftStart.AddDays(1) < lastShiftEnd)
|
||||
return operation.Failed("بازه زمانی وارد شده نا معتبر است");
|
||||
if (result.Sum(x => (x.End - x.Start).TotalHours) > 24)
|
||||
{
|
||||
return operation.Failed("بازه زمانی نمیتواند بیشتر از 24 ساعت باشد");
|
||||
}
|
||||
if (firstShiftStart.Date != lastShiftStart.Date)
|
||||
return operation.Failed("شروع رکورد حضور غیاب نمی تواند در روز های بعد از تاریخ تعیین شده باشد");
|
||||
|
||||
#endregion
|
||||
|
||||
if (result == null || !result.All(x => employeeStatuses.Any(y => x.Start >= y.StartDateGr || x.End <= y.EndDateGr)))
|
||||
return operation.Failed("کارمند در بازه وارد شده غیر فعال است");
|
||||
|
||||
|
||||
var name = _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(command.EmployeeId, command.WorkshopId).EmployeeFullName;
|
||||
var rollCallsAsEntityModels = result.Select(x => new RollCall(command.WorkshopId, command.EmployeeId, name, x.Start, x.End,
|
||||
Convert.ToInt32(x.Start.ToFarsi().Substring(0, 4)), Convert.ToInt32(x.Start.ToFarsi().Substring(5, 2)))).ToList();
|
||||
_rollCallRepository.RemoveEmployeeRollCallsInDate(command.WorkshopId, command.EmployeeId, date);
|
||||
|
||||
|
||||
_rollCallRepository.AddRange(rollCallsAsEntityModels);
|
||||
_rollCallRepository.SaveChanges();
|
||||
return operation.Succcedded();
|
||||
}
|
||||
public List<RollCallViewModel> GetWorkshopEmployeeRollCallsForDate(long workshopId, long employeeId, string dateFa)
|
||||
{
|
||||
DateTime date = Tools.ToGeorgianDateTime(dateFa);
|
||||
if (date == Tools.GetUndefinedDateTime())
|
||||
return new();
|
||||
return _rollCallRepository.GetWorkshopEmployeeRollCallsForDate(workshopId, employeeId, date);
|
||||
}
|
||||
#endregion
|
||||
public long Flag(long employeeId, long workshopId)
|
||||
{
|
||||
return _rollCallRepository.Flag(employeeId, workshopId);
|
||||
}
|
||||
|
||||
@@ -5,8 +5,10 @@ using Company.Domain.RollCallEmployeeAgg;
|
||||
using Company.Domain.RollCallEmployeeStatusAgg;
|
||||
using CompanyManagment.App.Contracts.RollCallEmployee;
|
||||
using CompanyManagment.App.Contracts.RollCallEmployeeStatus;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
|
||||
|
||||
@@ -19,14 +21,15 @@ public class RollCallEmployeeApplication : IRollCallEmployeeApplication
|
||||
private readonly IEmployeeRepository _employeeRepository;
|
||||
private readonly ILeftWorkRepository _leftWorkRepository;
|
||||
private readonly IRollCallEmployeeStatusRepository _rollCallEmployeeStatusRepository;
|
||||
|
||||
public RollCallEmployeeApplication(IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, ILeftWorkRepository leftWorkRepository, IRollCallEmployeeStatusRepository rollCallEmployeeStatusRepository)
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
public RollCallEmployeeApplication(IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, ILeftWorkRepository leftWorkRepository, IRollCallEmployeeStatusRepository rollCallEmployeeStatusRepository, IWebHostEnvironment webHostEnvironment)
|
||||
{
|
||||
_rollCallEmployeeRepository = rollCallEmployeeRepository;
|
||||
_employeeRepository = employeeRepository;
|
||||
_rollCallEmployeeStatusApplication = rollCallEmployeeStatusApplication;
|
||||
_leftWorkRepository = leftWorkRepository;
|
||||
_rollCallEmployeeStatusRepository = rollCallEmployeeStatusRepository;
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateRollCallEmployee command)
|
||||
@@ -89,16 +92,28 @@ public class RollCallEmployeeApplication : IRollCallEmployeeApplication
|
||||
|
||||
public OperationResult UploadedImage(long Employeeid, long WorkshopId)
|
||||
{
|
||||
var opreation = new OperationResult();
|
||||
var emp = _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(Employeeid, WorkshopId);
|
||||
if (emp == null)
|
||||
return opreation.Failed("پرسنل یافت نشد");
|
||||
var opreation = new OperationResult();
|
||||
var emp = _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(Employeeid, WorkshopId);
|
||||
if (emp == null)
|
||||
return opreation.Failed("پرسنل یافت نشد");
|
||||
|
||||
var rollCall = _rollCallEmployeeRepository.Get(emp.Id);
|
||||
rollCall.HasImage();
|
||||
_rollCallEmployeeRepository.SaveChanges();
|
||||
return opreation.Succcedded();
|
||||
}
|
||||
var rollCall = _rollCallEmployeeRepository.Get(emp.Id);
|
||||
rollCall.HasImage();
|
||||
_rollCallEmployeeRepository.SaveChanges();
|
||||
var path = Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", WorkshopId.ToString(), Employeeid.ToString());
|
||||
var thumbnailPath = Path.Combine(path, "Thumbnail.jpg");
|
||||
try
|
||||
{
|
||||
var thumbnail = Tools.ResizeImage(Path.Combine(path, "1.jpg"), 150, 150);
|
||||
System.IO.File.WriteAllBytes(thumbnailPath, Convert.FromBase64String(thumbnail));
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
return opreation.Succcedded();
|
||||
}
|
||||
|
||||
|
||||
public List<RollCallEmployeeViewModel> GetByWorkshopId(long workshopId)
|
||||
@@ -127,7 +142,10 @@ public class RollCallEmployeeApplication : IRollCallEmployeeApplication
|
||||
}
|
||||
|
||||
#region Pooya
|
||||
|
||||
public List<RollCallEmployeeViewModel> GetRollCallEmployeesByWorkshopId(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetRollCallEmployeesByWorkshopId(workshopId);
|
||||
}
|
||||
public List<RollCallEmployeeViewModel> GetActivePersonnelByWorkshopId(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetActivePersonnelByWorkshopId(workshopId);
|
||||
@@ -151,6 +169,11 @@ public class RollCallEmployeeApplication : IRollCallEmployeeApplication
|
||||
return _rollCallEmployeeRepository.GetEmployeeRollCalls(workshopId);
|
||||
}
|
||||
|
||||
public (int activeEmployees, int deActiveEmployees) GetActiveAndDeActiveRollCallEmployees(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetActiveAndDeActiveRollCallEmployees(workshopId);
|
||||
}
|
||||
|
||||
public List<RollCallEmployeeViewModel> GetPersonnelRollCallListAll(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetPersonnelRollCallListAll(workshopId);
|
||||
@@ -163,14 +186,28 @@ public class RollCallEmployeeApplication : IRollCallEmployeeApplication
|
||||
|
||||
public OperationResult ChangeEmployeeRollCallName(long rollCallEmployeeId, string fName, string lName)
|
||||
{
|
||||
OperationResult result = new();
|
||||
if (string.IsNullOrWhiteSpace(lName))
|
||||
return result.Failed("نام خاوادگی نمی تواند خالی باشد");
|
||||
fName = fName ?? "";
|
||||
var entity = _rollCallEmployeeRepository.Get(rollCallEmployeeId);
|
||||
entity.ChangeName(fName, lName);
|
||||
_rollCallEmployeeRepository.SaveChanges();
|
||||
return result.Succcedded();
|
||||
OperationResult result = new();
|
||||
if (string.IsNullOrWhiteSpace(lName) || string.IsNullOrWhiteSpace(fName))
|
||||
return result.Failed("نام و نام خانوادگی نمی توانند خالی باشند");
|
||||
fName = fName.Trim();
|
||||
lName = lName.Trim();
|
||||
var fullName = $"{fName} {lName}";
|
||||
var entity = _rollCallEmployeeRepository.Get(rollCallEmployeeId);
|
||||
|
||||
|
||||
if (entity == null)
|
||||
return result.Failed(ApplicationMessages.RecordNotFound);
|
||||
|
||||
if (_rollCallEmployeeRepository.Exists(x => x.WorkshopId == entity.WorkshopId && x.EmployeeFullName == fullName && x.id != rollCallEmployeeId))
|
||||
return result.Failed("نام و نام خانوادگی کارمند نمی تواند با نام و نام خانوادگی کارمند دیگری در آن کارگاه یکسان باشد");
|
||||
|
||||
if (entity.IsActiveString != "true")
|
||||
return result.Failed("امکان تغییر نام برای کارمند غیر فعال وجود ندارد");
|
||||
|
||||
|
||||
entity.ChangeName(fName, lName);
|
||||
_rollCallEmployeeRepository.SaveChanges();
|
||||
return result.Succcedded();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
@@ -24,20 +24,33 @@ namespace CompanyManagment.Application
|
||||
_leftWorkRepository = leftWorkRepository;
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateRollCallEmployeeStatus cmd)
|
||||
{
|
||||
public OperationResult Create(CreateRollCallEmployeeStatus cmd)
|
||||
{
|
||||
OperationResult op = new();
|
||||
RollCallEmployee employee = _rollCallEmployeeRepository.Get(cmd.RollCallEmployeeId);
|
||||
if (employee == null)
|
||||
RollCallEmployee rollCallEmployee = _rollCallEmployeeRepository.Get(cmd.RollCallEmployeeId);
|
||||
if (rollCallEmployee == null)
|
||||
return op.Failed("کارمند مجاز نیست");
|
||||
|
||||
if (!_leftWorkRepository.Exists(x => x.EmployeeId == employee.EmployeeId && x.WorkshopId == employee.WorkshopId &&
|
||||
x.LeftWorkDate.Date > DateTime.Now.Date && x.StartWorkDate.Date <= DateTime.Now.Date))
|
||||
if (!_leftWorkRepository.Exists(x => x.EmployeeId == rollCallEmployee.EmployeeId && x.WorkshopId == rollCallEmployee.WorkshopId &&
|
||||
x.LeftWorkDate.Date > DateTime.Now.Date && x.StartWorkDate.Date < DateTime.Now.Date))
|
||||
return op.Failed("کارمند در کارگاه شروع به کار نکرده است");
|
||||
if (_employeeRollCallStatusRepository.Exists(x => x.EndDate >= DateTime.Now && employee.id == x.RollCallEmployeeId))
|
||||
return op.Failed("تکراری است");
|
||||
RollCallEmployeeStatus newRecord = new(employee.id, DateTime.Now);
|
||||
_employeeRollCallStatusRepository.Create(newRecord);
|
||||
|
||||
if (_employeeRollCallStatusRepository.Exists(y =>
|
||||
rollCallEmployee.id == y.RollCallEmployeeId && y.EndDate.Date > DateTime.Now.Date))
|
||||
return op.Failed("کارمند فعال می باشد");
|
||||
|
||||
if (_employeeRollCallStatusRepository.Exists(y =>
|
||||
rollCallEmployee.id == y.RollCallEmployeeId && y.EndDate.Date == DateTime.Now.Date))
|
||||
{
|
||||
RollCallEmployeeStatus previousStatusInDate = _employeeRollCallStatusRepository.GetByRollCallEmployeeIdAndDate(cmd.RollCallEmployeeId, DateTime.Now.Date);
|
||||
previousStatusInDate.Edit(previousStatusInDate.StartDate, Tools.GetUndefinedDateTime());
|
||||
}
|
||||
else
|
||||
{
|
||||
RollCallEmployeeStatus newRecord = new(rollCallEmployee.id, DateTime.Now.Date);
|
||||
_employeeRollCallStatusRepository.Create(newRecord);
|
||||
}
|
||||
|
||||
_employeeRollCallStatusRepository.SaveChanges();
|
||||
|
||||
return op.Succcedded();
|
||||
|
||||
@@ -363,6 +363,13 @@ public class LeaveRepository : RepositoryBase<long, Leave>, ILeaveRepository
|
||||
return op.Failed("موردی یافت نشد");
|
||||
}
|
||||
|
||||
public bool HasLeave(long employeeId, long workshopId, DateTime date)
|
||||
{
|
||||
return _context.LeaveList.Where(x => (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه") ||
|
||||
x.LeaveType == "استعلاجی")
|
||||
.FirstOrDefault(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartLeave.Date <= date.Date && x.EndLeave.Date >= date.Date) != null;
|
||||
}
|
||||
|
||||
public bool CheckContractExist(DateTime myDate, long employeeId, long workshopId)
|
||||
{
|
||||
var result = _context.Contracts.Any(x => x.ContarctStart <= myDate
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using _0_Framework.Application;
|
||||
@@ -15,93 +16,126 @@ namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class RollCallEmployeeRepository : RepositoryBase<long, RollCallEmployee>, IRollCallEmployeeRepository
|
||||
{
|
||||
private readonly CompanyContext _context;
|
||||
private readonly IPasswordHasher _passwordHasher;
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
private IRollCallEmployeeRepository _rollCallEmployeeRepositoryImplementation;
|
||||
private readonly CompanyContext _context;
|
||||
private readonly IPasswordHasher _passwordHasher;
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
// private IRollCallEmployeeRepository _rollCallEmployeeRepositoryImplementation;
|
||||
|
||||
public RollCallEmployeeRepository(CompanyContext context, IPasswordHasher passwordHasher, IWebHostEnvironment webHostEnvironment) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
_passwordHasher = passwordHasher;
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
}
|
||||
public RollCallEmployeeRepository(CompanyContext context, IPasswordHasher passwordHasher,
|
||||
IWebHostEnvironment webHostEnvironment) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
_passwordHasher = passwordHasher;
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
}
|
||||
|
||||
public List<RollCallEmployeeViewModel> GetByWorkshopId(long workshopId)
|
||||
{
|
||||
var query = _context.RollCallEmployees.Select(x => new RollCallEmployeeViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
EmployeeId = x.EmployeeId,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
IsActiveString = x.IsActiveString,
|
||||
HasUploadedImage = x.HasUploadedImage
|
||||
}).Where(x => x.WorkshopId == workshopId);
|
||||
public List<RollCallEmployeeViewModel> GetByWorkshopId(long workshopId)
|
||||
{
|
||||
var query = _context.RollCallEmployees.Select(x => new RollCallEmployeeViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
EmployeeId = x.EmployeeId,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
IsActiveString = x.IsActiveString,
|
||||
HasUploadedImage = x.HasUploadedImage
|
||||
}).Where(x => x.WorkshopId == workshopId);
|
||||
|
||||
return query.ToList();
|
||||
}
|
||||
return query.ToList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public EditRollCallEmployee GetDetails(long id)
|
||||
{
|
||||
return _context.RollCallEmployees.Select(x => new RollCallEmployeeViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
IsActiveString = x.IsActiveString,
|
||||
HasUploadedImage = x.HasUploadedImage
|
||||
}).FirstOrDefault(x => x.Id == id);
|
||||
}
|
||||
public EditRollCallEmployee GetDetails(long id)
|
||||
{
|
||||
return _context.RollCallEmployees.Select(x => new RollCallEmployeeViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeFName = x.FName,
|
||||
EmployeeLName = x.LName,
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
IsActiveString = x.IsActiveString,
|
||||
HasUploadedImage = x.HasUploadedImage
|
||||
}).FirstOrDefault(x => x.Id == id);
|
||||
}
|
||||
|
||||
public RollCallEmployeeViewModel GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId)
|
||||
{
|
||||
return _context.RollCallEmployees.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId).Select(
|
||||
x => new RollCallEmployeeViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
EmployeeId = x.EmployeeId,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeFName = x.FName,
|
||||
EmployeeLName = x.LName,
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
IsActiveString = x.IsActiveString,
|
||||
HasUploadedImage = x.HasUploadedImage
|
||||
}).FirstOrDefault();
|
||||
}
|
||||
|
||||
public RollCallEmployeeViewModel GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId)
|
||||
{
|
||||
return _context.RollCallEmployees.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId).Select(x => new RollCallEmployeeViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
IsActiveString = x.IsActiveString,
|
||||
HasUploadedImage = x.HasUploadedImage
|
||||
}).FirstOrDefault();
|
||||
}
|
||||
|
||||
public List<RollCallEmployeeViewModel> GetPersonnelRollCallListPaginate(RollCallEmployeeSearchModel command)
|
||||
{
|
||||
var dateNow = DateTime.Now;
|
||||
var rawQuery = _context.Employees.Include(x => x.LeftWorks).Include(x => x.LeftWorkInsurances)
|
||||
var employeeQuery = _context.Employees.AsQueryable();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(command.Name))
|
||||
{
|
||||
var rollCallNames = _context.RollCallEmployees.Where(x => command.WorkshopId == x.WorkshopId &&
|
||||
x.EmployeeFullName.Contains(command.Name)).Select(
|
||||
x => new
|
||||
{
|
||||
x.EmployeeId,
|
||||
x.EmployeeFullName
|
||||
});
|
||||
|
||||
employeeQuery = employeeQuery.Where(x => rollCallNames.Any(y => y.EmployeeId == x.id));
|
||||
}
|
||||
|
||||
var rawQuery = employeeQuery.Include(x => x.LeftWorks).Include(x => x.LeftWorkInsurances)
|
||||
.Where(x => x.LeftWorks.Any(y =>
|
||||
y.WorkshopId == command.WorkshopId && y.StartWorkDate <= dateNow &&
|
||||
y.LeftWorkDate > dateNow) ||
|
||||
x.LeftWorkInsurances.Any(y =>
|
||||
y.WorkshopId == command.WorkshopId && y.StartWorkDate <= dateNow &&
|
||||
(y.LeftWorkDate > dateNow || y.LeftWorkDate == null))).OrderByDescending(x => x.id).AsQueryable().AsSplitQuery();
|
||||
if (!string.IsNullOrWhiteSpace(command.Name))
|
||||
rawQuery = rawQuery.Where(x => (x.FName + " " + x.LName).Contains(command.Name));
|
||||
(y.LeftWorkDate > dateNow || y.LeftWorkDate == null))).OrderByDescending(x => x.id)
|
||||
.Select(x => new
|
||||
{
|
||||
Id = x.id,
|
||||
x.FullName,
|
||||
x.NationalCode,
|
||||
|
||||
}).AsSplitQuery();
|
||||
|
||||
|
||||
|
||||
var rollCallEmployees = _context.RollCallEmployees.Where(x => x.WorkshopId == command.WorkshopId);
|
||||
|
||||
|
||||
var joinedQuery = from employee in rawQuery
|
||||
join rollCallEmployee in rollCallEmployees
|
||||
on employee.id equals rollCallEmployee.EmployeeId into grp
|
||||
from joinedRollCall in grp.DefaultIfEmpty()
|
||||
select new RollCallEmployeeViewModel()
|
||||
{
|
||||
WorkshopId = command.WorkshopId,
|
||||
EmployeeId = employee.id,
|
||||
Id = joinedRollCall == null ? 0 : joinedRollCall.id,
|
||||
EmployeeFullName = employee.FullName,
|
||||
NationalCode = employee.NationalCode,
|
||||
IsActiveString = joinedRollCall == null ? "false" : joinedRollCall.IsActiveString,
|
||||
HasUploadedImage = joinedRollCall == null ? "false" : joinedRollCall.HasUploadedImage
|
||||
};
|
||||
join rollCallEmployee in rollCallEmployees
|
||||
on employee.Id equals rollCallEmployee.EmployeeId into grp
|
||||
from joinedRollCall in grp.DefaultIfEmpty()
|
||||
select new RollCallEmployeeViewModel()
|
||||
{
|
||||
WorkshopId = command.WorkshopId,
|
||||
EmployeeId = employee.Id,
|
||||
Id = joinedRollCall == null ? 0 : joinedRollCall.id,
|
||||
EmployeeFullName = joinedRollCall == null ? employee.FullName : joinedRollCall.EmployeeFullName,
|
||||
NationalCode = employee.NationalCode,
|
||||
IsActiveString = joinedRollCall == null ? "false" : joinedRollCall.IsActiveString,
|
||||
HasUploadedImage = joinedRollCall == null ? "false" : joinedRollCall.HasUploadedImage
|
||||
};
|
||||
|
||||
|
||||
var firstlist = joinedQuery.AsSplitQuery();
|
||||
var list = firstlist.OrderByDescending(x => x.IsActiveString == "true" ? 1 : 0)
|
||||
.ThenByDescending(x => x.HasUploadedImage == "true" ? 1 : 0)
|
||||
.Skip(command.PageIndex).Take(30).ToList();
|
||||
var watch = new Stopwatch();
|
||||
watch.Start();
|
||||
list.ForEach(x =>
|
||||
{
|
||||
|
||||
@@ -110,17 +144,19 @@ public class RollCallEmployeeRepository : RepositoryBase<long, RollCallEmployee>
|
||||
{
|
||||
try
|
||||
{
|
||||
var path = Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", command.WorkshopId.ToString(), x.EmployeeId.ToString());
|
||||
var path = Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", command.WorkshopId.ToString(),
|
||||
x.EmployeeId.ToString());
|
||||
var thumbnailPath = Path.Combine(path, "Thumbnail.jpg");
|
||||
if (System.IO.File.Exists(path))
|
||||
if (System.IO.File.Exists(thumbnailPath))
|
||||
{
|
||||
var bytes = System.IO.File.ReadAllBytes(thumbnailPath);
|
||||
var image = Convert.ToBase64String(bytes);
|
||||
x.ImagePath = image;
|
||||
|
||||
}
|
||||
else
|
||||
else if (System.IO.File.Exists(Path.Combine(path, "1.jpg")))
|
||||
{
|
||||
|
||||
var thumbnail = Tools.ResizeImage(Path.Combine(path, "1.jpg"), 150, 150);
|
||||
System.IO.File.WriteAllBytes(thumbnailPath, Convert.FromBase64String(thumbnail));
|
||||
x.ImagePath = thumbnail;
|
||||
@@ -128,150 +164,229 @@ public class RollCallEmployeeRepository : RepositoryBase<long, RollCallEmployee>
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
// ignored
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
//list = list.Select(x => new RollCallEmployeeViewModel()
|
||||
//{
|
||||
// WorkshopId = x.WorkshopId,
|
||||
// EmployeeId = x.EmployeeId,
|
||||
// Id = x.Id,
|
||||
// EmployeeFullName = x.EmployeeFullName,
|
||||
// NationalCode = x.NationalCode,
|
||||
// IsActiveString = x.IsActiveString,
|
||||
// HasUploadedImage = x.HasUploadedImage,
|
||||
// EmployeeSlug = _passwordHasher.SlugHasher(x.EmployeeId),
|
||||
// ImagePath = (System.IO.File.Exists(Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", command.WorkshopId.ToString(), x.EmployeeId.ToString(), "1.jpg")))
|
||||
// ? Tools.ResizeImage(Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", command.WorkshopId.ToString(), x.EmployeeId.ToString(), "1.jpg"), 150, 150) : ""
|
||||
//}).ToList();
|
||||
|
||||
|
||||
|
||||
Console.WriteLine(watch.Elapsed);
|
||||
return list;
|
||||
}
|
||||
|
||||
public RollCallEmployee GetWithRollCallStatus(long id)
|
||||
{
|
||||
return _context.RollCallEmployees.Include(x => x.EmployeesStatus)
|
||||
.FirstOrDefault(x => x.id == id);
|
||||
}
|
||||
{
|
||||
return _context.RollCallEmployees.Include(x => x.EmployeesStatus)
|
||||
.FirstOrDefault(x => x.id == id);
|
||||
}
|
||||
|
||||
public int activedPerson(long workshopId)
|
||||
{
|
||||
return _context.RollCallEmployees.Count(x => x.WorkshopId == workshopId && x.IsActiveString == "true" && x.HasUploadedImage == "true");
|
||||
}
|
||||
public int activedPerson(long workshopId)
|
||||
{
|
||||
return _context.RollCallEmployees.Count(x =>
|
||||
x.WorkshopId == workshopId && x.IsActiveString == "true" && x.HasUploadedImage == "true");
|
||||
}
|
||||
|
||||
#region Pooya
|
||||
public List<RollCallEmployeeViewModel> GetByEmployeeIdWithStatuses(long employeeId)
|
||||
{
|
||||
return _context.RollCallEmployees.Include(x => x.EmployeesStatus)
|
||||
.Where(x => x.EmployeeId == employeeId).Select(x =>
|
||||
new RollCallEmployeeViewModel()
|
||||
{
|
||||
EmployeeId = x.EmployeeId,
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
Id = x.id,
|
||||
WorkshopId = x.WorkshopId,
|
||||
IsActiveString = x.IsActiveString,
|
||||
HasUploadedImage = x.HasUploadedImage,
|
||||
Statuses = x.EmployeesStatus.Select(y => new RollCallEmployeeStatusViewModel()
|
||||
{
|
||||
StartDateGr = y.StartDate,
|
||||
EndDateGr = y.EndDate,
|
||||
Id = y.id
|
||||
})
|
||||
#region Pooya
|
||||
|
||||
}).ToList(); ;
|
||||
}
|
||||
public List<RollCallEmployeeViewModel> GetRollCallEmployeesByWorkshopId(long workshopId)
|
||||
{
|
||||
return _context.RollCallEmployees.Where(x => x.WorkshopId == workshopId)
|
||||
.Select(x =>
|
||||
new RollCallEmployeeViewModel()
|
||||
{
|
||||
EmployeeId = x.EmployeeId,
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
Id = x.id,
|
||||
WorkshopId = x.WorkshopId,
|
||||
IsActiveString = x.IsActiveString,
|
||||
HasUploadedImage = x.HasUploadedImage,
|
||||
Statuses = x.EmployeesStatus.Select(y => new RollCallEmployeeStatusViewModel()
|
||||
{
|
||||
StartDateGr = y.StartDate,
|
||||
EndDateGr = y.EndDate,
|
||||
Id = y.id
|
||||
})
|
||||
|
||||
}).ToList();
|
||||
|
||||
}
|
||||
|
||||
public List<RollCallEmployeeViewModel> GetByEmployeeIdWithStatuses(long employeeId)
|
||||
{
|
||||
return _context.RollCallEmployees.Include(x => x.EmployeesStatus)
|
||||
.Where(x => x.EmployeeId == employeeId).Select(x =>
|
||||
new RollCallEmployeeViewModel()
|
||||
{
|
||||
EmployeeId = x.EmployeeId,
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
Id = x.id,
|
||||
WorkshopId = x.WorkshopId,
|
||||
IsActiveString = x.IsActiveString,
|
||||
HasUploadedImage = x.HasUploadedImage,
|
||||
Statuses = x.EmployeesStatus.Select(y => new RollCallEmployeeStatusViewModel()
|
||||
{
|
||||
StartDateGr = y.StartDate,
|
||||
EndDateGr = y.EndDate,
|
||||
Id = y.id
|
||||
})
|
||||
|
||||
}).ToList();
|
||||
;
|
||||
}
|
||||
|
||||
public bool HasEmployees(long workshopId)
|
||||
{
|
||||
var dateNow = DateTime.Now;
|
||||
return _context.Employees.Include(x => x.LeftWorks).Include(x => x.LeftWorkInsurances)
|
||||
.Any(x => x.LeftWorks.Any(y =>
|
||||
y.WorkshopId == workshopId && y.StartWorkDate <= dateNow &&
|
||||
y.LeftWorkDate > dateNow) ||
|
||||
x.LeftWorkInsurances.Any(y =>
|
||||
y.WorkshopId == workshopId && y.StartWorkDate <= dateNow &&
|
||||
(y.LeftWorkDate > dateNow || y.LeftWorkDate == null)));
|
||||
|
||||
return _context.Employees.Include(x => x.LeftWorks).Include(x => x.LeftWorkInsurances)
|
||||
.Any(x => x.LeftWorks.Any(y =>
|
||||
y.WorkshopId == workshopId && y.StartWorkDate <= dateNow &&
|
||||
y.LeftWorkDate > dateNow) ||
|
||||
x.LeftWorkInsurances.Any(y =>
|
||||
y.WorkshopId == workshopId && y.StartWorkDate <= dateNow &&
|
||||
(y.LeftWorkDate > dateNow || y.LeftWorkDate == null)));
|
||||
|
||||
}
|
||||
|
||||
public List<RollCallEmployeeViewModel> GetActivePersonnelByWorkshopId(long workshopId)
|
||||
{
|
||||
var rollCallEmployees = _context.RollCallEmployees.Where(x => x.WorkshopId == workshopId
|
||||
&& x.IsActiveString == "true" && x.HasUploadedImage == "true");
|
||||
{
|
||||
var rollCallEmployees = _context.RollCallEmployees.Where(x => x.WorkshopId == workshopId
|
||||
&& x.IsActiveString == "true" &&
|
||||
x.HasUploadedImage == "true");
|
||||
|
||||
var personnel =
|
||||
_context.PersonnelCodeSet.Where(x => rollCallEmployees.Any(y => y.EmployeeId == x.EmployeeId && y.WorkshopId == x.WorkshopId))
|
||||
.Select(x => new { x.EmployeeId, x.PersonnelCode }).ToList();
|
||||
var rollCallEmployeesList = rollCallEmployees.ToList();
|
||||
return personnel.Select(x =>
|
||||
{
|
||||
var name = rollCallEmployeesList.FirstOrDefault(y => x.EmployeeId == y.EmployeeId);
|
||||
return new RollCallEmployeeViewModel()
|
||||
{
|
||||
PersonelCode = x.PersonnelCode,
|
||||
EmployeeFName = name.FName,
|
||||
EmployeeLName = name.LName,
|
||||
EmployeeId = x.EmployeeId,
|
||||
EmployeeFullName = name.EmployeeFullName
|
||||
};
|
||||
}).OrderBy(x => x.EmployeeLName).ToList();
|
||||
var personnel =
|
||||
_context.PersonnelCodeSet.Where(x =>
|
||||
rollCallEmployees.Any(y => y.EmployeeId == x.EmployeeId && y.WorkshopId == x.WorkshopId))
|
||||
.Select(x => new { x.EmployeeId, x.PersonnelCode }).ToList();
|
||||
var rollCallEmployeesList = rollCallEmployees.ToList();
|
||||
return personnel.Select(x =>
|
||||
{
|
||||
var name = rollCallEmployeesList.FirstOrDefault(y => x.EmployeeId == y.EmployeeId);
|
||||
return new RollCallEmployeeViewModel()
|
||||
{
|
||||
PersonelCode = x.PersonnelCode,
|
||||
EmployeeFName = name.FName,
|
||||
EmployeeLName = name.LName,
|
||||
EmployeeId = x.EmployeeId,
|
||||
EmployeeFullName = name.EmployeeFullName
|
||||
};
|
||||
}).OrderBy(x => x.EmployeeLName).ToList();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public List<RollCallEmployeeViewModel> GetEmployeeRollCalls(long workshopId)
|
||||
{
|
||||
var dateNow = DateTime.Now;
|
||||
var f = _context.RollCallEmployees.Where(x => x.WorkshopId == workshopId);
|
||||
public List<RollCallEmployeeViewModel> GetEmployeeRollCalls(long workshopId)
|
||||
{
|
||||
var dateNow = DateTime.Now;
|
||||
var f = _context.RollCallEmployees.Where(x => x.WorkshopId == workshopId);
|
||||
|
||||
var res = f.Select(x => new RollCallEmployeeViewModel
|
||||
{
|
||||
RollCallEmployeeId = x.id,
|
||||
EmployeeId = x.EmployeeId,
|
||||
EmployeeFullName = x.EmployeeFullName
|
||||
})
|
||||
.ToList();
|
||||
var res = f.Select(x => new RollCallEmployeeViewModel
|
||||
{
|
||||
RollCallEmployeeId = x.id,
|
||||
EmployeeId = x.EmployeeId,
|
||||
EmployeeFullName = x.EmployeeFullName
|
||||
})
|
||||
.ToList();
|
||||
|
||||
return res;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public List<RollCallEmployeeViewModel> GetPersonnelRollCallListAll(long workshopId)
|
||||
{
|
||||
var dateNow = DateTime.Now;
|
||||
var f = _context.Employees.Include(x => x.LeftWorks).Include(x => x.LeftWorkInsurances)
|
||||
.Where(x => x.LeftWorks.Any(y => y.WorkshopId == workshopId && y.StartWorkDate <= dateNow && y.LeftWorkDate > dateNow) ||
|
||||
x.LeftWorkInsurances.Any(y => y.WorkshopId == workshopId && y.StartWorkDate <= dateNow &&
|
||||
(y.LeftWorkDate > dateNow || y.LeftWorkDate == null))).ToList();
|
||||
public List<RollCallEmployeeViewModel> GetPersonnelRollCallListAll(long workshopId)
|
||||
{
|
||||
//var dateNow = DateTime.Now;
|
||||
//var f = _context.Employees.Include(x => x.LeftWorks).Include(x => x.LeftWorkInsurances)
|
||||
// .Where(x => x.LeftWorks.Any(y => y.WorkshopId == workshopId && y.StartWorkDate <= dateNow && y.LeftWorkDate > dateNow) ||
|
||||
// x.LeftWorkInsurances.Any(y => y.WorkshopId == workshopId && y.StartWorkDate <= dateNow &&
|
||||
// (y.LeftWorkDate > dateNow || y.LeftWorkDate == null))).ToList();
|
||||
|
||||
|
||||
var res = f.Select(x => new RollCallEmployeeViewModel
|
||||
{
|
||||
WorkshopId = workshopId,
|
||||
EmployeeId = x.id,
|
||||
Id = _context.RollCallEmployees.Any(r => r.EmployeeId == x.id && r.WorkshopId == workshopId) ?
|
||||
_context.RollCallEmployees.FirstOrDefault(r => r.EmployeeId == x.id && r.WorkshopId == workshopId)!.id : 0,
|
||||
EmployeeFullName = $"{x.FName} {x.LName}",
|
||||
EmployeeSlug = _passwordHasher.SlugHasher(x.id),
|
||||
NationalCode = _context.Employees.FirstOrDefault(e => e.id == x.id).NationalCode,
|
||||
IsActiveString = _context.RollCallEmployees.Any(r => r.EmployeeId == x.id && r.WorkshopId == workshopId && r.IsActiveString == "true") ? "true" : "false",
|
||||
HasUploadedImage = _context.RollCallEmployees.Any(r => r.EmployeeId == x.id && r.WorkshopId == workshopId && r.HasUploadedImage == "true") ? "true" : "false",
|
||||
ImagePath = (System.IO.File.Exists(Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", workshopId.ToString(), x.id.ToString(), "1.jpg")))
|
||||
? Tools.ResizeImage(Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", workshopId.ToString(), x.id.ToString(), "1.jpg"), 150, 150)
|
||||
: "",
|
||||
}).OrderBy(x => x.PersonelCode)
|
||||
.ToList();
|
||||
//var res = f.Select(x => new RollCallEmployeeViewModel
|
||||
//{
|
||||
// WorkshopId = workshopId,
|
||||
// EmployeeId = x.id,
|
||||
// Id = _context.RollCallEmployees.Any(r => r.EmployeeId == x.id && r.WorkshopId == workshopId) ?
|
||||
// _context.RollCallEmployees.FirstOrDefault(r => r.EmployeeId == x.id && r.WorkshopId == workshopId)!.id : 0,
|
||||
// EmployeeFullName = $"{x.FName} {x.LName}",
|
||||
// EmployeeSlug = _passwordHasher.SlugHasher(x.id),
|
||||
// NationalCode = _context.Employees.FirstOrDefault(e => e.id == x.id).NationalCode,
|
||||
// IsActiveString = _context.RollCallEmployees.Any(r => r.EmployeeId == x.id && r.WorkshopId == workshopId && r.IsActiveString == "true") ? "true" : "false",
|
||||
// HasUploadedImage = _context.RollCallEmployees.Any(r => r.EmployeeId == x.id && r.WorkshopId == workshopId && r.HasUploadedImage == "true") ? "true" : "false",
|
||||
// ImagePath = (System.IO.File.Exists(Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", workshopId.ToString(), x.id.ToString(), "1.jpg")))
|
||||
// ? Tools.ResizeImage(Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", workshopId.ToString(), x.id.ToString(), "1.jpg"), 150, 150)
|
||||
// : "",
|
||||
//}).OrderBy(x => x.PersonelCode)
|
||||
// .ToList();
|
||||
|
||||
return res;
|
||||
}
|
||||
//return res;
|
||||
|
||||
#endregion
|
||||
return new();
|
||||
}
|
||||
|
||||
public (int activeEmployees, int deActiveEmployees) GetActiveAndDeActiveRollCallEmployees(long workshopId)
|
||||
{
|
||||
var dateNow = DateTime.Now;
|
||||
//var employeeQuery = _context.Employees.AsQueryable();
|
||||
|
||||
|
||||
//var rawQuery = employeeQuery.Include(x => x.LeftWorks).Include(x => x.LeftWorkInsurances)
|
||||
// .Where(x => x.LeftWorks.Any(y =>
|
||||
// y.WorkshopId == command.WorkshopId && y.StartWorkDate <= dateNow &&
|
||||
// y.LeftWorkDate > dateNow) ||
|
||||
// x.LeftWorkInsurances.Any(y =>
|
||||
// y.WorkshopId == command.WorkshopId && y.StartWorkDate <= dateNow &&
|
||||
// (y.LeftWorkDate > dateNow || y.LeftWorkDate == null))).OrderByDescending(x => x.id)
|
||||
// .Select(x => new
|
||||
// {
|
||||
// Id = x.id,
|
||||
// x.FullName,
|
||||
// x.NationalCode,
|
||||
|
||||
// }).AsSplitQuery();
|
||||
|
||||
|
||||
|
||||
//var rollCallEmployees = _context.RollCallEmployees.Where(x => x.WorkshopId == command.WorkshopId);
|
||||
|
||||
|
||||
//var joinedQuery = from employee in rawQuery
|
||||
// join rollCallEmployee in rollCallEmployees
|
||||
// on employee.Id equals rollCallEmployee.EmployeeId into grp
|
||||
// from joinedRollCall in grp.DefaultIfEmpty()
|
||||
// select new RollCallEmployeeViewModel()
|
||||
// {
|
||||
// WorkshopId = command.WorkshopId,
|
||||
// EmployeeId = employee.Id,
|
||||
// Id = joinedRollCall == null ? 0 : joinedRollCall.id,
|
||||
// EmployeeFullName = joinedRollCall == null ? employee.FullName : joinedRollCall.EmployeeFullName,
|
||||
// NationalCode = employee.NationalCode,
|
||||
// IsActiveString = joinedRollCall == null ? "false" : joinedRollCall.IsActiveString,
|
||||
// HasUploadedImage = joinedRollCall == null ? "false" : joinedRollCall.HasUploadedImage
|
||||
// };
|
||||
var rawQuery = _context.Employees.Include(x => x.LeftWorks).Include(x => x.LeftWorkInsurances)
|
||||
.Where(x => x.LeftWorks.Any(y =>
|
||||
y.WorkshopId == workshopId && y.StartWorkDate <= dateNow &&
|
||||
y.LeftWorkDate > dateNow) ||
|
||||
x.LeftWorkInsurances.Any(y =>
|
||||
y.WorkshopId == workshopId && y.StartWorkDate <= dateNow &&
|
||||
(y.LeftWorkDate > dateNow || y.LeftWorkDate == null))).OrderByDescending(x => x.id)
|
||||
.Select(x => new
|
||||
{
|
||||
Id = x.id,
|
||||
}).Distinct();
|
||||
|
||||
var rollCallEmployees = _context.RollCallEmployees.Where(x => x.WorkshopId == workshopId);
|
||||
|
||||
var joinedQuery = from employee in rawQuery
|
||||
join rollCallEmployee in rollCallEmployees
|
||||
on employee.Id equals rollCallEmployee.EmployeeId into grp
|
||||
from joinedRollCall in grp.DefaultIfEmpty()
|
||||
select new RollCallEmployeeViewModel()
|
||||
{
|
||||
IsActiveString = joinedRollCall == null ? "false" : joinedRollCall.IsActiveString,
|
||||
};
|
||||
var deActiveCount = joinedQuery.Count(x => x.IsActiveString == "false");
|
||||
var ActiveCount = joinedQuery.Count(x => x.IsActiveString == "true");
|
||||
return (ActiveCount, deActiveCount);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -47,6 +47,13 @@ namespace CompanyManagment.EFCore.Repository
|
||||
|
||||
_context.SaveChanges();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
public RollCallEmployeeStatus GetByRollCallEmployeeIdAndDate(long rollCallEmployeeId, DateTime date)
|
||||
{
|
||||
return _context.RollCallEmployeesStatus.FirstOrDefault(x => x.RollCallEmployeeId == rollCallEmployeeId && x.StartDate.Date <= date.Date && x.EndDate.Date >= date.Date);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,9 +36,14 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#region Pooya
|
||||
//حضور غیاب فیش حقوقی
|
||||
public List<CheckoutDailyRollCallViewModel> GetEmployeeRollCallsForMonth(long employeeId, long workshopId, DateTime startMonthDay, DateTime endMonthDay)
|
||||
|
||||
|
||||
|
||||
#region Pooya
|
||||
|
||||
|
||||
//حضور غیاب فیش حقوقی
|
||||
public List<CheckoutDailyRollCallViewModel> GetEmployeeRollCallsForMonth(long employeeId, long workshopId, DateTime startMonthDay, DateTime endMonthDay)
|
||||
{
|
||||
|
||||
|
||||
@@ -107,375 +112,428 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
|
||||
}
|
||||
|
||||
//جستجوی سوابق حضور غیاب بر اساس کارمند
|
||||
public EmployeeRollCallsByMonthViewModel GetEmployeeRollCallsHistory(long employeeId, long workshopId,
|
||||
DateTime? startDateTime, DateTime? endDateTime, DateTime? exactDateTime, DateTime? dateIndex)
|
||||
{
|
||||
|
||||
//get RollCallEmployee and RollCallEmployeeStatus for that employee in that workshop
|
||||
var employeeRollCallStatuses = _context.RollCallEmployees.Include(x => x.EmployeesStatus)
|
||||
.FirstOrDefault(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId);
|
||||
|
||||
//if none was found return empty
|
||||
if (employeeRollCallStatuses == null)
|
||||
return new();
|
||||
|
||||
//this list will have all the months which employee was active in
|
||||
var activeMonths = new List<PersianDateTime>();
|
||||
|
||||
//filling the list
|
||||
foreach (var status in employeeRollCallStatuses.EmployeesStatus)
|
||||
{
|
||||
var persianEndDate = new PersianDateTime(status.EndDate.Date);
|
||||
var persianStartDate = new PersianDateTime(status.StartDate.Date);
|
||||
|
||||
var persianStartFirstDayOfMonth = new PersianDateTime(persianStartDate.Year, persianStartDate.Month, 1);
|
||||
|
||||
for (PersianDateTime start = persianStartFirstDayOfMonth; start <= persianEndDate && start < PersianDateTime.Today.Date; start = start.AddMonths(1))
|
||||
{
|
||||
activeMonths.Add(start);
|
||||
}
|
||||
}
|
||||
//might have duplicated records, this is the reason for distinct
|
||||
var activeMonthsList = activeMonths.OrderByDescending(x => x.Date).Distinct().ToList();
|
||||
|
||||
PersianDateTime startSearch = new();
|
||||
PersianDateTime endSearch = new();
|
||||
|
||||
//if search has these parameters below
|
||||
if (startDateTime.HasValue && endDateTime.HasValue)
|
||||
{
|
||||
//change them to persian date time and save them
|
||||
startSearch = new PersianDateTime(startDateTime.Value);
|
||||
endSearch = new PersianDateTime(endDateTime.Value);
|
||||
|
||||
//get the months that include these dates
|
||||
activeMonthsList = activeMonthsList.Where(x => x.Year >= startSearch.Year && x.Month >= startSearch.Month && x.Year <= endSearch.Year && x.Month <= endSearch.Month).ToList();
|
||||
}
|
||||
//if exact datetime is given
|
||||
if (exactDateTime.HasValue)
|
||||
{
|
||||
//start and end will be the same date
|
||||
startSearch = new PersianDateTime(exactDateTime.Value);
|
||||
endSearch = startSearch;
|
||||
//get the
|
||||
activeMonthsList = activeMonthsList.Where(x => x.Year >= startSearch.Year && x.Month >= startSearch.Month && x.Year <= endSearch.Year && x.Month <= endSearch.Month).ToList();
|
||||
}
|
||||
|
||||
if (dateIndex != null)
|
||||
{
|
||||
var persianDateIndex = new PersianDateTime(dateIndex.Value);
|
||||
var dateIndexFirstOfMonth = persianDateIndex.AddDays(-(persianDateIndex.Day - 1));
|
||||
activeMonthsList = activeMonthsList.Where(x => dateIndexFirstOfMonth >= x).ToList();
|
||||
}
|
||||
|
||||
if (!activeMonthsList.Any()) return new();
|
||||
|
||||
//get the last month which user was active in
|
||||
PersianDateTime selectedMonthPersian = activeMonthsList.First();
|
||||
|
||||
DateTime selectedMonthFirstDay = selectedMonthPersian;
|
||||
DateTime nextMonthFirstDay = selectedMonthPersian.AddMonths(1);
|
||||
|
||||
var statusesOfMonth = employeeRollCallStatuses.EmployeesStatus.Where(x => x.EndDate >= selectedMonthFirstDay &&
|
||||
x.StartDate < nextMonthFirstDay);
|
||||
|
||||
|
||||
|
||||
var leavesQuery =
|
||||
_context.LeaveList.Where(x => (x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")) &&
|
||||
x.IsAccepted &&
|
||||
x.EndLeave >= selectedMonthFirstDay && x.StartLeave < nextMonthFirstDay && x.WorkshopId == workshopId);
|
||||
|
||||
var rollCalls = _context.RollCalls.Where(x =>
|
||||
!leavesQuery.Any(y =>
|
||||
y.StartLeave.Date <= x.StartDate.Value.Date && y.EndLeave.Date >= x.StartDate.Value.Date) &&
|
||||
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate != null && x.EndDate != null &&
|
||||
x.StartDate >= selectedMonthFirstDay && x.StartDate < nextMonthFirstDay);
|
||||
|
||||
var personnelCode =
|
||||
_context.PersonnelCodeSet.FirstOrDefault(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId)?.PersonnelCode;
|
||||
|
||||
var employeeName = _context.RollCallEmployees.Where(x => x.WorkshopId == workshopId).Select(x => new { x.EmployeeId, x.EmployeeFullName })
|
||||
.FirstOrDefault(x => x.EmployeeId == employeeId);
|
||||
|
||||
var rollCallsList = rollCalls.ToList();
|
||||
var leavesList = leavesQuery.ToList();
|
||||
|
||||
int dateRange = (int)(nextMonthFirstDay - selectedMonthFirstDay).TotalDays;
|
||||
|
||||
var todayDate = DateTime.Now.Date;
|
||||
//all the dates from start to end, to be compared with present days to get absent dates
|
||||
var completeDaysList = Enumerable.Range(0, dateRange).Select(offset => selectedMonthFirstDay.AddDays(offset).Date).Where(x => x.Date < todayDate);
|
||||
|
||||
//if user search range is within a month for example, we dont want 30/31/29 days for month, we want it to be the size of the search range
|
||||
//user input = 2024/04/15~2024/04/21, output days count is 21-15+1=6 days from 15th to 21st
|
||||
if (exactDateTime.HasValue || (startDateTime.HasValue && endDateTime.HasValue))
|
||||
completeDaysList = completeDaysList.Where(x => x.Date >= startSearch.Date && x.Date <= endSearch.Date);
|
||||
var result = completeDaysList.Where(x => statusesOfMonth.Any(y => x >= y.StartDate.Date && x <= y.EndDate.Date))
|
||||
.Select(x => new RollCallViewModel()
|
||||
{
|
||||
|
||||
DateGr = x.Date.Date,
|
||||
DateFa = x.Date.Date.ToFarsi(),
|
||||
RollCallTimesList = rollCallsList.Where(y => x.Date.Date == y.StartDate!.Value.Date).Select(y =>
|
||||
new RollCallTimeViewModel()
|
||||
{
|
||||
StartDate = y.StartDate.Value.ToString("HH:mm"),
|
||||
EndDate = y.EndDate!.Value.ToString("HH:mm")
|
||||
}),
|
||||
TotalWorkingHoursSpan = new TimeSpan(rollCallsList.Where(y => x.Date.Date == y.StartDate!.Value.Date)
|
||||
.Sum(y => (y.EndDate!.Value - y.StartDate.Value).Ticks)),
|
||||
Reason = leavesList.FirstOrDefault(y => y.EndLeave >= x.Date.Date && y.StartLeave <= x.Date.Date)?.LeaveType ?? ""
|
||||
});
|
||||
result = result.Select(x => new RollCallViewModel()
|
||||
{
|
||||
EmployeeFullName = employeeName.EmployeeFullName,
|
||||
PersonnelCode = personnelCode.ToString(),
|
||||
DateGr = x.DateGr,
|
||||
DateFa = x.DateFa,
|
||||
DayOfWeekFa = x.DateGr.DayOfWeek.DayOfWeeKToPersian(),
|
||||
IsHoliday = _holidayItemApplication.IsHoliday(x.DateGr),
|
||||
IsAbsent = !x.RollCallTimesList.Any(),
|
||||
RollCallTimesList = x.RollCallTimesList,
|
||||
TotalWorkingHours = $"{x.TotalWorkingHoursSpan.TotalHours.ToString("0")}:{x.TotalWorkingHoursSpan.Minutes.ToString("00")}",
|
||||
}).ToList();
|
||||
return new EmployeeRollCallsByMonthViewModel()
|
||||
{
|
||||
PersianMonthName = selectedMonthPersian.ToString("MMMM"),
|
||||
PersianYear = selectedMonthPersian.ToString("yyyy"),
|
||||
DateGr = selectedMonthFirstDay,
|
||||
RollCalls = result,
|
||||
DateIndex = activeMonthsList.Count > 1 ? activeMonthsList.Skip(1).First().ToString("yyyy/MM/dd") : null
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
//سوابق حضور غیاب کارگاه
|
||||
public RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel)
|
||||
{
|
||||
|
||||
//initialize
|
||||
|
||||
DateTime searchDurationEnd = DateTime.Now.AddDays(-1).Date;
|
||||
DateTime searchDurationStart = searchDurationEnd.AddDays(-16);
|
||||
|
||||
|
||||
|
||||
//override if user has entered inputs (dates must be validated in the application layer)
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.StarDateFa) && !string.IsNullOrWhiteSpace(searchModel.StarDateFa))
|
||||
{
|
||||
searchDurationEnd = searchModel.EndDateFa.ToGeorgianDateTime().Date;
|
||||
searchDurationStart = searchModel.StarDateFa.ToGeorgianDateTime().AddDays(-1).Date;
|
||||
}
|
||||
|
||||
|
||||
|
||||
else
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.ExactDateFa))
|
||||
{
|
||||
searchDurationEnd = searchModel.ExactDateFa.ToGeorgianDateTime().Date;
|
||||
searchDurationStart = searchModel.ExactDateFa.ToGeorgianDateTime().AddDays(-1).Date;
|
||||
}
|
||||
|
||||
|
||||
if (searchDurationEnd < searchDurationStart)
|
||||
return new();
|
||||
|
||||
|
||||
|
||||
DateTime dateIndex = searchDurationEnd.AddDays(-1 * (searchModel.DateIndex)).Date;
|
||||
|
||||
if (dateIndex <= searchDurationStart)
|
||||
return new();
|
||||
|
||||
|
||||
//get leaves for workshop that have been activated in dateIndex date
|
||||
var leavesQuery = _context.LeaveList.Where(x => x.WorkshopId == searchModel.WorkshopId &&
|
||||
x.IsAccepted && (x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")) &&
|
||||
x.EndLeave.Date >= dateIndex && x.StartLeave.Date <= dateIndex);
|
||||
|
||||
//roll calls for current workshop where shift start is in dateIndex date (filters today's shifts)
|
||||
var rollCallsQuery = _context.RollCalls
|
||||
.Where(x => x.WorkshopId == searchModel.WorkshopId && x.StartDate.HasValue && x.EndDate.HasValue && x.StartDate < DateTime.Now.Date &&
|
||||
x.StartDate.Value.Date == dateIndex.Date);
|
||||
|
||||
|
||||
//get active employees of workshop in dateIndex date
|
||||
var activeEmployeesQuery =
|
||||
_context.RollCallEmployees.Include(x => x.EmployeesStatus)
|
||||
.Where(x => x.WorkshopId == searchModel.WorkshopId && x.EmployeesStatus.Any(y => y.EndDate.Date >= dateIndex && y.StartDate.Date <= dateIndex));
|
||||
|
||||
//جستجوی سوابق حضور غیاب بر اساس کارمند
|
||||
public EmployeeRollCallsByMonthViewModel GetEmployeeRollCallsHistory(long employeeId, long workshopId,
|
||||
DateTime? startDateTime, DateTime? endDateTime, DateTime? exactDateTime, DateTime? dateIndex)
|
||||
{
|
||||
|
||||
//get RollCallEmployee and RollCallEmployeeStatus for that employee in that workshop
|
||||
var employeeRollCallStatuses = _context.RollCallEmployees.Include(x => x.EmployeesStatus)
|
||||
.FirstOrDefault(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId);
|
||||
|
||||
//if none was found return empty
|
||||
if (employeeRollCallStatuses == null)
|
||||
return new();
|
||||
|
||||
//this list will have all the months which employee was active in
|
||||
var activeMonths = new List<PersianDateTime>();
|
||||
|
||||
//filling the list
|
||||
foreach (var status in employeeRollCallStatuses.EmployeesStatus)
|
||||
{
|
||||
var persianEndDate = new PersianDateTime(status.EndDate.Date);
|
||||
var persianStartDate = new PersianDateTime(status.StartDate.Date);
|
||||
|
||||
var persianStartFirstDayOfMonth = new PersianDateTime(persianStartDate.Year, persianStartDate.Month, 1);
|
||||
|
||||
for (PersianDateTime start = persianStartFirstDayOfMonth; start <= persianEndDate && start < PersianDateTime.Today.Date; start = start.AddMonths(1))
|
||||
{
|
||||
activeMonths.Add(start);
|
||||
}
|
||||
}
|
||||
//might have duplicated records, this is the reason for distinct
|
||||
var activeMonthsList = activeMonths.OrderByDescending(x => x.Date).Distinct().ToList();
|
||||
|
||||
PersianDateTime startSearch = new();
|
||||
PersianDateTime endSearch = new();
|
||||
|
||||
//if search has these parameters below
|
||||
if (startDateTime.HasValue && endDateTime.HasValue)
|
||||
{
|
||||
//change them to persian date time and save them
|
||||
startSearch = new PersianDateTime(startDateTime.Value);
|
||||
endSearch = new PersianDateTime(endDateTime.Value);
|
||||
|
||||
//get the months that include these dates
|
||||
activeMonthsList = activeMonthsList.Where(x => x.Year >= startSearch.Year && x.Month >= startSearch.Month && x.Year <= endSearch.Year && x.Month <= endSearch.Month).ToList();
|
||||
}
|
||||
//if exact datetime is given
|
||||
if (exactDateTime.HasValue)
|
||||
{
|
||||
//start and end will be the same date
|
||||
startSearch = new PersianDateTime(exactDateTime.Value);
|
||||
endSearch = startSearch;
|
||||
//get the
|
||||
activeMonthsList = activeMonthsList.Where(x => x.Year >= startSearch.Year && x.Month >= startSearch.Month && x.Year <= endSearch.Year && x.Month <= endSearch.Month).ToList();
|
||||
}
|
||||
|
||||
if (dateIndex != null)
|
||||
{
|
||||
var persianDateIndex = new PersianDateTime(dateIndex.Value);
|
||||
var dateIndexFirstOfMonth = persianDateIndex.AddDays(-(persianDateIndex.Day - 1));
|
||||
activeMonthsList = activeMonthsList.Where(x => dateIndexFirstOfMonth >= x).ToList();
|
||||
}
|
||||
|
||||
if (!activeMonthsList.Any()) return new();
|
||||
|
||||
//get the last month which user was active in
|
||||
PersianDateTime selectedMonthPersian = activeMonthsList.First();
|
||||
|
||||
DateTime selectedMonthFirstDay = selectedMonthPersian;
|
||||
DateTime nextMonthFirstDay = selectedMonthPersian.AddMonths(1);
|
||||
|
||||
var statusesOfMonth = employeeRollCallStatuses.EmployeesStatus.Where(x => x.EndDate >= selectedMonthFirstDay &&
|
||||
x.StartDate < nextMonthFirstDay);
|
||||
|
||||
|
||||
|
||||
var leavesQuery =
|
||||
_context.LeaveList.Where(x => (x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")) &&
|
||||
x.IsAccepted &&
|
||||
x.EndLeave >= selectedMonthFirstDay && x.StartLeave < nextMonthFirstDay && x.WorkshopId == workshopId);
|
||||
|
||||
var rollCalls = _context.RollCalls.Where(x =>
|
||||
!leavesQuery.Any(y =>
|
||||
y.StartLeave.Date <= x.StartDate.Value.Date && y.EndLeave.Date >= x.StartDate.Value.Date) &&
|
||||
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate != null &&
|
||||
x.StartDate >= selectedMonthFirstDay && x.StartDate < nextMonthFirstDay);
|
||||
|
||||
var personnelCode =
|
||||
_context.PersonnelCodeSet.FirstOrDefault(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId)?.PersonnelCode;
|
||||
|
||||
var employeeName = _context.RollCallEmployees.Where(x => x.WorkshopId == workshopId).Select(x => new { x.EmployeeId, x.EmployeeFullName })
|
||||
.FirstOrDefault(x => x.EmployeeId == employeeId);
|
||||
|
||||
var rollCallsList = rollCalls.ToList();
|
||||
var leavesList = leavesQuery.ToList();
|
||||
|
||||
int dateRange = (int)(nextMonthFirstDay - selectedMonthFirstDay).TotalDays;
|
||||
|
||||
var todayDate = DateTime.Now.Date;
|
||||
//all the dates from start to end, to be compared with present days to get absent dates
|
||||
var completeDaysList = Enumerable.Range(0, dateRange).Select(offset => selectedMonthFirstDay.AddDays(offset).Date).Where(x => x.Date < todayDate);
|
||||
|
||||
//if user search range is within a month for example, we dont want 30/31/29 days for month, we want it to be the size of the search range
|
||||
//user input = 2024/04/15~2024/04/21, output days count is 21-15+1=6 days from 15th to 21st
|
||||
if (exactDateTime.HasValue || (startDateTime.HasValue && endDateTime.HasValue))
|
||||
completeDaysList = completeDaysList.Where(x => x.Date >= startSearch.Date && x.Date <= endSearch.Date);
|
||||
|
||||
var result = completeDaysList.Where(x => !rollCallsList.Any(y => y.StartDate.Value.Date == x.Date && y.EndDate == null) &&
|
||||
statusesOfMonth.Any(y => x >= y.StartDate.Date && x <= y.EndDate.Date))
|
||||
.Select(x =>
|
||||
{
|
||||
var leave = leavesList.FirstOrDefault(y => y.EndLeave >= x.Date.Date && y.StartLeave <= x.Date.Date);
|
||||
return new RollCallViewModel()
|
||||
{
|
||||
DateGr = x.Date.Date,
|
||||
DateFa = x.Date.Date.ToFarsi(),
|
||||
RollCallTimesList = rollCallsList.Where(y => x.Date.Date == y.StartDate!.Value.Date).Select(y =>
|
||||
new RollCallTimeViewModel()
|
||||
{
|
||||
StartDate = y.StartDate.Value.ToString("HH:mm"),
|
||||
EndDate = y.EndDate!.Value.ToString("HH:mm")
|
||||
}),
|
||||
TotalWorkingHoursSpan = new TimeSpan(rollCallsList.Where(y => x.Date.Date == y.StartDate!.Value.Date)
|
||||
.Sum(y => (y.EndDate!.Value - y.StartDate.Value).Ticks)),
|
||||
Reason = leave?.LeaveType ?? "",
|
||||
HasLeave = (leave?.PaidLeaveType == "روزانه" || leave?.LeaveType == "استعلاجی") ? true : false
|
||||
};
|
||||
});
|
||||
result = result.Select(x => new RollCallViewModel()
|
||||
{
|
||||
EmployeeFullName = employeeName.EmployeeFullName,
|
||||
EmployeeId = employeeId,
|
||||
PersonnelCode = personnelCode.ToString(),
|
||||
DateGr = x.DateGr,
|
||||
DateFa = x.DateFa,
|
||||
DayOfWeekFa = x.DateGr.DayOfWeek.DayOfWeeKToPersian(),
|
||||
IsHoliday = _holidayItemApplication.IsHoliday(x.DateGr),
|
||||
IsAbsent = !x.RollCallTimesList.Any(),
|
||||
RollCallTimesList = x.RollCallTimesList,
|
||||
TotalWorkingHours = $"{(int)x.TotalWorkingHoursSpan.TotalHours}:{x.TotalWorkingHoursSpan.Minutes:00}",
|
||||
}).ToList();
|
||||
return new EmployeeRollCallsByMonthViewModel()
|
||||
{
|
||||
PersianMonthName = selectedMonthPersian.ToString("MMMM"),
|
||||
PersianYear = selectedMonthPersian.ToString("yyyy"),
|
||||
DateGr = selectedMonthFirstDay,
|
||||
RollCalls = result,
|
||||
DateIndex = activeMonthsList.Count > 1 ? activeMonthsList.Skip(1).First().ToString("yyyy/MM/dd") : null
|
||||
|
||||
};
|
||||
}
|
||||
public void AddRange(List<RollCall> rollCalls)
|
||||
{
|
||||
_context.RollCalls.AddRange(rollCalls);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//سوابق حضور غیاب کارگاه
|
||||
public RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel)
|
||||
{
|
||||
|
||||
//initialize
|
||||
|
||||
DateTime searchDurationEnd = DateTime.Now.AddDays(-1).Date;
|
||||
DateTime searchDurationStart = searchDurationEnd.AddDays(-16);
|
||||
|
||||
|
||||
|
||||
//override if user has entered inputs (dates must be validated in the application layer)
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.StarDateFa) && !string.IsNullOrWhiteSpace(searchModel.StarDateFa))
|
||||
{
|
||||
searchDurationEnd = searchModel.EndDateFa.ToGeorgianDateTime().Date;
|
||||
searchDurationStart = searchModel.StarDateFa.ToGeorgianDateTime().AddDays(-1).Date;
|
||||
}
|
||||
|
||||
|
||||
|
||||
else
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.ExactDateFa))
|
||||
{
|
||||
searchDurationEnd = searchModel.ExactDateFa.ToGeorgianDateTime().Date;
|
||||
searchDurationStart = searchModel.ExactDateFa.ToGeorgianDateTime().AddDays(-1).Date;
|
||||
}
|
||||
|
||||
|
||||
if (searchDurationEnd < searchDurationStart)
|
||||
return new();
|
||||
|
||||
|
||||
|
||||
DateTime dateIndex = searchDurationEnd.AddDays(-1 * (searchModel.DateIndex)).Date;
|
||||
|
||||
if (dateIndex <= searchDurationStart)
|
||||
return new();
|
||||
|
||||
|
||||
//get leaves for workshop that have been activated in dateIndex date
|
||||
var leavesQuery = _context.LeaveList.Where(x => x.WorkshopId == searchModel.WorkshopId &&
|
||||
x.IsAccepted && (x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")) &&
|
||||
x.EndLeave.Date >= dateIndex && x.StartLeave.Date <= dateIndex);
|
||||
|
||||
//roll calls for current workshop where shift start is in dateIndex date (filters today's shifts)
|
||||
var rollCallsQuery = _context.RollCalls
|
||||
.Where(x => x.WorkshopId == searchModel.WorkshopId && x.StartDate.HasValue && x.StartDate < DateTime.Now.Date &&
|
||||
x.StartDate.Value.Date == dateIndex.Date);
|
||||
|
||||
|
||||
//get active employees of workshop in dateIndex date
|
||||
var activeEmployeesQuery =
|
||||
_context.RollCallEmployees.Include(x => x.EmployeesStatus)
|
||||
.Where(x => x.WorkshopId == searchModel.WorkshopId && x.EmployeesStatus.Any(y => y.EndDate.Date >= dateIndex && y.StartDate.Date <= dateIndex)
|
||||
&& !rollCallsQuery.Any(rc => rc.EmployeeId == x.EmployeeId && !rc.EndDate.HasValue));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (searchModel.EmployeeId > 0)
|
||||
{
|
||||
rollCallsQuery = rollCallsQuery.Where(x => x.EmployeeId == searchModel.EmployeeId);
|
||||
activeEmployeesQuery = activeEmployeesQuery.Where(x => x.EmployeeId == searchModel.EmployeeId);
|
||||
leavesQuery = leavesQuery.Where(x => x.EmployeeId == searchModel.EmployeeId);
|
||||
}
|
||||
|
||||
|
||||
var personnelCodeList =
|
||||
_context.PersonnelCodeSet.Where(x => activeEmployeesQuery.Any(y => y.EmployeeId == x.EmployeeId && y.WorkshopId == x.WorkshopId));
|
||||
var activatedEmployeesList = activeEmployeesQuery.ToList();
|
||||
rollCallsQuery = rollCallsQuery.Where(x => x.EndDate.HasValue);
|
||||
var rollCallsList = rollCallsQuery.ToList();
|
||||
var leavesList = leavesQuery.ToList();
|
||||
|
||||
rollCallsList = rollCallsList.Where(x => leavesList.All(y => y.EmployeeId != x.EmployeeId)).ToList();
|
||||
var result = new RollCallsByDateViewModel()
|
||||
{
|
||||
DateGr = dateIndex,
|
||||
DayOfWeekFa = dateIndex.DayOfWeek.DayOfWeeKToPersian(),
|
||||
IsHoliday = _holidayItemApplication.IsHoliday(dateIndex),
|
||||
DateFa = dateIndex.ToFarsi(),
|
||||
ActiveEmployees = activatedEmployeesList.Select(x =>
|
||||
{
|
||||
var leave = leavesList.FirstOrDefault(y => y.EmployeeId == x.EmployeeId);
|
||||
var employeeRollCallsForDate = rollCallsList.Where(y => y.EmployeeId == x.EmployeeId).ToList();
|
||||
|
||||
return new RollCallViewModel()
|
||||
{
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
EmployeeId = x.EmployeeId,
|
||||
Reason = leave == null ? "" : $"{leave.LeaveType}-{leave.PaidLeaveType}",
|
||||
RollCallTimesList = employeeRollCallsForDate.Select(y => new RollCallTimeViewModel()
|
||||
{
|
||||
EndDate = y.EndDate!.Value.ToString("HH:mm"),
|
||||
StartDate = y.StartDate!.Value.ToString("HH:mm")
|
||||
}),
|
||||
HasLeave = leave != null,
|
||||
IsAbsent = !employeeRollCallsForDate.Any(),
|
||||
TotalWorkingHoursSpan = new TimeSpan(employeeRollCallsForDate.Sum(y => (y.EndDate!.Value - y.StartDate!.Value).Ticks)),
|
||||
PersonnelCode = personnelCodeList.FirstOrDefault(y => y.EmployeeId == x.EmployeeId)?.PersonnelCode.ToString()
|
||||
};
|
||||
})
|
||||
};
|
||||
result.ActiveEmployees = result.ActiveEmployees.Select(x => new RollCallViewModel()
|
||||
{
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
EmployeeId = x.EmployeeId,
|
||||
Reason = x.Reason,
|
||||
RollCallTimesList = x.RollCallTimesList,
|
||||
HasLeave = x.HasLeave,
|
||||
IsAbsent = x.IsAbsent,
|
||||
PersonnelCode = x.PersonnelCode,
|
||||
TotalWorkingHours = $"{(int)x.TotalWorkingHoursSpan.TotalHours}:{(x.TotalWorkingHoursSpan.Minutes):00}"
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
if (searchModel.EmployeeId > 0)
|
||||
{
|
||||
rollCallsQuery = rollCallsQuery.Where(x => x.EmployeeId == searchModel.EmployeeId);
|
||||
activeEmployeesQuery = activeEmployeesQuery.Where(x => x.EmployeeId == searchModel.EmployeeId);
|
||||
leavesQuery = leavesQuery.Where(x => x.EmployeeId == searchModel.EmployeeId);
|
||||
}
|
||||
//گزارش آنلاین حضور غیاب کارگاه
|
||||
public CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId)
|
||||
{
|
||||
var date = DateTime.Now.Date;
|
||||
|
||||
|
||||
var personnelCodeList =
|
||||
_context.PersonnelCodeSet.Where(x => activeEmployeesQuery.Any(y => y.EmployeeId == x.EmployeeId));
|
||||
var rollCallsList = rollCallsQuery.ToList();
|
||||
var activatedEmployeesList = activeEmployeesQuery.ToList();
|
||||
var leavesList = leavesQuery.ToList();
|
||||
|
||||
rollCallsList = rollCallsList.Where(x => leavesList.All(y => y.EmployeeId != x.EmployeeId)).ToList();
|
||||
var result = new RollCallsByDateViewModel()
|
||||
{
|
||||
DateGr = dateIndex,
|
||||
DayOfWeekFa = dateIndex.DayOfWeek.DayOfWeeKToPersian(),
|
||||
IsHoliday = _holidayItemApplication.IsHoliday(dateIndex),
|
||||
DateFa = dateIndex.ToFarsi(),
|
||||
ActiveEmployees = activatedEmployeesList.Select(x =>
|
||||
{
|
||||
var leave = leavesList.FirstOrDefault(y => y.EmployeeId == x.EmployeeId);
|
||||
var employeeRollCallsForDate = rollCallsList.Where(y => y.EmployeeId == x.EmployeeId).ToList();
|
||||
|
||||
return new RollCallViewModel()
|
||||
{
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
EmployeeId = x.EmployeeId,
|
||||
Reason = leave == null ? "" : $"{leave.LeaveType}-{leave.PaidLeaveType}",
|
||||
RollCallTimesList = employeeRollCallsForDate.Select(y => new RollCallTimeViewModel()
|
||||
{
|
||||
EndDate = y.EndDate!.Value.ToString("HH:mm"),
|
||||
StartDate = y.StartDate!.Value.ToString("HH:mm")
|
||||
}),
|
||||
HasLeave = leave != null,
|
||||
IsAbsent = !employeeRollCallsForDate.Any(),
|
||||
TotalWorkingHoursSpan = new TimeSpan(employeeRollCallsForDate.Sum(y => (y.EndDate!.Value - y.StartDate!.Value).Ticks)),
|
||||
PersonnelCode = personnelCodeList.FirstOrDefault(y => y.EmployeeId == x.EmployeeId)?.PersonnelCode.ToString()
|
||||
};
|
||||
})
|
||||
};
|
||||
result.ActiveEmployees = result.ActiveEmployees.Select(x => new RollCallViewModel()
|
||||
{
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
EmployeeId = x.EmployeeId,
|
||||
Reason = x.Reason,
|
||||
RollCallTimesList = x.RollCallTimesList,
|
||||
HasLeave = x.HasLeave,
|
||||
IsAbsent = x.IsAbsent,
|
||||
PersonnelCode = x.PersonnelCode,
|
||||
TotalWorkingHours = $"{x.TotalWorkingHoursSpan.TotalHours.ToString("0")}:{x.TotalWorkingHoursSpan.Minutes.ToString("00")}"
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//گزارش آنلاین حضور غیاب کارگاه
|
||||
public CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId)
|
||||
{
|
||||
var date = DateTime.Now.Date;
|
||||
|
||||
|
||||
//get active leaves for workshop which are active today and accepted and are either روزانه and استحقاقی or استعلاجی
|
||||
var leaves = _context.LeaveList
|
||||
.Where(x =>
|
||||
(x.WorkshopId == workshopId && x.EndLeave.Date >= date && x.StartLeave.Date <= date && x.IsAccepted) &&
|
||||
((x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")) || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "ساعتی" && x.StartLeave <= DateTime.Now && x.EndLeave >= DateTime.Now))
|
||||
);
|
||||
|
||||
var personnelCodes = _context.PersonnelCodeSet.Where(x => x.WorkshopId == workshopId).ToList();
|
||||
|
||||
//get currently working employees with leftWork table
|
||||
//var workingEmployees =
|
||||
// _context.LeftWorkList.Where(x => x.WorkshopId == workshopId && x.StartWorkDate < date && x.LeftWorkDate.Date > date);
|
||||
|
||||
|
||||
|
||||
//get activated employees
|
||||
var activeEmployees =
|
||||
_context.RollCallEmployees.Include(x => x.EmployeesStatus)
|
||||
.Where(x => x.WorkshopId == workshopId && x.IsActiveString == "true" && x.EmployeesStatus.Any(y =>
|
||||
y.StartDate.Date <= date &&
|
||||
y.EndDate.Date >= date));
|
||||
|
||||
|
||||
//get today's roll calls
|
||||
var rollCallsQuery = _context.RollCalls.Where(x =>
|
||||
x.WorkshopId == workshopId && x.StartDate.Value.Date == date);
|
||||
|
||||
|
||||
|
||||
|
||||
var mustBePresent = activeEmployees.Where(x => !leaves.Any(y => y.EmployeeId == x.EmployeeId));
|
||||
|
||||
|
||||
|
||||
var filteredRollCallQuery = rollCallsQuery.Where(x => mustBePresent
|
||||
.Any(y => x.EmployeeId == y.EmployeeId)).ToList();
|
||||
|
||||
|
||||
var nameReferences = activeEmployees.ToList();
|
||||
|
||||
//presents list is ready
|
||||
var presentEmployees = filteredRollCallQuery.GroupBy(x => x.EmployeeId).Select(x => new RollCallViewModel()
|
||||
{
|
||||
PersonnelCode = personnelCodes
|
||||
.FirstOrDefault(y => y.EmployeeId == x.Key)?
|
||||
.PersonnelCode.ToString(),
|
||||
EmployeeFullName = nameReferences.FirstOrDefault(y => x.Key == y.EmployeeId)?.EmployeeFullName??"-",
|
||||
EmployeeId = x.FirstOrDefault()!.EmployeeId,
|
||||
TotalWorkingHoursSpan = new TimeSpan(x.Where(y => y.EndDate != null).Sum(y => (y.EndDate!.Value - y.StartDate!.Value).Ticks)),
|
||||
RollCallTimesList = x.Select(y => new RollCallTimeViewModel()
|
||||
{
|
||||
StartDate = y.StartDate!.Value.ToString("HH:mm"),
|
||||
EndDate = y.EndDate?.ToString("HH:mm")
|
||||
}).ToList()
|
||||
|
||||
|
||||
});
|
||||
|
||||
presentEmployees = presentEmployees.Select(x => new RollCallViewModel()
|
||||
{
|
||||
PersonnelCode = x.PersonnelCode,
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
EmployeeId = x.EmployeeId,
|
||||
TotalWorkingHours =
|
||||
$"{(int)x.TotalWorkingHoursSpan.TotalHours}:{x.TotalWorkingHoursSpan.Minutes.ToString("00")}",
|
||||
RollCallTimesList = x.RollCallTimesList
|
||||
}).OrderBy(x => x.RollCallTimesList.Any(y => y.EndDate != null)).ToList();
|
||||
|
||||
//absent ones are those who are active and not on the roll call list
|
||||
var absentsQuery = activeEmployees.AsEnumerable()
|
||||
.ExceptBy(presentEmployees.Select(x => x.EmployeeId), e => e.EmployeeId).ToList();
|
||||
|
||||
|
||||
|
||||
//get today's active leaves
|
||||
var employeesWithLeave = leaves.AsEnumerable()
|
||||
.Where(x => absentsQuery.Any(y => y.EmployeeId == x.EmployeeId))
|
||||
.Select(x => new { x.EmployeeId, x.LeaveType }).ToList();
|
||||
|
||||
//join leave and absents
|
||||
var absentsViewModel = absentsQuery.Select(x => new AbsentEmployeeViewModel()
|
||||
{
|
||||
PersonnelCode = personnelCodes
|
||||
.FirstOrDefault(y => y.EmployeeId == x.EmployeeId)?
|
||||
.PersonnelCode.ToString(),
|
||||
EmployeeId = x.EmployeeId,
|
||||
EmployeeFullName = nameReferences.FirstOrDefault(y => x.EmployeeId == y.EmployeeId)?.EmployeeFullName ?? "-",
|
||||
HasLeave = employeesWithLeave.Any(y => y.EmployeeId == x.EmployeeId),
|
||||
Reason = employeesWithLeave.FirstOrDefault(y => y.EmployeeId == x.EmployeeId)?.LeaveType
|
||||
}).ToList();
|
||||
|
||||
return new CurrentDayRollCall()
|
||||
{
|
||||
AbsentEmployees = absentsViewModel.ToList(),
|
||||
PresentEmployees = presentEmployees.ToList()
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
public long Flag(long employeeId, long workshopId)
|
||||
//get active leaves for workshop which are active today and accepted and are either روزانه and استحقاقی or استعلاجی
|
||||
var leaves = _context.LeaveList
|
||||
.Where(x =>
|
||||
(x.WorkshopId == workshopId && x.EndLeave.Date >= date && x.StartLeave.Date <= date && x.IsAccepted) &&
|
||||
((x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")) || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "ساعتی" && x.StartLeave <= DateTime.Now && x.EndLeave >= DateTime.Now))
|
||||
);
|
||||
|
||||
var personnelCodes = _context.PersonnelCodeSet.Where(x => x.WorkshopId == workshopId).ToList();
|
||||
|
||||
//get currently working employees with leftWork table
|
||||
//var workingEmployees =
|
||||
// _context.LeftWorkList.Where(x => x.WorkshopId == workshopId && x.StartWorkDate < date && x.LeftWorkDate.Date > date);
|
||||
|
||||
|
||||
|
||||
//get activated employees
|
||||
var activeEmployees =
|
||||
_context.RollCallEmployees.Include(x => x.EmployeesStatus)
|
||||
.Where(x => x.WorkshopId == workshopId && x.IsActiveString == "true" && x.EmployeesStatus.Any(y =>
|
||||
y.StartDate.Date <= date &&
|
||||
y.EndDate.Date >= date));
|
||||
|
||||
|
||||
//get today's roll calls
|
||||
var rollCallsQuery = _context.RollCalls.Where(x =>
|
||||
x.WorkshopId == workshopId && (x.StartDate.Value.Date == date || x.EndDate == null));
|
||||
|
||||
|
||||
|
||||
|
||||
var mustBePresent = activeEmployees.Where(x => !leaves.Any(y => y.EmployeeId == x.EmployeeId));
|
||||
|
||||
|
||||
|
||||
var filteredRollCallQuery = rollCallsQuery.Where(x => mustBePresent
|
||||
.Any(y => x.EmployeeId == y.EmployeeId)).ToList();
|
||||
|
||||
|
||||
var nameReferences = activeEmployees.ToList();
|
||||
|
||||
//presents list is ready
|
||||
var presentEmployees = filteredRollCallQuery.GroupBy(x => x.EmployeeId).Select(x => new RollCallViewModel()
|
||||
{
|
||||
PersonnelCode = personnelCodes
|
||||
.FirstOrDefault(y => y.EmployeeId == x.Key)?
|
||||
.PersonnelCode.ToString(),
|
||||
EmployeeFullName = nameReferences.FirstOrDefault(y => x.Key == y.EmployeeId).EmployeeFullName,
|
||||
EmployeeId = x.FirstOrDefault()!.EmployeeId,
|
||||
TotalWorkingHoursSpan = new TimeSpan(x.Where(y => y.EndDate != null).Sum(y => (y.EndDate!.Value - y.StartDate!.Value).Ticks)),
|
||||
RollCallTimesList = x.Select(y => new RollCallTimeViewModel()
|
||||
{
|
||||
StartDate = y.StartDate!.Value.ToString("HH:mm"),
|
||||
EndDate = y.EndDate?.ToString("HH:mm")
|
||||
}).ToList()
|
||||
|
||||
|
||||
});
|
||||
|
||||
presentEmployees = presentEmployees.Select(x => new RollCallViewModel()
|
||||
{
|
||||
PersonnelCode = x.PersonnelCode,
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
EmployeeId = x.EmployeeId,
|
||||
TotalWorkingHours =
|
||||
$"{(int)x.TotalWorkingHoursSpan.TotalHours}:{x.TotalWorkingHoursSpan.Minutes.ToString("00")}",
|
||||
RollCallTimesList = x.RollCallTimesList
|
||||
}).OrderBy(x => x.RollCallTimesList.Any(y => y.EndDate != null)).ToList();
|
||||
|
||||
//absent ones are those who are active and not on the roll call list
|
||||
var absentsQuery = activeEmployees.AsEnumerable()
|
||||
.ExceptBy(presentEmployees.Select(x => x.EmployeeId), e => e.EmployeeId).ToList();
|
||||
|
||||
|
||||
|
||||
//get today's active leaves
|
||||
var employeesWithLeave = leaves.AsEnumerable()
|
||||
.Where(x => absentsQuery.Any(y => y.EmployeeId == x.EmployeeId))
|
||||
.Select(x => new { x.EmployeeId, x.LeaveType }).ToList();
|
||||
|
||||
//join leave and absents
|
||||
var absentsViewModel = absentsQuery.Select(x => new AbsentEmployeeViewModel()
|
||||
{
|
||||
PersonnelCode = personnelCodes
|
||||
.FirstOrDefault(y => y.EmployeeId == x.EmployeeId)?
|
||||
.PersonnelCode.ToString(),
|
||||
EmployeeId = x.EmployeeId,
|
||||
EmployeeFullName = nameReferences.FirstOrDefault(y => x.EmployeeId == y.EmployeeId).EmployeeFullName,
|
||||
HasLeave = employeesWithLeave.Any(y => y.EmployeeId == x.EmployeeId),
|
||||
Reason = employeesWithLeave.FirstOrDefault(y => y.EmployeeId == x.EmployeeId)?.LeaveType
|
||||
}).ToList();
|
||||
|
||||
return new CurrentDayRollCall()
|
||||
{
|
||||
AbsentEmployees = absentsViewModel.ToList(),
|
||||
PresentEmployees = presentEmployees.ToList()
|
||||
};
|
||||
}
|
||||
|
||||
public void RemoveEmployeeRollCallsInDate(long workshopId, long employeeId, DateTime date)
|
||||
{
|
||||
var rollCalls = _context.RollCalls.Where(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId && x.StartDate.Value.Date == date.Date);
|
||||
if (!rollCalls.Any())
|
||||
return;
|
||||
_context.RollCalls.RemoveRange(rollCalls);
|
||||
}
|
||||
public List<RollCallViewModel> GetWorkshopEmployeeRollCallsForDate(long workshopId, long employeeId, DateTime date)
|
||||
{
|
||||
var names = _context.RollCallEmployees.Where(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId).Select(x => new
|
||||
{
|
||||
x.EmployeeId,
|
||||
x.EmployeeFullName
|
||||
}).ToList();
|
||||
var rollcalls = _context.RollCalls
|
||||
.Where(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId && x.StartDate.Value.Date == date.Date)
|
||||
.Select(x => new RollCallViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
StartDate = x.StartDate.Value,
|
||||
EndDate = x.EndDate.Value,
|
||||
DateFa = x.StartDate.Value.Date.ToFarsi(),
|
||||
StartDateFa = x.StartDate.Value.ToFarsi(),
|
||||
EndDateFa = x.EndDate != null ? x.EndDate.Value.ToFarsi() : null
|
||||
}).ToList();
|
||||
return rollcalls.Select(x => new RollCallViewModel()
|
||||
{
|
||||
Id = x.Id,
|
||||
StartDate = x.StartDate,
|
||||
EndDate = x.EndDate,
|
||||
StartTimeString = x.StartDate!.Value.ToString("HH:mm"),
|
||||
EndTimeString = x.EndDate?.ToString("HH:mm"),
|
||||
DateFa = x.DateFa,
|
||||
StartDateFa = x.StartDateFa,
|
||||
EndDateFa = x.EndDateFa,
|
||||
EmployeeId = names.FirstOrDefault(e => e.EmployeeId == employeeId)!.EmployeeId,
|
||||
EmployeeFullName = names.FirstOrDefault(e => e.EmployeeId == employeeId)!.EmployeeFullName
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
public long Flag(long employeeId, long workshopId)
|
||||
{
|
||||
var checkDate = DateTime.Now.AddDays(-3);
|
||||
var query = _context.RollCalls
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
@* <button type="button" class="btnTaskTicket me-1 d-flex align-items-center" id="btnTaskTicket" onclick="loadMore('ticket');">لیست پشتیبانیها</button> *@
|
||||
<button type="button" class="btnTaskRequest me-1 d-flex align-items-center" id="btnTaskRequest" permission="9012">
|
||||
لیست درخواستها
|
||||
<span class="badge bg-danger rounded-pill me-1 @(Model.RequestCount==0 ? "d-none" : "")" id="badgeRequestCount">@Model.RequestCount</span>
|
||||
<span class="badge bg-danger rounded-pill me-1 @(Model.RequestCount==0 ? "d-none" : "")" id="badgeRequestCount1">@Model.RequestCount</span>
|
||||
</button>
|
||||
|
||||
<button type="button" class="btnTaskListAllTask me-1" id="btnTaskListAllTask" onclick="loadMore('AllTask');">کل وظایف</button>
|
||||
@@ -73,7 +73,7 @@
|
||||
@* <button type="button" class="btnTaskTicket me-1 d-flex align-items-center" id="btnTaskTicket" onclick="loadMore('ticket');">لیست پشتیبانیها</button> *@
|
||||
<button type="button" class="btnTaskRequest me-1 d-flex align-items-center" id="btnTaskRequest" permission="9012">
|
||||
لیست درخواستها
|
||||
<span class="badge bg-danger rounded-pill me-1 @(Model.RequestCount==0 ? "d-none" : "")" id="badgeRequestCount">@Model.RequestCount</span>
|
||||
<span class="badge bg-danger rounded-pill me-1 @(Model.RequestCount==0 ? "d-none" : "")" id="badgeRequestCount2">@Model.RequestCount</span>
|
||||
</button>
|
||||
}
|
||||
|
||||
|
||||
@@ -179,15 +179,15 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
|
||||
});
|
||||
}
|
||||
|
||||
//public IActionResult OnGetRequestCount()
|
||||
//{
|
||||
// var requestCount = _taskApplication.GetRequestedTasksCount();
|
||||
// return new JsonResult(new
|
||||
// {
|
||||
// isSuccess = true,
|
||||
// result = requestCount
|
||||
// });
|
||||
//}
|
||||
public IActionResult OnGetRequestCount()
|
||||
{
|
||||
var requestCount = _taskApplication.GetRequestedTasksCount();
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccess = true,
|
||||
result = requestCount
|
||||
});
|
||||
}
|
||||
|
||||
// برای ارجاع دادن
|
||||
public IActionResult OnPostCreateAssign(OperationModalViewModel command)
|
||||
|
||||
@@ -158,31 +158,30 @@
|
||||
</svg>
|
||||
<span class="mx-1 d-md-none d-flex">جزئیات</span>
|
||||
</button>
|
||||
@if (item.Status != "بسته شده")
|
||||
{
|
||||
<button type="button" class="btn-ticket-task position-relative d-md-block d-none" onclick=@(!item.HasTask ? $"CreateTaskTicket({item.Id})" : "")>
|
||||
|
||||
<button type="button" class="btn-ticket-task position-relative d-md-block d-none @(item.HasTask || item.Status == "بسته شده" ? "disable" : "")" onclick=@(!item.HasTask ? $"CreateTaskTicket({item.Id})" : "")>
|
||||
|
||||
@if (!item.HasTask)
|
||||
{
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M3 8H17.8C18.9201 8 19.4802 8 19.908 8.21799C20.2843 8.40973 20.5903 8.71569 20.782 9.09202C21 9.51984 21 10.0799 21 11.2V16.8C21 17.9201 21 18.4802 20.782 18.908C20.5903 19.2843 20.2843 19.5903 19.908 19.782C19.4802 20 18.9201 20 17.8 20H6.2C5.0799 20 4.51984 20 4.09202 19.782C3.71569 19.5903 3.40973 19.2843 3.21799 18.908C3 18.4802 3 17.9201 3 16.8V8Z" fill="#7DD3FC" />
|
||||
<path d="M3 8C3 7.06812 3 6.60218 3.15224 6.23463C3.35523 5.74458 3.74458 5.35523 4.23463 5.15224C4.60218 5 5.06812 5 6 5H8.34315C9.16065 5 9.5694 5 9.93694 5.15224C10.3045 5.30448 10.5935 5.59351 11.1716 6.17157L13 8H3Z" fill="#38BDF8" />
|
||||
<path d="M10 14H15M15 14L12.5 11.5M15 14L12.5 16.5" stroke="#0284C7" stroke-linecap="round" />
|
||||
</svg>
|
||||
}
|
||||
else
|
||||
{
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M3 8H17.8C18.9201 8 19.4802 8 19.908 8.21799C20.2843 8.40973 20.5903 8.71569 20.782 9.09202C21 9.51984 21 10.0799 21 11.2V16.8C21 17.9201 21 18.4802 20.782 18.908C20.5903 19.2843 20.2843 19.5903 19.908 19.782C19.4802 20 18.9201 20 17.8 20H6.2C5.0799 20 4.51984 20 4.09202 19.782C3.71569 19.5903 3.40973 19.2843 3.21799 18.908C3 18.4802 3 17.9201 3 16.8V8Z" fill="#7DD3FC" />
|
||||
<path d="M10 14H15M15 14L12.5 11.5M15 14L12.5 16.5" stroke="#0284C7" stroke-linecap="round" />
|
||||
<path d="M3 8C3 7.06812 3 6.60218 3.15224 6.23463C3.35523 5.74458 3.74458 5.35523 4.23463 5.15224C4.60218 5 5.06812 5 6 5H8.34315C9.16065 5 9.5694 5 9.93694 5.15224C10.3045 5.30448 10.5935 5.59351 11.1716 6.17157L13 8H3Z" fill="#38BDF8" />
|
||||
<circle cx="20.0002" cy="18.9997" r="2.66667" fill="#84CC16" fill-opacity="0.6" />
|
||||
<path d="M19.1665 18.9997L19.7271 19.5603C19.7857 19.6189 19.8807 19.6189 19.9392 19.5603L21.1665 18.333" stroke="white" stroke-width="0.5" stroke-linecap="round" />
|
||||
</svg>
|
||||
}
|
||||
@if (!item.HasTask)
|
||||
{
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M3 8H17.8C18.9201 8 19.4802 8 19.908 8.21799C20.2843 8.40973 20.5903 8.71569 20.782 9.09202C21 9.51984 21 10.0799 21 11.2V16.8C21 17.9201 21 18.4802 20.782 18.908C20.5903 19.2843 20.2843 19.5903 19.908 19.782C19.4802 20 18.9201 20 17.8 20H6.2C5.0799 20 4.51984 20 4.09202 19.782C3.71569 19.5903 3.40973 19.2843 3.21799 18.908C3 18.4802 3 17.9201 3 16.8V8Z" fill="#7DD3FC" />
|
||||
<path d="M3 8C3 7.06812 3 6.60218 3.15224 6.23463C3.35523 5.74458 3.74458 5.35523 4.23463 5.15224C4.60218 5 5.06812 5 6 5H8.34315C9.16065 5 9.5694 5 9.93694 5.15224C10.3045 5.30448 10.5935 5.59351 11.1716 6.17157L13 8H3Z" fill="#38BDF8" />
|
||||
<path d="M10 14H15M15 14L12.5 11.5M15 14L12.5 16.5" stroke="#0284C7" stroke-linecap="round" />
|
||||
</svg>
|
||||
}
|
||||
else
|
||||
{
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M3 8H17.8C18.9201 8 19.4802 8 19.908 8.21799C20.2843 8.40973 20.5903 8.71569 20.782 9.09202C21 9.51984 21 10.0799 21 11.2V16.8C21 17.9201 21 18.4802 20.782 18.908C20.5903 19.2843 20.2843 19.5903 19.908 19.782C19.4802 20 18.9201 20 17.8 20H6.2C5.0799 20 4.51984 20 4.09202 19.782C3.71569 19.5903 3.40973 19.2843 3.21799 18.908C3 18.4802 3 17.9201 3 16.8V8Z" fill="#7DD3FC" />
|
||||
<path d="M10 14H15M15 14L12.5 11.5M15 14L12.5 16.5" stroke="#0284C7" stroke-linecap="round" />
|
||||
<path d="M3 8C3 7.06812 3 6.60218 3.15224 6.23463C3.35523 5.74458 3.74458 5.35523 4.23463 5.15224C4.60218 5 5.06812 5 6 5H8.34315C9.16065 5 9.5694 5 9.93694 5.15224C10.3045 5.30448 10.5935 5.59351 11.1716 6.17157L13 8H3Z" fill="#38BDF8" />
|
||||
<circle cx="20.0002" cy="18.9997" r="2.66667" fill="#84CC16" fill-opacity="0.6" />
|
||||
<path d="M19.1665 18.9997L19.7271 19.5603C19.7857 19.6189 19.8807 19.6189 19.9392 19.5603L21.1665 18.333" stroke="white" stroke-width="0.5" stroke-linecap="round" />
|
||||
</svg>
|
||||
}
|
||||
|
||||
</button>
|
||||
}
|
||||
</button>
|
||||
|
||||
|
||||
<button type="button" class="btn-ticket-delete d-md-block d-none">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
|
||||
|
||||
@@ -241,7 +241,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li permission="301">
|
||||
<a class="clik3" asp-area="Admin" asp-page="/Company/YearlySalaryTitles/Index">
|
||||
<a class="clik3" asp-area="Admin" asp-page="/Company/YearlySalaryTitles/Index">
|
||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white" />
|
||||
</svg>
|
||||
@@ -256,7 +256,7 @@
|
||||
مقادیر سالانه
|
||||
</a>
|
||||
</li>
|
||||
<li permission="302">
|
||||
<li permission="311">
|
||||
<a class="clik3" asp-area="Admin" asp-page="/Company/ClassifiedSalary/Index">
|
||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white" />
|
||||
@@ -264,7 +264,7 @@
|
||||
مزد سنوات
|
||||
</a>
|
||||
</li>
|
||||
<li permission="302">
|
||||
<li permission="310">
|
||||
<a class="clik3" asp-area="Admin" asp-page="/Company/InsuranceYearlySalary/Index">
|
||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white" />
|
||||
@@ -312,7 +312,7 @@
|
||||
تشخیص چهره
|
||||
</a>
|
||||
</li>
|
||||
<li permission="306">
|
||||
<li permission="309">
|
||||
<a class="clik3" asp-area="Admin" asp-page="/Company/Reports/Index">
|
||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white" />
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
}
|
||||
|
||||
.goToTop {
|
||||
display: none;
|
||||
position: fixed;
|
||||
bottom: -10px;
|
||||
margin-right: 100px;
|
||||
@@ -49,6 +50,16 @@
|
||||
background-color: #2ca4a4;
|
||||
}
|
||||
|
||||
.textListTitle {
|
||||
color: #1A1A1A;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.sweet-alert button {
|
||||
font-family: 'IRANYekanX' !important;
|
||||
}
|
||||
|
||||
@@media screen and (max-width: 767px) {
|
||||
.table-rollcall .width2 {
|
||||
width: 35% !important;
|
||||
@@ -67,6 +78,16 @@
|
||||
color: #fff;
|
||||
background-color: #25acac70;
|
||||
}
|
||||
|
||||
.textListTitle {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
@@media (max-width: 576px) {
|
||||
.form-control {
|
||||
margin: 0px 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
}
|
||||
@@ -74,13 +95,14 @@
|
||||
@section Styles {
|
||||
<link href="~/assetsclient/css/table-style.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/assetsclient/css/table-responsive.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/assetsclient/css/rollcall-list-table.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/assetsclient/css/rollcall-list-table.css?ver=clientVersion" rel="stylesheet" />
|
||||
<link href="~/assetsclient/css/operation-button.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/AssetsClient/css/dropdown.css?ver=123" rel="stylesheet" />
|
||||
<link href="~/AssetsClient/css/select2.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/AssetsClient/css/filter-search.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/assetsclient/pages/rollcall/css/casehistory.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/AssetsClient/css/datetimepicker.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/AdminTheme/assets/sweet-alert/sweet-alert.min.css" rel="stylesheet">
|
||||
}
|
||||
|
||||
|
||||
@@ -89,9 +111,12 @@
|
||||
<div class="container-fluid">
|
||||
<div class="row p-2">
|
||||
<div class="col p-0 m-0 d-flex align-items-center justify-content-between">
|
||||
<div class="col">
|
||||
<h4 class="title d-flex align-items-center">سوابق حضور و غیاب</h4>
|
||||
<div class="title d-flex align-items-center">@Model.WorkshopFullName</div>
|
||||
<div class="col d-flex align-items-center justify-content-start">
|
||||
<img src="~/AssetsClient/images/rollcall-history.png" alt="" class="img-fluid mx-1" width="50px" />
|
||||
<div>
|
||||
<h4 class="title d-flex align-items-center">سوابق حضور و غیاب</h4>
|
||||
<div class="title d-flex align-items-center" id="caseHistoryWorkshopFullname">@Model.WorkshopFullName</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<a asp-page="/Company/RollCall/Index" class="back-btn" type="button">
|
||||
@@ -132,7 +157,9 @@
|
||||
</div>
|
||||
<div class="">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<div><input type="text" class="form-control date start-date text-center" id="StartDate" placeholder="تاریخ"></div>
|
||||
<div>
|
||||
<input type="text" class="form-control date start-date text-center" id="StartDate" placeholder="تاریخ">
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center d-none" id="endDateRollcall">
|
||||
<div class="me-2 elay">الی</div>
|
||||
@@ -142,7 +169,6 @@
|
||||
</div>
|
||||
|
||||
<div class="col-3 col-xl-2">
|
||||
|
||||
<select class="form-select select2Option" aria-label="انتخاب پرسنل ..." id="employeeSelect">
|
||||
<option value="0">انتخاب پرسنل ...</option>
|
||||
@foreach (var itemEmployee in Model.RollCallEmployeeList)
|
||||
@@ -152,7 +178,6 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<button class="btn-search btn-w-size btn-search-click text-nowrap d-flex align-items-center justify-content-center" id="searchBtn" type="submit">
|
||||
<span>جستجو</span>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
||||
@@ -174,7 +199,7 @@
|
||||
<div class="container-fluid" id="containerHeight">
|
||||
<div class="row p-lg-2">
|
||||
|
||||
<div class="card">
|
||||
<div class="card" style="margin: 0 0 60px 0;">
|
||||
@if (@Model.RollCallViewModels.ActiveEmployees.Any())
|
||||
{
|
||||
|
||||
@@ -189,6 +214,39 @@
|
||||
</button>
|
||||
</div>
|
||||
<!-- End Advance Search Box -->
|
||||
|
||||
|
||||
<div class="d-flex align-items-center mb-1 p-1">
|
||||
<div class="col-12 col-md-4">
|
||||
<div class="d-flex align-items-center gap-1">
|
||||
<button type="button" class="btn-search text-nowrap d-flex align-items-center justify-content-center" onclick="addWorkTime()">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 25 25" fill="none">
|
||||
<circle cx="12.5" cy="12.5" r="8.775" stroke="white" stroke-width="2" stroke-opacity="0.84"></circle>
|
||||
<path d="M12.5 8.3335L12.5 16.6668" stroke="white" stroke-width="2" stroke-linecap="round"></path>
|
||||
<path d="M16.6667 12.5L8.33342 12.5" stroke="white" stroke-width="2" stroke-linecap="round"></path>
|
||||
</svg>
|
||||
<span class="mx-1">افزودن حضور و غیاب</span>
|
||||
</button>
|
||||
|
||||
<div class="col-6 col-xl-6 position-relative">
|
||||
<input type="text" class="form-control" id="search" placeholder="جستجو ...">
|
||||
<button type="button" id="clear-search" class="close-btn-search d-none">
|
||||
<svg width="20" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-none d-md-block text-center">
|
||||
<span class="textListTitle">لیست سوابق حضور و غیاب</span>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-none d-md-block">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="wrapper table-rollcall">
|
||||
<div class="rollcall-list Rtable Rtable--5cols Rtable--collapse px-1" >
|
||||
@@ -203,6 +261,7 @@
|
||||
<div class="Rtable-cell column-heading width6 text-center">خروج</div>
|
||||
<div class="Rtable-cell column-heading width7 text-start">تجمیع در خروج</div>
|
||||
<div class="Rtable-cell column-heading width8 text-center">مجموع ساعات کاری</div>
|
||||
<div class="Rtable-cell column-heading width9 text-end">عملیات</div>
|
||||
</div>
|
||||
|
||||
<div class="w-100 rollcall-list Rtable Rtable--5cols Rtable--collapse" id="caseHistoryLoadData">
|
||||
@@ -309,14 +368,26 @@
|
||||
<!-- End Modal From Bottom For Advance Search -->
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="MainModal" class="modal fade" aria-labelledby="myModalLabel" aria-hidden="true" tabindex="-1" data-bs-backdrop="static" style="display: none;">
|
||||
<div class="modal-dialog modal-md modal-dialog-centered">
|
||||
<div class="modal-content" id="ModalContent">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Script {
|
||||
<script src="~/assetsclient/js/site.js?ver=@clientVersion"></script>
|
||||
<script src="~/AdminTheme/assets/sweet-alert/sweet-alert.min.js"></script>
|
||||
<script src="~/AssetsClient/js/dropdown.js?ver=@clientVersion"></script>
|
||||
<script>
|
||||
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
|
||||
var caseHistoryAjaxLoadData = `@Url.Page("./CaseHistory", "CaseHistoryRollCallAjax")`;
|
||||
var itemsYearList = @Html.Raw(Json.Serialize(Model.YearlyList.OrderBy(x => x)));
|
||||
// var dateIndex = 0;
|
||||
|
||||
var deleteRollCallData = `@Url.Page("./CaseHistory", "RemoveEmployeeRollCallsInDate")`;
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/rollcall/js/casehistory.js?ver=@clientVersion"></script>
|
||||
<script src="~/assetsclient/pages/rollcall/js/casehistory.js?ver=13515"></script>
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
using CompanyManagment.App.Contracts.Error;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using CompanyManagment.App.Contracts.RollCallEmployee;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
@@ -7,6 +9,9 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using System.Security.Claims;
|
||||
using CompanyManagment.App.Contracts.Leave;
|
||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
{
|
||||
@@ -19,6 +24,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
private readonly IRollCallEmployeeApplication _rollCallEmployeeApplication;
|
||||
private readonly IRollCallApplication _rollCallApplication;
|
||||
private readonly IYearlySalaryApplication _yearlySalaryApplication;
|
||||
private readonly ILeaveApplication _leaveApplication;
|
||||
|
||||
public RollCallsByDateViewModel RollCallViewModels { get; set; }
|
||||
public EmployeeRollCallsByMonthViewModel RollCallEmployeeViewModels { get; set; }
|
||||
@@ -28,7 +34,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
public RollCallSearchModel SearchModel { get; set; } = new();
|
||||
public List<string> YearlyList { get; set; }
|
||||
|
||||
public CaseHistoryModel(IAuthHelper authHelper, IPasswordHasher passwordHasher, IRollCallEmployeeApplication rollCallEmployeeApplication, IWorkshopApplication workshopApplication, IRollCallApplication rollCallApplication, IYearlySalaryApplication yearlySalaryApplication)
|
||||
public CaseHistoryModel(IAuthHelper authHelper, IPasswordHasher passwordHasher, IRollCallEmployeeApplication rollCallEmployeeApplication, IWorkshopApplication workshopApplication, IRollCallApplication rollCallApplication, IYearlySalaryApplication yearlySalaryApplication, ILeaveApplication leaveApplication)
|
||||
{
|
||||
_authHelper = authHelper;
|
||||
_passwordHasher = passwordHasher;
|
||||
@@ -36,6 +42,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
_workshopApplication = workshopApplication;
|
||||
_rollCallApplication = rollCallApplication;
|
||||
_yearlySalaryApplication = yearlySalaryApplication;
|
||||
_leaveApplication = leaveApplication;
|
||||
}
|
||||
|
||||
|
||||
@@ -111,5 +118,141 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public IActionResult OnGetEmployeeList()
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
if (workshopId <= 0)
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = false,
|
||||
message = "کارگاه ای یافت نشد",
|
||||
});
|
||||
|
||||
var resultData = _rollCallEmployeeApplication.GetRollCallEmployeesByWorkshopId(workshopId);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = resultData
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public IActionResult OnGetCreate()
|
||||
{
|
||||
var command = new CreateOrEditEmployeeRollCall();
|
||||
return Partial("ModalAddRollCall", command);
|
||||
}
|
||||
|
||||
public IActionResult OnGetCheckEmployeeData(long employeeId, string date)
|
||||
{
|
||||
bool isSuccess = false;
|
||||
|
||||
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
if (workshopId < 1)
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = false,
|
||||
message = "کارگاهی یافت نشد!",
|
||||
});
|
||||
|
||||
List<RollCallViewModel> resultData= new List<RollCallViewModel>();
|
||||
|
||||
if(!string.IsNullOrWhiteSpace(date))
|
||||
{
|
||||
resultData = _rollCallApplication.GetWorkshopEmployeeRollCallsForDate(workshopId, employeeId, date);
|
||||
isSuccess = resultData.Any();
|
||||
}
|
||||
|
||||
var result=_leaveApplication.HasLeave(workshopId, employeeId, date);
|
||||
var isLeave = result.IsSuccedded ? result.Data : false;
|
||||
|
||||
var isNullEndDate = resultData.Any(x => x.EndDate == null);
|
||||
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = isSuccess,
|
||||
data = resultData,
|
||||
hasLeave = isLeave,
|
||||
hasNullEndDate = isNullEndDate
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public IActionResult OnGetEdit(long employeeId, string date)
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
if (workshopId < 1)
|
||||
{
|
||||
var resultError = new ErrorViewModel()
|
||||
{
|
||||
Message = "کارگاه شما یافت نشده است."
|
||||
};
|
||||
return Partial("../Error/_ErrorModal", resultError);
|
||||
}
|
||||
|
||||
|
||||
var result = _rollCallApplication.GetWorkshopEmployeeRollCallsForDate(workshopId, employeeId, date);
|
||||
|
||||
var name = _rollCallEmployeeApplication.GetByEmployeeIdAndWorkshopId(employeeId, workshopId);
|
||||
var command = new EmployeeRollCallsViewModel()
|
||||
{
|
||||
EmployeeFullName = name.EmployeeFullName,
|
||||
EmployeeId = employeeId,
|
||||
DateFa = date,
|
||||
RollCalls = result
|
||||
};
|
||||
|
||||
return Partial("ModalEditRollCall", command);
|
||||
}
|
||||
|
||||
public IActionResult OnPostManualCreateOrEdit(CreateOrEditEmployeeRollCall command)
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
if (workshopId < 1)
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = false,
|
||||
message = "هیچ کارگاهی یافت نشده است!",
|
||||
});
|
||||
|
||||
command.WorkshopId = workshopId;
|
||||
var result = _rollCallApplication.ManualEdit(command);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnPostRemoveEmployeeRollCallsInDate(long employeeId,string date)
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
if (workshopId < 1)
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = false,
|
||||
message = "هیچ کارگاهی یافت نشده است!",
|
||||
});
|
||||
|
||||
var result = _rollCallApplication.RemoveEmployeeRollCallsInDate(workshopId, employeeId, date);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,20 +25,55 @@
|
||||
|
||||
<div class="content-container">
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row p-2">
|
||||
<div class="col p-0 m-0 d-flex align-items-center justify-content-between">
|
||||
<div class="col">
|
||||
<div class="container-fluid">
|
||||
<div class="row p-2">
|
||||
<div class="col p-0 m-0 d-flex align-items-center justify-content-between">
|
||||
<div class="col d-flex align-items-center justify-content-start">
|
||||
<img src="~/AssetsClient/images/rollcall.png" alt="" class="img-fluid mx-1" width="45px" />
|
||||
<div>
|
||||
<h4 class="title d-flex align-items-center">ساعات حضور و غیاب جاری</h4>
|
||||
<div class="title d-flex align-items-center">@Model.WorkshopFullName <span class="ms-3 d-none d-md-flex">تاریخ امروز @Model.NowDate</span></div>
|
||||
</div>
|
||||
<div>
|
||||
<a asp-page="/Company/RollCall/Index" class="back-btn" type="button">
|
||||
<span>بازگشت</span>
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<a asp-page="/Company/RollCall/Index" class="back-btn" type="button">
|
||||
<span>بازگشت</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-block text-center d-md-none">تاریخ امروز @Model.NowDate</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row px-2">
|
||||
<div class="col-12 p-0 mb-2 d-none d-md-block">
|
||||
<div class="search-box card border-0">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
|
||||
<div class="col-2 position-relative">
|
||||
<input type="text" class="form-control" id="search" placeholder="جستجو ...">
|
||||
<button type="button" id="clear-search" class="close-btn-search d-none">
|
||||
<svg width="20" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@* <button class="btn-search btn-w-size btn-search-click text-nowrap d-flex align-items-center justify-content-center" id="searchBtn" type="submit">
|
||||
<span>جستجو</span>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
||||
<circle cx="11" cy="11" r="6" stroke="white" />
|
||||
<path d="M20 20L17 17" stroke="white" stroke-linecap="round" />
|
||||
</svg>
|
||||
</button>
|
||||
<a asp-page="/Company/RollCall/CaseHistory" class="btn-clear-filter btn-w-size text-nowrap d-flex align-items-center justify-content-center disable" id="filterRemove" style="padding: 7px 10px;">
|
||||
<span>حذف جستجو</span>
|
||||
</a> *@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-block text-center d-md-none">تاریخ امروز @Model.NowDate</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -50,7 +85,7 @@
|
||||
<div class="wrapper table-rollcall">
|
||||
<div class="rollcall-list Rtable Rtable--5cols Rtable--collapse px-1">
|
||||
|
||||
<div class="Rtable-row Rtable-row--head align-items-center d-flex sticky">
|
||||
<div class="Rtable-row Rtable-row--head align-items-center d-flex sticky" style="outline: 6px solid white !important;">
|
||||
<div class="Rtable-cell column-heading width1">ردیف</div>
|
||||
<div class="Rtable-cell column-heading width2">نام پرسنل</div>
|
||||
<div class="Rtable-cell column-heading width3">شماره پرسنلی</div>
|
||||
@@ -65,7 +100,7 @@
|
||||
{
|
||||
@foreach (var item in Model.RollCallViewModels.PresentEmployees)
|
||||
{
|
||||
<div class="Rtable-row align-items-center position-relative openAction @(Model.RollCallViewModels.PresentEmployees.Count() == 1 ? "radius" : "") @(index == 1 ? "firstRadius" : "") @(index == Model.RollCallViewModels.PresentEmployees.Count() ? "lastRadius" : "" ) @(item.RollCallTimesList.Last().EndDate != null ? "existTimeRollCall" : "")">
|
||||
<div class="Rtable-row align-items-center position-relative openAction employee-row @(Model.RollCallViewModels.PresentEmployees.Count() == 1 ? "radius" : "") @(index == 1 ? "firstRadius" : "") @(index == Model.RollCallViewModels.PresentEmployees.Count() ? "lastRadius" : "" ) @(item.RollCallTimesList.Last().EndDate != null ? "existTimeRollCall" : "")">
|
||||
<div class="Rtable-cell width1">
|
||||
<div class="Rtable-cell--heading d-none">
|
||||
ردیف
|
||||
@@ -79,7 +114,7 @@
|
||||
|
||||
<div class="Rtable-cell width2">
|
||||
<div class="Rtable-cell--heading d-none">نام پرسنل</div>
|
||||
<div class="Rtable-cell--content">
|
||||
<div class="Rtable-cell--content employee-name">
|
||||
@item.EmployeeFullName
|
||||
</div>
|
||||
</div>
|
||||
@@ -185,7 +220,7 @@
|
||||
{
|
||||
if (!item.HasLeave)
|
||||
{
|
||||
<div class="Rtable-row align-items-center position-relative table-rollcall-absent absenceItem">
|
||||
<div class="Rtable-row align-items-center position-relative table-rollcall-absent absenceItem absenceItem-row">
|
||||
<div class="Rtable-cell width1">
|
||||
<div class="Rtable-cell--heading d-none">
|
||||
ردیف
|
||||
@@ -199,7 +234,7 @@
|
||||
|
||||
<div class="Rtable-cell width2">
|
||||
<div class="Rtable-cell--heading d-none">نام پرسنل</div>
|
||||
<div class="Rtable-cell--content">
|
||||
<div class="Rtable-cell--content employee-name">
|
||||
@item.EmployeeFullName
|
||||
</div>
|
||||
</div>
|
||||
@@ -247,7 +282,7 @@
|
||||
{
|
||||
if (item.HasLeave)
|
||||
{
|
||||
<div class="Rtable-row align-items-center position-relative table-rollcall-leave leaveItem">
|
||||
<div class="Rtable-row align-items-center position-relative table-rollcall-leave leaveItem leaveItem-row">
|
||||
<div class="Rtable-cell width1">
|
||||
<div class="Rtable-cell--heading d-none">
|
||||
ردیف
|
||||
@@ -261,7 +296,7 @@
|
||||
|
||||
<div class="Rtable-cell width2">
|
||||
<div class="Rtable-cell--heading d-none">نام پرسنل</div>
|
||||
<div class="Rtable-cell--content">
|
||||
<div class="Rtable-cell--content employee-name">
|
||||
@item.EmployeeFullName
|
||||
</div>
|
||||
</div>
|
||||
@@ -319,11 +354,10 @@
|
||||
|
||||
@section Script {
|
||||
<script src="~/AssetsClient/js/dropdown.js?ver=@Version.StyleVersion"></script>
|
||||
<script src="~/assetsclient/pages/rollcall/js/currentday.js"></script>
|
||||
<script>
|
||||
|
||||
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
|
||||
var loadRollCallMoreAjax = "@Url.Page("./CurrentDay", "CurrentDayAjax")";
|
||||
var loadRollCallAbsentLeaveCountAjax = "@Url.Page("./CurrentDay", "CurrentAjaxCount")";
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/rollcall/js/currentday.js?ver=1235456"></script>
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@page
|
||||
@page
|
||||
@model ServiceHost.Areas.Client.Pages.Company.RollCall.EmployeeUploadPictureModel
|
||||
@{
|
||||
string clientVersion = _0_Framework.Application.Version.StyleVersion;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Security.Claims;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.Error;
|
||||
using CompanyManagment.App.Contracts.RollCallEmployee;
|
||||
@@ -9,58 +8,73 @@ using CompanyManagment.App.Contracts.Workshop;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using ServiceHost.Pages;
|
||||
using System.Diagnostics;
|
||||
using System.Security.Claims;
|
||||
|
||||
namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
{
|
||||
[Authorize]
|
||||
[Authorize]
|
||||
public class EmployeeUploadPictureModel : PageModel
|
||||
{
|
||||
public string WorkshopFullName;
|
||||
public RollCallEmployeeViewModel Employees;
|
||||
public bool HasEmployees;
|
||||
public int MaxPersonValid;
|
||||
public long WorkshopId;
|
||||
public int PageIndex;
|
||||
public string WorkshopFullName;
|
||||
public RollCallEmployeeViewModel Employees;
|
||||
public bool HasEmployees;
|
||||
public int MaxPersonValid;
|
||||
public long WorkshopId;
|
||||
public int PageIndex;
|
||||
|
||||
private readonly IWorkshopApplication _workshopApplication;
|
||||
private readonly IEmployeeApplication _employeeApplication;
|
||||
private readonly IRollCallEmployeeApplication _rollCallEmployeeApplication;
|
||||
private readonly IRollCallServiceApplication _rollCallServiceApplication;
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
private readonly IPasswordHasher _passwordHasher;
|
||||
private readonly IRollCallEmployeeStatusApplication _rollCallEmployeeStatusApplication;
|
||||
public EmployeeUploadPictureModel(IWorkshopApplication workshopApplication, IPasswordHasher passwordHasher, IRollCallEmployeeApplication rollCallEmployeeApplication, IRollCallServiceApplication rollCallServiceApplication, IWebHostEnvironment webHostEnvironment, IEmployeeApplication employeeApplication, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication)
|
||||
{
|
||||
_workshopApplication = workshopApplication;
|
||||
_passwordHasher = passwordHasher;
|
||||
_rollCallEmployeeApplication = rollCallEmployeeApplication;
|
||||
_rollCallServiceApplication = rollCallServiceApplication;
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
_employeeApplication = employeeApplication;
|
||||
_rollCallEmployeeStatusApplication = rollCallEmployeeStatusApplication;
|
||||
}
|
||||
|
||||
public IActionResult OnGet()
|
||||
private readonly IWorkshopApplication _workshopApplication;
|
||||
private readonly IEmployeeApplication _employeeApplication;
|
||||
private readonly IRollCallEmployeeApplication _rollCallEmployeeApplication;
|
||||
private readonly IRollCallServiceApplication _rollCallServiceApplication;
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
private readonly IPasswordHasher _passwordHasher;
|
||||
private readonly IRollCallEmployeeStatusApplication _rollCallEmployeeStatusApplication;
|
||||
public EmployeeUploadPictureModel(IWorkshopApplication workshopApplication, IPasswordHasher passwordHasher, IRollCallEmployeeApplication rollCallEmployeeApplication, IRollCallServiceApplication rollCallServiceApplication, IWebHostEnvironment webHostEnvironment, IEmployeeApplication employeeApplication, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication)
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
if (workshopId > 0)
|
||||
_workshopApplication = workshopApplication;
|
||||
_passwordHasher = passwordHasher;
|
||||
_rollCallEmployeeApplication = rollCallEmployeeApplication;
|
||||
_rollCallServiceApplication = rollCallServiceApplication;
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
_employeeApplication = employeeApplication;
|
||||
_rollCallEmployeeStatusApplication = rollCallEmployeeStatusApplication;
|
||||
}
|
||||
|
||||
public IActionResult OnGet()
|
||||
{
|
||||
var watch = new Stopwatch();
|
||||
watch.Start();
|
||||
Console.WriteLine("on get started");
|
||||
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
if (workshopId > 0)
|
||||
{
|
||||
var serviceActive = _rollCallServiceApplication.GetActiveServiceByWorkshopId(workshopId);
|
||||
Console.WriteLine("GetActiveServiceByWorkshopId >>>>>>" + watch.Elapsed);
|
||||
|
||||
if (serviceActive == null)
|
||||
return Redirect("/Client/Company/RollCall");
|
||||
|
||||
var workshop = _workshopApplication.GetWorkshopInfo(workshopId);
|
||||
WorkshopFullName = workshop.WorkshopFullName;
|
||||
var workshop = _workshopApplication.GetWorkshopInfo(workshopId);
|
||||
Console.WriteLine("GetWorkshopInfo >>>>>>" + watch.Elapsed);
|
||||
|
||||
MaxPersonValid = _rollCallServiceApplication.GetActiveServiceByWorkshopId(workshopId).MaxPersonValid;
|
||||
WorkshopFullName = workshop.WorkshopFullName;
|
||||
|
||||
MaxPersonValid = serviceActive.MaxPersonValid;
|
||||
|
||||
//var distinctEmployees = _rollCallEmployeeApplication.GetPersonnelRollCallListPaginate(new RollCallEmployeeSearchModel()
|
||||
//{
|
||||
|
||||
//});
|
||||
WorkshopId = workshopId;
|
||||
PageIndex = 0;
|
||||
|
||||
HasEmployees = _rollCallEmployeeApplication.HasEmployees(workshopId);
|
||||
Console.WriteLine("finish >>>>>>" + watch.Elapsed);
|
||||
|
||||
return Page();
|
||||
return Page();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -70,23 +84,28 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
|
||||
public IActionResult OnGetEmployeeUploadDataAjax(int pageIndex, string searchName)
|
||||
{
|
||||
var watch = new Stopwatch();
|
||||
watch.Start();
|
||||
Console.WriteLine("started");
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
if (workshopId > 0)
|
||||
{
|
||||
MaxPersonValid = _rollCallServiceApplication.GetActiveServiceByWorkshopId(workshopId).MaxPersonValid;
|
||||
|
||||
Console.WriteLine("GetActiveServiceByWorkshopId >>>>>>" + watch.Elapsed);
|
||||
var distinctEmployees = _rollCallEmployeeApplication.GetPersonnelRollCallListPaginate(new RollCallEmployeeSearchModel()
|
||||
{
|
||||
WorkshopId = workshopId,
|
||||
PageIndex = pageIndex,
|
||||
Name = searchName
|
||||
});
|
||||
Console.WriteLine("GetPersonnelRollCallListPaginate >>>>>>" + watch.Elapsed);
|
||||
|
||||
Employees = new RollCallEmployeeViewModel
|
||||
{
|
||||
PersonnelInfoViewModels = distinctEmployees
|
||||
};
|
||||
|
||||
Console.WriteLine("employee >>>>>>" + watch.Elapsed);
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = true,
|
||||
@@ -104,91 +123,90 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
}
|
||||
}
|
||||
|
||||
public IActionResult OnGetLoadInfoCount()
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
if (workshopId <= 0)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = false,
|
||||
message = "کارگاهی یافت نشد"
|
||||
});
|
||||
}
|
||||
public IActionResult OnGetLoadInfoCount()
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
if (workshopId <= 0)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = false,
|
||||
message = "کارگاهی یافت نشد"
|
||||
});
|
||||
}
|
||||
|
||||
var activeService = _rollCallServiceApplication.GetActiveServiceByWorkshopId(workshopId);
|
||||
var maxPersonValid = activeService.MaxPersonValid;
|
||||
var activeService = _rollCallServiceApplication.GetActiveServiceByWorkshopId(workshopId);
|
||||
var maxPersonValid = activeService.MaxPersonValid;
|
||||
|
||||
var employees = _rollCallEmployeeApplication.GetPersonnelRollCallListAll(workshopId);
|
||||
|
||||
var activeCount = employees.Count(e => e.IsActiveString == "true");
|
||||
var inactiveCount = employees.Count(e => e.IsActiveString == "false");
|
||||
var employeesCount = _rollCallEmployeeApplication.GetActiveAndDeActiveRollCallEmployees(workshopId);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = true,
|
||||
maxPersonValid = maxPersonValid == -1 ? "نامحدود" : maxPersonValid.ToString(),
|
||||
isTrueActiveCount = activeCount,
|
||||
isFalseActiveCount = inactiveCount,
|
||||
message = "موفق"
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetCheckModalTakeImage()
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = true,
|
||||
maxPersonValid = maxPersonValid == -1 ? "نامحدود" : maxPersonValid.ToString(),
|
||||
isTrueActiveCount = employeesCount.activeEmployees,
|
||||
isFalseActiveCount = employeesCount.deActiveEmployees,
|
||||
message = "موفق"
|
||||
});
|
||||
}
|
||||
|
||||
if (workshopId <= 0)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = false,
|
||||
message = "کارگاه شما یافت نشده است"
|
||||
});
|
||||
}
|
||||
public IActionResult OnGetCheckModalTakeImage()
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
|
||||
var plan = _rollCallServiceApplication.GetActiveServiceByWorkshopId(workshopId);
|
||||
if (workshopId <= 0)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = false,
|
||||
message = "کارگاه شما یافت نشده است"
|
||||
});
|
||||
}
|
||||
|
||||
if (plan == null)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = false,
|
||||
message = "شما سرویس خریداری شده ندارید"
|
||||
});
|
||||
}
|
||||
var plan = _rollCallServiceApplication.GetActiveServiceByWorkshopId(workshopId);
|
||||
|
||||
if (plan.IsActiveString != "true")
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = false,
|
||||
message = "سرویس شما فعال نیست"
|
||||
});
|
||||
}
|
||||
if (plan == null)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = false,
|
||||
message = "شما سرویس خریداری شده ندارید"
|
||||
});
|
||||
}
|
||||
|
||||
var maxValid = plan.MaxPersonValid;
|
||||
if (plan.IsActiveString != "true")
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = false,
|
||||
message = "سرویس شما فعال نیست"
|
||||
});
|
||||
}
|
||||
|
||||
if (maxValid == -1 || _rollCallEmployeeApplication.activedPerson(workshopId) < maxValid)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = true,
|
||||
message = "موفق"
|
||||
});
|
||||
}
|
||||
var maxValid = plan.MaxPersonValid;
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = false,
|
||||
message = "محدودیت افزودن پرسنل"
|
||||
});
|
||||
}
|
||||
if (maxValid == -1 || _rollCallEmployeeApplication.activedPerson(workshopId) < maxValid)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = true,
|
||||
message = "موفق"
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetModalTakeImages(long employeeId)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = false,
|
||||
message = "محدودیت افزودن پرسنل"
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetModalTakeImages(long employeeId)
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
if (workshopId > 0)
|
||||
@@ -202,60 +220,61 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
|
||||
var employeeDetails = _employeeApplication.GetDetails(employeeId);
|
||||
|
||||
string employeeName = employeeWorkshopInfo?.EmployeeFullName ?? employeeDetails.EmployeeFullName;
|
||||
string employeeName = string.Empty;
|
||||
if (employeeDetails != null)
|
||||
employeeName = employeeDetails.EmployeeFullName;
|
||||
|
||||
string pic1 = "";
|
||||
string pic2 = "";
|
||||
if (hasPicture)
|
||||
{
|
||||
string path1 = $"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}\\{1}.jpg";
|
||||
string path2 = $"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}\\{2}.jpg";
|
||||
|
||||
string pic1 = "";
|
||||
string pic2 = "";
|
||||
if (hasPicture)
|
||||
{
|
||||
string path1 = $"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}\\{1}.jpg";
|
||||
string path2 = $"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}\\{2}.jpg";
|
||||
if (System.IO.File.Exists(path1))
|
||||
{
|
||||
byte[] fileContent1 = System.IO.File.ReadAllBytes(path1);
|
||||
pic1 = Convert.ToBase64String(fileContent1);
|
||||
}
|
||||
|
||||
if (System.IO.File.Exists(path1))
|
||||
{
|
||||
byte[] fileContent1 = System.IO.File.ReadAllBytes(path1);
|
||||
pic1 = Convert.ToBase64String(fileContent1);
|
||||
}
|
||||
if (System.IO.File.Exists(path2))
|
||||
{
|
||||
byte[] fileContent2 = System.IO.File.ReadAllBytes(path2);
|
||||
pic2 = Convert.ToBase64String(fileContent2);
|
||||
}
|
||||
|
||||
if (System.IO.File.Exists(path2))
|
||||
{
|
||||
byte[] fileContent2 = System.IO.File.ReadAllBytes(path2);
|
||||
pic2 = Convert.ToBase64String(fileContent2);
|
||||
}
|
||||
|
||||
//byte[] fileContent1 = System.IO.File.ReadAllBytes($"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}\\{1}.jpg");
|
||||
//pic1 = Convert.ToBase64String(fileContent1);
|
||||
//byte[] fileContent2 = System.IO.File.ReadAllBytes($"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}\\{2}.jpg");
|
||||
//pic2 = Convert.ToBase64String(fileContent2);
|
||||
}
|
||||
|
||||
var res = new TakePictureModel()
|
||||
{
|
||||
HasPicture = hasPicture,
|
||||
EmployeeId = employeeId,
|
||||
WorkshopId = workshopId,
|
||||
Name = employeeName,
|
||||
Pic1 = pic1,
|
||||
Pic2 = pic2,
|
||||
};
|
||||
//byte[] fileContent1 = System.IO.File.ReadAllBytes($"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}\\{1}.jpg");
|
||||
//pic1 = Convert.ToBase64String(fileContent1);
|
||||
//byte[] fileContent2 = System.IO.File.ReadAllBytes($"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}\\{2}.jpg");
|
||||
//pic2 = Convert.ToBase64String(fileContent2);
|
||||
}
|
||||
|
||||
var res = new TakePictureModel()
|
||||
{
|
||||
HasPicture = hasPicture,
|
||||
EmployeeId = employeeId,
|
||||
WorkshopId = workshopId,
|
||||
Name = employeeName,
|
||||
Pic1 = pic1,
|
||||
Pic2 = pic2,
|
||||
};
|
||||
|
||||
|
||||
return Partial("ModalTakeImages", res);
|
||||
}
|
||||
else
|
||||
{
|
||||
var resultError = new ErrorViewModel()
|
||||
{
|
||||
IsSuccedded = false,
|
||||
Message = "هیج کارگاهی یافت نشد"
|
||||
};
|
||||
return Partial("../Error/_ErrorModal", resultError);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var resultError = new ErrorViewModel()
|
||||
{
|
||||
IsSuccedded = false,
|
||||
Message = "هیج کارگاهی یافت نشد"
|
||||
};
|
||||
return Partial("../Error/_ErrorModal", resultError);
|
||||
}
|
||||
}
|
||||
|
||||
public IActionResult OnPostTakePicture(string base64pic1, string base64pic2, long workshopId, long employeeId)
|
||||
{
|
||||
public IActionResult OnPostTakePicture(string base64pic1, string base64pic2, long workshopId, long employeeId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var directoryPath = $"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}";
|
||||
@@ -285,14 +304,14 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
HasUploadedImage = "true",
|
||||
};
|
||||
result = _rollCallEmployeeApplication.Create(createCommand);
|
||||
_rollCallEmployeeStatusApplication.Create(new CreateRollCallEmployeeStatus()
|
||||
{ RollCallEmployeeId = result.SendId });
|
||||
}
|
||||
_rollCallEmployeeStatusApplication.Create(new CreateRollCallEmployeeStatus()
|
||||
{ RollCallEmployeeId = result.SendId });
|
||||
}
|
||||
else
|
||||
{
|
||||
result = _rollCallEmployeeApplication.UploadedImage(employeeId, workshopId);
|
||||
result = _rollCallEmployeeApplication.UploadedImage(employeeId, workshopId);
|
||||
}
|
||||
|
||||
|
||||
if (result.IsSuccedded)
|
||||
{
|
||||
return new JsonResult(new
|
||||
@@ -317,121 +336,152 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
return new JsonResult(new
|
||||
{
|
||||
IsSuccedded = false,
|
||||
Message = e.Message,
|
||||
});
|
||||
Message = e.Message,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void CreateImageFromBase64(string base64, string imagePathWithExtension)
|
||||
{
|
||||
var subBase64 = base64.Substring(base64.LastIndexOf(',') + 1);
|
||||
byte[] bytes = Convert.FromBase64String(subBase64);
|
||||
System.IO.File.WriteAllBytes(imagePathWithExtension, bytes);
|
||||
}
|
||||
|
||||
public void CreateImageFromBase64(string base64, string imagePathWithExtension)
|
||||
{
|
||||
var subBase64 = base64.Substring(base64.LastIndexOf(',') + 1);
|
||||
byte[] bytes = Convert.FromBase64String(subBase64);
|
||||
System.IO.File.WriteAllBytes(imagePathWithExtension, bytes);
|
||||
}
|
||||
public IActionResult OnPostActivePersonnel(long id)
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
if (workshopId > 0)
|
||||
{
|
||||
var hasRollCallEmployee = _rollCallEmployeeApplication.GetDetails(id);
|
||||
|
||||
if (hasRollCallEmployee == null)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = false,
|
||||
message = "برای این پرسنل، هنوز هیچ عکسی آپلود نشده است. بعد از آپلود عکس بطور خودکار فعال خواهد شد",
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hasRollCallEmployee.HasUploadedImage == "false")
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = false,
|
||||
message = "برای این پرسنل، هنوز هیچ عکسی آپلود نشده است. بعد از آپلود عکس بطور خودکار فعال خواهد شد",
|
||||
});
|
||||
|
||||
var result = _rollCallEmployeeApplication.Active(hasRollCallEmployee.Id);
|
||||
if (result.IsSuccedded)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
}
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = false,
|
||||
message = "خطایی رخ آمده است",
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = false,
|
||||
message = "کارگاه شما یافت نشد",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public IActionResult OnPostDeActivePersonnel(long id)
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
if (workshopId > 0)
|
||||
{
|
||||
var result = _rollCallEmployeeApplication.DeActive(id);
|
||||
if (result.IsSuccedded)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = false,
|
||||
message = "کارگاه شما یافت نشد",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public IActionResult OnGetLoadFirstImage(long employeeId, long workshopId)
|
||||
{
|
||||
var directoryPath = $"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}";
|
||||
var imageDir = Path.Combine(directoryPath, "1.jpg");
|
||||
return PhysicalFile(imageDir, "image/jpeg");
|
||||
}
|
||||
|
||||
public IActionResult OnGetLoadSecondImage(long employeeId, long workshopId)
|
||||
{
|
||||
var directoryPath = $"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}";
|
||||
var imageDir = Path.Combine(directoryPath, "2.jpg");
|
||||
return PhysicalFile(imageDir, "image/jpeg");
|
||||
}
|
||||
|
||||
public IActionResult OnGetModalChangeName(long employeeId)
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
if (workshopId > 0)
|
||||
{
|
||||
var hasRollCallEmployee = _rollCallEmployeeApplication.GetDetails(id);
|
||||
var command = _rollCallEmployeeApplication.GetByEmployeeIdAndWorkshopId(employeeId, workshopId);
|
||||
|
||||
if (hasRollCallEmployee == null)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = false,
|
||||
message = "برای این پرسنل، هنوز هیچ عکسی آپلود نشده است. بعد از آپلود عکس بطور خودکار فعال خواهد شد",
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hasRollCallEmployee.HasUploadedImage == "false")
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = false,
|
||||
message = "برای این پرسنل، هنوز هیچ عکسی آپلود نشده است. بعد از آپلود عکس بطور خودکار فعال خواهد شد",
|
||||
});
|
||||
|
||||
var result = _rollCallEmployeeApplication.Active(hasRollCallEmployee.Id);
|
||||
if (result.IsSuccedded)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
}
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = false,
|
||||
message = "خطایی رخ آمده است",
|
||||
});
|
||||
return Partial("ModalChangeName", command);
|
||||
}
|
||||
else
|
||||
{
|
||||
return new JsonResult(new
|
||||
var resultError = new ErrorViewModel()
|
||||
{
|
||||
isSuccedded = false,
|
||||
message = "کارگاه شما یافت نشد",
|
||||
});
|
||||
IsSuccedded = false,
|
||||
Message = "هیج کارگاهی یافت نشد"
|
||||
};
|
||||
return Partial("../Error/_ErrorModal", resultError);
|
||||
}
|
||||
}
|
||||
|
||||
public IActionResult OnPostDeActivePersonnel(long id)
|
||||
public IActionResult OnPostChangeName(long rollCallEmployeeId, string fName, string lName)
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
if (workshopId > 0)
|
||||
var result = _rollCallEmployeeApplication.ChangeEmployeeRollCallName(rollCallEmployeeId, fName, lName);
|
||||
return new JsonResult(new
|
||||
{
|
||||
var result = _rollCallEmployeeApplication.DeActive(id);
|
||||
if (result.IsSuccedded)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = false,
|
||||
message = "کارگاه شما یافت نشد",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public IActionResult OnGetLoadFirstImage(long employeeId, long workshopId)
|
||||
{
|
||||
var directoryPath = $"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}";
|
||||
var imageDir = Path.Combine(directoryPath, "1.jpg");
|
||||
return PhysicalFile(imageDir, "image/jpeg");
|
||||
}
|
||||
|
||||
public IActionResult OnGetLoadSecondImage(long employeeId, long workshopId)
|
||||
{
|
||||
var directoryPath = $"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}";
|
||||
var imageDir = Path.Combine(directoryPath, "2.jpg");
|
||||
return PhysicalFile(imageDir, "image/jpeg");
|
||||
isSuccedded = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
@model CompanyManagment.App.Contracts.RollCall.CreateOrEditEmployeeRollCall
|
||||
@{
|
||||
string clientVersion = _0_Framework.Application.Version.StyleVersion;
|
||||
<link rel="stylesheet" href="~/AssetsClient/css/rollcall-package.css?ver=@clientVersion">
|
||||
<link href="~/AssetsClient/css/select2.css" rel="stylesheet" />
|
||||
<style>
|
||||
.errored {
|
||||
animation: shake 300ms;
|
||||
color: #eb3434 !important;
|
||||
background-color: #fef2f2 !important;
|
||||
border: 1px solid #eb3434 !important;
|
||||
}
|
||||
|
||||
.modal-dialog, .modal-content {
|
||||
height: 420px;
|
||||
}
|
||||
|
||||
.timeWorkTitle {
|
||||
color: #5C5C5C;
|
||||
font-weight: 600;
|
||||
font-size: 12px;
|
||||
margin: auto 0 auto 6px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.groupBox {
|
||||
background-color: #F5F5F5;
|
||||
border-radius: 10px;
|
||||
border: 1px solid #E7E7E7;
|
||||
padding: 6px;
|
||||
margin: 6px 3px;
|
||||
}
|
||||
|
||||
.groupBox .form-control {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.groupBox .form-control::placeholder {
|
||||
color: #bfbfbf;
|
||||
opacity: 1; /* Firefox */
|
||||
}
|
||||
|
||||
.groupBox .form-control::-ms-input-placeholder { /* Edge 12-18 */
|
||||
color: #bfbfbf;
|
||||
}
|
||||
|
||||
.btnAddTimeWork {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #84CC16;
|
||||
border-radius: 5px;
|
||||
color: #ffffff;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
.btnRemoveTimeWork {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #F87171;
|
||||
border-radius: 7px;
|
||||
padding: 3px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.ShowMessage {
|
||||
position: absolute;
|
||||
background: #dfdfdf;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
right: 0;
|
||||
height: 100%;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.heightControll {
|
||||
height: 190px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
<form role="form" method="post" name="create-form" id="create-form" autocomplete="off">
|
||||
|
||||
<div class="modal-content">
|
||||
<div class="modal-header d-block text-center mb-2">
|
||||
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
<h4 class="textListTitle">افزودن ساعت حضور و غیاب</h4>
|
||||
<h6 class="textListTitle" id="modalWorkshopFullname"></h6>
|
||||
</div>
|
||||
|
||||
<div class="modal-body py-0">
|
||||
<div class="container p-0 m-0">
|
||||
<div class="row">
|
||||
<div class="col-12 my-1">
|
||||
<div class="select-alert">
|
||||
<select class="form-select select2Option" aria-label="انتخاب پرسنل ..." name="Command.EmployeeId" id="employeeSelectAddModal">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 my-1">
|
||||
<input class="form-control form-control-date text-center" name="Command.DateFa" placeholder="تاریخ" style="direction: ltr" />
|
||||
</div>
|
||||
|
||||
<div class="heightControll">
|
||||
<div class="col-12" id="appendChildTimeWorkHtml">
|
||||
<div class="groupBox">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-2 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">
|
||||
نوبت اول
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.RollCallRecords[0].StartTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.RollCallRecords[0].EndTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
|
||||
<div class="col-2 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center justify-content-center w-100 my-2">
|
||||
<button type="button" class="btnAddTimeWork">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white" />
|
||||
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round" />
|
||||
<path d="M13.75 11L8.25 11" stroke="white" stroke-linecap="round" />
|
||||
</svg>
|
||||
<div class="mx-1 btnAppendChildTimeWork">افزودن نوبت دوم</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="ShowMessage d-none">
|
||||
<p class="m-0" id="ShowSettingMessage"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<div class="container m-0">
|
||||
<div class="row">
|
||||
<div class="col-6 text-end">
|
||||
<button type="button" class="btn-cancel2 d-flex justify-content-center w-100" id="prev-step" data-bs-dismiss="modal" aria-label="Close">انصراف</button>
|
||||
</div>
|
||||
<div class="col-6 text-start">
|
||||
<button type="button" class="btn-register w-100 position-relative" id="next-step">
|
||||
<span>ثبت</span>
|
||||
<div class="spinner-loading loading" style="display: none;">
|
||||
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script src="~/assetsclient/libs/jalaali-js/jalaali.js"></script>
|
||||
<script src="~/assetsclient/libs/cleave/cleave.min.js"></script>
|
||||
|
||||
<script>
|
||||
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
|
||||
var saveRollCallWorkTimeAjax = `@Url.Page("./CaseHistory", "ManualCreateOrEdit")`;
|
||||
var loadByEmployeeRollCallWorkTimeAjax = `@Url.Page("./CaseHistory", "ManualCreateOrEdit")`;
|
||||
var employeeListAjax = `@Url.Page("./CaseHistory", "EmployeeList")`;
|
||||
|
||||
var checkEmployeeData = `@Url.Page("./CaseHistory", "CheckEmployeeData")`;
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/rollcall/js/ModalAddRollCall.js?ver=@clientVersion"></script>
|
||||
@@ -0,0 +1,92 @@
|
||||
@model CompanyManagment.App.Contracts.RollCallEmployee.RollCallEmployeeViewModel
|
||||
|
||||
@{
|
||||
string clientVersion = _0_Framework.Application.Version.StyleVersion;
|
||||
<link href="~/AssetsClient/css/select2.css?ver=@clientVersion" rel="stylesheet" />
|
||||
|
||||
<style>
|
||||
.errored {
|
||||
animation: shake 300ms;
|
||||
color: #eb3434 !important;
|
||||
background-color: #fef2f2 !important;
|
||||
border: 1px solid #eb3434 !important;
|
||||
}
|
||||
|
||||
.textLFontColor,
|
||||
.form-control {
|
||||
color: #797979;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.textLFontColor span {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.btnCreateNew {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
background-color: #84CC16;
|
||||
color: #FFFFFF;
|
||||
border-radius: 8px;
|
||||
padding: 10px 70px;
|
||||
}
|
||||
|
||||
.btnCreateNew:hover {
|
||||
background-color: #5f9213;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
<form role="form" method="post" name="create-form" id="create-form" autocomplete="off">
|
||||
|
||||
<div class="modal-content">
|
||||
<div class="modal-header pb-0 d-flex align-items-center justify-content-center text-center">
|
||||
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
<div>
|
||||
<p class="m-0 pdHeaderTitle1">تغییر نام پرسنل</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<input type="hidden" name="rollCallEmployeeId" id="rollCallEmployeeId" value="@Model.Id" />
|
||||
<div class="col-12 my-1">
|
||||
<input class="form-control" name="fName" id="EmployeeFName" value="@Model.EmployeeFName" placeholder="نام" />
|
||||
</div>
|
||||
<div class="col-12 my-1">
|
||||
<input class="form-control" name="lName" id="EmployeeLName" value="@Model.EmployeeLName" placeholder="نام خانوادگی" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer d-block">
|
||||
<div class="container m-0">
|
||||
<div class="row">
|
||||
<div class="col-6 text-end">
|
||||
<button type="button" class="btn-cancel2 w-100 d-flex align-items-center justify-content-center" data-bs-dismiss="modal" aria-label="Close">انصراف</button>
|
||||
</div>
|
||||
<div class="col-6 text-start">
|
||||
<button type="button" class="btnCreateNew w-100 d-flex align-items-center justify-content-center position-relative" id="createData">
|
||||
<span>تغییر</span>
|
||||
<div class="spinner-loading loading" style="display: none;">
|
||||
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<script src="~/assetsclient/js/site.js?ver=@clientVersion"></script>
|
||||
<script>
|
||||
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
|
||||
var saveChangeNameAjax = `@Url.Page("./EmployeeUploadPicture", "ChangeName")`;
|
||||
var employeeId = Number(@Model.EmployeeId);
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/RollCall/js/ModalChangeName.js?ver=@clientVersion"></script>
|
||||
@@ -0,0 +1,318 @@
|
||||
@model CompanyManagment.App.Contracts.RollCall.EmployeeRollCallsViewModel
|
||||
@{
|
||||
string clientVersion = _0_Framework.Application.Version.StyleVersion;
|
||||
var index = 0;
|
||||
var count = Model.RollCalls.Count;
|
||||
string countString;
|
||||
string txtString;
|
||||
|
||||
<link rel="stylesheet" href="~/AssetsClient/css/rollcall-package.css?ver=@clientVersion">
|
||||
<link href="~/AssetsClient/css/select2.css" rel="stylesheet" />
|
||||
<style>
|
||||
.errored {
|
||||
animation: shake 300ms;
|
||||
color: #eb3434 !important;
|
||||
background-color: #fef2f2 !important;
|
||||
border: 1px solid #eb3434 !important;
|
||||
}
|
||||
|
||||
.modal-dialog, .modal-content {
|
||||
height: 420px;
|
||||
}
|
||||
|
||||
.timeWorkTitle {
|
||||
color: #5C5C5C;
|
||||
font-weight: 600;
|
||||
font-size: 12px;
|
||||
margin: auto 0 auto 6px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.groupBox {
|
||||
background-color: #F5F5F5;
|
||||
border-radius: 10px;
|
||||
border: 1px solid #E7E7E7;
|
||||
padding: 6px;
|
||||
margin: 6px 3px;
|
||||
}
|
||||
|
||||
.groupBox .form-control {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.groupBox .form-control::placeholder {
|
||||
color: #bfbfbf;
|
||||
opacity: 1; /* Firefox */
|
||||
}
|
||||
|
||||
.groupBox .form-control::-ms-input-placeholder { /* Edge 12-18 */
|
||||
color: #bfbfbf;
|
||||
}
|
||||
|
||||
.btnAddTimeWork {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #84CC16;
|
||||
border-radius: 5px;
|
||||
color: #ffffff;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
.btnRemoveTimeWork {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #F87171;
|
||||
border-radius: 7px;
|
||||
padding: 3px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.ShowMessage {
|
||||
position: absolute;
|
||||
background: #dfdfdf;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
right: 0;
|
||||
height: 100%;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.heightControll {
|
||||
height: 190px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
<form role="form" method="post" name="create-form" id="create-form" autocomplete="off">
|
||||
|
||||
<div class="modal-content">
|
||||
<div class="modal-header d-block text-center mb-2">
|
||||
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
<h4 class="textListTitle">ویرایش ساعت حضور و غیاب</h4>
|
||||
<h6 class="textListTitle" id="modalWorkshopFullname"></h6>
|
||||
</div>
|
||||
|
||||
<div class="modal-body py-0">
|
||||
<div class="container p-0 m-0">
|
||||
<div class="row">
|
||||
<div class="col-12 my-1">
|
||||
<div class="select-alert">
|
||||
<input type="hidden" name="Command.EmployeeId" value="@Model.EmployeeId" />
|
||||
<input class="form-control disable" value="@Model.EmployeeFullName" placeholder="نام پرسنل" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 my-1">
|
||||
<input type="hidden" name="Command.DateFa" value="@Model.DateFa" />
|
||||
<input class="form-control form-control-date text-center disable" value="@Model.DateFa" placeholder="تاریخ" style="direction: ltr" />
|
||||
</div>
|
||||
|
||||
<div class="heightControll">
|
||||
<div class="col-12" id="appendChildTimeWorkHtml">
|
||||
@if (@Model.RollCalls.Count > 0)
|
||||
{
|
||||
@foreach (var item in Model.RollCalls)
|
||||
{
|
||||
@switch (index)
|
||||
{
|
||||
case 1:
|
||||
txtString = "دوم";
|
||||
break;
|
||||
case 2:
|
||||
txtString = "سوم";
|
||||
break;
|
||||
case 3:
|
||||
txtString = "چهارم";
|
||||
break;
|
||||
case 4:
|
||||
txtString = "پنجم";
|
||||
break;
|
||||
case 5:
|
||||
txtString = "ششم";
|
||||
break;
|
||||
case 6:
|
||||
txtString = "هفتم";
|
||||
break;
|
||||
case 7:
|
||||
txtString = "هشتم";
|
||||
break;
|
||||
case 8:
|
||||
txtString = "نهم";
|
||||
break;
|
||||
case 9:
|
||||
txtString = "دهم";
|
||||
break;
|
||||
default:
|
||||
txtString = "اول";
|
||||
break;
|
||||
}
|
||||
|
||||
<div class="groupBox">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-2 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">
|
||||
نوبت @txtString
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.RollCallRecords[@index].StartTime" placeholder="00:00" value="@item.StartTimeString" style="direction: ltr;">
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.RollCallRecords[@index].EndTime" placeholder="00:00" value="@item.EndTimeString" style="direction: ltr;">
|
||||
</div>
|
||||
@if (index == 0)
|
||||
{
|
||||
<div class="col-2 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="col-2 d-flex align-items-center justify-content-end">
|
||||
<button type="button" class="btnRemoveTimeWork">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white" />
|
||||
<path d="M6.875 11H15.125" stroke="white" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
index++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="groupBox">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-2 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">
|
||||
نوبت اول
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.RollCallRecords[0].StartTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.RollCallRecords[0].EndTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
|
||||
<div class="col-2 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center justify-content-center w-100 my-2">
|
||||
<button type="button" class="btnAddTimeWork">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white" />
|
||||
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round" />
|
||||
<path d="M13.75 11L8.25 11" stroke="white" stroke-linecap="round" />
|
||||
</svg>
|
||||
|
||||
|
||||
@switch (count)
|
||||
{
|
||||
case 0:
|
||||
countString = "دوم";
|
||||
break;
|
||||
case 1:
|
||||
countString = "دوم";
|
||||
break;
|
||||
case 2:
|
||||
countString = "سوم";
|
||||
break;
|
||||
case 3:
|
||||
countString = "چهارم";
|
||||
break;
|
||||
case 4:
|
||||
countString = "پنجم";
|
||||
break;
|
||||
case 5:
|
||||
countString = "ششم";
|
||||
break;
|
||||
case 6:
|
||||
countString = "هفتم";
|
||||
break;
|
||||
case 7:
|
||||
countString = "هشتم";
|
||||
break;
|
||||
case 8:
|
||||
countString = "نهم";
|
||||
break;
|
||||
case 9:
|
||||
countString = "دهم";
|
||||
break;
|
||||
default:
|
||||
countString = "اول";
|
||||
break;
|
||||
}
|
||||
|
||||
<div class="mx-1 btnAppendChildTimeWork">افزودن نوبت @countString</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="ShowMessage d-none">
|
||||
<p class="m-0" id="ShowSettingMessage"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<div class="container m-0">
|
||||
<div class="row">
|
||||
<div class="col-6 text-end">
|
||||
<button type="button" class="btn-cancel2 d-flex justify-content-center w-100" id="prev-step" data-bs-dismiss="modal" aria-label="Close">انصراف</button>
|
||||
</div>
|
||||
<div class="col-6 text-start">
|
||||
<button type="button" class="btn-register w-100 position-relative" id="next-step">
|
||||
<span>ثبت</span>
|
||||
<div class="spinner-loading loading" style="display: none;">
|
||||
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script src="~/assetsclient/libs/jalaali-js/jalaali.js"></script>
|
||||
<script src="~/assetsclient/libs/cleave/cleave.min.js"></script>
|
||||
|
||||
<script>
|
||||
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
|
||||
var saveRollCallWorkTimeAjax = `@Url.Page("./CaseHistory", "ManualCreateOrEdit")`;
|
||||
var loadByEmployeeRollCallWorkTimeAjax = `@Url.Page("./CaseHistory", "ManualCreateOrEdit")`;
|
||||
var employeeListAjax = `@Url.Page("./CaseHistory", "EmployeeList")`;
|
||||
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/rollcall/js/ModalEditRollCall.js?ver=@clientVersion"></script>
|
||||
@@ -90,7 +90,7 @@
|
||||
</div>
|
||||
@if (Model.HasApkToDownload)
|
||||
{
|
||||
<div class="col-12 col-sm-12 col-md-6 col-lg-3 col-xl-3 col-xxl-3 mt-3 d-md-none d-block">
|
||||
<div class="col-12 col-sm-12 col-md-6 col-lg-3 col-xl-3 col-xxl-3 mt-3 d-md-none d-block" id="downloadAppDashboard">
|
||||
<div class="card p-0">
|
||||
<div class="card-section-btn bg-white">
|
||||
<div class="content btn-group">
|
||||
@@ -102,7 +102,7 @@
|
||||
<path d="m3.751.61 13.124 7.546-2.813 2.813zm-2.719-.61 12.047 12-12.046 12c-.613-.271-1.033-.874-1.033-1.575 0-.023 0-.046.001-.068v.003-20.719c-.001-.019-.001-.042-.001-.065 0-.701.42-1.304 1.022-1.571l.011-.004zm19.922 10.594c.414.307.679.795.679 1.344 0 .022 0 .043-.001.065v-.003c.004.043.007.094.007.145 0 .516-.25.974-.636 1.258l-.004.003-2.813 1.593-3.046-2.999 3.047-3.047zm-17.203 12.796 10.312-10.359 2.813 2.813z"></path>
|
||||
</g>
|
||||
</svg>
|
||||
<p class="btn-title text-nowrap m-0">دانلود اپلیکشن</p>
|
||||
<p class="btn-title text-nowrap m-0">دانلود نرم افزار مخصوص موبایل</p>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
BIN
ServiceHost/Faces/170/30368/1.jpg
Normal file
|
After Width: | Height: | Size: 286 KiB |
BIN
ServiceHost/Faces/170/30368/2.jpg
Normal file
|
After Width: | Height: | Size: 283 KiB |
BIN
ServiceHost/Faces/170/30368/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
ServiceHost/Faces/170/30369/1.jpg
Normal file
|
After Width: | Height: | Size: 288 KiB |
BIN
ServiceHost/Faces/170/30369/2.jpg
Normal file
|
After Width: | Height: | Size: 313 KiB |
BIN
ServiceHost/Faces/170/30369/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
ServiceHost/Faces/170/30370/1.jpg
Normal file
|
After Width: | Height: | Size: 298 KiB |
BIN
ServiceHost/Faces/170/30370/2.jpg
Normal file
|
After Width: | Height: | Size: 306 KiB |
BIN
ServiceHost/Faces/170/30370/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
ServiceHost/Faces/170/30374/1.jpg
Normal file
|
After Width: | Height: | Size: 279 KiB |
BIN
ServiceHost/Faces/170/30374/2.jpg
Normal file
|
After Width: | Height: | Size: 288 KiB |
BIN
ServiceHost/Faces/170/30374/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
ServiceHost/Faces/170/30376/1.jpg
Normal file
|
After Width: | Height: | Size: 210 KiB |
BIN
ServiceHost/Faces/170/30376/2.jpg
Normal file
|
After Width: | Height: | Size: 211 KiB |
BIN
ServiceHost/Faces/170/30376/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
ServiceHost/Faces/170/3396/1.jpg
Normal file
|
After Width: | Height: | Size: 439 KiB |
BIN
ServiceHost/Faces/170/3396/2.jpg
Normal file
|
After Width: | Height: | Size: 436 KiB |
BIN
ServiceHost/Faces/170/3396/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 6.5 KiB |
BIN
ServiceHost/Faces/170/4023/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
BIN
ServiceHost/Faces/170/4024/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
ServiceHost/Faces/170/4027/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
ServiceHost/Faces/170/4029/1.jpg
Normal file
|
After Width: | Height: | Size: 256 KiB |
BIN
ServiceHost/Faces/170/4029/2.jpg
Normal file
|
After Width: | Height: | Size: 232 KiB |
BIN
ServiceHost/Faces/170/4029/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
ServiceHost/Faces/170/4031/1.jpg
Normal file
|
After Width: | Height: | Size: 320 KiB |
BIN
ServiceHost/Faces/170/4031/2.jpg
Normal file
|
After Width: | Height: | Size: 350 KiB |
BIN
ServiceHost/Faces/170/4031/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
ServiceHost/Faces/170/4034/1.jpg
Normal file
|
After Width: | Height: | Size: 232 KiB |
BIN
ServiceHost/Faces/170/4034/2.jpg
Normal file
|
After Width: | Height: | Size: 228 KiB |
BIN
ServiceHost/Faces/170/4034/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
ServiceHost/Faces/170/4039/1.jpg
Normal file
|
After Width: | Height: | Size: 283 KiB |
BIN
ServiceHost/Faces/170/4039/2.jpg
Normal file
|
After Width: | Height: | Size: 258 KiB |
BIN
ServiceHost/Faces/170/4039/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
ServiceHost/Faces/170/4042/1.jpg
Normal file
|
After Width: | Height: | Size: 271 KiB |
BIN
ServiceHost/Faces/170/4042/2.jpg
Normal file
|
After Width: | Height: | Size: 281 KiB |
BIN
ServiceHost/Faces/170/4042/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
ServiceHost/Faces/170/4047/1.jpg
Normal file
|
After Width: | Height: | Size: 236 KiB |
BIN
ServiceHost/Faces/170/4047/2.jpg
Normal file
|
After Width: | Height: | Size: 225 KiB |
BIN
ServiceHost/Faces/170/4047/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
ServiceHost/Faces/170/40564/1.jpg
Normal file
|
After Width: | Height: | Size: 340 KiB |
BIN
ServiceHost/Faces/170/40564/2.jpg
Normal file
|
After Width: | Height: | Size: 367 KiB |
BIN
ServiceHost/Faces/170/40564/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
ServiceHost/Faces/170/40567/1.jpg
Normal file
|
After Width: | Height: | Size: 218 KiB |
BIN
ServiceHost/Faces/170/40567/2.jpg
Normal file
|
After Width: | Height: | Size: 195 KiB |
BIN
ServiceHost/Faces/170/40567/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
ServiceHost/Faces/170/40811/1.jpg
Normal file
|
After Width: | Height: | Size: 213 KiB |
BIN
ServiceHost/Faces/170/40811/2.jpg
Normal file
|
After Width: | Height: | Size: 206 KiB |
BIN
ServiceHost/Faces/170/40811/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
ServiceHost/Faces/170/40812/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
ServiceHost/Faces/170/40888/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
ServiceHost/Faces/170/40891/1.jpg
Normal file
|
After Width: | Height: | Size: 518 KiB |
BIN
ServiceHost/Faces/170/40891/2.jpg
Normal file
|
After Width: | Height: | Size: 520 KiB |
BIN
ServiceHost/Faces/170/40891/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 7.0 KiB |
BIN
ServiceHost/Faces/170/40892/1.jpg
Normal file
|
After Width: | Height: | Size: 355 KiB |
BIN
ServiceHost/Faces/170/40892/2.jpg
Normal file
|
After Width: | Height: | Size: 349 KiB |
BIN
ServiceHost/Faces/170/40892/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
ServiceHost/Faces/170/41032/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
ServiceHost/Faces/170/41037/1.jpg
Normal file
|
After Width: | Height: | Size: 220 KiB |
BIN
ServiceHost/Faces/170/41037/2.jpg
Normal file
|
After Width: | Height: | Size: 232 KiB |
BIN
ServiceHost/Faces/170/41037/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
ServiceHost/Faces/170/41050/1.jpg
Normal file
|
After Width: | Height: | Size: 256 KiB |
BIN
ServiceHost/Faces/170/41050/2.jpg
Normal file
|
After Width: | Height: | Size: 272 KiB |
BIN
ServiceHost/Faces/170/41050/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
ServiceHost/Faces/170/41051/Thumbnail.jpg
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
ServiceHost/Faces/170/41253/1.jpg
Normal file
|
After Width: | Height: | Size: 297 KiB |
BIN
ServiceHost/Faces/170/41253/2.jpg
Normal file
|
After Width: | Height: | Size: 284 KiB |