Compare commits
46 Commits
Feature/Lo
...
Feature/no
| Author | SHA1 | Date | |
|---|---|---|---|
| 517f2d06ca | |||
| 343f830d0d | |||
| 87ff7976fb | |||
| a533850f24 | |||
| b5c1a4c29d | |||
| 28607dec66 | |||
| 4a041ca8e2 | |||
|
|
de0de6fde8 | ||
|
|
70447a74ef | ||
| 90aa6058f0 | |||
| 3df296f205 | |||
| 6a2e4405de | |||
| 88c10ac141 | |||
|
|
8de3939675 | ||
| e78c838cab | |||
|
|
5e4b8a3a80 | ||
|
|
a18984fec1 | ||
| a178fcd202 | |||
| 9e92d2215f | |||
| c63eb23b22 | |||
| 238926118f | |||
| c874164ca2 | |||
| d2f0ed46ae | |||
| 40dd90074b | |||
| 452b0b6277 | |||
| 720e998a54 | |||
| 626722e805 | |||
| 5e5910e0fd | |||
| 5d81731512 | |||
| 511932fa58 | |||
| 95891d5bae | |||
| f3fa76c292 | |||
| ac6bbc3587 | |||
| 947d7590f4 | |||
| 91403a52a3 | |||
| 7e80342f80 | |||
| 5e92207778 | |||
|
|
29484e9565 | ||
| ba640494d2 | |||
| 6974a505b4 | |||
| 6d3d599449 | |||
| 2d28bd1f98 | |||
| 75ae3efb65 | |||
| eb53fd67ef | |||
| 8ec717916c | |||
| 64bdbcbd2d |
@@ -32,7 +32,7 @@ public static class StaticWorkshopAccounts
|
|||||||
/// 392 - عمار حسن دوست
|
/// 392 - عمار حسن دوست
|
||||||
/// 20 - سمیرا الهی نیا
|
/// 20 - سمیرا الهی نیا
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static List<long> StaticAccountIds = [2, 3, 380, 381, 392, 20];
|
public static List<long> StaticAccountIds = [2, 3, 380, 381, 392, 20, 476];
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// این تاریخ در جدول اکانت لفت ورک به این معنیست
|
/// این تاریخ در جدول اکانت لفت ورک به این معنیست
|
||||||
|
|||||||
@@ -27,4 +27,3 @@ public class NullFaceEmbeddingNotificationService : IFaceEmbeddingNotificationSe
|
|||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -252,6 +252,35 @@ public class PersonalContractingParty : EntityBase
|
|||||||
Phone = phone;
|
Phone = phone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void UnAuthenticateRealEdit(string fName, string lName, string fatherName,string idNumber,
|
||||||
|
string idNumberSeri, string idNumberSerial, string dateOfBirth, Gender gender,string phone)
|
||||||
|
{
|
||||||
|
this.FName = fName;
|
||||||
|
this.LName = lName;
|
||||||
|
this.FatherName = fatherName;
|
||||||
|
this.IdNumberSeri = idNumberSeri;
|
||||||
|
this.IdNumberSerial = idNumberSerial;
|
||||||
|
this.DateOfBirth = !string.IsNullOrWhiteSpace(dateOfBirth) ? dateOfBirth.ToGeorgianDateTime() : null;
|
||||||
|
this.IdNumber = idNumber;
|
||||||
|
this.Gender = gender;
|
||||||
|
Phone = phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UnAuthenticateLegalEdit(string fName, string lName, string fatherName, string idNumber,
|
||||||
|
string idNumberSeri,
|
||||||
|
string idNumberSerial, string dateOfBirth, Gender gender, string phone)
|
||||||
|
{
|
||||||
|
CeoFName = fName;
|
||||||
|
CeoLName = lName;
|
||||||
|
this.FatherName = fatherName;
|
||||||
|
this.IdNumberSeri = idNumberSeri;
|
||||||
|
this.IdNumberSerial = idNumberSerial;
|
||||||
|
this.DateOfBirth = !string.IsNullOrWhiteSpace(dateOfBirth) ? dateOfBirth.ToGeorgianDateTime() : null;
|
||||||
|
this.IdNumber = idNumber;
|
||||||
|
this.Gender = gender;
|
||||||
|
Phone = phone;
|
||||||
|
}
|
||||||
|
|
||||||
public void RegisterComplete(string fatherName, string idNumberSeri, string idNumberSerial, DateTime dateOfBirth, Gender gender)
|
public void RegisterComplete(string fatherName, string idNumberSeri, string idNumberSerial, DateTime dateOfBirth, Gender gender)
|
||||||
{
|
{
|
||||||
this.FatherName = fatherName;
|
this.FatherName = fatherName;
|
||||||
@@ -261,4 +290,13 @@ public class PersonalContractingParty : EntityBase
|
|||||||
this.Gender = gender;
|
this.Gender = gender;
|
||||||
this.IsAuthenticated = true;
|
this.IsAuthenticated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void EditLegalPartyFromInstitution(string legalPosition, string companyName,
|
||||||
|
string registerId,string nationalId)
|
||||||
|
{
|
||||||
|
LegalPosition = legalPosition;
|
||||||
|
LName = companyName;
|
||||||
|
RegisterId = registerId;
|
||||||
|
NationalId = nationalId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,7 @@ namespace Company.Domain.EmployeeDocumentsAgg
|
|||||||
{
|
{
|
||||||
WorkshopId = workshopId;
|
WorkshopId = workshopId;
|
||||||
EmployeeId = employeeId;
|
EmployeeId = employeeId;
|
||||||
Gender = gender;
|
Gender = gender??string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
private EmployeeDocuments()
|
private EmployeeDocuments()
|
||||||
|
|||||||
@@ -56,6 +56,9 @@ public interface IInstitutionContractRepository : IRepository<long, InstitutionC
|
|||||||
void UpdateStatusIfNeeded(long institutionContractId);
|
void UpdateStatusIfNeeded(long institutionContractId);
|
||||||
Task<GetInstitutionVerificationDetailsViewModel> GetVerificationDetails(Guid id);
|
Task<GetInstitutionVerificationDetailsViewModel> GetVerificationDetails(Guid id);
|
||||||
Task<InstitutionContract> GetByPublicIdAsync(Guid id);
|
Task<InstitutionContract> GetByPublicIdAsync(Guid id);
|
||||||
|
InstitutionContractDiscountResponse CalculateDiscount(InstitutionContractSetDiscountRequest request);
|
||||||
|
InstitutionContractDiscountResponse ResetDiscountCreate(InstitutionContractResetDiscountForCreateRequest request);
|
||||||
|
|
||||||
|
|
||||||
#region Extension
|
#region Extension
|
||||||
|
|
||||||
@@ -63,6 +66,10 @@ public interface IInstitutionContractRepository : IRepository<long, InstitutionC
|
|||||||
Task<InstitutionContractExtensionWorkshopsResponse> GetExtensionWorkshops(InstitutionContractExtensionWorkshopsRequest request);
|
Task<InstitutionContractExtensionWorkshopsResponse> GetExtensionWorkshops(InstitutionContractExtensionWorkshopsRequest request);
|
||||||
Task<InstitutionContractExtensionPlanResponse> GetExtensionInstitutionPlan(InstitutionContractExtensionPlanRequest request);
|
Task<InstitutionContractExtensionPlanResponse> GetExtensionInstitutionPlan(InstitutionContractExtensionPlanRequest request);
|
||||||
Task<InstitutionContractExtensionPaymentResponse> GetExtensionPaymentMethod(InstitutionContractExtensionPaymentRequest request);
|
Task<InstitutionContractExtensionPaymentResponse> GetExtensionPaymentMethod(InstitutionContractExtensionPaymentRequest request);
|
||||||
|
Task<InstitutionContractDiscountResponse> SetDiscountForExtension(
|
||||||
|
InstitutionContractSetDiscountForExtensionRequest request);
|
||||||
|
Task<InstitutionContractDiscountResponse> ResetDiscountForExtension(InstitutionContractResetDiscountForExtensionRequest request);
|
||||||
|
|
||||||
Task<OperationResult> ExtensionComplete(InstitutionContractExtensionCompleteRequest request);
|
Task<OperationResult> ExtensionComplete(InstitutionContractExtensionCompleteRequest request);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -145,4 +152,6 @@ public interface IInstitutionContractRepository : IRepository<long, InstitutionC
|
|||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
Task<long> GetIdByInstallmentId(long installmentId);
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,8 @@ public class InstitutionContract : EntityBase
|
|||||||
string contractEndFa, double contractAmount, double dailyCompenseation, double obligation,
|
string contractEndFa, double contractAmount, double dailyCompenseation, double obligation,
|
||||||
double totalAmount, int extensionNo, string workshopManualCount, string employeeManualCount, string description,
|
double totalAmount, int extensionNo, string workshopManualCount, string employeeManualCount, string description,
|
||||||
string officialCompany, string typeOfcontract, string hasValueAddedTax, double valueAddedTax,
|
string officialCompany, string typeOfcontract, string hasValueAddedTax, double valueAddedTax,
|
||||||
List<InstitutionContractWorkshopInitial> workshopDetails, long lawId)
|
List<InstitutionContractWorkshopInitial> workshopDetails, long lawId,
|
||||||
|
int discountPercentage, double discountAmount)
|
||||||
{
|
{
|
||||||
ContractNo = contractNo;
|
ContractNo = contractNo;
|
||||||
RepresentativeId = representativeId;
|
RepresentativeId = representativeId;
|
||||||
@@ -57,8 +58,12 @@ public class InstitutionContract : EntityBase
|
|||||||
WorkshopGroup = new InstitutionContractWorkshopGroup(id, workshopDetails);
|
WorkshopGroup = new InstitutionContractWorkshopGroup(id, workshopDetails);
|
||||||
PublicId = Guid.NewGuid();
|
PublicId = Guid.NewGuid();
|
||||||
LawId = lawId;
|
LawId = lawId;
|
||||||
|
DiscountPercentage = discountPercentage;
|
||||||
|
DiscountAmount = discountAmount;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public long LawId { get; private set; }
|
public long LawId { get; private set; }
|
||||||
|
|
||||||
public string ContractNo { get; private set; }
|
public string ContractNo { get; private set; }
|
||||||
@@ -129,6 +134,10 @@ public class InstitutionContract : EntityBase
|
|||||||
public string VerifierFullName { get; private set; }
|
public string VerifierFullName { get; private set; }
|
||||||
public string VerifierPhoneNumber { get; private set; }
|
public string VerifierPhoneNumber { get; private set; }
|
||||||
|
|
||||||
|
public double DiscountAmount { get; private set; }
|
||||||
|
|
||||||
|
public int DiscountPercentage { get; private set; }
|
||||||
|
|
||||||
[NotMapped] public bool VerifyCodeExpired => VerifyCodeCreation.Add(ExpireTime) <= DateTime.Now;
|
[NotMapped] public bool VerifyCodeExpired => VerifyCodeCreation.Add(ExpireTime) <= DateTime.Now;
|
||||||
|
|
||||||
[NotMapped] public bool CanResendVerifyCode => VerifyCodeCreation.Add(ReSendTime) <= DateTime.Now;
|
[NotMapped] public bool CanResendVerifyCode => VerifyCodeCreation.Add(ReSendTime) <= DateTime.Now;
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ public class InstitutionContractExtensionTemp
|
|||||||
OneTimePayment = oneTime;
|
OneTimePayment = oneTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class InstitutionContractExtenstionTempPlan
|
public class InstitutionContractExtenstionTempPlan
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ public class CreateInstitutionContractRequest
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// مبلغ کل قرارداد
|
/// مبلغ کل قرارداد
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double TotalAmount { get; set; }
|
public double PaymentAmount { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// آیا قرارداد اقساطی است؟
|
/// آیا قرارداد اقساطی است؟
|
||||||
@@ -102,6 +102,10 @@ public class CreateInstitutionContractRequest
|
|||||||
public double OneMonthAmount { get; set; }
|
public double OneMonthAmount { get; set; }
|
||||||
|
|
||||||
public long LawId { get; set; }
|
public long LawId { get; set; }
|
||||||
|
|
||||||
|
public int DiscountPercentage { get; set; }
|
||||||
|
|
||||||
|
public double DiscountAmount { get; set; }
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// مدت زمان قرارداد نهاد
|
/// مدت زمان قرارداد نهاد
|
||||||
|
|||||||
@@ -215,6 +215,8 @@ public interface IInstitutionContractApplication
|
|||||||
Task<OperationResult<OtpResultViewModel>> SendVerifyOtp(Guid id);
|
Task<OperationResult<OtpResultViewModel>> SendVerifyOtp(Guid id);
|
||||||
Task<OperationResult<string>> VerifyOtpAndMakeGateway(Guid publicId, string code, string callbackUrl);
|
Task<OperationResult<string>> VerifyOtpAndMakeGateway(Guid publicId, string code, string callbackUrl);
|
||||||
Task<InstitutionContractWorkshopDetailViewModel> GetWorkshopInitialDetails(long workshopDetailsId);
|
Task<InstitutionContractWorkshopDetailViewModel> GetWorkshopInitialDetails(long workshopDetailsId);
|
||||||
|
InstitutionContractDiscountResponse CalculateDiscount(InstitutionContractSetDiscountRequest request);
|
||||||
|
InstitutionContractDiscountResponse ResetDiscountCreate(InstitutionContractResetDiscountForCreateRequest request);
|
||||||
|
|
||||||
#region Extension
|
#region Extension
|
||||||
|
|
||||||
@@ -229,6 +231,12 @@ public interface IInstitutionContractApplication
|
|||||||
Task<InstitutionContractExtensionPaymentResponse> GetExtensionPaymentMethod(
|
Task<InstitutionContractExtensionPaymentResponse> GetExtensionPaymentMethod(
|
||||||
InstitutionContractExtensionPaymentRequest request);
|
InstitutionContractExtensionPaymentRequest request);
|
||||||
|
|
||||||
|
Task<InstitutionContractDiscountResponse> SetDiscountForExtension(
|
||||||
|
InstitutionContractSetDiscountForExtensionRequest request);
|
||||||
|
Task<InstitutionContractDiscountResponse> ResetDiscountForExtension(
|
||||||
|
InstitutionContractResetDiscountForExtensionRequest request);
|
||||||
|
|
||||||
|
|
||||||
Task<OperationResult> ExtensionComplete(InstitutionContractExtensionCompleteRequest request);
|
Task<OperationResult> ExtensionComplete(InstitutionContractExtensionCompleteRequest request);
|
||||||
Task<List<InstitutionContractSelectListViewModel>> GetInstitutionContractSelectList(string search,string selected);
|
Task<List<InstitutionContractSelectListViewModel>> GetInstitutionContractSelectList(string search,string selected);
|
||||||
|
|
||||||
@@ -253,6 +261,75 @@ public interface IInstitutionContractApplication
|
|||||||
Task<InstitutionContractPrintViewModel> PrintOneAsync(long id);
|
Task<InstitutionContractPrintViewModel> PrintOneAsync(long id);
|
||||||
|
|
||||||
Task<OperationResult> SetPendingWorkflow(long entityId);
|
Task<OperationResult> SetPendingWorkflow(long entityId);
|
||||||
|
Task<long> GetIdByInstallmentId(long installmentId);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class InstitutionContractDiscountResponse
|
||||||
|
{
|
||||||
|
public InstitutionContractDiscountOneTimeViewModel OneTime { get; set; }
|
||||||
|
public InstitutionContractDiscountMonthlyViewModel Monthly { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class InstitutionContractDiscountMonthlyViewModel:InstitutionContractDiscountOneTimeViewModel
|
||||||
|
{
|
||||||
|
public List<MonthlyInstallment> Installments { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class InstitutionContractDiscountOneTimeViewModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// مجموع مبالغ
|
||||||
|
/// </summary>
|
||||||
|
public string TotalAmount { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// ارزش افزوده
|
||||||
|
/// </summary>
|
||||||
|
public string Tax { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// مبلغ قابل پرداخت
|
||||||
|
/// </summary>
|
||||||
|
public string PaymentAmount { get; set; }
|
||||||
|
|
||||||
|
public string DiscountedAmount { get; set; }
|
||||||
|
|
||||||
|
public int DiscountPercetage { get; set; }
|
||||||
|
|
||||||
|
public string Obligation { get; set; }
|
||||||
|
|
||||||
|
public string OneMonthAmount { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class InstitutionContractResetDiscountForCreateRequest
|
||||||
|
{
|
||||||
|
public int DiscountPercentage { get; set; }
|
||||||
|
public double TotalAmount { get; set; }
|
||||||
|
public bool IsInstallment { get; set; }
|
||||||
|
public InstitutionContractDuration Duration { get; set; }
|
||||||
|
public double OneMonthAmount { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class InstitutionContractSetDiscountForExtensionRequest
|
||||||
|
{
|
||||||
|
public Guid TempId { get; set; }
|
||||||
|
public int DiscountPercentage { get; set; }
|
||||||
|
public double TotalAmount { get; set; }
|
||||||
|
public bool IsInstallment { get; set; }
|
||||||
|
}
|
||||||
|
public class InstitutionContractResetDiscountForExtensionRequest
|
||||||
|
{
|
||||||
|
public Guid TempId { get; set; }
|
||||||
|
public bool IsInstallment { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class InstitutionContractSetDiscountRequest
|
||||||
|
{
|
||||||
|
public int DiscountPercentage { get; set; }
|
||||||
|
public double TotalAmount { get; set; }
|
||||||
|
public InstitutionContractDuration Duration { get; set; }
|
||||||
|
public double OneMonthAmount { get; set; }
|
||||||
|
public bool IsInstallment { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class InstitutionContractPrintViewModel
|
public class InstitutionContractPrintViewModel
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using _0_Framework.Application.Enums;
|
||||||
using CompanyManagment.App.Contracts.InstitutionContractContactinfo;
|
using CompanyManagment.App.Contracts.InstitutionContractContactinfo;
|
||||||
|
|
||||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
||||||
@@ -11,4 +12,15 @@ public class InstitutionContractExtensionWorkshopsRequest
|
|||||||
public string Province { get; set; }
|
public string Province { get; set; }
|
||||||
public string Address { get; set; }
|
public string Address { get; set; }
|
||||||
public List<EditContactInfo> ContactInfos { get; set; }
|
public List<EditContactInfo> ContactInfos { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// اطلاعات شخص حقیقی
|
||||||
|
/// </summary>
|
||||||
|
public CreateInstitutionContractRealPartyRequest RealParty { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// اطلاعات شخص حقوقی
|
||||||
|
/// </summary>
|
||||||
|
public CreateInstitutionContractLegalPartyRequest LegalParty { get; set; }
|
||||||
|
|
||||||
|
public LegalType LegalType { get; set; }
|
||||||
}
|
}
|
||||||
@@ -17,6 +17,9 @@ public class InstitutionContractPaymentOneTimeViewModel
|
|||||||
/// مبلغ قابل پرداخت
|
/// مبلغ قابل پرداخت
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string PaymentAmount { get; set; }
|
public string PaymentAmount { get; set; }
|
||||||
|
|
||||||
|
public string DiscountedAmount { get; set; }
|
||||||
|
public int DiscountPercetage { get; set; }
|
||||||
}
|
}
|
||||||
public class InstitutionContractPaymentMonthlyViewModel:InstitutionContractPaymentOneTimeViewModel
|
public class InstitutionContractPaymentMonthlyViewModel:InstitutionContractPaymentOneTimeViewModel
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1585,7 +1585,12 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
|||||||
if (employee.IsAuthorized == false)
|
if (employee.IsAuthorized == false)
|
||||||
{
|
{
|
||||||
var apiResult = await _uidService.GetPersonalInfo(nationalCode, birthDate);
|
var apiResult = await _uidService.GetPersonalInfo(nationalCode, birthDate);
|
||||||
if (apiResult.ResponseContext.Status.Code == 14)
|
|
||||||
|
if (apiResult == null)
|
||||||
|
{
|
||||||
|
return op.Failed("این پرسنل در بانک اطلاعات موجود میباشد");
|
||||||
|
}
|
||||||
|
if (apiResult.ResponseContext.Status.Code is 14 or 3)
|
||||||
{
|
{
|
||||||
return op.Failed("این پرسنل در بانک اطلاعات موجود میباشد");
|
return op.Failed("این پرسنل در بانک اطلاعات موجود میباشد");
|
||||||
|
|
||||||
@@ -1644,8 +1649,13 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
|||||||
};
|
};
|
||||||
return op.Succcedded(data);
|
return op.Succcedded(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
var apiResult = await _uidService.GetPersonalInfo(nationalCode, birthDate);
|
var apiResult = await _uidService.GetPersonalInfo(nationalCode, birthDate);
|
||||||
if (apiResult.ResponseContext.Status.Code == 14)
|
if (apiResult == null)
|
||||||
|
{
|
||||||
|
return op.Failed("سامانه احراز هویت در دسترس نمیباشد لطفا اطلاعات پرسنل را به صورت دستی وارد کنید", new EmployeeDataFromApiViewModel() { AuthorizedCanceled = true });
|
||||||
|
}
|
||||||
|
if (apiResult.ResponseContext.Status.Code is 14 or 3)
|
||||||
{
|
{
|
||||||
return op.Failed("سامانه احراز هویت در دسترس نمیباشد لطفا اطلاعات پرسنل را به صورت دستی وارد کنید", new EmployeeDataFromApiViewModel() { AuthorizedCanceled = true });
|
return op.Failed("سامانه احراز هویت در دسترس نمیباشد لطفا اطلاعات پرسنل را به صورت دستی وارد کنید", new EmployeeDataFromApiViewModel() { AuthorizedCanceled = true });
|
||||||
|
|
||||||
|
|||||||
@@ -1485,12 +1485,12 @@ public class EmployerApplication : IEmployerApplication
|
|||||||
return opration.Failed("نام شرکت وارد شده تکراری است");
|
return opration.Failed("نام شرکت وارد شده تکراری است");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_EmployerRepository.Exists(x =>
|
// if (_EmployerRepository.Exists(x =>
|
||||||
x.RegisterId == command.RegisterId && !string.IsNullOrWhiteSpace(command.RegisterId) &&
|
// x.RegisterId == command.RegisterId && !string.IsNullOrWhiteSpace(command.RegisterId) &&
|
||||||
x.RegisterId != null))
|
// x.RegisterId != null))
|
||||||
{
|
// {
|
||||||
return opration.Failed(" شماره ثبت وارد شده تکراری است");
|
// return opration.Failed(" شماره ثبت وارد شده تکراری است");
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(command.NationalId) && command.NationalId.Length != 11)
|
if (!string.IsNullOrEmpty(command.NationalId) && command.NationalId.Length != 11)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -69,7 +69,8 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
IContractingPartyTempRepository contractingPartyTempRepository,
|
IContractingPartyTempRepository contractingPartyTempRepository,
|
||||||
IFinancialStatmentRepository financialStatmentRepository, IContactInfoApplication contactInfoApplication,
|
IFinancialStatmentRepository financialStatmentRepository, IContactInfoApplication contactInfoApplication,
|
||||||
IAccountApplication accountApplication, ISmsService smsService, IUidService uidService,
|
IAccountApplication accountApplication, ISmsService smsService, IUidService uidService,
|
||||||
IFinancialInvoiceRepository financialInvoiceRepository, IHttpClientFactory httpClientFactory, IPaymentTransactionRepository paymentTransactionRepository)
|
IFinancialInvoiceRepository financialInvoiceRepository, IHttpClientFactory httpClientFactory,
|
||||||
|
IPaymentTransactionRepository paymentTransactionRepository)
|
||||||
{
|
{
|
||||||
_institutionContractRepository = institutionContractRepository;
|
_institutionContractRepository = institutionContractRepository;
|
||||||
_contractingPartyRepository = contractingPartyRepository;
|
_contractingPartyRepository = contractingPartyRepository;
|
||||||
@@ -222,7 +223,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
command.ContractStartFa, contractEndGr, command.ContractEndFa, command.ContractAmount,
|
command.ContractStartFa, contractEndGr, command.ContractEndFa, command.ContractAmount,
|
||||||
command.DailyCompenseation, command.Obligation,
|
command.DailyCompenseation, command.Obligation,
|
||||||
command.TotalAmount, 0, command.WorkshopManualCount, command.EmployeeManualCount, command.Description,
|
command.TotalAmount, 0, command.WorkshopManualCount, command.EmployeeManualCount, command.Description,
|
||||||
command.OfficialCompany, command.TypeOfContract, command.HasValueAddedTax, command.ValueAddedTax, [], command.LawId);
|
command.OfficialCompany, command.TypeOfContract, command.HasValueAddedTax, command.ValueAddedTax, [], command.LawId,0,0);
|
||||||
|
|
||||||
_institutionContractRepository.Create(createContract);
|
_institutionContractRepository.Create(createContract);
|
||||||
_institutionContractRepository.SaveChanges();
|
_institutionContractRepository.SaveChanges();
|
||||||
@@ -331,7 +332,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
command.DailyCompenseation, command.Obligation,
|
command.DailyCompenseation, command.Obligation,
|
||||||
command.TotalAmount, command.ExtensionNo, command.WorkshopManualCount, command.EmployeeManualCount,
|
command.TotalAmount, command.ExtensionNo, command.WorkshopManualCount, command.EmployeeManualCount,
|
||||||
command.Description, command.OfficialCompany, command.TypeOfContract, command.HasValueAddedTax,
|
command.Description, command.OfficialCompany, command.TypeOfContract, command.HasValueAddedTax,
|
||||||
command.ValueAddedTax, [], command.LawId);
|
command.ValueAddedTax, [], command.LawId,0,0);
|
||||||
|
|
||||||
_institutionContractRepository.Create(createContract);
|
_institutionContractRepository.Create(createContract);
|
||||||
_institutionContractRepository.SaveChanges();
|
_institutionContractRepository.SaveChanges();
|
||||||
@@ -887,6 +888,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
public void RemoveContract(long id)
|
public void RemoveContract(long id)
|
||||||
{
|
{
|
||||||
_institutionContractRepository.RemoveContract(id);
|
_institutionContractRepository.RemoveContract(id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -943,7 +945,6 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
|
|
||||||
public async Task<OperationResult> CreateAsync(CreateInstitutionContractRequest command)
|
public async Task<OperationResult> CreateAsync(CreateInstitutionContractRequest command)
|
||||||
{
|
{
|
||||||
|
|
||||||
var opration = new OperationResult();
|
var opration = new OperationResult();
|
||||||
var syear = command.ContractStartFa.Substring(0, 4);
|
var syear = command.ContractStartFa.Substring(0, 4);
|
||||||
var smonth = command.ContractStartFa.Substring(5, 2);
|
var smonth = command.ContractStartFa.Substring(5, 2);
|
||||||
@@ -974,6 +975,19 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
throw new BadRequestException("امکان ایجاد قرارداد تکراری وجود ندارد");
|
throw new BadRequestException("امکان ایجاد قرارداد تکراری وجود ندارد");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!command.LegalParty.IsAuth && existingContractingParty != null)
|
||||||
|
{
|
||||||
|
var legalCommand = command.LegalParty;
|
||||||
|
existingContractingParty.UnAuthenticateLegalEdit(legalCommand.FName,legalCommand.LName,legalCommand.FatherName,legalCommand.IdNumber,existingContractingParty.IdNumberSeri,existingContractingParty.IdNumberSerial,
|
||||||
|
legalCommand.BirthDateFa,legalCommand.Gender,legalCommand.PhoneNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (existingContractingParty != null)
|
||||||
|
{
|
||||||
|
existingContractingParty.EditLegalPartyFromInstitution(command.LegalParty.Position,command.LegalParty.CompanyName,
|
||||||
|
command.LegalParty.RegisterId,command.LegalParty.NationalId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (command.ContractingPartyLegalType == LegalType.Real)
|
else if (command.ContractingPartyLegalType == LegalType.Real)
|
||||||
{
|
{
|
||||||
@@ -990,8 +1004,15 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
throw new BadRequestException("امکان ایجاد قرارداد تکراری وجود ندارد");
|
throw new BadRequestException("امکان ایجاد قرارداد تکراری وجود ندارد");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!command.RealParty.IsAuth && existingContractingParty != null)
|
||||||
|
{
|
||||||
|
var realCommand = command.RealParty;
|
||||||
|
existingContractingParty.UnAuthenticateRealEdit(realCommand.FName,realCommand.LName,realCommand.FatherName,realCommand.IdNumber,existingContractingParty.IdNumberSeri,existingContractingParty.IdNumberSerial,
|
||||||
|
realCommand.BirthDateFa,realCommand.Gender,realCommand.PhoneNumber);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await _institutionContractRepository.SaveChangesAsync();
|
||||||
PersonalContractingParty contractingParty;
|
PersonalContractingParty contractingParty;
|
||||||
if (existingContractingParty != null)
|
if (existingContractingParty != null)
|
||||||
{
|
{
|
||||||
@@ -1016,6 +1037,8 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
contractingParty = contractingPartyResult.Data;
|
contractingParty = contractingPartyResult.Data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (_institutionContractRepository.Exists(x =>
|
if (_institutionContractRepository.Exists(x =>
|
||||||
x.ContractingPartyId == contractingParty.id && x.RepresentativeId == command.RepresentativeId &&
|
x.ContractingPartyId == contractingParty.id && x.RepresentativeId == command.RepresentativeId &&
|
||||||
x.TypeOfContract == "JobRelation"))
|
x.TypeOfContract == "JobRelation"))
|
||||||
@@ -1046,7 +1069,6 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
var contractingPartyFullName = "";
|
var contractingPartyFullName = "";
|
||||||
if (contractingParty.IsLegal == "حقیقی")
|
if (contractingParty.IsLegal == "حقیقی")
|
||||||
{
|
{
|
||||||
|
|
||||||
contractingPartyFullName = contractingParty.FName + " " + contractingParty.LName;
|
contractingPartyFullName = contractingParty.FName + " " + contractingParty.LName;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1066,11 +1088,11 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
contractStartGr,
|
contractStartGr,
|
||||||
contractStartGr.ToFarsi(), contractEndGr, contractEndGr.ToFarsi(), command.OneMonthAmount,
|
contractStartGr.ToFarsi(), contractEndGr, contractEndGr.ToFarsi(), command.OneMonthAmount,
|
||||||
command.DailyCompensation,
|
command.DailyCompensation,
|
||||||
command.Obligation, command.TotalAmount, 0,
|
command.Obligation, command.PaymentAmount, 0,
|
||||||
command.Workshops.Count.ToString(),
|
command.Workshops.Count.ToString(),
|
||||||
command.Workshops.Sum(x => x.PersonnelCount).ToString(), command.Description,
|
command.Workshops.Sum(x => x.PersonnelCount).ToString(), command.Description,
|
||||||
"NotOfficial", "JobRelation", hasValueAddedTax,
|
"NotOfficial", "JobRelation", hasValueAddedTax,
|
||||||
command.TaxAmount, workshopDetails, command.LawId);
|
command.TaxAmount, workshopDetails, command.LawId,command.DiscountPercentage,command.DiscountAmount );
|
||||||
|
|
||||||
|
|
||||||
FinancialStatment financialStatement;
|
FinancialStatment financialStatement;
|
||||||
@@ -1086,14 +1108,10 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
await _institutionContractRepository.CreateAsync(entity);
|
await _institutionContractRepository.CreateAsync(entity);
|
||||||
await _institutionContractRepository.SaveChangesAsync();
|
await _institutionContractRepository.SaveChangesAsync();
|
||||||
|
|
||||||
double invoiceAmount;
|
|
||||||
string invoiceItemDescription;
|
|
||||||
FinancialInvoiceItemType invoiceItemType;
|
|
||||||
long invoiceItemEntityId;
|
|
||||||
if (command.IsInstallment)
|
if (command.IsInstallment)
|
||||||
{
|
{
|
||||||
var installments =
|
var installments =
|
||||||
CalculateInstallment(command.TotalAmount, (int)command.Duration, command.ContractStartFa, true);
|
CalculateInstallment(command.PaymentAmount, (int)command.Duration, command.ContractStartFa, true);
|
||||||
|
|
||||||
|
|
||||||
// دریافت مبلغ اولین قسط
|
// دریافت مبلغ اولین قسط
|
||||||
@@ -1114,33 +1132,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
|
|
||||||
await _institutionContractRepository.SaveChangesAsync();
|
await _institutionContractRepository.SaveChangesAsync();
|
||||||
|
|
||||||
var financialTransaction = new FinancialTransaction(0, today, today.ToFarsi(),
|
|
||||||
"قسط اول سرویس", "debt", "بابت خدمات", firstInstallmentAmount, 0, 0);
|
|
||||||
|
|
||||||
financialStatement.AddFinancialTransaction(financialTransaction);
|
|
||||||
invoiceAmount = firstInstallmentAmount;
|
|
||||||
invoiceItemDescription = $"پرداخت قسط اول قرارداد شماره {entity.ContractNo}";
|
|
||||||
invoiceItemType = FinancialInvoiceItemType.BuyInstitutionContractInstallment;
|
|
||||||
invoiceItemEntityId = todayInstallment.Id;
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
var financialTransaction = new FinancialTransaction(0, today, today.ToFarsi(),
|
|
||||||
"پرداخت کل سرویس", "debt", "بابت خدمات", command.TotalAmount, 0, 0);
|
|
||||||
financialStatement.AddFinancialTransaction(financialTransaction);
|
|
||||||
invoiceAmount = command.TotalAmount;
|
|
||||||
invoiceItemDescription = $"پرداخت کل قرارداد شماره {entity.ContractNo}";
|
|
||||||
invoiceItemType = FinancialInvoiceItemType.BuyInstitutionContract;
|
|
||||||
invoiceItemEntityId = entity.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
var financialInvoice = new FinancialInvoice(invoiceAmount, contractingParty.id, $"خرید قرارداد مالی شماره {entity.ContractNo}");
|
|
||||||
var financialInvoiceItem = new FinancialInvoiceItem(invoiceItemDescription, invoiceAmount, 0, invoiceItemType, invoiceItemEntityId);
|
|
||||||
financialInvoice.AddItem(financialInvoiceItem);
|
|
||||||
|
|
||||||
|
|
||||||
await _financialInvoiceRepository.CreateAsync(financialInvoice);
|
|
||||||
await _institutionContractRepository.SaveChangesAsync();
|
|
||||||
|
|
||||||
var mainContactInfo = new CreateContactInfo
|
var mainContactInfo = new CreateContactInfo
|
||||||
{
|
{
|
||||||
@@ -1260,7 +1252,8 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
await _institutionContractRepository.SaveChangesAsync();
|
await _institutionContractRepository.SaveChangesAsync();
|
||||||
_smsService.VerifySend(contractingParty.Phone, code);
|
await _smsService.SendInstitutionVerificationCode(contractingParty.Phone, code,contractingPartyFullName,
|
||||||
|
contractingParty.id, institutionContract.id);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -1301,25 +1294,74 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
if (institutionContract.VerifyCode != code)
|
if (institutionContract.VerifyCode != code)
|
||||||
return op.Failed("کد وارد شده صحیح نمی باشد");
|
return op.Failed("کد وارد شده صحیح نمی باشد");
|
||||||
|
|
||||||
var dbTransaction = await _institutionContractRepository.BeginTransactionAsync();
|
var financialStatement =await _financialStatmentRepository.GetByContractingPartyId(contractingParty.id);
|
||||||
|
|
||||||
|
var dbTransaction = await _institutionContractRepository.BeginTransactionAsync();
|
||||||
|
FinancialInvoice financialInvoice;
|
||||||
|
FinancialInvoiceItem financialInvoiceItem;
|
||||||
|
var today = DateTime.Today;
|
||||||
|
double invoiceAmount = 0;
|
||||||
|
string invoiceItemDescription = string.Empty;
|
||||||
|
FinancialInvoiceItemType invoiceItemType = FinancialInvoiceItemType.BuyInstitutionContract;
|
||||||
|
long invoiceItemEntityId = 0;
|
||||||
|
|
||||||
long entityId = 0;
|
|
||||||
FinancialInvoiceItemType financialInvoiceItemType;
|
|
||||||
if (institutionContract.IsInstallment)
|
if (institutionContract.IsInstallment)
|
||||||
{
|
{
|
||||||
entityId = institutionContract.Installments.MinBy(x => x.InstallmentDateGr).Id;
|
var firstInstallment = institutionContract.Installments.First();
|
||||||
financialInvoiceItemType = FinancialInvoiceItemType.BuyInstitutionContractInstallment;
|
var firstInstallmentAmount = firstInstallment.Amount;
|
||||||
|
|
||||||
|
financialInvoice = await _financialInvoiceRepository.GetUnPaidByEntityId(firstInstallment.Id, FinancialInvoiceItemType.BuyInstitutionContractInstallment);
|
||||||
|
if (financialInvoice == null)
|
||||||
|
{
|
||||||
|
var financialTransaction = new FinancialTransaction(0, today, today.ToFarsi(),
|
||||||
|
"قسط اول سرویس", "debt", "بابت خدمات", firstInstallmentAmount, 0, 0);
|
||||||
|
financialStatement.AddFinancialTransaction(financialTransaction);
|
||||||
|
invoiceAmount = firstInstallmentAmount;
|
||||||
|
invoiceItemDescription = $"پرداخت قسط اول قرارداد شماره {institutionContract.ContractNo}";
|
||||||
|
invoiceItemType = FinancialInvoiceItemType.BuyInstitutionContractInstallment;
|
||||||
|
invoiceItemEntityId = firstInstallment.Id;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
entityId = institutionContract.id;
|
invoiceAmount = financialInvoice.Amount;
|
||||||
financialInvoiceItemType = FinancialInvoiceItemType.BuyInstitutionContract;
|
invoiceItemDescription = financialInvoice.Items.First().Description;
|
||||||
|
invoiceItemType = financialInvoice.Items.First().Type;
|
||||||
|
invoiceItemEntityId = financialInvoice.Items.First().EntityId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
financialInvoice = await _financialInvoiceRepository.GetUnPaidByEntityId(institutionContract.id, FinancialInvoiceItemType.BuyInstitutionContract);
|
||||||
|
if (financialInvoice == null)
|
||||||
|
{
|
||||||
|
var financialTransaction = new FinancialTransaction(0, today, today.ToFarsi(),
|
||||||
|
"پرداخت کل سرویس", "debt", "بابت خدمات", institutionContract.TotalAmount, 0, 0);
|
||||||
|
financialStatement.AddFinancialTransaction(financialTransaction);
|
||||||
|
invoiceAmount = institutionContract.TotalAmount;
|
||||||
|
invoiceItemDescription = $"پرداخت کل قرارداد شماره {institutionContract.ContractNo}";
|
||||||
|
invoiceItemType = FinancialInvoiceItemType.BuyInstitutionContract;
|
||||||
|
invoiceItemEntityId = institutionContract.id;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
invoiceAmount = financialInvoice.Amount;
|
||||||
|
invoiceItemDescription = financialInvoice.Items.First().Description;
|
||||||
|
invoiceItemType = financialInvoice.Items.First().Type;
|
||||||
|
invoiceItemEntityId = financialInvoice.Items.First().EntityId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var financialInvoice = await _financialInvoiceRepository.GetUnPaidByEntityId(entityId, financialInvoiceItemType);
|
if (financialInvoice == null)
|
||||||
var amount = financialInvoice.Amount;
|
{
|
||||||
|
financialInvoice = new FinancialInvoice(invoiceAmount, contractingParty.id, $"خرید قرارداد مالی شماره {institutionContract.ContractNo}");
|
||||||
|
financialInvoiceItem = new FinancialInvoiceItem(invoiceItemDescription, invoiceAmount, 0, invoiceItemType, invoiceItemEntityId);
|
||||||
|
financialInvoice.AddItem(financialInvoiceItem);
|
||||||
|
await _financialInvoiceRepository.CreateAsync(financialInvoice);
|
||||||
|
}
|
||||||
|
|
||||||
var transaction = new PaymentTransaction(institutionContract.ContractingPartyId, amount,
|
await _financialInvoiceRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
var transaction = new PaymentTransaction(institutionContract.ContractingPartyId, invoiceAmount,
|
||||||
institutionContract.ContractingPartyName, "https://client.gozareshgir.ir",
|
institutionContract.ContractingPartyName, "https://client.gozareshgir.ir",
|
||||||
PaymentTransactionGateWay.SepehrPay);
|
PaymentTransactionGateWay.SepehrPay);
|
||||||
await _paymentTransactionRepository.CreateAsync(transaction);
|
await _paymentTransactionRepository.CreateAsync(transaction);
|
||||||
@@ -1327,7 +1369,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
|
|
||||||
var createPayment = new CreatePaymentGatewayRequest()
|
var createPayment = new CreatePaymentGatewayRequest()
|
||||||
{
|
{
|
||||||
Amount = amount,
|
Amount = invoiceAmount,
|
||||||
TransactionId = transaction.id.ToString(),
|
TransactionId = transaction.id.ToString(),
|
||||||
CallBackUrl = callbackUrl,
|
CallBackUrl = callbackUrl,
|
||||||
FinancialInvoiceId = financialInvoice.id,
|
FinancialInvoiceId = financialInvoice.id,
|
||||||
@@ -1388,6 +1430,17 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public InstitutionContractDiscountResponse CalculateDiscount(InstitutionContractSetDiscountRequest request)
|
||||||
|
{
|
||||||
|
return _institutionContractRepository.CalculateDiscount(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public InstitutionContractDiscountResponse ResetDiscountCreate(
|
||||||
|
InstitutionContractResetDiscountForCreateRequest request)
|
||||||
|
{
|
||||||
|
return _institutionContractRepository.ResetDiscountCreate(request);
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<InstitutionContractExtensionInquiryResult> GetExtensionInquiry(long previousContractId)
|
public async Task<InstitutionContractExtensionInquiryResult> GetExtensionInquiry(long previousContractId)
|
||||||
{
|
{
|
||||||
return await _institutionContractRepository.GetExtensionInquiry(previousContractId);
|
return await _institutionContractRepository.GetExtensionInquiry(previousContractId);
|
||||||
@@ -1411,12 +1464,25 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
return await _institutionContractRepository.GetExtensionPaymentMethod(request);
|
return await _institutionContractRepository.GetExtensionPaymentMethod(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<InstitutionContractDiscountResponse> SetDiscountForExtension(
|
||||||
|
InstitutionContractSetDiscountForExtensionRequest request)
|
||||||
|
{
|
||||||
|
return await _institutionContractRepository.SetDiscountForExtension(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<InstitutionContractDiscountResponse> ResetDiscountForExtension(
|
||||||
|
InstitutionContractResetDiscountForExtensionRequest request)
|
||||||
|
{
|
||||||
|
return await _institutionContractRepository.ResetDiscountForExtension(request);
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<OperationResult> ExtensionComplete(InstitutionContractExtensionCompleteRequest request)
|
public async Task<OperationResult> ExtensionComplete(InstitutionContractExtensionCompleteRequest request)
|
||||||
{
|
{
|
||||||
return await _institutionContractRepository.ExtensionComplete(request);
|
return await _institutionContractRepository.ExtensionComplete(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<InstitutionContractSelectListViewModel>> GetInstitutionContractSelectList(string search, string selected)
|
public async Task<List<InstitutionContractSelectListViewModel>> GetInstitutionContractSelectList(string search,
|
||||||
|
string selected)
|
||||||
{
|
{
|
||||||
return await _institutionContractRepository.GetInstitutionContractSelectList(search, selected);
|
return await _institutionContractRepository.GetInstitutionContractSelectList(search, selected);
|
||||||
}
|
}
|
||||||
@@ -1426,7 +1492,8 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
return await _institutionContractRepository.GetAmendmentWorkshops(institutionContractId);
|
return await _institutionContractRepository.GetAmendmentWorkshops(institutionContractId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<InsertAmendmentTempWorkshopResponse> InsertAmendmentTempWorkshops(InstitutionContractAmendmentTempWorkshopViewModel request)
|
public async Task<InsertAmendmentTempWorkshopResponse> InsertAmendmentTempWorkshops(
|
||||||
|
InstitutionContractAmendmentTempWorkshopViewModel request)
|
||||||
{
|
{
|
||||||
return await _institutionContractRepository.InsertAmendmentTempWorkshops(request);
|
return await _institutionContractRepository.InsertAmendmentTempWorkshops(request);
|
||||||
}
|
}
|
||||||
@@ -1436,7 +1503,8 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
return _institutionContractRepository.RemoveAmendmentWorkshops(workshopTempId);
|
return _institutionContractRepository.RemoveAmendmentWorkshops(workshopTempId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task<InsitutionContractAmendmentPaymentResponse> GetAmendmentPaymentDetails(InsitutionContractAmendmentPaymentRequest request)
|
public Task<InsitutionContractAmendmentPaymentResponse> GetAmendmentPaymentDetails(
|
||||||
|
InsitutionContractAmendmentPaymentRequest request)
|
||||||
{
|
{
|
||||||
return _institutionContractRepository.GetAmendmentPaymentDetails(request);
|
return _institutionContractRepository.GetAmendmentPaymentDetails(request);
|
||||||
}
|
}
|
||||||
@@ -1454,6 +1522,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
{
|
{
|
||||||
throw new BadRequestException("این قرارداد مالی در وضعیت مناسبی برای ارسال مجدد لینک تایید نمی باشد");
|
throw new BadRequestException("این قرارداد مالی در وضعیت مناسبی برای ارسال مجدد لینک تایید نمی باشد");
|
||||||
}
|
}
|
||||||
|
|
||||||
var contractingParty = _contractingPartyRepository.Get(institutionContract.ContractingPartyId);
|
var contractingParty = _contractingPartyRepository.Get(institutionContract.ContractingPartyId);
|
||||||
if (contractingParty == null)
|
if (contractingParty == null)
|
||||||
throw new NotFoundException("طرف قرارداد یافت نشد");
|
throw new NotFoundException("طرف قرارداد یافت نشد");
|
||||||
@@ -1471,7 +1540,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
public async Task<OperationResult> SetPendingWorkflow(long entityId)
|
public async Task<OperationResult> SetPendingWorkflow(long entityId)
|
||||||
{
|
{
|
||||||
var op = new OperationResult();
|
var op = new OperationResult();
|
||||||
var institutionContract = _institutionContractRepository.Get(entityId);
|
var institutionContract = await _institutionContractRepository.GetIncludeWorkshopDetailsAsync(entityId);
|
||||||
if (institutionContract == null)
|
if (institutionContract == null)
|
||||||
{
|
{
|
||||||
return op.Failed("قرارداد مالی یافت نشد");
|
return op.Failed("قرارداد مالی یافت نشد");
|
||||||
@@ -1481,11 +1550,24 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
{
|
{
|
||||||
return op.Failed("وضعیت قرارداد مالی برای این عملیات مناسب نمی باشد");
|
return op.Failed("وضعیت قرارداد مالی برای این عملیات مناسب نمی باشد");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (institutionContract.WorkshopGroup.InitialWorkshops.All(x => x.WorkshopCreated && x.WorkshopId is > 0))
|
||||||
|
{
|
||||||
|
institutionContract.Verified();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
institutionContract.SetPendingWorkflow();
|
institutionContract.SetPendingWorkflow();
|
||||||
|
}
|
||||||
|
|
||||||
await _institutionContractRepository.SaveChangesAsync();
|
await _institutionContractRepository.SaveChangesAsync();
|
||||||
return op.Succcedded();
|
return op.Succcedded();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<long> GetIdByInstallmentId(long installmentId)
|
||||||
|
{
|
||||||
|
return await _institutionContractRepository.GetIdByInstallmentId(installmentId);
|
||||||
|
}
|
||||||
|
|
||||||
private async Task<OperationResult<PersonalContractingParty>> CreateLegalContractingPartyEntity(
|
private async Task<OperationResult<PersonalContractingParty>> CreateLegalContractingPartyEntity(
|
||||||
CreateInstitutionContractLegalPartyRequest request, long representativeId, string address, string city,
|
CreateInstitutionContractLegalPartyRequest request, long representativeId, string address, string city,
|
||||||
@@ -1690,3 +1772,4 @@ public class WorkshopsAndEmployeeViewModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
@@ -290,17 +290,11 @@ public class LeftWorkTempApplication : ILeftWorkTempApplication
|
|||||||
|
|
||||||
|
|
||||||
//get rollCallEmployee associated with those leftworks which have a higher end date than leftworkDate
|
//get rollCallEmployee associated with those leftworks which have a higher end date than leftworkDate
|
||||||
|
|
||||||
var rollCallsEmployee = _rollCallEmployeeRepository.GetBy(employeeId, workshopId);
|
var rollCallsEmployee = _rollCallEmployeeRepository.GetBy(employeeId, workshopId);
|
||||||
|
|
||||||
// var joinedList = rollCallsEmployee.Join(leftWorks, x => x.WorkshopId, y => y.WorkshopId, (x, y) => new
|
if (rollCallsEmployee != null)
|
||||||
// {
|
{
|
||||||
// x.WorkshopId,
|
|
||||||
// x.EmployeeId,
|
|
||||||
// y.LeftWorkDateGr,
|
|
||||||
// Status = x.Statuses.OrderByDescending(z => z.StartDate).FirstOrDefault(z => z.StartDateGr.Date < y.LeftWorkDateGr && z.EndDateGr.Date > y.LeftWorkDateGr)
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
var status = rollCallsEmployee.EmployeesStatus.OrderByDescending(z => z.StartDate)
|
var status = rollCallsEmployee.EmployeesStatus.OrderByDescending(z => z.StartDate)
|
||||||
.FirstOrDefault(rollCallEmployeeStatus => rollCallEmployeeStatus.StartDate.Date < maxLeftWork.LeftWorkDateGr
|
.FirstOrDefault(rollCallEmployeeStatus => rollCallEmployeeStatus.StartDate.Date < maxLeftWork.LeftWorkDateGr
|
||||||
&& rollCallEmployeeStatus.EndDate.Date >
|
&& rollCallEmployeeStatus.EndDate.Date >
|
||||||
@@ -323,5 +317,16 @@ public class LeftWorkTempApplication : ILeftWorkTempApplication
|
|||||||
_rollCallEmployeeStatusRepository.RemoveRange(rollCallEmployeeStatusList);
|
_rollCallEmployeeStatusRepository.RemoveRange(rollCallEmployeeStatusList);
|
||||||
_rollCallEmployeeStatusRepository.SaveChanges();
|
_rollCallEmployeeStatusRepository.SaveChanges();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// var joinedList = rollCallsEmployee.Join(leftWorks, x => x.WorkshopId, y => y.WorkshopId, (x, y) => new
|
||||||
|
// {
|
||||||
|
// x.WorkshopId,
|
||||||
|
// x.EmployeeId,
|
||||||
|
// y.LeftWorkDateGr,
|
||||||
|
// Status = x.Statuses.OrderByDescending(z => z.StartDate).FirstOrDefault(z => z.StartDateGr.Date < y.LeftWorkDateGr && z.EndDateGr.Date > y.LeftWorkDateGr)
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -119,18 +119,10 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
|||||||
|
|
||||||
//دریافت اطلاعات احراز هویت
|
//دریافت اطلاعات احراز هویت
|
||||||
var apiResponsParty = await _uidService.GetPersonalInfo(nationalCode, dateOfBirth);
|
var apiResponsParty = await _uidService.GetPersonalInfo(nationalCode, dateOfBirth);
|
||||||
|
|
||||||
//چک کردن مطابقت شماره همراه و کد ملی
|
|
||||||
var isMachMobilAndNationalCode = await _uidService.IsMachPhoneWithNationalCode(nationalCode, mobile);
|
|
||||||
if (isMachMobilAndNationalCode == null)
|
|
||||||
return op.Failed("خطا در سرویس احراز هویت");
|
|
||||||
if (!isMachMobilAndNationalCode.IsMatched)
|
|
||||||
return op.Failed("شماره همراه وارد شده با کد ملی مطابقت ندارد");
|
|
||||||
|
|
||||||
if (apiResponsParty == null)
|
if (apiResponsParty == null)
|
||||||
throw new InternalServerException("خطا در سرویس احراز هویت");
|
throw new InternalServerException("خطا در سرویس احراز هویت");
|
||||||
|
|
||||||
if (apiResponsParty.ResponseContext.Status.Code ==14)
|
if (apiResponsParty.ResponseContext.Status.Code is 14 or 3)
|
||||||
throw new InternalServerException("سیستم احراز هویت در دسترس نمی باشد");
|
throw new InternalServerException("سیستم احراز هویت در دسترس نمی باشد");
|
||||||
|
|
||||||
if (apiResponsParty.ResponseContext.Status.Code != 0)
|
if (apiResponsParty.ResponseContext.Status.Code != 0)
|
||||||
@@ -140,6 +132,16 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
|||||||
? apiResponsParty.IdentificationInformation.NationalId
|
? apiResponsParty.IdentificationInformation.NationalId
|
||||||
: apiResponsParty.IdentificationInformation.ShenasnamehNumber;
|
: apiResponsParty.IdentificationInformation.ShenasnamehNumber;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//چک کردن مطابقت شماره همراه و کد ملی
|
||||||
|
var isMachMobilAndNationalCode = await _uidService.IsMachPhoneWithNationalCode(nationalCode, mobile);
|
||||||
|
|
||||||
|
if (isMachMobilAndNationalCode == null)
|
||||||
|
throw new InternalServerException("خطا در سرویس تطابق کد ملی و شماره همراه");
|
||||||
|
if (!isMachMobilAndNationalCode.IsMatched)
|
||||||
|
return op.Failed("شماره همراه وارد شده با کد ملی مطابقت ندارد");
|
||||||
|
|
||||||
contractingParty.Authentication(apiResponsParty.BasicInformation.FirstName, apiResponsParty.BasicInformation.LastName,
|
contractingParty.Authentication(apiResponsParty.BasicInformation.FirstName, apiResponsParty.BasicInformation.LastName,
|
||||||
apiResponsParty.BasicInformation.FatherName,idNumberParty,apiResponsParty.IdentificationInformation.ShenasnameSeri,
|
apiResponsParty.BasicInformation.FatherName,idNumberParty,apiResponsParty.IdentificationInformation.ShenasnameSeri,
|
||||||
apiResponsParty.IdentificationInformation.ShenasnameSerial,dateOfBirth,apiResponsParty.BasicInformation.GenderEnum,
|
apiResponsParty.IdentificationInformation.ShenasnameSerial,dateOfBirth,apiResponsParty.BasicInformation.GenderEnum,
|
||||||
@@ -147,12 +149,11 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
|||||||
|
|
||||||
|
|
||||||
await _contractingPartyTempRepository.SaveChangesAsync();
|
await _contractingPartyTempRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if (contractingParty.Phone != mobile)
|
if (contractingParty.Phone != mobile)
|
||||||
return op.Failed("شما قبلا با شماره همراه دیگری احراز هویت شده اید");
|
return op.Failed("شما قبلا با شماره همراه دیگری احراز هویت شده اید");
|
||||||
|
|
||||||
|
|
||||||
result.Id = contractingParty.id;
|
result.Id = contractingParty.id;
|
||||||
result.FName = contractingParty.FName;
|
result.FName = contractingParty.FName;
|
||||||
result.LName = contractingParty.LName;
|
result.LName = contractingParty.LName;
|
||||||
@@ -206,7 +207,7 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
|||||||
if (apiRespons == null)
|
if (apiRespons == null)
|
||||||
throw new InternalServerException("خطا در سرویس احراز هویت");
|
throw new InternalServerException("خطا در سرویس احراز هویت");
|
||||||
|
|
||||||
if (apiRespons.ResponseContext.Status.Code == 14)
|
if (apiRespons.ResponseContext.Status.Code is 14 or 3)
|
||||||
throw new InternalServerException("سیستم احراز هویت در دسترس نمی باشد");
|
throw new InternalServerException("سیستم احراز هویت در دسترس نمی باشد");
|
||||||
|
|
||||||
if (apiRespons.ResponseContext.Status.Code == 2)
|
if (apiRespons.ResponseContext.Status.Code == 2)
|
||||||
@@ -239,6 +240,8 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
|||||||
result.IdNumberSerial = createTemp.IdNumberSerial;
|
result.IdNumberSerial = createTemp.IdNumberSerial;
|
||||||
result.IdNumber = idNumber;
|
result.IdNumber = idNumber;
|
||||||
result.NationalCode = createTemp.NationalCode;
|
result.NationalCode = createTemp.NationalCode;
|
||||||
|
result.Phone = createTemp.Phone;
|
||||||
|
result.IdNumberSeri = createTemp.IdNumberSeri;
|
||||||
|
|
||||||
|
|
||||||
return op.Succcedded(result);
|
return op.Succcedded(result);
|
||||||
|
|||||||
11347
CompanyManagment.EFCore/Migrations/20251129103132_add discount to institutioncontract.Designer.cs
generated
Normal file
11347
CompanyManagment.EFCore/Migrations/20251129103132_add discount to institutioncontract.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,40 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace CompanyManagment.EFCore.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class adddiscounttoinstitutioncontract : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<double>(
|
||||||
|
name: "DiscountAmount",
|
||||||
|
table: "InstitutionContracts",
|
||||||
|
type: "float",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0.0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "DiscountPercentage",
|
||||||
|
table: "InstitutionContracts",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "DiscountAmount",
|
||||||
|
table: "InstitutionContracts");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "DiscountPercentage",
|
||||||
|
table: "InstitutionContracts");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3265,6 +3265,12 @@ namespace CompanyManagment.EFCore.Migrations
|
|||||||
.HasMaxLength(10000)
|
.HasMaxLength(10000)
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<double>("DiscountAmount")
|
||||||
|
.HasColumnType("float");
|
||||||
|
|
||||||
|
b.Property<int>("DiscountPercentage")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.Property<string>("EmployeeManualCount")
|
b.Property<string>("EmployeeManualCount")
|
||||||
.HasMaxLength(10)
|
.HasMaxLength(10)
|
||||||
.HasColumnType("nvarchar(10)");
|
.HasColumnType("nvarchar(10)");
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -4724,6 +4724,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
|||||||
|
|
||||||
#region KebabMahdiAbsentsCaclculation
|
#region KebabMahdiAbsentsCaclculation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var rollCallDays = groupedRollCall.Count > mandatoryDays ? mandatoryDays : groupedRollCall.Count;
|
var rollCallDays = groupedRollCall.Count > mandatoryDays ? mandatoryDays : groupedRollCall.Count;
|
||||||
|
|
||||||
absenceDays = mandatoryDays - rollCallDays;
|
absenceDays = mandatoryDays - rollCallDays;
|
||||||
@@ -5109,6 +5111,45 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region اگر که پرسنل در روز های جمعه یا پنجشنبه غیبت داشت یک روز به غیبت اضافه شود
|
||||||
|
//این منطق زمانی برقرار هست که مرخصی در اون روز نداشته باشه
|
||||||
|
|
||||||
|
// ساخت لیست روزهای بین شروع و پایان قرارداد
|
||||||
|
var contractDaysList = Enumerable.Range(0, (contractEnd - contractStart).Days + 1)
|
||||||
|
.Select(offset => contractStart.AddDays(offset))
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
// کم کردن روزهایی که حضور دارند
|
||||||
|
var absentDaysList = contractDaysList
|
||||||
|
.Where(date => !groupedRollCall.Any(g => g.ShiftDate.Date == date.Date))
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
var absentFridaysOrThursdays = absentDaysList
|
||||||
|
.Where(date => date.DayOfWeek is DayOfWeek.Friday or DayOfWeek.Thursday)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
var leaveList = _context.LeaveList
|
||||||
|
.Where(x => x.EmployeeId == employeeId
|
||||||
|
&& x.WorkshopId == workshopId
|
||||||
|
&& x.IsAccepted == true
|
||||||
|
&& x.StartLeave <= contractEnd
|
||||||
|
&& x.EndLeave >= contractStart
|
||||||
|
&& x.LeaveType == "استحقاقی"
|
||||||
|
&& x.PaidLeaveType =="روزانه")
|
||||||
|
.Select(x => new { x.StartLeave, x.EndLeave })
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
// بررسی کدام روزهای غایب جمعه/پنجشنبه در بازه مرخصی قرار ندارند
|
||||||
|
var absentFridaysOrThursdaysWithoutLeave = absentFridaysOrThursdays
|
||||||
|
.Where(date => !leaveList.Any(leave => date.Date >= leave.StartLeave.Date && date.Date <= leave.EndLeave.Date))
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
// تعداد روزهای غایب جمعه/پنجشنبه بدون مرخصی
|
||||||
|
int absentFridaysOrThursdaysWithoutLeaveCount = absentFridaysOrThursdaysWithoutLeave.Count;
|
||||||
|
|
||||||
|
absentsDeductionAmount += absentFridaysOrThursdaysWithoutLeaveCount * dailyWage;
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
return new CustomizeCheckoutMandatoryViewModel
|
return new CustomizeCheckoutMandatoryViewModel
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,12 +24,13 @@ public class UidService : IUidService
|
|||||||
public const string BusinessId = "98ed67ca-d441-4978-a748-e8bebce010eb";
|
public const string BusinessId = "98ed67ca-d441-4978-a748-e8bebce010eb";
|
||||||
|
|
||||||
|
|
||||||
public UidService(IAuthorizedPersonApplication authorizedPersonApplication, IAuthorizedBankDetailsApplication authorizedBankDetailsApplication)
|
public UidService(IAuthorizedPersonApplication authorizedPersonApplication,
|
||||||
|
IAuthorizedBankDetailsApplication authorizedBankDetailsApplication)
|
||||||
{
|
{
|
||||||
_httpClient = new HttpClient()
|
_httpClient = new HttpClient()
|
||||||
{
|
{
|
||||||
BaseAddress = new Uri(BaseUrl),
|
BaseAddress = new Uri(BaseUrl),
|
||||||
Timeout = new TimeSpan(0, 0, 12)
|
Timeout = new TimeSpan(0, 0, 20)
|
||||||
};
|
};
|
||||||
_authorizedPersonApplication = authorizedPersonApplication;
|
_authorizedPersonApplication = authorizedPersonApplication;
|
||||||
_authorizedBankDetailsApplication = authorizedBankDetailsApplication;
|
_authorizedBankDetailsApplication = authorizedBankDetailsApplication;
|
||||||
@@ -41,12 +42,14 @@ public class UidService : IUidService
|
|||||||
var existingPerson = _authorizedPersonApplication.GetByNationalCode(nationalCode);
|
var existingPerson = _authorizedPersonApplication.GetByNationalCode(nationalCode);
|
||||||
if (existingPerson != null)
|
if (existingPerson != null)
|
||||||
{
|
{
|
||||||
if (birthDate !=existingPerson.BirthDate )
|
if (birthDate != existingPerson.BirthDate)
|
||||||
{
|
{
|
||||||
return new PersonalInfoResponse(new UidBasicInformation(),
|
return new PersonalInfoResponse(new UidBasicInformation(),
|
||||||
new IdentificationInformation(default, default, default, default, default), new RegistrationStatus(),
|
new IdentificationInformation(default, default, default, default, default),
|
||||||
|
new RegistrationStatus(),
|
||||||
new ResponseContext(new UidStatus(13, "تاریخ تولد وارد با کد ملی تطابق ندارد")));
|
new ResponseContext(new UidStatus(13, "تاریخ تولد وارد با کد ملی تطابق ندارد")));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return data from database instead of calling API
|
// Return data from database instead of calling API
|
||||||
return CreatePersonalInfoResponseFromDatabase(existingPerson);
|
return CreatePersonalInfoResponseFromDatabase(existingPerson);
|
||||||
}
|
}
|
||||||
@@ -67,13 +70,23 @@ public class UidService : IUidService
|
|||||||
|
|
||||||
if (!requestResult.IsSuccessStatusCode)
|
if (!requestResult.IsSuccessStatusCode)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<PersonalInfoResponse>();
|
var responseResult = await requestResult.Content.ReadFromJsonAsync<PersonalInfoResponse>();
|
||||||
|
|
||||||
if (responseResult.BasicInformation != null)
|
if (responseResult.BasicInformation != null)
|
||||||
{
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(responseResult.BasicInformation.FirstName))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
responseResult.BasicInformation.FirstName = responseResult.BasicInformation.FirstName?.ToPersian();
|
responseResult.BasicInformation.FirstName = responseResult.BasicInformation.FirstName?.ToPersian();
|
||||||
responseResult.BasicInformation.LastName = responseResult.BasicInformation.LastName?.ToPersian();
|
responseResult.BasicInformation.LastName = responseResult.BasicInformation.LastName?.ToPersian();
|
||||||
responseResult.BasicInformation.FatherName = responseResult.BasicInformation.FatherName?.ToPersian();
|
responseResult.BasicInformation.FatherName = responseResult.BasicInformation.FatherName?.ToPersian();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// ذخیره اطلاعات در جدول AuthorizedPerson
|
// ذخیره اطلاعات در جدول AuthorizedPerson
|
||||||
await SaveAuthorizedPersonData(responseResult, nationalCode, birthDate);
|
await SaveAuthorizedPersonData(responseResult, nationalCode, birthDate);
|
||||||
@@ -138,7 +151,8 @@ public class UidService : IUidService
|
|||||||
_authorizedPersonApplication.CreateFromUidResponse(command);
|
_authorizedPersonApplication.CreateFromUidResponse(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<MatchMobileWithNationalCodeResponse> IsMachPhoneWithNationalCode(string nationalCode, string phoneNumber)
|
public async Task<MatchMobileWithNationalCodeResponse> IsMachPhoneWithNationalCode(string nationalCode,
|
||||||
|
string phoneNumber)
|
||||||
{
|
{
|
||||||
var request = new PersonalInfoRequest
|
var request = new PersonalInfoRequest
|
||||||
{
|
{
|
||||||
@@ -189,7 +203,7 @@ public class UidService : IUidService
|
|||||||
IBan = iban,
|
IBan = iban,
|
||||||
AccountNumber = responseResult?.AccountBasicInformation?.AccountNumber ?? "",
|
AccountNumber = responseResult?.AccountBasicInformation?.AccountNumber ?? "",
|
||||||
BankName = responseResult?.AccountBasicInformation?.BankInformation?.BankName ?? "",
|
BankName = responseResult?.AccountBasicInformation?.BankInformation?.BankName ?? "",
|
||||||
OwnersList = responseResult?.Owners.Select(x=> new CreateAuthorizedBankDetailsOwner()
|
OwnersList = responseResult?.Owners.Select(x => new CreateAuthorizedBankDetailsOwner()
|
||||||
{
|
{
|
||||||
FName = x.FirstName,
|
FName = x.FirstName,
|
||||||
LName = x.LastName,
|
LName = x.LastName,
|
||||||
|
|||||||
88
ServiceHost/Areas/Admin/Controllers/CountController.cs
Normal file
88
ServiceHost/Areas/Admin/Controllers/CountController.cs
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
using _0_Framework.Application;
|
||||||
|
using AccountManagement.Application.Contracts.Task;
|
||||||
|
using AccountManagement.Application.Contracts.Ticket;
|
||||||
|
using Company.Domain.WorkshopAccountAgg;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using ServiceHost.BaseControllers;
|
||||||
|
using WorkFlow.Application.Contracts.AdminWorkFlow;
|
||||||
|
|
||||||
|
namespace ServiceHost.Areas.Admin.Controllers;
|
||||||
|
|
||||||
|
public class CountController : AdminBaseController
|
||||||
|
{
|
||||||
|
private readonly IAuthHelper _authHelper;
|
||||||
|
private readonly IWorkshopAccountRepository _workshopAccountRepository;
|
||||||
|
private readonly IAdminWorkFlowApplication _adminWorkFlowApplication;
|
||||||
|
private readonly ITicketApplication _ticketApplication;
|
||||||
|
private readonly ITaskApplication _taskApplication;
|
||||||
|
private long _roleId;
|
||||||
|
|
||||||
|
public CountController(
|
||||||
|
IAuthHelper authHelper,
|
||||||
|
IWorkshopAccountRepository workshopAccountRepository,
|
||||||
|
IAdminWorkFlowApplication adminWorkFlowApplication,
|
||||||
|
ITicketApplication ticketApplication,
|
||||||
|
ITaskApplication taskApplication)
|
||||||
|
{
|
||||||
|
_authHelper = authHelper;
|
||||||
|
_workshopAccountRepository = workshopAccountRepository;
|
||||||
|
_ticketApplication = ticketApplication;
|
||||||
|
_taskApplication = taskApplication;
|
||||||
|
_adminWorkFlowApplication = adminWorkFlowApplication;
|
||||||
|
_roleId = authHelper.CurrentAccountInfo().RoleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("task")]
|
||||||
|
public async Task<IActionResult> GetTaskCount()
|
||||||
|
{
|
||||||
|
var currentAccountId = _authHelper.CurrentAccountId();
|
||||||
|
int taskCount = await _taskApplication.RequestedAndOverdueTasksCount(currentAccountId);
|
||||||
|
|
||||||
|
return Ok(new
|
||||||
|
{
|
||||||
|
success = true,
|
||||||
|
data = taskCount
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("ticket")]
|
||||||
|
public IActionResult GetTicketCount()
|
||||||
|
{
|
||||||
|
int ticketCount = _ticketApplication.GetAdminTicketsCount();
|
||||||
|
|
||||||
|
return Ok(new
|
||||||
|
{
|
||||||
|
success = true,
|
||||||
|
data = ticketCount
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("workflow")]
|
||||||
|
public async Task<IActionResult> GetWorkFlowCount()
|
||||||
|
{
|
||||||
|
var currentAccountId = _authHelper.CurrentAccountId();
|
||||||
|
var accountWorkshops = _workshopAccountRepository.GetList(currentAccountId).Select(x => x.WorkshopId).ToList();
|
||||||
|
var permissions = _authHelper.GetPermissions();
|
||||||
|
|
||||||
|
int workFlowCount = await _adminWorkFlowApplication.GetWorkFlowCountsForAdmin(accountWorkshops, currentAccountId, _roleId, permissions);
|
||||||
|
|
||||||
|
return Ok(new
|
||||||
|
{
|
||||||
|
success = true,
|
||||||
|
data = workFlowCount
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("checker")]
|
||||||
|
public async Task<IActionResult> GetCheckerCount()
|
||||||
|
{
|
||||||
|
int checkerCount = await _adminWorkFlowApplication.GetWorkFlowCountForChecker();
|
||||||
|
|
||||||
|
return Ok(new
|
||||||
|
{
|
||||||
|
success = true,
|
||||||
|
data = checkerCount
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -451,8 +451,19 @@ public class institutionContractController : AdminBaseController
|
|||||||
|
|
||||||
return operationResult;
|
return operationResult;
|
||||||
}
|
}
|
||||||
|
[HttpPost("create/set-discount")]
|
||||||
|
public ActionResult<InstitutionContractDiscountResponse> SetDiscountForInstitutionContract([FromBody]InstitutionContractSetDiscountRequest request)
|
||||||
|
{
|
||||||
|
var res = _institutionContractApplication.CalculateDiscount(request);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost("create/reset-discount")]
|
||||||
|
public ActionResult<InstitutionContractDiscountResponse> ResetDiscountForCreate([FromBody]InstitutionContractResetDiscountForCreateRequest request)
|
||||||
|
{
|
||||||
|
var res = _institutionContractApplication.ResetDiscountCreate(request);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -546,6 +557,20 @@ public class institutionContractController : AdminBaseController
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpPost("extension/set-discount")]
|
||||||
|
public async Task<ActionResult<InstitutionContractDiscountResponse>> SetDiscountForExtension([FromBody]InstitutionContractSetDiscountForExtensionRequest request)
|
||||||
|
{
|
||||||
|
var res =await _institutionContractApplication.SetDiscountForExtension(request);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost("extension/reset-discount")]
|
||||||
|
public async Task<ActionResult<InstitutionContractDiscountResponse>> ResetDiscountForExtension([FromBody]InstitutionContractResetDiscountForExtensionRequest request)
|
||||||
|
{
|
||||||
|
var res =await _institutionContractApplication.ResetDiscountForExtension(request);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
[HttpPost("extenstion/complete")]
|
[HttpPost("extenstion/complete")]
|
||||||
public async Task<ActionResult<OperationResult>> ExtensionComplete([FromBody]InstitutionContractExtensionCompleteRequest request)
|
public async Task<ActionResult<OperationResult>> ExtensionComplete([FromBody]InstitutionContractExtensionCompleteRequest request)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -507,6 +507,13 @@
|
|||||||
</svg>
|
</svg>
|
||||||
لیست تراکنش های درگاه پرداخت
|
لیست تراکنش های درگاه پرداخت
|
||||||
</a></li>
|
</a></li>
|
||||||
|
<li permission="307" style=";white-space: nowrap">
|
||||||
|
<a class="clik10 " href="https://admin@(AppSetting.Value.Domain)/account-number-database" style="width: 7px;margin: 0 6px;">
|
||||||
|
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
||||||
|
</svg>
|
||||||
|
اطلاعات بانکی طرف حساب
|
||||||
|
</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ using Parbad;
|
|||||||
using Parbad.AspNetCore;
|
using Parbad.AspNetCore;
|
||||||
using Parbad.Gateway.Sepehr;
|
using Parbad.Gateway.Sepehr;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using _0_Framework.Application.Enums;
|
||||||
using CompanyManagement.Infrastructure.Excel.WorkshopsRollCall;
|
using CompanyManagement.Infrastructure.Excel.WorkshopsRollCall;
|
||||||
using static ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk.IndexModel2;
|
using static ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk.IndexModel2;
|
||||||
|
|
||||||
@@ -46,7 +47,6 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
|||||||
private readonly IOnlinePayment _onlinePayment;
|
private readonly IOnlinePayment _onlinePayment;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[BindProperty] public IFormFile File { get; set; }
|
[BindProperty] public IFormFile File { get; set; }
|
||||||
|
|
||||||
[BindProperty]
|
[BindProperty]
|
||||||
@@ -58,6 +58,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
|||||||
[Required(ErrorMessage = "لطفا کد ورژن را وارد کنید")]
|
[Required(ErrorMessage = "لطفا کد ورژن را وارد کنید")]
|
||||||
[Display(Name = "کد ورژن")]
|
[Display(Name = "کد ورژن")]
|
||||||
public string VersionCode { get; set; }
|
public string VersionCode { get; set; }
|
||||||
|
|
||||||
[BindProperty] public ApkType SelectedApkType { get; set; }
|
[BindProperty] public ApkType SelectedApkType { get; set; }
|
||||||
[BindProperty] public bool IsForce { get; set; }
|
[BindProperty] public bool IsForce { get; set; }
|
||||||
|
|
||||||
@@ -82,7 +83,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
|||||||
|
|
||||||
public async Task<IActionResult> OnPostUpload()
|
public async Task<IActionResult> OnPostUpload()
|
||||||
{
|
{
|
||||||
var result = await _application.CreateAndActive(File,SelectedApkType, VersionName, VersionCode, IsForce);
|
var result = await _application.CreateAndActive(File, SelectedApkType, VersionName, VersionCode, IsForce);
|
||||||
ViewData["message"] = result.Message;
|
ViewData["message"] = result.Message;
|
||||||
return Page();
|
return Page();
|
||||||
}
|
}
|
||||||
@@ -103,7 +104,8 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
|||||||
|
|
||||||
|
|
||||||
var amount = 10000;
|
var amount = 10000;
|
||||||
var transaction = new PaymentTransaction(30427, amount, "سید حسن مصباح", "https://client.gozareshgir.ir", PaymentTransactionGateWay.SepehrPay);
|
var transaction = new PaymentTransaction(30427, amount, "سید حسن مصباح", "https://client.gozareshgir.ir",
|
||||||
|
PaymentTransactionGateWay.SepehrPay);
|
||||||
|
|
||||||
_context.PaymentTransactions.Add(transaction);
|
_context.PaymentTransactions.Add(transaction);
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
@@ -132,21 +134,9 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<IActionResult> OnPostShiftDateNew()
|
||||||
public IActionResult OnPostShiftDateNew()
|
|
||||||
{
|
{
|
||||||
var startRollCall = new DateTime(2025, 4, 21);
|
await UpdateInstitutionContract();
|
||||||
//var employees = _context.CustomizeWorkshopEmployeeSettings
|
|
||||||
// .Where(x => x.WorkshopShiftStatus == WorkshopShiftStatus.Rotating).Select(x => x.EmployeeId).ToList();
|
|
||||||
|
|
||||||
var rollCalls = _context.RollCalls.Where(x => x.ShiftDate >= startRollCall && x.EndDate != null).ToList();
|
|
||||||
var r1 = rollCalls.ToList();
|
|
||||||
|
|
||||||
Console.ForegroundColor = ConsoleColor.DarkRed;
|
|
||||||
Console.WriteLine("endStep 1 ============");
|
|
||||||
SetBreakTime(r1);
|
|
||||||
|
|
||||||
|
|
||||||
ViewData["message"] = "تومام یک";
|
ViewData["message"] = "تومام یک";
|
||||||
return Page();
|
return Page();
|
||||||
}
|
}
|
||||||
@@ -169,20 +159,21 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
|||||||
.ThenInclude(x => x.LeftWorks)
|
.ThenInclude(x => x.LeftWorks)
|
||||||
.Include(x => x.Workshop)
|
.Include(x => x.Workshop)
|
||||||
.ThenInclude(x => x.WorkshopEmployers)
|
.ThenInclude(x => x.WorkshopEmployers)
|
||||||
.ThenInclude(x=>x.Employer)
|
.ThenInclude(x => x.Employer)
|
||||||
.Select(x => new WorkshopRollCallExcelViewModel()
|
.Select(x => new WorkshopRollCallExcelViewModel()
|
||||||
{
|
{
|
||||||
EmployerName = x.Workshop.WorkshopEmployers.First().Employer.FullName,
|
EmployerName = x.Workshop.WorkshopEmployers.First().Employer.FullName,
|
||||||
IsActive = x.IsActiveString == "true",
|
IsActive = x.IsActiveString == "true",
|
||||||
PersonnelCount = x.Workshop.LeftWorks.Count(l => l.StartWorkDate <= now && l.LeftWorkDate >= now),
|
PersonnelCount = x.Workshop.LeftWorks.Count(l => l.StartWorkDate <= now && l.LeftWorkDate >= now),
|
||||||
WorkshopName = x.Workshop.WorkshopFullName
|
WorkshopName = x.Workshop.WorkshopFullName
|
||||||
}).OrderByDescending(x=>x.IsActive).ToList();
|
}).OrderByDescending(x => x.IsActive).ToList();
|
||||||
var dataBytes = WorkshopRollCallExcelExporter.Export(data);
|
var dataBytes = WorkshopRollCallExcelExporter.Export(data);
|
||||||
return File(dataBytes, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
return File(dataBytes, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||||
"RollCallServices.xlsx");
|
"RollCallServices.xlsx");
|
||||||
ViewData["message"] = "تومام دو";
|
ViewData["message"] = "تومام دو";
|
||||||
return Page();
|
return Page();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async System.Threading.Tasks.Task CreateDadmehrWorkshopFaceEmbedding()
|
private async System.Threading.Tasks.Task CreateDadmehrWorkshopFaceEmbedding()
|
||||||
{
|
{
|
||||||
var basePath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "faces");
|
var basePath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "faces");
|
||||||
@@ -820,7 +811,10 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
|||||||
{
|
{
|
||||||
var today = DateTime.Today;
|
var today = DateTime.Today;
|
||||||
var transaction = await _context.Database.BeginTransactionAsync();
|
var transaction = await _context.Database.BeginTransactionAsync();
|
||||||
|
|
||||||
var query = _context.InstitutionContractSet
|
var query = _context.InstitutionContractSet
|
||||||
|
.Where(a => a.VerifyCode == null
|
||||||
|
&& a.PublicId == Guid.Empty)
|
||||||
.Include(x => x.WorkshopGroup)
|
.Include(x => x.WorkshopGroup)
|
||||||
.Join(_context.PersonalContractingParties
|
.Join(_context.PersonalContractingParties
|
||||||
.Include(x => x.Employers)
|
.Include(x => x.Employers)
|
||||||
@@ -854,13 +848,17 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
|||||||
var personnelCount =
|
var personnelCount =
|
||||||
w.LeftWorks.Count(lw => lw.StartWorkDate <= today && lw.LeftWorkDate >= today);
|
w.LeftWorks.Count(lw => lw.StartWorkDate <= today && lw.LeftWorkDate >= today);
|
||||||
|
|
||||||
|
var rollCallService = _context.RollCallServices
|
||||||
|
.Where(x => x.WorkshopId == w.id)
|
||||||
|
.ToList().MaxBy(x => x.StartService);
|
||||||
|
|
||||||
var calculation = _clientRegistrationApplication
|
var calculation = _clientRegistrationApplication
|
||||||
.GetInstitutionPlanForWorkshop(new WorkshopTempViewModel()
|
.GetInstitutionPlanForWorkshop(new WorkshopTempViewModel()
|
||||||
{
|
{
|
||||||
CustomizeCheckout = false,
|
CustomizeCheckout = false,
|
||||||
Insurance = true,
|
Insurance = true,
|
||||||
InsuranceInPerson = false,
|
InsuranceInPerson = false,
|
||||||
RollCall = true,
|
RollCall = rollCallService != null,
|
||||||
WorkshopName = "",
|
WorkshopName = "",
|
||||||
ContractAndCheckout = true,
|
ContractAndCheckout = true,
|
||||||
ContractAndCheckoutInPerson = false,
|
ContractAndCheckoutInPerson = false,
|
||||||
@@ -915,14 +913,19 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
|||||||
.SelectMany(e => e.WorkshopEmployers.Select(we => we.Workshop)).ToList()
|
.SelectMany(e => e.WorkshopEmployers.Select(we => we.Workshop)).ToList()
|
||||||
.DistinctBy(x => x.id).ToList();
|
.DistinctBy(x => x.id).ToList();
|
||||||
|
|
||||||
|
|
||||||
var initialWorkshop = workshops
|
var initialWorkshop = workshops
|
||||||
.Select(w =>
|
.Select(w =>
|
||||||
{
|
{
|
||||||
var personnelCount =
|
var personnelCount =
|
||||||
w.LeftWorks.Count(lw => lw.StartWorkDate <= today && lw.LeftWorkDate >= today);
|
w.LeftWorks.Count(lw => lw.StartWorkDate <= today && lw.LeftWorkDate >= today);
|
||||||
|
|
||||||
bool hasRollCallPlan = true;
|
var rollCallService = _context.RollCallServices
|
||||||
bool hasRollCallPlanInPerson = false;
|
.Where(x => x.WorkshopId == w.id)
|
||||||
|
.ToList().MaxBy(x => x.StartService);
|
||||||
|
|
||||||
|
bool hasRollCallPlan = rollCallService != null;
|
||||||
|
bool hasRollCallPlanInPerson = rollCallService != null;
|
||||||
bool hasCustomizeCheckoutPlan = w.id == 170;
|
bool hasCustomizeCheckoutPlan = w.id == 170;
|
||||||
bool hasContractPlan = true;
|
bool hasContractPlan = true;
|
||||||
bool hasContractPlanInPerson = true;
|
bool hasContractPlanInPerson = true;
|
||||||
|
|||||||
@@ -136,6 +136,9 @@
|
|||||||
<div class="card-title">قرارداد های مالی</div>
|
<div class="card-title">قرارداد های مالی</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="countNumber" id="InstitutionContractCount">
|
||||||
|
<span></span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="spinner-loading loading" style="display: none;">
|
<div class="spinner-loading loading" style="display: none;">
|
||||||
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
|
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
|
||||||
@@ -192,6 +195,7 @@
|
|||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
workFlowStartAndLeftWorkCountMenu();
|
workFlowStartAndLeftWorkCountMenu();
|
||||||
|
getInstitutionContractCount();
|
||||||
|
|
||||||
$('.loadingButton').on('click', function (e) {
|
$('.loadingButton').on('click', function (e) {
|
||||||
if (e.ctrlKey || e.metaKey) {
|
if (e.ctrlKey || e.metaKey) {
|
||||||
@@ -235,5 +239,29 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getInstitutionContractCount() {
|
||||||
|
$.ajax({
|
||||||
|
async: true,
|
||||||
|
dataType: 'json',
|
||||||
|
url: `@Url.Page("./Index", "InstitutionContractCount")`,
|
||||||
|
headers: { "RequestVerificationToken": antiForgeryTokenLayout },
|
||||||
|
type: 'GET',
|
||||||
|
success: function (response) {
|
||||||
|
if (response.success) {
|
||||||
|
if (response.dataInstitutionContractCount === 0) {
|
||||||
|
$('#InstitutionContractCount').hide();
|
||||||
|
} else {
|
||||||
|
$('#InstitutionContractCount').show();
|
||||||
|
var contractCount = response.dataInstitutionContractCount > 99 ? "+99" : response.dataInstitutionContractCount;
|
||||||
|
$('#InstitutionContractCount span').text(contractCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function (xhr, status, error) {
|
||||||
|
console.error(xhr.responseText);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using _0_Framework.Application;
|
using _0_Framework.Application;
|
||||||
using Company.Domain.WorkshopAccountAgg;
|
using Company.Domain.WorkshopAccountAgg;
|
||||||
|
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||||
using CompanyManagment.App.Contracts.RollCallService;
|
using CompanyManagment.App.Contracts.RollCallService;
|
||||||
using CompanyManagment.App.Contracts.Workshop;
|
using CompanyManagment.App.Contracts.Workshop;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
@@ -18,13 +19,15 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.WorkFlow
|
|||||||
private readonly IAuthHelper _authHelper;
|
private readonly IAuthHelper _authHelper;
|
||||||
private readonly IWorkshopAccountRepository _workshopAccountRepository;
|
private readonly IWorkshopAccountRepository _workshopAccountRepository;
|
||||||
public int EmployeeDocumentsAwaitingSubmitCount;
|
public int EmployeeDocumentsAwaitingSubmitCount;
|
||||||
|
private readonly IInstitutionContractApplication _institutionContractApplication;
|
||||||
private readonly long _roleId;
|
private readonly long _roleId;
|
||||||
|
|
||||||
public IndexModel(IAdminWorkFlowApplication adminWorkFlowApplication, IAuthHelper authHelper, IWorkshopAccountRepository workshopAccountRepository)
|
public IndexModel(IAdminWorkFlowApplication adminWorkFlowApplication, IAuthHelper authHelper, IWorkshopAccountRepository workshopAccountRepository, IInstitutionContractApplication institutionContractApplication)
|
||||||
{
|
{
|
||||||
_adminWorkFlowApplication = adminWorkFlowApplication;
|
_adminWorkFlowApplication = adminWorkFlowApplication;
|
||||||
_authHelper = authHelper;
|
_authHelper = authHelper;
|
||||||
_workshopAccountRepository = workshopAccountRepository;
|
_workshopAccountRepository = workshopAccountRepository;
|
||||||
|
_institutionContractApplication = institutionContractApplication;
|
||||||
_roleId = authHelper.CurrentAccountInfo().RoleId;
|
_roleId = authHelper.CurrentAccountInfo().RoleId;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -49,5 +52,27 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.WorkFlow
|
|||||||
dataLeftWorkCount = resultLeftWorkCount,
|
dataLeftWorkCount = resultLeftWorkCount,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<IActionResult> OnGetInstitutionContractCount()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var institutionContractCount = (await _institutionContractApplication.RegistrationWorkflowMainList()).Count;
|
||||||
|
|
||||||
|
return new JsonResult(new
|
||||||
|
{
|
||||||
|
success = true,
|
||||||
|
dataInstitutionContractCount = institutionContractCount
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return new JsonResult(new
|
||||||
|
{
|
||||||
|
success = false,
|
||||||
|
message = ex.Message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,7 +99,9 @@ namespace ServiceHost.Areas.AdminNew.Pages
|
|||||||
{
|
{
|
||||||
var currentAccountId = _authHelper.CurrentAccountId();
|
var currentAccountId = _authHelper.CurrentAccountId();
|
||||||
var accountWorkshops = _workshopAccountRepository.GetList(currentAccountId).Select(x => x.WorkshopId).ToList();
|
var accountWorkshops = _workshopAccountRepository.GetList(currentAccountId).Select(x => x.WorkshopId).ToList();
|
||||||
int workFlowCount = await _adminWorkFlowApplication.GetWorkFlowCountsForAdmin(accountWorkshops,currentAccountId, _roleId);
|
var permissions = _authHelper.GetPermissions();
|
||||||
|
|
||||||
|
int workFlowCount = await _adminWorkFlowApplication.GetWorkFlowCountsForAdmin(accountWorkshops,currentAccountId, _roleId,permissions);
|
||||||
|
|
||||||
|
|
||||||
return new JsonResult(new
|
return new JsonResult(new
|
||||||
|
|||||||
@@ -655,6 +655,13 @@
|
|||||||
</svg>
|
</svg>
|
||||||
لیست تراکنش های درگاه پرداخت
|
لیست تراکنش های درگاه پرداخت
|
||||||
</a></li>
|
</a></li>
|
||||||
|
<li permission="307" style=";white-space: nowrap">
|
||||||
|
<a class="clik10 " href="https://admin@(AppSetting.Value.Domain)/account-number-database" style="width: 7px;margin: 0 6px;">
|
||||||
|
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
||||||
|
</svg>
|
||||||
|
اطلاعات بانکی طرف حساب
|
||||||
|
</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
56
ServiceHost/Areas/Client/Controllers/DashboardController.cs
Normal file
56
ServiceHost/Areas/Client/Controllers/DashboardController.cs
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
using _0_Framework.Application;
|
||||||
|
using CompanyManagment.App.Contracts.ClientDashboard;
|
||||||
|
using CompanyManagment.App.Contracts.Holiday;
|
||||||
|
using CompanyManagment.App.Contracts.HolidayItem;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using PersianTools.Core;
|
||||||
|
using ServiceHost.BaseControllers;
|
||||||
|
|
||||||
|
namespace ServiceHost.Areas.Client.Controllers;
|
||||||
|
public record ClientDashboardViewModel(List<CalenderViewModel> Calender, int Year,string Month,int Day,string DayOfWeek);
|
||||||
|
|
||||||
|
public class DashboardController:ClientBaseController
|
||||||
|
{
|
||||||
|
private readonly IHolidayItemApplication _holidayItemApplication;
|
||||||
|
|
||||||
|
public DashboardController(IHolidayItemApplication holidayItemApplication)
|
||||||
|
{
|
||||||
|
_holidayItemApplication = holidayItemApplication;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public ActionResult<ClientDashboardViewModel> Index()
|
||||||
|
{
|
||||||
|
var calenderList = new List<CalenderViewModel>();
|
||||||
|
|
||||||
|
var todayGr = DateTime.Today;
|
||||||
|
var todayFa = todayGr.ToFarsi();
|
||||||
|
|
||||||
|
var todayPersian = new PersianDateTime(
|
||||||
|
int.Parse(todayFa.Substring(0, 4)),
|
||||||
|
int.Parse(todayFa.Substring(5, 2)),
|
||||||
|
int.Parse(todayFa.Substring(8, 2))
|
||||||
|
);
|
||||||
|
|
||||||
|
var startDate =new PersianDateTime(todayGr.AddDays(-3));
|
||||||
|
var endDate =new PersianDateTime(todayGr.AddDays(3));
|
||||||
|
|
||||||
|
|
||||||
|
for (var day = startDate; day <= endDate; day = day.AddDays(1))
|
||||||
|
{
|
||||||
|
var calenderNewItem = new CalenderViewModel
|
||||||
|
{
|
||||||
|
DayNumber = day.ToString("dd"),
|
||||||
|
IsToday = day.DateTime == todayGr,
|
||||||
|
DayOfWeek = day.DayOfWeek,
|
||||||
|
Holiday = _holidayItemApplication.IsHoliday(day.ToGregorianDateTime()) || day.DayOfWeek== "جمعه"
|
||||||
|
};
|
||||||
|
calenderList.Add(calenderNewItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return new ClientDashboardViewModel(calenderList, todayPersian.Year,todayPersian.MonthOfYear,todayPersian.Day,todayPersian.DayOfWeek);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ public class GeneralController : GeneralBaseController
|
|||||||
payResponse.cardnumber, payResponse.issuerbank, payResponse.rrn.ToString(),
|
payResponse.cardnumber, payResponse.issuerbank, payResponse.rrn.ToString(),
|
||||||
payResponse.digitalreceipt);
|
payResponse.digitalreceipt);
|
||||||
|
|
||||||
if (financialInvoice.Items?.Any(x => x.Type == FinancialInvoiceItemType.BuyInstitutionContract) ?? false)
|
if (financialInvoice.Items?.Any(x => x.Type is FinancialInvoiceItemType.BuyInstitutionContract or FinancialInvoiceItemType.BuyInstitutionContractInstallment) ?? false)
|
||||||
{
|
{
|
||||||
var financialItems = financialInvoice.Items
|
var financialItems = financialInvoice.Items
|
||||||
.Where(x => x.Type == FinancialInvoiceItemType.BuyInstitutionContract);
|
.Where(x => x.Type == FinancialInvoiceItemType.BuyInstitutionContract);
|
||||||
@@ -158,6 +158,16 @@ public class GeneralController : GeneralBaseController
|
|||||||
{
|
{
|
||||||
await _institutionContractApplication.SetPendingWorkflow(editFinancialInvoiceItem.EntityId);
|
await _institutionContractApplication.SetPendingWorkflow(editFinancialInvoiceItem.EntityId);
|
||||||
}
|
}
|
||||||
|
var financialInstallmentItems = financialInvoice.Items
|
||||||
|
.Where(x => x.Type == FinancialInvoiceItemType.BuyInstitutionContractInstallment);
|
||||||
|
|
||||||
|
foreach (var editFinancialInvoiceItem in financialInstallmentItems)
|
||||||
|
{
|
||||||
|
var institutionContractId =
|
||||||
|
await _institutionContractApplication.GetIdByInstallmentId(
|
||||||
|
editFinancialInvoiceItem.Id);
|
||||||
|
await _institutionContractApplication.SetPendingWorkflow(institutionContractId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!setSuccessResult.IsSuccedded)
|
if (!setSuccessResult.IsSuccedded)
|
||||||
|
|||||||
@@ -17,6 +17,9 @@
|
|||||||
//local
|
//local
|
||||||
"MesbahDb": "Data Source=.;Initial Catalog=mesbah_db;Integrated Security=True;TrustServerCertificate=true;",
|
"MesbahDb": "Data Source=.;Initial Catalog=mesbah_db;Integrated Security=True;TrustServerCertificate=true;",
|
||||||
|
|
||||||
|
//server
|
||||||
|
//"MesbahDb": "Data Source=185.208.175.186;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]18[3019]#@ATt;TrustServerCertificate=true;",
|
||||||
|
|
||||||
//dad-mehr
|
//dad-mehr
|
||||||
//"MesbahDb": "Data Source=.;Initial Catalog=teamWork;Integrated Security=True;TrustServerCertificate=true;",
|
//"MesbahDb": "Data Source=.;Initial Catalog=teamWork;Integrated Security=True;TrustServerCertificate=true;",
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public interface IAdminWorkFlowApplication
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Task<int> GetEmployeeDocumentWorkFlowCountsForAdmin(List<long> workshopIds, long roleId);
|
Task<int> GetEmployeeDocumentWorkFlowCountsForAdmin(List<long> workshopIds, long roleId);
|
||||||
Task<int> GetWorkFlowCountsForAdmin(List<long> workshopIds, long accountId, long roleId);
|
Task<int> GetWorkFlowCountsForAdmin(List<long> workshopIds, long accountId, long roleId, List<int> permissions);
|
||||||
Task<int> GetWorkFlowCountForChecker();
|
Task<int> GetWorkFlowCountForChecker();
|
||||||
|
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ public interface IAdminWorkFlowApplication
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
Task<int> GetInstitutionContractWorkflowCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using CompanyManagment.App.Contracts.Employee;
|
|||||||
using WorkFlow.Application.Contracts.AdminWorkFlow;
|
using WorkFlow.Application.Contracts.AdminWorkFlow;
|
||||||
using WorkFlow.Infrastructure.ACL.Employee;
|
using WorkFlow.Infrastructure.ACL.Employee;
|
||||||
using WorkFlow.Infrastructure.ACL.EmployeeDocuments;
|
using WorkFlow.Infrastructure.ACL.EmployeeDocuments;
|
||||||
|
using WorkFlow.Infrastructure.ACL.InstitutionContract;
|
||||||
using WorkFlow.Infrastructure.ACL.Workshop;
|
using WorkFlow.Infrastructure.ACL.Workshop;
|
||||||
|
|
||||||
namespace WorkFlow.Application
|
namespace WorkFlow.Application
|
||||||
@@ -12,65 +13,76 @@ namespace WorkFlow.Application
|
|||||||
private readonly IWorkFlowEmployeeDocumentsACL _workFlowEmployeeDocumentsACL;
|
private readonly IWorkFlowEmployeeDocumentsACL _workFlowEmployeeDocumentsACL;
|
||||||
private readonly IWorkFlowWorkshopACL _workFlowWorkshopACL;
|
private readonly IWorkFlowWorkshopACL _workFlowWorkshopACL;
|
||||||
private readonly IWorkFlowEmployeeACL _workFlowEmployeeACL;
|
private readonly IWorkFlowEmployeeACL _workFlowEmployeeACL;
|
||||||
|
private readonly IWorkFlowInstitutionContractACL _workFlowInstitutionContractACL;
|
||||||
|
|
||||||
|
|
||||||
public AdminWorkFlowApplication(IWorkFlowEmployeeDocumentsACL workFlowEmployeeDocumentsACL, IWorkFlowWorkshopACL workFlowWorkshopACL, IWorkFlowEmployeeACL workFlowEmployeeACL)
|
public AdminWorkFlowApplication(IWorkFlowEmployeeDocumentsACL workFlowEmployeeDocumentsACL,
|
||||||
|
IWorkFlowWorkshopACL workFlowWorkshopACL, IWorkFlowEmployeeACL workFlowEmployeeACL,
|
||||||
|
IWorkFlowInstitutionContractACL workFlowInstitutionContractACL)
|
||||||
{
|
{
|
||||||
_workFlowEmployeeDocumentsACL = workFlowEmployeeDocumentsACL;
|
_workFlowEmployeeDocumentsACL = workFlowEmployeeDocumentsACL;
|
||||||
_workFlowWorkshopACL = workFlowWorkshopACL;
|
_workFlowWorkshopACL = workFlowWorkshopACL;
|
||||||
_workFlowEmployeeACL = workFlowEmployeeACL;
|
_workFlowEmployeeACL = workFlowEmployeeACL;
|
||||||
|
_workFlowInstitutionContractACL = workFlowInstitutionContractACL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Pooya
|
#region Pooya
|
||||||
|
|
||||||
public List<WorkshopWithDocumentsViewModelForWorkFlow> GetWorkshopDocumentsAwaitingReviewForChecker(List<long> workshops)
|
public List<WorkshopWithDocumentsViewModelForWorkFlow> GetWorkshopDocumentsAwaitingReviewForChecker(
|
||||||
|
List<long> workshops)
|
||||||
{
|
{
|
||||||
return _workFlowEmployeeDocumentsACL.GetWorkshopDocumentsAwaitingReviewForChecker(workshops);
|
return _workFlowEmployeeDocumentsACL.GetWorkshopDocumentsAwaitingReviewForChecker(workshops);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<int> GetEmployeeDocumentWorkFlowCountsForAdmin(List<long> workshopIds, long roleId)
|
||||||
public async Task<int> GetEmployeeDocumentWorkFlowCountsForAdmin(List<long> workshopIds,long roleId)
|
|
||||||
{
|
{
|
||||||
var count = 0;
|
var count = 0;
|
||||||
count += await _workFlowEmployeeDocumentsACL.GetWorkshopDocumentRejectedForAdmin(workshopIds,roleId);
|
count += await _workFlowEmployeeDocumentsACL.GetWorkshopDocumentRejectedForAdmin(workshopIds, roleId);
|
||||||
|
|
||||||
count+= await _workFlowEmployeeDocumentsACL.GetCreatedEmployeesWorkshopDocumentForAdmin(workshopIds,roleId);
|
count += await _workFlowEmployeeDocumentsACL.GetCreatedEmployeesWorkshopDocumentForAdmin(workshopIds,
|
||||||
|
roleId);
|
||||||
|
|
||||||
//count+= await _workFlowEmployeeDocumentsACL.GetClientRejectedDocumentWorkshopsForAdmin(workshopIds, roleId);
|
//count+= await _workFlowEmployeeDocumentsACL.GetClientRejectedDocumentWorkshopsForAdmin(workshopIds, roleId);
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<int> GetWorkFlowCountsForAdmin(List<long> workshopIds, long accountId,long roleId)
|
public async Task<int> GetWorkFlowCountsForAdmin(List<long> workshopIds, long accountId, long roleId,
|
||||||
|
List<int> permissions)
|
||||||
{
|
{
|
||||||
var employeeDocumentWorkFlowCounts = await GetEmployeeDocumentWorkFlowCountsForAdmin(workshopIds, roleId);
|
var employeeDocumentWorkFlowCounts = await GetEmployeeDocumentWorkFlowCountsForAdmin(workshopIds, roleId);
|
||||||
var startWork = await GetWorkshopsForEmployeeStartWorkCount(accountId);
|
var startWork = await GetWorkshopsForEmployeeStartWorkCount(accountId);
|
||||||
var leftWork = await GetWorkshopsForLeftWorkTempCount(accountId);
|
var leftWork = await GetWorkshopsForLeftWorkTempCount(accountId);
|
||||||
|
int institutionContract = 0;
|
||||||
|
if (permissions.Any(x => x == 1004))
|
||||||
|
{
|
||||||
|
institutionContract = await GetInstitutionContractWorkflowCount();
|
||||||
|
}
|
||||||
|
|
||||||
return employeeDocumentWorkFlowCounts + startWork + leftWork;
|
return employeeDocumentWorkFlowCounts + startWork + leftWork +institutionContract;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<int> GetWorkFlowCountForChecker()
|
public async Task<int> GetWorkFlowCountForChecker()
|
||||||
{
|
{
|
||||||
return await _workFlowEmployeeDocumentsACL.GetCheckerWorkFlowCount();
|
return await _workFlowEmployeeDocumentsACL.GetCheckerWorkFlowCount();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<WorkshopWithDocumentsViewModelForWorkFlow> GetWorkshopsWithDocumentsAwaitingUploadForAdmin(
|
||||||
public List<WorkshopWithDocumentsViewModelForWorkFlow> GetWorkshopsWithDocumentsAwaitingUploadForAdmin(List<long> workshops)
|
List<long> workshops)
|
||||||
{
|
{
|
||||||
return _workFlowEmployeeDocumentsACL.GetWorkshopsWithDocumentsAwaitingUploadForAdmin(workshops);
|
return _workFlowEmployeeDocumentsACL.GetWorkshopsWithDocumentsAwaitingUploadForAdmin(workshops);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Mahan
|
#region Mahan
|
||||||
|
|
||||||
#region شروع به کار پرسنل افزوده شده
|
#region شروع به کار پرسنل افزوده شده
|
||||||
public async Task<ICollection<WorkshopWithStartedWorkWorkFlowViewModel>> GetWorkshopsForEmployeeStartWork(long accountId)
|
|
||||||
|
public async Task<ICollection<WorkshopWithStartedWorkWorkFlowViewModel>> GetWorkshopsForEmployeeStartWork(
|
||||||
|
long accountId)
|
||||||
{
|
{
|
||||||
return await _workFlowWorkshopACL.GetWorkshopsForEmployeeStartWork(accountId);
|
return await _workFlowWorkshopACL.GetWorkshopsForEmployeeStartWork(accountId);
|
||||||
}
|
}
|
||||||
@@ -81,14 +93,14 @@ namespace WorkFlow.Application
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<ICollection<ClientStartedWorkEmployeesWorkFlowViewModel>> GetClientEmployeesStartWork(
|
||||||
|
long workshopId)
|
||||||
public async Task<ICollection<ClientStartedWorkEmployeesWorkFlowViewModel>> GetClientEmployeesStartWork(long workshopId)
|
|
||||||
{
|
{
|
||||||
return await _workFlowEmployeeACL.GetClientEmployeesStartWork(workshopId);
|
return await _workFlowEmployeeACL.GetClientEmployeesStartWork(workshopId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetEditEmployeeInEmployeeDocumentViewModel> GetEmployeeEditInEmployeeDocumentWorkFlow(long employeeId, long workshopId)
|
public async Task<GetEditEmployeeInEmployeeDocumentViewModel> GetEmployeeEditInEmployeeDocumentWorkFlow(
|
||||||
|
long employeeId, long workshopId)
|
||||||
{
|
{
|
||||||
return await _workFlowEmployeeACL.GetEmployeeEditInEmployeeDocumentWorkFlow(employeeId, workshopId);
|
return await _workFlowEmployeeACL.GetEmployeeEditInEmployeeDocumentWorkFlow(employeeId, workshopId);
|
||||||
}
|
}
|
||||||
@@ -103,16 +115,24 @@ namespace WorkFlow.Application
|
|||||||
|
|
||||||
#region ترک کار موقت
|
#region ترک کار موقت
|
||||||
|
|
||||||
public async Task<ICollection<WorkshopWithLeftWorkWorkFlowViewModel>> GetWorkshopsForLeftWorkTemp(long accountId)
|
public async Task<ICollection<WorkshopWithLeftWorkWorkFlowViewModel>> GetWorkshopsForLeftWorkTemp(
|
||||||
|
long accountId)
|
||||||
{
|
{
|
||||||
return await _workFlowWorkshopACL.GetWorkshopsForLeftWorkTemp(accountId);
|
return await _workFlowWorkshopACL.GetWorkshopsForLeftWorkTemp(accountId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<int> GetWorkshopsForLeftWorkTempCount(long accountId)
|
public async Task<int> GetWorkshopsForLeftWorkTempCount(long accountId)
|
||||||
{
|
{
|
||||||
return await _workFlowWorkshopACL.GetWorkshopsForLeftWorkTempCount(accountId);
|
return await _workFlowWorkshopACL.GetWorkshopsForLeftWorkTempCount(accountId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<ICollection<ClientLeftWorkEmployeesWorkFlowViewModel>> GetEmployeesForLeftWorkTemp(long workshopId)
|
public async Task<int> GetInstitutionContractWorkflowCount()
|
||||||
|
{
|
||||||
|
return await _workFlowInstitutionContractACL.GetInstitutionContractWorkflowCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<ICollection<ClientLeftWorkEmployeesWorkFlowViewModel>> GetEmployeesForLeftWorkTemp(
|
||||||
|
long workshopId)
|
||||||
{
|
{
|
||||||
return await _workFlowEmployeeACL.GetEmployeesForLeftWorkTemp(workshopId);
|
return await _workFlowEmployeeACL.GetEmployeesForLeftWorkTemp(workshopId);
|
||||||
}
|
}
|
||||||
@@ -121,7 +141,8 @@ namespace WorkFlow.Application
|
|||||||
|
|
||||||
#region آپلود مدارک پرسنل
|
#region آپلود مدارک پرسنل
|
||||||
|
|
||||||
public async Task<ICollection<WorkshopWithDocumentsViewModelForWorkFlow>> GetWorkshopDocumentCreatedEmployeeForAdmin(List<long> workshops, long roleId)
|
public async Task<ICollection<WorkshopWithDocumentsViewModelForWorkFlow>>
|
||||||
|
GetWorkshopDocumentCreatedEmployeeForAdmin(List<long> workshops, long roleId)
|
||||||
{
|
{
|
||||||
return await _workFlowEmployeeDocumentsACL.GetWorkshopDocumentCreatedEmployeeForAdmin(workshops, roleId);
|
return await _workFlowEmployeeDocumentsACL.GetWorkshopDocumentCreatedEmployeeForAdmin(workshops, roleId);
|
||||||
}
|
}
|
||||||
@@ -130,6 +151,4 @@ namespace WorkFlow.Application
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -58,4 +58,5 @@ public class WorkFlowEmployeeACL : IWorkFlowEmployeeACL
|
|||||||
{
|
{
|
||||||
return await _employeeApplication.EditEmployeeInEmployeeDocumentWorkFlow(command);
|
return await _employeeApplication.EditEmployeeInEmployeeDocumentWorkFlow(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||||
|
|
||||||
|
namespace WorkFlow.Infrastructure.ACL.InstitutionContract;
|
||||||
|
|
||||||
|
public interface IWorkFlowInstitutionContractACL
|
||||||
|
{
|
||||||
|
Task<int> GetInstitutionContractWorkflowCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class WorkFlowInstitutionContractACL : IWorkFlowInstitutionContractACL
|
||||||
|
{
|
||||||
|
private readonly IInstitutionContractApplication _institutionContractApplication;
|
||||||
|
public WorkFlowInstitutionContractACL(IInstitutionContractApplication institutionContractApplication)
|
||||||
|
{
|
||||||
|
_institutionContractApplication = institutionContractApplication;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<int> GetInstitutionContractWorkflowCount()
|
||||||
|
{
|
||||||
|
var list = await _institutionContractApplication.RegistrationWorkflowMainList();
|
||||||
|
return list.Count;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,6 +9,7 @@ using WorkFlow.Infrastructure.ACL.Checkout;
|
|||||||
using WorkFlow.Infrastructure.ACL.CustomizedWorkshopSettings;
|
using WorkFlow.Infrastructure.ACL.CustomizedWorkshopSettings;
|
||||||
using WorkFlow.Infrastructure.ACL.Employee;
|
using WorkFlow.Infrastructure.ACL.Employee;
|
||||||
using WorkFlow.Infrastructure.ACL.EmployeeDocuments;
|
using WorkFlow.Infrastructure.ACL.EmployeeDocuments;
|
||||||
|
using WorkFlow.Infrastructure.ACL.InstitutionContract;
|
||||||
using WorkFlow.Infrastructure.ACL.RollCall;
|
using WorkFlow.Infrastructure.ACL.RollCall;
|
||||||
using WorkFlow.Infrastructure.ACL.Workshop;
|
using WorkFlow.Infrastructure.ACL.Workshop;
|
||||||
using WorkFlow.Infrastructure.EfCore;
|
using WorkFlow.Infrastructure.EfCore;
|
||||||
@@ -33,8 +34,7 @@ namespace WorkFlow.Infrastructure.Config
|
|||||||
services.AddTransient<IWorkFlowRollCallACL, WorkFlowRollCallACL>();
|
services.AddTransient<IWorkFlowRollCallACL, WorkFlowRollCallACL>();
|
||||||
services.AddTransient<IWorkFlowCustomizedWorkshopSettingsACL, WorkFlowCustomizedWorkshopSettingsACL>();
|
services.AddTransient<IWorkFlowCustomizedWorkshopSettingsACL, WorkFlowCustomizedWorkshopSettingsACL>();
|
||||||
services.AddTransient<IWorkFlowEmployeeACL, WorkFlowEmployeeACL>();
|
services.AddTransient<IWorkFlowEmployeeACL, WorkFlowEmployeeACL>();
|
||||||
|
services.AddTransient<IWorkFlowInstitutionContractACL, WorkFlowInstitutionContractACL>();
|
||||||
|
|
||||||
services.AddTransient<IWorkFlowWorkshopACL, WorkFlowWorkshopACL>();
|
services.AddTransient<IWorkFlowWorkshopACL, WorkFlowWorkshopACL>();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user