Compare commits
35 Commits
Feature/ro
...
AdminCheck
| Author | SHA1 | Date | |
|---|---|---|---|
| a68b879e95 | |||
| 161f3a92a7 | |||
| 5a1ec104a1 | |||
|
|
5b6f967fca | ||
|
|
3317bde6d6 | ||
|
|
5cd30e5910 | ||
|
|
4463fdc177 | ||
|
|
2ce63d1e0f | ||
|
|
21302803b6 | ||
|
|
38603b2249 | ||
|
|
bf03247f81 | ||
|
|
12af5dcb56 | ||
|
|
8ec13ffae1 | ||
|
|
5508d4e88f | ||
| 43abb74c61 | |||
| 73e6681baa | |||
| 90b2fd2eab | |||
| d9c431e20e | |||
|
|
2746bf69ea | ||
|
|
77dbb50512 | ||
|
|
1c7e8824c7 | ||
| 0eff1b9a66 | |||
|
|
0d33d79620 | ||
|
|
e4355faffc | ||
|
|
577fe5db76 | ||
|
|
ec8333c715 | ||
|
|
8aa93e089a | ||
|
|
0ab3052251 | ||
|
|
5202779d9f | ||
|
|
67a85735f0 | ||
|
|
35e6355069 | ||
|
|
4de2e12ac5 | ||
|
|
23b65cfbfe | ||
|
|
48b75d2baa | ||
|
|
63edb33bf5 |
@@ -2,6 +2,8 @@
|
||||
|
||||
public enum TypeOfSmsSetting
|
||||
{
|
||||
//همه انواع پیامک
|
||||
All = 0,
|
||||
|
||||
/// <summary>
|
||||
/// پیامک
|
||||
@@ -23,7 +25,7 @@ public enum TypeOfSmsSetting
|
||||
|
||||
/// <summary>
|
||||
/// پیامک
|
||||
/// هشدار اول
|
||||
/// هشدار بدهی
|
||||
/// </summary>
|
||||
Warning,
|
||||
|
||||
@@ -38,4 +40,14 @@ public enum TypeOfSmsSetting
|
||||
/// </summary>
|
||||
InstitutionContractConfirm,
|
||||
|
||||
/// <summary>
|
||||
/// ارسال کد تاییدیه قرارداد مالی
|
||||
/// </summary>
|
||||
SendInstitutionContractConfirmationCode,
|
||||
|
||||
/// <summary>
|
||||
/// یادآور وظایف
|
||||
/// </summary>
|
||||
TaskReminder,
|
||||
|
||||
}
|
||||
@@ -17,4 +17,18 @@ public class ApiResultViewModel
|
||||
public string DeliveryUnixTime { get; set; }
|
||||
public string DeliveryColor { get; set; }
|
||||
public string FullName { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class ApiReportDto
|
||||
{
|
||||
public int MessageId { get; set; }
|
||||
|
||||
public long Mobile { get; set; }
|
||||
|
||||
public string SendUnixTime { get; set; }
|
||||
public string DeliveryState { get; set; }
|
||||
public string DeliveryUnixTime { get; set; }
|
||||
public string DeliveryColor { get; set; }
|
||||
|
||||
}
|
||||
@@ -19,6 +19,13 @@ public interface ISmsService
|
||||
bool SendAccountsInfo(string number,string fullName, string userName);
|
||||
Task<ApiResultViewModel> GetByMessageId(int messId);
|
||||
Task<List<ApiResultViewModel>> GetApiResult(string startDate, string endDate);
|
||||
|
||||
#region ForApi
|
||||
|
||||
Task<List<ApiReportDto>> GetApiReport(string startDate, string endDate);
|
||||
|
||||
#endregion
|
||||
|
||||
string DeliveryStatus(byte? dv);
|
||||
string DeliveryColorStatus(byte? dv);
|
||||
string UnixTimeStampToDateTime(int? unixTimeStamp);
|
||||
|
||||
@@ -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,5 +1,6 @@
|
||||
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using _0_Framework.Application.Sms;
|
||||
using Company.Domain.ContarctingPartyAgg;
|
||||
using Company.Domain.InstitutionContractAgg;
|
||||
@@ -12,19 +13,21 @@ public class JobSchedulerRegistrator
|
||||
private readonly IBackgroundJobClient _backgroundJobClient;
|
||||
private readonly SmsReminder _smsReminder;
|
||||
private readonly IInstitutionContractRepository _institutionContractRepository;
|
||||
private readonly IInstitutionContractSmsServiceRepository _institutionContractSmsServiceRepository;
|
||||
private static DateTime? _lastRunCreateTransaction;
|
||||
private static DateTime? _lastRunSendMonthlySms;
|
||||
private readonly ISmsService _smsService;
|
||||
private readonly ILogger<JobSchedulerRegistrator> _logger;
|
||||
|
||||
|
||||
public JobSchedulerRegistrator(SmsReminder smsReminder, IBackgroundJobClient backgroundJobClient, IInstitutionContractRepository institutionContractRepository, ISmsService smsService, ILogger<JobSchedulerRegistrator> logger)
|
||||
public JobSchedulerRegistrator(SmsReminder smsReminder, IBackgroundJobClient backgroundJobClient, IInstitutionContractRepository institutionContractRepository, ISmsService smsService, ILogger<JobSchedulerRegistrator> logger, IInstitutionContractSmsServiceRepository institutionContractSmsServiceRepository)
|
||||
{
|
||||
_smsReminder = smsReminder;
|
||||
_backgroundJobClient = backgroundJobClient;
|
||||
_institutionContractRepository = institutionContractRepository;
|
||||
_smsService = smsService;
|
||||
_logger = logger;
|
||||
_institutionContractSmsServiceRepository = institutionContractSmsServiceRepository;
|
||||
}
|
||||
|
||||
public void Register()
|
||||
@@ -58,17 +61,43 @@ public class JobSchedulerRegistrator
|
||||
"*/1 * * * *" // هر 1 دقیقه یکبار چک کن
|
||||
);
|
||||
|
||||
//RecurringJob.AddOrUpdate(
|
||||
// "InstitutionContract.SendWarningSms",
|
||||
// () => SendWarningSms(),
|
||||
// "*/1 * * * *" // هر 1 دقیقه یکبار چک کن
|
||||
//);
|
||||
RecurringJob.AddOrUpdate(
|
||||
"InstitutionContract.SendWarningSms",
|
||||
() => SendWarningSms(),
|
||||
"*/1 * * * *" // هر 1 دقیقه یکبار چک کن
|
||||
);
|
||||
|
||||
//RecurringJob.AddOrUpdate(
|
||||
// "InstitutionContract.SendLegalActionSms",
|
||||
// () => SendLegalActionSms(),
|
||||
// "*/1 * * * *" // هر 1 دقیقه یکبار چک کن
|
||||
//);
|
||||
RecurringJob.AddOrUpdate(
|
||||
"InstitutionContract.SendLegalActionSms",
|
||||
() => SendLegalActionSms(),
|
||||
"*/1 * * * *" // هر 1 دقیقه یکبار چک کن
|
||||
);
|
||||
|
||||
|
||||
|
||||
RecurringJob.AddOrUpdate(
|
||||
"InstitutionContract.Block",
|
||||
() => Block(),
|
||||
"*/30 * * * *" // هر 30 دقیقه یکبار چک کن
|
||||
);
|
||||
|
||||
RecurringJob.AddOrUpdate(
|
||||
"InstitutionContract.UnBlock",
|
||||
() => UnBlock(),
|
||||
"*/10 * * * *"
|
||||
);
|
||||
|
||||
RecurringJob.AddOrUpdate(
|
||||
"InstitutionContract.DeActiveInstitutionEndOfContract",
|
||||
() => DeActiveInstitutionEndOfContract(),
|
||||
"*/30 * * * *"
|
||||
);
|
||||
|
||||
RecurringJob.AddOrUpdate(
|
||||
"InstitutionContract.BlueDeActiveAfterZeroDebt",
|
||||
() => BlueDeActiveAfterZeroDebt(),
|
||||
"*/10 * * * *"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -79,14 +108,14 @@ public class JobSchedulerRegistrator
|
||||
[DisableConcurrentExecution(timeoutInSeconds: 1200)]
|
||||
public async System.Threading.Tasks.Task CreateFinancialTransaction()
|
||||
{
|
||||
var now =DateTime.Now;
|
||||
var now = DateTime.Now;
|
||||
var endOfMonth = now.ToFarsi().FindeEndOfMonth();
|
||||
var endOfMonthGr = endOfMonth.ToGeorgianDateTime();
|
||||
_logger.LogInformation("CreateFinancialTransaction job run");
|
||||
if (now.Date == endOfMonthGr.Date && now.Hour >= 2 && now.Hour < 4 &&
|
||||
now.Date != _lastRunCreateTransaction?.Date)
|
||||
{
|
||||
|
||||
|
||||
var month = endOfMonth.Substring(5, 2);
|
||||
var year = endOfMonth.Substring(0, 4);
|
||||
var monthName = month.ToFarsiMonthByNumber();
|
||||
@@ -101,17 +130,17 @@ public class JobSchedulerRegistrator
|
||||
|
||||
try
|
||||
{
|
||||
await _institutionContractRepository.CreateTransactionForInstitutionContracts(endNewGr, endNewFa, description);
|
||||
await _institutionContractRepository.CreateTransactionForInstitutionContracts(endNewGr, endNewFa, description);
|
||||
_lastRunCreateTransaction = now;
|
||||
Console.WriteLine("CreateTransAction executed");
|
||||
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
await _smsService.Alarm("09114221321", "خطا-ایجاد سند مالی");
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +163,7 @@ public class JobSchedulerRegistrator
|
||||
|
||||
try
|
||||
{
|
||||
await _institutionContractRepository.SendMonthlySms(now);
|
||||
await _institutionContractSmsServiceRepository.SendMonthlySms(now);
|
||||
_lastRunSendMonthlySms = now;
|
||||
Console.WriteLine("Send Monthly sms executed");
|
||||
|
||||
@@ -156,7 +185,7 @@ public class JobSchedulerRegistrator
|
||||
public async System.Threading.Tasks.Task SendReminderSms()
|
||||
{
|
||||
_logger.LogInformation("SendReminderSms job run");
|
||||
await _institutionContractRepository.SendReminderSmsForBackgroundTask();
|
||||
await _institutionContractSmsServiceRepository.SendReminderSmsForBackgroundTask();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -167,7 +196,7 @@ public class JobSchedulerRegistrator
|
||||
public async System.Threading.Tasks.Task SendBlockSms()
|
||||
{
|
||||
_logger.LogInformation("SendBlockSms job run");
|
||||
await _institutionContractRepository.SendBlockSmsForBackgroundTask();
|
||||
await _institutionContractSmsServiceRepository.SendBlockSmsForBackgroundTask();
|
||||
}
|
||||
|
||||
|
||||
@@ -179,7 +208,7 @@ public class JobSchedulerRegistrator
|
||||
public async System.Threading.Tasks.Task SendInstitutionContractConfirmSms()
|
||||
{
|
||||
_logger.LogInformation("SendInstitutionContractConfirmSms job run");
|
||||
await _institutionContractRepository.SendInstitutionContractConfirmSmsTask();
|
||||
await _institutionContractSmsServiceRepository.SendInstitutionContractConfirmSmsTask();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -190,14 +219,86 @@ public class JobSchedulerRegistrator
|
||||
public async System.Threading.Tasks.Task SendWarningSms()
|
||||
{
|
||||
_logger.LogInformation("SendWarningSms job run");
|
||||
await _institutionContractRepository.SendWarningSmsTask();
|
||||
await _institutionContractSmsServiceRepository.SendWarningOrLegalActionSmsTask(TypeOfSmsSetting.Warning);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// پیامک اقدام قضایی
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[DisableConcurrentExecution(timeoutInSeconds: 100)]
|
||||
public async System.Threading.Tasks.Task SendLegalActionSms()
|
||||
{
|
||||
_logger.LogInformation("SendWarningSms job run");
|
||||
await _institutionContractRepository.SendLegalActionSmsTask();
|
||||
await _institutionContractSmsServiceRepository.SendWarningOrLegalActionSmsTask(TypeOfSmsSetting.LegalAction);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// بلاگ سازی
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[DisableConcurrentExecution(timeoutInSeconds: 100)]
|
||||
public async System.Threading.Tasks.Task Block()
|
||||
{
|
||||
_logger.LogInformation("block job run");
|
||||
var now = DateTime.Now;
|
||||
var executeDate = now.ToFarsi().Substring(8, 2);
|
||||
if (executeDate == "20")
|
||||
{
|
||||
if (now.Hour >= 9 && now.Hour < 10)
|
||||
{
|
||||
await _institutionContractSmsServiceRepository.Block(now);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// آنبلاک
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[DisableConcurrentExecution(timeoutInSeconds: 100)]
|
||||
public async System.Threading.Tasks.Task UnBlock()
|
||||
{
|
||||
_logger.LogInformation("UnBlock job run");
|
||||
|
||||
await _institutionContractSmsServiceRepository.UnBlock();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// غیر فعال سازی قراداد های پایان یافته
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[DisableConcurrentExecution(timeoutInSeconds: 100)]
|
||||
public async System.Threading.Tasks.Task DeActiveInstitutionEndOfContract()
|
||||
{
|
||||
_logger.LogInformation("DeActiveInstitutionEndOfContract job run");
|
||||
|
||||
|
||||
var now = DateTime.Now;
|
||||
var executeDate = now.ToFarsi().Substring(8, 2);
|
||||
if (executeDate == "01")
|
||||
{
|
||||
if (now.Hour >= 9 && now.Hour < 10)
|
||||
{
|
||||
await _institutionContractSmsServiceRepository.DeActiveInstitutionEndOfContract(now);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// غیرفعال سازس قرارداد های آبی که بدهی ندارند
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[DisableConcurrentExecution(timeoutInSeconds: 800)]
|
||||
public async System.Threading.Tasks.Task BlueDeActiveAfterZeroDebt()
|
||||
{
|
||||
_logger.LogInformation("BlueDeActiveAfterZeroDebt job run");
|
||||
await _institutionContractSmsServiceRepository.BlueDeActiveAfterZeroDebt();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -91,65 +91,7 @@ public interface IInstitutionContractRepository : IRepository<long, InstitutionC
|
||||
Task<List<InstitutionContractPrintViewModel>> PrintAllAsync(List<long> ids);
|
||||
|
||||
|
||||
#region ReminderSMS
|
||||
/// <summary>
|
||||
/// دریافت لیست - ارسال پیامک
|
||||
/// فراخوانی از سمت بک گراند سرویس
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<bool> SendReminderSmsForBackgroundTask();
|
||||
|
||||
/// <summary>
|
||||
/// ارسال پیامک صورت حساب ماهانه
|
||||
/// </summary>
|
||||
/// <param name="now"></param>
|
||||
/// <returns></returns>
|
||||
Task SendMonthlySms(DateTime now);
|
||||
|
||||
/// <summary>
|
||||
/// ارسال پیامک مسدودی از طرف بک گراند سرویس
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task SendBlockSmsForBackgroundTask();
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست واجد شرایط بلاک
|
||||
/// جهت ارسال پیامک مسدودی
|
||||
/// </summary>
|
||||
/// <param name="checkDate"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<BlockSmsListData>> GetBlockListData(DateTime checkDate);
|
||||
|
||||
/// <summary>
|
||||
/// ارسال پیامک مسدودی
|
||||
/// </summary>
|
||||
/// <param name="smsListData"></param>
|
||||
/// <param name="typeOfSms"></param>
|
||||
/// <param name="sendMessStart"></param>
|
||||
/// <param name="sendMessEnd"></param>
|
||||
/// <returns></returns>
|
||||
Task SendBlockSmsToContractingParties(List<BlockSmsListData> smsListData, string typeOfSms,
|
||||
string sendMessStart, string sendMessEnd);
|
||||
|
||||
/// <summary>
|
||||
///دریافت لیست بدهکارن
|
||||
/// جهت ارسال پیامک
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<SmsListData>> GetSmsListData(DateTime checkDate, TypeOfSmsSetting typeOfSmsSetting);
|
||||
|
||||
/// <summary>
|
||||
/// ارسال پیامک های یاد آور بدهی
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task SendReminderSmsToContractingParties(List<SmsListData> smsListData, string typeOfSms, string sendMessStart, string sendMessEnd);
|
||||
|
||||
/// <summary>
|
||||
/// ارسال پیامک یادآور تایید قراداد مالی
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task SendInstitutionContractConfirmSmsTask();
|
||||
#endregion
|
||||
|
||||
|
||||
#region CreateMontlyTransaction
|
||||
|
||||
@@ -162,24 +104,12 @@ public interface IInstitutionContractRepository : IRepository<long, InstitutionC
|
||||
|
||||
#endregion
|
||||
|
||||
#region WarningSms
|
||||
/// <summary>
|
||||
/// پیامک های هشدار
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task SendWarningSmsTask();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region legalAction
|
||||
/// <summary>
|
||||
/// پیامک اقدام قضائی
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task SendLegalActionSmsTask();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
Task<long> GetIdByInstallmentId(long installmentId);
|
||||
Task<InstitutionContract> GetPreviousContract(long currentInstitutionContractId);
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
using _0_Framework.Application.Enums;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Company.Domain.InstitutionContractAgg;
|
||||
|
||||
public interface IInstitutionContractSmsServiceRepository : IRepository<long, InstitutionContract>
|
||||
{
|
||||
#region reminderSMs
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ارسال پیامک یادآور تایید قراداد مالی
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task SendInstitutionContractConfirmSmsTask();
|
||||
#endregion
|
||||
|
||||
//هشدار و اقدام قضایی
|
||||
#region WarningOrLegalActionSmsListData
|
||||
/// <summary>
|
||||
/// اجرای تسک پیامک هشدار یا اقدام قضایی
|
||||
/// </summary>
|
||||
/// <param name="typeOfSmsSetting"></param>
|
||||
/// <returns></returns>
|
||||
Task SendWarningOrLegalActionSmsTask(TypeOfSmsSetting typeOfSmsSetting);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست بدهکاران آبی جهت هشدار یا اقدام قضایی
|
||||
/// </summary>
|
||||
/// <param name="typeOfSmsSetting"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<SmsListData>> GetWarningOrLegalActionSmsListData(TypeOfSmsSetting typeOfSmsSetting);
|
||||
|
||||
/// <summary>
|
||||
/// ارسال پیامک هشدار یا اقدام قضایی
|
||||
/// </summary>
|
||||
/// <param name="smsListData"></param>
|
||||
/// <param name="typeOfSmsSetting"></param>
|
||||
/// <returns></returns>
|
||||
Task SendWarningOrLegalActionSms(List<SmsListData> smsListData, TypeOfSmsSetting typeOfSmsSetting);
|
||||
|
||||
#endregion
|
||||
|
||||
//بلاک - آنبلاک - پیامک بلاک -
|
||||
// غیر فعال سازی قراداد های پایان یافته
|
||||
#region Block
|
||||
|
||||
/// <summary>
|
||||
/// ارسال پیامک مسدودی از طرف بک گراند سرویس
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task SendBlockSmsForBackgroundTask();
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست واجد شرایط بلاک
|
||||
/// جهت ارسال پیامک مسدودی
|
||||
/// </summary>
|
||||
/// <param name="checkDate"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<BlockSmsListData>> GetBlockListData(DateTime checkDate);
|
||||
|
||||
/// <summary>
|
||||
/// ارسال پیامک مسدودی
|
||||
/// </summary>
|
||||
/// <param name="smsListData"></param>
|
||||
/// <param name="typeOfSms"></param>
|
||||
/// <param name="sendMessStart"></param>
|
||||
/// <param name="sendMessEnd"></param>
|
||||
/// <returns></returns>
|
||||
Task SendBlockSmsToContractingParties(List<BlockSmsListData> smsListData, string typeOfSms,
|
||||
string sendMessStart, string sendMessEnd);
|
||||
|
||||
/// <summary>
|
||||
/// بلاک سازی
|
||||
/// </summary>
|
||||
/// <param name="checkDate"></param>
|
||||
/// <returns></returns>
|
||||
Task Block(DateTime checkDate);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست بدهکارانی که باید بلاک شوند
|
||||
/// </summary>
|
||||
/// <param name="checkDate"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<long>> GetToBeBlockList(DateTime checkDate);
|
||||
|
||||
/// <summary>
|
||||
/// آنبلاک
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task UnBlock();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// غیر فعالسازی قرارداد های پایان یافته
|
||||
/// </summary>
|
||||
/// <param name="checkDate"></param>
|
||||
/// <returns></returns>
|
||||
Task DeActiveInstitutionEndOfContract(DateTime checkDate);
|
||||
|
||||
/// <summary>
|
||||
/// غیرفعال سازس قرارداد های آبی که بدهی ندارند
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task BlueDeActiveAfterZeroDebt();
|
||||
#endregion
|
||||
|
||||
|
||||
#region ReminderSMS
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست - ارسال پیامک
|
||||
/// فراخوانی از سمت بک گراند سرویس
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<bool> SendReminderSmsForBackgroundTask();
|
||||
|
||||
/// <summary>
|
||||
/// ارسال پیامک صورت حساب ماهانه
|
||||
/// </summary>
|
||||
/// <param name="now"></param>
|
||||
/// <returns></returns>
|
||||
Task SendMonthlySms(DateTime now);
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
///دریافت لیست بدهکارن
|
||||
/// جهت ارسال پیامک
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<SmsListData>> GetSmsListData(DateTime checkDate, TypeOfSmsSetting typeOfSmsSetting);
|
||||
|
||||
/// <summary>
|
||||
/// ارسال پیامک های یاد آور بدهی
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task SendReminderSmsToContractingParties(List<SmsListData> smsListData, string typeOfSms, string sendMessStart, string sendMessEnd);
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -1,10 +1,30 @@
|
||||
using CompanyManagment.App.Contracts.SmsResult;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.SmsResult;
|
||||
using CompanyManagment.App.Contracts.SmsResult.Dto;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Domain;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Company.Domain.SmsResultAgg;
|
||||
|
||||
public interface ISmsResultRepository : IRepository<long, SmsResult>
|
||||
{
|
||||
#region ForApi
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست پیامکها
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<SmsReportDto>> GetSmsReportList(SmsReportSearchModel searchModel);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت اکسپند لیست هر تاریخ
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <param name="date"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<SmsReportListDto>> GetSmsReportExpandList(SmsReportSearchModel searchModel, string date);
|
||||
|
||||
#endregion
|
||||
List<SmsResultViewModel> Search(SmsResultSearchModel searchModel);
|
||||
}
|
||||
@@ -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; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
15
CompanyManagment.App.Contracts/SmsResult/Dto/SendStatus.cs
Normal file
15
CompanyManagment.App.Contracts/SmsResult/Dto/SendStatus.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace CompanyManagment.App.Contracts.SmsResult.Dto;
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت ارسال پیامک
|
||||
/// </summary>
|
||||
public enum SendStatus
|
||||
{
|
||||
All=0,
|
||||
/// <summary>
|
||||
/// موفق
|
||||
/// </summary>
|
||||
Success,
|
||||
//ناموفق
|
||||
Failed,
|
||||
}
|
||||
54
CompanyManagment.App.Contracts/SmsResult/Dto/SmsReportDto.cs
Normal file
54
CompanyManagment.App.Contracts/SmsResult/Dto/SmsReportDto.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.SmsResult.Dto;
|
||||
|
||||
public class SmsReportDto
|
||||
{
|
||||
/// <summary>
|
||||
/// تاریخ ارسال
|
||||
/// </summary>
|
||||
public string SentDate { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class SmsReportListDto
|
||||
{
|
||||
/// <summary>
|
||||
/// آی دی
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// آی دی پیامک در sms.ir
|
||||
/// </summary>
|
||||
public int MessageId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت ارسال
|
||||
/// </summary>
|
||||
public string Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع پیامک
|
||||
/// </summary>
|
||||
public string TypeOfSms { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام طرف حساب
|
||||
/// </summary>
|
||||
public string ContractingPartyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره موبایل
|
||||
/// </summary>
|
||||
public string Mobile { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ساعت و دقیقه
|
||||
/// </summary>
|
||||
public string HourAndMinute { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
using _0_Framework.Application.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.SmsResult.Dto;
|
||||
|
||||
public class SmsReportSearchModel
|
||||
{
|
||||
//نوع پیامک
|
||||
public TypeOfSmsSetting TypeOfSms { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت ارسال پیامک
|
||||
/// </summary>
|
||||
public SendStatus SendStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره موبایل
|
||||
/// </summary>
|
||||
public string Mobile { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آی دی طرف حساب
|
||||
/// </summary>
|
||||
public long ContractingPatyId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// سال
|
||||
/// </summary>
|
||||
public string Year { get; set; }
|
||||
/// <summary>
|
||||
/// ماه
|
||||
/// </summary>
|
||||
public string Month { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع
|
||||
/// </summary>
|
||||
public string StartDateFa { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ پایان
|
||||
/// </summary>
|
||||
public string EndDateFa { get; set; }
|
||||
}
|
||||
@@ -1,14 +1,34 @@
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.SmsResult.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.SmsResult;
|
||||
|
||||
public interface ISmsResultApplication
|
||||
{
|
||||
#region ForApi
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست پیامکها
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<SmsReportDto>> GetSmsReportList(SmsReportSearchModel searchModel);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت اکسپند لیست هر تاریخ
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <param name="date"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<SmsReportListDto>> GetSmsReportExpandList(SmsReportSearchModel searchModel, string date);
|
||||
|
||||
#endregion
|
||||
|
||||
OperationResult Create(CreateSmsResult command);
|
||||
List<SmsResultViewModel> Search(SmsResultSearchModel searchModel);
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -1524,7 +1524,8 @@ public class InsuranceListApplication : IInsuranceListApplication
|
||||
var dateOfBirth = employeeData.DateOfBirthGr.ToFarsi();
|
||||
var dateOfIssue = employeeData.DateOfIssueGr.ToFarsi();
|
||||
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 startWorkFa = employeeData.StartWorkDateGr.ToFarsi();
|
||||
var workshop = _workShopRepository.GetDetails(workshopId);
|
||||
@@ -1606,7 +1607,7 @@ public class InsuranceListApplication : IInsuranceListApplication
|
||||
MaritalStatus = employeeData.MaritalStatus,
|
||||
|
||||
StartMonthCurrent = startMonthFa,
|
||||
WorkingDays = workingDays.countWorkingDays,
|
||||
WorkingDays = employeeData.WorkingDays,
|
||||
StartWorkDate = startWorkFa,
|
||||
StartWorkDateGr = employeeData.StartWorkDateGr,
|
||||
LeftWorkDate = leftWorkFa,
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.SmsResultAgg;
|
||||
using CompanyManagment.App.Contracts.SmsResult;
|
||||
using CompanyManagment.App.Contracts.SmsResult.Dto;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
@@ -15,6 +17,23 @@ public class SmsResultApplication : ISmsResultApplication
|
||||
_smsResultRepository = smsResultRepository;
|
||||
}
|
||||
|
||||
|
||||
#region ForApi
|
||||
|
||||
public async Task<List<SmsReportDto>> GetSmsReportList(SmsReportSearchModel searchModel)
|
||||
{
|
||||
return await _smsResultRepository.GetSmsReportList(searchModel);
|
||||
}
|
||||
|
||||
public async Task<List<SmsReportListDto>> GetSmsReportExpandList(SmsReportSearchModel searchModel, string date)
|
||||
{
|
||||
return await _smsResultRepository.GetSmsReportExpandList(searchModel, date);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
public OperationResult Create(CreateSmsResult command)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using Company.Domain.InstitutionContractAgg;
|
||||
using Company.Domain.SmsResultAgg;
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
using CompanyManagment.App.Contracts.SmsResult;
|
||||
using CompanyManagment.EFCore.Repository;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
@@ -15,11 +16,13 @@ public class SmsSettingApplication : ISmsSettingApplication
|
||||
{
|
||||
private readonly ISmsSettingsRepository _smsSettingsRepository;
|
||||
private readonly IInstitutionContractRepository _institutionContractRepository;
|
||||
private readonly IInstitutionContractSmsServiceRepository _institutionContractSmsServiceRepository;
|
||||
|
||||
public SmsSettingApplication(ISmsSettingsRepository smsSettingsRepository, IInstitutionContractRepository institutionContractRepository)
|
||||
public SmsSettingApplication(ISmsSettingsRepository smsSettingsRepository, IInstitutionContractRepository institutionContractRepository, IInstitutionContractSmsServiceRepository institutionContractSmsServiceRepository)
|
||||
{
|
||||
_smsSettingsRepository = smsSettingsRepository;
|
||||
_institutionContractRepository = institutionContractRepository;
|
||||
_institutionContractSmsServiceRepository = institutionContractSmsServiceRepository;
|
||||
}
|
||||
|
||||
|
||||
@@ -116,12 +119,12 @@ public class SmsSettingApplication : ISmsSettingApplication
|
||||
|
||||
public async Task<List<SmsListData>> GetSmsListData(TypeOfSmsSetting typeOfSmsSetting)
|
||||
{
|
||||
return await _institutionContractRepository.GetSmsListData(DateTime.Now, typeOfSmsSetting);
|
||||
return await _institutionContractSmsServiceRepository.GetSmsListData(DateTime.Now, typeOfSmsSetting);
|
||||
}
|
||||
|
||||
public async Task<List<BlockSmsListData>> GetBlockSmsListData(TypeOfSmsSetting typeOfSmsSetting)
|
||||
{
|
||||
return await _institutionContractRepository.GetBlockListData(DateTime.Now);
|
||||
return await _institutionContractSmsServiceRepository.GetBlockListData(DateTime.Now);
|
||||
}
|
||||
|
||||
|
||||
@@ -134,7 +137,7 @@ public class SmsSettingApplication : ISmsSettingApplication
|
||||
|
||||
if (command.Any())
|
||||
{
|
||||
await _institutionContractRepository.SendReminderSmsToContractingParties(command, typeOfSms, sendMessStart, sendMessEnd);
|
||||
await _institutionContractSmsServiceRepository.SendReminderSmsToContractingParties(command, typeOfSms, sendMessStart, sendMessEnd);
|
||||
return op.Succcedded();
|
||||
}
|
||||
else
|
||||
@@ -153,7 +156,7 @@ public class SmsSettingApplication : ISmsSettingApplication
|
||||
string sendMessEnd = "پایان مسدودی آنی ";
|
||||
if (command.Any())
|
||||
{
|
||||
await _institutionContractRepository.SendBlockSmsToContractingParties(command, typeOfSms, sendMessStart,
|
||||
await _institutionContractSmsServiceRepository.SendBlockSmsToContractingParties(command, typeOfSms, sendMessStart,
|
||||
sendMessEnd);
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
@@ -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
File diff suppressed because it is too large
Load Diff
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));
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.SmsResultAgg;
|
||||
using CompanyManagment.App.Contracts.SmsResult;
|
||||
using CompanyManagment.App.Contracts.SmsResult.Dto;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application.Enums;
|
||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class SmsResultRepository : RepositoryBase<long, SmsResult> , ISmsResultRepository
|
||||
public class SmsResultRepository : RepositoryBase<long, SmsResult>, ISmsResultRepository
|
||||
{
|
||||
private readonly CompanyContext _context;
|
||||
public SmsResultRepository(CompanyContext context) : base(context)
|
||||
@@ -15,9 +22,263 @@ public class SmsResultRepository : RepositoryBase<long, SmsResult> , ISmsResultR
|
||||
_context = context;
|
||||
}
|
||||
|
||||
#region ForApi
|
||||
|
||||
|
||||
|
||||
public async Task<List<SmsReportDto>> GetSmsReportList(SmsReportSearchModel searchModel)
|
||||
{
|
||||
|
||||
// مرحله 1: همه رکوردها را با projection ساده بگیرید
|
||||
var rawQuery = await _context.SmsResults
|
||||
.Select(x => new
|
||||
{
|
||||
x.id,
|
||||
x.ContractingPatyId,
|
||||
x.Mobile,
|
||||
x.Status,
|
||||
x.TypeOfSms,
|
||||
x.CreationDate,
|
||||
DateOnly = x.CreationDate.Date // فقط تاریخ بدون ساعت
|
||||
})
|
||||
.AsNoTracking()
|
||||
.ToListAsync(); // اینجا SQL اجرا میشود و همه دادهها به client میآیند
|
||||
|
||||
if (searchModel.ContractingPatyId > 0)
|
||||
{
|
||||
rawQuery = rawQuery.Where(x => x.ContractingPatyId == searchModel.ContractingPatyId).ToList();
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.Mobile))
|
||||
{
|
||||
rawQuery = rawQuery.Where(x => x.Mobile.Contains(searchModel.Mobile)).ToList();
|
||||
}
|
||||
|
||||
if (searchModel.TypeOfSms != TypeOfSmsSetting.All && searchModel.TypeOfSms != TypeOfSmsSetting.Warning)
|
||||
{
|
||||
var typeOfSms = "All";
|
||||
switch (searchModel.TypeOfSms)
|
||||
{
|
||||
case TypeOfSmsSetting.InstitutionContractDebtReminder:
|
||||
typeOfSms = "یادآور بدهی ماهانه";
|
||||
break;
|
||||
case TypeOfSmsSetting.MonthlyInstitutionContract:
|
||||
typeOfSms = "صورت حساب ماهانه";
|
||||
break;
|
||||
case TypeOfSmsSetting.BlockContractingParty:
|
||||
typeOfSms = "اعلام مسدودی طرف حساب";
|
||||
break;
|
||||
case TypeOfSmsSetting.LegalAction:
|
||||
typeOfSms = "اقدام قضایی";
|
||||
break;
|
||||
case TypeOfSmsSetting.InstitutionContractConfirm:
|
||||
typeOfSms = "یادآور تایید قرارداد مالی";
|
||||
break;
|
||||
case TypeOfSmsSetting.SendInstitutionContractConfirmationCode:
|
||||
typeOfSms = "کد تاییدیه قرارداد مالی";
|
||||
break;
|
||||
case TypeOfSmsSetting.TaskReminder:
|
||||
typeOfSms = "یادآور وظایف";
|
||||
break;
|
||||
}
|
||||
|
||||
rawQuery = rawQuery.Where(x => x.TypeOfSms == typeOfSms).ToList();
|
||||
}
|
||||
|
||||
if (searchModel.TypeOfSms == TypeOfSmsSetting.Warning)
|
||||
{
|
||||
rawQuery = rawQuery.Where(x => x.TypeOfSms.Contains("هشدار")).ToList();
|
||||
}
|
||||
|
||||
if (searchModel.SendStatus != SendStatus.All)
|
||||
{
|
||||
var status = "All";
|
||||
|
||||
switch (searchModel.SendStatus)
|
||||
{
|
||||
case SendStatus.Success: status = "موفق";
|
||||
break;
|
||||
case SendStatus.Failed: status = "ناموفق";
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
rawQuery = rawQuery.Where(x => x.Status == status).ToList();
|
||||
|
||||
}
|
||||
#region searchByDate
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.StartDateFa) &&
|
||||
!string.IsNullOrWhiteSpace(searchModel.EndDateFa))
|
||||
{
|
||||
if (searchModel.StartDateFa.TryToGeorgianDateTime(out var startGr) == false ||
|
||||
searchModel.EndDateFa.TryToGeorgianDateTime(out var endGr) == false)
|
||||
return new List<SmsReportDto>();
|
||||
|
||||
rawQuery = rawQuery.Where(x => x.CreationDate.Date >= startGr.Date && x.CreationDate.Date <= endGr.Date).ToList();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.Year) && !string.IsNullOrWhiteSpace(searchModel.Month))
|
||||
{
|
||||
var start = searchModel.Year + "/" + searchModel.Month + "/01";
|
||||
var end = start.FindeEndOfMonth();
|
||||
var startGr = start.ToGeorgianDateTime();
|
||||
var endGr = end.ToGeorgianDateTime();
|
||||
rawQuery = rawQuery.Where(x => x.CreationDate.Date >= startGr.Date && x.CreationDate.Date <= endGr.Date).ToList();
|
||||
|
||||
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(searchModel.Year) && string.IsNullOrWhiteSpace(searchModel.Month))
|
||||
{
|
||||
var start = searchModel.Year + "/01/01";
|
||||
var findEndOfYear = searchModel.Year + "/12/01";
|
||||
var end = findEndOfYear.FindeEndOfMonth();
|
||||
var startGr = start.ToGeorgianDateTime();
|
||||
var endGr = end.ToGeorgianDateTime();
|
||||
rawQuery = rawQuery.Where(x => x.CreationDate.Date >= startGr.Date && x.CreationDate.Date <= endGr.Date).ToList();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// مرحله 2: گروهبندی و انتخاب آخرین رکورد هر روز روی Client
|
||||
var grouped = rawQuery
|
||||
.GroupBy(x => x.DateOnly)
|
||||
.Select(g => g.OrderByDescending(x => x.CreationDate).First())
|
||||
.OrderByDescending(x => x.CreationDate)
|
||||
.ToList();
|
||||
|
||||
// مرحله 3: تبدیل به DTO و ToFarsi
|
||||
var result = grouped.Select(x => new SmsReportDto
|
||||
{
|
||||
SentDate = x.CreationDate.ToFarsi()
|
||||
}).ToList();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public async Task<List<SmsReportListDto>> GetSmsReportExpandList(SmsReportSearchModel searchModel, string date)
|
||||
{
|
||||
if(string.IsNullOrWhiteSpace(date))
|
||||
return new List<SmsReportListDto>();
|
||||
|
||||
if (date.TryToGeorgianDateTime(out var searchDate) == false)
|
||||
return new List<SmsReportListDto>();
|
||||
|
||||
var query = await _context.SmsResults.Where(x => x.CreationDate.Date == searchDate.Date)
|
||||
.Select(x =>
|
||||
new
|
||||
{
|
||||
x.id,
|
||||
x.MessageId,
|
||||
x.Status,
|
||||
x.TypeOfSms,
|
||||
x.ContractingPartyName,
|
||||
x.Mobile,
|
||||
x.ContractingPatyId,
|
||||
x.InstitutionContractId,
|
||||
x.CreationDate,
|
||||
x.CreationDate.Hour,
|
||||
x.CreationDate.Minute
|
||||
|
||||
}).AsNoTracking()
|
||||
.ToListAsync(); ;
|
||||
|
||||
if (searchModel.ContractingPatyId > 0)
|
||||
{
|
||||
query = query.Where(x => x.ContractingPatyId == searchModel.ContractingPatyId).ToList();
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.Mobile))
|
||||
{
|
||||
query = query.Where(x => x.Mobile.Contains(searchModel.Mobile)).ToList();
|
||||
}
|
||||
|
||||
if (searchModel.TypeOfSms != TypeOfSmsSetting.All && searchModel.TypeOfSms != TypeOfSmsSetting.Warning)
|
||||
{
|
||||
var typeOfSms = "All";
|
||||
switch (searchModel.TypeOfSms)
|
||||
{
|
||||
case TypeOfSmsSetting.InstitutionContractDebtReminder:
|
||||
typeOfSms = "یادآور بدهی ماهانه";
|
||||
break;
|
||||
case TypeOfSmsSetting.MonthlyInstitutionContract:
|
||||
typeOfSms = "صورت حساب ماهانه";
|
||||
break;
|
||||
case TypeOfSmsSetting.BlockContractingParty:
|
||||
typeOfSms = "اعلام مسدودی طرف حساب";
|
||||
break;
|
||||
case TypeOfSmsSetting.LegalAction:
|
||||
typeOfSms = "اقدام قضایی";
|
||||
break;
|
||||
case TypeOfSmsSetting.InstitutionContractConfirm:
|
||||
typeOfSms = "یادآور تایید قرارداد مالی";
|
||||
break;
|
||||
case TypeOfSmsSetting.SendInstitutionContractConfirmationCode:
|
||||
typeOfSms = "کد تاییدیه قرارداد مالی";
|
||||
break;
|
||||
case TypeOfSmsSetting.TaskReminder:
|
||||
typeOfSms = "یادآور وظایف";
|
||||
break;
|
||||
}
|
||||
|
||||
query = query.Where(x => x.TypeOfSms == typeOfSms).ToList();
|
||||
}
|
||||
|
||||
if (searchModel.TypeOfSms == TypeOfSmsSetting.Warning)
|
||||
{
|
||||
query = query.Where(x => x.TypeOfSms.Contains("هشدار")).ToList();
|
||||
}
|
||||
|
||||
if (searchModel.SendStatus != SendStatus.All)
|
||||
{
|
||||
var status = "All";
|
||||
|
||||
switch (searchModel.SendStatus)
|
||||
{
|
||||
case SendStatus.Success:
|
||||
status = "موفق";
|
||||
break;
|
||||
case SendStatus.Failed:
|
||||
status = "ناموفق";
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
query = query.Where(x => x.Status == status).ToList();
|
||||
|
||||
}
|
||||
|
||||
if (query.Count == 0)
|
||||
return new List<SmsReportListDto>();
|
||||
|
||||
var result = query.OrderByDescending(x => x.CreationDate.Hour)
|
||||
.ThenByDescending(x => x.CreationDate.Minute).Select(x =>
|
||||
new SmsReportListDto()
|
||||
{
|
||||
Id = x.id,
|
||||
MessageId = x.MessageId,
|
||||
Status = x.Status,
|
||||
TypeOfSms = x.TypeOfSms,
|
||||
ContractingPartyName = x.ContractingPartyName,
|
||||
Mobile = x.Mobile,
|
||||
HourAndMinute = x.CreationDate.TimeOfDay.ToString(@"hh\:mm"),
|
||||
}).ToList();
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public List<App.Contracts.SmsResult.SmsResultViewModel> Search(SmsResultSearchModel searchModel)
|
||||
{
|
||||
|
||||
|
||||
var query = _context.SmsResults.Select(x => new App.Contracts.SmsResult.SmsResultViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
@@ -64,7 +325,7 @@ public class SmsResultRepository : RepositoryBase<long, SmsResult> , ISmsResultR
|
||||
var endGr = end.ToGeorgianDateTime();
|
||||
query = query.Where(x => x.CreationDate.Date >= startGr.Date && x.CreationDate.Date <= endGr.Date);
|
||||
|
||||
|
||||
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(searchModel.Year) && string.IsNullOrWhiteSpace(searchModel.Month))
|
||||
{
|
||||
@@ -74,7 +335,7 @@ public class SmsResultRepository : RepositoryBase<long, SmsResult> , ISmsResultR
|
||||
var startGr = start.ToGeorgianDateTime();
|
||||
var endGr = end.ToGeorgianDateTime();
|
||||
query = query.Where(x => x.CreationDate.Date >= startGr.Date && x.CreationDate.Date <= endGr.Date);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,12 +343,12 @@ public class SmsResultRepository : RepositoryBase<long, SmsResult> , ISmsResultR
|
||||
|
||||
|
||||
query = query.OrderByDescending(x => x.CreationDate)
|
||||
.ThenByDescending(x=>x.CreationDate.Hour).ThenByDescending(x=>x.CreationDate.Minute);
|
||||
|
||||
.ThenByDescending(x => x.CreationDate.Hour).ThenByDescending(x => x.CreationDate.Minute);
|
||||
|
||||
return query.Skip(searchModel.PageIndex).Take(30).ToList();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -207,16 +207,11 @@ public class SmsService : ISmsService
|
||||
}
|
||||
public async Task<List<ApiResultViewModel>> GetApiResult(string startDate, string endDate)
|
||||
{
|
||||
var st = new DateTime(2024, 6, 2);
|
||||
var ed = new DateTime(2024, 7, 1);
|
||||
if (!string.IsNullOrWhiteSpace(startDate) && startDate.Length == 10)
|
||||
{
|
||||
st = startDate.ToGeorgianDateTime();
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(endDate) && endDate.Length == 10)
|
||||
{
|
||||
ed = endDate.ToGeorgianDateTime();
|
||||
}
|
||||
|
||||
|
||||
if(startDate.TryToGeorgianDateTime(out var st) == false || endDate.TryToGeorgianDateTime(out var ed) == false)
|
||||
return new List<ApiResultViewModel>();
|
||||
|
||||
var res = new List<ApiResultViewModel>();
|
||||
Int32 unixTimestamp = (int)st.Subtract(new DateTime(1970, 1, 1)).TotalSeconds;
|
||||
Int32 unixTimestamp2 = (int)ed.Subtract(new DateTime(1970, 1, 1)).TotalSeconds;
|
||||
@@ -248,6 +243,44 @@ public class SmsService : ISmsService
|
||||
return res;
|
||||
}
|
||||
|
||||
public async Task<List<ApiReportDto>> GetApiReport(string startDate, string endDate)
|
||||
{
|
||||
|
||||
|
||||
if (startDate.TryToGeorgianDateTime(out var st) == false || endDate.TryToGeorgianDateTime(out var ed) == false)
|
||||
return new List<ApiReportDto>();
|
||||
|
||||
var res = new List<ApiReportDto>();
|
||||
Int32 unixTimestamp = (int)st.Subtract(new DateTime(1970, 1, 1)).TotalSeconds;
|
||||
Int32 unixTimestamp2 = (int)ed.Subtract(new DateTime(1970, 1, 1)).TotalSeconds;
|
||||
// int? fromDateUnixTime = null; // unix time - for instance: 1700598600
|
||||
//int? toDateUnixTime = null; // unix time - for instance: 1703190600
|
||||
int pageNumber = 2;
|
||||
int pageSize = 100; // max: 100
|
||||
SmsIr smsIr = new SmsIr("Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa");
|
||||
var response = await smsIr.GetArchivedReportAsync(pageNumber, pageSize, unixTimestamp, unixTimestamp2);
|
||||
|
||||
MessageReportResult[] messages = response.Data;
|
||||
foreach (var message in messages)
|
||||
{
|
||||
var appendData = new ApiReportDto()
|
||||
{
|
||||
MessageId = message.MessageId,
|
||||
|
||||
Mobile = message.Mobile,
|
||||
|
||||
SendUnixTime = UnixTimeStampToDateTime(message.SendDateTime),
|
||||
DeliveryState = DeliveryStatus(message.DeliveryState),
|
||||
DeliveryUnixTime = UnixTimeStampToDateTime(message.DeliveryDateTime),
|
||||
DeliveryColor = DeliveryColorStatus(message.DeliveryState),
|
||||
};
|
||||
res.Add(appendData);
|
||||
}
|
||||
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
public string DeliveryStatus(byte? dv)
|
||||
{
|
||||
string mess = "";
|
||||
|
||||
@@ -563,6 +563,7 @@ public class PersonalBootstrapper
|
||||
services.AddTransient<ISmsSettingsRepository, SmsSettingsRepository>();
|
||||
services.AddTransient<ISmsSettingApplication, SmsSettingApplication>();
|
||||
|
||||
services.AddTransient<IInstitutionContractSmsServiceRepository, InstitutionContractSmsServiceRepository>();
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
@@ -209,22 +209,38 @@ public class CreateOrEditCheckoutCommandHandler : IBaseCommandHandler<CreateOrEd
|
||||
}
|
||||
|
||||
}
|
||||
//حقوق نهایی
|
||||
var monthlySalaryPay = (totalHoursWorked * monthlySalaryDefined) / mandatoryHours;
|
||||
// اگر اضافه کار داشت حقوق تعین شده به عنوان حقوق نهایی در نظر گرفته میشود
|
||||
monthlySalaryPay = monthlySalaryPay > monthlySalaryDefined ? monthlySalaryDefined : monthlySalaryPay;
|
||||
////حقوق نهایی
|
||||
//var monthlySalaryPay = (totalHoursWorked * monthlySalaryDefined) / mandatoryHours;
|
||||
//// اگر اضافه کار داشت حقوق تعین شده به عنوان حقوق نهایی در نظر گرفته میشود
|
||||
//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;
|
||||
|
||||
|
||||
//تناسب به دقیقه
|
||||
#region MyRegion
|
||||
|
||||
//var monthlySalaryDefinedTest = monthlySalaryDefined * mandatoryHours;
|
||||
//var monthlySalaryPayTest = totalHoursWorked * monthlySalaryDefined;
|
||||
////// اگر اضافه کار داشت حقوق تعین شده به عنوان حقوق نهایی در نظر گرفته میشود
|
||||
//monthlySalaryPayTest = monthlySalaryPayTest > monthlySalaryDefinedTest ? monthlySalaryDefinedTest : monthlySalaryPayTest;
|
||||
//////حقوق کسر شده
|
||||
//var deductionFromSalaryTest = monthlySalaryDefinedTest - monthlySalaryPayTest;
|
||||
|
||||
#endregion
|
||||
|
||||
var computeResult = new ComputeResultDto
|
||||
{
|
||||
MandatoryHours = mandatoryHours,
|
||||
MonthlySalaryPay = monthlySalaryPay,
|
||||
DeductionFromSalary = deductionFromSalary,
|
||||
DeductionFromSalary = 0 /*deductionFromSalary*/,
|
||||
RemainingHours = remainingTime
|
||||
};
|
||||
Console.WriteLine(mandatoryHours);
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using GozareshgirProgramManager.Application._Common.Interfaces;
|
||||
using DNTPersianUtils.Core;
|
||||
using GozareshgirProgramManager.Application._Common.Interfaces;
|
||||
using GozareshgirProgramManager.Application._Common.Models;
|
||||
using GozareshgirProgramManager.Application.Modules.SalaryPaymentSettings.Queries.GetUserListWhoHaveSettings;
|
||||
using GozareshgirProgramManager.Domain._Common;
|
||||
using GozareshgirProgramManager.Domain.CheckoutAgg.Enums;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PersianTools.Core;
|
||||
using PersianDateTime = PersianTools.Core.PersianDateTime;
|
||||
|
||||
namespace GozareshgirProgramManager.Application.Modules.Checkouts.Queries.GetUserToGropCreate;
|
||||
|
||||
@@ -45,8 +46,8 @@ public class GetUserToGroupCreatingQueryHandler : IBaseQueryHandler<GetUserToGro
|
||||
"ایجاد فیش فقط برای ماه های گذشته امکان پذیر است");
|
||||
|
||||
|
||||
var lastMonthStart = lastMonth;
|
||||
var lastMonthEnd = lastMonth;
|
||||
//var lastMonthStart = lastMonth;
|
||||
var lastMonthEnd = ((selectedDate.ToFarsi().FindeEndOfMonth())).ToGeorgianDateTime();
|
||||
|
||||
var query =
|
||||
await (from u in _context.Users
|
||||
@@ -60,8 +61,8 @@ public class GetUserToGroupCreatingQueryHandler : IBaseQueryHandler<GetUserToGro
|
||||
// LEFT JOIN
|
||||
//فیش
|
||||
join ch in _context.Checkouts
|
||||
.Where(x => x.CheckoutStartDate < lastMonthStart
|
||||
&& x.CheckoutEndDate >= lastMonthStart)
|
||||
.Where(x => x.CheckoutStartDate < lastMonthEnd
|
||||
&& x.CheckoutEndDate > selectedDate)
|
||||
on u.Id equals ch.UserId into chJoin
|
||||
from ch in chJoin.DefaultIfEmpty()
|
||||
|
||||
|
||||
@@ -7,5 +7,6 @@ namespace GozareshgirProgramManager.Application.Modules.Projects.Queries.Project
|
||||
public record ProjectBoardListQuery: IBaseQuery<List<ProjectBoardListResponse>>
|
||||
{
|
||||
public long? UserId { get; set; }
|
||||
public string? SearchText { get; set; }
|
||||
public TaskSectionStatus? Status { get; set; }
|
||||
}
|
||||
@@ -3,7 +3,6 @@ using GozareshgirProgramManager.Application._Common.Interfaces;
|
||||
using GozareshgirProgramManager.Application._Common.Models;
|
||||
using GozareshgirProgramManager.Domain.ProjectAgg.Enums;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Query.Internal;
|
||||
|
||||
namespace GozareshgirProgramManager.Application.Modules.Projects.Queries.ProjectBoardList;
|
||||
|
||||
@@ -24,7 +23,8 @@ public class ProjectBoardListQueryHandler : IBaseQueryHandler<ProjectBoardListQu
|
||||
var currentUserId = _authHelper.GetCurrentUserId();
|
||||
|
||||
var queryable = _programManagerDbContext.TaskSections.AsNoTracking()
|
||||
.Where(x => x.InitialEstimatedHours > TimeSpan.Zero && x.Status != TaskSectionStatus.Completed)
|
||||
.Where(x => x.InitialEstimatedHours > TimeSpan.Zero
|
||||
&& x.Status != TaskSectionStatus.Completed)
|
||||
.Include(x => x.Task)
|
||||
.ThenInclude(x => x.Phase)
|
||||
.ThenInclude(x => x.Project)
|
||||
@@ -45,10 +45,18 @@ public class ProjectBoardListQueryHandler : IBaseQueryHandler<ProjectBoardListQu
|
||||
{
|
||||
queryable = queryable.Where(x => x.CurrentAssignedUserId == request.UserId);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(request.SearchText))
|
||||
{
|
||||
queryable = queryable.Where(x=>x.Task.Name.Contains(request.SearchText)
|
||||
|| x.Task.Phase.Name.Contains(request.SearchText)
|
||||
|| x.Task.Phase.Project.Name.Contains(request.SearchText));
|
||||
}
|
||||
|
||||
var data = await queryable.ToListAsync(cancellationToken);
|
||||
|
||||
var activityUserIds = data.SelectMany(x => x.Activities).Select(a => a.UserId).Distinct().ToList();
|
||||
var activityUserIds = data.SelectMany(x => x.Activities)
|
||||
.Select(a => a.UserId).Distinct().ToList();
|
||||
var assignedUser = data.Select(x => x.CurrentAssignedUserId)
|
||||
.Concat(data.Select(x => x.OriginalAssignedUserId)).ToList();
|
||||
var allUserIds = activityUserIds.Concat(assignedUser).Distinct().ToList();
|
||||
@@ -72,7 +80,7 @@ public class ProjectBoardListQueryHandler : IBaseQueryHandler<ProjectBoardListQu
|
||||
{
|
||||
Activity = a,
|
||||
TimeSpent = timeSpent,
|
||||
TotalSeconds = timeSpent.TotalSeconds,
|
||||
timeSpent.TotalSeconds,
|
||||
FormattedTime = timeSpent.ToString(@"hh\:mm")
|
||||
};
|
||||
}).ToList();
|
||||
|
||||
@@ -56,6 +56,7 @@ public class ProjectSetTimeDetailsQueryHandler
|
||||
|
||||
var skills = await _context.Skills
|
||||
.AsNoTracking()
|
||||
.OrderBy(x=>x.CreationDate)
|
||||
.ToListAsync(cancellationToken);
|
||||
|
||||
var res = new ProjectSetTimeResponse(
|
||||
@@ -84,7 +85,7 @@ public class ProjectSetTimeDetailsQueryHandler
|
||||
UserId = section?.OriginalAssignedUserId ?? 0,
|
||||
SkillId = skill.Id,
|
||||
};
|
||||
}).OrderBy(x => x.SkillId).ToList(),
|
||||
}).ToList(),
|
||||
task.Id,
|
||||
level);
|
||||
|
||||
@@ -114,6 +115,7 @@ public class ProjectSetTimeDetailsQueryHandler
|
||||
|
||||
var skills = await _context.Skills
|
||||
.AsNoTracking()
|
||||
.OrderBy(x=>x.CreationDate)
|
||||
.ToListAsync(cancellationToken);
|
||||
|
||||
var res = new ProjectSetTimeResponse(
|
||||
@@ -135,7 +137,7 @@ public class ProjectSetTimeDetailsQueryHandler
|
||||
UserId = section?.UserId ?? 0,
|
||||
SkillId = skill.Id,
|
||||
};
|
||||
}).OrderBy(x => x.SkillId).ToList(),
|
||||
}).ToList(),
|
||||
phase.Id,
|
||||
level);
|
||||
|
||||
@@ -165,6 +167,7 @@ public class ProjectSetTimeDetailsQueryHandler
|
||||
|
||||
var skills = await _context.Skills
|
||||
.AsNoTracking()
|
||||
.OrderBy(x=>x.CreationDate)
|
||||
.ToListAsync(cancellationToken);
|
||||
|
||||
var res = new ProjectSetTimeResponse(
|
||||
@@ -186,7 +189,7 @@ public class ProjectSetTimeDetailsQueryHandler
|
||||
UserId = section?.UserId ?? 0,
|
||||
SkillId = skill.Id,
|
||||
};
|
||||
}).OrderBy(x => x.SkillId).ToList(),
|
||||
}).ToList(),
|
||||
project.Id,
|
||||
level);
|
||||
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
using GozareshgirProgramManager.Application._Common.Interfaces;
|
||||
using GozareshgirProgramManager.Application._Common.Models;
|
||||
using GozareshgirProgramManager.Application.Modules.TaskChat.DTOs;
|
||||
using GozareshgirProgramManager.Domain.TaskChatAgg.Enums;
|
||||
using MediatR;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace GozareshgirProgramManager.Application.Modules.TaskChat.Queries.GetMessages;
|
||||
|
||||
public record GetMessagesQuery(
|
||||
Guid TaskId,
|
||||
MessageType? MessageType,
|
||||
int Page = 1,
|
||||
int PageSize = 50
|
||||
) : IBaseQuery<PaginationResult<MessageDto>>;
|
||||
@@ -66,7 +69,12 @@ public class GetMessagesQueryHandler : IBaseQueryHandler<GetMessagesQuery, Pagin
|
||||
var query = _context.TaskChatMessages
|
||||
.Where(m => m.TaskId == request.TaskId && !m.IsDeleted)
|
||||
.Include(m => m.ReplyToMessage)
|
||||
.OrderBy(m => m.CreationDate);
|
||||
.OrderBy(m => m.CreationDate).AsQueryable();
|
||||
|
||||
if (request.MessageType.HasValue)
|
||||
{
|
||||
query = query.Where(m => m.MessageType == request.MessageType.Value);
|
||||
}
|
||||
|
||||
var totalCount = await query.CountAsync(cancellationToken);
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ public class ProjectTask : ProjectHierarchyNode
|
||||
{
|
||||
PhaseId = phaseId;
|
||||
_sections = new List<TaskSection>();
|
||||
Priority = ProjectTaskPriority.Medium;
|
||||
Priority = ProjectTaskPriority.Low;
|
||||
AddDomainEvent(new TaskCreatedEvent(Id, phaseId, name));
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ using GozareshgirProgramManager.Application.Modules.TaskChat.DTOs;
|
||||
using GozareshgirProgramManager.Application.Modules.TaskChat.Queries.GetMessages;
|
||||
using GozareshgirProgramManager.Application.Modules.TaskChat.Queries.GetPinnedMessages;
|
||||
using GozareshgirProgramManager.Application.Modules.TaskChat.Queries.SearchMessages;
|
||||
using GozareshgirProgramManager.Domain.TaskChatAgg.Enums;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.BaseControllers;
|
||||
@@ -30,15 +31,17 @@ public class TaskChatController : ProgramManagerBaseController
|
||||
/// دریافت لیست پیامهای یک تسک
|
||||
/// </summary>
|
||||
/// <param name="taskId">شناسه تسک</param>
|
||||
/// <param name="messageType">نوع پیام</param>
|
||||
/// <param name="page">صفحه (پیشفرض: 1)</param>
|
||||
/// <param name="pageSize">تعداد در هر صفحه (پیشفرض: 50)</param>
|
||||
[HttpGet("{taskId:guid}/messages")]
|
||||
public async Task<ActionResult<OperationResult<PaginationResult<MessageDto>>>> GetMessages(
|
||||
Guid taskId,
|
||||
[FromQuery] MessageType? messageType,
|
||||
[FromQuery] int page = 1,
|
||||
[FromQuery] int pageSize = 50)
|
||||
{
|
||||
var query = new GetMessagesQuery(taskId, page, pageSize);
|
||||
var query = new GetMessagesQuery(taskId,messageType, page, pageSize);
|
||||
var result = await _mediator.Send(query);
|
||||
return result;
|
||||
}
|
||||
|
||||
59
ServiceHost/Areas/Admin/Controllers/SmsReportController.cs
Normal file
59
ServiceHost/Areas/Admin/Controllers/SmsReportController.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using _0_Framework.Application.Sms;
|
||||
using CompanyManagment.App.Contracts.SmsResult;
|
||||
using CompanyManagment.App.Contracts.SmsResult.Dto;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Controllers;
|
||||
|
||||
public class SmsReportController : AdminBaseController
|
||||
{
|
||||
private readonly ISmsResultApplication _smsResultApplication;
|
||||
private readonly ISmsService _smsService;
|
||||
|
||||
public SmsReportController(ISmsResultApplication smsResultApplication, ISmsService smsService)
|
||||
{
|
||||
_smsResultApplication = smsResultApplication;
|
||||
_smsService = smsService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست پیامک ها
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<List<SmsReportDto>> GetSmsReportList(SmsReportSearchModel searchModel)
|
||||
{
|
||||
|
||||
var result =await _smsResultApplication.GetSmsReportList(searchModel);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// دریافت اطلاعات هر تاریخ برای اکسپند
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <param name="date"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("GetExpandedList")]
|
||||
public async Task<List<SmsReportListDto>> GetSmsReportExpandList(SmsReportSearchModel searchModel, string date)
|
||||
{
|
||||
var result =await _smsResultApplication.GetSmsReportExpandList(searchModel, date);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// گزارش ای پی آی
|
||||
/// </summary>
|
||||
/// <param name="startDate"></param>
|
||||
/// <param name="endDate"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("GetApiReport")]
|
||||
public async Task<List<ApiReportDto>> GetApiReport(string startDate, string endDate)
|
||||
{
|
||||
var result =await _smsService.GetApiReport(startDate, endDate);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -1289,7 +1289,7 @@
|
||||
تمدید قرارداد
|
||||
</p>
|
||||
</a>
|
||||
<a permission="30715" class="btn btn-inverse pull-left rad" style="background-color: #f57373;border: 1px solid #f57373;margin-left:5px;"
|
||||
<a class="btn btn-inverse pull-left rad" style="background-color: #f57373;border: 1px solid #f57373;margin-left:5px;"
|
||||
asp-page="./FinancialStatments" asp-route-name="@item.ContractingPartyName" asp-route-id="@item.ContractingPartyId" asp-route-pageNumber="0">
|
||||
<i class="fa fa-file-text-o faSize"></i>
|
||||
<p>
|
||||
|
||||
Reference in New Issue
Block a user