diff --git a/Company.Domain/CustomizeWorkshopEmployeeSettingsAgg/Entities/CustomizeWorkshopEmployeeSettings.cs b/Company.Domain/CustomizeWorkshopEmployeeSettingsAgg/Entities/CustomizeWorkshopEmployeeSettings.cs index 7ac8c4b8..df00c49b 100644 --- a/Company.Domain/CustomizeWorkshopEmployeeSettingsAgg/Entities/CustomizeWorkshopEmployeeSettings.cs +++ b/Company.Domain/CustomizeWorkshopEmployeeSettingsAgg/Entities/CustomizeWorkshopEmployeeSettings.cs @@ -112,12 +112,14 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity public void SimpleEdit( ICollection employeeSettingsShift, IrregularShift irregularShift, - WorkshopShiftStatus workshopShiftStatus, BreakTime breakTime, bool isShiftChange) + WorkshopShiftStatus workshopShiftStatus, BreakTime breakTime, bool isShiftChange,HolidayWork holidayWork,FridayWork fridayWork) { CustomizeWorkshopEmployeeSettingsShifts = EmployeeSettingsShiftsConvertor(employeeSettingsShift); BreakTime = new BreakTime(breakTime.HasBreakTimeValue, breakTime.BreakTimeValue); IsShiftChanged = isShiftChange; WorkshopShiftStatus = workshopShiftStatus; + HolidayWork = holidayWork; + FridayWork = fridayWork; IrregularShift = workshopShiftStatus == WorkshopShiftStatus.Regular ? new IrregularShift(new TimeOnly(), new TimeOnly(), WorkshopIrregularShifts.None) diff --git a/Company.Domain/CustomizeWorkshopGroupSettingsAgg/Entities/CustomizeWorkshopGroupSettings.cs b/Company.Domain/CustomizeWorkshopGroupSettingsAgg/Entities/CustomizeWorkshopGroupSettings.cs index d4af63c8..2e66359e 100644 --- a/Company.Domain/CustomizeWorkshopGroupSettingsAgg/Entities/CustomizeWorkshopGroupSettings.cs +++ b/Company.Domain/CustomizeWorkshopGroupSettingsAgg/Entities/CustomizeWorkshopGroupSettings.cs @@ -190,7 +190,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity public void EditSimpleAndOverwriteOnEmployee(string groupName, IEnumerable employeeIds, ICollection customizeWorkshopGroupSettingsShifts, WorkshopShiftStatus workshopShiftStatus, - IrregularShift irregularShift, BreakTime breakTime, bool isShiftChange) + IrregularShift irregularShift, BreakTime breakTime, bool isShiftChange,HolidayWork holidayWork , FridayWork fridayWork) { GroupName = groupName; CustomizeWorkshopGroupSettingsShifts = customizeWorkshopGroupSettingsShifts; @@ -200,7 +200,8 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity : new IrregularShift(irregularShift.StartTime, irregularShift.EndTime, irregularShift.WorkshopIrregularShifts); BreakTime = new BreakTime(breakTime.HasBreakTimeValue, breakTime.BreakTimeValue); IsShiftChange = isShiftChange; - + FridayWork = fridayWork; + HolidayWork = holidayWork; //var employeeSettingsShift = customizeWorkshopGroupSettingsShifts // .Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList(); if (isShiftChange) @@ -213,7 +214,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity { item.SimpleEdit(customizeWorkshopGroupSettingsShifts .Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList(), - IrregularShift, WorkshopShiftStatus, BreakTime, false); + IrregularShift, WorkshopShiftStatus, BreakTime, false,holidayWork, fridayWork); } } @@ -237,7 +238,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity { item.SimpleEdit(customizeWorkshopGroupSettingsShifts .Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList(), - irregularShift, workshopShiftStatus, breakTime, false); + irregularShift, workshopShiftStatus, breakTime, false,HolidayWork,FridayWork); } } diff --git a/CompanyManagment.App.Contracts/RollCall/IRollCallApplication.cs b/CompanyManagment.App.Contracts/RollCall/IRollCallApplication.cs index e9d981da..49ac7baf 100644 --- a/CompanyManagment.App.Contracts/RollCall/IRollCallApplication.cs +++ b/CompanyManagment.App.Contracts/RollCall/IRollCallApplication.cs @@ -46,10 +46,7 @@ namespace CompanyManagment.App.Contracts.RollCall TimeSpan GetEmployeeRollCallTimeSpanForDuration(long employeeId, long workshopId, string startFa, string endFa); - /// - /// دریافت بازه قابل تغییر برای ویرایش دستی حضور غیاب - /// - List GetEditableDatesForManualEdit(DateTime date); + /// /// برای صدور فیش حقوقی /// diff --git a/CompanyManagment.Application/CustomizeWorkshopSettingsApplication.cs b/CompanyManagment.Application/CustomizeWorkshopSettingsApplication.cs index d287bc8d..5360e4f2 100644 --- a/CompanyManagment.Application/CustomizeWorkshopSettingsApplication.cs +++ b/CompanyManagment.Application/CustomizeWorkshopSettingsApplication.cs @@ -523,7 +523,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo var breakTime = new BreakTime(command.BreakTime.HasBreakTimeValue, command.BreakTime.BreakTimeValue); entity.EditSimpleAndOverwriteOnEmployee(command.Name, employeeIds, groupSettingsShifts, command.WorkshopShiftStatus, - command.IrregularShift, breakTime, isChanged); + command.IrregularShift, breakTime, isChanged,command.HolidayWork,command.FridayWork); _customizeWorkshopGroupSettingsRepository.SaveChanges(); return op.Succcedded(); @@ -539,11 +539,17 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo if (entity == null) return op.Failed("چنین پرسنلی وجود ندارد"); - #endregion + #endregion - List employeesShifts = new(); + var groupSettings = + _customizeWorkshopGroupSettingsRepository.GetIncludeWorkshopSettings( + entity.CustomizeWorkshopGroupSettingId); - if (command.WorkshopShiftStatus == WorkshopShiftStatus.Regular) + List employeesShifts = new(); + bool isChanged = false; + + + if (command.WorkshopShiftStatus == WorkshopShiftStatus.Regular) { #region Validation @@ -621,8 +627,20 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo { return op.Failed("بازه زمانی کارگاه نمیتواند بیشتر از 24 ساعت باشد"); } - #endregion - } + #endregion + + if (employeesShifts.All(x => groupSettings.CustomizeWorkshopGroupSettingsShifts.Any(y => x.Equals(y))) + && command.WorkshopShiftStatus == groupSettings.WorkshopShiftStatus && command.FridayWork == groupSettings.FridayWork && + command.HolidayWork == groupSettings.HolidayWork && command.BreakTime == groupSettings.BreakTime) + { + isChanged = false; + } + + else + { + isChanged = true; + } + } else { var irregularShiftStartTime = new DateTime(DateOnly.MinValue, command.IrregularShift.StartTime); @@ -650,10 +668,21 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo } break; } - } + + if (command.WorkshopShiftStatus == groupSettings.WorkshopShiftStatus && command.BreakTime == groupSettings.BreakTime && + command.IrregularShift == groupSettings.IrregularShift && command.FridayWork == groupSettings.FridayWork && + command.HolidayWork == groupSettings.HolidayWork) + { + isChanged = false; + } + else + { + isChanged = true; + } + } - entity.SimpleEdit(employeesShifts, command.IrregularShift, command.WorkshopShiftStatus, command.BreakTime, true); + entity.SimpleEdit(employeesShifts, command.IrregularShift, command.WorkshopShiftStatus, command.BreakTime, isChanged,command.HolidayWork,command.FridayWork); _customizeWorkshopGroupSettingsRepository.SaveChanges(); return op.Succcedded(); diff --git a/CompanyManagment.Application/RollCallApplication.cs b/CompanyManagment.Application/RollCallApplication.cs index a556dccf..def29772 100644 --- a/CompanyManagment.Application/RollCallApplication.cs +++ b/CompanyManagment.Application/RollCallApplication.cs @@ -94,27 +94,7 @@ public class RollCallApplication : IRollCallApplication return _rollCallRepository.GetEmployeeRollCallTimeSpanForDuration(employeeId, workshopId, startDateTime, endDateTime); } - public List GetEditableDatesForManualEdit(DateTime date) - { - var date1 = new RollCallEditableDatesForManualEditViewModel() - { - StartFa = date.AddDays(-1).Date.ToFarsi(), - EndFa = date.Date.ToFarsi(), - }; - var date2 = new RollCallEditableDatesForManualEditViewModel() - { - StartFa = date.Date.ToFarsi(), - EndFa = date.Date.ToFarsi() - }; - var date3 = new RollCallEditableDatesForManualEditViewModel() - { - StartFa = date.Date.ToFarsi(), - EndFa = date.AddDays(1).Date.ToFarsi() - }; - - return [date1, date2, date3]; - } public List GetOverlappedRollCallsWithLeaveInDates(long workshopId, DateTime start, DateTime end) @@ -334,11 +314,11 @@ public class RollCallApplication : IRollCallApplication if (newRollCallDates == null || !newRollCallDates.All(x => employeeStatuses.Any(y => x.StartDate >= y.StartDateGr && x.EndDate <= y.EndDateGr))) return operation.Failed("کارمند در بازه وارد شده غیر فعال است"); - var editableDates = GetEditableDatesForManualEdit(date); - if (newRollCallDates.Any(x => !editableDates.Any(y => - x.StartDate.Value.Date == y.StartFa.ToGeorgianDateTime().Date && - x.EndDate.Value.Date == y.EndFa.ToGeorgianDateTime().Date))) + + if (newRollCallDates.Any(x => + x.StartDate.Value.Date < date.Date.AddDays(-1) || + x.EndDate.Value.Date > date.Date.AddDays(1))) { return operation.Failed("حضور غیاب در حال ویرایش را نمیتوانید بیشتر از یک روز از ثبت حضور غیاب عقب تر یا جلو تر ببرید"); } diff --git a/CompanyManagment.EFCore/Repository/CustomizeWorkshopSettingsRepository.cs b/CompanyManagment.EFCore/Repository/CustomizeWorkshopSettingsRepository.cs index 84b9528c..250644a6 100644 --- a/CompanyManagment.EFCore/Repository/CustomizeWorkshopSettingsRepository.cs +++ b/CompanyManagment.EFCore/Repository/CustomizeWorkshopSettingsRepository.cs @@ -246,7 +246,9 @@ namespace CompanyManagment.EFCore.Repository }).ToList(), Id = entity.id, WorkshopId = entity.WorkshopId, - WorkshopShiftStatus = entity.WorkshopShiftStatus + WorkshopShiftStatus = entity.WorkshopShiftStatus, + FridayWork = entity.FridayWork, + HolidayWork = entity.HolidayWork }; } diff --git a/Query/AdminReports/Handlers/GetWorkshopWithRollCallHandler.cs b/Query/AdminReports/Handlers/GetWorkshopWithRollCallHandler.cs index acb9f899..a2d62807 100644 --- a/Query/AdminReports/Handlers/GetWorkshopWithRollCallHandler.cs +++ b/Query/AdminReports/Handlers/GetWorkshopWithRollCallHandler.cs @@ -3,6 +3,7 @@ using CompanyManagment.EFCore; using Microsoft.EntityFrameworkCore; using Query.AdminReports.Models; using System.Data; +using _0_Framework.Application; using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database; namespace Query.AdminReports.Handlers @@ -28,8 +29,7 @@ namespace Query.AdminReports.Handlers //workshop filter by parameters - var rollCallServiceQuery = _companyContext.RollCallServices - .Where(x => x.StartService <= DateTime.Now && x.EndService >= DateTime.Now); + var rollCallServiceQuery = _companyContext.RollCallServices.AsSplitQuery(); var allWorkshops = _companyContext.Workshops.Select(x => new { x.id, x.WorkshopFullName }); if (!string.IsNullOrWhiteSpace(parameters.WorkshopName)) @@ -42,8 +42,12 @@ namespace Query.AdminReports.Handlers { WorkshopId = workshop.id, RollCallServiceType = rcs.ServiceType, - WorkshopName = workshop.WorkshopFullName - }); + WorkshopName = workshop.WorkshopFullName, + MaxPersonValid = rcs.MaxPersonValid, + IsActive = rcs.StartService <= DateTime.Now && rcs.EndService >= DateTime.Now, + ServiceStartFa=rcs.StartService.ToFarsi(), + ServiceEndFa=rcs.EndService.ToFarsi() + }); //workshop population @@ -77,14 +81,18 @@ namespace Query.AdminReports.Handlers var workshopsWithServiceList = workshopsWithService.ToList(); return workshopsWithServiceList.Select(x => new WorkshopWithRollCallServiceQueryModel() { + IsActive = x.IsActive, + ServiceStartFa = x.ServiceStartFa, + ServiceEndFa = x.ServiceEndFa, WorkshopId = x.WorkshopId, RollCallServiceType = x.RollCallServiceType, + MaxPersonValid = x.MaxPersonValid, WorkshopName = x.WorkshopName, ActiveEmployeesCount = activeEmployeesList.Count(y => y.WorkshopId == x.WorkshopId), ActiveEmployeesWithRollCallInLastWeekCount = activeEmployeesList.Count(y => y.WorkshopId == x.WorkshopId && lastWeekRollCalls.Contains(y.EmployeeId) && !leavesList.Contains(y.EmployeeId)), TotalEmployeesCount = workshopsWorkingEmployeesList.FirstOrDefault(y => y.WorkshopId == x.WorkshopId).TotalWorkingEmployeesCount - }).ToList(); + }).OrderByDescending(x=>x.IsActive).ToList(); } } diff --git a/Query/AdminReports/Models/WorkshopWithRollCallViewModel.cs b/Query/AdminReports/Models/WorkshopWithRollCallServiceQueryModel.cs similarity index 77% rename from Query/AdminReports/Models/WorkshopWithRollCallViewModel.cs rename to Query/AdminReports/Models/WorkshopWithRollCallServiceQueryModel.cs index 83a68189..267d03a5 100644 --- a/Query/AdminReports/Models/WorkshopWithRollCallViewModel.cs +++ b/Query/AdminReports/Models/WorkshopWithRollCallServiceQueryModel.cs @@ -20,5 +20,10 @@ return ((float)ActiveEmployeesWithRollCallInLastWeekCount / ActiveEmployeesCount) * 100; } } + + public int MaxPersonValid { get; set; } + public bool IsActive { get; set; } + public string ServiceStartFa { get; set; } + public string ServiceEndFa { get; set; } } } diff --git a/ServiceHost/Areas/AdminNew/Pages/Company/RollCall/Grouping.cshtml.cs b/ServiceHost/Areas/AdminNew/Pages/Company/RollCall/Grouping.cshtml.cs index 49d8aa04..47127403 100644 --- a/ServiceHost/Areas/AdminNew/Pages/Company/RollCall/Grouping.cshtml.cs +++ b/ServiceHost/Areas/AdminNew/Pages/Company/RollCall/Grouping.cshtml.cs @@ -205,7 +205,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.RollCall public IActionResult OnGetEditEmployee(long groupId, List employeeId, long workshopId) { - var employee = _customizeWorkshopSettingsApplication.GetEmployeeSettingsByEmployeeIdGroupSettingsId(workshopId, employeeId.First()); + var employee = _customizeWorkshopSettingsApplication.GetByEmployeeIdAndWorkshopIdIncludeGroupSettings(workshopId, employeeId.First()); var command = new EditCustomizeEmployeeSettings() { Id = employee.Id, diff --git a/ServiceHost/Areas/AdminNew/Pages/Company/RollCall/Index.cshtml b/ServiceHost/Areas/AdminNew/Pages/Company/RollCall/Index.cshtml index 41ece08f..fa4370af 100644 --- a/ServiceHost/Areas/AdminNew/Pages/Company/RollCall/Index.cshtml +++ b/ServiceHost/Areas/AdminNew/Pages/Company/RollCall/Index.cshtml @@ -13,9 +13,7 @@ var index = 1; - - - + @@ -24,7 +22,6 @@ var index = 1; - } - +
- +

مدیریت حضور و غیاب

-
کارگاه نورداد مهر گستر کاسپین
+
لیست کارگاه های حضور و غیاب
@@ -70,7 +67,7 @@ var index = 1;
-
+
@@ -83,16 +80,17 @@ var index = 1;
نام کارگاه
نوع سرویس
-
تعداد پرسنل
-
تعداد پرسنل فعال
-
تعداد پرسنل در حال حضور و غیاب
-
عملیات
+
تعداد پرسنل
+
تعداد پرسنل فعال
+
تعداد پرسنل در حال حضور و غیاب
+
وضعیت
+
عملیات
@foreach (var item in Model.Items) { -
+
@@ -105,18 +103,29 @@ var index = 1;
@item.WorkshopName
-
@item.RollCallServiceType
+
@item.RollCallServiceType
-
@item.TotalEmployeesCount
+
@item.TotalEmployeesCount
-
@item.ActiveEmployeesCount
+
@item.ActiveEmployeesCount
-
@item.ActiveEmployeesWithRollCallInLastWeekCount
+
@item.ActiveEmployeesWithRollCallInLastWeekCount
+
+
+
+ @if (item.IsActive) + { +
فعال
+ } + else + { +
غیر فعال
+ } +
-
@@ -130,16 +139,7 @@ var index = 1; جزئیات - - +
- @if (@Model.CountWorkFlowCut != 0) - { - @Model.CountWorkFlowCut - } +
+ +
- @*
- - -
*@ -
@@ -241,23 +270,13 @@
عدم ثبت ساعت استراحت
- @if (@Model.CountWorkFlowLunchBreak != 0) - { - @Model.CountWorkFlowLunchBreak - } +
+ +
- @*
- - -
*@ -
@@ -268,60 +287,40 @@
-
قطع شده مختلط
+
تعیین وضعیت تردد پرسنل فوری
- @if (@Model.CountUndefinedRollCalls != 0) - { - @Model.CountUndefinedRollCalls - } +
+ +
- @*
- - -
*@ -
-
+ @*
-
تداخل مرخصی و حضور و غیاب
+
رفع تداخل مرخصی و تردد پرسنل
- @if (@Model.CountRollCallsOverlappingLeave != 0) - { - @Model.CountRollCallsOverlappingLeave - } +
+ +
- @*
- - -
*@ -
-
+
*@
diff --git a/ServiceHost/Areas/Client/Pages/Company/WorkFlow/RollCall.cshtml.cs b/ServiceHost/Areas/Client/Pages/Company/WorkFlow/RollCall.cshtml.cs index 36b31eae..44163b3f 100644 --- a/ServiceHost/Areas/Client/Pages/Company/WorkFlow/RollCall.cshtml.cs +++ b/ServiceHost/Areas/Client/Pages/Company/WorkFlow/RollCall.cshtml.cs @@ -51,7 +51,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.WorkFlow throw new InvalidDataException("اختلال در کارگاه"); } - public IActionResult OnGet() + public async Task OnGet() { var hasRollCallService = _rollCallServiceApplication.GetActiveServiceByWorkshopId(_workshopId) != null; if (!hasRollCallService) @@ -61,40 +61,40 @@ namespace ServiceHost.Areas.Client.Pages.Company.WorkFlow var workshopInfo = _workshopApplication.GetWorkshopInfo(_workshopId); WorkshopFullName = workshopInfo.WorkshopFullName; - CountWorkFlowCut = _workflowApplication.GetCountCutRollCallByBgService(_workshopId); - //CountWorkFlowAbsent = _workflowApplication.GetRollCallAbsentsWorkFlows(accountId, workshopId); - CountWorkFlowAbsent = _workflowApplication.GetAbsentRollCallWorkFlows(_workshopId).Count(); - CountWorkFlowLunchBreak = _workflowApplication.GetEmployeesWithoutLunchBreak(_workshopId).Count(); - CountUndefinedRollCalls = _workflowApplication.GetUndefinedRollCalls(_workshopId).Count(); - CountRollCallsOverlappingLeave = _workflowApplication.GetRollCallsOverlappingLeaves(_workshopId).Count(); + // CountWorkFlowCut = await _workflowApplication.GetCountCutRollCallByBgService(_workshopId); + // //CountWorkFlowAbsent = _workflowApplication.GetRollCallAbsentsWorkFlows(accountId, workshopId); + // CountWorkFlowAbsent = (await _workflowApplication.GetAbsentRollCallWorkFlows(_workshopId)).Count(); + // CountWorkFlowLunchBreak = (await _workflowApplication.GetEmployeesWithoutLunchBreak(_workshopId)).Count(); + //CountUndefinedRollCalls = (await _workflowApplication.GetUndefinedRollCalls(_workshopId)).Count(); + //CountRollCallsOverlappingLeave = (await _workflowApplication.GetRollCallsOverlappingLeaves(_workshopId)).Count(); return Page(); } - public IActionResult OnGetCountWorkFlowOfAbsentAndCut() + public async Task OnGetCountWorkFlowOfAbsentAndCut() { - var countWorkFlowCut = _workflowApplication.GetCountCutRollCallByBgService(_workshopId); + var countWorkFlowCut = (await _workflowApplication.GetCountCutRollCallByBgService(_workshopId)); //CountWorkFlowAbsent = _workflowApplication.GetRollCallAbsentsWorkFlows(accountId, workshopId); - var countWorkFlowAbsent = _workflowApplication.GetAbsentRollCallWorkFlows(_workshopId).Count(); - var countWorkFlowLunchBreak = _workflowApplication.GetEmployeesWithoutLunchBreak(_workshopId).Count(); - var countUndefinedRollCalls = _workflowApplication.GetUndefinedRollCalls(_workshopId).Count(); - var countRollCallsOverlappingLeave = _workflowApplication.GetRollCallsOverlappingLeaves(_workshopId).Count(); + var countWorkFlowAbsent = (await _workflowApplication.GetAbsentRollCallWorkFlows(_workshopId)).Count(); + var countWorkFlowLunchBreak = (await _workflowApplication.GetEmployeesWithoutLunchBreak(_workshopId)).Count(); + var countUndefinedRollCalls = (await _workflowApplication.GetUndefinedRollCalls(_workshopId)).Count(); + var countRollCallsOverlappingLeave = (await _workflowApplication.GetRollCallsOverlappingLeaves(_workshopId)).Count(); - return new JsonResult(new + return new JsonResult(new { success = true, dataCut = countWorkFlowCut, dataAbsent = countWorkFlowAbsent, dataLunchBreak = countWorkFlowLunchBreak, - dataUndefined = countUndefinedRollCalls, - dataOverlappingLeave = countRollCallsOverlappingLeave, - }); + dataUndefined = countUndefinedRollCalls, + dataOverlappingLeave = countRollCallsOverlappingLeave + }); } - public IActionResult OnGetRollCallWorkFlowsCut() + public async Task OnGetRollCallWorkFlowsCut() { - var resultData = _workflowApplication.GetRollCallWorkFlowsCutByBgService(_workshopId); + var resultData = await _workflowApplication.GetRollCallWorkFlowsCutByBgService(_workshopId); foreach (var item in resultData) { item.RollCallWorkFlowPerDayCount = item.RollCallWorkFlowPerDayViewModels.Count; @@ -107,9 +107,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.WorkFlow }); } - public IActionResult OnGetEmployeeListByWorkFlowsCut(DateTime date) + public async Task OnGetEmployeeListByWorkFlowsCut(DateTime date) { - var resultData = _workflowApplication.GetRollCallWorkFlowsCutByBgServiceByDate(_workshopId, date); + var resultData = await _workflowApplication.GetRollCallWorkFlowsCutByBgServiceByDate(_workshopId, date); return new JsonResult(new { @@ -118,9 +118,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.WorkFlow }); } - public IActionResult OnGetRollCallWorkFlowsAbsents() + public async Task OnGetRollCallWorkFlowsAbsents() { - var resultData = _workflowApplication.GetAbsentRollCallWorkFlows(_workshopId); + var resultData = await _workflowApplication.GetAbsentRollCallWorkFlows(_workshopId); foreach (var item in resultData) { item.RollCallWorkFlowPerDayCount = item.RollCallWorkFlowPerDayViewModels.Count; @@ -133,9 +133,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.WorkFlow }); } - public IActionResult OnGetEmployeeListByWorkFlowsAbsents(DateTime date) + public async Task OnGetEmployeeListByWorkFlowsAbsents(DateTime date) { - var resultData = _workflowApplication.GetAbsentRollCallWorkFlowsByDate(_workshopId, date); + var resultData = await _workflowApplication.GetAbsentRollCallWorkFlowsByDate(_workshopId, date); return new JsonResult(new { @@ -144,9 +144,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.WorkFlow }); } - public IActionResult OnGetRollCallWorkFlowEmployeesWithoutLunchBreak() + public async Task OnGetRollCallWorkFlowEmployeesWithoutLunchBreak() { - var resultData = _workflowApplication.GetEmployeesWithoutLunchBreak(_workshopId); + var resultData = await _workflowApplication.GetEmployeesWithoutLunchBreak(_workshopId); foreach (var item in resultData) { item.Count = item.RollCallConfirmedWithoutLunchList.Count; @@ -159,9 +159,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.WorkFlow }); } - public IActionResult OnGetEmployeeListByWorkFlowsEmployeesWithoutLunchBreak(DateTime date) + public async Task OnGetEmployeeListByWorkFlowsEmployeesWithoutLunchBreak(DateTime date) { - var resultData = _workflowApplication.GetEmployeesWithoutLunchBreakByDate(_workshopId, date); + var resultData = await _workflowApplication.GetEmployeesWithoutLunchBreakByDate(_workshopId, date); return new JsonResult(new { @@ -170,9 +170,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.WorkFlow }); } - public IActionResult OnGetUndefinedRollCalls() + public async Task OnGetUndefinedRollCalls() { - var resultData = _workflowApplication.GetUndefinedRollCalls(_workshopId); + var resultData = await _workflowApplication.GetUndefinedRollCalls(_workshopId); foreach (var item in resultData) { item.RollCallWorkFlowPerDayCount = item.RollCallWorkFlowPerDayViewModels.Count; @@ -185,9 +185,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.WorkFlow }); } - public IActionResult OnGetEmployeeListByUndefinedRollCalls(DateTime date) + public async Task OnGetEmployeeListByUndefinedRollCalls(DateTime date) { - var resultData = _workflowApplication.GetUndefinedRollCallsByDate(_workshopId, date); + var resultData = await _workflowApplication.GetUndefinedRollCallsByDate(_workshopId, date); return new JsonResult(new { @@ -196,9 +196,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.WorkFlow }); } - public IActionResult OnGetOverlappingLeaves() + public async Task OnGetOverlappingLeaves() { - var resultData = _workflowApplication.GetRollCallsOverlappingLeaves(_workshopId); + var resultData = await _workflowApplication.GetRollCallsOverlappingLeaves(_workshopId); foreach (var item in resultData) { item.EmployeesListCount = item.EmployeesList.Count; @@ -211,9 +211,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.WorkFlow }); } - public IActionResult OnGetEmployeeListByOverlappingLeaveByDate(DateTime date) + public async Task OnGetEmployeeListByOverlappingLeaveByDate(DateTime date) { - var resultData = _workflowApplication.GetRollCallsOverlappingLeaveByDate(_workshopId, date); + var resultData = await _workflowApplication.GetRollCallsOverlappingLeaveByDate(_workshopId, date); return new JsonResult(new { @@ -227,7 +227,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.WorkFlow return Partial("LeaveCreate", command); } - public IActionResult OnPostConfirmedAbsence(long employeeId, string absenceDate) + public async Task OnPostConfirmedAbsence(long employeeId, string absenceDate) { long accountId = _authHelper.CurrentAccountId(); @@ -239,7 +239,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.WorkFlow AbsenceDate = absenceDate }; - var result = _workflowApplication.CreateRollCallConfirmedAbsence(command); + var result = await _workflowApplication.CreateRollCallConfirmedAbsence(command); return new JsonResult(new { success = result.IsSuccedded, @@ -249,7 +249,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.WorkFlow public IActionResult OnPostConfirmCutByBgService(long rollCallId) { - var result = _rollCallApplication.SetModifyTypeToEditByEmployer(rollCallId); + var result = _rollCallApplication.SetModifyTypeToEditByEmployer(rollCallId); return new JsonResult(new { @@ -258,13 +258,13 @@ namespace ServiceHost.Areas.Client.Pages.Company.WorkFlow }); } - public IActionResult OnPostConfirmedWithoutLunchBreak(long rollCallId) + public async Task OnPostConfirmedWithoutLunchBreak(long rollCallId) { var command = new CreateRollCallConfirmedWithoutLunchBreak() { RollCallId = rollCallId }; - var result = _workflowApplication.CreateRollCallConfirmedWithoutLunchBreak(command); + var result = await _workflowApplication.CreateRollCallConfirmedWithoutLunchBreak(command); return new JsonResult(new { diff --git a/ServiceHost/Areas/Client/Pages/Shared/_ClientLayout.cshtml b/ServiceHost/Areas/Client/Pages/Shared/_ClientLayout.cshtml index f5be6e76..ee95ba28 100644 --- a/ServiceHost/Areas/Client/Pages/Shared/_ClientLayout.cshtml +++ b/ServiceHost/Areas/Client/Pages/Shared/_ClientLayout.cshtml @@ -13,7 +13,7 @@ long workshopId = currentAccount.WorkshopList.First(x => x.Slug == currentAccount.WorkshopSlug).Id; - int countWorkFlow = WorkFlowApplication.GetCountAllWorkFlows(workshopId); + int countWorkFlow =await WorkFlowApplication.GetCountAllWorkFlows(workshopId); var viewData = new ViewDataDictionary(new EmptyModelMetadataProvider(), new ModelStateDictionary()) { { "countWorkFlow", countWorkFlow } }; } diff --git a/ServiceHost/ServiceHost.csproj b/ServiceHost/ServiceHost.csproj index 51924c65..f242f4f8 100644 --- a/ServiceHost/ServiceHost.csproj +++ b/ServiceHost/ServiceHost.csproj @@ -91,6 +91,9 @@ + + + diff --git a/ServiceHost/wwwroot/AssetsAdminNew/RollCall/css/Index.css b/ServiceHost/wwwroot/AssetsAdminNew/RollCall/css/Index.css new file mode 100644 index 00000000..58c7e827 --- /dev/null +++ b/ServiceHost/wwwroot/AssetsAdminNew/RollCall/css/Index.css @@ -0,0 +1,339 @@ +.table-rollcall .width1, +.table-rollcall .rollcall-list .width1 { + width: 5% !important; +} + +.table-rollcall .width2, +.table-rollcall .rollcall-list .width2 { + width: 20% !important; +} + +.table-rollcall .width3, +.table-rollcall .rollcall-list .width3 { + width: 15% !important; +} + +.table-rollcall .width4, +.table-rollcall .rollcall-list .width4 { + width: 12% !important; +} + +.table-rollcall .width5, +.table-rollcall .rollcall-list .width5 { + width: 12% !important; + /*text-align: center !important;*/ +} + +.table-rollcall .width6, +.table-rollcall .rollcall-list .width6 { + width: 16% !important; +} + +.table-rollcall .width7, +.table-rollcall .rollcall-list .width7 { + width: 14% !important; + text-align: center !important; +} + +.table-rollcall .width8, +.table-rollcall .rollcall-list .width8 { + width: 6% !important; +} + +.table-rollcall .rollcall-list .width3 .Rtable-cell--content, +.table-rollcall .rollcall-list .width7 .Rtable-cell--content { + text-align: center; + text-align: -webkit-center; +} + +.table-rollcall .ticket-list .green { + background-color: #C4FFC2; +} + +.badget-inprogress { + color: #ffffff; + background-color: #EAB308; + width: 60%; + text-align: center; + padding: 3px 6px; + border-radius: 30px; + display: inline-block; +} + +.badget-open { + color: #353535; + background-color: #E2E8F0; + width: 60%; + text-align: center; + padding: 3px 6px; + border-radius: 30px; + display: inline-block; +} + +.badget-answer { + color: #ffffff; + background-color: #60A5FA; + width: 60%; + text-align: center; + padding: 3px 6px; + border-radius: 30px; + display: inline-block; +} + +.badget-closed { + color: #ffffff; + background-color: #84CC16; + width: 60%; + text-align: center; + padding: 3px 6px; + border-radius: 30px; + display: inline-block; +} + + +.btn-ticket-detail { + background: rgba(93, 209, 52, 0.3); + border: 0.5px solid #2E8F2F54; + border-radius: 6px; + position: relative; + overflow: hidden; + color: #ffffff; + text-align: right; + font-size: 11px; + padding: 3px; + font-style: normal; + font-weight: 400; + line-height: normal; + white-space: nowrap; +} + +.btn-ticket-task { + background: #C9EEFE; + border: 0.5px solid #FFFFFF; + border-radius: 6px; + position: relative; + overflow: hidden; + color: #ffffff; + text-align: right; + font-size: 11px; + padding: 3px; + font-style: normal; + font-weight: 400; + line-height: normal; + white-space: nowrap; + margin: 0 2px; +} + +.btn-ticket-edit { + background: rgba(52, 209, 209, 0.3); + border-radius: 6px; + position: relative; + overflow: hidden; + color: #009EE2; + text-align: right; + font-size: 11px; + padding: 3px; + font-style: normal; + font-weight: 400; + line-height: normal; + white-space: nowrap; +} + +.btn-ticket-delete { + background: rgba(209, 50, 50, 0.15); + border-radius: 6px; + position: relative; + overflow: hidden; + color: #BF3737; + text-align: right; + font-size: 11px; + padding: 3px; + font-style: normal; + font-weight: 400; + line-height: normal; + white-space: nowrap; +} + +.btn-ticket-detail:hover { + background: rgba(93, 209, 52, 0.4); +} + +.btn-ticket-edit:hover { + background: rgba(52, 209, 209, 0.5); +} + +.btn-ticket-delete:hover { + background: rgba(209, 50, 50, 0.3); +} + + +.btn-ticket-more { + background: #C7F8F8; + border: 1px solid #0B5959; + border-radius: 7px; + position: relative; + overflow: hidden; + color: #0B5959; + text-align: right; + font-size: 11px; + padding: 3px; + font-style: normal; + font-weight: 400; + line-height: normal; + white-space: nowrap; +} + + .btn-ticket-more:hover { + background: #ACD2D2; + } + +.table-rollcall .Rtable .Rtable-row .Rtable-cell .Rtable-cell--content > span { + border-radius: 5px; + background: rgba(87, 227, 227, 0.25); + width: 32px; + height: 32px; + display: inline-block; + padding: 0 10px; + font-weight: 600; +} + +.operations-btns .span1 { + color: #0B5959; + font-size: 14px; + font-weight: 500; +} + +.operations-btns .span2 { + color: #0B5959; + font-size: 13px; + font-weight: 500; +} + +.black-background { + background-color: #E3E3E3 !important; +} + +.status { + display: inline-block; + padding: 6px; + width: 60px; + border-radius: 20px; + color: #ffffff; + font-weight: 500; +} + +.status-green { + background-color: #84cc16; +} + +.status-red { + background-color: #ef4444; +} + +@media (max-width: 1380px) { + .badget-inprogress, + .badget-answer, + .badget-closed, + .badget-open { + width: 110px; + font-size: 10px; + } + + .Rtable .Rtable-row .Rtable-cell .Rtable-cell--content { + font-size: 10px; + } + + .table-rollcall .Rtable-cell.column-heading { + font-size: 12px !important; + } + + .table-rollcall .width1, + .table-rollcall .ticket-list .width1 { + width: 5% !important; + } + + .table-rollcall .width2, + .table-rollcall .ticket-list .width2 { + width: 8% !important; + } + + .table-rollcall .width3, + .table-rollcall .ticket-list .width3 { + width: 17% !important; + text-align: center !important; + } + + .table-rollcall .width4, + .table-rollcall .ticket-list .width4 { + width: 15% !important; + } + + .table-rollcall .width5, + .table-rollcall .ticket-list .width5 { + width: 15% !important; + /*text-align: center !important;*/ + } + + .table-rollcall .ticket-list .width3 .Rtable-cell--content { + text-align: center; + text-align: -webkit-center; + } + + .table-rollcall .ticket-list .Rtable-cell--content { + font-size: 11px; + } + + .table-rollcall .width6, + .table-rollcall .ticket-list .width6 { + width: 10% !important; + } + + .table-rollcall .width7, + .table-rollcall .ticket-list .width7 { + width: 15% !important; + } + + .table-rollcall .width8, + .table-rollcall .ticket-list .width8 { + width: 10% !important; + } +} + +@media (max-width: 767px) { + .Rtable--collapse .Rtable-row { + outline: 0; + border: 1px solid #ECFFFF; + padding: 0; + } + + .Rtable--collapse .Rtable-row .Rtable-cell.width3 .Rtable-cell--content { + justify-content: right; + display: flex; + } + + .Rtable--collapse .Rtable-row .Rtable-cell.width8 { + justify-content: end; + } + + .Rtable--collapse .Rtable-row .Rtable-cell.width8 .Rtable-cell--content { + justify-content: end; + display: flex; + } + + .Rtable--collapse .Rtable-row .Rtable-cell { + border-bottom: 0; + } + + .badget-inprogress, + .badget-answer, + .badget-closed { + border-radius: 0; + } + + .btn-ticket-detail { + border: 1px solid #248826; + border-radius: 8px; + color: #248826; + background-color: #B7EABA; + } +} diff --git a/ServiceHost/wwwroot/AssetsAdminNew/RollCall/js/CameraAccounts.js b/ServiceHost/wwwroot/AssetsAdminNew/RollCall/js/CameraAccounts.js index 2063c82b..f9cc1490 100644 --- a/ServiceHost/wwwroot/AssetsAdminNew/RollCall/js/CameraAccounts.js +++ b/ServiceHost/wwwroot/AssetsAdminNew/RollCall/js/CameraAccounts.js @@ -67,7 +67,7 @@ function loadDataCameraAccountAjax() {
-
+
- -
-
- -
-
- + ورود مستقیم - - - - + -
+
@@ -146,7 +131,7 @@ function loadDataCameraAccountAjax() { - + + ورود به اکانت حساب کاربری + + + + +
diff --git a/ServiceHost/wwwroot/AssetsAdminNew/RollCall/js/ModalAddRollCall.js b/ServiceHost/wwwroot/AssetsAdminNew/RollCall/js/ModalAddRollCall.js index e53c97a2..c0fc72e6 100644 --- a/ServiceHost/wwwroot/AssetsAdminNew/RollCall/js/ModalAddRollCall.js +++ b/ServiceHost/wwwroot/AssetsAdminNew/RollCall/js/ModalAddRollCall.js @@ -400,7 +400,7 @@ function fetchAndDisplayRollCallData(employeeId, dateFa) { if (response.hasLeave) { htmlElement = ` -
برای این پرسنل مرخصی ثبت شده است
+
این پرسنل مرخصی ثبت شده است.
`; $('#appendChildTimeWorkHtml').html(htmlElement); $('.btn-register').addClass('disable'); diff --git a/ServiceHost/wwwroot/AssetsClient/pages/CustomizeCheckout/css/Group.css b/ServiceHost/wwwroot/AssetsClient/pages/CustomizeCheckout/css/Group.css index 3747fe9e..b1e2346a 100644 --- a/ServiceHost/wwwroot/AssetsClient/pages/CustomizeCheckout/css/Group.css +++ b/ServiceHost/wwwroot/AssetsClient/pages/CustomizeCheckout/css/Group.css @@ -28,15 +28,19 @@ } .table-rollcall-group2 .width3 { - width: 32% !important; + width: 30% !important; } .table-rollcall-group2 .width4 { - width: 25% !important; + width: 20% !important; } .table-rollcall-group2 .width5 { - width: 20% !important; + width: 15% !important; +} + +.table-rollcall-group2 .width6 { + width: 8% !important; } .infoGroupBox { @@ -66,9 +70,17 @@ color: #EF4444; } +#ajaxDataMain { + height: 700px; + border-radius: 10px; + padding: 3px; + overflow-y: auto; + /*outline: 1px solid #55D1D1;*/ +} + #loadAccountItems { - height: 620px; + height: 700px; background-color: #ffffff; border-radius: 10px; padding: 1px 6px; @@ -106,14 +118,14 @@ } .title-group1 { - font-size: 15px; + font-size: 14px; font-weight: 600; margin: 0; color: #696969; } .title-group2 { - font-size: 15px; + font-size: 14px; font-weight: 600; margin: 0; color: #716969; @@ -181,7 +193,7 @@ cursor: pointer; margin: 0 0 6px 0; transition: ease .3s; - height: 76px; + height: 75px; } .btnPosition:hover { @@ -284,12 +296,19 @@ @media(max-width: 1366px) { #loadAccountItems { - height: 310px; + height: 410px; + } + #ajaxDataMain { + height: 410px; + border-radius: 10px; + padding: 3px; + overflow-y: auto; + /*outline: 1px solid #55D1D1;*/ } .title-group1, .title-group2 { - font-size: 15px; + font-size: 13px; color: #353232; } @@ -322,6 +341,11 @@ .title-group h4 { font-size: 18px; } + + .time-set-title { + font-size: 13px; + } + } @media (max-width:768px) { @@ -333,6 +357,7 @@ background-color: #FFFFFF; outline: 0; box-shadow: 0px 2px 9px rgba(0, 0, 0, 0.1); + margin: 0 0 15px 0; } .btnPosition.active { @@ -348,15 +373,15 @@ } .widthMobile1 { - width: 15% !important; + width: 10% !important; } .widthMobile2 { - width: 45% !important; + width: 40% !important; } .widthMobile3 { - width: 40% !important; + width: 30% !important; } .Rtable .Rtable-row { @@ -385,9 +410,10 @@ font-size: 12px; padding: 10px 30px; } - + #ajaxDataMain, #loadAccountItems { height: auto; + overflow: hidden; } .btn-add { diff --git a/ServiceHost/wwwroot/AssetsClient/pages/CustomizeCheckout/js/Grouping.js b/ServiceHost/wwwroot/AssetsClient/pages/CustomizeCheckout/js/Grouping.js index ceff9bb8..c2d610c1 100644 --- a/ServiceHost/wwwroot/AssetsClient/pages/CustomizeCheckout/js/Grouping.js +++ b/ServiceHost/wwwroot/AssetsClient/pages/CustomizeCheckout/js/Grouping.js @@ -35,7 +35,6 @@ function loadDataAjax() { html += `
-
${item.id} ${index} @@ -47,15 +46,30 @@ function loadDataAjax() {
`; - item.rollCallWorkshopShifts.forEach(function(itemShifts) { - html += ` -

- ${itemShifts.startTime} - الی - ${itemShifts.endTime} -

- `; - }); + if (item.workshopShiftStatus === 0) { + item.rollCallWorkshopShifts.forEach(function (itemShifts) { + html += ` +

+ ${itemShifts.startTime} + الی + ${itemShifts.endTime} +

+ `; + }); + } else { + html += `

`; + if (item.irregularShift.workshopIrregularShifts === 1) { + html += `12-24`; + } else if (item.irregularShift.workshopIrregularShifts === 2) { + html += `24-24`; + } else if (item.irregularShift.workshopIrregularShifts === 3) { + html += `12-36`; + } else if (item.irregularShift.workshopIrregularShifts === 4) { + html += `24-48`; + } + + html += `

`; + } html += `
@@ -156,14 +170,30 @@ function loadEmployeeAjax(groupSettingId) {
ساعت کاری:
`; - itemEmployee.rollCallWorkshopShifts.forEach(function (itemEmployeeShifts) { - htmlEmployee += ` -

- ${itemEmployeeShifts.startTime} - الی - ${itemEmployeeShifts.endTime} -

`; - }); + if (itemEmployee.workshopShiftStatus === 0) { + itemEmployee.rollCallWorkshopShifts.forEach(function (itemEmployeeShifts) { + htmlEmployee += ` +

+ ${itemEmployeeShifts.startTime} + الی + ${itemEmployeeShifts.endTime} +

`; + }); + } else { + htmlEmployee += `

`; + if (itemEmployee.irregularShift.workshopIrregularShifts === 1) { + htmlEmployee += `12-24`; + } else if (itemEmployee.irregularShift.workshopIrregularShifts === 2) { + htmlEmployee += `24-24`; + } else if (itemEmployee.irregularShift.workshopIrregularShifts === 3) { + htmlEmployee += `12-36`; + } else if (itemEmployee.irregularShift.workshopIrregularShifts === 4) { + htmlEmployee += `24-48`; + } + + htmlEmployee += `

`; + } + htmlEmployee += `
@@ -174,7 +204,14 @@ function loadEmployeeAjax(groupSettingId) {
-
+
+
مرخصی مجاز
+
+ ${itemEmployee.leavePermittedDays} +
+
+ +
- - -