Merge branch 'master' into Main
# Conflicts: # ServiceHost/Areas/AdminNew/Pages/Company/AndroidApk/Index.cshtml.cs
This commit is contained in:
@@ -161,4 +161,5 @@ public interface IInstitutionContractRepository : IRepository<long, InstitutionC
|
||||
#endregion
|
||||
|
||||
Task<long> GetIdByInstallmentId(long installmentId);
|
||||
Task<InstitutionContract> GetPreviousContract(long currentInstitutionContractId);
|
||||
}
|
||||
@@ -1609,7 +1609,10 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
}
|
||||
|
||||
institutionContract.SetSigningType(signingType);
|
||||
|
||||
var previousInstitutionContract = await _institutionContractRepository
|
||||
.GetPreviousContract(institutionContract.id);
|
||||
previousInstitutionContract.DeActive();
|
||||
ReActiveAllAfterCreateNew(institutionContract.ContractingPartyId);
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
@@ -2837,7 +2837,6 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
_context.InstitutionContractContactInfos.Add(contactinfo);
|
||||
}
|
||||
}
|
||||
|
||||
await SaveChangesAsync();
|
||||
|
||||
await _smsService.SendInstitutionCreationVerificationLink(contractingParty.Phone, contractingPartyFullName,
|
||||
@@ -2848,6 +2847,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
await transaction.CommitAsync();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -5055,7 +5055,20 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
.Where(x => x.Installments.Any(i => i.Id == installmentId))
|
||||
.Select(x => x.id).FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
|
||||
public async Task<InstitutionContract> GetPreviousContract(long currentInstitutionContractId)
|
||||
{
|
||||
var institutionContract =await _context.InstitutionContractSet
|
||||
.FirstOrDefaultAsync(x=>x.id ==currentInstitutionContractId);
|
||||
if (institutionContract == null)
|
||||
return null;
|
||||
var previousContract = await _context.InstitutionContractSet
|
||||
.Where(x => x.ContractingPartyId == institutionContract.ContractingPartyId)
|
||||
.Where(x => x.ContractStartGr < institutionContract.ContractStartGr)
|
||||
.OrderByDescending(x => x.ContractEndGr)
|
||||
.FirstOrDefaultAsync();
|
||||
return previousContract;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
private readonly IOnlinePayment _onlinePayment;
|
||||
private readonly IFaceEmbeddingService _faceEmbeddingService;
|
||||
private readonly IAuthHelper _authHelper;
|
||||
private readonly IInstitutionContractApplication _institutionContractApplication;
|
||||
|
||||
|
||||
[BindProperty] public IFormFile File { get; set; }
|
||||
@@ -87,7 +88,8 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
public IndexModel(IAndroidApkVersionApplication application, IRollCallDomainService rollCallDomainService,
|
||||
CompanyContext context, AccountContext accountContext, IHttpClientFactory httpClientFactory,
|
||||
IOptions<AppSettingConfiguration> appSetting,
|
||||
ITemporaryClientRegistrationApplication clientRegistrationApplication, IOnlinePayment onlinePayment, IFaceEmbeddingService faceEmbeddingService, IAuthHelper authHelper)
|
||||
ITemporaryClientRegistrationApplication clientRegistrationApplication, IOnlinePayment onlinePayment,
|
||||
IFaceEmbeddingService faceEmbeddingService, IAuthHelper authHelper, IInstitutionContractApplication institutionContractApplication)
|
||||
{
|
||||
_application = application;
|
||||
_rollCallDomainService = rollCallDomainService;
|
||||
@@ -98,6 +100,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
_onlinePayment = onlinePayment;
|
||||
_faceEmbeddingService = faceEmbeddingService;
|
||||
_authHelper = authHelper;
|
||||
_institutionContractApplication = institutionContractApplication;
|
||||
_paymentGateway = new SepehrPaymentGateway(httpClientFactory);
|
||||
}
|
||||
|
||||
@@ -162,31 +165,60 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
{
|
||||
//await UpdateInstitutionContract();
|
||||
//await UpdateFaceEmbeddingNames();
|
||||
await SetInstitutionContractSigningType();
|
||||
//await SetInstitutionContractSigningType();
|
||||
await ReActivateInstitution();
|
||||
ViewData["message"] = "تومام یک";
|
||||
return Page();
|
||||
}
|
||||
|
||||
private async System.Threading.Tasks.Task ReActivateInstitution()
|
||||
{
|
||||
var blueInstitutionContracts = await _context.InstitutionContractSet.Where(x =>
|
||||
x.IsActiveString == "blue").ToListAsync();
|
||||
|
||||
|
||||
var blueContracts = new List<InstitutionContract>();
|
||||
|
||||
foreach (var blueContract in blueInstitutionContracts)
|
||||
{
|
||||
var verifiedContracts = await _context.InstitutionContractSet
|
||||
.Where(x => x.ContractingPartyId == blueContract.ContractingPartyId
|
||||
&& x.VerificationStatus == InstitutionContractVerificationStatus.Verified
|
||||
&& x.ContractStartGr > blueContract.ContractEndGr)
|
||||
.ToListAsync();
|
||||
|
||||
if (verifiedContracts.Any())
|
||||
{
|
||||
blueContracts.Add(blueContract);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var institutionContract in blueContracts)
|
||||
{
|
||||
institutionContract.DeActive();
|
||||
_institutionContractApplication.ReActiveAllAfterCreateNew(institutionContract.ContractingPartyId);
|
||||
}
|
||||
}
|
||||
|
||||
private async System.Threading.Tasks.Task SetInstitutionContractSigningType()
|
||||
{
|
||||
var query = _context.InstitutionContractSet
|
||||
.Where(x=>x.VerificationStatus != InstitutionContractVerificationStatus.PendingForVerify);
|
||||
|
||||
|
||||
var otpSigned = query.Where(x=>x.VerifierFullName != null && x.LawId != 0).ToList();
|
||||
.Where(x => x.VerificationStatus != InstitutionContractVerificationStatus.PendingForVerify);
|
||||
|
||||
|
||||
var otpSigned = query.Where(x => x.VerifierFullName != null && x.LawId != 0).ToList();
|
||||
foreach (var institutionContract in otpSigned)
|
||||
{
|
||||
institutionContract.SetSigningType(InstitutionContractSigningType.OtpBased);
|
||||
}
|
||||
var lagacySigned = query.Where(x=>x.VerifierFullName == null && x.LawId == 0).ToList();
|
||||
|
||||
var lagacySigned = query.Where(x => x.VerifierFullName == null && x.LawId == 0).ToList();
|
||||
foreach (var institutionContract in lagacySigned)
|
||||
{
|
||||
institutionContract.SetSigningType(InstitutionContractSigningType.Legacy);
|
||||
}
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostShiftDateNew2()
|
||||
@@ -336,6 +368,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
//TranslateCode(result?.ErrorCode);
|
||||
return Page();
|
||||
}
|
||||
|
||||
[DisableConcurrentExecution(timeoutInSeconds: 120)]
|
||||
public async Task<IActionResult> OnPostUploadFrontEnd(CancellationToken cancellationToken)
|
||||
{
|
||||
@@ -378,8 +411,8 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
TempData["Message"] = "فرآیند Deploy شروع شد. لاگ را بررسی کنید.";
|
||||
return RedirectToPage();
|
||||
}
|
||||
return Forbid();
|
||||
|
||||
return Forbid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -405,13 +438,10 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
{
|
||||
contractingPartyIdList.Add(employer.Employer.ContractingPartyId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (contractingPartyIdList.Count > 0)
|
||||
{
|
||||
|
||||
|
||||
if (contractingPartyIdList.Count == 1)
|
||||
{
|
||||
workshop.AddContractingPartyId(contractingPartyIdList[0]);
|
||||
@@ -432,7 +462,6 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
|
||||
ViewData["message"] = "آی دی های طرف حساب اضافه شد";
|
||||
return Page();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -451,8 +480,8 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
var content = System.IO.File.ReadAllText(logPath, Encoding.UTF8);
|
||||
return Content(content);
|
||||
}
|
||||
return Content("شما مجاز به دیدن لاگ نیستید");
|
||||
|
||||
return Content("شما مجاز به دیدن لاگ نیستید");
|
||||
}
|
||||
|
||||
|
||||
|
||||
25
ServiceHost/Areas/Client/Controllers/EmployeeController.cs
Normal file
25
ServiceHost/Areas/Client/Controllers/EmployeeController.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Areas.Client.Controllers;
|
||||
|
||||
public class EmployeeController:ClientBaseController
|
||||
{
|
||||
private readonly IEmployeeApplication _employeeApplication;
|
||||
private readonly long _workshopId;
|
||||
|
||||
public EmployeeController(IEmployeeApplication employeeApplication,IAuthHelper authHelper)
|
||||
{
|
||||
_employeeApplication = employeeApplication;
|
||||
_workshopId = authHelper.GetWorkshopId();
|
||||
}
|
||||
|
||||
[HttpGet("select-list")]
|
||||
public async Task<ActionResult<List<EmployeeSelectListViewModel>>> GetEmployeeSelectList()
|
||||
{
|
||||
var result = await _employeeApplication.WorkedEmployeesInWorkshopSelectList(_workshopId);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user