Compare commits
8 Commits
Feature/In
...
Feature/in
| Author | SHA1 | Date | |
|---|---|---|---|
| 56e79d2099 | |||
| 93891f3837 | |||
|
|
5bdfbc572b | ||
|
|
07113353c4 | ||
| 8c6336b9bd | |||
| 20e3d454cf | |||
| 2bf31db6b2 | |||
| 7a4a6de84f |
@@ -98,6 +98,11 @@ public class InstitutionContract : EntityBase
|
||||
// مبلغ قرارداد
|
||||
public double ContractAmount { get; private set; }
|
||||
|
||||
public double ContractAmountWithTax => !IsOldContract ? ContractAmount + ContractAmountTax
|
||||
: ContractAmount;
|
||||
|
||||
public double ContractAmountTax => ContractAmount*0.10;
|
||||
|
||||
//خسارت روزانه
|
||||
public double DailyCompenseation { get; private set; }
|
||||
|
||||
@@ -159,6 +164,8 @@ public class InstitutionContract : EntityBase
|
||||
|
||||
public List<InstitutionContractAmendment> Amendments { get; private set; }
|
||||
|
||||
public bool IsOldContract => LawId== 0;
|
||||
|
||||
public InstitutionContract()
|
||||
{
|
||||
ContactInfoList = [];
|
||||
|
||||
@@ -316,7 +316,10 @@ public class Workshop : EntityBase
|
||||
IsStaticCheckout = isStaticCheckout;
|
||||
}
|
||||
|
||||
|
||||
public void AddContractingPartyId(long contractingPartyId)
|
||||
{
|
||||
ContractingPartyId = contractingPartyId;
|
||||
}
|
||||
public void Active(string archiveCode)
|
||||
{
|
||||
this.IsActive = true;
|
||||
|
||||
@@ -344,6 +344,9 @@ public class InstitutionContractPrintViewModel
|
||||
public string TotalPrice { get; set; }
|
||||
public string TaxPrice { get; set; }
|
||||
public string PaymentPrice { get; set; }
|
||||
public string OneMonthPrice { get; set; }
|
||||
public string OneMonthWithoutTax { get; set; }
|
||||
public string OneMonthTax { get; set; }
|
||||
public string VerifyCode { get; set; }
|
||||
public string VerifyDate { get; set; }
|
||||
public string VerifyTime { get; set; }
|
||||
|
||||
@@ -45,5 +45,10 @@ public class InstitutionContractMapping : IEntityTypeConfiguration<InstitutionCo
|
||||
|
||||
builder.HasMany(x => x.Amendments).WithOne(x => x.InstitutionContract)
|
||||
.HasForeignKey(x => x.InstitutionContractId);
|
||||
|
||||
|
||||
builder.Ignore(x => x.ContractAmountWithTax);
|
||||
builder.Ignore(x => x.ContractAmountTax);
|
||||
builder.Ignore(x => x.ContractAmountTax);
|
||||
}
|
||||
}
|
||||
@@ -1375,7 +1375,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
.Count(l => l.StartWorkDate <= DateTime.Now && l.LeftWorkDate >= DateTime.Now);
|
||||
return new GetInstitutionContractListItemsViewModel()
|
||||
{
|
||||
ContractAmount = x.contract.ContractAmount,
|
||||
ContractAmount = x.contract.ContractAmountWithTax,
|
||||
Balance = statement?.FinancialTransactionList.Sum(ft => ft.Deptor - ft.Creditor) ?? 0,
|
||||
WorkshopsCount = workshops.Count(),
|
||||
ContractStartFa = x.contract.ContractStartGr.ToFarsi(),
|
||||
@@ -1395,9 +1395,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
Workshops = workshopDetails,
|
||||
IsInPersonContract = x.contract.WorkshopGroup?.CurrentWorkshops
|
||||
.Any(y => y.Services.ContractInPerson) ?? true,
|
||||
IsOldContract = x.contract.WorkshopGroup?.CurrentWorkshops == null
|
||||
|| x.contract.WorkshopGroup.CurrentWorkshops.Count == 0
|
||||
|| x.contract.WorkshopGroup.CurrentWorkshops.Any(y => y.Price == 0)
|
||||
IsOldContract = x.contract.IsOldContract
|
||||
};
|
||||
}).ToList()
|
||||
};
|
||||
@@ -3216,6 +3214,9 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
PaymentPrice = institution.TotalAmount.ToMoney(),
|
||||
TotalPrice = (institution.TotalAmount - institution.ValueAddedTax).ToMoney(),
|
||||
TaxPrice = institution.ValueAddedTax.ToMoney(),
|
||||
OneMonthPrice = institution.ContractAmountWithTax.ToMoney(),
|
||||
OneMonthWithoutTax = institution.ContractAmount.ToMoney(),
|
||||
OneMonthTax = institution.ContractAmountTax.ToMoney(),
|
||||
VerifierFullName = institution.VerifierFullName,
|
||||
VerifierPhoneNumber = institution.VerifierPhoneNumber,
|
||||
VerifyCode = institution.VerifyCode,
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
@page
|
||||
|
||||
|
||||
<h4>Deploy Log</h4>
|
||||
|
||||
<pre style="
|
||||
background:#111;
|
||||
color:#0f0;
|
||||
padding:15px;
|
||||
max-height:600px;
|
||||
overflow:auto;
|
||||
font-size:13px;
|
||||
border-radius:6px;">
|
||||
|
||||
</pre>
|
||||
@@ -2,6 +2,14 @@
|
||||
@model ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk.IndexModel
|
||||
@{
|
||||
ViewData["Title"] = "File Upload";
|
||||
<style>
|
||||
.lineDiv {
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
background-image: linear-gradient(to right, #ffffff, #e5e5e5, #cbcbcb, #b2b2b2, #9a9a9a, #9a9a9a, #9a9a9a, #9a9a9a, #b2b2b2, #cbcbcb, #e5e5e5, #ffffff);
|
||||
margin: 10px;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
<h1>Upload APK File</h1>
|
||||
@@ -60,16 +68,85 @@
|
||||
</form>
|
||||
|
||||
|
||||
<form style="margin:50px" asp-page-handler="PaymentGateWay" id="11" method="post">
|
||||
<form style="margin:30px" asp-page-handler="PaymentGateWay" id="11" method="post">
|
||||
|
||||
<button type="submit">درگاه پرداخت تستی </button>
|
||||
</form>
|
||||
<div class="lineDiv"></div>
|
||||
<div class="row m-t-20">
|
||||
<div class="col-4"></div>
|
||||
<div class="col-2">
|
||||
<form asp-page-handler="UploadFrontEnd" id="12" method="post">
|
||||
<button type="submit"
|
||||
class="btn btn-danger"
|
||||
onclick="return confirm('آیا از انتشار نسخه جدید فرانت مطمئن هستید؟');">
|
||||
🚀 Deploy Next UI
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<button type="button" class="btn btn-outline-secondary"
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#logModal">
|
||||
مشاهده لاگ Deploy
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-4"></div>
|
||||
</div>
|
||||
<div class="lineDiv"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="modal fade" id="logModal" tabindex="-1">
|
||||
<div class="modal-dialog modal-xl modal-dialog-scrollable">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Deploy Log</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<pre id="logContent"
|
||||
style="background: #111;
|
||||
color: #0f0;
|
||||
padding: 15px;
|
||||
font-size: 13px;
|
||||
text-align: left;
|
||||
direction: ltr;">
|
||||
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form style="margin:20px" asp-page-handler="ContractingPartyToWorkshop" id="13" method="post">
|
||||
|
||||
<button class="btn btn-outline-secondary" type="submit"> افزودن آی دی طرف حساب به کارگاه </button>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
@if (ViewData["message"] != null)
|
||||
{
|
||||
<p>@ViewData["message"]</p>
|
||||
}
|
||||
<script>
|
||||
document.getElementById('logModal')
|
||||
.addEventListener('show.bs.modal', function () {
|
||||
|
||||
fetch('?handler=Log')
|
||||
.then(r => r.text())
|
||||
.then(t => {
|
||||
document.getElementById('logContent').textContent = t;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@* <script>
|
||||
|
||||
|
||||
@@ -1,36 +1,40 @@
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using _0_Framework.Application.FaceEmbedding;
|
||||
using _0_Framework.Application.PaymentGateway;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using AccountManagement.Domain.AccountLeftWorkAgg;
|
||||
using AccountMangement.Infrastructure.EFCore;
|
||||
using Company.Domain.AndroidApkVersionAgg;
|
||||
using Company.Domain.CustomizeCheckoutAgg.ValueObjects;
|
||||
using Company.Domain.CustomizeCheckoutTempAgg.ValueObjects;
|
||||
using Company.Domain.InstitutionContractAgg;
|
||||
using Company.Domain.InstitutionPlanAgg;
|
||||
using Company.Domain.PaymentTransactionAgg;
|
||||
using Company.Domain.RewardAgg;
|
||||
using Company.Domain.RollCallAgg.DomainService;
|
||||
using CompanyManagement.Infrastructure.Excel.WorkshopsRollCall;
|
||||
using CompanyManagment.App.Contracts.AndroidApkVersion;
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
using CompanyManagment.App.Contracts.PaymentTransaction;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
using CompanyManagment.EFCore;
|
||||
using Hangfire;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Net.Http;
|
||||
using System.Security.Cryptography.Xml;
|
||||
using System.Text.Json.Serialization;
|
||||
using _0_Framework.Application.PaymentGateway;
|
||||
using Company.Domain.InstitutionContractAgg;
|
||||
using Company.Domain.InstitutionPlanAgg;
|
||||
using Company.Domain.PaymentTransactionAgg;
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
using CompanyManagment.App.Contracts.PaymentTransaction;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Parbad;
|
||||
using Parbad.AspNetCore;
|
||||
using Parbad.Gateway.Sepehr;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using _0_Framework.Application.Enums;
|
||||
using _0_Framework.Application.FaceEmbedding;
|
||||
using CompanyManagement.Infrastructure.Excel.WorkshopsRollCall;
|
||||
using System.Diagnostics;
|
||||
using System.Net.Http;
|
||||
using System.Security.Cryptography.Xml;
|
||||
using System.Text;
|
||||
using System.Text.Json.Serialization;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using static ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk.IndexModel2;
|
||||
|
||||
namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
@@ -47,6 +51,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
private readonly IHttpClientFactory _httpClientFactory;
|
||||
private readonly IOnlinePayment _onlinePayment;
|
||||
private readonly IFaceEmbeddingService _faceEmbeddingService;
|
||||
private readonly IAuthHelper _authHelper;
|
||||
|
||||
|
||||
[BindProperty] public IFormFile File { get; set; }
|
||||
@@ -61,13 +66,18 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
[Display(Name = "کد ورژن")]
|
||||
public string VersionCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// لاگ آپلود فرانت
|
||||
/// </summary>
|
||||
public string LogContent { get; set; }
|
||||
|
||||
[BindProperty] public ApkType SelectedApkType { get; set; }
|
||||
[BindProperty] public bool IsForce { get; set; }
|
||||
|
||||
public IndexModel(IAndroidApkVersionApplication application, IRollCallDomainService rollCallDomainService,
|
||||
CompanyContext context, AccountContext accountContext, IHttpClientFactory httpClientFactory,
|
||||
IOptions<AppSettingConfiguration> appSetting,
|
||||
ITemporaryClientRegistrationApplication clientRegistrationApplication, IOnlinePayment onlinePayment, IFaceEmbeddingService faceEmbeddingService)
|
||||
ITemporaryClientRegistrationApplication clientRegistrationApplication, IOnlinePayment onlinePayment, IFaceEmbeddingService faceEmbeddingService, IAuthHelper authHelper)
|
||||
{
|
||||
_application = application;
|
||||
_rollCallDomainService = rollCallDomainService;
|
||||
@@ -77,6 +87,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
_clientRegistrationApplication = clientRegistrationApplication;
|
||||
_onlinePayment = onlinePayment;
|
||||
_faceEmbeddingService = faceEmbeddingService;
|
||||
_authHelper = authHelper;
|
||||
_paymentGateway = new SepehrPaymentGateway(httpClientFactory);
|
||||
}
|
||||
|
||||
@@ -292,6 +303,105 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
//TranslateCode(result?.ErrorCode);
|
||||
return Page();
|
||||
}
|
||||
[DisableConcurrentExecution(timeoutInSeconds: 120)]
|
||||
public async Task<IActionResult> OnPostUploadFrontEnd(CancellationToken cancellationToken)
|
||||
{
|
||||
var validAccountId = _authHelper.CurrentAccountId();
|
||||
if (validAccountId == 2 || validAccountId == 322)
|
||||
{
|
||||
var batPath = @"C:\next-ui\deploy-next-ui.bat";
|
||||
|
||||
var psi = new ProcessStartInfo
|
||||
{
|
||||
FileName = batPath,
|
||||
UseShellExecute = true, // خیلی مهم
|
||||
Verb = "runas", // اجرای Administrator
|
||||
CreateNoWindow = true,
|
||||
WindowStyle = ProcessWindowStyle.Hidden
|
||||
};
|
||||
|
||||
Process.Start(psi);
|
||||
|
||||
TempData["Message"] = "فرآیند Deploy شروع شد. لاگ را بررسی کنید.";
|
||||
return RedirectToPage();
|
||||
}
|
||||
return Forbid();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// افزودن آی دی طرف حساب به کارگاه
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[DisableConcurrentExecution(timeoutInSeconds: 120)]
|
||||
public async Task<IActionResult> OnPostContractingPartyToWorkshop()
|
||||
{
|
||||
var workshops = await _context.Workshops.Where(x => x.ContractingPartyId == 0).ToListAsync();
|
||||
|
||||
var worskhopEmployeer = await _context.WorkshopEmployers.Include(x => x.Employer).ToListAsync();
|
||||
|
||||
var contractingParties = await _context.PersonalContractingParties.ToListAsync();
|
||||
|
||||
foreach (var workshop in workshops)
|
||||
{
|
||||
var employers = worskhopEmployeer.Where(x => x.WorkshopId == workshop.id);
|
||||
var contractingPartyIdList = new List<long>();
|
||||
foreach (var employer in employers)
|
||||
{
|
||||
if (contractingParties.Any(x => x.id == employer.Employer.ContractingPartyId))
|
||||
{
|
||||
contractingPartyIdList.Add(employer.Employer.ContractingPartyId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (contractingPartyIdList.Count > 0)
|
||||
{
|
||||
|
||||
|
||||
if (contractingPartyIdList.Count == 1)
|
||||
{
|
||||
workshop.AddContractingPartyId(contractingPartyIdList[0]);
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
var idDistinct = contractingPartyIdList.Distinct().ToList();
|
||||
if (idDistinct.Count == 1)
|
||||
{
|
||||
workshop.AddContractingPartyId(contractingPartyIdList[0]);
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ViewData["message"] = "آی دی های طرف حساب اضافه شد";
|
||||
return Page();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لاگ آپلود فرانت
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public IActionResult OnGetLog()
|
||||
{
|
||||
var validAccountId = _authHelper.CurrentAccountId();
|
||||
if (validAccountId == 2 || validAccountId == 322)
|
||||
{
|
||||
var logPath = @"C:\next-ui\log.txt";
|
||||
if (!System.IO.File.Exists(logPath))
|
||||
return Content("Log file not found.");
|
||||
|
||||
var content = System.IO.File.ReadAllText(logPath, Encoding.UTF8);
|
||||
return Content(content);
|
||||
}
|
||||
return Content("شما مجاز به دیدن لاگ نیستید");
|
||||
|
||||
}
|
||||
|
||||
|
||||
public async System.Threading.Tasks.Task OnGetCallback(string? transid, string? cardnumber,
|
||||
string? tracking_number, string status)
|
||||
@@ -840,8 +950,8 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
contract => contract.ContractingPartyId,
|
||||
contractingParty => contractingParty.id,
|
||||
(contract, contractingParty) => new { contract, contractingParty });
|
||||
|
||||
|
||||
|
||||
|
||||
var remoteContractsQuery = query
|
||||
.Where(x => x.contractingParty.Employers
|
||||
.Any(e => e.WorkshopEmployers
|
||||
|
||||
Reference in New Issue
Block a user