PrintAllEmployeesInfoClient api

This commit is contained in:
SamSys
2025-12-29 16:14:25 +03:30
parent 3139552217
commit d2acf59eba
6 changed files with 141 additions and 0 deletions

View File

@@ -87,6 +87,14 @@ public interface IEmployeeRepository : IRepository<long, Employee>
/// <returns></returns>
Task<List<EmployeeListDto>> ListOfAllEmployeesClient(EmployeeSearchModelDto searchModel, long workshopId);
/// <summary>
/// پرینت تجمیعی پرسنل کلاینت
/// api
/// </summary>
/// <param name="workshopId"></param>
/// <returns></returns>
Task<List<PrintAllEmployeesInfoDtoClient>> PrintAllEmployeesInfoClient(long workshopId);
#endregion

View File

@@ -0,0 +1,96 @@
namespace CompanyManagment.App.Contracts.Employee.DTO;
/// <summary>
/// پرینت تجمیعی پرسنل
/// </summary>
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;
}
/// <summary>
/// آی دی پرسنل
/// </summary>
public long Id { get; set; }
/// <summary>
/// نام کامل پرسنل
/// </summary>
public string EmployeeFullName { get; set; }
/// <summary>
/// کد پرسنلی
/// </summary>
public int PersonnelCode { get; set; }
/// <summary>
/// وضعیت تاهل
/// </summary>
public string MaritalStatus { get; set; }
/// <summary>
///کد ملی
/// </summary>
public string NationalCode { get; set; }
/// <summary>
/// شماره شناسنامه
/// </summary>
public string IdNumber { get; set; }
/// <summary>
/// تاریخ تولد
/// </summary>
public string DateOfBirth { get; set; }
/// <summary>
/// نام پدر
/// </summary>
public string FatherName { get; set; }
/// <summary>
/// تعداد فرزندان
/// </summary>
public string NumberOfChildren { get; set; }
/// <summary>
/// آخرین تاریخ شروع بکار قرارداد
/// </summary>
public string LatestContractStartDate { get; set; }
/// <summary>
/// تاریخ ترک کار قرارداد
/// </summary>
public string ContractLeftDate { get; set; }
/// <summary>
/// آخرین تاریخ شروع بکار بیمه
/// </summary>
public string LatestInsuranceStartDate { get; set; }
/// <summary>
/// تاریخ ترک کار بیمه
/// </summary>
public string InsuranceLeftDate { get; set; }
/// <summary>
/// وضعیت پرسنل در کارگاه
/// </summary>
public EmployeeStatusInWorkshop EmployeeStatusInWorkshop { get; set; }
}

View File

@@ -112,6 +112,14 @@ public interface IEmployeeApplication
/// <param name="workshopId"></param>
/// <returns></returns>
Task<List<EmployeeListDto>> ListOfAllEmployeesClient(EmployeeSearchModelDto searchModel, long workshopId);
/// <summary>
/// پرینت تجمیعی پرسنل کلاینت
/// api
/// </summary>
/// <param name="workshopId"></param>
/// <returns></returns>
Task<List<PrintAllEmployeesInfoDtoClient>> PrintAllEmployeesInfoClient(long workshopId);
#endregion
}

View File

@@ -1739,5 +1739,10 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
return await _EmployeeRepository.ListOfAllEmployeesClient(searchModel, workshopId);
}
public async Task<List<PrintAllEmployeesInfoDtoClient>> PrintAllEmployeesInfoClient(long workshopId)
{
return await _EmployeeRepository.PrintAllEmployeesInfoClient(workshopId);
}
#endregion
}

View File

@@ -1275,5 +1275,16 @@ public class EmployeeRepository : RepositoryBase<long, Employee>, IEmployeeRepos
return result;
}
public async Task<List<PrintAllEmployeesInfoDtoClient>> 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
}

View File

@@ -36,4 +36,17 @@ public class EmployeeController:ClientBaseController
var result = await _employeeApplication.ListOfAllEmployeesClient(searchModel, _workshopId);
return result;
}
/// <summary>
/// پرینت تجمیعی پرسنل
/// </summary>
/// <returns></returns>
[HttpGet("PrintAllEmployeesInfo")]
public async Task<ActionResult<List<PrintAllEmployeesInfoDtoClient>>> PrintAllEmployeesInfo()
{
var result = await _employeeApplication.PrintAllEmployeesInfoClient(_workshopId);
return result;
}
}