Compare commits
11 Commits
Feature/pr
...
AdminCheck
| Author | SHA1 | Date | |
|---|---|---|---|
| a68b879e95 | |||
| 161f3a92a7 | |||
| 5a1ec104a1 | |||
|
|
5b6f967fca | ||
|
|
3317bde6d6 | ||
|
|
5cd30e5910 | ||
|
|
4463fdc177 | ||
|
|
2ce63d1e0f | ||
|
|
38603b2249 | ||
|
|
bf03247f81 | ||
|
|
12af5dcb56 |
@@ -445,6 +445,30 @@ public static class Tools
|
||||
|
||||
return myMoney.ToString("N0", CultureInfo.CreateSpecificCulture("fa-ir"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// اگر مبلغ صفر باشد خط تیره برمیگرداند
|
||||
/// </summary>
|
||||
/// <param name="myMoney"></param>
|
||||
/// <returns></returns>
|
||||
public static string ToMoneyCheckZero(this double myMoney)
|
||||
{
|
||||
if (myMoney == 0)
|
||||
return "-";
|
||||
return myMoney.ToString("N0", CultureInfo.CreateSpecificCulture("fa-ir"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// اگر مبلغ صفر یا نال باشد خط تیره برمیگرداند
|
||||
/// </summary>
|
||||
/// <param name="myMoney"></param>
|
||||
/// <returns></returns>
|
||||
public static string ToMoneyCheckZeroNullable(this double? myMoney)
|
||||
{
|
||||
if (myMoney == 0 || myMoney == null)
|
||||
return "-";
|
||||
return myMoney?.ToString("N0", CultureInfo.CreateSpecificCulture("fa-ir"));
|
||||
}
|
||||
public static string ToMoneyNullable(this double? myMoney)
|
||||
{
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Checkout.Dto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
namespace Company.Domain.CheckoutAgg;
|
||||
@@ -80,4 +81,31 @@ public interface ICheckoutRepository : IRepository<long, Checkout>
|
||||
#endregion
|
||||
|
||||
Task<Checkout> GetByWorkshopIdEmployeeIdInDate(long workshopId, long employeeId, DateTime inDate);
|
||||
|
||||
|
||||
#region ForApi
|
||||
/// <summary>
|
||||
/// دریافت سلکت لیست پرسنل کارگاه
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<EmployeeSelectListDto>> GetEmployeeSelectListByWorkshopId(long id);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست فیش حقوقی
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <returns></returns>
|
||||
Task<PagedResult<CheckoutDto>> GetList(CheckoutSearchModelDto searchModel);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// پرینت فیش حقوقی
|
||||
/// Api
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<CheckoutPrintDto>> CheckoutPrint(List<long> ids);
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -106,4 +106,14 @@ public interface IWorkshopRepository : IRepository<long, Workshop>
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region ForApi
|
||||
/// <summary>
|
||||
/// دریافت لیست کارگاه های ادمین برای سلکت تو
|
||||
/// Api
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<AdminWorkshopSelectListDto>> GetAdminWorkshopSelectList();
|
||||
|
||||
#endregion
|
||||
}
|
||||
92
CompanyManagment.App.Contracts/Checkout/Dto/CheckoutDto.cs
Normal file
92
CompanyManagment.App.Contracts/Checkout/Dto/CheckoutDto.cs
Normal file
@@ -0,0 +1,92 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Checkout.Dto;
|
||||
|
||||
public class CheckoutDto
|
||||
{
|
||||
/// <summary>
|
||||
/// آی دی فیش
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام پرسنل
|
||||
/// </summary>
|
||||
public string EmployeeFullName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کارگاه
|
||||
/// </summary>
|
||||
public string WorkshopName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره قراداد
|
||||
/// </summary>
|
||||
public string ContractNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع فیش
|
||||
/// </summary>
|
||||
public string ContractStart { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ پایان فیش
|
||||
/// </summary>
|
||||
public string ContractEnd { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ماه
|
||||
/// </summary>
|
||||
public string Month { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// سال
|
||||
/// </summary>
|
||||
public string Year { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// روزهای کارکرد
|
||||
/// </summary>
|
||||
public string SumOfWorkingDays { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره کارگاه
|
||||
/// </summary>
|
||||
public string ArchiveCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد پرسنلی
|
||||
/// </summary>
|
||||
public string PersonnelCode { get; set; }
|
||||
/// <summary>
|
||||
/// فعال/غیرفعال
|
||||
/// </summary>
|
||||
public bool IsActive { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// امضاء فیش
|
||||
/// </summary>
|
||||
public bool Signature { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کارفرما
|
||||
/// </summary>
|
||||
public string EmployerName { get; set; }
|
||||
public bool IsBlockCantracingParty { get; set; }
|
||||
/// <summary>
|
||||
/// آیا فیش نیاز به بروزرسانی دارد
|
||||
/// </summary>
|
||||
public bool IsUpdateNeeded { get; set; }
|
||||
/// <summary>
|
||||
/// لیست پیام های هشدار فیش حقوقی
|
||||
/// </summary>
|
||||
public List<CheckoutWarningMessageModel> CheckoutWarningMessageList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نیاز به امزا دارد یا خیر
|
||||
/// </summary>
|
||||
public bool HasSignCheckoutOption { get; set; }
|
||||
|
||||
}
|
||||
247
CompanyManagment.App.Contracts/Checkout/Dto/CheckoutPrintDto.cs
Normal file
247
CompanyManagment.App.Contracts/Checkout/Dto/CheckoutPrintDto.cs
Normal file
@@ -0,0 +1,247 @@
|
||||
using System;
|
||||
using CompanyManagment.App.Contracts.Loan;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using CompanyManagment.App.Contracts.SalaryAid;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Checkout.Dto;
|
||||
|
||||
public class CheckoutPrintDto
|
||||
{
|
||||
// هدر فیش
|
||||
// اطلاعات هویتی
|
||||
// اطلاعات کارگاه
|
||||
#region Header
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام پرسنل
|
||||
/// </summary>
|
||||
public string EmployeeFullName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام پدر
|
||||
/// </summary>
|
||||
public string FathersName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد ملی
|
||||
/// </summary>
|
||||
public string NationalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ تولد
|
||||
/// </summary>
|
||||
public string DateOfBirth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کارگاه
|
||||
/// </summary>
|
||||
public string WorkshopName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره قراداد
|
||||
/// </summary>
|
||||
public string ContractNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ماه
|
||||
/// </summary>
|
||||
public string Month { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// سال
|
||||
/// </summary>
|
||||
public string Year { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// لیست کارفرما
|
||||
/// </summary>
|
||||
public List<CheckoutEmployersList> EmployersLists { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا کارقرما حقوقی است
|
||||
/// </summary>
|
||||
public bool EmployerIslegal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا ترک کار کرده
|
||||
/// </summary>
|
||||
public bool HasLeft { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آخرین روز کاری
|
||||
/// </summary>
|
||||
public string LastDayOfWork { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// روز ترک کار
|
||||
/// </summary>
|
||||
public string LeftWorkDate { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
//جدول مطالبات و کسورات
|
||||
#region PaymentAndDeductionTable
|
||||
/// <summary>
|
||||
/// مطالبات
|
||||
/// </summary>
|
||||
public List<PaymentAndDeductionList> PaymentList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کسورات
|
||||
/// </summary>
|
||||
public List<PaymentAndDeductionList> DeductionList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// جمع مطالبات
|
||||
/// </summary>
|
||||
public string TotalPayment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// جمع کسورات
|
||||
/// </summary>
|
||||
public string TotalDeductions { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ قابل پرداخت
|
||||
/// </summary>
|
||||
public string TotalClaims { get; set; }
|
||||
#endregion
|
||||
|
||||
//لیست ورود و خروج پرسنل
|
||||
//اطلاعات ساعات کار و موظقی
|
||||
#region RollCallData
|
||||
/// <summary>
|
||||
/// لیست حضورغیاب
|
||||
/// </summary>
|
||||
public List<CheckoutPrintRollCallDto> MonthlyRollCall { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// دیتای جدول حضورغیاب
|
||||
/// </summary>
|
||||
public CheckoutRollCallViewModel CheckoutRollCall { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
//اقساط - مساعده
|
||||
#region SalaryAidAndInstallmentData
|
||||
|
||||
public List<CheckoutPrintInstallmentDto> Installments { get; set; }
|
||||
public List<CheckoutPrintSalaryAidDto> SalaryAids { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// کسورات
|
||||
/// </summary>
|
||||
public class PaymentData
|
||||
{
|
||||
/// <summary>
|
||||
/// حقوق و مزد
|
||||
/// </summary>
|
||||
public string MonthlySalary { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// پایه سنوات
|
||||
/// </summary>
|
||||
public string BaseYearsPay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کمک هزینه اقلام مصرفی
|
||||
/// </summary>
|
||||
public string ConsumableItems { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کمک هزینه مسکن
|
||||
/// </summary>
|
||||
public string HousingAllowance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// فوق العاده اضافه کاری
|
||||
/// </summary>
|
||||
public string OvertimePay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// فوق العاده شبکاری
|
||||
/// </summary>
|
||||
public string NightworkPay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// فوق العاده جمعه کاری
|
||||
/// </summary>
|
||||
public string FridayPay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// فوق العاده ماموریت
|
||||
/// </summary>
|
||||
public string MissionPay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// فوق العاده نوبت کاری
|
||||
/// </summary>
|
||||
public string ShiftPay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کمک هزینه عائله مندی
|
||||
/// </summary>
|
||||
public string FamilyAllowance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// حق تاهل
|
||||
/// </summary>
|
||||
public string MarriedAllowance { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// کسورات
|
||||
/// </summary>
|
||||
public class DeductionData
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public class PaymentAndDeductionList
|
||||
{
|
||||
public int RowNumber { get; set; }
|
||||
/// <summary>
|
||||
/// عنوان
|
||||
/// </summary>
|
||||
public string Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مقدار/روز/ساعت
|
||||
/// </summary>
|
||||
public string Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ
|
||||
/// </summary>
|
||||
public string Amount { get; set; }
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// لیست کارفرما
|
||||
/// </summary>
|
||||
public class CheckoutEmployersList
|
||||
{
|
||||
public string IsLegal { get; set; }
|
||||
public string EmployerFullName { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public class CheckoutGetData : CheckoutPrintDto
|
||||
{
|
||||
public DateTime ContractStart { get; set; }
|
||||
|
||||
public int PersonnelCode { get; set; }
|
||||
|
||||
public long WorkshopId { get; set; }
|
||||
public long EmployeeId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Checkout.Dto;
|
||||
|
||||
public class CheckoutSearchModelDto : PaginationRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// نام پرسنل
|
||||
/// </summary>
|
||||
public string EmployeeFullName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آی دی کارگاه
|
||||
/// </summary>
|
||||
public long WorkshopId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره قرارداد
|
||||
/// </summary>
|
||||
public string ContractNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع فیش
|
||||
/// </summary>
|
||||
public string ContractStart { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ پاین فیش
|
||||
/// </summary>
|
||||
public string ContractEnd { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ماه
|
||||
/// </summary>
|
||||
public string Month { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// سال
|
||||
/// </summary>
|
||||
public string Year { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آی دی گارفرما
|
||||
/// </summary>
|
||||
public long EmployerId { get; set; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace CompanyManagment.App.Contracts.Checkout.Dto;
|
||||
|
||||
public class EmployeeSelectListDto
|
||||
{
|
||||
/// <summary>
|
||||
/// آی دی پرسنل
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام پرسنل
|
||||
/// </summary>
|
||||
public string EmployeeFullName { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Checkout.Dto;
|
||||
|
||||
public class RotatingShiftOfCheckoutDto
|
||||
{
|
||||
/// <summary>
|
||||
/// نام پرسنل
|
||||
/// </summary>
|
||||
public string FullName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت نوبتکاری
|
||||
/// </summary>
|
||||
public string RotatingShiftStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا نوبت کاری دارد
|
||||
/// </summary>
|
||||
public bool HasRotatingShift { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// سال و ماه
|
||||
/// </summary>
|
||||
public string YearAndMonth { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// نوع ساعت کاری
|
||||
/// </summary>
|
||||
public string TypeOfWorkingHours { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// لیست نوبت کاری
|
||||
/// </summary>
|
||||
public List<RotatingShiftListDto> RotatingShiftList { get; set; }
|
||||
}
|
||||
|
||||
public class RotatingShiftListDto
|
||||
{
|
||||
/// <summary>
|
||||
/// بازه کاری صبح
|
||||
/// </summary>
|
||||
public string MorningShiftSpan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// بازه کاری عصر
|
||||
/// </summary>
|
||||
public string EveningShiftSpan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// بازه کاری شب
|
||||
/// </summary>
|
||||
public string NightShiftSpan { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// آیا صبح کاری داشته
|
||||
/// </summary>
|
||||
public bool IsMorningShift { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا عصرکاری داشته
|
||||
/// </summary>
|
||||
public bool IsEveningShift { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا شبکاری داشته
|
||||
/// </summary>
|
||||
public bool IsNightShift { get; set; }
|
||||
/// <summary>
|
||||
/// تاریخ شیفت
|
||||
/// </summary>
|
||||
public string ShiftDate { get; set; }
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.Checkout.Dto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Checkout;
|
||||
|
||||
@@ -62,4 +63,49 @@ public interface ICheckoutApplication
|
||||
long workshopId, DateTime start, DateTime end);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region ForApi
|
||||
|
||||
/// <summary>
|
||||
/// دریافت سلکت لیست پرسنل کارگاه
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<EmployeeSelectListDto>> GetEmployeeSelectListByWorkshopId(long id);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست فیش های حقوقی ادمین
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <returns></returns>
|
||||
Task<PagedResult<CheckoutDto>> GetList(CheckoutSearchModelDto searchModel);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت نوبتکاری
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<RotatingShiftOfCheckoutDto> GetRotatingShiftApi(long id);
|
||||
|
||||
/// <summary>
|
||||
/// پرینت فیش حقوقی
|
||||
/// Api
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<CheckoutPrintDto>> CheckoutPrint(List<long> ids);
|
||||
#endregion
|
||||
}
|
||||
|
||||
public class CheckoutPrintInstallmentDto
|
||||
{
|
||||
public string RemainingAmount { get; set; }
|
||||
public string LoanAmount { get; set; }
|
||||
public string Amount { get; set; }
|
||||
}
|
||||
public class CheckoutPrintSalaryAidDto
|
||||
{
|
||||
public string Amount { get; set; }
|
||||
public string SalaryAidDateTimeFa { get; set; }
|
||||
}
|
||||
@@ -45,4 +45,42 @@ namespace CompanyManagment.App.Contracts.RollCall
|
||||
}
|
||||
#endregion
|
||||
|
||||
public class CheckoutPrintRollCallDto
|
||||
{
|
||||
|
||||
public string RollCallDateFa { get; set; }
|
||||
public string StartDate1 { get; set; }
|
||||
public string EndDate1 { get; set; }
|
||||
|
||||
public string StartDate2 { get; set; }
|
||||
public string EndDate2 { get; set; }
|
||||
|
||||
//منقطع بودن شیفت کاری
|
||||
public bool IsSliced { get; set; }
|
||||
|
||||
public string TotalWorkingHours { get; set; }
|
||||
|
||||
public string DayOfWeek { get; set; }
|
||||
|
||||
public string BreakTimeString { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اگر مرخصی نداشته باشد خالی خواهد بود، اگر داشته باشد نوع مرخصی جانشانی می شود
|
||||
/// </summary>
|
||||
public string LeaveType { get; set; }
|
||||
|
||||
public bool IsAbsent { get; set; }
|
||||
public bool IsFriday { get; set; }
|
||||
public bool IsHoliday { get; set; }
|
||||
public bool IsBirthDay { get; set; }
|
||||
|
||||
|
||||
public string EnterDifferencesMinutes1 { get; set; }
|
||||
public string ExitDifferencesMinutes1 { get; set; }
|
||||
|
||||
public string EnterDifferencesMinutes2 { get; set; }
|
||||
public string ExitDifferencesMinutes2 { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
namespace CompanyManagment.App.Contracts.Workshop.DTOs;
|
||||
|
||||
public class AdminWorkshopSelectListDto
|
||||
{
|
||||
/// <summary>
|
||||
/// آی دی کارگاه
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کارگاه
|
||||
/// </summary>
|
||||
public string WorkshopFullName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد بایگانی
|
||||
/// </summary>
|
||||
public string ArchiveCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا بلاک شده است
|
||||
/// </summary>
|
||||
public bool IsBlock { get; set; }
|
||||
}
|
||||
@@ -1,10 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application;
|
||||
using AccountManagement.Application.Contracts.Account;
|
||||
using CompanyManagment.App.Contracts.Checkout.Dto;
|
||||
using CompanyManagment.App.Contracts.Workshop.DTOs;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Workshop;
|
||||
|
||||
@@ -92,6 +93,19 @@ public interface IWorkshopApplication
|
||||
#endregion
|
||||
|
||||
Task<ActionResult<OperationResult>> CreateWorkshopWorkflowRegistration(CreateWorkshopWorkflowRegistration command);
|
||||
|
||||
|
||||
#region ForApi
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست کارگاه های ادمین برای سلکت تو
|
||||
/// Api
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<AdminWorkshopSelectListDto>> GetAdminWorkshopSelectList();
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public class CreateWorkshopWorkflowRegistration
|
||||
|
||||
@@ -1,28 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||
using Company.Domain.CheckoutAgg;
|
||||
using Company.Domain.CheckoutAgg.ValueObjects;
|
||||
using Company.Domain.LeftWorkAgg;
|
||||
using Company.Domain.YearlySalaryAgg;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
using Company.Domain.empolyerAgg;
|
||||
using Company.Domain.LeaveAgg;
|
||||
using Company.Domain.LeftWorkAgg;
|
||||
using Company.Domain.RollCallAgg;
|
||||
using Company.Domain.WorkingHoursTempAgg;
|
||||
using Company.Domain.WorkshopAgg;
|
||||
using Company.Domain.YearlySalaryAgg;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
using CompanyManagment.App.Contracts.Checkout.Dto;
|
||||
using CompanyManagment.App.Contracts.Contract;
|
||||
using CompanyManagment.App.Contracts.HolidayItem;
|
||||
using CompanyManagment.App.Contracts.Leave;
|
||||
using CompanyManagment.App.Contracts.MandantoryHours;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
using CompanyManagment.App.Contracts.HolidayItem;
|
||||
using CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using CompanyManagment.App.Contracts.WorkingHoursTemp;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using CompanyManagment.EFCore.Migrations;
|
||||
using CompanyManagment.EFCore.Repository;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
using Company.Domain.LeaveAgg;
|
||||
using Company.Domain.WorkshopAgg;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
@@ -38,11 +44,14 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
private readonly IRollCallMandatoryRepository _rollCallMandatoryRepository;
|
||||
private readonly IRollCallRepository _rollCallRepository;
|
||||
private readonly IHolidayItemApplication _holidayItemApplication;
|
||||
private readonly IWorkingHoursTempRepository _workingHoursTempRepository;
|
||||
private readonly IWorkshopRepository _workshopRepository;
|
||||
|
||||
|
||||
public CheckoutApplication(ICheckoutRepository checkoutRepository, IYearlySalaryRepository yearlySalaryRepository,
|
||||
|
||||
public CheckoutApplication(ICheckoutRepository checkoutRepository, IYearlySalaryRepository yearlySalaryRepository,
|
||||
ILeftWorkRepository leftWorkRepository,
|
||||
IEmployerRepository employerRepository, IPersonalContractingPartyApp contractingPartyApp, ILeaveApplication leaveApplication, IMandatoryHoursApplication mandatoryHoursApplication, IRollCallMandatoryRepository rollCallMandatoryRepository, IRollCallRepository rollCallRepository, IHolidayItemApplication holidayItemApplication)
|
||||
IEmployerRepository employerRepository, IPersonalContractingPartyApp contractingPartyApp, ILeaveApplication leaveApplication, IMandatoryHoursApplication mandatoryHoursApplication, IRollCallMandatoryRepository rollCallMandatoryRepository, IRollCallRepository rollCallRepository, IHolidayItemApplication holidayItemApplication, IWorkingHoursTempRepository workingHoursTempRepository, IWorkshopRepository workshopRepository)
|
||||
{
|
||||
_checkoutRepository = checkoutRepository;
|
||||
_yearlySalaryRepository = yearlySalaryRepository;
|
||||
@@ -54,7 +63,9 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
_rollCallMandatoryRepository = rollCallMandatoryRepository;
|
||||
_rollCallRepository = rollCallRepository;
|
||||
_holidayItemApplication = holidayItemApplication;
|
||||
}
|
||||
_workingHoursTempRepository = workingHoursTempRepository;
|
||||
_workshopRepository = workshopRepository;
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper.DPA", "DPA0007: Large number of DB records", MessageId = "count: 241")]
|
||||
public void Create(CreateCheckout command)
|
||||
@@ -706,5 +717,69 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
return _checkoutRepository.GetLastCheckoutsByWorkshopIdForWorkFlow(workshopId, start, end);
|
||||
}
|
||||
|
||||
#endregion
|
||||
public async Task<List<EmployeeSelectListDto>> GetEmployeeSelectListByWorkshopId(long id)
|
||||
{
|
||||
return await _checkoutRepository.GetEmployeeSelectListByWorkshopId(id);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region ForApi
|
||||
|
||||
public async Task<PagedResult<CheckoutDto>> GetList(CheckoutSearchModelDto searchModel)
|
||||
{
|
||||
return await _checkoutRepository.GetList(searchModel);
|
||||
}
|
||||
|
||||
|
||||
public async Task<RotatingShiftOfCheckoutDto> GetRotatingShiftApi(long id)
|
||||
{
|
||||
var result = new ComputingViewModel();
|
||||
var checkout = GetDetails(id);
|
||||
var workingHours = _workingHoursTempRepository.GetByContractIdConvertToShiftwork4(checkout.ContractId);
|
||||
var typeOfWorkingHours = "";
|
||||
if (checkout.HasRollCall)
|
||||
{
|
||||
result = await _rollCallMandatoryRepository.RotatingShiftReport(checkout.WorkshopId, checkout.EmployeeId, checkout.ContractStartGr, checkout.ContractEndGr, workingHours.ShiftWork, true, workingHours, false);
|
||||
typeOfWorkingHours = "دارای حضورغیاب";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var workshop = _workshopRepository.GetDetails(checkout.WorkshopId);
|
||||
result = await _rollCallMandatoryRepository.RotatingShiftReport(checkout.WorkshopId, checkout.EmployeeId, checkout.ContractStartGr, checkout.ContractEndGr, workingHours.ShiftWork, false, workingHours, workshop.WorkshopHolidayWorking);
|
||||
typeOfWorkingHours = "بدون حضورغیاب";
|
||||
}
|
||||
|
||||
var items = result.RotatingResultList.Select(x => new RotatingShiftListDto()
|
||||
{
|
||||
MorningShiftSpan = x.MorningString,
|
||||
EveningShiftSpan = x.EveningString,
|
||||
NightShiftSpan = x.NightString,
|
||||
|
||||
IsMorningShift = x.IsMorningShift,
|
||||
IsEveningShift = x.IsEveningShift,
|
||||
IsNightShift = x.IsNightShift,
|
||||
|
||||
ShiftDate = x.RotatingDate
|
||||
}).ToList();
|
||||
return new RotatingShiftOfCheckoutDto()
|
||||
{
|
||||
FullName = checkout.EmployeeFullName,
|
||||
YearAndMonth = $"{checkout.Month} {checkout.Year}",
|
||||
HasRotatingShift = result.RotatingStatus != "نوبت کاری ندارد",
|
||||
RotatingShiftStatus = result.RotatingStatus,
|
||||
TypeOfWorkingHours = typeOfWorkingHours,
|
||||
RotatingShiftList = items
|
||||
};
|
||||
}
|
||||
|
||||
public Task<List<CheckoutPrintDto>> CheckoutPrint(List<long> ids)
|
||||
{
|
||||
return _checkoutRepository.CheckoutPrint(ids);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -11,6 +11,7 @@ using Company.Domain.InstitutionContractAgg;
|
||||
using Company.Domain.LeftWorkAgg;
|
||||
using Company.Domain.LeftWorkInsuranceAgg;
|
||||
using Company.Domain.WorkshopAgg;
|
||||
using CompanyManagment.App.Contracts.Checkout.Dto;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.EmployeeChildren;
|
||||
using CompanyManagment.App.Contracts.LeftWork;
|
||||
@@ -1130,5 +1131,17 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region ForApi
|
||||
|
||||
public async Task<List<AdminWorkshopSelectListDto>> GetAdminWorkshopSelectList()
|
||||
{
|
||||
return await _workshopRepository.GetAdminWorkshopSelectList();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1604,9 +1604,14 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
bool workshopHolidyWorking)
|
||||
{
|
||||
var rollCallList = new List<RollCallViewModel>();
|
||||
|
||||
|
||||
#region Entities
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.ContarctStart) || string.IsNullOrWhiteSpace(command.ContractEnd))
|
||||
{
|
||||
command.ContarctStart = command.ContractStartGr.ToFarsi();
|
||||
command.ContractEnd = command.ContractEndGr.ToFarsi();
|
||||
}
|
||||
var sdate = command.ContarctStart.ToEnglishNumber();
|
||||
var edate = command.ContractEnd.ToEnglishNumber();
|
||||
var syear = Convert.ToInt32(sdate.Substring(0, 4));
|
||||
|
||||
@@ -1187,14 +1187,14 @@ public class WorkshopRepository : RepositoryBase<long, Company.Domain.WorkshopAg
|
||||
.Where(x => !string.IsNullOrEmpty(x.ArchiveCode))
|
||||
.Select(x => x.ArchiveCode)
|
||||
.ToList();
|
||||
|
||||
|
||||
int maxArchiveCode = 0;
|
||||
|
||||
|
||||
foreach (var code in archiveCodes)
|
||||
{
|
||||
// Remove "b-" prefix if exists
|
||||
string cleanCode = code.StartsWith("b-") ? code.Substring(2) : code;
|
||||
|
||||
|
||||
// Try to parse the clean code to an integer
|
||||
if (int.TryParse(cleanCode, out int codeValue))
|
||||
{
|
||||
@@ -1204,7 +1204,7 @@ public class WorkshopRepository : RepositoryBase<long, Company.Domain.WorkshopAg
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return maxArchiveCode;
|
||||
}
|
||||
|
||||
@@ -2024,5 +2024,52 @@ public class WorkshopRepository : RepositoryBase<long, Company.Domain.WorkshopAg
|
||||
}).OrderByDescending(x => x.StartWork).ToList();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region ForApi
|
||||
|
||||
public async Task<List<AdminWorkshopSelectListDto>> GetAdminWorkshopSelectList()
|
||||
{
|
||||
var watch = new Stopwatch();
|
||||
watch.Start();
|
||||
var acountId = _authHelper.CurrentAccountId();
|
||||
|
||||
var workshopIds = _context.WorkshopAccounts.AsNoTracking().Where(x => x.AccountId == acountId).Select(x => x.WorkshopId);
|
||||
|
||||
var employers = await
|
||||
_context.WorkshopEmployers.AsNoTracking().Where(x => workshopIds.Contains(x.WorkshopId))
|
||||
.Select(x => new { x.Employer, x.WorkshopId }).ToListAsync();
|
||||
|
||||
var blockedContractingParties =await _context.PersonalContractingParties
|
||||
.Where(x => x.IsBlock == "true").Select(x=>x.id).ToListAsync();
|
||||
|
||||
var workshops = await _context.Workshops.AsNoTracking()
|
||||
.Where(x => workshopIds.Contains(x.id))
|
||||
.Where(x => x.IsActiveString == "true").ToListAsync();
|
||||
|
||||
|
||||
var result = workshops.Select(x =>
|
||||
{
|
||||
var empl = employers.First(em => em.WorkshopId == x.id);
|
||||
var isBlock = blockedContractingParties.Any(cp => cp == empl.Employer.ContractingPartyId);
|
||||
return new AdminWorkshopSelectListDto
|
||||
{
|
||||
Id = x.id,
|
||||
WorkshopFullName = x.WorkshopFullName,
|
||||
ArchiveCode = x.ArchiveCode,
|
||||
IsBlock = isBlock
|
||||
};
|
||||
|
||||
}).OrderBy(x=>x.IsBlock ? 1 : 0)
|
||||
.ToList();
|
||||
|
||||
Console.WriteLine("workshopSelectList : " +watch.Elapsed);
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
98
ServiceHost/Areas/Admin/Controllers/CheckoutController.cs
Normal file
98
ServiceHost/Areas/Admin/Controllers/CheckoutController.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Checkout.Dto;
|
||||
using CompanyManagment.App.Contracts.InstitutionPlan;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using CompanyManagment.App.Contracts.Workshop.DTOs;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NuGet.Packaging.Signing;
|
||||
using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Controllers;
|
||||
|
||||
public class CheckoutController : AdminBaseController
|
||||
{
|
||||
private readonly ICheckoutApplication _checkoutApplication;
|
||||
private readonly IWorkshopApplication _workshopApplication;
|
||||
|
||||
public CheckoutController(ICheckoutApplication checkoutApplication, IWorkshopApplication workshopApplication)
|
||||
{
|
||||
_checkoutApplication = checkoutApplication;
|
||||
_workshopApplication = workshopApplication;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست فیش حقوقی
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<PagedResult<CheckoutDto>>> GetList(CheckoutSearchModelDto searchModel)
|
||||
{
|
||||
return await _checkoutApplication.GetList(searchModel);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// دریافت نوبت کاری
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("RotatingShift")]
|
||||
public async Task<RotatingShiftOfCheckoutDto> GetRotatingShift(long id)
|
||||
{
|
||||
var result =await _checkoutApplication.GetRotatingShiftApi(id);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// پرینت گروهی فیش حقوقی
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("GroupPrint")]
|
||||
public async Task<List<CheckoutPrintDto>> Print(List<long> ids)
|
||||
{
|
||||
var result =await _checkoutApplication.CheckoutPrint(ids);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// پرینت تکی فیش حقوقی
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("PrintOne")]
|
||||
public async Task<List<CheckoutPrintDto>> Print(long id)
|
||||
{
|
||||
var result = await _checkoutApplication.CheckoutPrint([id]);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
#region CreateCheckout
|
||||
/// <summary>
|
||||
/// سلکت لیست کارگاه
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("WorkshopSelectList")]
|
||||
public async Task<List<AdminWorkshopSelectListDto>> GetWorkshopSelectList()
|
||||
{
|
||||
var result =await _workshopApplication.GetAdminWorkshopSelectList();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// سلک لیست پرسنل
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("EmployeeSelectList")]
|
||||
public async Task<List<EmployeeSelectListDto>> GetEmployeeSelectListByWorkshopId(long workshopId)
|
||||
{
|
||||
var result = await _checkoutApplication.GetEmployeeSelectListByWorkshopId(workshopId);
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
@@ -22,9 +22,12 @@ public class CheckoutPrintAllModel : PageModel
|
||||
}
|
||||
|
||||
public void OnGet(string idlist)
|
||||
{
|
||||
var ids = ExtractNumbers(idlist);
|
||||
var resultList = new List<CheckoutGroupPrintViewModel>();
|
||||
{
|
||||
|
||||
|
||||
var ids = ExtractNumbers(idlist);
|
||||
|
||||
var resultList = new List<CheckoutGroupPrintViewModel>();
|
||||
|
||||
var res = _checkoutApplication.PrintAll(ids);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user