From d2acf59eba54bbdd6ac1e86a58db2d279cea123c Mon Sep 17 00:00:00 2001 From: SamSys Date: Mon, 29 Dec 2025 16:14:25 +0330 Subject: [PATCH] PrintAllEmployeesInfoClient api --- .../EmployeeAgg/IEmployeeRepository.cs | 8 ++ .../DTO/PrintAllEmployeesInfoDtoClient.cs | 96 +++++++++++++++++++ .../Employee/IEmployeeApplication.cs | 8 ++ .../EmployeeAplication.cs | 5 + .../Repository/EmployeeRepository .cs | 11 +++ .../Client/Controllers/EmployeeController.cs | 13 +++ 6 files changed, 141 insertions(+) create mode 100644 CompanyManagment.App.Contracts/Employee/DTO/PrintAllEmployeesInfoDtoClient.cs diff --git a/Company.Domain/EmployeeAgg/IEmployeeRepository.cs b/Company.Domain/EmployeeAgg/IEmployeeRepository.cs index 7ab427d8..b61bf8f4 100644 --- a/Company.Domain/EmployeeAgg/IEmployeeRepository.cs +++ b/Company.Domain/EmployeeAgg/IEmployeeRepository.cs @@ -87,6 +87,14 @@ public interface IEmployeeRepository : IRepository /// Task> ListOfAllEmployeesClient(EmployeeSearchModelDto searchModel, long workshopId); + /// + /// پرینت تجمیعی پرسنل کلاینت + /// api + /// + /// + /// + Task> PrintAllEmployeesInfoClient(long workshopId); + #endregion diff --git a/CompanyManagment.App.Contracts/Employee/DTO/PrintAllEmployeesInfoDtoClient.cs b/CompanyManagment.App.Contracts/Employee/DTO/PrintAllEmployeesInfoDtoClient.cs new file mode 100644 index 00000000..d9781377 --- /dev/null +++ b/CompanyManagment.App.Contracts/Employee/DTO/PrintAllEmployeesInfoDtoClient.cs @@ -0,0 +1,96 @@ +namespace CompanyManagment.App.Contracts.Employee.DTO; + +/// +/// پرینت تجمیعی پرسنل +/// +public class PrintAllEmployeesInfoDtoClient +{ + public PrintAllEmployeesInfoDtoClient(EmployeeListDto source) + { + Id = source.Id; + EmployeeFullName = source.EmployeeFullName; + PersonnelCode = source.PersonnelCode; + MaritalStatus = source.MaritalStatus; + NationalCode = source.NationalCode; + IdNumber = source.IdNumber; + DateOfBirth = source.DateOfBirth; + FatherName = source.FatherName; + NumberOfChildren = source.NumberOfChildren; + LatestContractStartDate = source.LatestContractStartDate; + ContractLeftDate = source.ContractLeftDate; + LatestInsuranceStartDate = source.LatestInsuranceStartDate; + InsuranceLeftDate = source.InsuranceLeftDate; + EmployeeStatusInWorkshop = source.EmployeeStatusInWorkshop; + } + /// + /// آی دی پرسنل + /// + public long Id { get; set; } + + /// + /// نام کامل پرسنل + /// + public string EmployeeFullName { get; set; } + + /// + /// کد پرسنلی + /// + public int PersonnelCode { get; set; } + + /// + /// وضعیت تاهل + /// + public string MaritalStatus { get; set; } + + /// + ///کد ملی + /// + public string NationalCode { get; set; } + + /// + /// شماره شناسنامه + /// + public string IdNumber { get; set; } + + /// + /// تاریخ تولد + /// + public string DateOfBirth { get; set; } + + /// + /// نام پدر + /// + public string FatherName { get; set; } + + /// + /// تعداد فرزندان + /// + public string NumberOfChildren { get; set; } + + /// + /// آخرین تاریخ شروع بکار قرارداد + /// + public string LatestContractStartDate { get; set; } + + /// + /// تاریخ ترک کار قرارداد + /// + public string ContractLeftDate { get; set; } + + + /// + /// آخرین تاریخ شروع بکار بیمه + /// + public string LatestInsuranceStartDate { get; set; } + + /// + /// تاریخ ترک کار بیمه + /// + public string InsuranceLeftDate { get; set; } + + + /// + /// وضعیت پرسنل در کارگاه + /// + public EmployeeStatusInWorkshop EmployeeStatusInWorkshop { get; set; } +} \ No newline at end of file diff --git a/CompanyManagment.App.Contracts/Employee/IEmployeeApplication.cs b/CompanyManagment.App.Contracts/Employee/IEmployeeApplication.cs index 58a5190a..aaba14db 100644 --- a/CompanyManagment.App.Contracts/Employee/IEmployeeApplication.cs +++ b/CompanyManagment.App.Contracts/Employee/IEmployeeApplication.cs @@ -112,6 +112,14 @@ public interface IEmployeeApplication /// /// Task> ListOfAllEmployeesClient(EmployeeSearchModelDto searchModel, long workshopId); + + /// + /// پرینت تجمیعی پرسنل کلاینت + /// api + /// + /// + /// + Task> PrintAllEmployeesInfoClient(long workshopId); #endregion } diff --git a/CompanyManagment.Application/EmployeeAplication.cs b/CompanyManagment.Application/EmployeeAplication.cs index 288bdf4c..9d8aa4f4 100644 --- a/CompanyManagment.Application/EmployeeAplication.cs +++ b/CompanyManagment.Application/EmployeeAplication.cs @@ -1739,5 +1739,10 @@ public class EmployeeAplication : RepositoryBase, IEmployeeAppli return await _EmployeeRepository.ListOfAllEmployeesClient(searchModel, workshopId); } + public async Task> PrintAllEmployeesInfoClient(long workshopId) + { + return await _EmployeeRepository.PrintAllEmployeesInfoClient(workshopId); + } + #endregion } \ No newline at end of file diff --git a/CompanyManagment.EFCore/Repository/EmployeeRepository .cs b/CompanyManagment.EFCore/Repository/EmployeeRepository .cs index 05db2554..5d82f0ca 100644 --- a/CompanyManagment.EFCore/Repository/EmployeeRepository .cs +++ b/CompanyManagment.EFCore/Repository/EmployeeRepository .cs @@ -1275,5 +1275,16 @@ public class EmployeeRepository : RepositoryBase, IEmployeeRepos return result; } + + + public async Task> PrintAllEmployeesInfoClient(long workshopId) + { + var res = await ListOfAllEmployeesClient(new EmployeeSearchModelDto(), workshopId); + + return res + .Where(x=>x.EmployeeStatusInWorkshop != EmployeeStatusInWorkshop.CreatedByClient + && x.EmployeeStatusInWorkshop != EmployeeStatusInWorkshop.LefWorkTemp) + .Select(x => new PrintAllEmployeesInfoDtoClient(x)).ToList(); + } #endregion } \ No newline at end of file diff --git a/ServiceHost/Areas/Client/Controllers/EmployeeController.cs b/ServiceHost/Areas/Client/Controllers/EmployeeController.cs index c506d9cb..d3136348 100644 --- a/ServiceHost/Areas/Client/Controllers/EmployeeController.cs +++ b/ServiceHost/Areas/Client/Controllers/EmployeeController.cs @@ -36,4 +36,17 @@ public class EmployeeController:ClientBaseController var result = await _employeeApplication.ListOfAllEmployeesClient(searchModel, _workshopId); return result; } + + /// + /// پرینت تجمیعی پرسنل + /// + /// + [HttpGet("PrintAllEmployeesInfo")] + public async Task>> PrintAllEmployeesInfo() + { + var result = await _employeeApplication.PrintAllEmployeesInfoClient(_workshopId); + return result; + } + + } \ No newline at end of file