changes
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
namespace WorkFlow.Application.Contracts.AdminWorkFlow;
|
||||
|
||||
/// <summary>
|
||||
/// پرسنل شروع به کار خورده توسط کلاینت
|
||||
/// </summary>
|
||||
public class ClientStartedWorkEmployeesWorkFlowViewModel
|
||||
{
|
||||
public long EmployeeId { get; set; }
|
||||
|
||||
public long WorkshopId { get; set; }
|
||||
|
||||
public string EmployeeName { get; set; } = string.Empty;
|
||||
|
||||
public bool HasCompleteEmployeeDocument { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace WorkFlow.Application.Contracts.AdminWorkFlow
|
||||
{
|
||||
public class AdminWorkFlowNumbersViewModel
|
||||
{
|
||||
public int InsuranceWithoutContractCount { get; set; }
|
||||
|
||||
//مدارک در انتظار ادمین
|
||||
public int EmployeeDocumentsAwaitingSubmit { get; set; }
|
||||
public int StartWorkCount { get; set; }
|
||||
public int NewEmployeesAwaitingUpload { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace WorkFlow.Application.Contracts.AdminWorkFlow;
|
||||
|
||||
public interface IAdminWorkFlowApplication
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// نمایش کارگاه های دارای مدارک بررسی نشده
|
||||
/// </summary>
|
||||
List<WorkshopWithDocumentsViewModelForWorkFlow> GetWorkshopDocumentsAwaitingReviewForChecker(List<long> workshops);
|
||||
|
||||
List<WorkshopWithDocumentsViewModelForWorkFlow> GetWorkshopsWithDocumentsAwaitingUploadForAdmin(
|
||||
List<long> workshops);
|
||||
|
||||
|
||||
|
||||
#region شروع به کار پرسنل افزوده شده
|
||||
|
||||
/// <summary>
|
||||
/// لیست کارگاه هایی که از کلاینت، پرسنلی را شروع به کار زدند
|
||||
/// </summary>
|
||||
/// <param name="accountId"></param>
|
||||
/// <returns></returns>
|
||||
// Task<ICollection<WorkshopWithStartedWorkWorkFlowViewModel>> GetWorkshopsForEmployeeStartWork(long accountId);
|
||||
|
||||
/// <summary>
|
||||
/// لیست پرسنل هایی که از سمت کلاینت شروع به کار خوردند
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <returns></returns>
|
||||
//Task<ICollection<ClientStartedWorkEmployeesWorkFlowViewModel>> GetClientEmployeesStartWork(long workshopId);
|
||||
|
||||
#endregion
|
||||
|
||||
AdminWorkFlowNumbersViewModel GetWorkFlowCountsForAdmin(List<long> workshopIds);
|
||||
int GetWorkFlowCountForChecker();
|
||||
|
||||
|
||||
#region ترک کار موقت
|
||||
|
||||
/// <summary>
|
||||
/// لیست کارگاه هایی که از کلاینت، پرسنلی را ترک کار زدند
|
||||
/// </summary>
|
||||
/// <param name="accountId"></param>
|
||||
/// <returns></returns>
|
||||
//Task<ICollection<WorkshopWithLeftWorkWorkFlowViewModel>> GetWorkshopsForLeftWorkTemp(long accountId);
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// لیست پرسنل هایی که از سمت کلاینت ترک کار موقت خوردند
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <returns></returns>
|
||||
// Task<ICollection<ClientLeftWorkEmployeesWorkFlowViewModel>> GetEmployeesForLeftWorkTemp(long workshopId);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// پرسنل هایی که دارای ترک کار موقت هستند در کارپوشه ادمین
|
||||
/// </summary>
|
||||
public class ClientLeftWorkEmployeesWorkFlowViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی پرسنل
|
||||
/// </summary>
|
||||
public long EmployeeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیدی کارگاه
|
||||
/// </summary>
|
||||
public long WorkshopId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام پرسنل
|
||||
/// </summary>
|
||||
public string EmployeeName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ ترک کار
|
||||
/// </summary>
|
||||
public string LeftWorkDate { get; set; } = string.Empty;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// کارگاه هایی که پرسنل دارای ترک کار موقت دارند در کارپوشه ادمین
|
||||
/// </summary>
|
||||
public class WorkshopWithLeftWorkWorkFlowViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی کارگاه
|
||||
/// </summary>
|
||||
public long WorkshopId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کارگاه
|
||||
/// </summary>
|
||||
public string WorkshopName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// نام کارفرما
|
||||
/// </summary>
|
||||
public string EmployerName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// تعداد پرسنل ترک کار کرده
|
||||
/// </summary>
|
||||
public int LeftWorkEmployeesCount { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace WorkFlow.Application.Contracts.AdminWorkFlow;
|
||||
|
||||
public class WorkshopWithDocumentsViewModelForWorkFlow
|
||||
{
|
||||
public long WorkshopId { get; set; }
|
||||
public int UploadItemsCount { get; set; }
|
||||
public DateTime LastUploadDate { get; set; }
|
||||
public string LastUploadDateFa { get; set; }
|
||||
public string EmployerName { get; set; }
|
||||
public string WorkshopName { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
namespace WorkFlow.Application.Contracts.AdminWorkFlow;
|
||||
|
||||
/// <summary>
|
||||
/// کارگاهی که از کلاینت پرسنلی را شروع به کار زدند
|
||||
/// </summary>
|
||||
public class WorkshopWithStartedWorkWorkFlowViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی کارگاه
|
||||
/// </summary>
|
||||
public long WorkshopId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کارگاه
|
||||
/// </summary>
|
||||
public string WorkshopName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// نام کارفرما
|
||||
/// </summary>
|
||||
public string EmployerName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// تعداد پرسنل اضافه شده
|
||||
/// </summary>
|
||||
public int AddedEmployeesCount { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
using WorkFlow.Application.Contracts.AdminWorkFlow;
|
||||
|
||||
using WorkFlow.Infrastructure.ACL.EmployeeDocuments;
|
||||
|
||||
|
||||
namespace WorkFlow.Application
|
||||
{
|
||||
public class AdminWorkFlowApplication : IAdminWorkFlowApplication
|
||||
{
|
||||
private readonly IWorkFlowEmployeeDocumentsACL _workFlowEmployeeDocumentsACL;
|
||||
//private readonly IWorkFlowWorkshopACL _workFlowWorkshopACL;
|
||||
//private readonly IWorkFlowEmployeeACL _workFlowEmployeeACL;
|
||||
|
||||
|
||||
public AdminWorkFlowApplication(IWorkFlowEmployeeDocumentsACL workFlowEmployeeDocumentsACL/*, IWorkFlowWorkshopACL workFlowWorkshopACL, IWorkFlowEmployeeACL workFlowEmployeeACL*/)
|
||||
{
|
||||
_workFlowEmployeeDocumentsACL = workFlowEmployeeDocumentsACL;
|
||||
//_workFlowWorkshopACL = workFlowWorkshopACL;
|
||||
//_workFlowEmployeeACL = workFlowEmployeeACL;
|
||||
}
|
||||
|
||||
#region Pooya
|
||||
|
||||
public List<WorkshopWithDocumentsViewModelForWorkFlow> GetWorkshopDocumentsAwaitingReviewForChecker(List<long> workshops)
|
||||
{
|
||||
return _workFlowEmployeeDocumentsACL.GetWorkshopDocumentsAwaitingReviewForChecker(workshops);
|
||||
}
|
||||
|
||||
public AdminWorkFlowNumbersViewModel GetWorkFlowCountsForAdmin(List<long> workshopIds)
|
||||
{
|
||||
var submittedDocumentsByClient = _workFlowEmployeeDocumentsACL.GetAdminWorkFlowCountForSubmittedDocuments(workshopIds);
|
||||
|
||||
//var newEmployees = _workFlowEmployeeDocumentsACL.GetAdminWorkFlowCountForNewEmployees(workshopIds);
|
||||
|
||||
return new AdminWorkFlowNumbersViewModel()
|
||||
{
|
||||
EmployeeDocumentsAwaitingSubmit = submittedDocumentsByClient,
|
||||
//NewEmployeesAwaitingUpload = newEmployees
|
||||
};
|
||||
}
|
||||
|
||||
public int GetWorkFlowCountForChecker()
|
||||
{
|
||||
return _workFlowEmployeeDocumentsACL.GetCheckerWorkFlowCount();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<WorkshopWithDocumentsViewModelForWorkFlow> GetWorkshopsWithDocumentsAwaitingUploadForAdmin(List<long> workshops)
|
||||
{
|
||||
return _workFlowEmployeeDocumentsACL.GetWorkshopsWithDocumentsAwaitingUploadForAdmin(workshops);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Mahan
|
||||
|
||||
#region شروع به کار پرسنل افزوده شده
|
||||
//public async Task<ICollection<WorkshopWithStartedWorkWorkFlowViewModel>> GetWorkshopsForEmployeeStartWork(long accountId)
|
||||
//{
|
||||
// return await _workFlowWorkshopACL.GetWorkshopsForEmployeeStartWork(accountId);
|
||||
//}
|
||||
|
||||
//public async Task<ICollection<ClientStartedWorkEmployeesWorkFlowViewModel>> GetClientEmployeesStartWork(long workshopId)
|
||||
//{
|
||||
// return await _workFlowEmployeeACL.GetClientEmployeesStartWork(workshopId);
|
||||
//}
|
||||
#endregion
|
||||
|
||||
#region ترک کار موقت
|
||||
|
||||
//public async Task<ICollection<WorkshopWithLeftWorkWorkFlowViewModel>> GetWorkshopsForLeftWorkTemp(long accountId)
|
||||
//{
|
||||
// return await _workFlowWorkshopACL.GetWorkshopsForLeftWorkTemp(accountId);
|
||||
//}
|
||||
|
||||
//public async Task<ICollection<ClientLeftWorkEmployeesWorkFlowViewModel>> GetEmployeesForLeftWorkTemp(long workshopId)
|
||||
//{
|
||||
// return await _workFlowEmployeeACL.GetEmployeesForLeftWorkTemp(workshopId);
|
||||
//}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
using CompanyManagment.App.Contracts.EmployeeDocuments;
|
||||
using WorkFlow.Application.Contracts.AdminWorkFlow;
|
||||
|
||||
namespace WorkFlow.Infrastructure.ACL.EmployeeDocuments
|
||||
{
|
||||
public interface IWorkFlowEmployeeDocumentsACL
|
||||
{
|
||||
List<WorkshopWithDocumentsViewModelForWorkFlow> GetWorkshopDocumentsAwaitingReviewForChecker(List<long> workshops);
|
||||
List<WorkshopWithDocumentsViewModelForWorkFlow> GetWorkshopsWithDocumentsAwaitingUploadForAdmin(List<long> workshops);
|
||||
|
||||
int GetAdminWorkFlowCountForSubmittedDocuments(List<long> workshopIds);
|
||||
//int GetAdminWorkFlowCountForNewEmployees(List<long> workshopIds);
|
||||
int GetCheckerWorkFlowCount();
|
||||
}
|
||||
|
||||
public class WorkFlowEmployeeDocumentsACL : IWorkFlowEmployeeDocumentsACL
|
||||
{
|
||||
private readonly IEmployeeDocumentsApplication _employeeDocumentsApplication;
|
||||
|
||||
public WorkFlowEmployeeDocumentsACL(IEmployeeDocumentsApplication employeeDocumentsApplication)
|
||||
{
|
||||
_employeeDocumentsApplication = employeeDocumentsApplication;
|
||||
}
|
||||
|
||||
|
||||
public List<WorkshopWithDocumentsViewModelForWorkFlow> GetWorkshopsWithDocumentsAwaitingUploadForAdmin(List<long> workshops)
|
||||
{
|
||||
return _employeeDocumentsApplication.GetWorkshopDocumentsAwaitingUploadForAdminWorkFlow(workshops).Select(x => new WorkshopWithDocumentsViewModelForWorkFlow()
|
||||
{
|
||||
WorkshopId = x.WorkshopId,
|
||||
UploadItemsCount = x.EmployeesWithoutDocumentCount,
|
||||
WorkshopName = x.WorkshopFullName,
|
||||
EmployerName = x.EmployerName,
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public int GetAdminWorkFlowCountForSubmittedDocuments(List<long> workshopIds)
|
||||
{
|
||||
return _employeeDocumentsApplication.GetAdminWorkFlowCountForSubmittedAndRejectedDocuments(workshopIds);
|
||||
}
|
||||
//public int GetAdminWorkFlowCountForNewEmployees(List<long> workshopIds)
|
||||
//{
|
||||
// return _employeeDocumentsApplication.GetAdminWorkFlowCountForNewEmployees(workshopIds);
|
||||
//}
|
||||
public int GetCheckerWorkFlowCount()
|
||||
{
|
||||
return _employeeDocumentsApplication.GetCheckerWorkFlowCount();
|
||||
}
|
||||
|
||||
public List<WorkshopWithDocumentsViewModelForWorkFlow> GetWorkshopDocumentsAwaitingReviewForChecker(List<long> workshops)
|
||||
{
|
||||
return _employeeDocumentsApplication.GetWorkshopsWithDocumentsAwaitingReviewForCheckerWorkFlow().Select(x=> new WorkshopWithDocumentsViewModelForWorkFlow()
|
||||
{
|
||||
WorkshopId = x.WorkshopId,
|
||||
UploadItemsCount = x.SubmittedItemsCount
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using WorkFlow.Application;
|
||||
using WorkFlow.Application.Contracts.AdminWorkFlow;
|
||||
using WorkFlow.Application.Contracts.WorkFlow;
|
||||
using WorkFlow.Domain.RollCallConfirmedAbsenceAgg;
|
||||
using WorkFlow.Domain.RollCallConfirmedWithoutLunchBreakAgg;
|
||||
using WorkFlow.Infrastructure.ACL.Checkout;
|
||||
using WorkFlow.Infrastructure.ACL.CustomizedWorkshopSettings;
|
||||
using WorkFlow.Infrastructure.ACL.EmployeeDocuments;
|
||||
using WorkFlow.Infrastructure.ACL.RollCall;
|
||||
using WorkFlow.Infrastructure.EfCore;
|
||||
using WorkFlow.Infrastructure.EfCore.Repository;
|
||||
@@ -16,7 +18,9 @@ namespace WorkFlow.Infrastructure.Config
|
||||
{
|
||||
public static void Configure(IServiceCollection services, string connectionString)
|
||||
{
|
||||
services.AddTransient<IWorkFlowApplication, WorkFlowApplication>();
|
||||
services.AddTransient<IWorkFlowApplication, WorkFlowApplication>();
|
||||
services.AddTransient<IAdminWorkFlowApplication, AdminWorkFlowApplication>();
|
||||
|
||||
services.AddTransient<IRollCallConfirmedAbsenceRepository, RollCallConfirmedAbsenceRepository>();
|
||||
services.AddTransient<IRollCallConfirmedWithoutLunchBreakRepository, RollCallConfirmedWithoutLunchBreakRepository>();
|
||||
|
||||
@@ -25,6 +29,7 @@ namespace WorkFlow.Infrastructure.Config
|
||||
services.AddTransient<IWorkFlowCheckoutACL, WorkFlowCheckoutACL>();
|
||||
services.AddTransient<IWorkFlowRollCallACL, WorkFlowRollCallACL>();
|
||||
services.AddTransient<IWorkFlowCustomizedWorkshopSettingsACL, WorkFlowCustomizedWorkshopSettingsACL>();
|
||||
services.AddTransient<IWorkFlowEmployeeDocumentsACL, WorkFlowEmployeeDocumentsACL>();
|
||||
|
||||
|
||||
services.AddDbContext<WorkFlowContext>(x =>
|
||||
|
||||
Reference in New Issue
Block a user