From 2d879ce80a61c60056920b7efb39f54a78777a66 Mon Sep 17 00:00:00 2001 From: mahan Date: Sat, 20 Dec 2025 20:06:28 +0330 Subject: [PATCH 1/9] fix: update workshop identification logic in InstitutionContractApplication --- .../InstitutionContractApplication.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CompanyManagment.Application/InstitutionContractApplication.cs b/CompanyManagment.Application/InstitutionContractApplication.cs index c16a634a..2e3e354c 100644 --- a/CompanyManagment.Application/InstitutionContractApplication.cs +++ b/CompanyManagment.Application/InstitutionContractApplication.cs @@ -1557,17 +1557,22 @@ public class InstitutionContractApplication : IInstitutionContractApplication var currentWorkshops = institutionContract.WorkshopGroup.CurrentWorkshops.ToList(); foreach (var createdWorkshop in initialCreatedWorkshops) { - if (currentWorkshops.Any(x => x.InitialWorkshopId == createdWorkshop.id)) + if (currentWorkshops.Any(x => x.WorkshopId == createdWorkshop.WorkshopId)) + { continue; - + } + var currentWorkshop = new InstitutionContractWorkshopCurrent(createdWorkshop.WorkshopName, createdWorkshop.Services.RollCall, createdWorkshop.Services.RollCallInPerson, createdWorkshop.Services.CustomizeCheckout, createdWorkshop.Services.Contract, - createdWorkshop.Services.ContractInPerson, createdWorkshop.Services.Insurance, + createdWorkshop.Services.ContractInPerson, createdWorkshop.Services.Insurance, createdWorkshop.Services.InsuranceInPerson,createdWorkshop.PersonnelCount, createdWorkshop.Price, createdWorkshop.InstitutionContractWorkshopGroupId,createdWorkshop.WorkshopGroup, createdWorkshop.WorkshopId!.Value, createdWorkshop.id); institutionContract.WorkshopGroup.AddCurrentWorkshop(currentWorkshop); + + + } if (institutionContract.WorkshopGroup.InitialWorkshops.All(x => x.WorkshopCreated && x.WorkshopId is > 0)) From b8274933061fa1ca08bfa84c9f6d51c96b829e05 Mon Sep 17 00:00:00 2001 From: mahan Date: Sat, 20 Dec 2025 20:12:31 +0330 Subject: [PATCH 2/9] refactor: remove unused discount-related classes from IInstitutionContractApplicationpnpm --- .../IInstitutionContractApplication.cs | 139 ------------------ 1 file changed, 139 deletions(-) diff --git a/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs b/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs index 03d191f2..424d71b0 100644 --- a/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs +++ b/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs @@ -268,143 +268,4 @@ public interface IInstitutionContractApplication /// Task VerifyInstitutionContractManually(long institutionContractId); -} - -public class InstitutionContractDiscountResponse -{ - public InstitutionContractDiscountOneTimeViewModel OneTime { get; set; } - public InstitutionContractDiscountMonthlyViewModel Monthly { get; set; } -} - -public class InstitutionContractDiscountMonthlyViewModel:InstitutionContractDiscountOneTimeViewModel -{ - public List Installments { get; set; } -} - -public class InstitutionContractDiscountOneTimeViewModel -{ - /// - /// مجموع مبالغ - /// - public string TotalAmount { get; set; } - /// - /// ارزش افزوده - /// - public string Tax { get; set; } - /// - /// مبلغ قابل پرداخت - /// - public string PaymentAmount { get; set; } - - public string DiscountedAmount { get; set; } - - public int DiscountPercetage { get; set; } - - public string Obligation { get; set; } - - public string OneMonthAmount { get; set; } -} - -public class InstitutionContractResetDiscountForCreateRequest -{ - public int DiscountPercentage { get; set; } - public double TotalAmount { get; set; } - public bool IsInstallment { get; set; } - public InstitutionContractDuration Duration { get; set; } - public double OneMonthAmount { get; set; } -} - -public class InstitutionContractSetDiscountForExtensionRequest -{ - public Guid TempId { get; set; } - public int DiscountPercentage { get; set; } - public double TotalAmount { get; set; } - public bool IsInstallment { get; set; } -} -public class InstitutionContractResetDiscountForExtensionRequest -{ - public Guid TempId { get; set; } - public bool IsInstallment { get; set; } -} - - -public class InstitutionContractSetDiscountRequest -{ - public int DiscountPercentage { get; set; } - public double TotalAmount { get; set; } - public InstitutionContractDuration Duration { get; set; } - public double OneMonthAmount { get; set; } - public bool IsInstallment { get; set; } -} - -public class InstitutionContractPrintViewModel -{ - public InstitutionContratVerificationParty FirstParty { get; set; } - public InstitutionContratVerificationParty SecondParty { get; set; } - public string ContractNo { get; set; } - public string CreationDate { get; set; } - public string ContractStart { get; set; } - public string ContractEnd { get; set; } - public List Workshops { get; set; } - public string TotalPrice { get; set; } - public string TaxPrice { get; set; } - public string PaymentPrice { get; set; } - public string OneMonthPrice { get; set; } - public string OneMonthWithoutTax { get; set; } - public string OneMonthTax { get; set; } - public string VerifyCode { 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; } - public string Obligation { get; set; } -} - -public class InsertAmendmentTempWorkshopResponse -{ - public Guid WorkshopTempId { get; set; } - public string Amount { get; set; } -} - -public class InstitutionContractAmendmentWorkshopsResponse -{ - /// - /// - /// - public List Workshops { get; set; } - - public Guid TempId { get; set; } - -} - -public class InstitutionContractSelectListViewModel : SelectListViewModel; - -public class InstitutionContractExtensionInquiryResponse -{ - public long Id { get; set; } - public string FName { get; set; } - public string LName { get; set; } - public string DateOfBirthFa { get; set; } - public string FatherName { get; set; } - public string IdNumberSerial { get; set; } - public string IdNumber { get; set; } - public string Address { get; set; } - public string Phone { get; set; } - public string City { get; set; } - public string State { get; set; } - public long RepresentativeId { get; set; } - public string NationalCode { get; set; } -} - - - -public class InstitutionContractExtensionPaymentMonthly:InstitutionContractExtensionPaymentOneTime -{ - public List Installments { get; set; } -} - -public class InstitutionContractExtensionPaymentOneTime -{ - } \ No newline at end of file From 20dd8f64f46c31281950beef8352f3548013934e Mon Sep 17 00:00:00 2001 From: mahan Date: Sat, 20 Dec 2025 20:28:08 +0330 Subject: [PATCH 3/9] add: include OneMonthWithoutTax and OneMonthTax properties in InstitutionContractPrintViewModel --- .../InstitutionContract/InstitutionContractPrintViewModel.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractPrintViewModel.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractPrintViewModel.cs index 597fd017..df913c85 100644 --- a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractPrintViewModel.cs +++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractPrintViewModel.cs @@ -23,4 +23,6 @@ public class InstitutionContractPrintViewModel public string VerifierPhoneNumber { get; set; } public LawViewModel LawViewModel { get; set; } public string Obligation { get; set; } + public string OneMonthWithoutTax { get; set; } + public string OneMonthTax { get; set; } } \ No newline at end of file From 12fab5a9a592c1403561a4315620e1e2cc249476 Mon Sep 17 00:00:00 2001 From: mahan Date: Sat, 20 Dec 2025 20:57:34 +0330 Subject: [PATCH 4/9] add {id:guid} convention for controllers --- ServiceHost/Conventions/ParameterBindingConvention.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ServiceHost/Conventions/ParameterBindingConvention.cs b/ServiceHost/Conventions/ParameterBindingConvention.cs index ccc0fa73..aded0e88 100644 --- a/ServiceHost/Conventions/ParameterBindingConvention.cs +++ b/ServiceHost/Conventions/ParameterBindingConvention.cs @@ -70,7 +70,8 @@ public class ParameterBindingConvention : IApplicationModelConvention { if (selector.AttributeRouteModel?.Template != null) { - if (selector.AttributeRouteModel.Template.Contains($"{{{parameterName}}}", StringComparison.OrdinalIgnoreCase)) + if (selector.AttributeRouteModel.Template.Contains($"{{{parameterName}}}", StringComparison.OrdinalIgnoreCase) || + selector.AttributeRouteModel.Template.Contains($"{{{parameterName}:", StringComparison.OrdinalIgnoreCase)) return true; } } @@ -80,7 +81,8 @@ public class ParameterBindingConvention : IApplicationModelConvention { if (selector.AttributeRouteModel?.Template != null) { - if (selector.AttributeRouteModel.Template.Contains($"{{{parameterName}}}", StringComparison.OrdinalIgnoreCase)) + if (selector.AttributeRouteModel.Template.Contains($"{{{parameterName}}}", StringComparison.OrdinalIgnoreCase) || + selector.AttributeRouteModel.Template.Contains($"{{{parameterName}:", StringComparison.OrdinalIgnoreCase)) return true; } } From 9cb42b7cef56bc9942b1b7dd67983bf1b46e53a3 Mon Sep 17 00:00:00 2001 From: SamSys Date: Mon, 22 Dec 2025 11:16:50 +0330 Subject: [PATCH 5/9] background job changed --- .../Jobs/JobSchedulerRegistrator.cs | 9 ++++-- .../NullBoardNotificationPublisher.cs | 10 ++++++ .../Program.cs | 3 +- .../InstitutionContractViewModel.cs | 2 ++ .../InstitutionContractRepository.cs | 32 +++++++++++++------ 5 files changed, 42 insertions(+), 14 deletions(-) create mode 100644 BackgroundInstitutionContract/BackgroundInstitutionContract.Task/NullBoardNotificationPublisher.cs diff --git a/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/Jobs/JobSchedulerRegistrator.cs b/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/Jobs/JobSchedulerRegistrator.cs index b97ff4f8..b4487ac7 100644 --- a/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/Jobs/JobSchedulerRegistrator.cs +++ b/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/Jobs/JobSchedulerRegistrator.cs @@ -1,5 +1,6 @@ using _0_Framework.Application; +using _0_Framework.Application.Sms; using Company.Domain.ContarctingPartyAgg; using Company.Domain.InstitutionContractAgg; using Hangfire; @@ -13,13 +14,15 @@ public class JobSchedulerRegistrator private readonly IInstitutionContractRepository _institutionContractRepository; private static DateTime? _lastRunCreateTransaction; private static DateTime? _lastRunSendMonthlySms; + private readonly ISmsService _smsService; - public JobSchedulerRegistrator(SmsReminder smsReminder, IBackgroundJobClient backgroundJobClient, IInstitutionContractRepository institutionContractRepository) + public JobSchedulerRegistrator(SmsReminder smsReminder, IBackgroundJobClient backgroundJobClient, IInstitutionContractRepository institutionContractRepository, ISmsService smsService) { _smsReminder = smsReminder; _backgroundJobClient = backgroundJobClient; _institutionContractRepository = institutionContractRepository; + _smsService = smsService; } public void Register() @@ -91,8 +94,8 @@ public class JobSchedulerRegistrator } catch (Exception e) { - //_smsService.Alarm("09114221321", "خطا-ایجاد سند مالی"); - + await _smsService.Alarm("09114221321", "خطا-ایجاد سند مالی"); + } } diff --git a/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/NullBoardNotificationPublisher.cs b/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/NullBoardNotificationPublisher.cs new file mode 100644 index 00000000..ddb1796b --- /dev/null +++ b/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/NullBoardNotificationPublisher.cs @@ -0,0 +1,10 @@ +using GozareshgirProgramManager.Application.Interfaces; +using GozareshgirProgramManager.Domain.ProjectAgg.Enums; + +public class NullBoardNotificationPublisher:IBoardNotificationPublisher +{ + public Task SendProjectStatusChanged(long userId, TaskSectionStatus oldStatus, TaskSectionStatus newStatus, Guid sectionId) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/Program.cs b/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/Program.cs index 3cb83458..c08fcf29 100644 --- a/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/Program.cs +++ b/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/Program.cs @@ -8,6 +8,7 @@ using BackgroundInstitutionContract.Task.Jobs; using CompanyManagment.App.Contracts.Hubs; using CompanyManagment.EFCore.Services; using GozareshgirProgramManager.Application._Bootstrapper; +using GozareshgirProgramManager.Application.Interfaces; using GozareshgirProgramManager.Application.Modules.Users.Commands.CreateUser; using GozareshgirProgramManager.Infrastructure; using GozareshgirProgramManager.Infrastructure.Persistence.Seed; @@ -31,7 +32,7 @@ builder.Services.AddTransient(); builder.Services.AddTransient(); builder.Services.AddTransient(); builder.Services.Configure(builder.Configuration); - +builder.Services.AddScoped(); #region MongoDb var mongoConnectionSection = builder.Configuration.GetSection("MongoDb"); diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractViewModel.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractViewModel.cs index 2b3032cc..1e7ee84c 100644 --- a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractViewModel.cs +++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractViewModel.cs @@ -76,5 +76,7 @@ public class InstitutionContractViewModel public bool IsInstallment { get; set; } public InstitutionContractVerificationStatus VerificationStatus { get; set; } + public InstitutionContractSigningType? SigningType { get; set; } + public List InstallmentList { get; set; } } \ No newline at end of file diff --git a/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs b/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs index af34b1b3..6ae60e32 100644 --- a/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs +++ b/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs @@ -4364,6 +4364,7 @@ public class InstitutionContractRepository : RepositoryBase new InstitutionContractInstallmentViewModel { AmountDouble = ins.Amount, InstallmentDateGr = ins.InstallmentDateGr }) .OrderBy(ins => ins.InstallmentDateGr).Skip(1).ToList(), }).Where(x => - x.ContractStartGr < endOfMonthGr && x.ContractEndGr >= endOfMonthGr && x.ContractAmountDouble > 0) + x.ContractStartGr < endOfMonthGr && x.ContractEndGr >= endOfMonthGr && x.ContractAmountDouble > 0 && x.VerificationStatus != InstitutionContractVerificationStatus.PendingForVerify) .ToListAsync(); #endregion @@ -4438,13 +4440,13 @@ public class InstitutionContractRepository : RepositoryBase futureContractIds = futureContracts.Select(x => x.ContractingPartyId).ToList(); List deatcivedContract = await _context.InstitutionContractSet .Where(x => x.IsActiveString == "false" && futureContractIds.Contains(x.ContractingPartyId) && - x.ContractEndGr.Date == endOfCurrentMonth.Date && x.ContractAmount > 0) + x.ContractEndGr.Date == endOfCurrentMonth.Date && x.ContractAmount > 0 && x.VerificationStatus != InstitutionContractVerificationStatus.PendingForVerify) .Select(x => new InstitutionContractViewModel { Id = x.id, @@ -4459,6 +4461,7 @@ public class InstitutionContractRepository : RepositoryBase new InstitutionContractInstallmentViewModel { AmountDouble = ins.Amount, InstallmentDateGr = ins.InstallmentDateGr }) @@ -4469,6 +4472,12 @@ public class InstitutionContractRepository : RepositoryBase + x.SigningType != InstitutionContractSigningType.Legacy && x.IsInstallment == false && x.SigningType != null).ToList(); + + //حذف قراداد هایی که یکجا پرداخت شده اند از لیست ایجاد سند ماهانه + institutionContracts = institutionContracts.Except(paidInFull).ToList(); #region RollCallServicCompute @@ -4516,8 +4525,7 @@ public class InstitutionContractRepository : RepositoryBase @@ -4551,8 +4559,7 @@ public class InstitutionContractRepository : RepositoryBase @@ -4579,12 +4586,17 @@ public class InstitutionContractRepository : RepositoryBase x.ContractingPartyId == item.ContractingPartyId) .Select(x => x.id).ToListAsync(); From 19a72ac78dc08148964a3f709d255f2c3a9fe562 Mon Sep 17 00:00:00 2001 From: SamSys Date: Mon, 22 Dec 2025 12:35:51 +0330 Subject: [PATCH 6/9] load data and create service percentage --- .../IPlanPercentageRepository.cs | 7 ++ .../InstitutionPlan/CreateServiceAmountDto.cs | 51 +++++++++++++++ .../IInstitutionPlanApplication.cs | 19 +++++- .../InstitutionPlanApplication.cs | 65 +++++++++++++++++++ .../Repository/PlanPercentageRepository.cs | 21 ++++++ .../Controllers/ServiceAmountsManagement.cs | 52 +++++++++++++++ 6 files changed, 213 insertions(+), 2 deletions(-) create mode 100644 CompanyManagment.App.Contracts/InstitutionPlan/CreateServiceAmountDto.cs create mode 100644 ServiceHost/Areas/Admin/Controllers/ServiceAmountsManagement.cs diff --git a/Company.Domain/InstitutionPlanAgg/IPlanPercentageRepository.cs b/Company.Domain/InstitutionPlanAgg/IPlanPercentageRepository.cs index b8406a4f..ad2575f3 100644 --- a/Company.Domain/InstitutionPlanAgg/IPlanPercentageRepository.cs +++ b/Company.Domain/InstitutionPlanAgg/IPlanPercentageRepository.cs @@ -2,6 +2,7 @@ using CompanyManagment.App.Contracts.InstitutionPlan; using CompanyManagment.App.Contracts.TemporaryClientRegistration; using System.Collections.Generic; +using System.Threading.Tasks; namespace Company.Domain.InstitutionPlanAgg; @@ -26,4 +27,10 @@ public interface IPlanPercentageRepository : IRepository /// /// InstitutionPlanViewModel GetInstitutionPlanForWorkshop(WorkshopTempViewModel command); + + /// + /// دریافت دیتای مودال ایجاد + /// + /// + Task GetCreateModalData(); } \ No newline at end of file diff --git a/CompanyManagment.App.Contracts/InstitutionPlan/CreateServiceAmountDto.cs b/CompanyManagment.App.Contracts/InstitutionPlan/CreateServiceAmountDto.cs new file mode 100644 index 00000000..6800b2f5 --- /dev/null +++ b/CompanyManagment.App.Contracts/InstitutionPlan/CreateServiceAmountDto.cs @@ -0,0 +1,51 @@ +namespace CompanyManagment.App.Contracts.InstitutionPlan; + +public class CreateServiceAmountDto +{ + /// + /// آی دی + /// + public long Id { get; set; } + + /// + /// قرارداد و تصفیه + /// درصد از مزد روزانه + /// string + /// + public string ContractAndCheckoutPercentStr { get; set; } + + /// + /// بیمه + /// درصد از مزد روزانه + /// string + /// + public string InsurancePercentStr { get; set; } + + /// + /// حضورغباب + /// درصد از مزد روزانه + /// string + /// + public string RollCallPercentStr { get; set; } + + /// + /// فیش غیر رسمی + /// درصد از مزد روزانه + /// string + /// + public string CustomizeCheckoutPercentStr { get; set; } + + /// + /// خدمات حضوری قرداد و تصفیه + /// درصد از مزد روزانه + /// string + /// + public string ContractAndCheckoutInPersonPercentStr { get; set; } + + /// + /// خدمات حضوری بیمه + /// درصد از مزد روزانه + /// string + /// + public string InsuranceInPersonPercentStr { get; set; } +} \ No newline at end of file diff --git a/CompanyManagment.App.Contracts/InstitutionPlan/IInstitutionPlanApplication.cs b/CompanyManagment.App.Contracts/InstitutionPlan/IInstitutionPlanApplication.cs index 2e2293c0..2eb91460 100644 --- a/CompanyManagment.App.Contracts/InstitutionPlan/IInstitutionPlanApplication.cs +++ b/CompanyManagment.App.Contracts/InstitutionPlan/IInstitutionPlanApplication.cs @@ -1,6 +1,7 @@ -using System.Collections.Generic; -using _0_Framework.Application; +using _0_Framework.Application; using CompanyManagment.App.Contracts.TemporaryClientRegistration; +using System.Collections.Generic; +using System.Threading.Tasks; namespace CompanyManagment.App.Contracts.InstitutionPlan; @@ -34,4 +35,18 @@ public interface IInstitutionPlanApplication /// /// InstitutionPlanViewModel GetInstitutionPlanForWorkshop(WorkshopTempViewModel command); + + + /// + /// دریافت دیتای درصد سرویس برای مودال ایجاد + /// + /// + Task GetCreateModalData(); + + /// + /// ایجاد درصد سرویس + /// + /// + /// + Task CreateInstitutionPlanPercentage(CreateServiceAmountDto command); } \ No newline at end of file diff --git a/CompanyManagment.Application/InstitutionPlanApplication.cs b/CompanyManagment.Application/InstitutionPlanApplication.cs index 6137c992..53e2f1f7 100644 --- a/CompanyManagment.Application/InstitutionPlanApplication.cs +++ b/CompanyManagment.Application/InstitutionPlanApplication.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Threading.Tasks; using _0_Framework.Application; using Company.Domain.InstitutionPlanAgg; using CompanyManagment.App.Contracts.InstitutionPlan; @@ -84,4 +85,68 @@ public class InstitutionPlanApplication : IInstitutionPlanApplication { return _planPercentageRepository.GetInstitutionPlanForWorkshop(command); } + + + #region ForApi + + public async Task GetCreateModalData() + { + return await _planPercentageRepository.GetCreateModalData(); + } + + + public async Task CreateInstitutionPlanPercentage(CreateServiceAmountDto command) + { + var op = new OperationResult(); + if (string.IsNullOrWhiteSpace(command.ContractAndCheckoutInPersonPercentStr) || command.ContractAndCheckoutInPersonPercentStr == "0" || + string.IsNullOrWhiteSpace(command.ContractAndCheckoutPercentStr) || (command.ContractAndCheckoutPercentStr == "0" || + string.IsNullOrWhiteSpace(command.CustomizeCheckoutPercentStr) || command.CustomizeCheckoutPercentStr == "0" || + string.IsNullOrWhiteSpace(command.InsuranceInPersonPercentStr) || command.InsuranceInPersonPercentStr == "0" || + string.IsNullOrWhiteSpace(command.InsurancePercentStr) || command.InsurancePercentStr == "0" || + string.IsNullOrWhiteSpace(command.RollCallPercentStr) || command.RollCallPercentStr == "0")) + return op.Failed("هیچ یک از فیلدها نمیتوانند صفر باشند"); + + int contractAndCheckoutInPersonPercent = 0; + int contractAndCheckoutPercent = 0; + int customizeCheckoutPercent = 0; + int insuranceInPersonPercent = 0; + int insurancePercent = 0; + int rollCallPercent = 0; + + try + { + contractAndCheckoutInPersonPercent = Convert.ToInt32(command.ContractAndCheckoutInPersonPercentStr); + contractAndCheckoutPercent = Convert.ToInt32(command.ContractAndCheckoutPercentStr); + customizeCheckoutPercent = Convert.ToInt32(command.CustomizeCheckoutPercentStr); + insuranceInPersonPercent = Convert.ToInt32(command.InsuranceInPersonPercentStr); + insurancePercent = Convert.ToInt32(command.InsurancePercentStr); + rollCallPercent = Convert.ToInt32(command.RollCallPercentStr); + } + catch (Exception e) + { + return op.Failed("لطفا عدد معتبر وارد کنید"); + + } + + var firstPlan =await _planPercentageRepository.GetCreateModalData(); + if (firstPlan != null) + { + var planPercentage = _planPercentageRepository.Get(firstPlan.Id); + planPercentage.Edit(contractAndCheckoutPercent, insurancePercent, rollCallPercent, customizeCheckoutPercent, contractAndCheckoutInPersonPercent, insuranceInPersonPercent); + _planPercentageRepository.SaveChanges(); + } + else + { + var create = new PlanPercentage(contractAndCheckoutPercent, insurancePercent, rollCallPercent, + customizeCheckoutPercent, contractAndCheckoutInPersonPercent, insuranceInPersonPercent); + await _planPercentageRepository.CreateAsync(create); + await _planPercentageRepository.SaveChangesAsync(); + } + + + + return op.Succcedded(); + } + + #endregion } \ No newline at end of file diff --git a/CompanyManagment.EFCore/Repository/PlanPercentageRepository.cs b/CompanyManagment.EFCore/Repository/PlanPercentageRepository.cs index 2657de37..91b2366b 100644 --- a/CompanyManagment.EFCore/Repository/PlanPercentageRepository.cs +++ b/CompanyManagment.EFCore/Repository/PlanPercentageRepository.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; using _0_Framework.Application; using _0_Framework.InfraStructure; using Company.Domain.InstitutionPlanAgg; @@ -44,6 +45,7 @@ public class PlanPercentageRepository : RepositoryBase, IP }).FirstOrDefault(); } + public List GetInstitutionPlanList(int pageIndex, int countPeron) { var planPercentage = _context.PlanPercentages.FirstOrDefault(); @@ -303,4 +305,23 @@ public class PlanPercentageRepository : RepositoryBase, IP return new InstitutionPlanViewModel(); } + + + #region ForApi + + public async Task GetCreateModalData() + { + return await _context.PlanPercentages.Select(x => new CreateServiceAmountDto() + { + Id = x.id, + ContractAndCheckoutInPersonPercentStr = $"{x.ContractAndCheckoutInPersonPercent}", + CustomizeCheckoutPercentStr = $"{x.CustomizeCheckoutPercent}", + ContractAndCheckoutPercentStr = $"{x.ContractAndCheckoutPercent}", + InsuranceInPersonPercentStr = $"{x.InsuranceInPersonPercent}", + InsurancePercentStr = $"{x.InsurancePercent}", + RollCallPercentStr = $"{x.RollCallPercent}", + }).FirstOrDefaultAsync(); + } + + #endregion } \ No newline at end of file diff --git a/ServiceHost/Areas/Admin/Controllers/ServiceAmountsManagement.cs b/ServiceHost/Areas/Admin/Controllers/ServiceAmountsManagement.cs new file mode 100644 index 00000000..edfc1416 --- /dev/null +++ b/ServiceHost/Areas/Admin/Controllers/ServiceAmountsManagement.cs @@ -0,0 +1,52 @@ +using _0_Framework.Application; +using AccountManagement.Application.Contracts.Ticket; +using CompanyManagment.App.Contracts.InstitutionPlan; +using CompanyManagment.App.Contracts.Workshop; +using Microsoft.AspNetCore.Mvc; +using ServiceHost.BaseControllers; + +namespace ServiceHost.Areas.Admin.Controllers; + +public class ServiceAmountsManagement : AdminBaseController +{ + private readonly IInstitutionPlanApplication _institutionPlanApplication; + private readonly IAuthHelper _authHelper; + + public ServiceAmountsManagement(IInstitutionPlanApplication institutionPlanApplication, IAuthHelper authHelper) + { + _institutionPlanApplication = institutionPlanApplication; + _authHelper = authHelper; + } + + + /// + /// دریافت دیتای مودال ایجاد + /// + /// + [HttpGet("GetCreateModalData")] + public async Task> GetCreateModalData() + { + if(!_authHelper.HasPermission(315)) + return Forbid(); + var data = await _institutionPlanApplication.GetCreateModalData(); + + return data; + } + + /// + /// ذخیره درصدها + /// + /// + /// + [HttpPost("CreateServicePercentage")] + public async Task> CreateServicePercentage([FromBody] CreateServiceAmountDto command) + { + + if (!_authHelper.HasPermission(315)) + return new OperationResult().Failed("اجازه دسترسی ندارید"); + + var result = await _institutionPlanApplication.CreateInstitutionPlanPercentage(command); + + return result; + } +} \ No newline at end of file From 68b42c98d68e73b432174de711e07d6ac9c93e4c Mon Sep 17 00:00:00 2001 From: SamSys Date: Mon, 22 Dec 2025 13:24:53 +0330 Subject: [PATCH 7/9] changes --- .../InstitutionContract.cs | 2 +- .../IInstitutionContractApplication.cs | 96 ------------------- .../InstitutionContractApplication.cs | 3 +- .../InstitutionContractRepository.cs | 14 +-- .../Controllers/ServiceAmountsManagement.cs | 4 + 5 files changed, 14 insertions(+), 105 deletions(-) diff --git a/Company.Domain/InstitutionContractAgg/InstitutionContract.cs b/Company.Domain/InstitutionContractAgg/InstitutionContract.cs index 159fda16..3d4ba428 100644 --- a/Company.Domain/InstitutionContractAgg/InstitutionContract.cs +++ b/Company.Domain/InstitutionContractAgg/InstitutionContract.cs @@ -276,7 +276,7 @@ public class InstitutionContract : EntityBase { Amendments.Add(amendment); } -} + public void SetSigningType(InstitutionContractSigningType signingType) { SigningType = signingType; diff --git a/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs b/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs index 468d1ebc..43928b66 100644 --- a/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs +++ b/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs @@ -259,7 +259,6 @@ public interface IInstitutionContractApplication /// Task PrintOneAsync(long id); - Task SetPendingWorkflow(long entityId); Task GetContractWorkshopsDetails(long id); @@ -272,34 +271,6 @@ public interface IInstitutionContractApplication /// /// Task VerifyInstitutionContractManually(long institutionContractId); - - - public string TotalAmount { get; set; } - /// - /// ارزش افزوده - /// - public string Tax { get; set; } - /// - /// مبلغ قابل پرداخت - /// - public string PaymentAmount { get; set; } - - public string DiscountedAmount { get; set; } - - public int DiscountPercetage { get; set; } - - public string Obligation { get; set; } - - public string OneMonthAmount { get; set; } -} - -public class InstitutionContractResetDiscountForCreateRequest -{ - public int DiscountPercentage { get; set; } - public double TotalAmount { get; set; } - public bool IsInstallment { get; set; } - public InstitutionContractDuration Duration { get; set; } - public double OneMonthAmount { get; set; } } public class GetInstitutionAmendmentVerificationDetailsViewModel @@ -319,30 +290,6 @@ public class GetInstitutionAmendmentVerificationDetailsViewModel } - -public class InstitutionContractSetDiscountForExtensionRequest -{ - public Guid TempId { get; set; } - public int DiscountPercentage { get; set; } - public double TotalAmount { get; set; } - public bool IsInstallment { get; set; } -} -public class InstitutionContractResetDiscountForExtensionRequest -{ - public Guid TempId { get; set; } - public bool IsInstallment { get; set; } -} - - -public class InstitutionContractSetDiscountRequest -{ - public int DiscountPercentage { get; set; } - public double TotalAmount { get; set; } - public InstitutionContractDuration Duration { get; set; } - public double OneMonthAmount { get; set; } - public bool IsInstallment { get; set; } -} - public class InstitutionContractAmendmentCompleteRequest { public Guid TempId { get; set; } @@ -357,46 +304,3 @@ public class GetInstitutionContractWorkshopsDetails public List Workshops { get; set; } } - - -public class InstitutionContractPrintViewModel -{ - public InstitutionContratVerificationParty FirstParty { get; set; } - public InstitutionContratVerificationParty SecondParty { get; set; } - public string ContractNo { get; set; } - public string CreationDate { get; set; } - public string ContractStart { get; set; } - public string ContractEnd { get; set; } - public List Workshops { get; set; } - public string TotalPrice { get; set; } - public string TaxPrice { get; set; } - public string PaymentPrice { get; set; } - public string VerifyCode { 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; } - public string Obligation { get; set; } -} - -public class InsertAmendmentTempWorkshopResponse -{ - public Guid WorkshopTempId { get; set; } - public string Amount { get; set; } -} - -public class InstitutionContractAmendmentWorkshopsResponse -{ - /// - /// - /// - public List Workshops { get; set; } - - public Guid TempId { get; set; } - -} - -public class InstitutionContractSelectListViewModel : SelectListViewModel; - -} \ No newline at end of file diff --git a/CompanyManagment.Application/InstitutionContractApplication.cs b/CompanyManagment.Application/InstitutionContractApplication.cs index edd04758..ad369caf 100644 --- a/CompanyManagment.Application/InstitutionContractApplication.cs +++ b/CompanyManagment.Application/InstitutionContractApplication.cs @@ -1537,6 +1537,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication return (await _institutionContractRepository.PrintAllAsync([id])).FirstOrDefault(); } + public async Task SetPendingWorkflow(long entityId,InstitutionContractSigningType signingType) { var op = new OperationResult(); @@ -1568,7 +1569,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication createdWorkshop.Services.ContractInPerson, createdWorkshop.Services.Insurance, createdWorkshop.Services.InsuranceInPerson,createdWorkshop.PersonnelCount, createdWorkshop.Price, createdWorkshop.InstitutionContractWorkshopGroupId,createdWorkshop.WorkshopGroup, - createdWorkshop.WorkshopId!.Value, createdWorkshop.id); + createdWorkshop.WorkshopId!.Value, false,createdWorkshop.id); institutionContract.WorkshopGroup.AddCurrentWorkshop(currentWorkshop); diff --git a/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs b/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs index a979c6ec..3050b957 100644 --- a/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs +++ b/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs @@ -3387,13 +3387,13 @@ public class InstitutionContractRepository : RepositoryBasex.Id == amendmentTemp.Id); await _context.SaveChangesAsync(); diff --git a/ServiceHost/Areas/Admin/Controllers/ServiceAmountsManagement.cs b/ServiceHost/Areas/Admin/Controllers/ServiceAmountsManagement.cs index edfc1416..81e32e2b 100644 --- a/ServiceHost/Areas/Admin/Controllers/ServiceAmountsManagement.cs +++ b/ServiceHost/Areas/Admin/Controllers/ServiceAmountsManagement.cs @@ -1,5 +1,6 @@ using _0_Framework.Application; using AccountManagement.Application.Contracts.Ticket; +using CompanyManagment.App.Contracts.InstitutionContract; using CompanyManagment.App.Contracts.InstitutionPlan; using CompanyManagment.App.Contracts.Workshop; using Microsoft.AspNetCore.Mvc; @@ -49,4 +50,7 @@ public class ServiceAmountsManagement : AdminBaseController return result; } + + + } \ No newline at end of file From 82bf10c2d5d061c5790357f8074ae8c5d5c96c9e Mon Sep 17 00:00:00 2001 From: SamSys Date: Mon, 22 Dec 2025 14:21:01 +0330 Subject: [PATCH 8/9] ServiceAmount GetList --- .../IPlanPercentageRepository.cs | 11 ++- .../IInstitutionPlanApplication.cs | 9 ++ .../InstitutionPlan/InstitutionPlanListDto.cs | 84 ++++++++++++++++ .../InstitutionPlanSearchModel.cs | 11 +++ .../InstitutionPlanApplication.cs | 5 + .../Repository/PlanPercentageRepository.cs | 97 +++++++++++++++++-- .../Controllers/ServiceAmountsManagement.cs | 13 ++- 7 files changed, 222 insertions(+), 8 deletions(-) create mode 100644 CompanyManagment.App.Contracts/InstitutionPlan/InstitutionPlanListDto.cs create mode 100644 CompanyManagment.App.Contracts/InstitutionPlan/InstitutionPlanSearchModel.cs diff --git a/Company.Domain/InstitutionPlanAgg/IPlanPercentageRepository.cs b/Company.Domain/InstitutionPlanAgg/IPlanPercentageRepository.cs index ad2575f3..9395f968 100644 --- a/Company.Domain/InstitutionPlanAgg/IPlanPercentageRepository.cs +++ b/Company.Domain/InstitutionPlanAgg/IPlanPercentageRepository.cs @@ -1,4 +1,5 @@ -using _0_Framework.Domain; +using _0_Framework.Application; +using _0_Framework.Domain; using CompanyManagment.App.Contracts.InstitutionPlan; using CompanyManagment.App.Contracts.TemporaryClientRegistration; using System.Collections.Generic; @@ -33,4 +34,12 @@ public interface IPlanPercentageRepository : IRepository /// /// Task GetCreateModalData(); + + /// + /// دریافت لیست مبالغ سرویس ها + /// + /// + /// + Task> GetList( + InstitutionPlanSearchModel searchModel); } \ No newline at end of file diff --git a/CompanyManagment.App.Contracts/InstitutionPlan/IInstitutionPlanApplication.cs b/CompanyManagment.App.Contracts/InstitutionPlan/IInstitutionPlanApplication.cs index 2eb91460..0a359530 100644 --- a/CompanyManagment.App.Contracts/InstitutionPlan/IInstitutionPlanApplication.cs +++ b/CompanyManagment.App.Contracts/InstitutionPlan/IInstitutionPlanApplication.cs @@ -49,4 +49,13 @@ public interface IInstitutionPlanApplication /// /// Task CreateInstitutionPlanPercentage(CreateServiceAmountDto command); + + + /// + /// دریافت لیست مبالغ سرویس ها + /// + /// + /// + Task> GetList( + InstitutionPlanSearchModel searchModel); } \ No newline at end of file diff --git a/CompanyManagment.App.Contracts/InstitutionPlan/InstitutionPlanListDto.cs b/CompanyManagment.App.Contracts/InstitutionPlan/InstitutionPlanListDto.cs new file mode 100644 index 00000000..d8d9f389 --- /dev/null +++ b/CompanyManagment.App.Contracts/InstitutionPlan/InstitutionPlanListDto.cs @@ -0,0 +1,84 @@ +namespace CompanyManagment.App.Contracts.InstitutionPlan; + +public class InstitutionPlanListDto +{ + + + /// + /// تعداد پرسنل + /// + public int CountPerson { get; set; } + + /// + /// مبلغ قرارداد و تصفیه + /// + public string ContractAndCheckout { get; set; } + + /// + /// مبلغ بیمه + /// + public string Insurance { get; set; } + + /// + /// مبلغ حضورغباب + /// + public string RollCall { get; set; } + + /// + /// مبلغ فیش غیر رسمی + /// + public string CustomizeCheckout { get; set; } + + /// + /// مبلغ خدمات حضوری قرداد و تصفیه + /// + public string ContractAndCheckoutInPerson { get; set; } + + /// + /// مبلغ خدمات حضوری بیمه + /// + public string InsuranceInPerson { get; set; } + + + + + #region Total + + + /// + /// مبلغ کل خدمات حضوری + /// + public string InPersonSumAmountStr { get; set; } + + /// + /// مبلغ کل خدمات آنلاین + /// + public string OnlineOnlySumAmountStr { get; set; } + + /// + /// مبلغ کل خدمات حضوری و آنلاین + /// + public string OnlineAndInPersonSumAmountStr { get; set; } + + /// + /// مبلغ کل خدمات حضوری و آنلاین + /// double + /// + public double OnlineAndInPersonSumAmountDouble { get; set; } + + + /// + /// مبلغ کل خدمات حضوری + /// double + /// + public double InPersonSumAmountDouble { get; set; } + + /// + /// مبلغ کل خدمات آنلاین + /// double + /// + public double OnlineOnlySumAmountDouble { get; set; } + + + #endregion +} \ No newline at end of file diff --git a/CompanyManagment.App.Contracts/InstitutionPlan/InstitutionPlanSearchModel.cs b/CompanyManagment.App.Contracts/InstitutionPlan/InstitutionPlanSearchModel.cs new file mode 100644 index 00000000..34e5d347 --- /dev/null +++ b/CompanyManagment.App.Contracts/InstitutionPlan/InstitutionPlanSearchModel.cs @@ -0,0 +1,11 @@ +using _0_Framework.Application; + +namespace CompanyManagment.App.Contracts.InstitutionPlan; + +public class InstitutionPlanSearchModel : PaginationRequest +{ + /// + /// تعدلد پرسنل برای جستجو + /// + public int CountPeron { get; set; } +} \ No newline at end of file diff --git a/CompanyManagment.Application/InstitutionPlanApplication.cs b/CompanyManagment.Application/InstitutionPlanApplication.cs index 53e2f1f7..2b4aba06 100644 --- a/CompanyManagment.Application/InstitutionPlanApplication.cs +++ b/CompanyManagment.Application/InstitutionPlanApplication.cs @@ -148,5 +148,10 @@ public class InstitutionPlanApplication : IInstitutionPlanApplication return op.Succcedded(); } + public async Task> GetList(InstitutionPlanSearchModel searchModel) + { + return await _planPercentageRepository.GetList(searchModel); + } + #endregion } \ No newline at end of file diff --git a/CompanyManagment.EFCore/Repository/PlanPercentageRepository.cs b/CompanyManagment.EFCore/Repository/PlanPercentageRepository.cs index 91b2366b..b5b6db6b 100644 --- a/CompanyManagment.EFCore/Repository/PlanPercentageRepository.cs +++ b/CompanyManagment.EFCore/Repository/PlanPercentageRepository.cs @@ -1,13 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using _0_Framework.Application; +using _0_Framework.Application; using _0_Framework.InfraStructure; using Company.Domain.InstitutionPlanAgg; +using CompanyManagment.App.Contracts.InstitutionContract; using CompanyManagment.App.Contracts.InstitutionPlan; using CompanyManagment.App.Contracts.TemporaryClientRegistration; using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; namespace CompanyManagment.EFCore.Repository; @@ -45,7 +46,7 @@ public class PlanPercentageRepository : RepositoryBase, IP }).FirstOrDefault(); } - + public List GetInstitutionPlanList(int pageIndex, int countPeron) { var planPercentage = _context.PlanPercentages.FirstOrDefault(); @@ -323,5 +324,89 @@ public class PlanPercentageRepository : RepositoryBase, IP }).FirstOrDefaultAsync(); } + + public async Task> GetList( + InstitutionPlanSearchModel searchModel) + { + var planPercentage = await _context.PlanPercentages.FirstOrDefaultAsync(); + if (planPercentage == null) + return new PagedResult(); + var dailyWageYearlySalery = await _context.YearlySalaries.Include(i => i.YearlySalaryItemsList).FirstOrDefaultAsync(x => + x.StartDate.Date <= DateTime.Now.Date && x.EndDate >= DateTime.Now.Date); + if (dailyWageYearlySalery == null) + return new PagedResult(); + + var dailyWage = dailyWageYearlySalery.YearlySalaryItemsList.Where(x => x.ItemName == "مزد روزانه") + .Select(x => x.ItemValue).FirstOrDefault(); + + var plans = _context.InstitutionPlans.AsQueryable(); + if (searchModel.CountPeron > 0) + plans = plans.Where(x => x.CountPerson == searchModel.CountPeron); + + var planQueryFilter =await plans.ApplyPagination(searchModel.PageIndex, searchModel.PageSize).ToListAsync(); + var planResult = planQueryFilter.Select(plan => + new InstitutionPlanViewModel + { + CountPerson = plan.CountPerson, + + ContractAndCheckoutDouble = + ((dailyWage * planPercentage.ContractAndCheckoutPercent / 100) * plan.CountPerson * + plan.IncreasePercentage), + + InsuranceDouble = (((dailyWage * planPercentage.InsurancePercent) / 100) * plan.CountPerson * + plan.IncreasePercentage), + + RollCallDouble = (((dailyWage * planPercentage.RollCallPercent) / 100) * plan.CountPerson * + plan.IncreasePercentage), + + CustomizeCheckoutDouble = (((dailyWage * planPercentage.CustomizeCheckoutPercent) / 100) * + plan.CountPerson * + plan.IncreasePercentage), + + ContractAndCheckoutInPersonDouble = + (((dailyWage * planPercentage.ContractAndCheckoutInPersonPercent) / 100) * plan.CountPerson * + plan.IncreasePercentage), + + InsuranceInPersonDouble = (((dailyWage * planPercentage.InsuranceInPersonPercent) / 100) * + plan.CountPerson * + plan.IncreasePercentage) + }).ToList(); + + var finalResult = planResult.Select(plan => new InstitutionPlanListDto() + { + CountPerson = plan.CountPerson, + + ContractAndCheckout = plan.ContractAndCheckoutDouble.ToMoney(), + + Insurance = plan.InsuranceDouble.ToMoney(), + + RollCall = plan.RollCallDouble.ToMoney(), + + CustomizeCheckout = plan.CustomizeCheckoutDouble.ToMoney(), + + ContractAndCheckoutInPerson = plan.ContractAndCheckoutInPersonDouble.ToMoney(), + + InsuranceInPerson = plan.InsuranceInPersonDouble.ToMoney(), + + InPersonSumAmountStr = + (plan.ContractAndCheckoutDouble + plan.InsuranceDouble + plan.ContractAndCheckoutInPersonDouble + + plan.InsuranceInPersonDouble).ToMoney(), + + OnlineAndInPersonSumAmountStr = (plan.ContractAndCheckoutDouble + plan.InsuranceDouble + + plan.ContractAndCheckoutInPersonDouble + plan.InsuranceInPersonDouble + + plan.RollCallDouble + plan.CustomizeCheckoutDouble).ToMoney(), + + OnlineOnlySumAmountStr = + (plan.ContractAndCheckoutDouble + plan.InsuranceDouble + plan.RollCallDouble + + plan.CustomizeCheckoutDouble).ToMoney(), + }).ToList(); + + return new PagedResult() + { + TotalCount = finalResult.Count, + List = finalResult + }; + + } #endregion } \ No newline at end of file diff --git a/ServiceHost/Areas/Admin/Controllers/ServiceAmountsManagement.cs b/ServiceHost/Areas/Admin/Controllers/ServiceAmountsManagement.cs index edfc1416..bc0c6dcf 100644 --- a/ServiceHost/Areas/Admin/Controllers/ServiceAmountsManagement.cs +++ b/ServiceHost/Areas/Admin/Controllers/ServiceAmountsManagement.cs @@ -43,10 +43,21 @@ public class ServiceAmountsManagement : AdminBaseController { if (!_authHelper.HasPermission(315)) - return new OperationResult().Failed("اجازه دسترسی ندارید"); + return Forbid(); var result = await _institutionPlanApplication.CreateInstitutionPlanPercentage(command); return result; } + + /// + /// دریافت لیست مبالغ سرویس ها + /// + /// + /// + [HttpGet("GetList")] + public async Task>> GetList(InstitutionPlanSearchModel searchModel) + { + return await _institutionPlanApplication.GetList(searchModel); + } } \ No newline at end of file From 27edcc5f7b39bb9f1f9aecf5b4ffacd5ecdef5fa Mon Sep 17 00:00:00 2001 From: SamSys Date: Mon, 22 Dec 2025 17:48:04 +0330 Subject: [PATCH 9/9] changed --- .../InstitutionPlan/InstitutionPlanSearchModel.cs | 4 ++-- .../Repository/PlanPercentageRepository.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CompanyManagment.App.Contracts/InstitutionPlan/InstitutionPlanSearchModel.cs b/CompanyManagment.App.Contracts/InstitutionPlan/InstitutionPlanSearchModel.cs index 34e5d347..f6055430 100644 --- a/CompanyManagment.App.Contracts/InstitutionPlan/InstitutionPlanSearchModel.cs +++ b/CompanyManagment.App.Contracts/InstitutionPlan/InstitutionPlanSearchModel.cs @@ -5,7 +5,7 @@ namespace CompanyManagment.App.Contracts.InstitutionPlan; public class InstitutionPlanSearchModel : PaginationRequest { /// - /// تعدلد پرسنل برای جستجو + /// تعداد پرسنل برای جستجو /// - public int CountPeron { get; set; } + public int CountPerson { get; set; } } \ No newline at end of file diff --git a/CompanyManagment.EFCore/Repository/PlanPercentageRepository.cs b/CompanyManagment.EFCore/Repository/PlanPercentageRepository.cs index b5b6db6b..57d41be0 100644 --- a/CompanyManagment.EFCore/Repository/PlanPercentageRepository.cs +++ b/CompanyManagment.EFCore/Repository/PlanPercentageRepository.cs @@ -340,8 +340,8 @@ public class PlanPercentageRepository : RepositoryBase, IP .Select(x => x.ItemValue).FirstOrDefault(); var plans = _context.InstitutionPlans.AsQueryable(); - if (searchModel.CountPeron > 0) - plans = plans.Where(x => x.CountPerson == searchModel.CountPeron); + if (searchModel.CountPerson > 0) + plans = plans.Where(x => x.CountPerson == searchModel.CountPerson); var planQueryFilter =await plans.ApplyPagination(searchModel.PageIndex, searchModel.PageSize).ToListAsync(); var planResult = planQueryFilter.Select(plan =>