Compare commits
3 Commits
AdminCheck
...
Feature/fi
| Author | SHA1 | Date | |
|---|---|---|---|
| 18867b4929 | |||
| a9df0669c6 | |||
| 5c75316f40 |
@@ -445,30 +445,6 @@ public static class Tools
|
|||||||
|
|
||||||
return myMoney.ToString("N0", CultureInfo.CreateSpecificCulture("fa-ir"));
|
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)
|
public static string ToMoneyNullable(this double? myMoney)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
using _0_Framework.Application;
|
using System;
|
||||||
using _0_Framework.Domain;
|
|
||||||
using CompanyManagment.App.Contracts.Checkout;
|
|
||||||
using CompanyManagment.App.Contracts.Checkout.Dto;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using _0_Framework.Application;
|
||||||
|
using _0_Framework.Domain;
|
||||||
|
using CompanyManagment.App.Contracts.Checkout;
|
||||||
|
|
||||||
|
|
||||||
namespace Company.Domain.CheckoutAgg;
|
namespace Company.Domain.CheckoutAgg;
|
||||||
@@ -81,31 +80,4 @@ public interface ICheckoutRepository : IRepository<long, Checkout>
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Task<Checkout> GetByWorkshopIdEmployeeIdInDate(long workshopId, long employeeId, DateTime inDate);
|
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,14 +106,4 @@ public interface IWorkshopRepository : IRepository<long, Workshop>
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region ForApi
|
|
||||||
/// <summary>
|
|
||||||
/// دریافت لیست کارگاه های ادمین برای سلکت تو
|
|
||||||
/// Api
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<AdminWorkshopSelectListDto>> GetAdminWorkshopSelectList();
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
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; }
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,247 +0,0 @@
|
|||||||
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; }
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
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; }
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
namespace CompanyManagment.App.Contracts.Checkout.Dto;
|
|
||||||
|
|
||||||
public class EmployeeSelectListDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// آی دی پرسنل
|
|
||||||
/// </summary>
|
|
||||||
public long Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// نام پرسنل
|
|
||||||
/// </summary>
|
|
||||||
public string EmployeeFullName { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
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,10 +1,9 @@
|
|||||||
using _0_Framework.Application;
|
using System;
|
||||||
using CompanyManagment.App.Contracts.Checkout.Dto;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using _0_Framework.Application;
|
||||||
|
|
||||||
namespace CompanyManagment.App.Contracts.Checkout;
|
namespace CompanyManagment.App.Contracts.Checkout;
|
||||||
|
|
||||||
@@ -63,49 +62,4 @@ public interface ICheckoutApplication
|
|||||||
long workshopId, DateTime start, DateTime end);
|
long workshopId, DateTime start, DateTime end);
|
||||||
|
|
||||||
#endregion
|
#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,42 +45,4 @@ namespace CompanyManagment.App.Contracts.RollCall
|
|||||||
}
|
}
|
||||||
#endregion
|
#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; }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
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,11 +1,10 @@
|
|||||||
using _0_Framework.Application;
|
using System.Collections.Generic;
|
||||||
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.Runtime.InteropServices;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using _0_Framework.Application;
|
||||||
|
using AccountManagement.Application.Contracts.Account;
|
||||||
|
using CompanyManagment.App.Contracts.Workshop.DTOs;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace CompanyManagment.App.Contracts.Workshop;
|
namespace CompanyManagment.App.Contracts.Workshop;
|
||||||
|
|
||||||
@@ -93,19 +92,6 @@ public interface IWorkshopApplication
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Task<ActionResult<OperationResult>> CreateWorkshopWorkflowRegistration(CreateWorkshopWorkflowRegistration command);
|
Task<ActionResult<OperationResult>> CreateWorkshopWorkflowRegistration(CreateWorkshopWorkflowRegistration command);
|
||||||
|
|
||||||
|
|
||||||
#region ForApi
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// دریافت لیست کارگاه های ادمین برای سلکت تو
|
|
||||||
/// Api
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<AdminWorkshopSelectListDto>> GetAdminWorkshopSelectList();
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CreateWorkshopWorkflowRegistration
|
public class CreateWorkshopWorkflowRegistration
|
||||||
|
|||||||
@@ -1,34 +1,28 @@
|
|||||||
using _0_Framework.Application;
|
using System;
|
||||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
|
||||||
using Company.Domain.CheckoutAgg;
|
|
||||||
using Company.Domain.CheckoutAgg.ValueObjects;
|
|
||||||
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.Checkout.Dto;
|
|
||||||
using CompanyManagment.App.Contracts.Contract;
|
|
||||||
using CompanyManagment.App.Contracts.HolidayItem;
|
|
||||||
using CompanyManagment.App.Contracts.Leave;
|
|
||||||
using CompanyManagment.App.Contracts.MandantoryHours;
|
|
||||||
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.Collections.Generic;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Globalization;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using _0_Framework.Application;
|
||||||
|
using Company.Domain.CheckoutAgg;
|
||||||
|
using Company.Domain.CheckoutAgg.ValueObjects;
|
||||||
|
using Company.Domain.LeftWorkAgg;
|
||||||
|
using Company.Domain.YearlySalaryAgg;
|
||||||
|
using Company.Domain.empolyerAgg;
|
||||||
|
using Company.Domain.RollCallAgg;
|
||||||
|
using CompanyManagment.App.Contracts.Checkout;
|
||||||
|
using CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||||
|
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.RollCall;
|
||||||
|
using CompanyManagment.EFCore.Migrations;
|
||||||
|
using CompanyManagment.EFCore.Repository;
|
||||||
|
using System.Globalization;
|
||||||
|
using Company.Domain.LeaveAgg;
|
||||||
|
using Company.Domain.WorkshopAgg;
|
||||||
|
|
||||||
namespace CompanyManagment.Application;
|
namespace CompanyManagment.Application;
|
||||||
|
|
||||||
@@ -44,14 +38,11 @@ public class CheckoutApplication : ICheckoutApplication
|
|||||||
private readonly IRollCallMandatoryRepository _rollCallMandatoryRepository;
|
private readonly IRollCallMandatoryRepository _rollCallMandatoryRepository;
|
||||||
private readonly IRollCallRepository _rollCallRepository;
|
private readonly IRollCallRepository _rollCallRepository;
|
||||||
private readonly IHolidayItemApplication _holidayItemApplication;
|
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,
|
ILeftWorkRepository leftWorkRepository,
|
||||||
IEmployerRepository employerRepository, IPersonalContractingPartyApp contractingPartyApp, ILeaveApplication leaveApplication, IMandatoryHoursApplication mandatoryHoursApplication, IRollCallMandatoryRepository rollCallMandatoryRepository, IRollCallRepository rollCallRepository, IHolidayItemApplication holidayItemApplication, IWorkingHoursTempRepository workingHoursTempRepository, IWorkshopRepository workshopRepository)
|
IEmployerRepository employerRepository, IPersonalContractingPartyApp contractingPartyApp, ILeaveApplication leaveApplication, IMandatoryHoursApplication mandatoryHoursApplication, IRollCallMandatoryRepository rollCallMandatoryRepository, IRollCallRepository rollCallRepository, IHolidayItemApplication holidayItemApplication)
|
||||||
{
|
{
|
||||||
_checkoutRepository = checkoutRepository;
|
_checkoutRepository = checkoutRepository;
|
||||||
_yearlySalaryRepository = yearlySalaryRepository;
|
_yearlySalaryRepository = yearlySalaryRepository;
|
||||||
@@ -63,9 +54,7 @@ public class CheckoutApplication : ICheckoutApplication
|
|||||||
_rollCallMandatoryRepository = rollCallMandatoryRepository;
|
_rollCallMandatoryRepository = rollCallMandatoryRepository;
|
||||||
_rollCallRepository = rollCallRepository;
|
_rollCallRepository = rollCallRepository;
|
||||||
_holidayItemApplication = holidayItemApplication;
|
_holidayItemApplication = holidayItemApplication;
|
||||||
_workingHoursTempRepository = workingHoursTempRepository;
|
}
|
||||||
_workshopRepository = workshopRepository;
|
|
||||||
}
|
|
||||||
|
|
||||||
[SuppressMessage("ReSharper.DPA", "DPA0007: Large number of DB records", MessageId = "count: 241")]
|
[SuppressMessage("ReSharper.DPA", "DPA0007: Large number of DB records", MessageId = "count: 241")]
|
||||||
public void Create(CreateCheckout command)
|
public void Create(CreateCheckout command)
|
||||||
@@ -717,69 +706,5 @@ public class CheckoutApplication : ICheckoutApplication
|
|||||||
return _checkoutRepository.GetLastCheckoutsByWorkshopIdForWorkFlow(workshopId, start, end);
|
return _checkoutRepository.GetLastCheckoutsByWorkshopIdForWorkFlow(workshopId, start, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<EmployeeSelectListDto>> GetEmployeeSelectListByWorkshopId(long id)
|
#endregion
|
||||||
{
|
|
||||||
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
|
|
||||||
}
|
}
|
||||||
@@ -1524,8 +1524,7 @@ public class InsuranceListApplication : IInsuranceListApplication
|
|||||||
var dateOfBirth = employeeData.DateOfBirthGr.ToFarsi();
|
var dateOfBirth = employeeData.DateOfBirthGr.ToFarsi();
|
||||||
var dateOfIssue = employeeData.DateOfIssueGr.ToFarsi();
|
var dateOfIssue = employeeData.DateOfIssueGr.ToFarsi();
|
||||||
var leftDate = employeeData.LeftWorkDateGr != null ? employeeData.LeftWorkDateGr.Value.AddDays(-1) : new DateTime();
|
var leftDate = employeeData.LeftWorkDateGr != null ? employeeData.LeftWorkDateGr.Value.AddDays(-1) : new DateTime();
|
||||||
|
var workingDays = Tools.GetEmployeeInsuranceWorkingDays(employeeData.StartWorkDateGr, leftDate, startDateGr, endDateGr, employeeData.EmployeeId);
|
||||||
var workingDays = Tools.GetEmployeeInsuranceWorkingDays(employeeData.StartWorkDateGr, leftDate, startDateGr, endDateGr, employeeData.EmployeeId);
|
|
||||||
var leftWorkFa = workingDays.hasLeftWorkInMonth ? employeeData.LeftWorkDateGr.ToFarsi() : "";
|
var leftWorkFa = workingDays.hasLeftWorkInMonth ? employeeData.LeftWorkDateGr.ToFarsi() : "";
|
||||||
var startWorkFa = employeeData.StartWorkDateGr.ToFarsi();
|
var startWorkFa = employeeData.StartWorkDateGr.ToFarsi();
|
||||||
var workshop = _workShopRepository.GetDetails(workshopId);
|
var workshop = _workShopRepository.GetDetails(workshopId);
|
||||||
@@ -1607,7 +1606,7 @@ public class InsuranceListApplication : IInsuranceListApplication
|
|||||||
MaritalStatus = employeeData.MaritalStatus,
|
MaritalStatus = employeeData.MaritalStatus,
|
||||||
|
|
||||||
StartMonthCurrent = startMonthFa,
|
StartMonthCurrent = startMonthFa,
|
||||||
WorkingDays = employeeData.WorkingDays,
|
WorkingDays = workingDays.countWorkingDays,
|
||||||
StartWorkDate = startWorkFa,
|
StartWorkDate = startWorkFa,
|
||||||
StartWorkDateGr = employeeData.StartWorkDateGr,
|
StartWorkDateGr = employeeData.StartWorkDateGr,
|
||||||
LeftWorkDate = leftWorkFa,
|
LeftWorkDate = leftWorkFa,
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ using Company.Domain.InstitutionContractAgg;
|
|||||||
using Company.Domain.LeftWorkAgg;
|
using Company.Domain.LeftWorkAgg;
|
||||||
using Company.Domain.LeftWorkInsuranceAgg;
|
using Company.Domain.LeftWorkInsuranceAgg;
|
||||||
using Company.Domain.WorkshopAgg;
|
using Company.Domain.WorkshopAgg;
|
||||||
using CompanyManagment.App.Contracts.Checkout.Dto;
|
|
||||||
using CompanyManagment.App.Contracts.Employee;
|
using CompanyManagment.App.Contracts.Employee;
|
||||||
using CompanyManagment.App.Contracts.EmployeeChildren;
|
using CompanyManagment.App.Contracts.EmployeeChildren;
|
||||||
using CompanyManagment.App.Contracts.LeftWork;
|
using CompanyManagment.App.Contracts.LeftWork;
|
||||||
@@ -1131,17 +1130,5 @@ public class WorkshopAppliction : IWorkshopApplication
|
|||||||
return operation.Succcedded();
|
return operation.Succcedded();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
#region ForApi
|
|
||||||
|
|
||||||
public async Task<List<AdminWorkshopSelectListDto>> GetAdminWorkshopSelectList()
|
|
||||||
{
|
|
||||||
return await _workshopRepository.GetAdminWorkshopSelectList();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1604,14 +1604,9 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
|||||||
bool workshopHolidyWorking)
|
bool workshopHolidyWorking)
|
||||||
{
|
{
|
||||||
var rollCallList = new List<RollCallViewModel>();
|
var rollCallList = new List<RollCallViewModel>();
|
||||||
|
|
||||||
#region Entities
|
#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 sdate = command.ContarctStart.ToEnglishNumber();
|
||||||
var edate = command.ContractEnd.ToEnglishNumber();
|
var edate = command.ContractEnd.ToEnglishNumber();
|
||||||
var syear = Convert.ToInt32(sdate.Substring(0, 4));
|
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))
|
.Where(x => !string.IsNullOrEmpty(x.ArchiveCode))
|
||||||
.Select(x => x.ArchiveCode)
|
.Select(x => x.ArchiveCode)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
int maxArchiveCode = 0;
|
int maxArchiveCode = 0;
|
||||||
|
|
||||||
foreach (var code in archiveCodes)
|
foreach (var code in archiveCodes)
|
||||||
{
|
{
|
||||||
// Remove "b-" prefix if exists
|
// Remove "b-" prefix if exists
|
||||||
string cleanCode = code.StartsWith("b-") ? code.Substring(2) : code;
|
string cleanCode = code.StartsWith("b-") ? code.Substring(2) : code;
|
||||||
|
|
||||||
// Try to parse the clean code to an integer
|
// Try to parse the clean code to an integer
|
||||||
if (int.TryParse(cleanCode, out int codeValue))
|
if (int.TryParse(cleanCode, out int codeValue))
|
||||||
{
|
{
|
||||||
@@ -1204,7 +1204,7 @@ public class WorkshopRepository : RepositoryBase<long, Company.Domain.WorkshopAg
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return maxArchiveCode;
|
return maxArchiveCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2024,52 +2024,5 @@ public class WorkshopRepository : RepositoryBase<long, Company.Domain.WorkshopAg
|
|||||||
}).OrderByDescending(x => x.StartWork).ToList();
|
}).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
|
#endregion
|
||||||
}
|
}
|
||||||
@@ -209,38 +209,22 @@ public class CreateOrEditCheckoutCommandHandler : IBaseCommandHandler<CreateOrEd
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
////حقوق نهایی
|
//حقوق نهایی
|
||||||
//var monthlySalaryPay = (totalHoursWorked * monthlySalaryDefined) / mandatoryHours;
|
var monthlySalaryPay = (totalHoursWorked * monthlySalaryDefined) / mandatoryHours;
|
||||||
//// اگر اضافه کار داشت حقوق تعین شده به عنوان حقوق نهایی در نظر گرفته میشود
|
// اگر اضافه کار داشت حقوق تعین شده به عنوان حقوق نهایی در نظر گرفته میشود
|
||||||
//monthlySalaryPay = monthlySalaryPay > monthlySalaryDefined ? monthlySalaryDefined : monthlySalaryPay;
|
monthlySalaryPay = monthlySalaryPay > monthlySalaryDefined ? monthlySalaryDefined : monthlySalaryPay;
|
||||||
|
|
||||||
////حقوق کسر شده
|
//حقوق کسر شده
|
||||||
//var deductionFromSalary = monthlySalaryDefined - monthlySalaryPay;
|
var deductionFromSalary = monthlySalaryDefined - monthlySalaryPay;
|
||||||
|
|
||||||
//new chang salary compute
|
|
||||||
var monthlySalaryPay = totalHoursWorked * monthlySalaryDefined;
|
|
||||||
|
|
||||||
//زمان باقی مانده
|
//زمان باقی مانده
|
||||||
var remainingTime = totalHoursWorked - mandatoryHours;
|
var remainingTime = totalHoursWorked - mandatoryHours;
|
||||||
|
|
||||||
|
|
||||||
//تناسب به دقیقه
|
|
||||||
#region MyRegion
|
|
||||||
|
|
||||||
//var monthlySalaryDefinedTest = monthlySalaryDefined * mandatoryHours;
|
|
||||||
//var monthlySalaryPayTest = totalHoursWorked * monthlySalaryDefined;
|
|
||||||
////// اگر اضافه کار داشت حقوق تعین شده به عنوان حقوق نهایی در نظر گرفته میشود
|
|
||||||
//monthlySalaryPayTest = monthlySalaryPayTest > monthlySalaryDefinedTest ? monthlySalaryDefinedTest : monthlySalaryPayTest;
|
|
||||||
//////حقوق کسر شده
|
|
||||||
//var deductionFromSalaryTest = monthlySalaryDefinedTest - monthlySalaryPayTest;
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
var computeResult = new ComputeResultDto
|
var computeResult = new ComputeResultDto
|
||||||
{
|
{
|
||||||
MandatoryHours = mandatoryHours,
|
MandatoryHours = mandatoryHours,
|
||||||
MonthlySalaryPay = monthlySalaryPay,
|
MonthlySalaryPay = monthlySalaryPay,
|
||||||
DeductionFromSalary = 0 /*deductionFromSalary*/,
|
DeductionFromSalary = deductionFromSalary,
|
||||||
RemainingHours = remainingTime
|
RemainingHours = remainingTime
|
||||||
};
|
};
|
||||||
Console.WriteLine(mandatoryHours);
|
Console.WriteLine(mandatoryHours);
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
using DNTPersianUtils.Core;
|
using GozareshgirProgramManager.Application._Common.Interfaces;
|
||||||
using GozareshgirProgramManager.Application._Common.Interfaces;
|
|
||||||
using GozareshgirProgramManager.Application._Common.Models;
|
using GozareshgirProgramManager.Application._Common.Models;
|
||||||
using GozareshgirProgramManager.Application.Modules.SalaryPaymentSettings.Queries.GetUserListWhoHaveSettings;
|
using GozareshgirProgramManager.Application.Modules.SalaryPaymentSettings.Queries.GetUserListWhoHaveSettings;
|
||||||
using GozareshgirProgramManager.Domain._Common;
|
using GozareshgirProgramManager.Domain._Common;
|
||||||
using GozareshgirProgramManager.Domain.CheckoutAgg.Enums;
|
using GozareshgirProgramManager.Domain.CheckoutAgg.Enums;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using PersianDateTime = PersianTools.Core.PersianDateTime;
|
using PersianTools.Core;
|
||||||
|
|
||||||
namespace GozareshgirProgramManager.Application.Modules.Checkouts.Queries.GetUserToGropCreate;
|
namespace GozareshgirProgramManager.Application.Modules.Checkouts.Queries.GetUserToGropCreate;
|
||||||
|
|
||||||
@@ -46,8 +45,8 @@ public class GetUserToGroupCreatingQueryHandler : IBaseQueryHandler<GetUserToGro
|
|||||||
"ایجاد فیش فقط برای ماه های گذشته امکان پذیر است");
|
"ایجاد فیش فقط برای ماه های گذشته امکان پذیر است");
|
||||||
|
|
||||||
|
|
||||||
//var lastMonthStart = lastMonth;
|
var lastMonthStart = lastMonth;
|
||||||
var lastMonthEnd = ((selectedDate.ToFarsi().FindeEndOfMonth())).ToGeorgianDateTime();
|
var lastMonthEnd = lastMonth;
|
||||||
|
|
||||||
var query =
|
var query =
|
||||||
await (from u in _context.Users
|
await (from u in _context.Users
|
||||||
@@ -61,8 +60,8 @@ public class GetUserToGroupCreatingQueryHandler : IBaseQueryHandler<GetUserToGro
|
|||||||
// LEFT JOIN
|
// LEFT JOIN
|
||||||
//فیش
|
//فیش
|
||||||
join ch in _context.Checkouts
|
join ch in _context.Checkouts
|
||||||
.Where(x => x.CheckoutStartDate < lastMonthEnd
|
.Where(x => x.CheckoutStartDate < lastMonthStart
|
||||||
&& x.CheckoutEndDate > selectedDate)
|
&& x.CheckoutEndDate >= lastMonthStart)
|
||||||
on u.Id equals ch.UserId into chJoin
|
on u.Id equals ch.UserId into chJoin
|
||||||
from ch in chJoin.DefaultIfEmpty()
|
from ch in chJoin.DefaultIfEmpty()
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,6 @@ public class ProjectSetTimeDetailsQueryHandler
|
|||||||
|
|
||||||
var skills = await _context.Skills
|
var skills = await _context.Skills
|
||||||
.AsNoTracking()
|
.AsNoTracking()
|
||||||
.OrderBy(x=>x.CreationDate)
|
|
||||||
.ToListAsync(cancellationToken);
|
.ToListAsync(cancellationToken);
|
||||||
|
|
||||||
var res = new ProjectSetTimeResponse(
|
var res = new ProjectSetTimeResponse(
|
||||||
@@ -85,7 +84,7 @@ public class ProjectSetTimeDetailsQueryHandler
|
|||||||
UserId = section?.OriginalAssignedUserId ?? 0,
|
UserId = section?.OriginalAssignedUserId ?? 0,
|
||||||
SkillId = skill.Id,
|
SkillId = skill.Id,
|
||||||
};
|
};
|
||||||
}).ToList(),
|
}).OrderBy(x => x.SkillId).ToList(),
|
||||||
task.Id,
|
task.Id,
|
||||||
level);
|
level);
|
||||||
|
|
||||||
@@ -115,7 +114,6 @@ public class ProjectSetTimeDetailsQueryHandler
|
|||||||
|
|
||||||
var skills = await _context.Skills
|
var skills = await _context.Skills
|
||||||
.AsNoTracking()
|
.AsNoTracking()
|
||||||
.OrderBy(x=>x.CreationDate)
|
|
||||||
.ToListAsync(cancellationToken);
|
.ToListAsync(cancellationToken);
|
||||||
|
|
||||||
var res = new ProjectSetTimeResponse(
|
var res = new ProjectSetTimeResponse(
|
||||||
@@ -137,7 +135,7 @@ public class ProjectSetTimeDetailsQueryHandler
|
|||||||
UserId = section?.UserId ?? 0,
|
UserId = section?.UserId ?? 0,
|
||||||
SkillId = skill.Id,
|
SkillId = skill.Id,
|
||||||
};
|
};
|
||||||
}).ToList(),
|
}).OrderBy(x => x.SkillId).ToList(),
|
||||||
phase.Id,
|
phase.Id,
|
||||||
level);
|
level);
|
||||||
|
|
||||||
@@ -167,7 +165,6 @@ public class ProjectSetTimeDetailsQueryHandler
|
|||||||
|
|
||||||
var skills = await _context.Skills
|
var skills = await _context.Skills
|
||||||
.AsNoTracking()
|
.AsNoTracking()
|
||||||
.OrderBy(x=>x.CreationDate)
|
|
||||||
.ToListAsync(cancellationToken);
|
.ToListAsync(cancellationToken);
|
||||||
|
|
||||||
var res = new ProjectSetTimeResponse(
|
var res = new ProjectSetTimeResponse(
|
||||||
@@ -189,7 +186,7 @@ public class ProjectSetTimeDetailsQueryHandler
|
|||||||
UserId = section?.UserId ?? 0,
|
UserId = section?.UserId ?? 0,
|
||||||
SkillId = skill.Id,
|
SkillId = skill.Id,
|
||||||
};
|
};
|
||||||
}).ToList(),
|
}).OrderBy(x => x.SkillId).ToList(),
|
||||||
project.Id,
|
project.Id,
|
||||||
level);
|
level);
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,12 @@
|
|||||||
using GozareshgirProgramManager.Application._Common.Interfaces;
|
using GozareshgirProgramManager.Application._Common.Interfaces;
|
||||||
using GozareshgirProgramManager.Application._Common.Models;
|
using GozareshgirProgramManager.Application._Common.Models;
|
||||||
using GozareshgirProgramManager.Application.Modules.TaskChat.DTOs;
|
using GozareshgirProgramManager.Application.Modules.TaskChat.DTOs;
|
||||||
using GozareshgirProgramManager.Domain.TaskChatAgg.Enums;
|
|
||||||
using MediatR;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace GozareshgirProgramManager.Application.Modules.TaskChat.Queries.GetMessages;
|
namespace GozareshgirProgramManager.Application.Modules.TaskChat.Queries.GetMessages;
|
||||||
|
|
||||||
public record GetMessagesQuery(
|
public record GetMessagesQuery(
|
||||||
Guid TaskId,
|
Guid TaskId,
|
||||||
MessageType? MessageType,
|
|
||||||
int Page = 1,
|
int Page = 1,
|
||||||
int PageSize = 50
|
int PageSize = 50
|
||||||
) : IBaseQuery<PaginationResult<MessageDto>>;
|
) : IBaseQuery<PaginationResult<MessageDto>>;
|
||||||
@@ -69,12 +66,7 @@ public class GetMessagesQueryHandler : IBaseQueryHandler<GetMessagesQuery, Pagin
|
|||||||
var query = _context.TaskChatMessages
|
var query = _context.TaskChatMessages
|
||||||
.Where(m => m.TaskId == request.TaskId && !m.IsDeleted)
|
.Where(m => m.TaskId == request.TaskId && !m.IsDeleted)
|
||||||
.Include(m => m.ReplyToMessage)
|
.Include(m => m.ReplyToMessage)
|
||||||
.OrderBy(m => m.CreationDate).AsQueryable();
|
.OrderBy(m => m.CreationDate);
|
||||||
|
|
||||||
if (request.MessageType.HasValue)
|
|
||||||
{
|
|
||||||
query = query.Where(m => m.MessageType == request.MessageType.Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
var totalCount = await query.CountAsync(cancellationToken);
|
var totalCount = await query.CountAsync(cancellationToken);
|
||||||
|
|
||||||
|
|||||||
@@ -1,98 +0,0 @@
|
|||||||
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
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -8,7 +8,6 @@ using GozareshgirProgramManager.Application.Modules.TaskChat.DTOs;
|
|||||||
using GozareshgirProgramManager.Application.Modules.TaskChat.Queries.GetMessages;
|
using GozareshgirProgramManager.Application.Modules.TaskChat.Queries.GetMessages;
|
||||||
using GozareshgirProgramManager.Application.Modules.TaskChat.Queries.GetPinnedMessages;
|
using GozareshgirProgramManager.Application.Modules.TaskChat.Queries.GetPinnedMessages;
|
||||||
using GozareshgirProgramManager.Application.Modules.TaskChat.Queries.SearchMessages;
|
using GozareshgirProgramManager.Application.Modules.TaskChat.Queries.SearchMessages;
|
||||||
using GozareshgirProgramManager.Domain.TaskChatAgg.Enums;
|
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using ServiceHost.BaseControllers;
|
using ServiceHost.BaseControllers;
|
||||||
@@ -31,17 +30,15 @@ public class TaskChatController : ProgramManagerBaseController
|
|||||||
/// دریافت لیست پیامهای یک تسک
|
/// دریافت لیست پیامهای یک تسک
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="taskId">شناسه تسک</param>
|
/// <param name="taskId">شناسه تسک</param>
|
||||||
/// <param name="messageType">نوع پیام</param>
|
|
||||||
/// <param name="page">صفحه (پیشفرض: 1)</param>
|
/// <param name="page">صفحه (پیشفرض: 1)</param>
|
||||||
/// <param name="pageSize">تعداد در هر صفحه (پیشفرض: 50)</param>
|
/// <param name="pageSize">تعداد در هر صفحه (پیشفرض: 50)</param>
|
||||||
[HttpGet("{taskId:guid}/messages")]
|
[HttpGet("{taskId:guid}/messages")]
|
||||||
public async Task<ActionResult<OperationResult<PaginationResult<MessageDto>>>> GetMessages(
|
public async Task<ActionResult<OperationResult<PaginationResult<MessageDto>>>> GetMessages(
|
||||||
Guid taskId,
|
Guid taskId,
|
||||||
[FromQuery] MessageType? messageType,
|
|
||||||
[FromQuery] int page = 1,
|
[FromQuery] int page = 1,
|
||||||
[FromQuery] int pageSize = 50)
|
[FromQuery] int pageSize = 50)
|
||||||
{
|
{
|
||||||
var query = new GetMessagesQuery(taskId,messageType, page, pageSize);
|
var query = new GetMessagesQuery(taskId, page, pageSize);
|
||||||
var result = await _mediator.Send(query);
|
var result = await _mediator.Send(query);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,12 +22,9 @@ public class CheckoutPrintAllModel : PageModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void OnGet(string idlist)
|
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);
|
var res = _checkoutApplication.PrintAll(ids);
|
||||||
|
|
||||||
|
|||||||
95
ServiceHost/Areas/Client/Controllers/FineController.cs
Normal file
95
ServiceHost/Areas/Client/Controllers/FineController.cs
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
using _0_Framework.Application;
|
||||||
|
using CompanyManagment.App.Contracts.Fine;
|
||||||
|
using CompanyManagment.App.Contracts.FineSubject;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using ServiceHost.BaseControllers;
|
||||||
|
|
||||||
|
namespace ServiceHost.Areas.Client.Controllers;
|
||||||
|
|
||||||
|
public class FineController:ClientBaseController
|
||||||
|
{
|
||||||
|
private readonly IFineApplication _fineApplication;
|
||||||
|
private readonly IFineSubjectApplication _fineSubjectApplication;
|
||||||
|
private readonly long _workshopId;
|
||||||
|
|
||||||
|
public FineController(IFineApplication fineApplication, IFineSubjectApplication fineSubjectApplication,
|
||||||
|
IAuthHelper authHelper)
|
||||||
|
{
|
||||||
|
_fineApplication = fineApplication;
|
||||||
|
_fineSubjectApplication = fineSubjectApplication;
|
||||||
|
_workshopId = authHelper.GetWorkshopId();
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public ActionResult<FinesGroupedViewModel> GetList([FromQuery]FineSearchViewModel searchModel)
|
||||||
|
{
|
||||||
|
searchModel.WorkshopId = _workshopId;
|
||||||
|
var res = _fineApplication.GetSearchListAsGrouped(searchModel);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public ActionResult<OperationResult> Create([FromBody]CreateFineViewModel command)
|
||||||
|
{
|
||||||
|
command.WorkshopId = _workshopId;
|
||||||
|
var res =_fineApplication.Create(command);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPut]
|
||||||
|
public ActionResult<OperationResult> Edit([FromBody]EditFineViewModel command)
|
||||||
|
{
|
||||||
|
command.WorkshopId = _workshopId;
|
||||||
|
var res = _fineApplication.Edit(command);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("{id:long}")]
|
||||||
|
public ActionResult<EditFineViewModel> Details(long id)
|
||||||
|
{
|
||||||
|
var res = _fineApplication.GetDetails(id);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpDelete(("{id:long}"))]
|
||||||
|
public ActionResult<OperationResult> Remove(long id)
|
||||||
|
{
|
||||||
|
var res = _fineApplication.Remove(id);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region FineSubject
|
||||||
|
|
||||||
|
[HttpGet("subject")]
|
||||||
|
public ActionResult<List<FineSubjectViewModel>> GetList()
|
||||||
|
{
|
||||||
|
var res = _fineSubjectApplication.GetAll(_workshopId);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost("subject/{id:long}")]
|
||||||
|
public ActionResult<OperationResult> CreateSubject(CreateFineSubjectViewModel command)
|
||||||
|
{
|
||||||
|
command.WorkshopId = _workshopId;
|
||||||
|
var res = _fineSubjectApplication.Create(command);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPut("subject/{id:long}")]
|
||||||
|
public ActionResult<OperationResult> EditSubject(EditFineSubjectViewModel command)
|
||||||
|
{
|
||||||
|
command.WorkshopId = _workshopId;
|
||||||
|
var res = _fineSubjectApplication.Edit(command);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpDelete("subject/{id:long}")]
|
||||||
|
public ActionResult<OperationResult> RemoveSubject(long id)
|
||||||
|
{
|
||||||
|
var res = _fineSubjectApplication.Delete(id);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user