diff --git a/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs b/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs index 816745a6..92463672 100644 --- a/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs +++ b/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs @@ -266,7 +266,8 @@ public class InstitutionContractPrintViewModel public string TaxPrice { get; set; } public string PaymentPrice { get; set; } public string VerifyCode { get; set; } - public string VerifyDateTime { get; set; } + public string VerifyDate { get; set; } + public string VerifyTime { get; set; } public string VerifierFullName { get; set; } public string VerifierPhoneNumber { get; set; } public LawViewModel LawViewModel { get; set; } diff --git a/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs b/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs index 1d0ecd24..b7435d03 100644 --- a/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs +++ b/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs @@ -2740,7 +2740,8 @@ public class InstitutionContractRepository : RepositoryBase new GetInstitutionVerificationDetailsWorkshopsViewModel() { diff --git a/WorkFlow/Application/WorkFlow.Application/WorkFlowApplication.cs b/WorkFlow/Application/WorkFlow.Application/WorkFlowApplication.cs index 9bed52c5..d644bb5f 100644 --- a/WorkFlow/Application/WorkFlow.Application/WorkFlowApplication.cs +++ b/WorkFlow/Application/WorkFlow.Application/WorkFlowApplication.cs @@ -1,6 +1,7 @@ using _0_Framework.Application; using _0_Framework.Domain.CustomizeCheckoutShared.Enums; using Company.Domain.RollCallAgg.DomainService; +using Company.Domain.WorkshopAgg; using CompanyManagment.App.Contracts.EmployeeDocuments; using WorkFlow.Application.Contracts.RollCallConfirmedAbsence; using WorkFlow.Application.Contracts.RollCallConfirmedWithoutLunchBreak; @@ -23,7 +24,9 @@ public class WorkFlowApplication : IWorkFlowApplication private readonly IRollCallDomainService _rollCallDomainService; private readonly IRollCallConfirmedWithoutLunchBreakRepository _rollCallConfirmedWithoutLunchBreakRepository; private readonly IEmployeeDocumentsApplication _employeeDocumentsApplication; - public WorkFlowApplication(IRollCallConfirmedAbsenceRepository absenceRepository, IWorkFlowRollCallACL rollCallACL, IWorkFlowCheckoutACL checkoutACL, IWorkFlowCustomizedWorkshopSettingsACL customizedWorkshopSettingsACL, IRollCallConfirmedWithoutLunchBreakRepository rollCallConfirmedWithoutLunchBreakRepository, IRollCallDomainService rollCallDomainService, IEmployeeDocumentsApplication employeeDocumentsApplication) + private readonly IWorkshopRepository _workshopRepository; + + public WorkFlowApplication(IRollCallConfirmedAbsenceRepository absenceRepository, IWorkFlowRollCallACL rollCallACL, IWorkFlowCheckoutACL checkoutACL, IWorkFlowCustomizedWorkshopSettingsACL customizedWorkshopSettingsACL, IRollCallConfirmedWithoutLunchBreakRepository rollCallConfirmedWithoutLunchBreakRepository, IRollCallDomainService rollCallDomainService, IEmployeeDocumentsApplication employeeDocumentsApplication, IWorkshopRepository workshopRepository) { _absenceRepository = absenceRepository; _rollCallACL = rollCallACL; @@ -32,6 +35,7 @@ public class WorkFlowApplication : IWorkFlowApplication _rollCallConfirmedWithoutLunchBreakRepository = rollCallConfirmedWithoutLunchBreakRepository; _rollCallDomainService = rollCallDomainService; _employeeDocumentsApplication = employeeDocumentsApplication; + _workshopRepository = workshopRepository; } public async Task CreateRollCallConfirmedAbsence(CreateRollCallConfirmedAbsence command) @@ -416,10 +420,17 @@ public class WorkFlowApplication : IWorkFlowApplication /// public async Task> GetUndefinedRollCalls(long workshopId) { + var now = DateTime.Now; DateTime.Now.Date.AddMonthsFa(-2, out var twoMonthsAgo); + //استثنا برای کارگاه پیتزا امیر برای برای نمایش ندادن کارپوشه قبل از 1 آبان 1404 + if(workshopId == 367 && twoMonthsAgo< new DateTime(2025,10,23)) + { + twoMonthsAgo = new DateTime(2025,10,23); + } + var lastCheckouts = _checkoutACL.GetLastCheckoutsByWorkshopIdForWorkFlow(workshopId, twoMonthsAgo, now); List rollCalls = _rollCallACL.GetUndefinedRollCalls(workshopId, twoMonthsAgo, now.AddDays(-1).Date); var activeEmployees = _rollCallACL.GetActiveWorkshopRollCallEmployees(workshopId, twoMonthsAgo, now); @@ -443,10 +454,17 @@ public class WorkFlowApplication : IWorkFlowApplication /// public async Task> GetRollCallWorkFlowsCutByBgService(long workshopId) { + var now = DateTime.Now; DateTime.Now.Date.AddMonthsFa(-2, out var twoMonthsAgo); + //استثنا برای کارگاه پیتزا امیر برای برای نمایش ندادن کارپوشه قبل از 1 آبان 1404 + if(workshopId == 367 && twoMonthsAgo< new DateTime(2025,10,23)) + { + twoMonthsAgo = new DateTime(2025,10,23); + } + var lastCheckouts = _checkoutACL.GetLastCheckoutsByWorkshopIdForWorkFlow(workshopId, twoMonthsAgo, now); var rollCalls = _rollCallACL.GetRollCallWorkFlowsCutByBgService(workshopId, twoMonthsAgo, now.AddDays(-1).Date); var activeEmployees = _rollCallACL.GetActiveWorkshopRollCallEmployees(workshopId, twoMonthsAgo, now); @@ -468,6 +486,11 @@ public class WorkFlowApplication : IWorkFlowApplication public async Task CountCutByBgServiceLastMonth(long workshopId) { + var workshop = _workshopRepository.Get(workshopId); + + if (workshop == null || workshop.IsStaticCheckout) + return 0; + DateTime lastMonthEnd = ($"{DateTime.Now.ToFarsi().Substring(0, 8)}01").ToGeorgianDateTime().AddDays(-1); var now = lastMonthEnd; var twoMonthsAgo = ($"{lastMonthEnd.ToFarsi().Substring(0, 8)}01").ToGeorgianDateTime(); @@ -496,7 +519,11 @@ public class WorkFlowApplication : IWorkFlowApplication /// public async Task CountAbsentRollCallLastMonth(long workshopId) { - + var workshop = _workshopRepository.Get(workshopId); + + if (workshop == null || workshop.IsStaticCheckout) + return 0; + DateTime lastMonthEnd = ($"{DateTime.Now.ToFarsi().Substring(0, 8)}01").ToGeorgianDateTime().AddDays(-1); var now = lastMonthEnd; var twoMonthsAgo = ($"{lastMonthEnd.ToFarsi().Substring(0, 8)}01").ToGeorgianDateTime(); @@ -558,6 +585,11 @@ public class WorkFlowApplication : IWorkFlowApplication public async Task CountEmployeesWithoutLunchBreakLastMonth(long workshopId) { + var workshop = _workshopRepository.Get(workshopId); + + if (workshop == null || workshop.IsStaticCheckout) + return 0; + DateTime lastMonthEnd = ($"{DateTime.Now.ToFarsi().Substring(0, 8)}01").ToGeorgianDateTime().AddDays(-1); var now = lastMonthEnd; var twoMonthsAgo = ($"{lastMonthEnd.ToFarsi().Substring(0, 8)}01").ToGeorgianDateTime(); @@ -596,6 +628,11 @@ public class WorkFlowApplication : IWorkFlowApplication public async Task CountUndefinedLastMonth(long workshopId) { + var workshop = _workshopRepository.Get(workshopId); + + if (workshop == null || workshop.IsStaticCheckout) + return 0; + DateTime lastMonthEnd = ($"{DateTime.Now.ToFarsi().Substring(0, 8)}01").ToGeorgianDateTime().AddDays(-1); var now = lastMonthEnd; var twoMonthsAgo = ($"{lastMonthEnd.ToFarsi().Substring(0, 8)}01").ToGeorgianDateTime(); @@ -625,11 +662,17 @@ public class WorkFlowApplication : IWorkFlowApplication /// public async Task> GetAbsentRollCallWorkFlows(long workshopId) { - + var now = DateTime.Now; + DateTime.Now.Date.AddMonthsFa(-2, out var twoMonthsAgo); + //استثنا برای کارگاه پیتزا امیر برای برای نمایش ندادن کارپوشه قبل از 1 آبان 1404 + if(workshopId == 367 && twoMonthsAgo< new DateTime(2025,10,23)) + { + twoMonthsAgo = new DateTime(2025,10,23); + } var lastCheckouts = _checkoutACL.GetLastCheckoutsByWorkshopIdForWorkFlow(workshopId, twoMonthsAgo, now); @@ -689,10 +732,16 @@ public class WorkFlowApplication : IWorkFlowApplication /// public async Task> GetEmployeesWithoutLunchBreak(long workshopId) { + var now = DateTime.Now.Date; now.AddMonthsFa(-2, out var twoMonthsAgo); + //استثنا برای کارگاه پیتزا امیر برای برای نمایش ندادن کارپوشه قبل از 1 آبان 1404 + if(workshopId == 367 && twoMonthsAgo< new DateTime(2025,10,23)) + { + twoMonthsAgo = new DateTime(2025,10,23); + } var lastCheckouts = _checkoutACL.GetLastCheckoutsByWorkshopIdForWorkFlow(workshopId, twoMonthsAgo, now); var notSlicedRollCalls = _rollCallACL.GetNotSlicedRollCallsByWorkshopId(workshopId, twoMonthsAgo, now.AddDays(-1).Date); var employeesWithoutBreakTime = _customizedWorkshopSettingsACL.GetEmployeesWithoutBreakTime(workshopId);