Api merged with master
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
<PackageReference Include="PersianTools.Core" Version="2.0.4" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="9.0.0" />
|
||||
<PackageReference Include="MD.PersianDateTime.Standard" Version="2.5.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="7.2.0" />
|
||||
|
||||
|
||||
|
||||
</ItemGroup>
|
||||
|
||||
@@ -40,7 +40,9 @@ public class AuthHelper : IAuthHelper
|
||||
result.Mobile = claims.FirstOrDefault(x => x is { Type: "Mobile" }).Value;
|
||||
result.SubAccountId = long.Parse(claims.FirstOrDefault(x => x.Type == "SubAccountId").Value);
|
||||
result.WorkshopName = claims.FirstOrDefault(x => x is { Type: "WorkshopName" })?.Value;
|
||||
return result;
|
||||
result.Permissions = Tools.DeserializeFromBsonList<int>(claims.FirstOrDefault(x => x is { Type: "permissions" })?.Value);
|
||||
result.RoleName = claims.FirstOrDefault(x => x is { Type: "RoleName" })?.Value;
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<int> GetPermissions()
|
||||
|
||||
8
0_Framework/Application/Enums/ActivationStatus.cs
Normal file
8
0_Framework/Application/Enums/ActivationStatus.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace _0_Framework.Application.Enums;
|
||||
|
||||
public enum ActivationStatus
|
||||
{
|
||||
None = 0,
|
||||
Active = 1,
|
||||
DeActive = 2
|
||||
}
|
||||
8
0_Framework/Application/Enums/LegalType.cs
Normal file
8
0_Framework/Application/Enums/LegalType.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace _0_Framework.Application.Enums;
|
||||
|
||||
public enum LegalType
|
||||
{
|
||||
None = 0,
|
||||
Real = 1,
|
||||
Legal = 2
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Json;
|
||||
using System.Security.Policy;
|
||||
using System.Security.Principal;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace _0_Framework.Application.PaymentGateway;
|
||||
|
||||
public class AqayePardakhtPaymentGateway:IPaymentGateway
|
||||
{
|
||||
private const string Pin = "86EAF2C4D052F7D8759F";
|
||||
private const string AccountNumber = "AP.1042276242";
|
||||
private const string EncryptedKey = "130D2@D2923";
|
||||
|
||||
private readonly HttpClient _httpClient;
|
||||
|
||||
public AqayePardakhtPaymentGateway(IHttpClientFactory httpClientFactory)
|
||||
{
|
||||
_httpClient = httpClientFactory.CreateClient();
|
||||
}
|
||||
|
||||
public async Task<PaymentGatewayResponse> Create(CreatePaymentGatewayRequest command,CancellationToken cancellationToken =default)
|
||||
{
|
||||
var response = await _httpClient.PostAsJsonAsync("https://panel.aqayepardakht.ir/api/v2/create", new
|
||||
{
|
||||
pin = Pin,
|
||||
amount = command.Amount,
|
||||
callback = command.CallBackUrl,
|
||||
card_number = command.CardNumber,
|
||||
invoice_id = command.InvoiceId,
|
||||
mobile = command.Mobile,
|
||||
email = command.Email,
|
||||
description = command.Description,
|
||||
}, cancellationToken: cancellationToken);
|
||||
|
||||
var result = await response.Content.ReadFromJsonAsync<PaymentGatewayResponse>(cancellationToken: cancellationToken);
|
||||
return result;
|
||||
}
|
||||
|
||||
public string GetStartPayUrl(string transactionId) =>
|
||||
$"https://panel.aqayepardakht.ir/startpay/{transactionId}";
|
||||
|
||||
public async Task<PaymentGatewayResponse> Verify(VerifyPaymentGateWayRequest command, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var response = await _httpClient.PostAsJsonAsync("https://panel.aqayepardakht.ir/api/v2/verify", new
|
||||
{
|
||||
pin = Pin,
|
||||
amount = command.Amount,
|
||||
transid = command.TransactionId,
|
||||
}, cancellationToken: cancellationToken);
|
||||
|
||||
var result = await response.Content.ReadFromJsonAsync<PaymentGatewayResponse>(cancellationToken: cancellationToken);
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<PaymentGatewayResponse> CreateSandBox(CreatePaymentGatewayRequest command, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var response = await _httpClient.PostAsJsonAsync("https://panel.aqayepardakht.ir/api/v2/create", new
|
||||
{
|
||||
pin = "sandbox",
|
||||
amount = command.Amount,
|
||||
callback = command.CallBackUrl,
|
||||
card_number = command.Amount,
|
||||
invoice_id = command.InvoiceId,
|
||||
mobile = command.Mobile,
|
||||
email = command.Email,
|
||||
description = command.Email,
|
||||
}, cancellationToken: cancellationToken);
|
||||
|
||||
var result = await response.Content.ReadFromJsonAsync<PaymentGatewayResponse>(cancellationToken: cancellationToken);
|
||||
return result;
|
||||
}
|
||||
|
||||
public string GetStartPaySandBoxUrl(string transactionId) =>
|
||||
$"https://panel.aqayepardakht.ir/startpay/sandbox/{transactionId}";
|
||||
|
||||
public async Task<WalletAmountResponse> GetWalletAmount(CancellationToken cancellationToken)
|
||||
{
|
||||
var response =await _httpClient.PostAsJsonAsync("https://panel.aqayepardakht.ir/api/v2/getmoney", new
|
||||
{
|
||||
account=AccountNumber,
|
||||
code = EncryptedKey
|
||||
}, cancellationToken: cancellationToken);
|
||||
var jsonString = await response.Content.ReadAsStringAsync(cancellationToken);
|
||||
var result = await response.Content.ReadFromJsonAsync<WalletAmountResponse>(cancellationToken);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
60
0_Framework/Application/PaymentGateway/IPaymentGateway.cs
Normal file
60
0_Framework/Application/PaymentGateway/IPaymentGateway.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using Microsoft.AspNetCore.Server.HttpSys;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace _0_Framework.Application.PaymentGateway;
|
||||
|
||||
public interface IPaymentGateway
|
||||
{
|
||||
Task<PaymentGatewayResponse> Create(CreatePaymentGatewayRequest command, CancellationToken cancellationToken =default);
|
||||
|
||||
string GetStartPayUrl(string transactionId);
|
||||
Task<PaymentGatewayResponse> Verify(VerifyPaymentGateWayRequest command, CancellationToken cancellationToken=default);
|
||||
Task<PaymentGatewayResponse> CreateSandBox(CreatePaymentGatewayRequest command, CancellationToken cancellationToken=default);
|
||||
string GetStartPaySandBoxUrl(string transactionId);
|
||||
Task<WalletAmountResponse> GetWalletAmount(CancellationToken cancellationToken);
|
||||
|
||||
}
|
||||
public class PaymentGatewayResponse
|
||||
{
|
||||
[JsonPropertyName("status")]
|
||||
public string Status { get; set; }
|
||||
|
||||
[JsonPropertyName("code")]
|
||||
public int? ErrorCode { get; set; }
|
||||
|
||||
[JsonPropertyName("transid")]
|
||||
public string TransactionId { get; set; }
|
||||
}
|
||||
|
||||
public class WalletAmountResponse
|
||||
{
|
||||
[JsonPropertyName("status")]
|
||||
public string Status { get; set; }
|
||||
[JsonPropertyName("money")]
|
||||
public double Amount { get; set; }
|
||||
[JsonPropertyName("code")]
|
||||
public int Code { get; set; }
|
||||
}
|
||||
|
||||
public class CreatePaymentGatewayRequest
|
||||
{
|
||||
public double Amount { get; set; }
|
||||
public string CallBackUrl { get; set; }
|
||||
public string InvoiceId { get; set; }
|
||||
public string CardNumber { get; set; }
|
||||
public string Mobile { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string Description { get; set; }
|
||||
}
|
||||
|
||||
public class VerifyPaymentGateWayRequest
|
||||
{
|
||||
public string TransactionId { get; set; }
|
||||
public double Amount { get; set; }
|
||||
}
|
||||
7
0_Framework/Application/SelectListViewModel.cs
Normal file
7
0_Framework/Application/SelectListViewModel.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace _0_Framework.Application;
|
||||
|
||||
public class SelectListViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string Text { get; set; }
|
||||
}
|
||||
@@ -41,6 +41,23 @@ public static class Tools
|
||||
return Regex.IsMatch(mobileNo, "^((09))(\\d{9})$");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع و تعداد ماه را میگیرد و تاریخ پایان قراردا را بر میگرداند
|
||||
/// </summary>
|
||||
/// <param name="startDate"></param>
|
||||
/// <param name="monthPlus"></param>
|
||||
/// <returns></returns>
|
||||
public static (DateTime endDateGr, string endDateFa) FindEndOfContract(string startDate, string monthPlus)
|
||||
{
|
||||
|
||||
int startYear = Convert.ToInt32(startDate.Substring(0, 4));
|
||||
int startMonth = Convert.ToInt32(startDate.Substring(5, 2));
|
||||
int startDay = Convert.ToInt32(startDate.Substring(8, 2));
|
||||
var start = new PersianDateTime(startYear, startMonth, startDay);
|
||||
var end = (start.AddMonths(Convert.ToInt32(monthPlus))).AddDays(-1);
|
||||
return ($"{end}".ToGeorgianDateTime(), $"{end}");
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// دریافت روزهای کارکرد پرسنل در لیست بیمه ماه مشخص شده
|
||||
|
||||
75
0_Framework/Exceptions/Handler/CustomExceptionHandler.cs
Normal file
75
0_Framework/Exceptions/Handler/CustomExceptionHandler.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Diagnostics;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
|
||||
namespace _0_Framework.Exceptions.Handler;
|
||||
|
||||
public class CustomExceptionHandler : IExceptionHandler
|
||||
{
|
||||
private readonly ILogger<CustomExceptionHandler> _logger;
|
||||
|
||||
public CustomExceptionHandler(ILogger<CustomExceptionHandler> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public async ValueTask<bool> TryHandleAsync(HttpContext context, Exception exception, CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.LogError(
|
||||
"Error Message: {exceptionMessage}, Time of occurrence {time}",
|
||||
exception.Message, DateTime.UtcNow);
|
||||
|
||||
(string Detail, string Title, int StatusCode) details = exception switch
|
||||
{
|
||||
InternalServerException =>
|
||||
(
|
||||
exception.Message,
|
||||
exception.GetType().Name,
|
||||
context.Response.StatusCode = StatusCodes.Status500InternalServerError
|
||||
),
|
||||
BadRequestException =>
|
||||
(
|
||||
exception.Message,
|
||||
exception.GetType().Name,
|
||||
context.Response.StatusCode = StatusCodes.Status400BadRequest
|
||||
),
|
||||
NotFoundException =>
|
||||
(
|
||||
exception.Message,
|
||||
exception.GetType().Name,
|
||||
context.Response.StatusCode = StatusCodes.Status404NotFound
|
||||
),
|
||||
UnAuthorizeException =>
|
||||
(
|
||||
exception.Message,
|
||||
exception.GetType().Name,
|
||||
context.Response.StatusCode = StatusCodes.Status401Unauthorized
|
||||
),
|
||||
_ =>
|
||||
(
|
||||
exception.Message,
|
||||
exception.GetType().Name,
|
||||
context.Response.StatusCode = StatusCodes.Status500InternalServerError
|
||||
)
|
||||
};
|
||||
|
||||
var problemDetails = new ProblemDetails
|
||||
{
|
||||
Title = details.Title,
|
||||
Detail = details.Detail,
|
||||
Status = details.StatusCode,
|
||||
Instance = context.Request.Path
|
||||
};
|
||||
|
||||
problemDetails.Extensions.Add("traceId", context.TraceIdentifier);
|
||||
|
||||
await context.Response.WriteAsJsonAsync(problemDetails, cancellationToken: cancellationToken);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
10
0_Framework/Exceptions/UnAuthorizeException.cs
Normal file
10
0_Framework/Exceptions/UnAuthorizeException.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace _0_Framework.Exceptions;
|
||||
|
||||
public class UnAuthorizeException:Exception
|
||||
{
|
||||
public UnAuthorizeException(string message) : base(message)
|
||||
{
|
||||
}
|
||||
}
|
||||
26
Company.Domain/ContactUsAgg/ContactUs.cs
Normal file
26
Company.Domain/ContactUsAgg/ContactUs.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.ContactUsAgg;
|
||||
|
||||
public class ContactUs:EntityBase
|
||||
{
|
||||
public ContactUs(string firstName, string lastName, string email, string phoneNumber, string title, string message)
|
||||
{
|
||||
FirstName = firstName.Trim();
|
||||
LastName = lastName.Trim();
|
||||
Email = email;
|
||||
PhoneNumber = phoneNumber;
|
||||
Title = title;
|
||||
Message = message;
|
||||
FullName = FirstName + " " + LastName;
|
||||
}
|
||||
|
||||
public string FirstName { get; private set; }
|
||||
public string LastName { get; private set; }
|
||||
public string Email { get; private set; }
|
||||
public string PhoneNumber { get; private set; }
|
||||
public string Title { get; private set; }
|
||||
public string Message { get; private set; }
|
||||
public string FullName { get; private set; }
|
||||
|
||||
}
|
||||
8
Company.Domain/ContactUsAgg/IContactUsRepository.cs
Normal file
8
Company.Domain/ContactUsAgg/IContactUsRepository.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.ContactUsAgg;
|
||||
|
||||
public interface IContactUsRepository : IRepository<long, ContactUs>
|
||||
{
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using AccountManagement.Application.Contracts.Account;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Company.Domain.ContarctingPartyAgg;
|
||||
|
||||
@@ -42,6 +43,34 @@ public interface IPersonalContractingPartyRepository :IRepository<long, Personal
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// لیست طرف حساب ها
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <returns></returns>
|
||||
Task<ICollection<ContractingPartyGetListViewModel>> GetList(ContractingPartyGetListSearchModel searchModel);
|
||||
|
||||
/// <summary>
|
||||
/// لیست طرف حساب برای سلکت لیست سرچ
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<ContractingPartySelectListViewModel>> GetSelectList();
|
||||
|
||||
/// <summary>
|
||||
/// لیستی از شماره ملی یا شناسه ملی بر اساس حقیقی یا حقوقی بودن
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<GetContractingPartyNationalCodeOrNationalIdViewModel>> GetNationalCodeOrNationalId();
|
||||
|
||||
/// <summary>
|
||||
/// غیرفعال کردن طرف حساب و زیرمجموعه های آن
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult<string>> DeactivateWithSubordinates(long id);
|
||||
|
||||
void Remove(PersonalContractingParty entity);
|
||||
Task<GetRealContractingPartyDetailsViewModel> GetRealDetails(long id);
|
||||
Task<GetLegalContractingPartyDetailsViewModel> GetLegalDetails(long id);
|
||||
|
||||
}
|
||||
@@ -213,4 +213,14 @@ public class PersonalContractingParty : EntityBase
|
||||
this.Gender = gender;
|
||||
this.IsAuthenticated = true;
|
||||
}
|
||||
|
||||
public void RegisterComplete(string fatherName, string idNumberSeri, string idNumberSerial, DateTime dateOfBirth, Gender gender)
|
||||
{
|
||||
this.FatherName = fatherName;
|
||||
this.IdNumberSeri = idNumberSeri;
|
||||
this.IdNumberSerial = idNumberSerial;
|
||||
this.DateOfBirth = dateOfBirth;
|
||||
this.Gender = gender;
|
||||
this.IsAuthenticated = true;
|
||||
}
|
||||
}
|
||||
@@ -71,7 +71,12 @@ public interface IEmployeeRepository : IRepository<long, Employee>
|
||||
Task<GetEditEmployeeInEmployeeDocumentViewModel> GetEmployeeEditInEmployeeDocumentWorkFlow(long employeeId,
|
||||
long workshopId);
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Api
|
||||
Task<List<EmployeeSelectListViewModel>> GetSelectList(string searchText);
|
||||
Task<List<GetEmployeeListViewModel>> GetList(GetEmployeeListSearchModel searchModel);
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
@@ -13,4 +13,6 @@ public interface IFinancialStatmentRepository : IRepository<long, FinancialStatm
|
||||
|
||||
FinancialStatmentViewModel GetDetailsByContractingPartyId(long contractingPartyId);
|
||||
List<FinancialStatmentViewModel> Search(FinancialStatmentSearchModel searchModel);
|
||||
Task<ClientFinancialStatementViewModel> GetClientFinancialStatement(long accountId,
|
||||
ClientFinancialStatementSearchModel searchModel);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.PaymentTransaction;
|
||||
|
||||
namespace Company.Domain.PaymentTransactionAgg;
|
||||
|
||||
public interface IPaymentTransactionRepository:IRepository<long,PaymentTransaction>
|
||||
{
|
||||
Task<List<GetPaymentTransactionListViewModel>> GetPaymentTransactionList(
|
||||
GetPaymentTransactionListSearchModel searchModel);
|
||||
}
|
||||
104
Company.Domain/PaymentTransactionAgg/PaymentTransaction.cs
Normal file
104
Company.Domain/PaymentTransactionAgg/PaymentTransaction.cs
Normal file
@@ -0,0 +1,104 @@
|
||||
using System;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.PaymentTransaction;
|
||||
|
||||
namespace Company.Domain.PaymentTransactionAgg
|
||||
{
|
||||
/// <summary>
|
||||
/// نمایانگر یک تراکنش پرداخت شامل جزئیات طرف قرارداد، اطلاعات بانکی، وضعیت تراکنش و مبلغ.
|
||||
/// </summary>
|
||||
public class PaymentTransaction:EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// سازنده کلاس PaymentTransaction با دریافت اطلاعات تراکنش.
|
||||
/// </summary>
|
||||
/// <param name="contractingPartyId">شناسه طرف قرارداد</param>
|
||||
/// <param name="bankAccountHolderName">نام صاحب حساب بانکی</param>
|
||||
/// <param name="bankName">نام بانک</param>
|
||||
/// <param name="cardNumber">شماره کارت</param>
|
||||
/// <param name="shebaNumber">شماره شبا</param>
|
||||
/// <param name="accountNumber">شماره حساب بانکی</param>
|
||||
/// <param name="status">وضعیت تراکنش پرداخت</param>
|
||||
/// <param name="amount">مبلغ تراکنش</param>
|
||||
/// <param name="transactionId">شناسه یکتای تراکنش</param>
|
||||
/// <param name="contractingPartyName"></param>
|
||||
public PaymentTransaction(long contractingPartyId,
|
||||
string bankAccountHolderName,
|
||||
string bankName,
|
||||
string cardNumber,
|
||||
string shebaNumber,
|
||||
string accountNumber,
|
||||
PaymentTransactionStatus status,
|
||||
double amount,
|
||||
string transactionId,
|
||||
string contractingPartyName)
|
||||
{
|
||||
TransactionDate = DateTime.Now;
|
||||
ContractingPartyId = contractingPartyId;
|
||||
BankAccountHolderName = bankAccountHolderName;
|
||||
BankName = bankName;
|
||||
CardNumber = cardNumber;
|
||||
ShebaNumber = shebaNumber;
|
||||
AccountNumber = accountNumber;
|
||||
Status = status;
|
||||
Amount = amount;
|
||||
TransactionId = transactionId;
|
||||
ContractingPartyName = contractingPartyName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ و زمان انجام پرداخت
|
||||
/// </summary>
|
||||
public DateTime TransactionDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه طرف حساب
|
||||
/// </summary>
|
||||
public long ContractingPartyId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام طرف حساب
|
||||
/// </summary>
|
||||
public string ContractingPartyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام صاحب حساب بانکی
|
||||
/// </summary>
|
||||
public string BankAccountHolderName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام بانک
|
||||
/// </summary>
|
||||
public string BankName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره کارت
|
||||
/// </summary>
|
||||
public string CardNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره شبا
|
||||
/// </summary>
|
||||
public string ShebaNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره حساب بانکی
|
||||
/// </summary>
|
||||
public string AccountNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت تراکنش پرداخت
|
||||
/// </summary>
|
||||
public PaymentTransactionStatus Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ تراکنش
|
||||
/// </summary>
|
||||
public double Amount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه یکتای تراکنش
|
||||
/// </summary>
|
||||
public string TransactionId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
@@ -20,4 +21,10 @@ public interface IRepresentativeRepository : IRepository<long, Representative>
|
||||
|
||||
#endregion
|
||||
|
||||
#region Api
|
||||
Task<ICollection<RepresentativeGetListViewModel>> GetList(RepresentativeGetListSearchModel searchModel);
|
||||
bool HasAnyContractingParty(long id);
|
||||
Task<List<GetSelectListRepresentativeViewModel>> GetSelectList();
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework_b.Domain;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
@@ -15,4 +16,11 @@ public interface IInstitutionContractTempRepository : IRepository<long, Institut
|
||||
/// <param name="contractingPartyId"></param>
|
||||
/// <returns></returns>
|
||||
Task<InstitutionContractTempViewModel> GetInstitutionContractTemp(long id,long contractingPartyTempId);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست طرف حساب هایی که ثبت نام آنها تکمیل شده
|
||||
/// جهت نمایش در کارپوشه
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<RegistrationWorkflowMainList>> GetAllCompletedRegistration();
|
||||
}
|
||||
@@ -14,5 +14,7 @@ public interface IWorkshopTempRepository : IRepository<long, WorkshopTemp>
|
||||
/// <returns></returns>
|
||||
Task<List<WorkshopTempViewModel>> GetWorkshopTemp(long contractingPartyTemp);
|
||||
|
||||
System.Threading.Tasks.Task RemoveWorkshopTemps(List<long> workshopTempIds);
|
||||
|
||||
|
||||
}
|
||||
@@ -34,12 +34,14 @@ public class InstitutionContractTemp : EntityBase
|
||||
/// بصورت یکجا
|
||||
/// -
|
||||
/// بصئورت ماهیانه
|
||||
/// OneTime
|
||||
/// </summary>
|
||||
public string PaymentModel { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// مدت قرارداد
|
||||
/// چند ماهه؟
|
||||
/// "12"
|
||||
/// </summary>
|
||||
public string PeriodModel { get; private set; }
|
||||
|
||||
@@ -129,6 +131,9 @@ public class InstitutionContractTemp : EntityBase
|
||||
VerifyCodeEndTime = verifyCodeEndTime;
|
||||
}
|
||||
|
||||
|
||||
public void ChangeRegistrationStatus(string registrationStatus)
|
||||
{
|
||||
RegistrationStatus = registrationStatus;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -56,6 +56,17 @@ public interface IEmployerRepository : IRepository<long, Employer>
|
||||
|
||||
#endregion
|
||||
|
||||
#region Api
|
||||
Task<List<GetEmployerListViewModel>> GetEmployerList(GetEmployerSearchModel searchModel);
|
||||
|
||||
Task<GetLegalEmployerDetailViewModel> GetLegalEmployerDetail(long id);
|
||||
Task<GetRealEmployerDetailViewModel> GetRealEmployerDetail(long id);
|
||||
//Task<List<EmployerSelectListViewModel>> GetSelectList(string search);
|
||||
Task<OperationResult<string>> DeactivateWithSubordinates(long id);
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,17 +1,22 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="PersianTools.Core" Version="2.0.4" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="PersianTools.Core" Version="2.0.4" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\0_Framework\0_Framework.csproj" />
|
||||
<ProjectReference Include="..\AccountManagement.Application.Contracts\AccountManagement.Application.Contracts.csproj" />
|
||||
<ProjectReference Include="..\_0_Framework\_0_Framework_b.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\0_Framework\0_Framework.csproj" />
|
||||
<ProjectReference Include="..\AccountManagement.Application.Contracts\AccountManagement.Application.Contracts.csproj" />
|
||||
<ProjectReference Include="..\_0_Framework\_0_Framework_b.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="CopyDocs" AfterTargets="Build">
|
||||
<Copy SourceFiles="$(OutputPath)CompanyManagment.App.Contracts.xml" DestinationFolder="../ServiceHost\bin\Debug\net8.0\" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.ContactUs;
|
||||
|
||||
public interface IContactUsApplication
|
||||
{
|
||||
OperationResult Create(CreateContactUs command);
|
||||
}
|
||||
|
||||
public class CreateContactUs
|
||||
{
|
||||
public string FirstName { get; set; }
|
||||
public string LastName { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string PhoneNumber { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Message { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using _0_Framework.Application.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employee;
|
||||
|
||||
/// <summary>
|
||||
/// مدل جستجو در لیست پرسنل در ادمین
|
||||
/// </summary>
|
||||
public class GetEmployeeListSearchModel
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی کارفرما
|
||||
/// </summary>
|
||||
public long EmployerId { get; set; }
|
||||
/// <summary>
|
||||
/// آیدی کارگاه
|
||||
/// </summary>
|
||||
public long WorkshopId { get; set; }
|
||||
/// <summary>
|
||||
/// آیدی پرسنل
|
||||
/// </summary>
|
||||
public long EmployeeId { get; set; }
|
||||
/// <summary>
|
||||
/// کدملی
|
||||
/// </summary>
|
||||
public string NationalCode { get; set; }
|
||||
/// <summary>
|
||||
/// شماره بیمه
|
||||
/// </summary>
|
||||
public string InsuranceCode { get; set; }
|
||||
/// <summary>
|
||||
/// وضعیت پرسنل
|
||||
/// </summary>
|
||||
public ActivationStatus EmployeeStatus { get; set; }
|
||||
/// <summary>
|
||||
/// ایندکس جستجو
|
||||
/// </summary>
|
||||
public int PageIndex { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employee;
|
||||
|
||||
/// <summary>
|
||||
/// ویو مدل لیست پرسنل ادمین
|
||||
/// </summary>
|
||||
public class GetEmployeeListViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی پرسنل
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// نام و نام خانوادگی پرسنل
|
||||
/// </summary>
|
||||
public string EmployeeFullName { get; set; }
|
||||
/// <summary>
|
||||
/// کدملی
|
||||
/// </summary>
|
||||
public string NationalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تعداد فرزندان
|
||||
/// </summary>
|
||||
public string ChildrenCount { get; set; }
|
||||
/// <summary>
|
||||
/// جنسیت
|
||||
/// </summary>
|
||||
public Gender Gender { get; set; }
|
||||
/// <summary>
|
||||
/// تاریخ تولد
|
||||
/// </summary>
|
||||
public string BirthDate { get; set; }
|
||||
/// <summary>
|
||||
/// شماره بیمه
|
||||
/// </summary>
|
||||
public string InsuranceCode { get; set; }
|
||||
/// <summary>
|
||||
/// وضعیت پرسنل
|
||||
/// </summary>
|
||||
public ActivationStatus EmployeeStatus { get; set; }
|
||||
}
|
||||
@@ -77,6 +77,23 @@ public interface IEmployeeApplication
|
||||
|
||||
Task<OperationResult<EmployeeDataFromApiViewModel>> GetEmployeeDataFromApi(string nationalCode, string birthDate);
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Api
|
||||
|
||||
/// <summary>
|
||||
/// لیست پرسنل برای جستجو
|
||||
/// </summary>
|
||||
/// <param name="searchText"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<EmployeeSelectListViewModel>> GetSelectList(string searchText);
|
||||
|
||||
/// <summary>
|
||||
/// لیست کل پرسنل
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<GetEmployeeListViewModel>> GetList(GetEmployeeListSearchModel searchModel);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد کارفرمای حقیقی
|
||||
/// </summary>
|
||||
public class CreateLegalEmployer
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی طرف حساب
|
||||
/// </summary>
|
||||
[Required]
|
||||
public long ContractingPartyId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام شرکت
|
||||
/// </summary>
|
||||
public string CompanyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه ملی
|
||||
/// </summary>
|
||||
public string NationalId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره ثبت
|
||||
/// </summary>
|
||||
public string RegisterId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن همراه
|
||||
/// </summary>
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن ثابت
|
||||
/// </summary>
|
||||
public string TelephoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام مدیر عامل
|
||||
/// </summary>
|
||||
public string EmployerFName { get; set; }
|
||||
/// <summary>
|
||||
/// نام خانوادگی مدیر عامل
|
||||
/// </summary>
|
||||
public string EmployerLName { get; set; }
|
||||
/// <summary>
|
||||
/// جنسیت مدیر عامل
|
||||
/// </summary>
|
||||
public Gender EmployerGender { get; set; }
|
||||
/// <summary>
|
||||
/// کد ملی مدیر عامل
|
||||
/// </summary>
|
||||
public string EmployerNationalCode { get; set; }
|
||||
/// <summary>
|
||||
/// شماره شناسنامه مدیر عامل
|
||||
/// </summary>
|
||||
public string EmployerIdNumber { get; set; }
|
||||
/// <summary>
|
||||
/// نام پدر مدیر عامل
|
||||
/// </summary>
|
||||
public string EmployerFatherName { get; set; }
|
||||
/// <summary>
|
||||
/// تاریخ تولد مدیر عامل
|
||||
/// </summary>
|
||||
public string EmployerDateOfBirth { get; set; }
|
||||
/// <summary>
|
||||
/// تاریخ صدور شناسنامه مدیر عامل
|
||||
/// </summary>
|
||||
public string EmployerDateOfIssue { get; set; }
|
||||
/// <summary>
|
||||
/// محل صدور شناسنامه مدیر عامل
|
||||
/// </summary>
|
||||
public string EmployerPlaceOfIssue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اطلاعات سامانه ای
|
||||
/// </summary>
|
||||
public GovernmentSystemInfo GovernmentSystemInfo { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد کارفرما حقیقی
|
||||
/// </summary>
|
||||
public class CreateRealEmployer
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی طرف حساب
|
||||
/// </summary>
|
||||
[Required]
|
||||
public long ContractingPartyId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// جنسیت
|
||||
/// </summary>
|
||||
[Required]
|
||||
public Gender Gender { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string FName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///نام خانوادگی
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string LName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد ملی
|
||||
/// </summary>
|
||||
public string NationalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن همراه
|
||||
/// </summary>
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن ثابت
|
||||
/// </summary>
|
||||
public string Telephone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ صدور شناسنامه
|
||||
/// </summary>
|
||||
public string DateOfIssue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// محل صدور شناسنامه
|
||||
/// </summary>
|
||||
public string PlaceOfIssue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ تولد
|
||||
/// </summary>
|
||||
public string DateOfBirth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام پدر
|
||||
/// </summary>
|
||||
public string FatherName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اطلاعات سامانه ای
|
||||
/// </summary>
|
||||
public GovernmentSystemInfo GovernmentSystemInfo { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
|
||||
public class EditLegalEmployer: CreateLegalEmployer
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی کارفرما
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
}
|
||||
12
CompanyManagment.App.Contracts/Employer/EditRealEmployer.cs
Normal file
12
CompanyManagment.App.Contracts/Employer/EditRealEmployer.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش کارفرما حقیقی
|
||||
/// </summary>
|
||||
public class EditRealEmployer:CreateRealEmployer
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی کارفرما
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Application.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
|
||||
/// <summary>
|
||||
/// مدل برای گرفتن لیست کارفرما
|
||||
/// </summary>
|
||||
public class GetEmployerListViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی کارفرما
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کدملی / شناسه ملی
|
||||
/// </summary>
|
||||
public string NationalCodeOrNationalId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کارفرما
|
||||
/// </summary>
|
||||
public string FullName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام های کارگاه
|
||||
/// </summary>
|
||||
public ICollection<string> WorkshopNames { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// دارای طرف حساب
|
||||
/// </summary>
|
||||
public bool HasContractingParty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// طرف حساب بلاک شده یا نه
|
||||
/// </summary>
|
||||
public bool HasBlockContractingParty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع کارفرما
|
||||
/// </summary>
|
||||
public LegalType LegalType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت کارفرما
|
||||
/// </summary>
|
||||
public ActivationStatus EmployerStatus { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using _0_Framework.Application.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
|
||||
/// <summary>
|
||||
/// مدل جستجوی لیست کارفرما
|
||||
/// </summary>
|
||||
public class GetEmployerSearchModel
|
||||
{
|
||||
/// <summary>
|
||||
/// نام شرکت / نام و نام خانوادگی
|
||||
/// </summary>
|
||||
public string FullNameOrCompanyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کدملی/ شناسه ملی
|
||||
/// </summary>
|
||||
public string NationalCodeOrNationalId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره شناسنامه یا شماره ثبت
|
||||
/// </summary>
|
||||
public string IdNumberOrRegisterId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام طرف حساب
|
||||
/// </summary>
|
||||
public string ContractingPartyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت کارفرما
|
||||
/// </summary>
|
||||
public ActivationStatus EmployerStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع کارفرما
|
||||
/// </summary>
|
||||
public LegalType EmployerType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// پیج ایندکس برای دسته بندی سی تایی
|
||||
/// </summary>
|
||||
public int PageIndex { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
|
||||
/// <summary>
|
||||
/// اطلاعات کارفرمای حقوقی
|
||||
/// </summary>
|
||||
public class GetLegalEmployerDetailViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی کارفرما
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام شرکت
|
||||
/// </summary>
|
||||
public string CompanyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه ملی
|
||||
/// </summary>
|
||||
public string NationalId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره ثبت
|
||||
/// </summary>
|
||||
public string RegisterId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن همراه
|
||||
/// </summary>
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن ثابت
|
||||
/// </summary>
|
||||
public string TelephoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد کارفرما
|
||||
/// </summary>
|
||||
public string EmployerNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کارفرما
|
||||
/// </summary>
|
||||
public string ContractingPartyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کارفرما
|
||||
/// </summary>
|
||||
public long ContractingPartyId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام و خانوادگی مدیر عامل
|
||||
/// </summary>
|
||||
public string CeoFullName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام و خانوادگی مدیر عامل
|
||||
/// </summary>
|
||||
public string CeoFName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام و خانوادگی مدیر عامل
|
||||
/// </summary>
|
||||
public string CeoLName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// جنسیت مدیر عامل
|
||||
/// </summary>
|
||||
public Gender Gender { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// جنیست
|
||||
/// </summary>
|
||||
public string GenderStr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ملیت
|
||||
/// </summary>
|
||||
public string Nationality { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام پدر
|
||||
/// </summary>
|
||||
public string FatherName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد ملی
|
||||
/// </summary>
|
||||
public string NationalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ تولد
|
||||
/// </summary>
|
||||
public string DateOfBirth { get; set; }
|
||||
/// <summary>
|
||||
/// تاریخ صدور شناسنامه
|
||||
/// </summary>
|
||||
public string DateOfIssue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// محل صدور شناسنامه
|
||||
/// </summary>
|
||||
public string PlaceOfIssue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اطلاعات سامانه های دولتی
|
||||
/// </summary>
|
||||
public GovernmentSystemInfo GovernmentSystemInfo { get; set; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
|
||||
/// <summary>
|
||||
/// اطلاعات کارفرمای حقوقی
|
||||
/// </summary>
|
||||
public class GetRealEmployerDetailViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی کارفرما
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام و نام خانوادگی
|
||||
/// </summary>
|
||||
public string FullName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام
|
||||
/// </summary>
|
||||
public string FName{ get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام خانوادگی
|
||||
/// </summary>
|
||||
public string LName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کدملی
|
||||
/// </summary>
|
||||
public string NationalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// جنسیت فارسی
|
||||
/// </summary>
|
||||
public string GenderStr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// جنسیت
|
||||
/// </summary>
|
||||
public Gender Gender { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ملیت
|
||||
/// </summary>
|
||||
public string Nationality { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن همراه
|
||||
/// </summary>
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام پدر
|
||||
/// </summary>
|
||||
public string FatherName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ تولد
|
||||
/// </summary>
|
||||
public string DateOfBirth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام طرف حساب
|
||||
/// </summary>
|
||||
public string ContractingPartyName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// آیدی طرف حساب
|
||||
/// </summary>
|
||||
public long ContractingPartyId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد کارفرما
|
||||
/// </summary>
|
||||
public string EmployerNo { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن ثابت
|
||||
/// </summary>
|
||||
public string TelephoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ صدور شناسنامه
|
||||
/// </summary>
|
||||
public string DateOfIssue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// محل صدور شناسنامه
|
||||
/// </summary>
|
||||
public string PlaceOfIssue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اطلاعات سامانه های دولتی
|
||||
/// </summary>
|
||||
public GovernmentSystemInfo GovernmentSystemInfo { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
|
||||
/// <summary>
|
||||
/// اطلاعات سامانه های دولتی
|
||||
/// </summary>
|
||||
public class GovernmentSystemInfo
|
||||
{
|
||||
#region MCL
|
||||
/// <summary>
|
||||
/// نام کاربری اداره کار
|
||||
/// </summary>
|
||||
public string MclUsername { get; set; }
|
||||
/// <summary>
|
||||
/// رمز عبور اداره کار
|
||||
/// </summary>
|
||||
public string MclPassword { get; set; }
|
||||
#endregion
|
||||
|
||||
#region E-Service تامین اجتماعی
|
||||
/// <summary>
|
||||
/// نام کاربری سازمان تامین اجتماعی
|
||||
/// </summary>
|
||||
public string EServiceUsername { get; set; }
|
||||
/// <summary>
|
||||
/// رمز عبور سازمان تامین اجتماعی
|
||||
/// </summary>
|
||||
public string EServicePassword { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Tax سامانه مالیاتی
|
||||
/// <summary>
|
||||
/// نام کاربری سامانه مالیاتی
|
||||
/// </summary>
|
||||
public string TaxUsername { get; set; }
|
||||
/// <summary>
|
||||
/// رمز عبور سامانه مالیاتی
|
||||
/// </summary>
|
||||
public string TaxPassword { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Sana سامانه ثنا
|
||||
/// <summary>
|
||||
/// نام کاربری ثنا
|
||||
/// </summary>
|
||||
public string SanaUsername { get; set; }
|
||||
/// <summary>
|
||||
/// رمز عبور ثنا
|
||||
/// </summary>
|
||||
public string SanaPassword { get; set; }
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
@@ -19,7 +20,7 @@ public interface IEmployerApplication
|
||||
|
||||
OperationResult Active(long id);
|
||||
OperationResult DeActive(long id);
|
||||
OperationResult Remove(long id);
|
||||
OperationResult Remove_Old(long id);
|
||||
|
||||
List<EmployerViewModel> GetEmployers();
|
||||
List<EmployerViewModel> Search(EmployerSearchModel searchModel);
|
||||
@@ -36,7 +37,13 @@ public interface IEmployerApplication
|
||||
#region Mahan
|
||||
|
||||
List<EmployerViewModel> GetEmployersHasWorkshop();
|
||||
Task<List<EmployerSelectListViewModel>> GetSelectList(string search);
|
||||
|
||||
/// <summary>
|
||||
/// لیست نام کارفرما ها برای جستجو
|
||||
/// </summary>
|
||||
/// <param name="search"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<EmployerSelectListViewModel>> GetSelectList(string search);
|
||||
|
||||
#endregion
|
||||
#region NewByHeydari
|
||||
@@ -53,6 +60,68 @@ public interface IEmployerApplication
|
||||
|
||||
(string employerName, bool isLegal) InsuranceEmployerByWorkshopId(long workshopId);
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
#region Api
|
||||
/// <summary>
|
||||
/// لیست کارفرما ها
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<GetEmployerListViewModel>> GetEmployerList(GetEmployerSearchModel searchModel);
|
||||
|
||||
/// <summary>
|
||||
/// جزئیات کارفرما حقوقی
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<GetLegalEmployerDetailViewModel> GetLegalEmployerDetail(long id);
|
||||
|
||||
/// <summary>
|
||||
/// جزئیات کارفرما حقیقی
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<GetRealEmployerDetailViewModel> GetRealEmployerDetail(long id);
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد کارفرمای حقیقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> CreateReal(CreateRealEmployer command);
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد کارفرمای حقوقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> CreateLegal(CreateLegalEmployer command);
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش کارفرمای حقیقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> EditReal(EditRealEmployer command);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش کارفرمای حقوقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> EditLegal(EditLegalEmployer command);
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// حذف کارفرما - درصورت داشتن کارگاه کارفرما غیرفعال میشود
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public Task<OperationResult<string>> Remove(long id);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.FinancilTransaction;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.FinancialStatment;
|
||||
|
||||
@@ -13,4 +14,123 @@ public interface IFinancialStatmentApplication
|
||||
|
||||
List<FinancialStatmentViewModel> Search(FinancialStatmentSearchModel searchModel);
|
||||
FinancialStatmentViewModel GetDetailsByContractingPartyId(long contractingPartyId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// نمایش اطلاعات صورت حساب مالی کلاینت
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <param name="accountId"></param>
|
||||
/// <returns>مدل صورت حساب مالی کلاینت</returns>
|
||||
Task<ClientFinancialStatementViewModel> GetClientFinancialStatement(ClientFinancialStatementSearchModel searchModel,
|
||||
long accountId);
|
||||
}
|
||||
|
||||
public class ClientFinancialStatementSearchModel
|
||||
{
|
||||
/// <summary>
|
||||
/// از تاریخ
|
||||
/// </summary>
|
||||
public string FromDate { get; set; }
|
||||
/// <summary>
|
||||
/// تا تاریخ
|
||||
/// </summary>
|
||||
public string ToDate { get; set; }
|
||||
/// <summary>
|
||||
/// از مبلغ
|
||||
/// </summary>
|
||||
public double FromAmount { get; set; }
|
||||
/// <summary>
|
||||
/// تا مبلغ
|
||||
/// </summary>
|
||||
public double ToAmount { get; set; }
|
||||
/// <summary>
|
||||
/// نوع عملیات تراکنش
|
||||
/// </summary>
|
||||
public FinancialTransactionType? Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// صفحه بندی
|
||||
/// </summary>
|
||||
public int PageIndex { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public enum FinancialTransactionType
|
||||
{
|
||||
/// <summary>
|
||||
/// ایجاد درآمد
|
||||
/// </summary>
|
||||
Debt,
|
||||
/// <summary>
|
||||
/// دریافت درآمد
|
||||
/// </summary>
|
||||
Credit
|
||||
}
|
||||
|
||||
public class ClientFinancialStatementViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی FinancialStatement
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// جمع بدهکاری
|
||||
/// </summary>
|
||||
public double TotalDebt { get; set; }
|
||||
/// <summary>
|
||||
/// جمع بستانکاری
|
||||
/// </summary>
|
||||
public double TotalCredit { get; set; }
|
||||
/// <summary>
|
||||
/// مبلغ قابل پرداخت
|
||||
/// </summary>
|
||||
public double TotalAmountPayable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تراکنش ها
|
||||
/// </summary>
|
||||
public List<ClientFinancialTransactionViewModel> Transactions { get; set; }
|
||||
}
|
||||
|
||||
public class ClientFinancialTransactionViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// زمان و تاریخ میلادی
|
||||
/// </summary>
|
||||
public DateTime DateTimeGr { get; set; }
|
||||
/// <summary>
|
||||
/// تاریخ
|
||||
/// </summary>
|
||||
public string DateFa { get; set; }
|
||||
/// <summary>
|
||||
/// زمان
|
||||
/// </summary>
|
||||
public string TimeFa { get; set; }
|
||||
/// <summary>
|
||||
/// شرح
|
||||
/// </summary>
|
||||
public string Description { get; set; }
|
||||
/// <summary>
|
||||
/// نوع عملیات پرداخت
|
||||
/// </summary>
|
||||
public FinancialTransactionType Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع عملیات پرداخت به صورت استرینگ
|
||||
/// </summary>
|
||||
public string TypeStr { get; set; }
|
||||
/// <summary>
|
||||
/// بدهکار
|
||||
/// </summary>
|
||||
public double Debtor { get; set; }
|
||||
/// <summary>
|
||||
/// بستانکار
|
||||
/// </summary>
|
||||
public double Creditor { get; set; }
|
||||
/// <summary>
|
||||
/// باقی مانده
|
||||
/// </summary>
|
||||
public double Balance { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
namespace CompanyManagment.App.Contracts.PaymentTransaction;
|
||||
|
||||
public class CreatePaymentTransaction
|
||||
{
|
||||
/// <summary>
|
||||
/// شناسه طرف قرارداد
|
||||
/// </summary>
|
||||
public long ContractingPartyId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام صاحب حساب بانکی
|
||||
/// </summary>
|
||||
public string BankAccountHolderName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام بانک
|
||||
/// </summary>
|
||||
public string BankName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره کارت
|
||||
/// </summary>
|
||||
public string CardNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره شبا
|
||||
/// </summary>
|
||||
public string ShebaNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره حساب بانکی
|
||||
/// </summary>
|
||||
public string AccountNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت تراکنش پرداخت
|
||||
/// </summary>
|
||||
public PaymentTransactionStatus Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ تراکنش
|
||||
/// </summary>
|
||||
public double Amount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه یکتای تراکنش
|
||||
/// </summary>
|
||||
public string TransactionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام طرف حساب
|
||||
/// </summary>
|
||||
public string ContractingPartyName { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
namespace CompanyManagment.App.Contracts.PaymentTransaction;
|
||||
|
||||
/// <summary>
|
||||
/// مدل جستجو برای دریافت لیست تراکنشهای پرداخت.
|
||||
/// شامل فیلترهایی مانند نام طرف قرارداد یا صاحب حساب، بازه تاریخ، بازه مبلغ و وضعیت تراکنش.
|
||||
/// </summary>
|
||||
public class GetPaymentTransactionListSearchModel
|
||||
{
|
||||
/// <summary>
|
||||
/// نام طرف قرارداد یا صاحب حساب بانکی جهت جستجو
|
||||
/// </summary>
|
||||
public string ContractingPartyOrAccountHolderName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع بازه جستجو (به صورت رشته)
|
||||
/// </summary>
|
||||
public string FromDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ پایان بازه جستجو (به صورت رشته)
|
||||
/// </summary>
|
||||
public string ToDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// حداقل مبلغ تراکنش جهت جستجو
|
||||
/// </summary>
|
||||
public double FromAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// حداکثر مبلغ تراکنش جهت جستجو
|
||||
/// </summary>
|
||||
public double ToAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت تراکنش جهت فیلتر کردن نتایج
|
||||
/// </summary>
|
||||
public PaymentTransactionStatus? StatusEnum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره صفحه برای پیادهسازی pagination
|
||||
/// </summary>
|
||||
public int PageIndex { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
namespace CompanyManagment.App.Contracts.PaymentTransaction;
|
||||
|
||||
/// <summary>
|
||||
/// مدل نمایش اطلاعات هر تراکنش پرداخت در لیست تراکنشها.
|
||||
/// شامل جزئیاتی مانند تاریخ و زمان پرداخت، نام طرف حساب، اطلاعات بانکی، وضعیت و مبلغ تراکنش.
|
||||
/// </summary>
|
||||
public class GetPaymentTransactionListViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی تراکنش پرداخت
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ پرداخت
|
||||
/// </summary>
|
||||
public string PaymentDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// زمان پرداخت
|
||||
/// </summary>
|
||||
public string PaymentTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام طرف حساب
|
||||
/// </summary>
|
||||
public string ContractingPartyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام صاحب حساب بانکی
|
||||
/// </summary>
|
||||
public string BankAccountHolderName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام بانک
|
||||
/// </summary>
|
||||
public string BankName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره کارت
|
||||
/// </summary>
|
||||
public string CardNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره شبا
|
||||
/// </summary>
|
||||
public string ShebaNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره حساب بانکی
|
||||
/// </summary>
|
||||
public string AccountNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت تراکنش به صورت متنی
|
||||
/// </summary>
|
||||
public string Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت تراکنش به صورت Enum
|
||||
/// </summary>
|
||||
public PaymentTransactionStatus StatusEnum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ تراکنش
|
||||
/// </summary>
|
||||
public double Amount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه یکتای تراکنش
|
||||
/// </summary>
|
||||
public string TransactionId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.PaymentGateway;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.PaymentTransaction;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public interface IPaymentTransactionApplication
|
||||
{
|
||||
/// <summary>
|
||||
/// لیست تراکنش های پرداخت را بر اساس فیلتر مشخص شده برمی گرداند.
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<GetPaymentTransactionListViewModel>> GetPaymentTransactionList(
|
||||
GetPaymentTransactionListSearchModel searchModel);
|
||||
/// <summary>
|
||||
/// ایجاد تراکنش
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> Create(CreatePaymentTransaction command);
|
||||
|
||||
Task<WalletAmountResponse> GetWalletAmount(CancellationToken cancellationToken);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace CompanyManagment.App.Contracts.PaymentTransaction;
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت تراکنش درگاه پرداخت
|
||||
/// </summary>
|
||||
public enum PaymentTransactionStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// تراکنش با شکست مواجه شد.
|
||||
/// </summary>
|
||||
Failed,
|
||||
/// <summary>
|
||||
/// تراکنش با موفقیت انجام شد.
|
||||
/// </summary>
|
||||
Success,
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using _0_Framework.Application.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
public class ContractingPartyGetListSearchModel
|
||||
{
|
||||
/// <summary>
|
||||
/// تعدادی که برای لیست بعدی آیتم باید رد کنه
|
||||
/// </summary>
|
||||
public int PageIndex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام شرکت یا نام و نام خانوادگی طرف حساب
|
||||
/// </summary>
|
||||
public string FullNameOrCompanyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه ملی یا شماره ملی
|
||||
/// </summary>
|
||||
public string NationalIdOrNationalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام معرف
|
||||
/// </summary>
|
||||
public string RepresentativeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع طرف حساب
|
||||
/// </summary>
|
||||
public LegalType ContractingPartyType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت طرف حساب
|
||||
/// </summary>
|
||||
public ActivationStatus ContractingPartyStatus { get; set; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Application.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
public record ContractingPartyGetListEmployerViewModel(long EmployerId, string EmployerName);
|
||||
|
||||
public class ContractingPartyGetListViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی طرف حساب
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد طرف حساب
|
||||
/// </summary>
|
||||
public int ArchiveCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه ملی یا شماره ملی
|
||||
/// </summary>
|
||||
public string NationalIdOrNationalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام طرف حساب
|
||||
/// </summary>
|
||||
public string ContractingPartyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// لیست کارفرما ها
|
||||
/// </summary>
|
||||
public ICollection<ContractingPartyGetListEmployerViewModel> Employers { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تعداد بلاک
|
||||
/// </summary>
|
||||
public int BlockTimes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا بلاک هست
|
||||
/// </summary>
|
||||
public bool IsBlock { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا دارای قرارداد مالی است
|
||||
/// </summary>
|
||||
public bool HasInstitutionContract { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع طرف حساب
|
||||
/// </summary>
|
||||
public LegalType ContractingPartyType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت طرف حساب
|
||||
/// </summary>
|
||||
public ActivationStatus Status { get; set; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
public class ContractingPartySelectListViewModel: SelectListViewModel
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
public class CreateLegalContractingParty
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی معرف
|
||||
/// </summary>
|
||||
[Required]
|
||||
public long RepresentativeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام شرکت
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string CompanyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه ملی
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string NationalId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد طرف حساب
|
||||
/// </summary>
|
||||
[Required]
|
||||
public int ArchiveCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام مستعار
|
||||
/// </summary>
|
||||
public string SureName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره ثبت
|
||||
/// </summary>
|
||||
public string RegisterId { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن
|
||||
/// </summary>
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن نماینده
|
||||
/// </summary>
|
||||
public string AgentPhone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// استان
|
||||
/// </summary>
|
||||
public string State { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شهر
|
||||
/// </summary>
|
||||
public string City { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// محله
|
||||
/// </summary>
|
||||
public string Zone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نشانی
|
||||
/// </summary>
|
||||
public string Address { get; set; }
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
public class CreateRealContractingParty
|
||||
{
|
||||
/// <summary>
|
||||
/// نام
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string FName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام خانوادگی
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string LName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیدی معرف
|
||||
/// </summary>
|
||||
[Required]
|
||||
public long RepresentativeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد ملی
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string NationalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره شناسنامه
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string IdNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد طرف حساب
|
||||
/// </summary>
|
||||
[Required]
|
||||
public int ArchiveCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام مستعار
|
||||
/// </summary>
|
||||
public string SureName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن
|
||||
/// </summary>
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن نماینده
|
||||
/// </summary>
|
||||
public string AgentPhone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// استان
|
||||
/// </summary>
|
||||
public string State { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شهر
|
||||
/// </summary>
|
||||
public string City { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// محله
|
||||
/// </summary>
|
||||
public string Zone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نشانی
|
||||
/// </summary>
|
||||
public string Address { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش طرف حساب حقوقی
|
||||
/// </summary>
|
||||
public class EditLegalContractingParty:CreateLegalContractingParty
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی طرف حساب
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش طرف حساب حقیقی
|
||||
/// </summary>
|
||||
public class EditRealContractingParty:CreateRealContractingParty
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی طرف حساب
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
/// <summary>
|
||||
/// شماره ملی یا شناسه ملی بر اساس حقیقی یا حقوقی بودن
|
||||
/// </summary>
|
||||
public class GetContractingPartyNationalCodeOrNationalIdViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// شماره ملی یا شناسه ملی
|
||||
/// </summary>
|
||||
public string NationalCodeOrNationalId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
/// <summary>
|
||||
/// ویو مدل جزئیات طرف حساب حقوقی
|
||||
/// </summary>
|
||||
public class GetLegalContractingPartyDetailsViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی طرف حساب
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کامل شرکت(به همراه نام مستعار)ء
|
||||
/// </summary>
|
||||
public string CompanyFullName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام شرکت (بدون نام مستعار)ء
|
||||
/// </summary>
|
||||
public string CompanyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام مستعار
|
||||
/// </summary>
|
||||
public string SureName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره ثبت
|
||||
/// </summary>
|
||||
public string RegisterId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره ملی
|
||||
/// </summary>
|
||||
public string NationalId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تماس
|
||||
/// </summary>
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تماس نماینده
|
||||
/// </summary>
|
||||
public string AgentPhone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آدرس
|
||||
/// </summary>
|
||||
public string Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// معرف
|
||||
/// </summary>
|
||||
public string RepresentativeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیدی معرف
|
||||
/// </summary>
|
||||
public long RepresentativeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد طرف حساب
|
||||
/// </summary>
|
||||
public int ArchiveCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// استان
|
||||
/// </summary>
|
||||
public string State { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شهر
|
||||
/// </summary>
|
||||
public string City { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// محله
|
||||
/// </summary>
|
||||
public string Zone { get; set; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
/// <summary>
|
||||
/// ویو مدل جزئیات طرف حساب حقیقی
|
||||
/// </summary>
|
||||
public class GetRealContractingPartyDetailsViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی طرف حساب
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام
|
||||
/// </summary>
|
||||
public string FName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام خانوادگی
|
||||
/// </summary>
|
||||
public string LName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام و نام خانوادگی
|
||||
/// </summary>
|
||||
public string FullName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد ملی
|
||||
/// </summary>
|
||||
public string NationalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن
|
||||
/// </summary>
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن نماینده
|
||||
/// </summary>
|
||||
public string AgentPhone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آدرس
|
||||
/// </summary>
|
||||
public string Address { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// نام معرف
|
||||
/// </summary>
|
||||
public string RepresentativeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیدی معرف
|
||||
/// </summary>
|
||||
public long RepresentativeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام مستعار
|
||||
/// </summary>
|
||||
public string SureName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد طرف حساب
|
||||
/// </summary>
|
||||
public int ArchiveCode { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// استان
|
||||
/// </summary>
|
||||
public string State { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شهر
|
||||
/// </summary>
|
||||
public string City { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// محله
|
||||
/// </summary>
|
||||
public string Zone { get; set; }
|
||||
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using _0_Framework.Application;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
@@ -54,4 +55,79 @@ public interface IPersonalContractingPartyApp
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Api
|
||||
/// <summary>
|
||||
/// لیست طرف حساب ها
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <returns></returns>
|
||||
Task<ICollection<ContractingPartyGetListViewModel>> GetList(ContractingPartyGetListSearchModel searchModel);
|
||||
|
||||
/// <summary>
|
||||
/// لیست طرف حساب برای سلکت لیست سرچ
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<ContractingPartySelectListViewModel>> GetSelectList();
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد طرف حساب حقیقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> CreateReal(CreateRealContractingParty command);
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد ظرف حساب حقوقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> CreateLegal(CreateLegalContractingParty command);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// لیستی از شماره ملی یا شناسه ملی بر اساس حقیقی یا حقوقی بودن
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<GetContractingPartyNationalCodeOrNationalIdViewModel>> GetNationalCodeOrNationalId();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// حذف طرف حساب. در صورتی که طرف حساب دارای قرارداد مالی یا دارای کارفرما باشد غیرفعال میشود
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult<string>> Delete(long id);
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش طرف حساب حقیقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
OperationResult EditRealApi(EditRealContractingParty command);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش طرف حساب حقوقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
OperationResult EditLegal(EditLegalContractingParty command);
|
||||
|
||||
/// <summary>
|
||||
/// گرفتن جزئیات طرف حساب حقوقی
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<GetRealContractingPartyDetailsViewModel> GetRealDetails(long id);
|
||||
|
||||
/// <summary>
|
||||
/// گرفتن جزئیات طرف حساب حقوقی
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<GetLegalContractingPartyDetailsViewModel> GetLegalDetails(long id);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -47,4 +47,6 @@ public class PersonalContractingPartyViewModel
|
||||
public bool IsAuthenticated { get; set; }
|
||||
public List<EmployerViewModel> EmployerList { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Representative;
|
||||
|
||||
public class CreateLegalRepresentative
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// نام حقوقی
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "این مقدار نمی تواند خالی باشد")]
|
||||
public string LegalName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// شناسه ثبت
|
||||
/// </summary>
|
||||
[RegularExpression("^[0-9]*$", ErrorMessage = "لطفا فقط عدد وارد کنید")]
|
||||
public string RegisterId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// شناسه ملی
|
||||
/// </summary>
|
||||
[RegularExpression("[0-9]{11}", ErrorMessage = "لطفا فقط عدد 11 رقمی وارد کنید")]
|
||||
public string NationalId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن
|
||||
/// </summary>
|
||||
[DataType(DataType.PhoneNumber)]
|
||||
[RegularExpression(@"^\(?([0-9]{4})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$", ErrorMessage = "لطفا شماره تلفن معتبر وارد کنید")]
|
||||
public string Phone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن نماینده
|
||||
/// </summary>
|
||||
[RegularExpression("^[0-9]*$", ErrorMessage = "لطفا فقط عدد وارد کنید")]
|
||||
public string AgentPhone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آدرس
|
||||
/// </summary>
|
||||
public string Address { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Representative;
|
||||
|
||||
public class CreateRealRepresentative
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// نام کوچک
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "این مقدار نمی تواند خالی باشد")]
|
||||
public string FName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام خانوادگی
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "این مقدار نمی تواند خالی باشد")]
|
||||
public string LName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// کد ملی
|
||||
/// </summary>
|
||||
[RegularExpression("^[0-9]*$", ErrorMessage = "لطفا فقط عدد وارد کنید")]
|
||||
public string Nationalcode { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// شماره شناسنامه
|
||||
/// </summary>
|
||||
[MaxLength(12)]
|
||||
[MinLength(1)]
|
||||
[RegularExpression("^[0-9]*$", ErrorMessage = "لطفا فقط عدد وارد کنید")]
|
||||
public string IdNumber { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن
|
||||
/// </summary>
|
||||
[DataType(DataType.PhoneNumber)]
|
||||
[RegularExpression(@"^\(?([0-9]{4})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$", ErrorMessage = "لطفا شماره تلفن معتبر وارد کنید")]
|
||||
public string Phone { get; set; }
|
||||
|
||||
|
||||
[RegularExpression("^[0-9]*$", ErrorMessage = "لطفا فقط عدد وارد کنید")]
|
||||
public string AgentPhone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آدرس
|
||||
/// </summary>
|
||||
public string Address { get; set; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace CompanyManagment.App.Contracts.Representative;
|
||||
|
||||
public class EditLegalRepresentative : CreateLegalRepresentative
|
||||
{
|
||||
public long Id { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace CompanyManagment.App.Contracts.Representative;
|
||||
|
||||
public class EditRealRepresentative : CreateRealRepresentative
|
||||
{
|
||||
public long Id { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace CompanyManagment.App.Contracts.Representative;
|
||||
|
||||
/// <summary>
|
||||
/// ویو مدل سلکت لیست برای معرف
|
||||
/// </summary>
|
||||
public class GetSelectListRepresentativeViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام معرف
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
}
|
||||
@@ -24,8 +24,27 @@ public interface IRepresentativeApplication
|
||||
OperationResult DeleteRepresentative(long id);
|
||||
OperationResult Active(long id);
|
||||
OperationResult DeActive(long id);
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Api
|
||||
|
||||
Task<List<RepresentativeGetListViewModel>> GetList(RepresentativeGetListSearchModel searchModel);
|
||||
|
||||
bool HasAnyContractingParty(long id);
|
||||
|
||||
|
||||
OperationResult CreateReal(CreateRealRepresentative command);
|
||||
OperationResult CreateLegal(CreateLegalRepresentative command);
|
||||
OperationResult EditReal(EditRealRepresentative command);
|
||||
OperationResult EditLegal(EditLegalRepresentative command);
|
||||
|
||||
/// <summary>
|
||||
/// لیست نام های معرف برای سلکت لیست
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<GetSelectListRepresentativeViewModel>> GetSelectList();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using _0_Framework.Application.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Representative;
|
||||
|
||||
public class RepresentativeGetListSearchModel
|
||||
{
|
||||
|
||||
public int PageIndex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام شرکت یا نام و نام خانوادگی
|
||||
/// </summary>
|
||||
public string CompanyNameOrFullName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه ملی یا کدملی
|
||||
/// </summary>
|
||||
public string NationalCodeOrNationalId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیدی طرف حساب
|
||||
/// </summary>
|
||||
public long ContractingPartyId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع معرف
|
||||
/// </summary>
|
||||
public LegalType RepresentativeType { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت معرف
|
||||
/// </summary>
|
||||
public ActivationStatus RepresentativeStatus { get; set; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using _0_Framework.Application.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Representative;
|
||||
|
||||
public class RepresentativeGetListViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی معرف
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام حقیقی یا نام حقوقی
|
||||
/// </summary>
|
||||
public string RealNameOrLegalName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کدملی یا شناسه ملی
|
||||
/// </summary>
|
||||
public string NationalIdOrNationalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا این معرف طرف حسابی دارد؟
|
||||
/// </summary>
|
||||
public bool HasAnyContractingParty { get; set; }
|
||||
|
||||
public ActivationStatus RepresentativeStatus { get; set; }
|
||||
public LegalType RepresentativeType { get; set; }
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.InstitutionPlan;
|
||||
@@ -38,7 +39,7 @@ public interface ITemporaryClientRegistrationApplication
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> CreateOrUpdateWorkshopTemp(List<WorkshopTempViewModel> command);
|
||||
Task<OperationResult> CreateOrUpdateWorkshopTemp(List<WorkshopTempViewModel> command, long contractingPartyTempId);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت جمع کل خدمات برای یک کارگاه
|
||||
@@ -55,14 +56,14 @@ public interface ITemporaryClientRegistrationApplication
|
||||
/// <param name="paymentModel"></param>
|
||||
/// <returns></returns>
|
||||
Task<ReviewAndPaymentViewModel> GetTotalPaymentAndWorkshopList(long contractingPartyTempId,
|
||||
string periodModel = "12", string paymentModel = "OneTime");
|
||||
string periodModel = "12", string paymentModel = "OneTime", string contractStartType = "currentMonth");
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد یا ویرایش قرارداد موقت
|
||||
/// </summary>
|
||||
/// <param name="contractingPartyTempId"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel, double totalPayment, double valueAddedTax);
|
||||
Task<OperationResult> CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel, double totalPayment, double valueAddedTax, DateTime contractStart);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت کد برای کلاینت
|
||||
@@ -92,4 +93,11 @@ public interface ITemporaryClientRegistrationApplication
|
||||
/// <param name="verifyCode"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> PayOffCompleted(long contractingPartyTempId);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست طرف حساب هایی که ثبت نام آنها تکمیل شده
|
||||
/// جهت نمایش در کارپوشه
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<RegistrationWorkflowMainList>> RegistrationWorkflowMainList();
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
public class MonthlyInstallment
|
||||
{
|
||||
/// <summary>
|
||||
/// مبلغ قسط ماهانه
|
||||
/// </summary>
|
||||
public string InstallmentAmountStr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ قسط ماهانه
|
||||
/// </summary>
|
||||
public string InstalmentDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شمارنده قسط
|
||||
/// </summary>
|
||||
public string InstallmentCounter{ get; set; }
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
namespace CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
public class RegistrationWorkflowMainList
|
||||
{
|
||||
/// <summary>
|
||||
/// آی دی طرف حساب ثبت شده موقت
|
||||
/// </summary>
|
||||
public long ContractingPartyTempId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// نام کامل طرف حساب
|
||||
/// </summary>
|
||||
public string ContractingPartyFullName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره همراه
|
||||
/// </summary>
|
||||
public string Phone { get; set; }
|
||||
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
@@ -23,28 +24,54 @@ public class ReviewAndPaymentViewModel
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double WithoutTaxPaymentDouble { get; set; }
|
||||
public double OneTimeWithoutTaxPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// string
|
||||
/// </summary>
|
||||
public string WithoutTaxPaymentStr { get; set; }
|
||||
public string OneTimeWithoutTaxPaymentStr { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double TotalPaymentDouble { get; set; }
|
||||
public double OneTimeTotalPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// string
|
||||
/// </summary>
|
||||
public string TotalPaymentStr { get; set; }
|
||||
public string OneTimeTotalPaymentStr { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double MonthlyWithoutTaxPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// string
|
||||
/// </summary>
|
||||
public string MonthlyWithoutTaxPaymentStr { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double MonthlyTotalPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// string
|
||||
/// </summary>
|
||||
public string MonthlyTotalPaymentStr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مالیات بر ارزش افزوده
|
||||
/// Double
|
||||
@@ -83,4 +110,52 @@ public class ReviewAndPaymentViewModel
|
||||
/// آی دی طرف حساب
|
||||
/// </summary>
|
||||
public long ContractingPartTempId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// لیست اقساط ماهیانه
|
||||
/// </summary>
|
||||
public List<MonthlyInstallment> MonthlyInstallments { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع قرارداد در اول ماه جاری
|
||||
/// -
|
||||
/// شمسی
|
||||
/// </summary>
|
||||
public string ContractStartCurrentMonthFa { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع قرارداد در اول ماه جاری
|
||||
/// -
|
||||
/// میلادی
|
||||
/// </summary>
|
||||
public DateTime ContractStartCurrentMonthGr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع قرارداد در اول ماه بعد
|
||||
/// -
|
||||
/// شمسی
|
||||
/// </summary>
|
||||
public string ContractStartNextMonthFa{ get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع قرارداد در اول ماه بعد
|
||||
/// -
|
||||
/// میلادی
|
||||
/// </summary>
|
||||
public DateTime ContractStartNextMonthGr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ پایان قرارداد
|
||||
/// -
|
||||
/// میلادی
|
||||
/// </summary>
|
||||
public DateTime ContractEndGr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ پایان قرارداد
|
||||
/// -
|
||||
/// شمسی
|
||||
/// </summary>
|
||||
public string ContractEndFa { get; set; }
|
||||
}
|
||||
70
CompanyManagment.Application/ContactUsApplication.cs
Normal file
70
CompanyManagment.Application/ContactUsApplication.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.ContactUsAgg;
|
||||
using CompanyManagment.App.Contracts.ContactUs;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
public class ContactUsApplication : IContactUsApplication
|
||||
{
|
||||
private readonly IContactUsRepository _contactUsRepository;
|
||||
|
||||
public ContactUsApplication(IContactUsRepository contactUsRepository)
|
||||
{
|
||||
_contactUsRepository = contactUsRepository;
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateContactUs command)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
if (string.IsNullOrWhiteSpace(command.FirstName))
|
||||
{
|
||||
return op.Failed("لطفا نام خود را وارد کنید");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.LastName))
|
||||
{
|
||||
return op.Failed("لطفا نام خانوادگی خود را وارد کنید");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.Email))
|
||||
{
|
||||
return op.Failed("لطفا ایمیل خود را وارد کنید");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.PhoneNumber))
|
||||
{
|
||||
return op.Failed("لطفا شماره تماس خود را وارد کنید");
|
||||
}
|
||||
|
||||
if (!Regex.IsMatch(command.PhoneNumber, @"^(\+98|0)?9\d{9}$"))
|
||||
{
|
||||
return op.Failed("شماره تماس وارد شده نامعتبر است");
|
||||
}
|
||||
|
||||
if (!Regex.IsMatch(command.Email, @"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$"))
|
||||
{
|
||||
return op.Failed("ایمیل وارد شده نامعتبر است");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.Title))
|
||||
{
|
||||
return op.Failed("لطفا عنوان پیغام خود را وارد کنید");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.Message))
|
||||
{
|
||||
return op.Failed("لطفا پیغام خود را وارد کنید");
|
||||
}
|
||||
|
||||
var entity = new ContactUs(command.FirstName, command.LastName, command.Email, command.PhoneNumber,
|
||||
command.Title, command.Message);
|
||||
|
||||
_contactUsRepository.Create(entity);
|
||||
|
||||
_contactUsRepository.SaveChanges();
|
||||
|
||||
return op.Succcedded();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1660,5 +1660,19 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Api
|
||||
|
||||
public async Task<List<EmployeeSelectListViewModel>> GetSelectList(string searchText)
|
||||
{
|
||||
return await _EmployeeRepository.GetSelectList(searchText);
|
||||
}
|
||||
|
||||
public async Task<List<GetEmployeeListViewModel>> GetList(GetEmployeeListSearchModel searchModel)
|
||||
{
|
||||
return await _EmployeeRepository.GetList(searchModel);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Exceptions;
|
||||
using Company.Domain.empolyerAgg;
|
||||
using Company.Domain.WorkshopAgg;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
@@ -239,7 +240,7 @@ public class EmployerApplication : IEmployerApplication
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult Remove(long id)
|
||||
public OperationResult Remove_Old(long id)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
|
||||
@@ -894,10 +895,10 @@ public class EmployerApplication : IEmployerApplication
|
||||
return _EmployerRepository.GetEmployersHasWorkshop();
|
||||
}
|
||||
|
||||
public async Task<List<EmployerSelectListViewModel>> GetSelectList(string search)
|
||||
{
|
||||
return await _EmployerRepository.GetSelectList(search);
|
||||
}
|
||||
//public async Task<List<EmployerSelectListViewModel>> GetSelectList(string search)
|
||||
//{
|
||||
// return await _EmployerRepository.GetSelectList(search);
|
||||
//}
|
||||
#endregion
|
||||
|
||||
#region NewByHeydari
|
||||
@@ -957,4 +958,255 @@ public class EmployerApplication : IEmployerApplication
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Api
|
||||
public async Task<List<GetEmployerListViewModel>> GetEmployerList(GetEmployerSearchModel searchModel)
|
||||
{
|
||||
return await _EmployerRepository.GetEmployerList(searchModel);
|
||||
}
|
||||
public async Task<GetLegalEmployerDetailViewModel> GetLegalEmployerDetail(long id)
|
||||
{
|
||||
var employer = await _EmployerRepository.GetLegalEmployerDetail(id);
|
||||
if (employer == null)
|
||||
{
|
||||
throw new NotFoundException("کارفرمای مورد نطر یافت نشد");
|
||||
}
|
||||
return employer;
|
||||
}
|
||||
|
||||
public async Task<GetRealEmployerDetailViewModel> GetRealEmployerDetail(long id)
|
||||
{
|
||||
var employer = await _EmployerRepository.GetRealEmployerDetail(id);
|
||||
if (employer == null)
|
||||
{
|
||||
throw new NotFoundException("کارفرمای مورد نطر یافت نشد");
|
||||
}
|
||||
return employer;
|
||||
}
|
||||
|
||||
public async Task<OperationResult> CreateReal(CreateRealEmployer command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
if (_EmployerRepository.Exists(x =>
|
||||
(x.FName == command.FName && x.LName == command.LName) && x.Nationalcode == command.NationalCode && x.Nationalcode != null))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.FName))
|
||||
return opration.Failed("لطفا نام را وارد کنید");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(command.NationalCode))
|
||||
{
|
||||
if (command.NationalCode.NationalCodeValid() != "valid")
|
||||
{
|
||||
return opration.Failed("کدملی وارد شده نامعتبر است");
|
||||
}
|
||||
if (_EmployerRepository.Exists(x => x.Nationalcode == command.NationalCode && !string.IsNullOrWhiteSpace(command.NationalCode)))
|
||||
{
|
||||
return opration.Failed("کد ملی وارد شده تکراری است");
|
||||
}
|
||||
}
|
||||
string initial = "1300/10/11";
|
||||
var dateOfBirth = command.DateOfBirth?.ToGeorgianDateTime() ?? initial.ToGeorgianDateTime();
|
||||
var dateOfIssue = command.DateOfIssue?.ToGeorgianDateTime() ?? initial.ToGeorgianDateTime();
|
||||
|
||||
var gender = command.Gender switch
|
||||
{
|
||||
Gender.Male => "مرد",
|
||||
Gender.Female => "زن",
|
||||
Gender.None => null,
|
||||
_ => throw new BadRequestException("جنسیت وارد شده نامعتبر است")
|
||||
};
|
||||
|
||||
var employerData = new Employer(command.FName, command.LName, command.ContractingPartyId, gender,
|
||||
command.NationalCode, command.IdNumber, "ایرانی", command.FatherName, dateOfBirth,
|
||||
dateOfIssue, command.PlaceOfIssue, "*", "*", "*", "حقیقی", command.PhoneNumber,
|
||||
command.Telephone, "true", command.GovernmentSystemInfo.MclUsername, command.GovernmentSystemInfo.MclPassword, command.GovernmentSystemInfo.EServiceUsername, command.GovernmentSystemInfo.EServicePassword,
|
||||
command.GovernmentSystemInfo.TaxUsername, command.GovernmentSystemInfo.TaxPassword, command.GovernmentSystemInfo.SanaUsername, command.GovernmentSystemInfo.SanaPassword);
|
||||
|
||||
await _EmployerRepository.CreateAsync(employerData);
|
||||
await _EmployerRepository.SaveChangesAsync();
|
||||
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
public async Task<OperationResult> CreateLegal(CreateLegalEmployer command)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(command.EmployerLName))
|
||||
command.EmployerLName = "#";
|
||||
var opration = new OperationResult();
|
||||
if (_EmployerRepository.Exists(x =>
|
||||
x.LName == command.CompanyName && x.NationalId == command.NationalId && x.EmployerLName == command.EmployerLName))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
if (_EmployerRepository.Exists(x => x.NationalId == command.NationalId && !string.IsNullOrWhiteSpace(command.NationalId) && x.NationalId != null))
|
||||
{
|
||||
return opration.Failed(" شناسه ملی وارد شده تکراری است");
|
||||
}
|
||||
if (_EmployerRepository.Exists(x => x.LName == command.CompanyName))
|
||||
{
|
||||
return opration.Failed("نام شرکت وارد شده تکراری است");
|
||||
}
|
||||
if (_EmployerRepository.Exists(x => x.RegisterId == command.RegisterId && !string.IsNullOrWhiteSpace(command.RegisterId) && x.RegisterId != null))
|
||||
{
|
||||
return opration.Failed(" شماره ثبت وارد شده تکراری است");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(command.NationalId) && command.NationalId.Length != 11)
|
||||
{
|
||||
return opration.Failed(" شناسه ملی باید 11 رقم باشد");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(command.EmployerNationalCode))
|
||||
{
|
||||
if (command.EmployerNationalCode.NationalCodeValid() != "valid")
|
||||
{
|
||||
return opration.Failed("کد ملی وارد شده نا معتبر است");
|
||||
}
|
||||
}
|
||||
|
||||
string initial = "1300/10/11";
|
||||
var dateOfBirth = command.EmployerDateOfBirth?.ToGeorgianDateTime() ?? initial.ToGeorgianDateTime();
|
||||
var dateOfIssue = command.EmployerDateOfIssue?.ToGeorgianDateTime() ?? initial.ToGeorgianDateTime();
|
||||
|
||||
var gender = command.EmployerGender switch
|
||||
{
|
||||
Gender.Male => "مرد",
|
||||
Gender.Female => "زن",
|
||||
Gender.None => null,
|
||||
_ => throw new BadRequestException("جنسیت وارد شده نامعتبر است")
|
||||
};
|
||||
|
||||
|
||||
var legalEmployerData = new Employer(command.EmployerFName, command.CompanyName, command.ContractingPartyId, gender,
|
||||
command.EmployerNationalCode, command.EmployerIdNumber, "ایرانی", command.EmployerFatherName, dateOfBirth,
|
||||
dateOfIssue, command.EmployerPlaceOfIssue, command.RegisterId, command.NationalId, command.EmployerLName, "حقوقی", command.PhoneNumber,
|
||||
command.TelephoneNumber, "true", command.GovernmentSystemInfo.MclUsername, command.GovernmentSystemInfo.MclPassword,
|
||||
command.GovernmentSystemInfo.EServiceUsername, command.GovernmentSystemInfo.EServicePassword,
|
||||
command.GovernmentSystemInfo.TaxUsername, command.GovernmentSystemInfo.TaxPassword, command.GovernmentSystemInfo.SanaUsername, command.GovernmentSystemInfo.SanaPassword);
|
||||
|
||||
await _EmployerRepository.CreateAsync(legalEmployerData);
|
||||
await _EmployerRepository.SaveChangesAsync();
|
||||
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
public async Task<OperationResult> EditReal(EditRealEmployer command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var employer = _EmployerRepository.Get(command.Id);
|
||||
if (employer == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
if (_EmployerRepository.Exists(x =>
|
||||
(x.FName == command.FName && x.LName == command.LName) && x.Nationalcode == command.NationalCode && x.id != command.Id))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
if (!string.IsNullOrWhiteSpace(command.NationalCode))
|
||||
{
|
||||
if (command.NationalCode.NationalCodeValid() != "valid")
|
||||
{
|
||||
return opration.Failed("کد ملی وارد شده نا معتبر است");
|
||||
}
|
||||
}
|
||||
|
||||
if (_EmployerRepository.Exists(x => x.Nationalcode == command.NationalCode && !string.IsNullOrWhiteSpace(command.NationalCode) && x.id != command.Id))
|
||||
{
|
||||
|
||||
return opration.Failed(" کد ملی وارد شده تکراری است");
|
||||
}
|
||||
|
||||
|
||||
|
||||
string initial = "1300/10/11";
|
||||
|
||||
var dateOfBirth = command.DateOfBirth?.ToGeorgianDateTime() ?? initial.ToGeorgianDateTime();
|
||||
var dateOfIssue = command.DateOfIssue?.ToGeorgianDateTime() ?? initial.ToGeorgianDateTime();
|
||||
|
||||
var gender = command.Gender switch
|
||||
{
|
||||
Gender.Male => "مرد",
|
||||
Gender.Female => "زن",
|
||||
Gender.None => null,
|
||||
_ => throw new BadRequestException("جنسیت وارد شده نامعتبر است")
|
||||
};
|
||||
|
||||
employer.Edit(command.FName, command.LName, command.ContractingPartyId,
|
||||
gender, command.NationalCode, command.IdNumber, "ایرانی", command.FatherName,
|
||||
dateOfBirth, dateOfIssue, command.PlaceOfIssue, command.PhoneNumber, command.Telephone,
|
||||
command.GovernmentSystemInfo.MclUsername, command.GovernmentSystemInfo.MclPassword, command.GovernmentSystemInfo.EServiceUsername, command.GovernmentSystemInfo.EServicePassword,
|
||||
command.GovernmentSystemInfo.TaxUsername, command.GovernmentSystemInfo.TaxPassword, command.GovernmentSystemInfo.SanaUsername, command.GovernmentSystemInfo.SanaPassword, null);
|
||||
|
||||
await _EmployerRepository.SaveChangesAsync();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
public async Task<OperationResult> EditLegal(EditLegalEmployer command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var legalEmployer = _EmployerRepository.Get(command.Id);
|
||||
if (legalEmployer == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
if (_EmployerRepository.Exists(x =>
|
||||
x.LName == command.CompanyName && x.NationalId == command.NationalId && !string.IsNullOrWhiteSpace(command.NationalId) && x.id != command.Id))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(command.NationalId) && command.NationalId.Length != 11)
|
||||
{
|
||||
return opration.Failed(" شناسه ملی باید 11 رقم باشد");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(command.EmployerNationalCode))
|
||||
{
|
||||
if (command.EmployerNationalCode.NationalCodeValid() != "valid")
|
||||
{
|
||||
return opration.Failed("کد ملی وارد شده نا معتبر است");
|
||||
}
|
||||
}
|
||||
|
||||
var gender = command.EmployerGender switch
|
||||
{
|
||||
Gender.Male => "مرد",
|
||||
Gender.Female => "زن",
|
||||
Gender.None => null,
|
||||
_ => throw new BadRequestException("جنسیت وارد شده نامعتبر است")
|
||||
};
|
||||
|
||||
string initial = "1300/10/11";
|
||||
var dateOfBirth = command.EmployerDateOfBirth?.ToGeorgianDateTime() ?? initial.ToGeorgianDateTime();
|
||||
var dateOfIssue = command.EmployerDateOfIssue?.ToGeorgianDateTime() ?? initial.ToGeorgianDateTime();
|
||||
legalEmployer.EditLegal(command.EmployerFName, command.CompanyName, command.ContractingPartyId, gender,
|
||||
command.EmployerNationalCode, command.EmployerIdNumber, "ایرانی", command.EmployerFatherName, dateOfBirth,
|
||||
dateOfIssue, command.EmployerPlaceOfIssue, command.RegisterId, command.NationalId, command.EmployerLName,
|
||||
command.PhoneNumber, command.TelephoneNumber, command.GovernmentSystemInfo.MclUsername, command.GovernmentSystemInfo.MclUsername, command.GovernmentSystemInfo.EServiceUsername, command.GovernmentSystemInfo.EServicePassword,
|
||||
command.GovernmentSystemInfo.TaxUsername, command.GovernmentSystemInfo.TaxPassword, command.GovernmentSystemInfo.SanaUsername, command.GovernmentSystemInfo.SanaPassword, null);
|
||||
|
||||
await _EmployerRepository.SaveChangesAsync();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
public async Task<List<EmployerSelectListViewModel>> GetSelectList(string search)
|
||||
{
|
||||
return await _EmployerRepository.GetSelectList(search);
|
||||
}
|
||||
|
||||
async Task<OperationResult<string>> IEmployerApplication.Remove(long id)
|
||||
{
|
||||
var employer = _EmployerRepository.Get(id);
|
||||
if (employer == null)
|
||||
throw new NotFoundException("دیتای مورد نظر یافت نشد");
|
||||
|
||||
var workshops = _workshopRepository.GetWorkshopsByEmployerId([id]);
|
||||
|
||||
if (workshops.Any())
|
||||
{
|
||||
return await _EmployerRepository.DeactivateWithSubordinates(id);
|
||||
}
|
||||
|
||||
_EmployerRepository.Remove(id);
|
||||
|
||||
return new OperationResult<string>().Succcedded("Deleted");
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.FinancialStatmentAgg;
|
||||
using CompanyManagment.App.Contracts.FinancialStatment;
|
||||
@@ -110,4 +111,10 @@ public class FinancialStatmentApplication : IFinancialStatmentApplication
|
||||
{
|
||||
return _financialStatmentRepository.GetDetailsByContractingPartyId(contractingPartyId);
|
||||
}
|
||||
|
||||
public async Task<ClientFinancialStatementViewModel> GetClientFinancialStatement(
|
||||
ClientFinancialStatementSearchModel searchModel, long accountId)
|
||||
{
|
||||
return await _financialStatmentRepository.GetClientFinancialStatement(accountId, searchModel);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.PaymentGateway;
|
||||
using Company.Domain.PaymentTransactionAgg;
|
||||
using CompanyManagment.App.Contracts.PaymentTransaction;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
public class PaymentTransactionApplication : IPaymentTransactionApplication
|
||||
{
|
||||
private readonly IPaymentTransactionRepository _paymentTransactionRepository;
|
||||
private readonly IPaymentGateway _paymentGateway;
|
||||
|
||||
public PaymentTransactionApplication(IPaymentTransactionRepository paymentTransactionRepository,IHttpClientFactory httpClientFactory)
|
||||
{
|
||||
_paymentTransactionRepository = paymentTransactionRepository;
|
||||
_paymentGateway = new AqayePardakhtPaymentGateway(httpClientFactory);
|
||||
}
|
||||
|
||||
public async Task<List<GetPaymentTransactionListViewModel>> GetPaymentTransactionList(
|
||||
GetPaymentTransactionListSearchModel searchModel)
|
||||
{
|
||||
return await _paymentTransactionRepository.GetPaymentTransactionList(searchModel);
|
||||
}
|
||||
|
||||
public async Task<OperationResult> Create(CreatePaymentTransaction command)
|
||||
{
|
||||
var operationResult = new OperationResult();
|
||||
var entity = new PaymentTransaction(
|
||||
command.ContractingPartyId,
|
||||
command.BankAccountHolderName,
|
||||
command.BankName,
|
||||
command.CardNumber,
|
||||
command.ShebaNumber,
|
||||
command.AccountNumber,
|
||||
command.Status,
|
||||
command.Amount,
|
||||
command.TransactionId,
|
||||
command.ContractingPartyName);
|
||||
|
||||
await _paymentTransactionRepository.CreateAsync(entity);
|
||||
await _paymentTransactionRepository.SaveChangesAsync();
|
||||
return operationResult.Succcedded();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public async Task<WalletAmountResponse> GetWalletAmount(CancellationToken cancellationToken)
|
||||
{
|
||||
var result = await _paymentGateway.GetWalletAmount(cancellationToken);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
using Company.Domain.ContarctingPartyAgg;
|
||||
using Company.Domain.empolyerAgg;
|
||||
using CompanyManagment.App.Contracts.Representative;
|
||||
using Company.Domain.InstitutionContractAgg;
|
||||
using CompanyManagment.EFCore.Repository;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
{
|
||||
private readonly IPersonalContractingPartyRepository _personalContractingPartyRepository2;
|
||||
private readonly IPersonalContractingPartyRepository _personalContractingPartyRepository;
|
||||
private readonly IRepresentativeApplication _representativeApplication;
|
||||
private readonly IEmployerRepository _employerRepository;
|
||||
private readonly IInstitutionContractRepository _institutionContractRepository;
|
||||
@@ -26,7 +28,7 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
public PersonalContractingPartyApplication(
|
||||
IPersonalContractingPartyRepository personalContractingPartyRepository, IRepresentativeApplication representativeApplication, IEmployerRepository employerRepository, IInstitutionContractRepository institutionContractRepository)
|
||||
{
|
||||
_personalContractingPartyRepository2 = personalContractingPartyRepository;
|
||||
_personalContractingPartyRepository = personalContractingPartyRepository;
|
||||
_representativeApplication = representativeApplication;
|
||||
_employerRepository = employerRepository;
|
||||
_institutionContractRepository = institutionContractRepository;
|
||||
@@ -36,7 +38,7 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
public OperationResult Create(CreatePersonalContractingParty command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
if (_personalContractingPartyRepository2.Exists(x =>
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
x.LName == command.LName && x.Nationalcode == command.Nationalcode && x.SureName == command.SureName ))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
if (command.RepresentativeId < 1)
|
||||
@@ -54,14 +56,14 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
// return opration.Failed("نام خانوادگی وارد شده تکراری است");
|
||||
|
||||
//}
|
||||
if (_personalContractingPartyRepository2.Exists(x => x.Nationalcode == command.Nationalcode && x.LName != command.LName))
|
||||
if (_personalContractingPartyRepository.Exists(x => x.Nationalcode == command.Nationalcode && x.LName != command.LName))
|
||||
{
|
||||
nationalcodeIsOk = false;
|
||||
|
||||
return opration.Failed("کد ملی وارد شده تکراری است");
|
||||
}
|
||||
|
||||
if (_personalContractingPartyRepository2.Exists(x => x.ArchiveCode == command.ArchiveCode))
|
||||
if (_personalContractingPartyRepository.Exists(x => x.ArchiveCode == command.ArchiveCode))
|
||||
return opration.Failed("کد طرف حساب تکراری است");
|
||||
|
||||
try
|
||||
@@ -132,8 +134,8 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
command.State,command.City,command.Zone,command.SureName);
|
||||
|
||||
|
||||
_personalContractingPartyRepository2.Create(personalContractingParty);
|
||||
_personalContractingPartyRepository2.SaveChanges();
|
||||
_personalContractingPartyRepository.Create(personalContractingParty);
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
|
||||
return opration.Succcedded();
|
||||
|
||||
@@ -152,13 +154,13 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
public OperationResult Edit2(EditPersonalContractingParty command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var personalContractingParty = _personalContractingPartyRepository2.Get(command.Id);
|
||||
var personalContractingParty = _personalContractingPartyRepository.Get(command.Id);
|
||||
if (personalContractingParty == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
personalContractingParty.Edit2(command.Address);
|
||||
|
||||
_personalContractingPartyRepository2.SaveChanges();
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
@@ -166,7 +168,7 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
{
|
||||
|
||||
var opration = new OperationResult();
|
||||
if (_personalContractingPartyRepository2.Exists(x =>
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
x.LName == command.LName && x.RegisterId == command.RegisterId && x.SureName == command.SureName))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
if (command.RepresentativeId < 1)
|
||||
@@ -174,23 +176,23 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
|
||||
|
||||
|
||||
if (_personalContractingPartyRepository2.Exists(x => x.LName == command.LName && x.SureName == command.SureName))
|
||||
if (_personalContractingPartyRepository.Exists(x => x.LName == command.LName && x.SureName == command.SureName))
|
||||
{
|
||||
legalNameIsOk = false;
|
||||
return opration.Failed("نام شرکت وارد شده تکراری است");
|
||||
}
|
||||
if (_personalContractingPartyRepository2.Exists(x => x.RegisterId == command.RegisterId && x.LName != command.LName))
|
||||
if (_personalContractingPartyRepository.Exists(x => x.RegisterId == command.RegisterId && x.LName != command.LName))
|
||||
{
|
||||
registerIdIsOk = false;
|
||||
return opration.Failed("شماره ثبت وارد شده تکراری است");
|
||||
|
||||
}
|
||||
if (_personalContractingPartyRepository2.Exists(x => x.NationalId == command.NationalId && x.LName != command.LName))
|
||||
if (_personalContractingPartyRepository.Exists(x => x.NationalId == command.NationalId && x.LName != command.LName))
|
||||
{
|
||||
nationalIdIsOk = false;
|
||||
return opration.Failed("شناسه ملی وارد شده تکراری است");
|
||||
}
|
||||
if (_personalContractingPartyRepository2.Exists(x => x.ArchiveCode == command.ArchiveCode))
|
||||
if (_personalContractingPartyRepository.Exists(x => x.ArchiveCode == command.ArchiveCode))
|
||||
return opration.Failed("کد طرف حساب تکراری است");
|
||||
|
||||
|
||||
@@ -204,8 +206,8 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
command.State, command.City, command.Zone,command.SureName);
|
||||
|
||||
|
||||
_personalContractingPartyRepository2.Create(legalContractingParty);
|
||||
_personalContractingPartyRepository2.SaveChanges();
|
||||
_personalContractingPartyRepository.Create(legalContractingParty);
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
|
||||
return opration.Succcedded();
|
||||
|
||||
@@ -223,15 +225,15 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
{
|
||||
|
||||
var opration = new OperationResult();
|
||||
var personalContractingParty = _personalContractingPartyRepository2.Get(command.Id);
|
||||
var personalContractingParty = _personalContractingPartyRepository.Get(command.Id);
|
||||
if (personalContractingParty == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
if (command.RepresentativeId < 1)
|
||||
return opration.Failed("لطفا معرف را انتخاب کنید");
|
||||
if (_personalContractingPartyRepository2.Exists(x =>
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
x.LName == command.LName && x.Nationalcode == command.Nationalcode && x.SureName == command.SureName && x.id != command.Id))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
if (_personalContractingPartyRepository2.Exists(x => x.ArchiveCode == command.ArchiveCode && x.id != command.Id))
|
||||
if (_personalContractingPartyRepository.Exists(x => x.ArchiveCode == command.ArchiveCode && x.id != command.Id))
|
||||
return opration.Failed("کد طرف حساب تکراری است");
|
||||
try
|
||||
{
|
||||
@@ -300,7 +302,7 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
command.Phone, command.AgentPhone, command.Address, command.RepresentativeId, representative.FullName, command.ArchiveCode,
|
||||
command.State, command.City, command.Zone,command.SureName);
|
||||
|
||||
_personalContractingPartyRepository2.SaveChanges();
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
else
|
||||
@@ -314,16 +316,16 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
{
|
||||
|
||||
var opration = new OperationResult();
|
||||
var legalContractingParty = _personalContractingPartyRepository2.Get(command.Id);
|
||||
var legalContractingParty = _personalContractingPartyRepository.Get(command.Id);
|
||||
if (legalContractingParty == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
if (_personalContractingPartyRepository2.Exists(x =>
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
x.LName== command.LName && x.RegisterId == command.RegisterId &&x.SureName == command.SureName &&x.id != command.Id))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
if (command.RepresentativeId < 1)
|
||||
return opration.Failed("لطفا معرف را انتخاب کنید");
|
||||
if (_personalContractingPartyRepository2.Exists(x => x.ArchiveCode == command.ArchiveCode && x.id != command.Id))
|
||||
if (_personalContractingPartyRepository.Exists(x => x.ArchiveCode == command.ArchiveCode && x.id != command.Id))
|
||||
return opration.Failed("کد طرف حساب تکراری است");
|
||||
var representative = _representativeApplication.GetDetails(command.RepresentativeId);
|
||||
legalContractingParty.EditLegal(command.LName, command.RegisterId,
|
||||
@@ -331,54 +333,54 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
command.Phone, command.AgentPhone, command.Address, command.RepresentativeId, representative.FullName,command.ArchiveCode,
|
||||
command.State, command.City, command.Zone, command.SureName);
|
||||
|
||||
_personalContractingPartyRepository2.SaveChanges();
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
public EditPersonalContractingParty GetDetails(long id)
|
||||
{
|
||||
return _personalContractingPartyRepository2.GetDetails(id);
|
||||
return _personalContractingPartyRepository.GetDetails(id);
|
||||
}
|
||||
|
||||
public string IsBlockByEmployerId(long employerId)
|
||||
{
|
||||
return _personalContractingPartyRepository2.IsBlockByEmployerId(employerId);
|
||||
return _personalContractingPartyRepository.IsBlockByEmployerId(employerId);
|
||||
}
|
||||
|
||||
public EditPersonalContractingParty GetDetailsToEdit(long id)
|
||||
{
|
||||
return _personalContractingPartyRepository2.GetDetailsToEdit(id);
|
||||
return _personalContractingPartyRepository.GetDetailsToEdit(id);
|
||||
|
||||
}
|
||||
|
||||
public string GetFullName(long id)
|
||||
{
|
||||
return _personalContractingPartyRepository2.GetFullName(id);
|
||||
return _personalContractingPartyRepository.GetFullName(id);
|
||||
}
|
||||
|
||||
public List<PersonalContractingPartyViewModel> GetPersonalContractingParties()
|
||||
{
|
||||
return _personalContractingPartyRepository2.GetPersonalContractingParties();
|
||||
return _personalContractingPartyRepository.GetPersonalContractingParties();
|
||||
}
|
||||
|
||||
public List<PersonalContractingPartyViewModel> Search(PersonalContractingPartySearchModel searchModel2)
|
||||
{
|
||||
return _personalContractingPartyRepository2.Search(searchModel2);
|
||||
return _personalContractingPartyRepository.Search(searchModel2);
|
||||
}
|
||||
|
||||
public int GetLastArchiveCode()
|
||||
{
|
||||
return _personalContractingPartyRepository2.GetLastArchiveCode();
|
||||
return _personalContractingPartyRepository.GetLastArchiveCode();
|
||||
}
|
||||
#region Mahan
|
||||
public List<string> SearchByName(string name)
|
||||
{
|
||||
return _personalContractingPartyRepository2.SearchByName(name);
|
||||
return _personalContractingPartyRepository.SearchByName(name);
|
||||
}
|
||||
#endregion
|
||||
public ContractingPartyAndStatmentIdViewModel GetContractingpartyIdByAccountId(long accountId)
|
||||
{
|
||||
return _personalContractingPartyRepository2.GetContractingpartyIdByAccountId(accountId);
|
||||
return _personalContractingPartyRepository.GetContractingpartyIdByAccountId(accountId);
|
||||
}
|
||||
|
||||
|
||||
@@ -386,15 +388,15 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
|
||||
public List<PersonalContractingPartyViewModel> GetPersonalContractingPartiesForNationalcode(string searchText)
|
||||
{
|
||||
return _personalContractingPartyRepository2.GetPersonalContractingPartiesForNationalcode(searchText);
|
||||
return _personalContractingPartyRepository.GetPersonalContractingPartiesForNationalcode(searchText);
|
||||
|
||||
}
|
||||
public List<PersonalContractingPartyViewModel> SearchForMain(PersonalContractingPartySearchModel searchModel2)
|
||||
{
|
||||
var result= _personalContractingPartyRepository2.SearchForMain(searchModel2);
|
||||
var result= _personalContractingPartyRepository.SearchForMain(searchModel2);
|
||||
foreach (var item in result)
|
||||
{
|
||||
item.HasInstitutionContract = _personalContractingPartyRepository2.GetHasContract(item.id);
|
||||
item.HasInstitutionContract = _personalContractingPartyRepository.GetHasContract(item.id);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -411,12 +413,12 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
//اونهایی که کارفرما یا قرارداد غیر فعال دارند غیر فعال می شوند
|
||||
if (_employerRepository.Exists(x => x.ContractingPartyId == id)|| _institutionContractRepository.Exists(x => x.ContractingPartyId == id))
|
||||
{
|
||||
opration= _personalContractingPartyRepository2.DeActiveAll(id);
|
||||
opration= _personalContractingPartyRepository.DeActiveAll(id);
|
||||
return opration;
|
||||
}
|
||||
else
|
||||
{
|
||||
opration = _personalContractingPartyRepository2.DeletePersonalContractingParties(id);
|
||||
opration = _personalContractingPartyRepository.DeletePersonalContractingParties(id);
|
||||
}
|
||||
|
||||
return opration;
|
||||
@@ -428,10 +430,10 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
{
|
||||
|
||||
var opration = new OperationResult();
|
||||
var contract = _personalContractingPartyRepository2.Get(id);
|
||||
var contract = _personalContractingPartyRepository.Get(id);
|
||||
if (contract == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
return _personalContractingPartyRepository2.ActiveAll(id);
|
||||
return _personalContractingPartyRepository.ActiveAll(id);
|
||||
|
||||
|
||||
//var opration = new OperationResult();
|
||||
@@ -446,44 +448,44 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
public OperationResult DeActive(long id)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var personalContracting = _personalContractingPartyRepository2.Get(id);
|
||||
var personalContracting = _personalContractingPartyRepository.Get(id);
|
||||
if (personalContracting == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
personalContracting.DeActive();
|
||||
|
||||
|
||||
_personalContractingPartyRepository2.SaveChanges();
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
public bool GetHasContract(long id)
|
||||
{
|
||||
|
||||
return _personalContractingPartyRepository2.GetHasContract(id);
|
||||
return _personalContractingPartyRepository.GetHasContract(id);
|
||||
|
||||
}
|
||||
|
||||
public OperationResult Block(long id)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var contract = _personalContractingPartyRepository2.Get(id);
|
||||
var contract = _personalContractingPartyRepository.Get(id);
|
||||
if (contract == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
contract.Block();
|
||||
|
||||
_personalContractingPartyRepository2.SaveChanges();
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
public OperationResult DisableBlock(long id)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var personalContracting = _personalContractingPartyRepository2.Get(id);
|
||||
var personalContracting = _personalContractingPartyRepository.Get(id);
|
||||
if (personalContracting == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
int blockTimes = personalContracting.BlockTimes + 1;
|
||||
personalContracting.DisableBlock(blockTimes);
|
||||
_personalContractingPartyRepository2.SaveChanges();
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
|
||||
|
||||
|
||||
@@ -499,7 +501,225 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
|
||||
public bool IsBlockCheckByWorkshopId(long workshopId)
|
||||
{
|
||||
return _personalContractingPartyRepository2.IsBlockCheckByWorkshopId(workshopId);
|
||||
return _personalContractingPartyRepository.IsBlockCheckByWorkshopId(workshopId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Api
|
||||
|
||||
|
||||
public async Task<ICollection<ContractingPartyGetListViewModel>> GetList(
|
||||
ContractingPartyGetListSearchModel searchModel)
|
||||
{
|
||||
return await _personalContractingPartyRepository.GetList(searchModel);
|
||||
}
|
||||
|
||||
public async Task<List<ContractingPartySelectListViewModel>> GetSelectList()
|
||||
{
|
||||
return await _personalContractingPartyRepository.GetSelectList();
|
||||
}
|
||||
public async Task<OperationResult> CreateReal(CreateRealContractingParty command)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
x.LName == command.LName && x.Nationalcode == command.NationalCode && x.SureName == command.SureName))
|
||||
return operation.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
if (command.RepresentativeId < 1)
|
||||
return operation.Failed("لطفا معرف را انتخاب کنید");
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x => x.Nationalcode == command.NationalCode && x.LName != command.LName))
|
||||
{
|
||||
nationalcodeIsOk = false;
|
||||
|
||||
return operation.Failed("کد ملی وارد شده تکراری است");
|
||||
}
|
||||
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x => x.ArchiveCode == command.ArchiveCode))
|
||||
return operation.Failed("کد طرف حساب تکراری است");
|
||||
|
||||
if (command.NationalCode.NationalCodeValid() != "valid")
|
||||
{
|
||||
return operation.Failed("کد ملی وارد شده نا معتبر است");
|
||||
}
|
||||
|
||||
var representative = _representativeApplication.GetDetails(command.RepresentativeId);
|
||||
var personalContractingParty = new PersonalContractingParty(command.FName, command.LName,
|
||||
command.NationalCode, command.IdNumber, "*", "*",
|
||||
"حقیقی",
|
||||
command.PhoneNumber, command.AgentPhone, command.Address, command.RepresentativeId, representative.FullName, command.ArchiveCode,
|
||||
command.State, command.City, command.Zone, command.SureName);
|
||||
|
||||
|
||||
await _personalContractingPartyRepository.CreateAsync(personalContractingParty);
|
||||
await _personalContractingPartyRepository.SaveChangesAsync();
|
||||
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
public async Task<OperationResult> CreateLegal(CreateLegalContractingParty command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
x.LName == command.CompanyName && x.RegisterId == command.RegisterId && x.SureName == command.SureName))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
if (command.RepresentativeId < 1)
|
||||
return opration.Failed("لطفا معرف را انتخاب کنید");
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
x.LName == command.CompanyName && x.SureName == command.SureName))
|
||||
{
|
||||
legalNameIsOk = false;
|
||||
return opration.Failed("نام شرکت وارد شده تکراری است");
|
||||
}
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
x.RegisterId == command.RegisterId && x.LName != command.CompanyName))
|
||||
{
|
||||
registerIdIsOk = false;
|
||||
return opration.Failed("شماره ثبت وارد شده تکراری است");
|
||||
|
||||
}
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
x.NationalId == command.NationalId && x.LName != command.CompanyName))
|
||||
{
|
||||
nationalIdIsOk = false;
|
||||
return opration.Failed("شناسه ملی وارد شده تکراری است");
|
||||
}
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x => x.ArchiveCode == command.ArchiveCode))
|
||||
return opration.Failed("کد طرف حساب تکراری است");
|
||||
|
||||
|
||||
|
||||
var representative = _representativeApplication.GetDetails(command.RepresentativeId);
|
||||
var legalContractingParty = new PersonalContractingParty("*", command.CompanyName,
|
||||
"*", "*", command.RegisterId, command.NationalId,
|
||||
"حقوقی",
|
||||
command.PhoneNumber, command.AgentPhone, command.Address, command.RepresentativeId, representative.FullName,
|
||||
command.ArchiveCode,
|
||||
command.State, command.City, command.Zone, command.SureName);
|
||||
|
||||
|
||||
await _personalContractingPartyRepository.CreateAsync(legalContractingParty);
|
||||
await _personalContractingPartyRepository.SaveChangesAsync();
|
||||
|
||||
return opration.Succcedded();
|
||||
|
||||
}
|
||||
|
||||
public async Task<List<GetContractingPartyNationalCodeOrNationalIdViewModel>> GetNationalCodeOrNationalId()
|
||||
{
|
||||
return await _personalContractingPartyRepository.GetNationalCodeOrNationalId();
|
||||
}
|
||||
|
||||
public async Task<OperationResult<string>> Delete(long id)
|
||||
{
|
||||
var operationResult = new OperationResult<string>();
|
||||
|
||||
try
|
||||
{
|
||||
//اگر دارای قرارداد یا دازای کارفرما باشد غیر فعال می شود
|
||||
if (_employerRepository.Exists(x => x.ContractingPartyId == id) || _institutionContractRepository.Exists(x => x.ContractingPartyId == id))
|
||||
{
|
||||
operationResult = await _personalContractingPartyRepository.DeactivateWithSubordinates(id);
|
||||
return operationResult;
|
||||
}
|
||||
|
||||
var entity = _personalContractingPartyRepository.Get(id);
|
||||
_personalContractingPartyRepository.Remove(entity);
|
||||
operationResult.Succcedded("Deleted");
|
||||
}
|
||||
catch
|
||||
{
|
||||
return operationResult.Failed("خطایی رخ داده است");
|
||||
}
|
||||
|
||||
return operationResult;
|
||||
}
|
||||
|
||||
public OperationResult EditRealApi(EditRealContractingParty command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var personalContractingParty = _personalContractingPartyRepository.Get(command.Id);
|
||||
|
||||
if (personalContractingParty == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
if (command.RepresentativeId < 1)
|
||||
return opration.Failed("لطفا معرف را انتخاب کنید");
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
x.LName == command.LName && x.Nationalcode == command.NationalCode && x.SureName == command.SureName && x.id != command.Id))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x => x.ArchiveCode == command.ArchiveCode && x.id != command.Id))
|
||||
return opration.Failed("کد طرف حساب تکراری است");
|
||||
|
||||
if (command.NationalCode.NationalCodeValid() != "valid")
|
||||
{
|
||||
return opration.Failed("کد ملی وارد شده نا معتبر است");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var representative = _representativeApplication.GetDetails(command.RepresentativeId);
|
||||
personalContractingParty.Edit(command.FName, command.LName,
|
||||
command.NationalCode, command.IdNumber,
|
||||
command.PhoneNumber, command.AgentPhone, command.Address, command.RepresentativeId, representative.FullName, command.ArchiveCode,
|
||||
command.State, command.City, command.Zone, command.SureName);
|
||||
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
return opration.Failed("خطایی رخ داده است");
|
||||
}
|
||||
}
|
||||
|
||||
public OperationResult EditLegal(EditLegalContractingParty command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var legalContractingParty = _personalContractingPartyRepository.Get(command.Id);
|
||||
if (legalContractingParty == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
x.LName == command.CompanyName && x.RegisterId == command.RegisterId && x.SureName == command.SureName && x.id != command.Id))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
if (command.RepresentativeId < 1)
|
||||
return opration.Failed("لطفا معرف را انتخاب کنید");
|
||||
if (_personalContractingPartyRepository.Exists(x => x.ArchiveCode == command.ArchiveCode && x.id != command.Id))
|
||||
return opration.Failed("کد طرف حساب تکراری است");
|
||||
var representative = _representativeApplication.GetDetails(command.RepresentativeId);
|
||||
legalContractingParty.EditLegal(command.CompanyName, command.RegisterId,
|
||||
command.NationalId,
|
||||
command.PhoneNumber, command.AgentPhone, command.Address, command.RepresentativeId, representative.FullName, command.ArchiveCode,
|
||||
command.State, command.City, command.Zone, command.SureName);
|
||||
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
public async Task<GetRealContractingPartyDetailsViewModel> GetRealDetails(long id)
|
||||
{
|
||||
return await _personalContractingPartyRepository.GetRealDetails(id);
|
||||
}
|
||||
|
||||
public async Task<GetLegalContractingPartyDetailsViewModel> GetLegalDetails(long id)
|
||||
{
|
||||
return await _personalContractingPartyRepository.GetLegalDetails(id);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.RepresentativeAgg;
|
||||
using CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
@@ -350,5 +352,290 @@ public class RepresentativeApplication : IRepresentativeApplication
|
||||
_representativeRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Api
|
||||
public OperationResult CreateReal(CreateRealRepresentative command)
|
||||
{
|
||||
var nationalCode = string.Empty;
|
||||
var op = new OperationResult();
|
||||
if (_representativeRepository.Exists(x =>
|
||||
x.LName == command.LName && x.Nationalcode == command.Nationalcode))
|
||||
return op.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
if (_representativeRepository.Exists(x => x.LName == command.LName))
|
||||
{
|
||||
|
||||
|
||||
return op.Failed("نام خانوادگی وارد شده تکراری است");
|
||||
|
||||
}
|
||||
if (_representativeRepository.Exists(x => x.Nationalcode == command.Nationalcode))
|
||||
{
|
||||
|
||||
|
||||
return op.Failed("کد ملی وارد شده تکراری است");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(command.Nationalcode))
|
||||
{
|
||||
if (_representativeRepository.Exists(x => x.Nationalcode == command.Nationalcode))
|
||||
{
|
||||
|
||||
|
||||
return op.Failed("کد ملی وارد شده تکراری است");
|
||||
}
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
char[] chArray = command.Nationalcode.ToCharArray();
|
||||
int[] numArray = new int[chArray.Length];
|
||||
var cunt = chArray.Length;
|
||||
for (int i = 0; i < chArray.Length; i++)
|
||||
{
|
||||
numArray[i] = (int)char.GetNumericValue(chArray[i]);
|
||||
}
|
||||
|
||||
int num2 = numArray[9];
|
||||
switch (command.Nationalcode)
|
||||
{
|
||||
case "0000000000":
|
||||
case "1111111111":
|
||||
case "22222222222":
|
||||
case "33333333333":
|
||||
case "4444444444":
|
||||
case "5555555555":
|
||||
case "6666666666":
|
||||
case "7777777777":
|
||||
case "8888888888":
|
||||
case "9999999999":
|
||||
|
||||
|
||||
|
||||
|
||||
return op.Failed("کد ملی وارد شده صحیح نمی باشد");
|
||||
|
||||
|
||||
}
|
||||
|
||||
int num3 =
|
||||
((((((((numArray[0] * 10) + (numArray[1] * 9)) + (numArray[2] * 8)) + (numArray[3] * 7)) +
|
||||
(numArray[4] * 6)) + (numArray[5] * 5)) + (numArray[6] * 4)) + (numArray[7] * 3)) +
|
||||
(numArray[8] * 2);
|
||||
int num4 = num3 - ((num3 / 11) * 11);
|
||||
if ((((num4 == 0) && (num2 == num4)) || ((num4 == 1) && (num2 == 1))) ||
|
||||
((num4 > 1) && (num2 == Math.Abs((int)(num4 - 11)))) && cunt <= 10)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
nationalCode = command.Nationalcode;
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
return op.Failed("کد ملی وارد شده نا معتبر است");
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
return op.Failed("لطفا کد ملی 10 رقمی وارد کنید");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
nationalCode = "";
|
||||
}
|
||||
|
||||
var createReal = new Representative(command.FName, command.LName, "*",
|
||||
nationalCode, command.IdNumber, "*", "*",
|
||||
"false", command.Phone, command.AgentPhone, command.Address
|
||||
);
|
||||
|
||||
|
||||
_representativeRepository.Create(createReal);
|
||||
_representativeRepository.SaveChanges();
|
||||
|
||||
return op.Succcedded();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public OperationResult CreateLegal(CreateLegalRepresentative command)
|
||||
|
||||
{
|
||||
var op = new OperationResult();
|
||||
if (_representativeRepository.Exists(x =>
|
||||
x.LegalName == command.LegalName && x.RegisterId == command.RegisterId))
|
||||
return op.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
if (_representativeRepository.Exists(x => x.LegalName == command.LegalName))
|
||||
{
|
||||
legalNameIsOk = false;
|
||||
return op.Failed("نام شرکت وارد شده تکراری است");
|
||||
}
|
||||
if (_representativeRepository.Exists(x => x.RegisterId == command.RegisterId))
|
||||
{
|
||||
|
||||
return op.Failed("شماره ثبت وارد شده تکراری است");
|
||||
|
||||
}
|
||||
if (_representativeRepository.Exists(x => x.NationalId == command.NationalId))
|
||||
{
|
||||
|
||||
return op.Failed("شناسه ملی وارد شده تکراری است");
|
||||
}
|
||||
var createLegal = new Representative("*", "*",
|
||||
command.LegalName, "*", "*", command.RegisterId, command.NationalId,
|
||||
"true",
|
||||
command.Phone, command.AgentPhone, command.Address);
|
||||
|
||||
|
||||
_representativeRepository.Create(createLegal);
|
||||
_representativeRepository.SaveChanges();
|
||||
|
||||
return op.Succcedded();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public OperationResult EditReal(EditRealRepresentative command)
|
||||
{
|
||||
var nationalCode = string.Empty;
|
||||
var opration = new OperationResult();
|
||||
var representativeRealEdit = _representativeRepository.Get(command.Id);
|
||||
if (representativeRealEdit == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
if (_representativeRepository.Exists(x =>
|
||||
x.LName == command.LName && x.FName == command.FName && x.id != command.Id))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
if (!string.IsNullOrWhiteSpace(command.Nationalcode))
|
||||
{
|
||||
if (_representativeRepository.Exists(x => x.Nationalcode == command.Nationalcode && x.id != command.Id))
|
||||
{
|
||||
|
||||
|
||||
return opration.Failed("کد ملی وارد شده تکراری است");
|
||||
}
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
char[] chArray = command.Nationalcode.ToCharArray();
|
||||
int[] numArray = new int[chArray.Length];
|
||||
var cunt = chArray.Length;
|
||||
for (int i = 0; i < chArray.Length; i++)
|
||||
{
|
||||
numArray[i] = (int)char.GetNumericValue(chArray[i]);
|
||||
}
|
||||
|
||||
int num2 = numArray[9];
|
||||
switch (command.Nationalcode)
|
||||
{
|
||||
case "0000000000":
|
||||
case "1111111111":
|
||||
case "22222222222":
|
||||
case "33333333333":
|
||||
case "4444444444":
|
||||
case "5555555555":
|
||||
case "6666666666":
|
||||
case "7777777777":
|
||||
case "8888888888":
|
||||
case "9999999999":
|
||||
|
||||
|
||||
|
||||
|
||||
return opration.Failed("کد ملی وارد شده صحیح نمی باشد");
|
||||
|
||||
|
||||
}
|
||||
|
||||
int num3 =
|
||||
((((((((numArray[0] * 10) + (numArray[1] * 9)) + (numArray[2] * 8)) + (numArray[3] * 7)) +
|
||||
(numArray[4] * 6)) + (numArray[5] * 5)) + (numArray[6] * 4)) + (numArray[7] * 3)) +
|
||||
(numArray[8] * 2);
|
||||
int num4 = num3 - ((num3 / 11) * 11);
|
||||
if ((((num4 == 0) && (num2 == num4)) || ((num4 == 1) && (num2 == 1))) ||
|
||||
((num4 > 1) && (num2 == Math.Abs((int)(num4 - 11)))) && cunt <= 10)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
nationalCode = command.Nationalcode;
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
return opration.Failed("کد ملی وارد شده نا معتبر است");
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
return opration.Failed("لطفا کد ملی 10 رقمی وارد کنید");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
nationalCode = "";
|
||||
}
|
||||
|
||||
representativeRealEdit.EditReal(command.FName, command.LName,
|
||||
nationalCode, command.IdNumber,
|
||||
command.Phone, command.AgentPhone, command.Address);
|
||||
|
||||
_representativeRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
|
||||
}
|
||||
public OperationResult EditLegal(EditLegalRepresentative command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var representativeLegalEdit = _representativeRepository.Get(command.Id);
|
||||
if (representativeLegalEdit == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
if (_representativeRepository.Exists(x =>
|
||||
x.LegalName == command.LegalName && x.RegisterId == command.RegisterId && x.id != command.Id))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
representativeLegalEdit.EditLegal(command.LegalName, command.RegisterId,
|
||||
command.NationalId,
|
||||
command.Phone, command.AgentPhone, command.Address);
|
||||
|
||||
_representativeRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
public async Task<List<GetSelectListRepresentativeViewModel>> GetSelectList()
|
||||
{
|
||||
return await _representativeRepository.GetSelectList();
|
||||
}
|
||||
|
||||
public async Task<List<RepresentativeGetListViewModel>> GetList(RepresentativeGetListSearchModel searchModel)
|
||||
{
|
||||
return (await _representativeRepository.GetList(searchModel)).ToList();
|
||||
}
|
||||
|
||||
public bool HasAnyContractingParty(long id)
|
||||
{
|
||||
return _representativeRepository.HasAnyContractingParty(id);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -13,6 +13,7 @@ using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
using IPE.SmsIrClient.Models.Results;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PersianTools.Core;
|
||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
@@ -67,7 +68,7 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
return op.Failed("شماره همراه نا معتبر است");
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -141,6 +142,8 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
result.FName = createTemp.FName;
|
||||
result.LName = createTemp.LName;
|
||||
result.DateOfBirthFa = dateOfBirth;
|
||||
result.FatherName = createTemp.FatherName;
|
||||
result.IdNumberSerial = createTemp.IdNumberSerial;
|
||||
result.IdNumber = idNumber;
|
||||
|
||||
return op.Succcedded(result);
|
||||
@@ -188,7 +191,7 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<OperationResult> CreateOrUpdateWorkshopTemp(List<WorkshopTempViewModel> command)
|
||||
public async Task<OperationResult> CreateOrUpdateWorkshopTemp(List<WorkshopTempViewModel> command, long contractingPartyTempId)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
var updateWorkshopList = command.Where(x => x.Id > 0).ToList();
|
||||
@@ -196,10 +199,17 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
|
||||
if (updateWorkshopList.Count == 0 && createNewWorkshopList.Count == 0)
|
||||
return op.Failed("هیچ مجموعه ای ایجاد نشده است");
|
||||
var oldWorkshops = await _workshopTempRepository.GetWorkshopTemp(contractingPartyTempId);
|
||||
|
||||
#region Update
|
||||
if (updateWorkshopList.Count > 0)
|
||||
{
|
||||
var updateListIds = updateWorkshopList.Select(x => x.Id).ToList();
|
||||
var oldWorkshopsIds = oldWorkshops.Select(x => x.Id).ToList();
|
||||
var exceptWorkshops = oldWorkshopsIds.Except(updateListIds).ToList();
|
||||
if (exceptWorkshops.Any())
|
||||
await _workshopTempRepository.RemoveWorkshopTemps(exceptWorkshops);
|
||||
|
||||
|
||||
foreach (var workshop in updateWorkshopList)
|
||||
{
|
||||
@@ -212,6 +222,7 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
workshop.RollCall == false && workshop.Insurance == false)
|
||||
op.Failed($"برای مجموعه {workshop.WorkshopName} هیچ سرویسی انتخاب نشده است");
|
||||
var existWorkshops = _workshopTempRepository.Get(workshop.Id);
|
||||
|
||||
if (existWorkshops != null)
|
||||
{
|
||||
if (workshop.ContractAndCheckout)
|
||||
@@ -256,6 +267,8 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
if (workshop.CustomizeCheckout)
|
||||
await _workshopServicesTempRepository.CreateAsync(
|
||||
new WorkshopServicesTemp("CustomizeCheckout", workshop.CountPerson, workshop.Id));
|
||||
|
||||
await _workshopServicesTempRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -324,6 +337,8 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
if (workshop.CustomizeCheckout)
|
||||
await _workshopServicesTempRepository.CreateAsync(
|
||||
new WorkshopServicesTemp("CustomizeCheckout", workshop.CountPerson, createNewWorkshopTemp.id));
|
||||
|
||||
await _workshopServicesTempRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -352,8 +367,9 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
/// </summary>
|
||||
/// <param name="contractingPartyTempId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ReviewAndPaymentViewModel> GetTotalPaymentAndWorkshopList(long contractingPartyTempId, string periodModel = "12", string paymentModel = "OneTime")
|
||||
public async Task<ReviewAndPaymentViewModel> GetTotalPaymentAndWorkshopList(long contractingPartyTempId, string periodModel = "12", string paymentModel = "OneTime", string contractStartType = "currentMonth")
|
||||
{
|
||||
|
||||
//دریافت کارگاه ها
|
||||
var workshops = await _workshopTempRepository.GetWorkshopTemp(contractingPartyTempId);
|
||||
|
||||
@@ -380,9 +396,10 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
_ => 12,
|
||||
};
|
||||
//رند کردن مبالغ کارگاه ها
|
||||
var roundAmount = (int)(totalPayment1MonthDouble / 1000000) * 1000000;
|
||||
var roundAmount = (((Convert.ToInt64(totalPayment1MonthDouble))) / 1000000) * 1000000;
|
||||
double roundAmount2 = roundAmount;
|
||||
//بدست آوردن جمع کل مبالغ کارگاه بر اساس مدت قراداد
|
||||
result.SumOfWorkshopsPaymentDouble = roundAmount * months;
|
||||
result.SumOfWorkshopsPaymentDouble = months * roundAmount2;
|
||||
result.SumOfWorkshopsPaymentPaymentStr = result.SumOfWorkshopsPaymentDouble.ToMoney();
|
||||
|
||||
|
||||
@@ -394,31 +411,112 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
//مالیات
|
||||
result.ValueAddedTaxDouble = tenPercent;
|
||||
result.ValueAddedTaxSt = tenPercent.ToMoney();
|
||||
if (paymentModel == "OneTime")//تخفیف 10 درصدی درصورت پرداخت یکجا
|
||||
//پرداخت یکجا
|
||||
#region OneTimePaymentResult
|
||||
|
||||
double discountOneTimePeyment = result.SumOfWorkshopsPaymentDouble - tenPercent;
|
||||
|
||||
|
||||
//مبلغ بدون مالیات و با تخفیف
|
||||
result.OneTimeWithoutTaxPaymentDouble = discountOneTimePeyment;
|
||||
result.OneTimeWithoutTaxPaymentStr = discountOneTimePeyment.ToMoney();
|
||||
|
||||
//مبلغ با مالیات
|
||||
result.OneTimeTotalPaymentDouble = discountOneTimePeyment + tenPercent;
|
||||
result.OneTimeTotalPaymentStr = result.OneTimeTotalPaymentDouble.ToMoney();
|
||||
|
||||
#endregion
|
||||
|
||||
//پرداخت ماهیانه
|
||||
#region MonthlyPaymentResult
|
||||
|
||||
//مبلغ بدون مالیات
|
||||
result.MonthlyWithoutTaxPaymentDouble = result.SumOfWorkshopsPaymentDouble;
|
||||
result.MonthlyWithoutTaxPaymentStr = result.SumOfWorkshopsPaymentDouble.ToMoney();
|
||||
|
||||
// مبلغ با مالیات
|
||||
result.MonthlyTotalPaymentDouble = result.SumOfWorkshopsPaymentDouble + tenPercent;
|
||||
result.MonthlyTotalPaymentStr = result.MonthlyTotalPaymentDouble.ToMoney();
|
||||
var installmentList = new List<MonthlyInstallment>();
|
||||
|
||||
var startDate = (DateTime.Now).ToFarsi();
|
||||
result.ContractStartCurrentMonthFa = $"{startDate.Substring(0, 8)}01";
|
||||
result.ContractStartCurrentMonthGr = result.ContractStartCurrentMonthFa.ToGeorgianDateTime();
|
||||
startDate = result.ContractStartCurrentMonthFa;
|
||||
|
||||
result.ContractStartNextMonthGr = ((startDate.FindeEndOfMonth()).ToGeorgianDateTime()).AddDays(1);
|
||||
result.ContractStartNextMonthFa = result.ContractStartNextMonthGr.ToFarsi();
|
||||
|
||||
if (contractStartType == "nextMonth")
|
||||
startDate = result.ContractStartNextMonthFa;
|
||||
|
||||
|
||||
|
||||
var findeEnd = Tools.FindEndOfContract(startDate, periodModel);
|
||||
var contractEndDate = findeEnd.endDateGr;
|
||||
result.ContractEndGr = contractEndDate;
|
||||
result.ContractEndFa = contractEndDate.ToFarsi();
|
||||
|
||||
if (periodModel == "1")
|
||||
{
|
||||
|
||||
double discountOneTimePeyment = result.SumOfWorkshopsPaymentDouble - tenPercent;
|
||||
|
||||
installmentList.Add(new MonthlyInstallment()
|
||||
{
|
||||
InstallmentAmountStr = result.MonthlyTotalPaymentStr,
|
||||
InstallmentCounter = "سررسید پرداخت اول",
|
||||
InstalmentDate = (DateTime.Now).ToFarsi()
|
||||
|
||||
//مبلغ بدون مالیات و با تخفیف
|
||||
result.WithoutTaxPaymentDouble = discountOneTimePeyment;
|
||||
result.WithoutTaxPaymentStr = discountOneTimePeyment.ToMoney();
|
||||
|
||||
//مبلغ با مالیات
|
||||
result.TotalPaymentDouble = discountOneTimePeyment + tenPercent;
|
||||
result.TotalPaymentStr = result.TotalPaymentDouble.ToMoney();
|
||||
});
|
||||
result.MonthlyInstallments = installmentList;
|
||||
}
|
||||
else
|
||||
{
|
||||
//مبلغ بدون مالیات
|
||||
result.WithoutTaxPaymentDouble = result.SumOfWorkshopsPaymentDouble;
|
||||
result.WithoutTaxPaymentStr = result.SumOfWorkshopsPaymentDouble.ToMoney();
|
||||
int instalmentCount = Convert.ToInt32(periodModel);
|
||||
var instalmentAmount = result.MonthlyTotalPaymentDouble / instalmentCount;
|
||||
var findEndOfMonth = startDate.FindeEndOfMonth();
|
||||
for (int i = 1; i <= instalmentCount; i++)
|
||||
{
|
||||
if (i == 1)
|
||||
{
|
||||
startDate = (DateTime.Now).ToFarsi();
|
||||
|
||||
}
|
||||
else if (i > 1)
|
||||
{
|
||||
var currentMonthStart = ((findEndOfMonth.ToGeorgianDateTime()).AddDays(1)).ToFarsi();
|
||||
startDate = currentMonthStart.FindeEndOfMonth();
|
||||
findEndOfMonth = startDate;
|
||||
}
|
||||
|
||||
installmentList.Add(new MonthlyInstallment()
|
||||
{
|
||||
InstallmentAmountStr = instalmentAmount.ToMoney(),
|
||||
InstallmentCounter = i switch
|
||||
{
|
||||
1 => "سررسید پرداخت اول",
|
||||
2 => "سررسید پرداخت دوم",
|
||||
3 => "سررسید پرداخت سوم",
|
||||
4 => "سررسید پرداخت چهارم",
|
||||
5 => "سررسید پرداخت پنجم",
|
||||
6 => "سررسید پرداخت ششم",
|
||||
7 => "سررسید پرداخت هفتم",
|
||||
8 => "سررسید پرداخت هشتم",
|
||||
9 => "سررسید پرداخت نهم",
|
||||
10 => "سررسید پرداخت دهم",
|
||||
11 => "سررسید پرداخت یازدهم",
|
||||
12 => "سررسید پرداخت دوازدهم",
|
||||
_ => "سررسید پرداخت دوازدهم",
|
||||
},
|
||||
InstalmentDate = startDate
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// مبلغ با مالیات
|
||||
result.TotalPaymentDouble = result.SumOfWorkshopsPaymentDouble + tenPercent;
|
||||
result.TotalPaymentStr = result.TotalPaymentDouble.ToMoney();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
result.MonthlyInstallments = installmentList;
|
||||
result.ContractingPartTempId = contractingPartyTempId;
|
||||
|
||||
return result;
|
||||
@@ -430,42 +528,57 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
/// </summary>
|
||||
/// <param name="contractingPartyTempId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<OperationResult> CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel, double totalPayment, double valueAddedTax)
|
||||
public async Task<OperationResult> CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel, double totalPayment, double valueAddedTax, DateTime contractStart)
|
||||
{
|
||||
|
||||
var op = new OperationResult();
|
||||
|
||||
|
||||
|
||||
var institutionContractTemp = await
|
||||
_institutionContractTempRepository.GetInstitutionContractTemp(0, contractingPartyTempId);
|
||||
|
||||
var contractStartDate = contractStart;
|
||||
string contractStartFa = contractStart.ToFarsi();
|
||||
var findeEnd = Tools.FindEndOfContract(contractStartFa, periodModel);
|
||||
var contractEndDate = findeEnd.endDateGr;
|
||||
if (institutionContractTemp == null)
|
||||
{
|
||||
var periodModelInt = Convert.ToInt32(periodModel);
|
||||
var contractstart = DateTime.Now;
|
||||
var contractEnd = DateTime.Now.AddMonths(periodModelInt);
|
||||
var create = new InstitutionContractTemp(contractingPartyTempId,paymentModel,periodModel,totalPayment,contractstart,contractEnd,"official", valueAddedTax,"", "BeforeSendVerifyCode", 0,null,null);
|
||||
|
||||
var create = new InstitutionContractTemp(contractingPartyTempId, paymentModel, periodModel, totalPayment, contractStartDate, contractEndDate, "official", valueAddedTax, "", "BeforeSendVerifyCode", 0, null, null);
|
||||
_institutionContractTempRepository.Create(create);
|
||||
_institutionContractTempRepository.SaveChanges();
|
||||
|
||||
//temporary
|
||||
var res = await PayOffCompleted(contractingPartyTempId);
|
||||
if (!res.IsSuccedded)
|
||||
return op.Failed(res.Message);
|
||||
return op.Succcedded();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (institutionContractTemp.VerifyCodeEndTime != null)
|
||||
{
|
||||
var spaning = (institutionContractTemp.VerifyCodeEndTime.Value - DateTime.Now);
|
||||
var spaning = (DateTime.Now - institutionContractTemp.VerifyCodeEndTime.Value);
|
||||
if (institutionContractTemp.RegistrationStatus == "VerifyCodeSent" && spaning > new TimeSpan(0, 0, 0) && spaning < new TimeSpan(0, 1, 0))
|
||||
return op.Failed("شما به تازگی پیامک دریافت نموده اید دو دقیقه صبر کنید و دوباره تلاش کنید");
|
||||
}
|
||||
|
||||
|
||||
if (institutionContractTemp.RegistrationStatus == "Completed")
|
||||
return op.Failed("شما قبلا ثبت نام خود را تکمیل نموده اید");
|
||||
|
||||
|
||||
|
||||
var periodModelInt = Convert.ToInt32(periodModel);
|
||||
var contractstart = DateTime.Now;
|
||||
var contractEnd = DateTime.Now.AddMonths(periodModelInt);
|
||||
var update = _institutionContractTempRepository.Get(institutionContractTemp.Id);
|
||||
update.Edit(contractingPartyTempId, paymentModel, periodModel, totalPayment, contractstart, contractEnd, "official", valueAddedTax, "", "BeforeSendVerifyCode", 0, null, null);
|
||||
update.Edit(contractingPartyTempId, paymentModel, periodModel, totalPayment, contractStartDate, contractEndDate, "official", valueAddedTax, "", "BeforeSendVerifyCode", 0, null, null);
|
||||
_institutionContractTempRepository.SaveChanges();
|
||||
|
||||
//temporary
|
||||
var res = await PayOffCompleted(contractingPartyTempId);
|
||||
if (!res.IsSuccedded)
|
||||
return op.Failed(res.Message);
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
@@ -483,14 +596,16 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
{
|
||||
|
||||
var op = new OperationResult();
|
||||
var institutionContractTemp = await
|
||||
_institutionContractTempRepository.GetInstitutionContractTemp(0, contractingPartyTempId);
|
||||
|
||||
|
||||
var institutionContractTemp = await
|
||||
_institutionContractTempRepository.GetInstitutionContractTemp(0, contractingPartyTempId);
|
||||
if (institutionContractTemp == null)
|
||||
return op.Failed("خظا");
|
||||
return op.Failed("خطا");
|
||||
|
||||
var update = _institutionContractTempRepository.Get(institutionContractTemp.Id);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (institutionContractTemp.RegistrationStatus == "BeforeSendVerifyCode")
|
||||
@@ -516,26 +631,29 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
return op.Succcedded(1, "کد برای شما پیامک شد");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (institutionContractTemp.RegistrationStatus == "VerifyCodeSent")
|
||||
|
||||
{
|
||||
var spaning = (institutionContractTemp.VerifyCodeEndTime.Value - DateTime.Now);
|
||||
if ((spaning > new TimeSpan(0, 0, 0) && spaning < new TimeSpan(0, 1, 0)))
|
||||
|
||||
if (DateTime.Now < institutionContractTemp.VerifyCodeEndTime.Value)
|
||||
return op.Failed("کد دریافت شده را وارد کنید");
|
||||
var spaning = (DateTime.Now - institutionContractTemp.VerifyCodeEndTime.Value);
|
||||
if ((spaning > new TimeSpan(0, 0, 0) && spaning < new TimeSpan(0, 1, 0)))
|
||||
return op.Failed("شما به تازگی پیامک دریافت نموده اید دو دقیقه صبر کنید و دوباره تلاش کنید");
|
||||
|
||||
if ((spaning > new TimeSpan(0, 0, 0) && spaning > new TimeSpan(0, 1, 0)))
|
||||
if ((spaning > new TimeSpan(0, 1, 0)))
|
||||
{
|
||||
//ساخت کد شش رقمی
|
||||
Random generator = new Random();
|
||||
String code = generator.Next(1, 1000000).ToString("D6");
|
||||
//ارسال اس ام اس
|
||||
var getContractingPaty = _contractingPartyTempRepository.GetByContractingPartyTempId(contractingPartyTempId);
|
||||
var sendResult =await _smsService.SendVerifyCodeToClient(getContractingPaty.Phone, code);
|
||||
var sendResult = await _smsService.SendVerifyCodeToClient(getContractingPaty.Phone, code);
|
||||
|
||||
if(!sendResult.IsSuccedded)
|
||||
if (!sendResult.IsSuccedded)
|
||||
return op.Failed($"{sendResult.Message}");
|
||||
|
||||
|
||||
@@ -544,16 +662,16 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
//ذخیره تاریخ ارسال و مهلت پایان
|
||||
//ذخیره آیدی پیامک
|
||||
//تغییر وضعیت به ارسال شده
|
||||
|
||||
|
||||
if (update != null)
|
||||
{
|
||||
update.Update(code, "VerifyCodeSent",sendResult.MessageId, DateTime.Now, DateTime.Now.AddMinutes(2));
|
||||
update.Update(code, "VerifyCodeSent", sendResult.MessageId, DateTime.Now, DateTime.Now.AddMinutes(2));
|
||||
_institutionContractTempRepository.SaveChanges();
|
||||
return op.Succcedded(1, "کد برای شما پیامک شد");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -580,25 +698,25 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
_institutionContractTempRepository.GetInstitutionContractTemp(0, contractingPartyTempId);
|
||||
if (institutionContractTemp == null)
|
||||
return op.Failed("خظا");
|
||||
if(institutionContractTemp.RegistrationStatus != "VerifyCodeSent")
|
||||
if (institutionContractTemp.RegistrationStatus != "VerifyCodeSent")
|
||||
return op.Failed("خطا");
|
||||
|
||||
if(institutionContractTemp.VerifyCodeEndTime < DateTime.Now)
|
||||
if (institutionContractTemp.VerifyCodeEndTime < DateTime.Now)
|
||||
return op.Failed("کد شما منقضی شده است");
|
||||
|
||||
if(institutionContractTemp.SendVerifyCodeTime < DateTime.Now && institutionContractTemp.VerifyCodeEndTime >= DateTime.Now)
|
||||
if (institutionContractTemp.SendVerifyCodeTime < DateTime.Now && institutionContractTemp.VerifyCodeEndTime >= DateTime.Now)
|
||||
{
|
||||
if (institutionContractTemp.VerifyCode == verifyCode)
|
||||
{
|
||||
|
||||
|
||||
|
||||
return op.Succcedded();
|
||||
}
|
||||
else
|
||||
{
|
||||
return op.Failed("کد وارد شده صحیح نیست");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -615,7 +733,38 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
public async Task<OperationResult> PayOffCompleted(long contractingPartyTempId)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
|
||||
var temp = _contractingPartyTempRepository.GetByContractingPartyTempId(contractingPartyTempId);
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
x.Nationalcode == temp.NationalCode))
|
||||
return op.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
var lastArchiveCode = _personalContractingPartyRepository.GetLastArchiveCode();
|
||||
var personalContractingParty = new PersonalContractingParty(temp.FName, temp.LName,
|
||||
temp.NationalCode, temp.IdNumber, "*", "*",
|
||||
"حقیقی",
|
||||
temp.Phone, null, temp.Address, 1, "-", lastArchiveCode,
|
||||
temp.State, temp.City, null, null);
|
||||
_personalContractingPartyRepository.Create(personalContractingParty);
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
|
||||
personalContractingParty.RegisterComplete(temp.FatherName, temp.IdNumberSeri, temp.IdNumberSerial, temp.DateOfBirth, temp.Gender);
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
var institutionContractTemp = await
|
||||
_institutionContractTempRepository.GetInstitutionContractTemp(0, contractingPartyTempId);
|
||||
var update = _institutionContractTempRepository.Get(institutionContractTemp.Id);
|
||||
update.ChangeRegistrationStatus("Completed");
|
||||
_institutionContractTempRepository.SaveChanges();
|
||||
|
||||
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
|
||||
public async Task<List<RegistrationWorkflowMainList>> RegistrationWorkflowMainList()
|
||||
{
|
||||
|
||||
return await _institutionContractTempRepository.GetAllCompletedRegistration();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,6 +9,7 @@ using Company.Domain.CheckoutAgg;
|
||||
using Company.Domain.ClassifiedSalaryAgg;
|
||||
using Company.Domain.ClientEmployeeWorkshopAgg;
|
||||
using Company.Domain.Contact2Agg;
|
||||
using Company.Domain.ContactUsAgg;
|
||||
using Company.Domain.ContarctingPartyAgg;
|
||||
using Company.Domain.ContractAgg;
|
||||
using Company.Domain.ContractingPartyAccountAgg;
|
||||
@@ -77,6 +78,7 @@ using Company.Domain.ModuleTextManagerAgg;
|
||||
using Company.Domain.OriginalTitleAgg;
|
||||
using Company.Domain.PaymentToEmployeeAgg;
|
||||
using Company.Domain.PaymentToEmployeeItemAgg;
|
||||
using Company.Domain.PaymentTransactionAgg;
|
||||
using Company.Domain.PenaltyTitle;
|
||||
using Company.Domain.PercentageAgg;
|
||||
using Company.Domain.PersonnelCodeAgg;
|
||||
@@ -175,9 +177,12 @@ public class CompanyContext : DbContext
|
||||
|
||||
public DbSet<EmployeeClientTemp> EmployeeClientTemps { get; set; }
|
||||
public DbSet<LeftWorkTemp> LeftWorkTemps { get; set; }
|
||||
public DbSet<ContactUs> ContactUs { get; set; }
|
||||
|
||||
|
||||
public DbSet<EmployeeAuthorizeTemp> EmployeeAuthorizeTemps { get; set; }
|
||||
public DbSet<AdminMonthlyOverview> AdminMonthlyOverviews { get; set; }
|
||||
public DbSet<PaymentTransaction> PaymentTransactions{ get; set; }
|
||||
#endregion
|
||||
|
||||
#region Pooya
|
||||
|
||||
20
CompanyManagment.EFCore/Mapping/ContactUsMapping.cs
Normal file
20
CompanyManagment.EFCore/Mapping/ContactUsMapping.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Company.Domain.ContactUsAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping;
|
||||
|
||||
public class ContactUsMapping:IEntityTypeConfiguration<ContactUs>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<ContactUs> builder)
|
||||
{
|
||||
builder.HasKey(x => x.id);
|
||||
builder.Property(x => x.FullName).HasMaxLength(200);
|
||||
builder.Property(x => x.Title).HasMaxLength(200);
|
||||
builder.Property(x => x.Email).HasMaxLength(200);
|
||||
builder.Property(x => x.FirstName).HasMaxLength(100);
|
||||
builder.Property(x => x.LastName).HasMaxLength(100);
|
||||
builder.Property(x => x.Message).HasMaxLength(500);
|
||||
builder.Property(x => x.PhoneNumber).HasMaxLength(20);
|
||||
}
|
||||
}
|
||||
24
CompanyManagment.EFCore/Mapping/PaymentTransactionMapping.cs
Normal file
24
CompanyManagment.EFCore/Mapping/PaymentTransactionMapping.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Company.Domain.PaymentTransactionAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping;
|
||||
|
||||
public class PaymentTransactionMapping:IEntityTypeConfiguration<PaymentTransaction>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<PaymentTransaction> builder)
|
||||
{
|
||||
builder.ToTable("PaymentTransactions");
|
||||
builder.HasKey(pt => pt.id);
|
||||
|
||||
builder.Property(x => x.TransactionId).HasMaxLength(60);
|
||||
builder.Property(x => x.CardNumber).HasMaxLength(25);
|
||||
builder.Property(x => x.AccountNumber).HasMaxLength(25);
|
||||
builder.Property(x => x.BankName).HasMaxLength(50);
|
||||
builder.Property(x => x.BankAccountHolderName).HasMaxLength(255);
|
||||
builder.Property(x => x.Status).HasConversion<string>().HasMaxLength(35);
|
||||
builder.Property(x => x.ShebaNumber).HasMaxLength(30);
|
||||
builder.Property(x => x.ContractingPartyName).HasMaxLength(255);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ public class PersonalContractingpartyMapping : IEntityTypeConfiguration<Personal
|
||||
builder.Property(x => x.IdNumberSerial).HasMaxLength(15);
|
||||
builder.Property(x => x.FatherName).HasMaxLength(20);
|
||||
builder.Property(x => x.DateOfBirth).IsRequired(false);
|
||||
builder.Property(x => x.Gender).HasConversion(
|
||||
builder.Property(x => x.Gender).HasConversion(
|
||||
v => v.ToString(),
|
||||
v => string.IsNullOrWhiteSpace(v) ? Gender.None : (Gender)Enum.Parse(typeof(Gender), v)).HasMaxLength(6);
|
||||
|
||||
|
||||
9450
CompanyManagment.EFCore/Migrations/20250423184716_add contact us .Designer.cs
generated
Normal file
9450
CompanyManagment.EFCore/Migrations/20250423184716_add contact us .Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addcontactus : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ContactUs",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
FirstName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
LastName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
Email = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
PhoneNumber = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
|
||||
Title = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
Message = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
|
||||
FullName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ContactUs", x => x.id);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "ContactUs");
|
||||
}
|
||||
}
|
||||
}
|
||||
10018
CompanyManagment.EFCore/Migrations/20250709090803_init payment transaction.Designer.cs
generated
Normal file
10018
CompanyManagment.EFCore/Migrations/20250709090803_init payment transaction.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class initpaymenttransaction : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PaymentTransactions",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
TransactionDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
ContractingPartyId = table.Column<long>(type: "bigint", nullable: false),
|
||||
ContractingPartyName = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
||||
BankAccountHolderName = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
||||
BankName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
CardNumber = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
|
||||
ShebaNumber = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
|
||||
AccountNumber = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
|
||||
Status = table.Column<string>(type: "nvarchar(35)", maxLength: 35, nullable: false),
|
||||
Amount = table.Column<double>(type: "float", nullable: false),
|
||||
TransactionId = table.Column<string>(type: "nvarchar(60)", maxLength: 60, nullable: true),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PaymentTransactions", x => x.id);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "PaymentTransactions");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -560,6 +560,50 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("TextManager_Contact", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.ContactUsAgg.ContactUs", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("Message")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("ContactUs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.ContarctingPartyAgg.PersonalContractingParty", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -4295,6 +4339,64 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("PaymentToEmployeeItems", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.PaymentTransactionAgg.PaymentTransaction", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<string>("AccountNumber")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<double>("Amount")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<string>("BankAccountHolderName")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)");
|
||||
|
||||
b.Property<string>("BankName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("CardNumber")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<long>("ContractingPartyId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("ContractingPartyName")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("ShebaNumber")
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.IsRequired()
|
||||
.HasMaxLength(35)
|
||||
.HasColumnType("nvarchar(35)");
|
||||
|
||||
b.Property<DateTime>("TransactionDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("TransactionId")
|
||||
.HasMaxLength(60)
|
||||
.HasColumnType("nvarchar(60)");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("PaymentTransactions", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.PenaltyTitle.PenaltyTitle", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
|
||||
14
CompanyManagment.EFCore/Repository/ContactUsRepository.cs
Normal file
14
CompanyManagment.EFCore/Repository/ContactUsRepository.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.ContactUsAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class ContactUsRepository:RepositoryBase<long,ContactUs>,IContactUsRepository
|
||||
{
|
||||
private readonly CompanyContext _companyContext;
|
||||
public ContactUsRepository(CompanyContext companyContext) : base(companyContext)
|
||||
{
|
||||
_companyContext = companyContext;
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,8 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using CompanyManagment.App.Contracts.Employee.DTO;
|
||||
using CompanyManagment.App.Contracts.LeftWorkTemp;
|
||||
using _0_Framework.Application.Enums;
|
||||
using _0_Framework.Exceptions;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
@@ -944,5 +946,108 @@ public class EmployeeRepository : RepositoryBase<long, Employee>, IEmployeeRepos
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Api
|
||||
|
||||
public async Task<List<EmployeeSelectListViewModel>> GetSelectList(string searchText)
|
||||
{
|
||||
var query = _context.Employees.AsQueryable();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchText))
|
||||
{
|
||||
query = query.Where(x => (x.FName + " " + x.LName).Contains(searchText));
|
||||
}
|
||||
|
||||
return await query.Take(100).Select(x => new EmployeeSelectListViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
EmployeeFullName = x.FName + " " + x.LName
|
||||
}).ToListAsync();
|
||||
|
||||
}
|
||||
|
||||
public async Task<List<GetEmployeeListViewModel>> GetList(GetEmployeeListSearchModel searchModel)
|
||||
{
|
||||
var query = _context.Employees.Include(x => x.LeftWorks).Include(x => x.LeftWorkInsurances).AsQueryable();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.NationalCode))
|
||||
{
|
||||
query = query.Where(x => x.NationalCode.Contains(searchModel.NationalCode));
|
||||
}
|
||||
|
||||
if (searchModel.EmployeeId > 0)
|
||||
{
|
||||
query = query.Where(x => x.id == searchModel.EmployeeId);
|
||||
}
|
||||
|
||||
if (searchModel.WorkshopId > 0)
|
||||
{
|
||||
query = query.Where(x => x.LeftWorks.Any(l => l.WorkshopId == searchModel.WorkshopId) || x.LeftWorkInsurances.Any(l => l.WorkshopId == searchModel.WorkshopId));
|
||||
}
|
||||
|
||||
|
||||
#region employer
|
||||
|
||||
if (searchModel.EmployerId > 0)
|
||||
{
|
||||
|
||||
var workshopIdsByEmployer = _context.WorkshopEmployers.Where(x => x.EmployerId == searchModel.EmployerId)
|
||||
.Include(x => x.Workshop).Select(x => x.Workshop.id).AsQueryable();
|
||||
|
||||
query = query.Where(x =>
|
||||
x.LeftWorks.Any(l => workshopIdsByEmployer.Contains(l.WorkshopId)) ||
|
||||
x.LeftWorkInsurances.Any(l => workshopIdsByEmployer.Contains(l.WorkshopId)));
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.InsuranceCode))
|
||||
{
|
||||
query = query.Where(x => x.InsuranceCode.Contains(searchModel.InsuranceCode));
|
||||
}
|
||||
|
||||
if (searchModel.EmployeeStatus != ActivationStatus.None)
|
||||
{
|
||||
var status = searchModel.EmployeeStatus switch
|
||||
{
|
||||
ActivationStatus.Active => true,
|
||||
ActivationStatus.DeActive => false,
|
||||
_ => throw new BadRequestException("پارامتر جستجو نامعتبر است")
|
||||
};
|
||||
query = query.Where(x => x.IsActiveString == status.ToString() || x.IsActive == status);
|
||||
}
|
||||
|
||||
var list = await query.Skip(searchModel.PageIndex).Take(30).ToListAsync();
|
||||
|
||||
var employeeIds = list.Select(x => x.id);
|
||||
|
||||
var children = await _context.EmployeeChildrenSet.Where(x => employeeIds.Contains(x.EmployeeId)).ToListAsync();
|
||||
|
||||
var result = list.Select(x => new GetEmployeeListViewModel()
|
||||
{
|
||||
BirthDate = x.DateOfBirth.ToFarsi(),
|
||||
ChildrenCount = children.Count(c => c.EmployeeId == x.id).ToString(),
|
||||
EmployeeFullName = x.FullName,
|
||||
EmployeeStatus = x.IsActive switch
|
||||
{
|
||||
true => ActivationStatus.Active,
|
||||
false => ActivationStatus.DeActive
|
||||
},
|
||||
Gender = x.Gender switch
|
||||
{
|
||||
"مرد" => Gender.Male,
|
||||
"زن" => Gender.Female,
|
||||
_ => Gender.None
|
||||
},
|
||||
Id = x.id,
|
||||
InsuranceCode = x.InsuranceCode,
|
||||
NationalCode = x.NationalCode
|
||||
}).ToList();
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.EmployerAccountAgg;
|
||||
using Company.Domain.empolyerAgg;
|
||||
@@ -786,4 +787,213 @@ public class EmployerRepository : RepositoryBase<long, Employer>, IEmployerRepos
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Api
|
||||
public async Task<List<GetEmployerListViewModel>> GetEmployerList(GetEmployerSearchModel searchModel)
|
||||
{
|
||||
var query = _context.Employers.Include(x => x.ContractingParty).Include(x => x.WorkshopEmployers).ThenInclude(x => x.Workshop).AsQueryable();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.FullNameOrCompanyName))
|
||||
query = query.Where(x => x.FullName.Contains(searchModel.FullNameOrCompanyName));
|
||||
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.NationalCodeOrNationalId))
|
||||
query = query.Where(x => x.Nationalcode.Contains(searchModel.NationalCodeOrNationalId) || x.NationalId.Contains(searchModel.NationalCodeOrNationalId));
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.IdNumberOrRegisterId))
|
||||
query = query.Where(x => x.IdNumber.Contains(searchModel.IdNumberOrRegisterId) || x.RegisterId.Contains(searchModel.IdNumberOrRegisterId));
|
||||
|
||||
|
||||
if (searchModel.EmployerType != LegalType.None)
|
||||
{
|
||||
var type = searchModel.EmployerType switch
|
||||
{
|
||||
LegalType.Legal => "true",
|
||||
LegalType.Real => "false",
|
||||
_ => "",
|
||||
};
|
||||
|
||||
query = query.Where(x => x.IsLegal == type);
|
||||
}
|
||||
|
||||
if (searchModel.EmployerStatus != ActivationStatus.None)
|
||||
{
|
||||
var status = searchModel.EmployerStatus switch
|
||||
{
|
||||
ActivationStatus.Active => true,
|
||||
ActivationStatus.DeActive => false,
|
||||
_ => false
|
||||
};
|
||||
query = query.Where(x => x.IsActive == status);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.ContractingPartyName))
|
||||
{
|
||||
query = query.Where(x =>
|
||||
x.ContractingParty.IsLegal == "true"
|
||||
? (x.ContractingParty.LName).Contains(searchModel.ContractingPartyName)
|
||||
: (x.ContractingParty.FName + " " + x.ContractingParty.LName).Contains(searchModel
|
||||
.ContractingPartyName));
|
||||
}
|
||||
|
||||
var employerList = await query.Select(x => new GetEmployerListViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
FullName = x.FullName,
|
||||
HasContractingParty = x.ContractingPartyId == 30428 && x.WorkshopEmployers.Any(),
|
||||
HasBlockContractingParty = x.ContractingParty.IsBlock == "true",
|
||||
NationalCodeOrNationalId = x.IsLegal == "true" ? x.NationalId : x.Nationalcode,
|
||||
WorkshopNames = x.WorkshopEmployers.Select(w => w.Workshop.WorkshopFullName).ToList(),
|
||||
LegalType = x.IsLegal == "حقیقی" ? LegalType.Real : LegalType.Legal,
|
||||
EmployerStatus = x.IsActive ? ActivationStatus.Active : ActivationStatus.DeActive,
|
||||
|
||||
}).Skip(searchModel.PageIndex).Take(30).ToListAsync();
|
||||
return employerList;
|
||||
}
|
||||
|
||||
public async Task<GetLegalEmployerDetailViewModel> GetLegalEmployerDetail(long id)
|
||||
{
|
||||
var employer = await _context.Employers.Where(x => x.IsLegal == "حقوقی").Include(x => x.ContractingParty).Select(x =>
|
||||
new GetLegalEmployerDetailViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
CompanyName = x.LName,
|
||||
ContractingPartyName = x.ContractingParty.FName + " " + x.ContractingParty.LName,
|
||||
DateOfBirth = x.DateOfBirth.ToFarsi(),
|
||||
DateOfIssue = x.DateOfIssue.ToFarsi(),
|
||||
CeoFullName = x.FName + " " + x.EmployerLName,
|
||||
EmployerNo = x.EmployerNo,
|
||||
FatherName = x.FatherName,
|
||||
GenderStr = x.Gender,
|
||||
Gender = string.IsNullOrWhiteSpace(x.Gender) ? Gender.None :
|
||||
x.Gender == "مرد" ?
|
||||
Gender.Male :
|
||||
Gender.Female,
|
||||
NationalCode = x.Nationalcode,
|
||||
IdNumber = x.IdNumber,
|
||||
NationalId = x.NationalId,
|
||||
Nationality = x.Nationality,
|
||||
PhoneNumber = x.Phone,
|
||||
PlaceOfIssue = x.PlaceOfIssue,
|
||||
RegisterId = x.RegisterId,
|
||||
TelephoneNumber = x.AgentPhone,
|
||||
CeoFName = x.FName,
|
||||
CeoLName = x.EmployerLName,
|
||||
GovernmentSystemInfo = new GovernmentSystemInfo
|
||||
{
|
||||
EServicePassword = x.EservicePassword,
|
||||
EServiceUsername = x.EservicePassword,
|
||||
MclPassword = x.MclsPassword,
|
||||
MclUsername = x.MclsUserName,
|
||||
SanaUsername = x.SanaUserName,
|
||||
SanaPassword = x.SanaPassword,
|
||||
TaxUsername = x.TaxOfficeUserName,
|
||||
TaxPassword = x.TaxOfficepassword
|
||||
},
|
||||
ContractingPartyId = x.ContractingPartyId
|
||||
}).FirstOrDefaultAsync(x => x.Id == id);
|
||||
|
||||
return employer;
|
||||
}
|
||||
|
||||
public async Task<GetRealEmployerDetailViewModel> GetRealEmployerDetail(long id)
|
||||
{
|
||||
var employer = await _context.Employers.Where(x => x.IsLegal == "حقیقی").Include(x => x.ContractingParty).Select(x =>
|
||||
new GetRealEmployerDetailViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
ContractingPartyName = x.ContractingParty.FName + " " + x.ContractingParty.LName,
|
||||
DateOfBirth = x.DateOfBirth.ToFarsi(),
|
||||
DateOfIssue = x.DateOfIssue.ToFarsi(),
|
||||
EmployerNo = x.EmployerNo,
|
||||
FatherName = x.FatherName,
|
||||
GenderStr = x.Gender,
|
||||
Gender = string.IsNullOrWhiteSpace(x.Gender) ? Gender.None :
|
||||
x.Gender == "مرد" ?
|
||||
Gender.Male :
|
||||
Gender.Female,
|
||||
NationalCode = x.Nationalcode,
|
||||
IdNumber = x.IdNumber,
|
||||
Nationality = x.Nationality,
|
||||
PhoneNumber = x.Phone,
|
||||
PlaceOfIssue = x.PlaceOfIssue,
|
||||
TelephoneNumber = x.AgentPhone,
|
||||
FullName = x.FullName,
|
||||
FName = x.FName,
|
||||
LName = x.LName,
|
||||
GovernmentSystemInfo = new GovernmentSystemInfo
|
||||
{
|
||||
EServicePassword = x.EservicePassword,
|
||||
EServiceUsername = x.EservicePassword,
|
||||
MclPassword = x.MclsPassword,
|
||||
MclUsername = x.MclsUserName,
|
||||
SanaUsername = x.SanaUserName,
|
||||
SanaPassword = x.SanaPassword,
|
||||
TaxUsername = x.TaxOfficeUserName,
|
||||
TaxPassword = x.TaxOfficepassword
|
||||
},
|
||||
ContractingPartyId = x.ContractingPartyId
|
||||
}).FirstOrDefaultAsync(x => x.Id == id);
|
||||
|
||||
return employer;
|
||||
}
|
||||
|
||||
|
||||
public async Task<OperationResult<string>> DeactivateWithSubordinates(long id)
|
||||
{
|
||||
var op = new OperationResult<string>();
|
||||
;
|
||||
using (var transaction = await _context.Database.BeginTransactionAsync())
|
||||
{
|
||||
try
|
||||
{
|
||||
var employer = await _context.Employers
|
||||
.Include(x => x.Contracts)
|
||||
.Include(x => x.WorkshopEmployers)
|
||||
.ThenInclude(x => x.Workshop)
|
||||
.ThenInclude(x => x.Checkouts).FirstOrDefaultAsync(x => x.id == id);
|
||||
if (employer == null)
|
||||
{
|
||||
return op.Failed("چنین آیتمی وجود ندارد");
|
||||
}
|
||||
|
||||
|
||||
var workshops = employer.WorkshopEmployers.Select(x => x.Workshop).ToList();
|
||||
|
||||
var contracts = employer.Contracts.ToList();
|
||||
|
||||
var checkouts = workshops.SelectMany(x => x.Checkouts).ToList();
|
||||
|
||||
|
||||
employer.DeActive();
|
||||
|
||||
foreach (var workshop in workshops)
|
||||
{
|
||||
workshop.DeActive(workshop.ArchiveCode);
|
||||
}
|
||||
|
||||
foreach (var contract in contracts)
|
||||
{
|
||||
contract.DeActive();
|
||||
}
|
||||
|
||||
foreach (var checkout in checkouts)
|
||||
{
|
||||
checkout.DeActive();
|
||||
}
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
await transaction.CommitAsync();
|
||||
return op.Succcedded("DeActivate");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
await transaction.RollbackAsync();
|
||||
return op.Failed("غیرفعال کردن کارفرما با خطا مواجه شد");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -1,12 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Exceptions;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.FinancialStatmentAgg;
|
||||
using CompanyManagment.App.Contracts.FinancialStatment;
|
||||
using CompanyManagment.App.Contracts.FinancilTransaction;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using AccountManagement.Application.Contracts.SubAccount;
|
||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
@@ -31,7 +35,7 @@ public class FinancialStatmentRepository : RepositoryBase<long, FinancialStatmen
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
return new FinancialStatmentViewModel()
|
||||
{
|
||||
Id = res.id,
|
||||
@@ -44,16 +48,16 @@ public class FinancialStatmentRepository : RepositoryBase<long, FinancialStatmen
|
||||
TdateGr = t.TdateGr,
|
||||
Description = t.TypeOfTransaction == "debt" ? "ایجاد درآمد" + " " + t.DescriptionOption + " " + t.Description : "دریافت درآمد" + " " + t.DescriptionOption + " " + t.Description,
|
||||
Deptor = t.Deptor,
|
||||
DeptorString = t.Deptor!=0?t.Deptor.ToMoney():"",
|
||||
DeptorString = t.Deptor != 0 ? t.Deptor.ToMoney() : "",
|
||||
Creditor = t.Creditor,
|
||||
CreditorString = t.Creditor!=0?t.Creditor.ToMoney():"",
|
||||
CreditorString = t.Creditor != 0 ? t.Creditor.ToMoney() : "",
|
||||
Balance = t.Balance,
|
||||
MessageText = t.MessageText,
|
||||
SentSms = t.SentSms,
|
||||
SentSmsDateFa = t.SentSmsDateFa,
|
||||
FinancialStatementId = t.FinancialStatementId,
|
||||
TypeOfTransaction = t.TypeOfTransaction
|
||||
}).OrderBy(t=>t.TdateGr).ToList(),
|
||||
}).OrderBy(t => t.TdateGr).ToList(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -63,4 +67,83 @@ public class FinancialStatmentRepository : RepositoryBase<long, FinancialStatmen
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public async Task<ClientFinancialStatementViewModel> GetClientFinancialStatement(long accountId,
|
||||
ClientFinancialStatementSearchModel searchModel)
|
||||
{
|
||||
var contractingPartyId = _context.ContractingPartyAccounts.Any(x => x.AccountId == accountId) ?
|
||||
_context.ContractingPartyAccounts.FirstOrDefault(x => x.AccountId == accountId)!.PersonalContractingPartyId : 0;
|
||||
|
||||
if (contractingPartyId == 0)
|
||||
throw new BadRequestException("طرف حساب مورد نظر یافت نشد");
|
||||
|
||||
var resStatement = await _context.FinancialStatments.Include(x=>x.FinancialTransactionList)
|
||||
.FirstOrDefaultAsync(x => x.ContractingPartyId == contractingPartyId);
|
||||
|
||||
if (resStatement == null)
|
||||
throw new BadRequestException("صورت حساب مالی شخص یافت نشد");
|
||||
|
||||
var resTransaction = resStatement.FinancialTransactionList.ToList();
|
||||
|
||||
#region Search
|
||||
|
||||
//if (searchModel.FromAmount > 0 || searchModel.ToAmount > 0)
|
||||
//{
|
||||
// if (searchModel.FromAmount > 0 && searchModel.ToAmount > 0)
|
||||
// {
|
||||
// resTransaction = resTransaction.Where(x => x.>= searchModel.FromAmount && x.Amount <= searchModel);
|
||||
// }
|
||||
// else if (searchModel.FromAmount > 0)
|
||||
// {
|
||||
// query = query.Where(x => x.Amount >= searchModel.FromAmount);
|
||||
// }
|
||||
// else if (searchModel.ToAmount > 0)
|
||||
// {
|
||||
// query = query.Where(x => x.Amount <= searchModel.ToAmount);
|
||||
// }
|
||||
//}
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.FromDate) && !string.IsNullOrWhiteSpace(searchModel.ToDate))
|
||||
{
|
||||
if (searchModel.FromDate.TryToGeorgianDateTime(out var fromDate) == false)
|
||||
throw new BadRequestException("تاریخ وارد شده نامعتبر است");
|
||||
|
||||
if (searchModel.FromDate.TryToGeorgianDateTime(out var toDate) == false)
|
||||
throw new BadRequestException("تاریخ وارد شده نامعتبر است");
|
||||
|
||||
resTransaction = resTransaction.Where(x => x.TdateGr >= fromDate && x.TdateGr <= toDate).ToList();
|
||||
}
|
||||
|
||||
if (searchModel.Type != null)
|
||||
{
|
||||
var type = searchModel.Type switch
|
||||
{
|
||||
FinancialTransactionType.Credit => "credit",
|
||||
FinancialTransactionType.Debt => "debt"
|
||||
};
|
||||
|
||||
resTransaction = resTransaction.Where(x => x.TypeOfTransaction == type).ToList();
|
||||
}
|
||||
#endregion
|
||||
|
||||
return new ClientFinancialStatementViewModel()
|
||||
{
|
||||
Id = resStatement.id,
|
||||
TotalAmountPayable = resStatement.FinancialTransactionList.Sum(x=>x.Deptor) - resStatement.FinancialTransactionList.Sum(x=>x.Creditor),
|
||||
TotalCredit = resTransaction.Sum(x=>x.Creditor),
|
||||
TotalDebt = resTransaction.Sum(x=>x.Deptor),
|
||||
Transactions = resTransaction.Select(t => new ClientFinancialTransactionViewModel()
|
||||
{
|
||||
DateTimeGr = t.TdateGr,
|
||||
DateFa = t.TdateGr.ToFarsi(),
|
||||
TimeFa = $"{t.TdateGr:HH:mm}",
|
||||
Description = t.DescriptionOption + " " + t.Description,
|
||||
Debtor = t.Deptor,
|
||||
Creditor = t.Creditor,
|
||||
Balance = t.Balance,
|
||||
Type = t.TypeOfTransaction =="debt"? FinancialTransactionType.Debt :FinancialTransactionType.Credit,
|
||||
TypeStr = t.TypeOfTransaction =="debt"? "ایجاد درآمد" : "دریافت درآمد"
|
||||
}).OrderByDescending(t => t.DateTimeGr).ToList(),
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.TemporaryClientRegistrationAgg;
|
||||
@@ -46,4 +47,20 @@ public class InstitutionContractTempRepository : RepositoryBase<long, Institutio
|
||||
MessageId = x.MessageId
|
||||
}).FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
public async Task<List<RegistrationWorkflowMainList>> GetAllCompletedRegistration()
|
||||
{
|
||||
return await _context.InstitutionContractTemps.Where(x => x.RegistrationStatus == "Completed")
|
||||
.Join(_context.ContractingPartyTemps,
|
||||
institutionContract => institutionContract.ContractingPartyTempId,
|
||||
contractingParty => contractingParty.id,
|
||||
(institutionContract, contractingParty) => new { institutionContract, contractingParty }).Select(x =>
|
||||
new RegistrationWorkflowMainList
|
||||
{
|
||||
ContractingPartyTempId = x.contractingParty.id,
|
||||
ContractingPartyFullName = $"{x.contractingParty.FName} {x.contractingParty.LName}",
|
||||
Phone = x.contractingParty.Phone
|
||||
|
||||
}).ToListAsync();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.PaymentTransactionAgg;
|
||||
using CompanyManagment.App.Contracts.PaymentTransaction;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class PaymentTransactionRepository:RepositoryBase<long, PaymentTransaction>,IPaymentTransactionRepository
|
||||
{
|
||||
private readonly CompanyContext _companyContext;
|
||||
public PaymentTransactionRepository(CompanyContext companyContext) : base(companyContext)
|
||||
{
|
||||
_companyContext = companyContext;
|
||||
}
|
||||
|
||||
public async Task<List<GetPaymentTransactionListViewModel>> GetPaymentTransactionList(GetPaymentTransactionListSearchModel searchModel)
|
||||
{
|
||||
var query = _companyContext.PaymentTransactions.AsQueryable();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.ContractingPartyOrAccountHolderName))
|
||||
{
|
||||
query = query.Where(x=>searchModel.ContractingPartyOrAccountHolderName.Contains(x.ContractingPartyName)||
|
||||
searchModel.ContractingPartyOrAccountHolderName.Contains(x.BankAccountHolderName));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.FromDate) && !string.IsNullOrWhiteSpace(searchModel.ToDate))
|
||||
{
|
||||
searchModel.FromDate.TryToGeorgianDateTime(out var fromDateGr);
|
||||
searchModel.ToDate.TryToGeorgianDateTime(out var toDateGr);
|
||||
query = query.Where(x => x.TransactionDate >= fromDateGr && x.TransactionDate <= toDateGr);
|
||||
}
|
||||
|
||||
if (searchModel.FromAmount > 0 || searchModel.ToAmount > 0)
|
||||
{
|
||||
if (searchModel.FromAmount > 0 && searchModel.ToAmount > 0)
|
||||
{
|
||||
query = query.Where(x => x.Amount >= searchModel.FromAmount && x.Amount <= searchModel.ToAmount);
|
||||
}
|
||||
else if (searchModel.FromAmount > 0)
|
||||
{
|
||||
query = query.Where(x => x.Amount >= searchModel.FromAmount);
|
||||
}
|
||||
else if (searchModel.ToAmount > 0)
|
||||
{
|
||||
query = query.Where(x => x.Amount <= searchModel.ToAmount);
|
||||
}
|
||||
}
|
||||
|
||||
if (searchModel.StatusEnum != null)
|
||||
{
|
||||
query = query.Where(x => x.Status == searchModel.StatusEnum);
|
||||
}
|
||||
|
||||
var paymentTransactionsData = await query
|
||||
.AsNoTracking()
|
||||
.Skip(searchModel.PageIndex)
|
||||
.Take(30)
|
||||
.ToListAsync();
|
||||
|
||||
var result = paymentTransactionsData
|
||||
.Select(x => new GetPaymentTransactionListViewModel
|
||||
{
|
||||
Id = x.id,
|
||||
ContractingPartyName = x.ContractingPartyName,
|
||||
BankAccountHolderName = x.BankAccountHolderName,
|
||||
BankName = x.BankName,
|
||||
CardNumber = x.CardNumber,
|
||||
ShebaNumber = x.ShebaNumber,
|
||||
AccountNumber = x.AccountNumber,
|
||||
Status = x.Status switch
|
||||
{
|
||||
PaymentTransactionStatus.Failed => "ناموفق",
|
||||
PaymentTransactionStatus.Success => "موفق",
|
||||
_ => "نامشخص"
|
||||
},
|
||||
StatusEnum = x.Status,
|
||||
Amount = x.Amount,
|
||||
TransactionId = x.TransactionId,
|
||||
PaymentDate = x.TransactionDate.ToFarsi(),
|
||||
PaymentTime = $"{x.TransactionDate:HH:mm}"
|
||||
})
|
||||
.ToList();
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using _0_Framework.Exceptions;
|
||||
using _0_Framework.InfraStructure;
|
||||
using AccountManagement.Application.Contracts.Account;
|
||||
using AccountMangement.Infrastructure.EFCore;
|
||||
@@ -230,8 +233,10 @@ public class PersonalContractingPartyRepository : RepositoryBase<long, PersonalC
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
#region Mahan
|
||||
public List<string> SearchByName(string name)
|
||||
|
||||
|
||||
#region Mahan
|
||||
public List<string> SearchByName(string name)
|
||||
{
|
||||
var contractingParties = _context.PersonalContractingParties.Select(x => new PersonalContractingPartyViewModel()
|
||||
{
|
||||
@@ -478,6 +483,248 @@ public class PersonalContractingPartyRepository : RepositoryBase<long, PersonalC
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Api
|
||||
public async Task<ICollection<ContractingPartyGetListViewModel>> GetList(ContractingPartyGetListSearchModel searchModel)
|
||||
{
|
||||
var personalContractingPartiesQuery = _context.PersonalContractingParties
|
||||
.Include(x => x.Representative)
|
||||
.Include(x => x.Employers).AsQueryable();
|
||||
|
||||
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.NationalIdOrNationalCode))
|
||||
personalContractingPartiesQuery = personalContractingPartiesQuery
|
||||
.Where(x => x.Nationalcode.Contains(searchModel.NationalIdOrNationalCode) ||
|
||||
x.NationalId.Contains(searchModel.NationalIdOrNationalCode));
|
||||
|
||||
|
||||
if (searchModel.ContractingPartyType != LegalType.None)
|
||||
|
||||
{
|
||||
string type = searchModel.ContractingPartyType switch
|
||||
{
|
||||
LegalType.Legal => "حقوقی",
|
||||
LegalType.Real => "حقیقی",
|
||||
_ => ""
|
||||
};
|
||||
|
||||
personalContractingPartiesQuery = personalContractingPartiesQuery
|
||||
.Where(x => x.IsLegal == type);
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (searchModel.ContractingPartyStatus != ActivationStatus.None)
|
||||
{
|
||||
string status = searchModel.ContractingPartyStatus switch
|
||||
{
|
||||
ActivationStatus.Active => "true",
|
||||
ActivationStatus.DeActive => "false",
|
||||
_ => ""
|
||||
};
|
||||
personalContractingPartiesQuery = personalContractingPartiesQuery
|
||||
.Where(x => x.IsActiveString == status);
|
||||
}
|
||||
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.RepresentativeName))
|
||||
{
|
||||
personalContractingPartiesQuery = personalContractingPartiesQuery
|
||||
.Where(x => x.Representative.FullName.Contains(searchModel.RepresentativeName));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.FullNameOrCompanyName))
|
||||
{
|
||||
personalContractingPartiesQuery = personalContractingPartiesQuery.Where(x =>
|
||||
(x.FName + " " + x.LName).Contains(searchModel.FullNameOrCompanyName));
|
||||
}
|
||||
var joinedQuery = personalContractingPartiesQuery
|
||||
.GroupJoin(_context.InstitutionContractSet.Where(x => personalContractingPartiesQuery.Any(p => p.id == x.ContractingPartyId)),
|
||||
contractingParty => contractingParty.id,
|
||||
institution => institution.ContractingPartyId,
|
||||
(contractingParty, institution) => new
|
||||
{
|
||||
contractingParty,
|
||||
institution
|
||||
});
|
||||
|
||||
var result = await joinedQuery.Skip(searchModel.PageIndex)
|
||||
.Take(30).Select(x => new ContractingPartyGetListViewModel()
|
||||
{
|
||||
ArchiveCode = x.contractingParty.ArchiveCode,
|
||||
BlockTimes = x.contractingParty.BlockTimes,
|
||||
|
||||
ContractingPartyName = x.contractingParty.IsLegal == "حقیقی" ?
|
||||
x.contractingParty.SureName == null ? $"{x.contractingParty.FName} {x.contractingParty.LName}"
|
||||
: $"{x.contractingParty.FName} {x.contractingParty.LName} {x.contractingParty.SureName}"
|
||||
: x.contractingParty.SureName == null ? $"{x.contractingParty.LName}"
|
||||
: $"{x.contractingParty.LName} {x.contractingParty.SureName}",
|
||||
|
||||
ContractingPartyType = x.contractingParty.IsLegal == "حقیقی" ? LegalType.Real : LegalType.Legal,
|
||||
Employers = x.contractingParty.Employers.Take(11).Select(e => new ContractingPartyGetListEmployerViewModel(e.id, e.FullName)).ToList(),
|
||||
Id = x.contractingParty.id,
|
||||
IsBlock = x.contractingParty.IsBlock == "true",
|
||||
HasInstitutionContract = x.institution.Any(i => i.IsActiveString == "true"),
|
||||
NationalIdOrNationalCode = x.contractingParty.IsLegal == "حقیقی" ? x.contractingParty.Nationalcode : x.contractingParty.NationalId,
|
||||
Status = x.contractingParty.IsActiveString == "true" ? ActivationStatus.Active : ActivationStatus.DeActive
|
||||
}).ToListAsync();
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<List<ContractingPartySelectListViewModel>> GetSelectList()
|
||||
{
|
||||
return await _context.PersonalContractingParties.Select(x => new ContractingPartySelectListViewModel
|
||||
{
|
||||
Id = x.id,
|
||||
Text = x.IsLegal == "حقیقی" ? x.SureName == null
|
||||
? $"{x.FName} {x.LName}"
|
||||
: $"{x.FName} {x.LName} {x.SureName}"
|
||||
: x.SureName == null ? $"{x.LName}"
|
||||
: $"{x.LName} {x.SureName}",
|
||||
|
||||
}).ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<List<GetContractingPartyNationalCodeOrNationalIdViewModel>> GetNationalCodeOrNationalId()
|
||||
{
|
||||
return await _context.PersonalContractingParties.Select(x => new GetContractingPartyNationalCodeOrNationalIdViewModel
|
||||
{
|
||||
NationalCodeOrNationalId = x.IsLegal == "true" ? x.NationalId : x.Nationalcode
|
||||
}).ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<OperationResult<string>> DeactivateWithSubordinates(long id)
|
||||
{
|
||||
var op = new OperationResult<string>();
|
||||
;
|
||||
using (var transaction = await _context.Database.BeginTransactionAsync())
|
||||
{
|
||||
try
|
||||
{
|
||||
var contractingParty = await _context.PersonalContractingParties
|
||||
.Include(x => x.Employers)
|
||||
.ThenInclude(x => x.Contracts)
|
||||
.Include(x => x.Employers)
|
||||
.ThenInclude(x => x.WorkshopEmployers)
|
||||
.ThenInclude(x => x.Workshop)
|
||||
.ThenInclude(x => x.Checkouts).FirstOrDefaultAsync(x => x.id == id);
|
||||
if (contractingParty == null)
|
||||
{
|
||||
return op.Failed("چنین آیتمی وجود ندارد");
|
||||
}
|
||||
|
||||
var employers = contractingParty.Employers;
|
||||
|
||||
var workshops = employers.SelectMany(x => x.WorkshopEmployers).Select(x => x.Workshop).ToList();
|
||||
|
||||
var contracts = employers.SelectMany(x => x.Contracts).ToList();
|
||||
|
||||
var checkouts = workshops.SelectMany(x => x.Checkouts).ToList();
|
||||
|
||||
|
||||
contractingParty.DeActive();
|
||||
|
||||
foreach (var employer in employers)
|
||||
{
|
||||
employer.DeActive();
|
||||
}
|
||||
|
||||
foreach (var workshop in workshops)
|
||||
{
|
||||
workshop.DeActive(workshop.ArchiveCode);
|
||||
}
|
||||
|
||||
foreach (var contract in contracts)
|
||||
{
|
||||
contract.DeActive();
|
||||
}
|
||||
|
||||
foreach (var checkout in checkouts)
|
||||
{
|
||||
checkout.DeActive();
|
||||
}
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
await transaction.CommitAsync();
|
||||
return op.Succcedded("DeActivate");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
await transaction.RollbackAsync();
|
||||
return op.Failed("غیرفعال کردن طرف حساب با خطا مواجه شد");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<GetRealContractingPartyDetailsViewModel> GetRealDetails(long id)
|
||||
{
|
||||
var res = await _context.PersonalContractingParties.Where(x => x.IsLegal == "حقیقی").Select(x =>
|
||||
new GetRealContractingPartyDetailsViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
IdNumber = x.IdNumber,
|
||||
PhoneNumber = x.Phone,
|
||||
AgentPhone = x.AgentPhone,
|
||||
Address = x.Address,
|
||||
FullName = x.SureName == null
|
||||
? $"{x.FName} {x.LName}"
|
||||
: $"{x.FName} {x.LName} {x.SureName}",
|
||||
NationalCode = x.Nationalcode,
|
||||
RepresentativeName = x.RepresentativeFullName,
|
||||
ArchiveCode = x.ArchiveCode,
|
||||
City = x.City,
|
||||
FName = x.FName,
|
||||
LName = x.LName,
|
||||
SureName = x.SureName,
|
||||
RepresentativeId = x.RepresentativeId,
|
||||
State = x.State,
|
||||
Zone = x.Zone
|
||||
}).FirstOrDefaultAsync(x => x.Id == id);
|
||||
|
||||
if (res == null)
|
||||
{
|
||||
throw new BadRequestException("چنین طرف حسابی وجود ندارد");
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
public async Task<GetLegalContractingPartyDetailsViewModel> GetLegalDetails(long id)
|
||||
{
|
||||
var res = await _context.PersonalContractingParties.Where(x => x.IsLegal == "حقوقی").Select(x =>
|
||||
new GetLegalContractingPartyDetailsViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
PhoneNumber = x.Phone,
|
||||
AgentPhone = x.AgentPhone,
|
||||
Address = x.Address,
|
||||
CompanyFullName = x.SureName == null
|
||||
? $"{x.LName}"
|
||||
: $"{x.LName} {x.SureName}",
|
||||
NationalId = x.NationalId,
|
||||
RegisterId = x.RegisterId,
|
||||
RepresentativeName = x.RepresentativeFullName,
|
||||
RepresentativeId = x.RepresentativeId,
|
||||
State = x.State,
|
||||
SureName = x.SureName,
|
||||
Zone = x.Zone,
|
||||
ArchiveCode = x.ArchiveCode,
|
||||
City = x.City,
|
||||
CompanyName = x.LName
|
||||
}).FirstOrDefaultAsync(x => x.Id == id);
|
||||
|
||||
if (res == null)
|
||||
{
|
||||
throw new BadRequestException("چنین طرف حسابی وجود ندارد");
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.InstitutionPlanAgg;
|
||||
@@ -170,7 +169,6 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
|
||||
|
||||
}
|
||||
|
||||
|
||||
public InstitutionPlanViewModel GetInstitutionPlanForWorkshop(WorkshopTempViewModel command)
|
||||
{
|
||||
var planPercentage = _context.PlanPercentages.FirstOrDefault();
|
||||
@@ -184,7 +182,10 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
|
||||
|
||||
var dailyWage = dailyWageYearlySalery.YearlySalaryItemsList.Where(x => x.ItemName == "مزد روزانه")
|
||||
.Select(x => x.ItemValue).FirstOrDefault();
|
||||
|
||||
if (command.ContractAndCheckout)
|
||||
command.ContractAndCheckoutInPerson = true;
|
||||
if(command.Insurance)
|
||||
command.InsuranceInPerson = true;
|
||||
|
||||
if (command.CountPerson > 0)
|
||||
{
|
||||
@@ -193,28 +194,28 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
|
||||
.Select(plan => new InstitutionPlanViewModel
|
||||
{
|
||||
CountPerson = plan.CountPerson,
|
||||
|
||||
|
||||
ContractAndCheckoutDouble = command.ContractAndCheckout ?
|
||||
((dailyWage * planPercentage.ContractAndCheckoutPercent / 100) * plan.CountPerson * plan.IncreasePercentage) : 0,
|
||||
|
||||
|
||||
InsuranceDouble = command.Insurance ? (((dailyWage * planPercentage.InsurancePercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage) : 0,
|
||||
|
||||
|
||||
RollCallDouble = command.RollCall ? (((dailyWage * planPercentage.RollCallPercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage) : 0,
|
||||
|
||||
CustomizeCheckoutDouble = (((dailyWage * planPercentage.CustomizeCheckoutPercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage),
|
||||
|
||||
ContractAndCheckoutInPersonDouble = command.ContractAndCheckoutInPerson ? (((dailyWage * planPercentage.ContractAndCheckoutInPersonPercent) / 100) * plan.CountPerson *
|
||||
|
||||
CustomizeCheckoutDouble =command.CustomizeCheckout ? (((dailyWage * planPercentage.CustomizeCheckoutPercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage) : 0,
|
||||
|
||||
ContractAndCheckoutInPersonDouble = command.ContractAndCheckoutInPerson ? (((dailyWage * planPercentage.ContractAndCheckoutInPersonPercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage) : 0,
|
||||
|
||||
|
||||
InsuranceInPersonDouble = command.InsuranceInPerson ? (((dailyWage * planPercentage.InsuranceInPersonPercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage) : 0,
|
||||
|
||||
|
||||
}).FirstOrDefault();
|
||||
|
||||
if(planByCountPerson == null)
|
||||
if (planByCountPerson == null)
|
||||
return new InstitutionPlanViewModel();
|
||||
//مبلغ کل خدمات حضوری
|
||||
var inPersonSumAmount = planByCountPerson.ContractAndCheckoutDouble + planByCountPerson.InsuranceDouble +
|
||||
@@ -236,7 +237,7 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
|
||||
{
|
||||
CountPerson = planByCountPerson.CountPerson,
|
||||
|
||||
ContractAndCheckout = planByCountPerson.ContractAndCheckoutDouble > 0 ? planByCountPerson.ContractAndCheckoutDouble.ToMoney() : "0",
|
||||
ContractAndCheckout = planByCountPerson.ContractAndCheckoutDouble > 0 ? planByCountPerson.ContractAndCheckoutDouble.ToMoney() : "0",
|
||||
|
||||
Insurance = planByCountPerson.InsuranceDouble > 0 ? planByCountPerson.InsuranceDouble.ToMoney() : "0",
|
||||
|
||||
@@ -259,7 +260,7 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
return new InstitutionPlanViewModel();
|
||||
}
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using _0_Framework.Application.Enums;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.RepresentativeAgg;
|
||||
using CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
using CompanyManagment.App.Contracts.Representative;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
@@ -213,5 +216,82 @@ public class RepresentativeRepository : RepositoryBase<long, Representative>, IR
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Api
|
||||
public async Task<ICollection<RepresentativeGetListViewModel>> GetList(RepresentativeGetListSearchModel searchModel)
|
||||
{
|
||||
var query = _context.RepresentativeSet.Include(x => x.ContractingParties)
|
||||
.Where(x => x.FullName != "-");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.CompanyNameOrFullName))
|
||||
query = query.Where(x => x.FullName.Contains(searchModel.CompanyNameOrFullName));
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.NationalCodeOrNationalId))
|
||||
query = query.Where(x => x.Nationalcode.Contains(searchModel.NationalCodeOrNationalId)
|
||||
|| x.NationalId.Contains(searchModel.NationalCodeOrNationalId));
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.IdNumber))
|
||||
query = query.Where(x => x.IdNumber.Contains(searchModel.IdNumber));
|
||||
|
||||
|
||||
if (searchModel.ContractingPartyId > 0)
|
||||
{
|
||||
query = query.Where(x => x.ContractingParties.Any(c => c.id == searchModel.ContractingPartyId));
|
||||
}
|
||||
|
||||
if (searchModel.RepresentativeType != LegalType.None)
|
||||
{
|
||||
string isLegal = searchModel.RepresentativeType switch
|
||||
{
|
||||
LegalType.Real => "false",
|
||||
LegalType.Legal => "true",
|
||||
_ => ""
|
||||
};
|
||||
|
||||
query = query.Where(x => x.IsLegal == isLegal);
|
||||
}
|
||||
|
||||
if (searchModel.RepresentativeStatus != ActivationStatus.None)
|
||||
{
|
||||
string status = searchModel.RepresentativeStatus switch
|
||||
{
|
||||
ActivationStatus.Active => "true",
|
||||
ActivationStatus.DeActive => "false",
|
||||
_ => ""
|
||||
};
|
||||
query = query.Where(x => x.IsActive == status);
|
||||
}
|
||||
|
||||
var result = await query.Skip(searchModel.PageIndex).Take(30)
|
||||
.Select(x => new RepresentativeGetListViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
NationalIdOrNationalCode = x.IsLegal == "true" ? x.NationalId : x.Nationalcode,
|
||||
RealNameOrLegalName = x.FullName,
|
||||
HasAnyContractingParty = x.ContractingParties.Any(),
|
||||
RepresentativeStatus = x.IsActive == "false" ? ActivationStatus.DeActive : ActivationStatus.Active,
|
||||
RepresentativeType = x.IsLegal == "true" ? LegalType.Legal : LegalType.Real,
|
||||
}).ToListAsync();
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
public bool HasAnyContractingParty(long id)
|
||||
{
|
||||
return _context.RepresentativeSet.Where(x => x.id == id).Include(x => x.ContractingParties)
|
||||
.Any(x => x.ContractingParties.Any());
|
||||
}
|
||||
|
||||
public async Task<List<GetSelectListRepresentativeViewModel>> GetSelectList()
|
||||
{
|
||||
return await _context.RepresentativeSet.Select(x => new GetSelectListRepresentativeViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
Name = x.FullName
|
||||
}).ToListAsync();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -40,5 +40,11 @@ public class WorkshopTempRepository : RepositoryBase<long, WorkshopTemp>, IWorks
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task RemoveWorkshopTemps(List<long> workshopTempIds)
|
||||
{
|
||||
var result = _context.WorkshopTemps.Where(x => workshopTempIds.Contains(x.id));
|
||||
|
||||
_context.RemoveRange(result);
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/CodeEditing/SuppressNullableWarningFix/Enabled/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Aqaye/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Govermentlist/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Mcls/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Mcls/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Pardakht/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||
@@ -205,9 +205,13 @@ using CompanyManagment.App.Contracts.EmployeeClientTemp;
|
||||
using CompanyManagment.App.Contracts.InstitutionPlan;
|
||||
using CompanyManagment.App.Contracts.LeftWorkTemp;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
using Company.Domain.ContactUsAgg;
|
||||
using CompanyManagment.App.Contracts.ContactUs;
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
using Company.Domain.AdminMonthlyOverviewAgg;
|
||||
using Company.Domain.PaymentTransactionAgg;
|
||||
using CompanyManagment.App.Contracts.AdminMonthlyOverview;
|
||||
using CompanyManagment.App.Contracts.PaymentTransaction;
|
||||
|
||||
namespace PersonalContractingParty.Config;
|
||||
|
||||
@@ -427,10 +431,16 @@ public class PersonalBootstrapper
|
||||
services.AddTransient<ILeftWorkTempRepository, LeftWorkTempRepository>();
|
||||
services.AddTransient<ILeftWorkTempApplication, LeftWorkTempApplication>();
|
||||
|
||||
services.AddTransient<IContactUsRepository, ContactUsRepository>();
|
||||
services.AddTransient<IContactUsApplication, ContactUsApplication>();
|
||||
|
||||
services.AddTransient<IEmployeeAuthorizeTempRepository, EmployeeAuthorizeTempRepository>();
|
||||
|
||||
services.AddTransient<IAdminMonthlyOverviewRepository, AdminMonthlyOverviewRepository>();
|
||||
services.AddTransient<IAdminMonthlyOverviewApplication, AdminMonthlyOverviewApplication>();
|
||||
|
||||
services.AddTransient<IPaymentTransactionRepository, PaymentTransactionRepository>();
|
||||
services.AddTransient<IPaymentTransactionApplication, PaymentTransactionApplication>();
|
||||
#endregion
|
||||
#region Pooya
|
||||
|
||||
|
||||
25
ServiceHost/Areas/Admin/Controllers/AccountController.cs
Normal file
25
ServiceHost/Areas/Admin/Controllers/AccountController.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using AccountManagement.Application.Contracts.Account;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Controllers;
|
||||
|
||||
public class AccountController:AdminBaseController
|
||||
{
|
||||
private readonly IAccountApplication _accountApplication;
|
||||
|
||||
public AccountController(IAccountApplication accountApplication)
|
||||
{
|
||||
_accountApplication = accountApplication;
|
||||
}
|
||||
/// <summary>
|
||||
/// سلکت لیست اکانت های ادمین برای جستجو
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("select_list")]
|
||||
public async Task<ActionResult<List<AccountSelectListViewModel>>> GetAdminAccountsSelectList()
|
||||
{
|
||||
var res = await _accountApplication.GetAdminSelectList();
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.AdminMonthlyOverview;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Controllers;
|
||||
|
||||
public class AdminMonthlyOverviewController:AdminBaseController
|
||||
{
|
||||
|
||||
private readonly IAdminMonthlyOverviewApplication _adminMonthlyOverviewApplication;
|
||||
|
||||
public AdminMonthlyOverviewController(IAdminMonthlyOverviewApplication adminMonthlyOverviewApplication)
|
||||
{
|
||||
_adminMonthlyOverviewApplication = adminMonthlyOverviewApplication;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// لیست امور ماهیانه پرسنل
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("")]
|
||||
public async Task<ActionResult<List<AdminMonthlyOverviewListViewModel>>> GetList([FromQuery]AdminMonthlyOverviewSearchModel searchModel)
|
||||
{
|
||||
var result= await _adminMonthlyOverviewApplication.GetWorkshopListByStatus(searchModel);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// مرحله بهدی
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("Next/{id}")]
|
||||
public async Task<ActionResult<OperationResult>> Next(long id)
|
||||
{
|
||||
var result = await _adminMonthlyOverviewApplication.Next(id);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// مرحله قبلی
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("Back/{id}")]
|
||||
public async Task<ActionResult<OperationResult>> Back(long id)
|
||||
{
|
||||
var result = await _adminMonthlyOverviewApplication.Back(id);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// تعداد امور ماهاینه
|
||||
/// </summary>
|
||||
/// <param name="year"></param>
|
||||
/// <param name="month"></param>
|
||||
/// <param name="accountId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("Counter")]
|
||||
public async Task<ActionResult<AdminMonthlyOverViewCounterVm>> Counter(int year,int month,int accountId)
|
||||
{
|
||||
var result = await _adminMonthlyOverviewApplication.GetCounter(year,month,accountId);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
using System.Diagnostics;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Controllers;
|
||||
|
||||
public class ContractingPartyController : AdminBaseController
|
||||
{
|
||||
private readonly IPersonalContractingPartyApp _contractingPartyApplication;
|
||||
|
||||
public ContractingPartyController(IPersonalContractingPartyApp contractingPartyApplication)
|
||||
{
|
||||
_contractingPartyApplication = contractingPartyApplication;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// لیست طرف حساب
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<ICollection<ContractingPartyGetListViewModel>>> Get([FromQuery] ContractingPartyGetListSearchModel searchModel)
|
||||
{
|
||||
var watch = new Stopwatch();
|
||||
watch.Start();
|
||||
var result = await _contractingPartyApplication.GetList(searchModel);
|
||||
Console.WriteLine(watch.Elapsed);
|
||||
return result.ToList();
|
||||
}
|
||||
[HttpGet("t/{name}")]
|
||||
public async Task<List<string>> TestApi(string name)
|
||||
{
|
||||
var res = _contractingPartyApplication.SearchByName(name).Where(x=>x.Contains(name)).ToList();
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// جزئیات طرف حساب حقیقی
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("real/{id}")]
|
||||
public async Task<ActionResult<GetRealContractingPartyDetailsViewModel>> GetDetailsReal(long id)
|
||||
{
|
||||
var result = await _contractingPartyApplication.GetRealDetails(id);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// جزئیات طرف حساب حقوقی
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("legal/{id}")]
|
||||
public async Task<ActionResult<GetLegalContractingPartyDetailsViewModel>> GetDetailsLegal(long id)
|
||||
{
|
||||
var result = await _contractingPartyApplication.GetLegalDetails(id);
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد طرف حساب حقیقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("real")]
|
||||
public async Task<ActionResult<OperationResult>> CreateReal([FromBody] CreateRealContractingParty command)
|
||||
{
|
||||
var result = await _contractingPartyApplication.CreateReal(command);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد طرف حساب حقوقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("legal")]
|
||||
public async Task<ActionResult<OperationResult>> CreateLegal([FromBody] CreateLegalContractingParty command)
|
||||
{
|
||||
var result = await _contractingPartyApplication.CreateLegal(command);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش طرف حساب حقیقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut("real")]
|
||||
public ActionResult<OperationResult> EditReal([FromBody] EditRealContractingParty command)
|
||||
{
|
||||
var result = _contractingPartyApplication.EditRealApi(command);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش طرف حساب حقوقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut("legal")]
|
||||
public ActionResult<OperationResult> EditLegal([FromBody] EditLegalContractingParty command)
|
||||
{
|
||||
var result = _contractingPartyApplication.EditLegal(command);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// چک کردن بلاک بودن طرف حساب با آیدی کارفرما
|
||||
/// </summary>
|
||||
/// <param name="employerId">آیدی کارفرما</param>
|
||||
/// <returns>true - false - NotFound</returns>
|
||||
[HttpGet("is_block/{employerId}")]
|
||||
public ActionResult<string> IsBlockByEmployerId(long employerId)
|
||||
{
|
||||
var result = _contractingPartyApplication.IsBlockByEmployerId(employerId);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// گرفتن آخرین کد بایگانی کارگاه
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("last_archive_code")]
|
||||
public ActionResult<int> GetLastArchiveCodeByContractingPartyId()
|
||||
{
|
||||
var data = _contractingPartyApplication.GetLastArchiveCode();
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// سلکت لیست طرف حساب برای جستجو
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("selectList")]
|
||||
public async Task<ActionResult<List<ContractingPartySelectListViewModel>>> GetSelectList()
|
||||
{
|
||||
return await _contractingPartyApplication.GetSelectList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// لیست شناسه ملی یا شماره ملی برای جستجوی
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("national_Code_Select_list")]
|
||||
public async Task<ActionResult<List<GetContractingPartyNationalCodeOrNationalIdViewModel>>> GetNationalCodeOrNationalId()
|
||||
{
|
||||
return await _contractingPartyApplication.GetNationalCodeOrNationalId();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// حذف طرف حساب. درصورت داشتن قرارداد مالی یا داشتن کارفرما، طرف حساب غیرفعال میشود
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpDelete]
|
||||
public async Task<OperationResult<string>> DeleteContractingParty(long id)
|
||||
{
|
||||
var operationResult = await _contractingPartyApplication.Delete(id);
|
||||
|
||||
return operationResult;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user