Merge branch 'master' into Feature/ClientLeavePageApi
This commit is contained in:
@@ -43,6 +43,9 @@
|
||||
case TypeOfSmsSetting.Warning:
|
||||
<h5 class="modal-title">ایجاد پیامک هشدار قضائی</h5>
|
||||
break;
|
||||
case TypeOfSmsSetting.InstitutionContractConfirm:
|
||||
<h5 class="modal-title">ایجاد پیامک یادآور تایید قراداد</h5>
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,10 @@
|
||||
case TypeOfSmsSetting.Warning:
|
||||
<h5 class="modal-title">ویرایش پیامک هشدار قضائی</h5>
|
||||
break;
|
||||
case TypeOfSmsSetting.InstitutionContractConfirm:
|
||||
<h5 class="modal-title">ویرایش پیامک یادآور تایید قراداد</h5>
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="بستن">
|
||||
@@ -100,8 +104,8 @@
|
||||
success: function (response) {
|
||||
if(response.isSuccess){
|
||||
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', response.message);
|
||||
$('.close').click();
|
||||
|
||||
|
||||
$('.close').click();
|
||||
setTimeout(function () {
|
||||
if(modelTypeOfSmsSetting == '@TypeOfSmsSetting.InstitutionContractDebtReminder'){
|
||||
$('#institutionContractDebtReminderTab').click();
|
||||
@@ -114,14 +118,16 @@
|
||||
}else if(modelTypeOfSmsSetting == '@TypeOfSmsSetting.Warning'){
|
||||
$('#warningTab').click();
|
||||
|
||||
}else if(typeOfSmsSetting == '@TypeOfSmsSetting.InstitutionContractConfirm'){
|
||||
}else if(modelTypeOfSmsSetting == '@TypeOfSmsSetting.InstitutionContractConfirm'){
|
||||
|
||||
$('#institutionContractConfirmTab').click();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}, 500);
|
||||
}, 700);
|
||||
|
||||
}else{
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
|
||||
}
|
||||
|
||||
@@ -52,6 +52,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; }
|
||||
@@ -77,7 +78,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;
|
||||
@@ -88,6 +90,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
_onlinePayment = onlinePayment;
|
||||
_faceEmbeddingService = faceEmbeddingService;
|
||||
_authHelper = authHelper;
|
||||
_institutionContractApplication = institutionContractApplication;
|
||||
_paymentGateway = new SepehrPaymentGateway(httpClientFactory);
|
||||
}
|
||||
|
||||
@@ -152,31 +155,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()
|
||||
@@ -326,6 +358,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
//TranslateCode(result?.ErrorCode);
|
||||
return Page();
|
||||
}
|
||||
|
||||
[DisableConcurrentExecution(timeoutInSeconds: 120)]
|
||||
public async Task<IActionResult> OnPostUploadFrontEnd(CancellationToken cancellationToken)
|
||||
{
|
||||
@@ -368,8 +401,8 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
TempData["Message"] = "فرآیند Deploy شروع شد. لاگ را بررسی کنید.";
|
||||
return RedirectToPage();
|
||||
}
|
||||
return Forbid();
|
||||
|
||||
return Forbid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -395,13 +428,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]);
|
||||
@@ -422,7 +452,6 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
|
||||
ViewData["message"] = "آی دی های طرف حساب اضافه شد";
|
||||
return Page();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -441,8 +470,8 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
var content = System.IO.File.ReadAllText(logPath, Encoding.UTF8);
|
||||
return Content(content);
|
||||
}
|
||||
return Content("شما مجاز به دیدن لاگ نیستید");
|
||||
|
||||
return Content("شما مجاز به دیدن لاگ نیستید");
|
||||
}
|
||||
|
||||
|
||||
@@ -1055,7 +1084,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
x.PersonnelCount,
|
||||
x.Price, x.InstitutionContractWorkshopGroupId,
|
||||
group,
|
||||
x.WorkshopId.Value,x.id);
|
||||
x.WorkshopId.Value, x.id);
|
||||
entity.SetEmployers(x.Employers.Select(e => e.EmployerId).ToList());
|
||||
|
||||
return entity;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -293,9 +293,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnPostReCalculateValues(List<ReCalculateRollCallValues> command)
|
||||
public async Task<IActionResult> OnPostReCalculateValues(List<ReCalculateRollCallValues> command)
|
||||
{
|
||||
var result = _rollCallApplication.RecalculateValues(_workshopId, command);
|
||||
var result =await _rollCallApplication.RecalculateValues(_workshopId, command);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
|
||||
@@ -75,7 +75,7 @@ public class GeneralController : GeneralBaseController
|
||||
}
|
||||
|
||||
[HttpGet("/api/callback"), HttpPost("/api/callback")]
|
||||
public async Task<IActionResult> Verify(SepehrGatewayPayResponse payResponse)
|
||||
public async Task<IActionResult> Verify([FromForm]SepehrGatewayPayResponse payResponse)
|
||||
{
|
||||
if (!long.TryParse(payResponse.invoiceid, out var paymentTransactionId))
|
||||
{
|
||||
@@ -133,7 +133,12 @@ public class GeneralController : GeneralBaseController
|
||||
DigitalReceipt = payResponse.digitalreceipt
|
||||
};
|
||||
|
||||
|
||||
var verifyRes = await _paymentGateway.Verify(verifyCommand, CancellationToken.None);
|
||||
#if DEBUG
|
||||
verifyRes.IsSuccess = true;
|
||||
#endif
|
||||
|
||||
_financialInvoiceApplication.SetPaid(financialInvoiceId, DateTime.Now);
|
||||
|
||||
if (verifyRes.IsSuccess)
|
||||
@@ -158,14 +163,18 @@ public class GeneralController : GeneralBaseController
|
||||
payResponse.cardnumber, payResponse.issuerbank, payResponse.rrn.ToString(),
|
||||
payResponse.digitalreceipt);
|
||||
|
||||
if (financialInvoice.Items?.Any(x => x.Type is FinancialInvoiceItemType.BuyInstitutionContract or FinancialInvoiceItemType.BuyInstitutionContractInstallment) ?? false)
|
||||
if (financialInvoice.Items?.Any(x =>
|
||||
x.Type is FinancialInvoiceItemType.BuyInstitutionContract
|
||||
or FinancialInvoiceItemType.BuyInstitutionContractInstallment) ?? false)
|
||||
{
|
||||
var financialItems = financialInvoice.Items
|
||||
.Where(x => x.Type == FinancialInvoiceItemType.BuyInstitutionContract);
|
||||
foreach (var editFinancialInvoiceItem in financialItems)
|
||||
{
|
||||
await _institutionContractApplication.SetPendingWorkflow(editFinancialInvoiceItem.EntityId,InstitutionContractSigningType.OtpBased);
|
||||
await _institutionContractApplication.SetPendingWorkflow(editFinancialInvoiceItem.EntityId,
|
||||
InstitutionContractSigningType.OtpBased);
|
||||
}
|
||||
|
||||
var financialInstallmentItems = financialInvoice.Items
|
||||
.Where(x => x.Type == FinancialInvoiceItemType.BuyInstitutionContractInstallment);
|
||||
|
||||
@@ -174,7 +183,8 @@ public class GeneralController : GeneralBaseController
|
||||
var institutionContractId =
|
||||
await _institutionContractApplication.GetIdByInstallmentId(
|
||||
editFinancialInvoiceItem.EntityId);
|
||||
await _institutionContractApplication.SetPendingWorkflow(institutionContractId,InstitutionContractSigningType.OtpBased);
|
||||
await _institutionContractApplication.SetPendingWorkflow(institutionContractId,
|
||||
InstitutionContractSigningType.OtpBased);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user