diff --git a/Company.Domain/RollCallEmployeeAgg/IRollCallEmployeeRepository.cs b/Company.Domain/RollCallEmployeeAgg/IRollCallEmployeeRepository.cs index 42035647..9e1edbbf 100644 --- a/Company.Domain/RollCallEmployeeAgg/IRollCallEmployeeRepository.cs +++ b/Company.Domain/RollCallEmployeeAgg/IRollCallEmployeeRepository.cs @@ -13,4 +13,10 @@ public interface IRollCallEmployeeRepository : IRepository GetByEmployeeIdWithStatuses(long employeeId); + List GetActivePersonnelByWorkshopId(long workshopId); + #endregion } \ No newline at end of file diff --git a/CompanyManagment.App.Contracts/RollCallEmployee/IRollCallEmployeeApplication.cs b/CompanyManagment.App.Contracts/RollCallEmployee/IRollCallEmployeeApplication.cs index a8dad668..3e204ea0 100644 --- a/CompanyManagment.App.Contracts/RollCallEmployee/IRollCallEmployeeApplication.cs +++ b/CompanyManagment.App.Contracts/RollCallEmployee/IRollCallEmployeeApplication.cs @@ -13,5 +13,7 @@ public interface IRollCallEmployeeApplication EditRollCallEmployee GetDetails(long id); RollCallEmployeeViewModel GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId); List GetPersonnelRollCallList(long workshopId); + List GetActivePersonnelByWorkshopId(long workshopId); + bool IsEmployeeRollCallActive(long employeeId, long workshopId); int activedPerson(long workshopId); } \ No newline at end of file diff --git a/CompanyManagment.App.Contracts/RollCallEmployee/RollCallEmployeeViewModel.cs b/CompanyManagment.App.Contracts/RollCallEmployee/RollCallEmployeeViewModel.cs index 1d142c8d..43f97c3d 100644 --- a/CompanyManagment.App.Contracts/RollCallEmployee/RollCallEmployeeViewModel.cs +++ b/CompanyManagment.App.Contracts/RollCallEmployee/RollCallEmployeeViewModel.cs @@ -2,6 +2,7 @@ using CompanyManagment.App.Contracts.Workshop; using System.Collections.Generic; using System; +using CompanyManagment.App.Contracts.RollCallEmployeeStatus; namespace CompanyManagment.App.Contracts.RollCallEmployee; @@ -29,4 +30,5 @@ public class RollCallEmployeeViewModel : EditRollCallEmployee public string YearsOptions { get; set; } public string EmployeeSlug { get; set; } public List PersonnelInfoViewModels { get; set; } + public IEnumerable Statuses { get; set; } } \ No newline at end of file diff --git a/CompanyManagment.App.Contracts/RollCallEmployeeStatus/RollCallEmployeeStatusViewModel.cs b/CompanyManagment.App.Contracts/RollCallEmployeeStatus/RollCallEmployeeStatusViewModel.cs index 04c0b59a..f515f025 100644 --- a/CompanyManagment.App.Contracts/RollCallEmployeeStatus/RollCallEmployeeStatusViewModel.cs +++ b/CompanyManagment.App.Contracts/RollCallEmployeeStatus/RollCallEmployeeStatusViewModel.cs @@ -1,9 +1,13 @@ -namespace CompanyManagment.App.Contracts.RollCallEmployeeStatus +using System; + +namespace CompanyManagment.App.Contracts.RollCallEmployeeStatus { public class RollCallEmployeeStatusViewModel { public long Id { get; set; } public string StartDate { get; set; } public string EndDate { get; set; } - } + public DateTime StartDateGr { get; set; } + public DateTime EndDateGr { get; set; } + } } diff --git a/CompanyManagment.Application/RollCallEmployeeApplication.cs b/CompanyManagment.Application/RollCallEmployeeApplication.cs index d8776c6d..f3bdb303 100644 --- a/CompanyManagment.Application/RollCallEmployeeApplication.cs +++ b/CompanyManagment.Application/RollCallEmployeeApplication.cs @@ -2,6 +2,7 @@ using Company.Domain.EmployeeAgg; using Company.Domain.LeftWorkAgg; using Company.Domain.RollCallEmployeeAgg; +using Company.Domain.RollCallEmployeeStatusAgg; using CompanyManagment.App.Contracts.RollCallEmployee; using CompanyManagment.App.Contracts.RollCallEmployeeStatus; using System; @@ -16,13 +17,15 @@ public class RollCallEmployeeApplication : IRollCallEmployeeApplication private readonly IRollCallEmployeeStatusApplication _rollCallEmployeeStatusApplication; private readonly IEmployeeRepository _employeeRepository; private readonly ILeftWorkRepository _leftWorkRepository; + private readonly IRollCallEmployeeStatusRepository _rollCallEmployeeStatusRepository; - public RollCallEmployeeApplication(IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, ILeftWorkRepository leftWorkRepository) + public RollCallEmployeeApplication(IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, ILeftWorkRepository leftWorkRepository, IRollCallEmployeeStatusRepository rollCallEmployeeStatusRepository) { _rollCallEmployeeRepository = rollCallEmployeeRepository; _employeeRepository = employeeRepository; _rollCallEmployeeStatusApplication = rollCallEmployeeStatusApplication; _leftWorkRepository = leftWorkRepository; + _rollCallEmployeeStatusRepository = rollCallEmployeeStatusRepository; } public OperationResult Create(CreateRollCallEmployee command) @@ -119,4 +122,26 @@ public class RollCallEmployeeApplication : IRollCallEmployeeApplication { return _rollCallEmployeeRepository.activedPerson(workshopId); } + + #region Pooya + + public List GetActivePersonnelByWorkshopId(long workshopId) + { + return _rollCallEmployeeRepository.GetActivePersonnelByWorkshopId(workshopId); + } + + + public bool IsEmployeeRollCallActive(long employeeId, long workshopId) + { + RollCallEmployeeViewModel rollCallEmployee = _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(employeeId, workshopId); + if (rollCallEmployee == null || rollCallEmployee.IsActiveString != "true" || rollCallEmployee.HasUploadedImage != "true") + return false; + var now = DateTime.Now; + return _rollCallEmployeeStatusRepository.Exists(x => x.RollCallEmployeeId == rollCallEmployee.Id && x.StartDate < now && x.EndDate > now); + + + + } + + #endregion } \ No newline at end of file diff --git a/CompanyManagment.EFCore/Repository/RollCallEmployeeRepository.cs b/CompanyManagment.EFCore/Repository/RollCallEmployeeRepository.cs index 9a667009..634317aa 100644 --- a/CompanyManagment.EFCore/Repository/RollCallEmployeeRepository.cs +++ b/CompanyManagment.EFCore/Repository/RollCallEmployeeRepository.cs @@ -6,6 +6,7 @@ using _0_Framework.Application; using _0_Framework.InfraStructure; using Company.Domain.RollCallEmployeeAgg; using CompanyManagment.App.Contracts.RollCallEmployee; +using CompanyManagment.App.Contracts.RollCallEmployeeStatus; using Microsoft.AspNetCore.Hosting; using Microsoft.EntityFrameworkCore; @@ -207,4 +208,45 @@ public class RollCallEmployeeRepository : RepositoryBase { return _context.RollCallEmployees.Count(x => x.WorkshopId == workshopId && x.IsActiveString == "true" && x.HasUploadedImage == "true"); } + + #region Pooya + public List 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 List GetActivePersonnelByWorkshopId(long workshopId) + { + var rollCallEmployeeIdQuery = _context.RollCallEmployees.Where(x => x.WorkshopId == workshopId + && x.IsActiveString == "true" && x.HasUploadedImage == "true"); + + var personnel = + _context.PersonnelCodeSet.Include(x => x.Employee).Where(x => rollCallEmployeeIdQuery.Any(y => y.EmployeeId == x.EmployeeId)); + + return personnel.Select(x => new RollCallEmployeeViewModel() + { + PersonelCode = x.PersonnelCode, + EmployeeFullName = $"{x.Employee.FName} {x.Employee.LName}", + }).ToList(); + + } + + #endregion } \ No newline at end of file diff --git a/ServiceHost/Areas/Camera/Pages/Index.cshtml b/ServiceHost/Areas/Camera/Pages/Index.cshtml index 4e2e851b..11c95b2f 100644 --- a/ServiceHost/Areas/Camera/Pages/Index.cshtml +++ b/ServiceHost/Areas/Camera/Pages/Index.cshtml @@ -45,7 +45,21 @@
-
+
+
+ +
+
@@ -66,7 +80,7 @@
-

لطفا کد پرسنلی خود را وارد کنید.

+

لطفا کد پرسنلی خود را وارد کنید

@@ -120,17 +134,19 @@

9

-
+
+
- +
-
+
+

0

-
-
- +
+
+ تائید
@@ -146,7 +162,6 @@

برای ساعات حضور و غیاب میباست از گوشی استفاده نمایید!

-
@@ -156,7 +171,8 @@
-
+
+
@@ -268,12 +284,20 @@
*@ + + @section Script { @* *@ @* *@ + \ No newline at end of file diff --git a/ServiceHost/wwwroot/AssetsCamera/css/Index.css b/ServiceHost/wwwroot/AssetsCamera/css/Index.css index f6405302..9dbde0eb 100644 --- a/ServiceHost/wwwroot/AssetsCamera/css/Index.css +++ b/ServiceHost/wwwroot/AssetsCamera/css/Index.css @@ -198,15 +198,14 @@ canvas { .keypad.dark { background-color: #222831; - border-top: 1px solid #0f172a; + /*border-top: 1px solid #0f172a;*/ } .keypad { - overflow: hidden; + /*overflow: hidden;*/ position: relative; width: 100%; margin: 0 0 18px 0; - display: flex; flex-direction: column; justify-content: space-between; /* Space out the keypad elements */ @@ -241,7 +240,7 @@ canvas { } .keypad .keypad-input-field:after { - background-color: rgba(0, 0, 0, 0.2); + /*background-color: rgba(0, 0, 0, 0.2);*/ bottom: 0px; content: ''; height: 1px; @@ -250,9 +249,9 @@ canvas { width: 100%; } -.keypad.dark .keypad-input-field:after { +/*.keypad.dark .keypad-input-field:after { background-color: rgba(255, 255, 255, 0.2); -} +}*/ .keypad .entered-numbers-wrapper { height: 45px; @@ -261,6 +260,8 @@ canvas { position: absolute; top: 5px; width: 100%; + background-color: #171717; + border-radius: 10px; } .keypad .entered-numbers { @@ -272,6 +273,7 @@ canvas { transform: translateX(-50%); white-space: nowrap; direction: ltr; + width: 100%; } .keypad .num { @@ -287,6 +289,9 @@ canvas { text-align: center; transition: all 0.25s; width: 12px; + -webkit-user-select: none; /* Safari */ + -ms-user-select: none; /* IE 10 and IE 11 */ + user-select: none; /* Standard syntax */ } .keypad.dark .num { @@ -385,14 +390,17 @@ canvas { } .keypad .keypad-numbers { - display: flex; - flex-wrap: wrap; + /*display: flex; + flex-wrap: wrap;*/ + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 auto; margin-top: 10px; position: relative; width: 90%; height: 100%; direction: ltr; + gap: 10px; } .keypad .item-wrapper { @@ -402,7 +410,10 @@ canvas { position: relative; vertical-align: top; transition: all 0.25s; - width: 33.3%; + width: 100%; + border: 1px solid #3f454c; + border-radius: 10px; + background: #2b333f; } .keypad .item-wrapper.zero { @@ -410,7 +421,8 @@ canvas { /*visibility:hidden*/ } -.keypad .item-wrapper .item { +.keypad .item-wrapper .item, +.keypad .item-wrapper .item1{ position: relative; z-index: 20; height: 100%; @@ -419,6 +431,10 @@ canvas { display: flex; align-items: center; justify-content: center; + color: white; + -webkit-user-select: none; /* Safari */ + -ms-user-select: none; /* IE 10 and IE 11 */ + user-select: none; /* Standard syntax */ } .keypad .item-wrapper .item i {