Compare commits
1 Commits
Feature/ro
...
Feature/In
| Author | SHA1 | Date | |
|---|---|---|---|
| bc192d9552 |
@@ -29,11 +29,9 @@ public class PaymentGatewayResponse
|
||||
public int? ErrorCode { get; set; }
|
||||
|
||||
[JsonPropertyName("transid")]
|
||||
public string Token { get; set; }
|
||||
public string TransactionId { get; set; }
|
||||
|
||||
public bool IsSuccess { get; set; }
|
||||
|
||||
public string Message { get; set; }
|
||||
public bool IsSuccess => Status == "success";
|
||||
}
|
||||
|
||||
public class WalletAmountResponse
|
||||
@@ -55,12 +53,10 @@ public class CreatePaymentGatewayRequest
|
||||
public string Mobile { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string Description { get; set; }
|
||||
public IDictionary<string, object> ExtraData { get; set; }
|
||||
}
|
||||
|
||||
public class VerifyPaymentGateWayRequest
|
||||
{
|
||||
public string DigitalReceipt { get; set; }
|
||||
public string TransactionId { get; set; }
|
||||
public string TransactionId { get; set; }
|
||||
public double Amount { get; set; }
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace _0_Framework.Application.PaymentGateway;
|
||||
|
||||
public class SepehrPaymentGateway:IPaymentGateway
|
||||
{
|
||||
private readonly HttpClient _httpClient;
|
||||
private const long TerminalId = 99213700;
|
||||
|
||||
public SepehrPaymentGateway(IHttpClientFactory httpClient)
|
||||
{
|
||||
_httpClient = httpClient.CreateClient();
|
||||
_httpClient.BaseAddress = new Uri("https://sepehr.shaparak.ir/Rest/V1/PeymentApi/");
|
||||
|
||||
|
||||
}
|
||||
|
||||
public async Task<PaymentGatewayResponse> Create(CreatePaymentGatewayRequest command, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var extraData = JsonConvert.SerializeObject(command.ExtraData);
|
||||
var res = await _httpClient.PostAsJsonAsync("GetToken", new
|
||||
{
|
||||
TerminalID = TerminalId,
|
||||
Amount = command.Amount,
|
||||
InvoiceID = command.InvoiceId,
|
||||
callbackURL = command.CallBackUrl,
|
||||
payload = extraData
|
||||
}, cancellationToken: cancellationToken);
|
||||
// خواندن محتوای پاسخ
|
||||
var content = await res.Content.ReadAsStringAsync(cancellationToken);
|
||||
|
||||
// تبدیل پاسخ JSON به آبجکت داتنت
|
||||
var json = System.Text.Json.JsonDocument.Parse(content);
|
||||
|
||||
// گرفتن مقدار AccessToken
|
||||
var accessToken = json.RootElement.GetProperty("Accesstoken").ToString();
|
||||
var status = json.RootElement.GetProperty("Status").ToString();
|
||||
|
||||
return new PaymentGatewayResponse
|
||||
{
|
||||
Status = status,
|
||||
IsSuccess = status == "0",
|
||||
Token = accessToken
|
||||
};
|
||||
}
|
||||
|
||||
public string GetStartPayUrl(string token)=>
|
||||
$"https://sepehr.shaparak.ir/Payment/Pay?token={token}&terminalId={TerminalId}";
|
||||
|
||||
public async Task<PaymentGatewayResponse> Verify(VerifyPaymentGateWayRequest command, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var res = await _httpClient.PostAsJsonAsync("Advice", new
|
||||
{
|
||||
digitalreceipt = command.DigitalReceipt,
|
||||
Tid = TerminalId,
|
||||
}, cancellationToken: cancellationToken);
|
||||
|
||||
// خواندن محتوای پاسخ
|
||||
var content = await res.Content.ReadAsStringAsync(cancellationToken);
|
||||
|
||||
// تبدیل پاسخ JSON به آبجکت داتنت
|
||||
var json = System.Text.Json.JsonDocument.Parse(content);
|
||||
|
||||
|
||||
var message = json.RootElement.GetProperty("Message").GetString();
|
||||
var status = json.RootElement.GetProperty("Status").GetString();
|
||||
return new PaymentGatewayResponse
|
||||
{
|
||||
Status = status,
|
||||
IsSuccess = status.ToLower() == "ok",
|
||||
Message = message
|
||||
};
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public Task<PaymentGatewayResponse> CreateSandBox(CreatePaymentGatewayRequest command, CancellationToken cancellationToken = default)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public string GetStartPaySandBoxUrl(string transactionId)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<WalletAmountResponse> GetWalletAmount(CancellationToken cancellationToken)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ public interface ISmsService
|
||||
|
||||
Task<double> GetCreditAmount();
|
||||
|
||||
public Task<bool> SendInstitutionCreationVerificationLink(string number, string fullName, Guid institutionId, long contractingPartyId, long institutionContractId);
|
||||
public Task<bool> SendInstitutionVerificationLink(string number, string fullName, Guid institutionId, long contractingPartyId, long institutionContractId);
|
||||
|
||||
public Task<bool> SendInstitutionVerificationCode(string number, string code, string contractingPartyFullName,
|
||||
long contractingPartyId, long institutionContractId);
|
||||
|
||||
@@ -66,11 +66,4 @@ public interface IAccountApplication
|
||||
public bool CheckExistClientAccount(string userName);
|
||||
List<AccountViewModel> GetAdminAccountsNew();
|
||||
|
||||
void CameraLogin(CameraLoginRequest request);
|
||||
}
|
||||
|
||||
public class CameraLoginRequest
|
||||
{
|
||||
public string UserName { get; set; }
|
||||
public string Password { get; set; }
|
||||
}
|
||||
@@ -18,7 +18,6 @@ using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
|
||||
using Company.Domain.WorkshopAgg;
|
||||
using System.Security.Claims;
|
||||
using _0_Framework.Exceptions;
|
||||
using AccountManagement.Domain.PositionAgg;
|
||||
using AccountManagement.Domain.SubAccountAgg;
|
||||
using AccountManagement.Domain.SubAccountPermissionSubtitle1Agg;
|
||||
@@ -804,29 +803,4 @@ public class AccountApplication : IAccountApplication
|
||||
{
|
||||
return _accountRepository.GetAdminAccountsNew();
|
||||
}
|
||||
|
||||
public void CameraLogin(CameraLoginRequest request)
|
||||
{
|
||||
var cameraAccount = _cameraAccountRepository.GetBy(request.UserName);
|
||||
|
||||
if (cameraAccount == null)
|
||||
{
|
||||
throw new BadRequestException(ApplicationMessages.WrongUserPass);
|
||||
}
|
||||
|
||||
(bool Verified, bool NeedUpgrade) result = _passwordHasher.Check(cameraAccount.Password, request.Password);
|
||||
|
||||
if (!result.Verified)
|
||||
throw new BadRequestException(ApplicationMessages.WrongUserPass);
|
||||
|
||||
var mobile = string.IsNullOrWhiteSpace(cameraAccount.Mobile) ? " " : cameraAccount.Mobile;
|
||||
|
||||
var authViewModel = new CameraAuthViewModel(cameraAccount.id, cameraAccount.WorkshopId,
|
||||
cameraAccount.Username, mobile, cameraAccount.WorkshopName, cameraAccount.AccountId,
|
||||
cameraAccount.IsActiveSting);
|
||||
if (cameraAccount.IsActiveSting != "true")
|
||||
throw new BadRequestException(ApplicationMessages.WrongUserPass);
|
||||
|
||||
_authHelper.CameraSignIn(authViewModel);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.AndroidApkVersion;
|
||||
|
||||
namespace Company.Domain.AndroidApkVersionAgg;
|
||||
|
||||
@@ -9,17 +8,14 @@ public class AndroidApkVersion:EntityBase
|
||||
{
|
||||
private AndroidApkVersion () { }
|
||||
|
||||
public AndroidApkVersion( string versionName,string versionCode, IsActive isActive, string path, ApkType apkType, bool isForce = false)
|
||||
public AndroidApkVersion( string versionName,string versionCode, IsActive isActive, string path)
|
||||
{
|
||||
|
||||
VersionName = versionName;
|
||||
VersionCode = versionCode;
|
||||
IsActive = isActive;
|
||||
Path = path;
|
||||
ApkType = apkType;
|
||||
IsForce = isForce;
|
||||
var appName = apkType == ApkType.WebView ? "Gozareshgir-WebView" : "Gozareshgir-FaceDetection";
|
||||
Title = $"{appName}-{versionName}-{CreationDate:g}";
|
||||
Title = $"Gozareshgir-{versionName}-{CreationDate:g}";
|
||||
}
|
||||
|
||||
public string Title { get; private set; }
|
||||
@@ -27,9 +23,6 @@ public class AndroidApkVersion:EntityBase
|
||||
public string VersionCode{ get; private set; }
|
||||
public IsActive IsActive { get; private set; }
|
||||
public string Path { get; set; }
|
||||
public ApkType ApkType { get; private set; }
|
||||
public bool IsForce { get; private set; }
|
||||
|
||||
|
||||
public void Active()
|
||||
{
|
||||
@@ -40,4 +33,4 @@ public class AndroidApkVersion:EntityBase
|
||||
{
|
||||
IsActive = IsActive.False;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using _0_Framework_b.Domain;
|
||||
using CompanyManagment.App.Contracts.AndroidApkVersion;
|
||||
|
||||
namespace Company.Domain.AndroidApkVersionAgg;
|
||||
|
||||
public interface IAndroidApkVersionRepository:IRepository<long,AndroidApkVersion>
|
||||
{
|
||||
IQueryable<AndroidApkVersion> GetActives(ApkType apkType);
|
||||
AndroidApkVersion GetLatestActive(ApkType apkType);
|
||||
IQueryable<AndroidApkVersion> GetActives();
|
||||
void Remove(AndroidApkVersion entity);
|
||||
System.Threading.Tasks.Task<string> GetLatestActiveVersionPath(ApkType apkType);
|
||||
System.Threading.Tasks.Task<string> GetLatestActiveVersionPath();
|
||||
}
|
||||
@@ -1,189 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace Company.Domain.EmployeeFaceEmbeddingAgg;
|
||||
|
||||
public class EmployeeFaceEmbedding
|
||||
{
|
||||
public EmployeeFaceEmbedding()
|
||||
{
|
||||
EmbeddingHistory = new List<EmbeddingHistoryItem>();
|
||||
MetadataHistory = new List<MetadataHistoryItem>();
|
||||
}
|
||||
|
||||
public EmployeeFaceEmbedding(string employeeFullName, long employeeId, long workshopId,
|
||||
List<double> embeddings, EmployeeFaceEmbeddingMetadata metadata)
|
||||
{
|
||||
Id = Guid.NewGuid().ToString();
|
||||
EmployeeFullName = employeeFullName;
|
||||
EmployeeId = employeeId;
|
||||
WorkshopId = workshopId;
|
||||
Embeddings = embeddings;
|
||||
Metadata = metadata;
|
||||
EmbeddingHistory = new List<EmbeddingHistoryItem>();
|
||||
MetadataHistory = new List<MetadataHistoryItem>();
|
||||
CreatedAt = DateTime.UtcNow;
|
||||
UpdatedAt = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
[BsonId]
|
||||
[BsonRepresentation(BsonType.String)]
|
||||
public string Id { get; set; }
|
||||
|
||||
[BsonElement("employeeFullName")]
|
||||
public string EmployeeFullName { get; set; }
|
||||
|
||||
[BsonElement("employeeId")]
|
||||
public long EmployeeId { get; set; }
|
||||
|
||||
[BsonElement("workshopId")]
|
||||
public long WorkshopId { get; set; }
|
||||
|
||||
[BsonElement("embeddings")]
|
||||
public List<double> Embeddings { get; set; }
|
||||
|
||||
[BsonElement("metadata")]
|
||||
public EmployeeFaceEmbeddingMetadata Metadata { get; set; }
|
||||
|
||||
[BsonElement("embeddingHistory")]
|
||||
public List<EmbeddingHistoryItem> EmbeddingHistory { get; set; }
|
||||
|
||||
[BsonElement("metadataHistory")]
|
||||
public List<MetadataHistoryItem> MetadataHistory { get; set; }
|
||||
|
||||
[BsonElement("createdAt")]
|
||||
public DateTime CreatedAt { get; set; }
|
||||
|
||||
[BsonElement("updatedAt")]
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
|
||||
public void UpdateEmbedding(List<double> newEmbedding, double confidence, double refinementPercentage)
|
||||
{
|
||||
if (Embeddings != null)
|
||||
{
|
||||
EmbeddingHistory.Add(new EmbeddingHistoryItem
|
||||
{
|
||||
Embedding = new List<double>(Embeddings),
|
||||
Timestamp = DateTime.UtcNow,
|
||||
Confidence = confidence,
|
||||
RefinementPercentage = refinementPercentage
|
||||
});
|
||||
}
|
||||
|
||||
Embeddings = newEmbedding;
|
||||
UpdatedAt = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public void UpdateMetadata(EmployeeFaceEmbeddingMetadata newMetadata, double confidence, double refinementPercentage)
|
||||
{
|
||||
if (Metadata != null)
|
||||
{
|
||||
MetadataHistory.Add(new MetadataHistoryItem
|
||||
{
|
||||
Metadata = Metadata,
|
||||
Timestamp = DateTime.UtcNow,
|
||||
Confidence = confidence,
|
||||
RefinementPercentage = refinementPercentage
|
||||
});
|
||||
}
|
||||
|
||||
Metadata = newMetadata;
|
||||
UpdatedAt = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public void UpdateEmployeeInfo(string employeeFullName, long workshopId)
|
||||
{
|
||||
EmployeeFullName = employeeFullName;
|
||||
WorkshopId = workshopId;
|
||||
UpdatedAt = DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
|
||||
public class EmployeeFaceEmbeddingMetadata
|
||||
{
|
||||
[BsonElement("avg_eye_distance_normalized")]
|
||||
public double AvgEyeDistanceNormalized { get; set; }
|
||||
|
||||
[BsonElement("avg_eye_to_face_ratio")]
|
||||
public double AvgEyeToFaceRatio { get; set; }
|
||||
|
||||
[BsonElement("avg_face_aspect_ratio")]
|
||||
public double AvgFaceAspectRatio { get; set; }
|
||||
|
||||
[BsonElement("avg_detection_confidence")]
|
||||
public double AvgDetectionConfidence { get; set; }
|
||||
|
||||
[BsonElement("avg_keypoints_normalized")]
|
||||
public EmployeeFaceEmbeddingKeypoints AvgKeypointsNormalized { get; set; }
|
||||
|
||||
[BsonElement("per_image_metadata")]
|
||||
public List<ImageMetadata> PerImageMetadata { get; set; }
|
||||
}
|
||||
|
||||
public class EmployeeFaceEmbeddingKeypoints
|
||||
{
|
||||
[BsonElement("left_eye")]
|
||||
public double[] LeftEye { get; set; }
|
||||
|
||||
[BsonElement("right_eye")]
|
||||
public double[] RightEye { get; set; }
|
||||
|
||||
[BsonElement("nose")]
|
||||
public double[] Nose { get; set; }
|
||||
|
||||
[BsonElement("mouth_left")]
|
||||
public double[] MouthLeft { get; set; }
|
||||
|
||||
[BsonElement("mouth_right")]
|
||||
public double[] MouthRight { get; set; }
|
||||
}
|
||||
|
||||
public class ImageMetadata
|
||||
{
|
||||
[BsonElement("face_aspect_ratio")]
|
||||
public double FaceAspectRatio { get; set; }
|
||||
|
||||
[BsonElement("eye_distance_normalized")]
|
||||
public double EyeDistanceNormalized { get; set; }
|
||||
|
||||
[BsonElement("eye_to_face_ratio")]
|
||||
public double EyeToFaceRatio { get; set; }
|
||||
|
||||
[BsonElement("detection_confidence")]
|
||||
public double DetectionConfidence { get; set; }
|
||||
|
||||
[BsonElement("keypoints_normalized")]
|
||||
public EmployeeFaceEmbeddingKeypoints KeypointsNormalized { get; set; }
|
||||
}
|
||||
|
||||
public class EmbeddingHistoryItem
|
||||
{
|
||||
[BsonElement("embedding")]
|
||||
public List<double> Embedding { get; set; }
|
||||
|
||||
[BsonElement("timestamp")]
|
||||
public DateTime Timestamp { get; set; }
|
||||
|
||||
[BsonElement("confidence")]
|
||||
public double Confidence { get; set; }
|
||||
|
||||
[BsonElement("refinementPercentage")]
|
||||
public double RefinementPercentage { get; set; }
|
||||
}
|
||||
|
||||
public class MetadataHistoryItem
|
||||
{
|
||||
[BsonElement("metadata")]
|
||||
public EmployeeFaceEmbeddingMetadata Metadata { get; set; }
|
||||
|
||||
[BsonElement("timestamp")]
|
||||
public DateTime Timestamp { get; set; }
|
||||
|
||||
[BsonElement("confidence")]
|
||||
public double Confidence { get; set; }
|
||||
|
||||
[BsonElement("refinementPercentage")]
|
||||
public double RefinementPercentage { get; set; }
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Company.Domain.EmployeeFaceEmbeddingAgg;
|
||||
|
||||
public interface IEmployeeFaceEmbeddingRepository
|
||||
{
|
||||
Task CreateAsync(EmployeeFaceEmbedding employeeFaceEmbedding);
|
||||
Task UpdateAsync(EmployeeFaceEmbedding employeeFaceEmbedding);
|
||||
Task<EmployeeFaceEmbedding> GetByIdAsync(string id);
|
||||
Task<EmployeeFaceEmbedding> GetByEmployeeIdAsync(long employeeId);
|
||||
Task<List<EmployeeFaceEmbedding>> GetByWorkshopIdAsync(long workshopId);
|
||||
Task<List<EmployeeFaceEmbedding>> GetByWorkshopIdsAsync(List<long> workshopIds);
|
||||
Task DeleteAsync(string id);
|
||||
}
|
||||
@@ -18,15 +18,13 @@ public class PaymentTransaction:EntityBase
|
||||
/// <param name="callBackUrl"></param>
|
||||
public PaymentTransaction(long contractingPartyId,
|
||||
double amount,
|
||||
string contractingPartyName,string callBackUrl,
|
||||
PaymentTransactionGateWay gateway)
|
||||
string contractingPartyName,string callBackUrl)
|
||||
{
|
||||
ContractingPartyId = contractingPartyId;
|
||||
Status = PaymentTransactionStatus.Pending;
|
||||
Amount = amount;
|
||||
ContractingPartyName = contractingPartyName;
|
||||
CallBackUrl = callBackUrl;
|
||||
Gateway = gateway;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -70,20 +68,13 @@ public class PaymentTransaction:EntityBase
|
||||
public string TransactionId { get; private set; }
|
||||
|
||||
public string CallBackUrl { get; private set; }
|
||||
public PaymentTransactionGateWay Gateway { get; private set; }
|
||||
public string Rrn { get; private set; }
|
||||
public string DigitalReceipt { get; private set; }
|
||||
|
||||
|
||||
public void SetPaid(string cardNumber,string bankName,string rrn,string digitalReceipt)
|
||||
public void SetPaid(string cardNumber,string bankName)
|
||||
{
|
||||
Status = PaymentTransactionStatus.Success;
|
||||
TransactionDate = DateTime.Now;
|
||||
CardNumber = cardNumber;
|
||||
BankName = bankName;
|
||||
Rrn = rrn;
|
||||
DigitalReceipt = digitalReceipt;
|
||||
|
||||
}
|
||||
public void SetFailed()
|
||||
{
|
||||
@@ -94,5 +85,4 @@ public class PaymentTransaction:EntityBase
|
||||
{
|
||||
TransactionId = transactionId;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,23 +11,21 @@ namespace Company.Domain.ReportAgg
|
||||
{
|
||||
Task<AllReport> GetAllActiveWorkshopsNew(string year, string month);
|
||||
AllReport GetAllActiveWorkshops(string year, string month);
|
||||
Task<WorkshopResult> GetWorkshopContractDone(string year, string month, long accountId, List<long> workshopList);
|
||||
Task<WorkshopResult> GetWorkshopContractSignDone(string year, string month, long accountId,
|
||||
WorkshopResult GetWorkshopContractDone(string year, string month, long accountId, List<long> workshopList);
|
||||
WorkshopResult GetWorkshopContractSignDone(string year, string month, long accountId, List<long> workshopList);
|
||||
WorkshopResult GetWorkshopCheckoutDone(string year, string month, long accountId, List<long> workshopList);
|
||||
WorkshopResult GetWorkshopCheckoutSignDone(string year, string month, long accountId, List<long> workshopList);
|
||||
List<EmployeeNotDone> GetEmployeeContract(string year, string month, long workshopId);
|
||||
List<EmployeeNotDone> GetEmployeeContractSign(string year, string month, long workshopId);
|
||||
List<EmployeeNotDone> GetEmployeeCheckout(string year, string month, long workshopId);
|
||||
List<EmployeeNotDone> GetEmployeeCheckoutSign(string year, string month, long workshopId);
|
||||
PrintAllContractCheckout GetPrintAllContractDone(string year, string month, long accountId,
|
||||
List<long> workshopList);
|
||||
Task<WorkshopResult> GetWorkshopCheckoutDone(string year, string month, long accountId, List<long> workshopList);
|
||||
Task<WorkshopResult> GetWorkshopCheckoutSignDone(string year, string month, long accountId,
|
||||
PrintAllContractCheckout GetPrintAllContractSignDone(string year, string month, long accountId,
|
||||
List<long> workshopList);
|
||||
Task<List<EmployeeNotDone>> GetEmployeeContract(string year, string month, long workshopId);
|
||||
Task<List<EmployeeNotDone>> GetEmployeeContractSign(string year, string month, long workshopId);
|
||||
Task<List<EmployeeNotDone>> GetEmployeeCheckout(string year, string month, long workshopId);
|
||||
Task<List<EmployeeNotDone>> GetEmployeeCheckoutSign(string year, string month, long workshopId);
|
||||
Task<PrintAllContractCheckout> GetPrintAllContractDone(string year, string month, long accountId,
|
||||
PrintAllContractCheckout GetPrintAllCheckoutDone(string year, string month, long accountId,
|
||||
List<long> workshopList);
|
||||
Task<PrintAllContractCheckout> GetPrintAllContractSignDone(string year, string month, long accountId,
|
||||
List<long> workshopList);
|
||||
Task<PrintAllContractCheckout> GetPrintAllCheckoutDone(string year, string month, long accountId,
|
||||
List<long> workshopList);
|
||||
Task<PrintAllContractCheckout> GetPrintAllCheckoutSignDone(string year, string month, long accountId,
|
||||
PrintAllContractCheckout GetPrintAllCheckoutSignDone(string year, string month, long accountId,
|
||||
List<long> workshopList);
|
||||
|
||||
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
using Company.Domain.EmployeeFaceEmbeddingAgg;
|
||||
using MongoDB.Driver;
|
||||
|
||||
namespace CompanyManagement.Infrastructure.Mongo.EmployeeFaceEmbeddingRepo;
|
||||
|
||||
public class EmployeeFaceEmbeddingRepository : IEmployeeFaceEmbeddingRepository
|
||||
{
|
||||
private readonly IMongoCollection<EmployeeFaceEmbedding> _employeeFaceEmbeddings;
|
||||
|
||||
public EmployeeFaceEmbeddingRepository(IMongoDatabase database)
|
||||
{
|
||||
_employeeFaceEmbeddings = database.GetCollection<EmployeeFaceEmbedding>("EmployeeFaces");
|
||||
}
|
||||
|
||||
public async Task CreateAsync(EmployeeFaceEmbedding employeeFaceEmbedding)
|
||||
{
|
||||
await _employeeFaceEmbeddings.InsertOneAsync(employeeFaceEmbedding);
|
||||
}
|
||||
|
||||
public async Task UpdateAsync(EmployeeFaceEmbedding employeeFaceEmbedding)
|
||||
{
|
||||
await _employeeFaceEmbeddings.ReplaceOneAsync(
|
||||
x => x.Id == employeeFaceEmbedding.Id,
|
||||
employeeFaceEmbedding);
|
||||
}
|
||||
|
||||
public async Task<EmployeeFaceEmbedding> GetByIdAsync(string id)
|
||||
{
|
||||
return await _employeeFaceEmbeddings
|
||||
.Find(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
public async Task<EmployeeFaceEmbedding> GetByEmployeeIdAsync(long employeeId)
|
||||
{
|
||||
return await _employeeFaceEmbeddings
|
||||
.Find(x => x.EmployeeId == employeeId)
|
||||
.FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
public async Task<List<EmployeeFaceEmbedding>> GetByWorkshopIdAsync(long workshopId)
|
||||
{
|
||||
return await _employeeFaceEmbeddings
|
||||
.Find(x => x.WorkshopId == workshopId)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<List<EmployeeFaceEmbedding>> GetByWorkshopIdsAsync(List<long> workshopIds)
|
||||
{
|
||||
return await _employeeFaceEmbeddings
|
||||
.Find(x => workshopIds.First()==x.WorkshopId)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task DeleteAsync(string id)
|
||||
{
|
||||
await _employeeFaceEmbeddings.DeleteOneAsync(x => x.Id == id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace CompanyManagment.App.Contracts.AndroidApkVersion;
|
||||
|
||||
public enum ApkType
|
||||
{
|
||||
WebView,
|
||||
FaceDetection
|
||||
}
|
||||
|
||||
@@ -4,15 +4,12 @@ using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.AndroidApkVersion;
|
||||
|
||||
public record AndroidApkVersionInfo(int LatestVersionCode, string LatestVersionName, bool ShouldUpdate, bool IsForceUpdate, string DownloadUrl, string ReleaseNotes);
|
||||
|
||||
public interface IAndroidApkVersionApplication
|
||||
{
|
||||
Task<OperationResult> CreateAndActive(IFormFile file, ApkType apkType, bool isForce = false);
|
||||
Task<OperationResult> CreateAndDeActive(IFormFile file, ApkType apkType, bool isForce = false);
|
||||
Task<string> GetLatestActiveVersionPath(ApkType apkType);
|
||||
Task<AndroidApkVersionInfo> GetLatestActiveInfo(ApkType apkType, int currentVersionCode);
|
||||
Task<OperationResult> CreateAndActive(IFormFile file);
|
||||
Task<OperationResult> CreateAndDeActive(IFormFile file);
|
||||
Task<string> GetLatestActiveVersionPath();
|
||||
OperationResult Remove(long id);
|
||||
|
||||
bool HasAndroidApkToDownload(ApkType apkType);
|
||||
bool HasAndroidApkToDownload();
|
||||
}
|
||||
@@ -25,5 +25,4 @@ public class CustomizeWorkshopEmployeeSettingsViewModel
|
||||
public int LeavePermittedDays { get; set; }
|
||||
public ICollection<CustomizeRotatingShiftsViewModel> CustomizeRotatingShiftsViewModels { get; set; }
|
||||
public List<DayOfWeek> WeeklyOffDays { get; set; }
|
||||
public bool HasLeft { get; set; }
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.EmployeeFaceEmbedding;
|
||||
|
||||
public class EmployeeFaceEmbeddingDto
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string EmployeeFullName { get; set; }
|
||||
public long EmployeeId { get; set; }
|
||||
public long WorkshopId { get; set; }
|
||||
public List<double> Embeddings { get; set; }
|
||||
public EmployeeFaceEmbeddingMetadataDto Metadata { get; set; }
|
||||
}
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.EmployeeFaceEmbedding;
|
||||
|
||||
public class EmployeeFaceEmbeddingMetadataDto
|
||||
{
|
||||
public double AvgEyeDistanceNormalized { get; set; }
|
||||
public double AvgEyeToFaceRatio { get; set; }
|
||||
public double AvgFaceAspectRatio { get; set; }
|
||||
public double AvgDetectionConfidence { get; set; }
|
||||
public EmployeeFaceEmbeddingKeypointsDto AvgKeypointsNormalized { get; set; }
|
||||
public List<ImageMetadataDto> PerImageMetadata { get; set; }
|
||||
}
|
||||
|
||||
public class EmployeeFaceEmbeddingKeypointsDto
|
||||
{
|
||||
public double[] LeftEye { get; set; }
|
||||
public double[] RightEye { get; set; }
|
||||
public double[] Nose { get; set; }
|
||||
public double[] MouthLeft { get; set; }
|
||||
public double[] MouthRight { get; set; }
|
||||
}
|
||||
|
||||
public class ImageMetadataDto
|
||||
{
|
||||
public double FaceAspectRatio { get; set; }
|
||||
public double EyeDistanceNormalized { get; set; }
|
||||
public double EyeToFaceRatio { get; set; }
|
||||
public double DetectionConfidence { get; set; }
|
||||
public EmployeeFaceEmbeddingKeypointsDto KeypointsNormalized { get; set; }
|
||||
}
|
||||
|
||||
public class EmbeddingHistoryItemDto
|
||||
{
|
||||
public List<double> Embedding { get; set; }
|
||||
public DateTime Timestamp { get; set; }
|
||||
public double Confidence { get; set; }
|
||||
public double RefinementPercentage { get; set; }
|
||||
}
|
||||
|
||||
public class MetadataHistoryItemDto
|
||||
{
|
||||
public EmployeeFaceEmbeddingMetadataDto Metadata { get; set; }
|
||||
public DateTime Timestamp { get; set; }
|
||||
public double Confidence { get; set; }
|
||||
public double RefinementPercentage { get; set; }
|
||||
}
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.EmployeeFaceEmbedding;
|
||||
|
||||
/// <summary>
|
||||
/// سرویس مدیریت Embedding چهره کارکنان
|
||||
/// این سرویس فقط برای دریافت و ارسال داده است و هیچ command-driven نیست
|
||||
/// </summary>
|
||||
public interface IEmployeeFaceEmbeddingApplication
|
||||
{
|
||||
/// <summary>
|
||||
/// دریافت embedding بر اساس شناسه
|
||||
/// </summary>
|
||||
Task<EmployeeFaceEmbeddingDto> GetByIdAsync(string id);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت embedding بر اساس شناسه کارمند
|
||||
/// </summary>
|
||||
Task<EmployeeFaceEmbeddingDto> GetByEmployeeIdAsync(long employeeId);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست embeddings بر اساس شناسه کارگاه
|
||||
/// </summary>
|
||||
Task<List<EmployeeFaceEmbeddingDto>> GetByWorkshopIdAsync(long workshopId);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست embeddings بر اساس لیست شناسه کارگاهها
|
||||
/// </summary>
|
||||
Task<List<EmployeeFaceEmbeddingDto>> GetByWorkshopIdsAsync(List<long> workshopIds);
|
||||
|
||||
/// <summary>
|
||||
/// ذخیره یا بهروزرسانی embedding
|
||||
/// اگر Id وجود داشته باشد، بهروزرسانی میشود، در غیر این صورت ایجاد میشود
|
||||
/// </summary>
|
||||
Task<string> SaveAsync(EmployeeFaceEmbeddingDto dto);
|
||||
|
||||
/// <summary>
|
||||
/// حذف embedding
|
||||
/// </summary>
|
||||
Task DeleteAsync(string id);
|
||||
}
|
||||
|
||||
@@ -88,9 +88,20 @@ public class GetInstitutionContractListItemsViewModel
|
||||
|
||||
public List<InstitutionContractListWorkshop> Workshops { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// قرارداد ها با خدمات حضوری قرارداد
|
||||
/// </summary>
|
||||
public bool IsInPersonContract { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// قرارداد های قدیمی
|
||||
/// </summary>
|
||||
public bool IsOldContract { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// قرارداد هایی که برای آینده تنظیم شده اند
|
||||
/// </summary>
|
||||
public bool IsFutureContract { get; set; }
|
||||
}
|
||||
|
||||
public class InstitutionContractListWorkshop
|
||||
|
||||
@@ -17,14 +17,4 @@ public class CreatePaymentTransaction
|
||||
/// مسیر برگشت پس از پرداخت
|
||||
/// </summary>
|
||||
public string CallBackUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع درگاه
|
||||
/// </summary>
|
||||
public PaymentTransactionGateWay Gateway { get; set; }
|
||||
}
|
||||
public enum PaymentTransactionGateWay
|
||||
{
|
||||
AqayePardakht = 1,
|
||||
SepehrPay = 2
|
||||
}
|
||||
@@ -49,7 +49,7 @@ public interface IPaymentTransactionApplication
|
||||
/// <param name="cardNumber"></param>
|
||||
/// <param name="bankName"></param>
|
||||
/// <returns></returns>
|
||||
OperationResult SetSuccess(long paymentTransactionId, string cardNumber, string bankName, string rrn, string digitalReceipt);
|
||||
OperationResult SetSuccess(long paymentTransactionId, string cardNumber, string bankName);
|
||||
|
||||
Task<OperationResult> SetTransactionId(long id, string transactionId);
|
||||
}
|
||||
|
||||
@@ -27,8 +27,6 @@ namespace CompanyManagment.App.Contracts.Report
|
||||
public int ContractSignNotDone { get; set; }
|
||||
public int ContractSignDone { get; set; }
|
||||
|
||||
public int ContractSignToBe { get; set; }
|
||||
|
||||
//تصفیه
|
||||
public int AllCheckout { get; set; }
|
||||
public int CheckoutNotDone { get; set; }
|
||||
@@ -36,8 +34,6 @@ namespace CompanyManagment.App.Contracts.Report
|
||||
public int CheckoutSignNotDone { get; set; }
|
||||
public int CheckoutSignDone { get; set; }
|
||||
|
||||
public int CheckoutSignToBe { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -10,23 +10,21 @@ namespace CompanyManagment.App.Contracts.Report
|
||||
{
|
||||
Task<AllReport> GetAllActiveWorkshops(string year, string month);
|
||||
Task<AllReport> GetAllReports(string year, string month);
|
||||
Task<WorkshopResult> GetWorkshopContractDone(string year, string month, long accountId, List<long> workshopList);
|
||||
Task<WorkshopResult> GetWorkshopContractSignDone(string year, string month, long accountId,
|
||||
WorkshopResult GetWorkshopContractDone(string year, string month, long accountId, List<long> workshopList);
|
||||
WorkshopResult GetWorkshopContractSignDone(string year, string month, long accountId, List<long> workshopList);
|
||||
WorkshopResult GetWorkshopCheckoutDone(string year, string month, long accountId, List<long> workshopList);
|
||||
WorkshopResult GetWorkshopCheckoutSignDone(string year, string month, long accountId, List<long> workshopList);
|
||||
List<EmployeeNotDone> GetEmployeeContract(string year, string month, long workshopId);
|
||||
List<EmployeeNotDone> GetEmployeeContractSign(string year, string month, long workshopId);
|
||||
List<EmployeeNotDone> GetEmployeeCheckout(string year, string month, long workshopId);
|
||||
List<EmployeeNotDone> GetEmployeeCheckoutSign(string year, string month, long workshopId);
|
||||
PrintAllContractCheckout GetPrintAllContractDone(string year, string month, long accountId,
|
||||
List<long> workshopList);
|
||||
Task<WorkshopResult> GetWorkshopCheckoutDone(string year, string month, long accountId, List<long> workshopList);
|
||||
Task<WorkshopResult> GetWorkshopCheckoutSignDone(string year, string month, long accountId,
|
||||
PrintAllContractCheckout GetPrintAllContractSignDone(string year, string month, long accountId,
|
||||
List<long> workshopList);
|
||||
Task<List<EmployeeNotDone>> GetEmployeeContract(string year, string month, long workshopId);
|
||||
Task<List<EmployeeNotDone>> GetEmployeeContractSign(string year, string month, long workshopId);
|
||||
Task<List<EmployeeNotDone>> GetEmployeeCheckout(string year, string month, long workshopId);
|
||||
Task<List<EmployeeNotDone>> GetEmployeeCheckoutSign(string year, string month, long workshopId);
|
||||
Task<PrintAllContractCheckout> GetPrintAllContractDone(string year, string month, long accountId,
|
||||
PrintAllContractCheckout GetPrintAllCheckoutDone(string year, string month, long accountId,
|
||||
List<long> workshopList);
|
||||
Task<PrintAllContractCheckout> GetPrintAllContractSignDone(string year, string month, long accountId,
|
||||
List<long> workshopList);
|
||||
Task<PrintAllContractCheckout> GetPrintAllCheckoutDone(string year, string month, long accountId,
|
||||
List<long> workshopList);
|
||||
Task<PrintAllContractCheckout> GetPrintAllCheckoutSignDone(string year, string month, long accountId,
|
||||
PrintAllContractCheckout GetPrintAllCheckoutSignDone(string year, string month, long accountId,
|
||||
List<long> workshopList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using AccountManagement.Domain.TaskAgg;
|
||||
using ApkReader;
|
||||
using Company.Domain.AndroidApkVersionAgg;
|
||||
using CompanyManagment.App.Contracts.AndroidApkVersion;
|
||||
using CompanyManagment.Application.Helpers;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
|
||||
@@ -22,7 +24,7 @@ public class AndroidApkVersionApplication : IAndroidApkVersionApplication
|
||||
_taskRepository = taskRepository;
|
||||
}
|
||||
|
||||
public async Task<OperationResult> CreateAndActive(IFormFile file, ApkType apkType, bool isForce = false)
|
||||
public async Task<OperationResult> CreateAndActive(IFormFile file)
|
||||
{
|
||||
OperationResult op = new OperationResult();
|
||||
|
||||
@@ -36,41 +38,21 @@ public class AndroidApkVersionApplication : IAndroidApkVersionApplication
|
||||
|
||||
#endregion
|
||||
|
||||
var activeApks = _androidApkVersionRepository.GetActives(apkType);
|
||||
var activeApks = _androidApkVersionRepository.GetActives();
|
||||
|
||||
await activeApks.ExecuteUpdateAsync(setter => setter.SetProperty(e => e.IsActive, IsActive.False));
|
||||
_androidApkVersionRepository.SaveChanges();
|
||||
|
||||
var folderName = apkType == ApkType.WebView ? "GozreshgirWebView" : "GozreshgirFaceDetection";
|
||||
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
|
||||
"Apk", "Android", folderName);
|
||||
"Apk", "Android", "GozreshgirWebView");
|
||||
|
||||
Directory.CreateDirectory(path);
|
||||
|
||||
// Read APK metadata with error handling
|
||||
ApkInfo apk;
|
||||
try
|
||||
{
|
||||
apk = ApkHelper.ReadApkInfo(file.OpenReadStream());
|
||||
|
||||
// Validate APK info
|
||||
if (string.IsNullOrEmpty(apk.VersionName) || string.IsNullOrEmpty(apk.VersionCode))
|
||||
{
|
||||
return op.Failed("فایل APK معتبر نیست - اطلاعات نسخه یافت نشد");
|
||||
}
|
||||
|
||||
// Validate version code is numeric
|
||||
if (!int.TryParse(apk.VersionCode, out _))
|
||||
{
|
||||
return op.Failed("فایل APK معتبر نیست - کد نسخه باید عددی باشد");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return op.Failed("خطا در خواندن فایل APK: " + ex.Message);
|
||||
}
|
||||
//var apk = new ApkReader.ApkReader().Read(file.OpenReadStream());
|
||||
|
||||
string uniqueFileName = $"{Path.GetFileNameWithoutExtension(file.FileName)}{Path.GetExtension(file.FileName)}";
|
||||
|
||||
|
||||
string uniqueFileName = $"{Path.GetFileNameWithoutExtension(file.FileName)}.v{apk.VersionName}{Path.GetExtension(file.FileName)}";
|
||||
string filepath = Path.Combine(path, uniqueFileName);
|
||||
|
||||
await using (var stream = new FileStream(filepath, FileMode.Create))
|
||||
@@ -78,13 +60,13 @@ public class AndroidApkVersionApplication : IAndroidApkVersionApplication
|
||||
await file.CopyToAsync(stream);
|
||||
}
|
||||
|
||||
var entity = new AndroidApkVersion(apk.VersionName, apk.VersionCode, IsActive.True, filepath, apkType, isForce);
|
||||
var entity = new AndroidApkVersion("0", "0", IsActive.True, filepath);
|
||||
_androidApkVersionRepository.Create(entity);
|
||||
_androidApkVersionRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
public async Task<OperationResult> CreateAndDeActive(IFormFile file, ApkType apkType, bool isForce = false)
|
||||
public async Task<OperationResult> CreateAndDeActive(IFormFile file)
|
||||
{
|
||||
OperationResult op = new OperationResult();
|
||||
|
||||
@@ -99,34 +81,12 @@ public class AndroidApkVersionApplication : IAndroidApkVersionApplication
|
||||
#endregion
|
||||
|
||||
|
||||
var folderName = apkType == ApkType.WebView ? "GozreshgirWebView" : "GozreshgirFaceDetection";
|
||||
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
|
||||
"Apk", "Android", folderName);
|
||||
"Apk", "Android", "GozreshgirWebView");
|
||||
|
||||
Directory.CreateDirectory(path);
|
||||
|
||||
// Read APK metadata with error handling
|
||||
ApkInfo apk;
|
||||
try
|
||||
{
|
||||
apk = ApkHelper.ReadApkInfo(file.OpenReadStream());
|
||||
|
||||
// Validate APK info
|
||||
if (string.IsNullOrEmpty(apk.VersionName) || string.IsNullOrEmpty(apk.VersionCode))
|
||||
{
|
||||
return op.Failed("فایل APK معتبر نیست - اطلاعات نسخه یافت نشد");
|
||||
}
|
||||
|
||||
// Validate version code is numeric
|
||||
if (!int.TryParse(apk.VersionCode, out _))
|
||||
{
|
||||
return op.Failed("فایل APK معتبر نیست - کد نسخه باید عددی باشد");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return op.Failed("خطا در خواندن فایل APK: " + ex.Message);
|
||||
}
|
||||
var apk = new ApkReader.ApkReader().Read(file.OpenReadStream());
|
||||
|
||||
string uniqueFileName = $"{Path.GetFileNameWithoutExtension(file.FileName)}.v{apk.VersionName}{Path.GetExtension(file.FileName)}";
|
||||
|
||||
@@ -138,15 +98,14 @@ public class AndroidApkVersionApplication : IAndroidApkVersionApplication
|
||||
await file.CopyToAsync(stream);
|
||||
}
|
||||
|
||||
var entity = new AndroidApkVersion(apk.VersionName, apk.VersionCode, IsActive.False, filepath, apkType, isForce);
|
||||
_androidApkVersionRepository.Create(entity);
|
||||
var entity = new AndroidApkVersion(apk.VersionName, apk.VersionCode, IsActive.False, filepath);
|
||||
_androidApkVersionRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
public async Task<string> GetLatestActiveVersionPath(ApkType apkType)
|
||||
public async Task<string> GetLatestActiveVersionPath()
|
||||
{
|
||||
return await _androidApkVersionRepository.GetLatestActiveVersionPath(apkType);
|
||||
return await _androidApkVersionRepository.GetLatestActiveVersionPath();
|
||||
}
|
||||
|
||||
public OperationResult Remove(long id)
|
||||
@@ -168,22 +127,8 @@ public class AndroidApkVersionApplication : IAndroidApkVersionApplication
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
public bool HasAndroidApkToDownload(ApkType apkType)
|
||||
public bool HasAndroidApkToDownload()
|
||||
{
|
||||
return _androidApkVersionRepository.Exists(x => x.IsActive == IsActive.True && x.ApkType == apkType);
|
||||
}
|
||||
|
||||
public Task<AndroidApkVersionInfo> GetLatestActiveInfo(ApkType apkType, int currentVersionCode)
|
||||
{
|
||||
var latest = _androidApkVersionRepository.GetLatestActive(apkType);
|
||||
if (latest == null)
|
||||
return Task.FromResult(new AndroidApkVersionInfo(0, "0", false, false, string.Empty, string.Empty));
|
||||
|
||||
// Return API endpoint for downloading APK file
|
||||
var fileUrl = $"/api/android-apk/download?type={apkType}";
|
||||
int latestCode = 0;
|
||||
int.TryParse(latest.VersionCode, out latestCode);
|
||||
var shouldUpdate = latestCode > currentVersionCode;
|
||||
return Task.FromResult(new AndroidApkVersionInfo(latestCode, latest.VersionName, shouldUpdate, latest.IsForce, fileUrl, "Bug fixes and improvements"));
|
||||
return _androidApkVersionRepository.Exists(x => x.IsActive == IsActive.True);
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AndroidXml" Version="1.1.24" />
|
||||
<PackageReference Include="System.IO.Compression.ZipFile" Version="4.3.0" />
|
||||
<PackageReference Include="ApkReader" Version="2.0.1.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,170 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Company.Domain.EmployeeFaceEmbeddingAgg;
|
||||
using CompanyManagment.App.Contracts.EmployeeFaceEmbedding;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
public class EmployeeFaceEmbeddingApplication : IEmployeeFaceEmbeddingApplication
|
||||
{
|
||||
private readonly IEmployeeFaceEmbeddingRepository _repository;
|
||||
|
||||
public EmployeeFaceEmbeddingApplication(IEmployeeFaceEmbeddingRepository repository)
|
||||
{
|
||||
_repository = repository;
|
||||
}
|
||||
|
||||
public async Task<EmployeeFaceEmbeddingDto> GetByIdAsync(string id)
|
||||
{
|
||||
var entity = await _repository.GetByIdAsync(id);
|
||||
return entity == null ? null : MapToDto(entity);
|
||||
}
|
||||
|
||||
public async Task<EmployeeFaceEmbeddingDto> GetByEmployeeIdAsync(long employeeId)
|
||||
{
|
||||
var entity = await _repository.GetByEmployeeIdAsync(employeeId);
|
||||
return entity == null ? null : MapToDto(entity);
|
||||
}
|
||||
|
||||
public async Task<List<EmployeeFaceEmbeddingDto>> GetByWorkshopIdAsync(long workshopId)
|
||||
{
|
||||
var entities = await _repository.GetByWorkshopIdAsync(workshopId);
|
||||
return entities.Select(MapToDto).ToList();
|
||||
}
|
||||
|
||||
public async Task<List<EmployeeFaceEmbeddingDto>> GetByWorkshopIdsAsync(List<long> workshopIds)
|
||||
{
|
||||
var entities = await _repository.GetByWorkshopIdsAsync(workshopIds);
|
||||
return entities.Select(MapToDto).ToList();
|
||||
}
|
||||
|
||||
public async Task<string> SaveAsync(EmployeeFaceEmbeddingDto dto)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(dto.Id))
|
||||
{
|
||||
// ایجاد جدید
|
||||
var metadata = MapMetadataFromDto(dto.Metadata);
|
||||
var entity = new EmployeeFaceEmbedding(
|
||||
dto.EmployeeFullName,
|
||||
dto.EmployeeId,
|
||||
dto.WorkshopId,
|
||||
dto.Embeddings,
|
||||
metadata
|
||||
);
|
||||
|
||||
await _repository.CreateAsync(entity);
|
||||
return entity.Id;
|
||||
}
|
||||
else
|
||||
{
|
||||
// بهروزرسانی
|
||||
var entity = await _repository.GetByIdAsync(dto.Id);
|
||||
if (entity == null)
|
||||
throw new Exception($"EmployeeFaceEmbedding با شناسه {dto.Id} یافت نشد");
|
||||
|
||||
entity.UpdateEmployeeInfo(dto.EmployeeFullName, dto.WorkshopId);
|
||||
entity.UpdateEmbedding(dto.Embeddings, 0, 0);
|
||||
entity.UpdateMetadata(MapMetadataFromDto(dto.Metadata), 0, 0);
|
||||
|
||||
await _repository.UpdateAsync(entity);
|
||||
return entity.Id;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task DeleteAsync(string id)
|
||||
{
|
||||
await _repository.DeleteAsync(id);
|
||||
}
|
||||
|
||||
#region Mapping Methods
|
||||
|
||||
private EmployeeFaceEmbeddingDto MapToDto(EmployeeFaceEmbedding entity)
|
||||
{
|
||||
return new EmployeeFaceEmbeddingDto
|
||||
{
|
||||
Id = entity.Id,
|
||||
EmployeeFullName = entity.EmployeeFullName,
|
||||
EmployeeId = entity.EmployeeId,
|
||||
WorkshopId = entity.WorkshopId,
|
||||
Embeddings = entity.Embeddings,
|
||||
Metadata = MapMetadataToDto(entity.Metadata)
|
||||
};
|
||||
}
|
||||
|
||||
private EmployeeFaceEmbeddingMetadataDto MapMetadataToDto(EmployeeFaceEmbeddingMetadata metadata)
|
||||
{
|
||||
if (metadata == null) return null;
|
||||
|
||||
return new EmployeeFaceEmbeddingMetadataDto
|
||||
{
|
||||
AvgEyeDistanceNormalized = metadata.AvgEyeDistanceNormalized,
|
||||
AvgEyeToFaceRatio = metadata.AvgEyeToFaceRatio,
|
||||
AvgFaceAspectRatio = metadata.AvgFaceAspectRatio,
|
||||
AvgDetectionConfidence = metadata.AvgDetectionConfidence,
|
||||
AvgKeypointsNormalized = MapKeypointsToDto(metadata.AvgKeypointsNormalized),
|
||||
PerImageMetadata = metadata.PerImageMetadata?.Select(x => new ImageMetadataDto
|
||||
{
|
||||
FaceAspectRatio = x.FaceAspectRatio,
|
||||
EyeDistanceNormalized = x.EyeDistanceNormalized,
|
||||
EyeToFaceRatio = x.EyeToFaceRatio,
|
||||
DetectionConfidence = x.DetectionConfidence,
|
||||
KeypointsNormalized = MapKeypointsToDto(x.KeypointsNormalized)
|
||||
}).ToList()
|
||||
};
|
||||
}
|
||||
|
||||
private EmployeeFaceEmbeddingKeypointsDto MapKeypointsToDto(EmployeeFaceEmbeddingKeypoints keypoints)
|
||||
{
|
||||
if (keypoints == null) return null;
|
||||
|
||||
return new EmployeeFaceEmbeddingKeypointsDto
|
||||
{
|
||||
LeftEye = keypoints.LeftEye,
|
||||
RightEye = keypoints.RightEye,
|
||||
Nose = keypoints.Nose,
|
||||
MouthLeft = keypoints.MouthLeft,
|
||||
MouthRight = keypoints.MouthRight
|
||||
};
|
||||
}
|
||||
|
||||
private EmployeeFaceEmbeddingMetadata MapMetadataFromDto(EmployeeFaceEmbeddingMetadataDto dto)
|
||||
{
|
||||
if (dto == null) return null;
|
||||
|
||||
return new EmployeeFaceEmbeddingMetadata
|
||||
{
|
||||
AvgEyeDistanceNormalized = dto.AvgEyeDistanceNormalized,
|
||||
AvgEyeToFaceRatio = dto.AvgEyeToFaceRatio,
|
||||
AvgFaceAspectRatio = dto.AvgFaceAspectRatio,
|
||||
AvgDetectionConfidence = dto.AvgDetectionConfidence,
|
||||
AvgKeypointsNormalized = MapKeypointsFromDto(dto.AvgKeypointsNormalized),
|
||||
PerImageMetadata = dto.PerImageMetadata?.Select(x => new ImageMetadata
|
||||
{
|
||||
FaceAspectRatio = x.FaceAspectRatio,
|
||||
EyeDistanceNormalized = x.EyeDistanceNormalized,
|
||||
EyeToFaceRatio = x.EyeToFaceRatio,
|
||||
DetectionConfidence = x.DetectionConfidence,
|
||||
KeypointsNormalized = MapKeypointsFromDto(x.KeypointsNormalized)
|
||||
}).ToList()
|
||||
};
|
||||
}
|
||||
|
||||
private EmployeeFaceEmbeddingKeypoints MapKeypointsFromDto(EmployeeFaceEmbeddingKeypointsDto dto)
|
||||
{
|
||||
if (dto == null) return null;
|
||||
|
||||
return new EmployeeFaceEmbeddingKeypoints
|
||||
{
|
||||
LeftEye = dto.LeftEye,
|
||||
RightEye = dto.RightEye,
|
||||
Nose = dto.Nose,
|
||||
MouthLeft = dto.MouthLeft,
|
||||
MouthRight = dto.MouthRight
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -1,132 +0,0 @@
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace CompanyManagment.Application.Helpers
|
||||
{
|
||||
public class ApkInfo
|
||||
{
|
||||
public string VersionName { get; set; } = string.Empty;
|
||||
public string VersionCode { get; set; } = string.Empty;
|
||||
public string PackageName { get; set; } = string.Empty;
|
||||
public string ApplicationLabel { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public static class ApkHelper
|
||||
{
|
||||
public static ApkInfo ReadApkInfo(Stream apkStream)
|
||||
{
|
||||
var apkInfo = new ApkInfo();
|
||||
|
||||
try
|
||||
{
|
||||
using var archive = new ZipArchive(apkStream, ZipArchiveMode.Read, true);
|
||||
var manifestEntry = archive.GetEntry("AndroidManifest.xml");
|
||||
|
||||
if (manifestEntry == null)
|
||||
{
|
||||
throw new InvalidOperationException("AndroidManifest.xml not found in APK file");
|
||||
}
|
||||
|
||||
using var manifestStream = manifestEntry.Open();
|
||||
using var memoryStream = new MemoryStream();
|
||||
manifestStream.CopyTo(memoryStream);
|
||||
var manifestBytes = memoryStream.ToArray();
|
||||
|
||||
// Parse the binary AndroidManifest.xml
|
||||
apkInfo = ParseBinaryManifest(manifestBytes);
|
||||
|
||||
// Validate that we found at least version information
|
||||
if (string.IsNullOrEmpty(apkInfo.VersionCode) && string.IsNullOrEmpty(apkInfo.VersionName))
|
||||
{
|
||||
throw new InvalidOperationException("Could not extract version information from APK");
|
||||
}
|
||||
|
||||
return apkInfo;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new InvalidOperationException($"Error reading APK file: {ex.Message}", ex);
|
||||
}
|
||||
}
|
||||
|
||||
private static ApkInfo ParseBinaryManifest(byte[] manifestBytes)
|
||||
{
|
||||
var apkInfo = new ApkInfo();
|
||||
|
||||
try
|
||||
{
|
||||
// Convert bytes to string for regex parsing
|
||||
var text = System.Text.Encoding.UTF8.GetString(manifestBytes);
|
||||
|
||||
// Extract package name
|
||||
var packageMatch = Regex.Match(text, @"package[^a-zA-Z]+([a-zA-Z][a-zA-Z0-9_]*(?:\.[a-zA-Z][a-zA-Z0-9_]*)+)", RegexOptions.IgnoreCase);
|
||||
if (packageMatch.Success)
|
||||
{
|
||||
apkInfo.PackageName = packageMatch.Groups[1].Value;
|
||||
}
|
||||
|
||||
// Extract version code - look for numeric values that could be version codes
|
||||
var versionCodeMatch = Regex.Match(text, @"versionCode[^\d]*(\d+)", RegexOptions.IgnoreCase);
|
||||
if (versionCodeMatch.Success)
|
||||
{
|
||||
apkInfo.VersionCode = versionCodeMatch.Groups[1].Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fallback: try to find reasonable numeric values
|
||||
var numbers = Regex.Matches(text, @"\b(\d{1,8})\b");
|
||||
foreach (Match numMatch in numbers)
|
||||
{
|
||||
if (int.TryParse(numMatch.Groups[1].Value, out int num) && num > 0 && num < 99999999)
|
||||
{
|
||||
apkInfo.VersionCode = num.ToString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Extract version name
|
||||
var versionNameMatch = Regex.Match(text, @"versionName[^\d]*(\d+(?:\.\d+)*(?:\.\d+)*)", RegexOptions.IgnoreCase);
|
||||
if (versionNameMatch.Success)
|
||||
{
|
||||
apkInfo.VersionName = versionNameMatch.Groups[1].Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fallback: look for version-like patterns
|
||||
var versionMatch = Regex.Match(text, @"\b(\d+\.\d+(?:\.\d+)*)\b");
|
||||
if (versionMatch.Success)
|
||||
{
|
||||
apkInfo.VersionName = versionMatch.Groups[1].Value;
|
||||
}
|
||||
}
|
||||
|
||||
// Set defaults if nothing found
|
||||
if (string.IsNullOrEmpty(apkInfo.VersionCode))
|
||||
apkInfo.VersionCode = "1";
|
||||
|
||||
if (string.IsNullOrEmpty(apkInfo.VersionName))
|
||||
apkInfo.VersionName = "1.0";
|
||||
|
||||
if (string.IsNullOrEmpty(apkInfo.PackageName))
|
||||
apkInfo.PackageName = "unknown.package";
|
||||
|
||||
return apkInfo;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Return default values if parsing fails
|
||||
return new ApkInfo
|
||||
{
|
||||
VersionCode = "1",
|
||||
VersionName = "1.0",
|
||||
PackageName = "unknown.package"
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1140,7 +1140,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
CreateContractingPartyAccount(contractingParty.id, res.SendId);
|
||||
|
||||
|
||||
await _smsService.SendInstitutionCreationVerificationLink(contractingParty.Phone, contractingPartyFullName,
|
||||
await _smsService.SendInstitutionVerificationLink(contractingParty.Phone, contractingPartyFullName,
|
||||
entity.PublicId, contractingParty.id,entity.id );
|
||||
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
@@ -1377,7 +1377,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
if (contractingParty == null)
|
||||
throw new NotFoundException("طرف قرارداد یافت نشد");
|
||||
var contractingPartyFullName = contractingParty.FName + " " + contractingParty.LName;
|
||||
await _smsService.SendInstitutionCreationVerificationLink(contractingParty.Phone, contractingPartyFullName,
|
||||
await _smsService.SendInstitutionVerificationLink(contractingParty.Phone, contractingPartyFullName,
|
||||
institutionContract.PublicId, contractingParty.id, institutionContract.id);
|
||||
return new OperationResult().Succcedded();
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public class PaymentTransactionApplication : IPaymentTransactionApplication
|
||||
command.ContractingPartyId,
|
||||
command.Amount,
|
||||
contractingPartyName,
|
||||
command.CallBackUrl,command.Gateway);
|
||||
command.CallBackUrl);
|
||||
|
||||
await _paymentTransactionRepository.CreateAsync(entity);
|
||||
await _paymentTransactionRepository.SaveChangesAsync();
|
||||
@@ -87,7 +87,7 @@ public class PaymentTransactionApplication : IPaymentTransactionApplication
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult SetSuccess(long paymentTransactionId,string cardNumber, string bankName, string rrn, string digitalReceipt)
|
||||
public OperationResult SetSuccess(long paymentTransactionId,string cardNumber, string bankName)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
|
||||
@@ -97,7 +97,7 @@ public class PaymentTransactionApplication : IPaymentTransactionApplication
|
||||
{
|
||||
return op.Failed("تراکنش مورد نظر یافت نشد");
|
||||
}
|
||||
paymentTransaction.SetPaid(cardNumber, bankName,rrn, digitalReceipt);
|
||||
paymentTransaction.SetPaid(cardNumber, bankName);
|
||||
_paymentTransactionRepository.SaveChanges();
|
||||
|
||||
return op.Succcedded();
|
||||
|
||||
@@ -29,67 +29,67 @@ public class ReportApplication : IReportApplication
|
||||
return await _reportRepository.GetAllActiveWorkshopsNew(year, month);
|
||||
}
|
||||
|
||||
public async Task<WorkshopResult> GetWorkshopContractDone(string year, string month, long accountId, List<long> workshopList)
|
||||
public WorkshopResult GetWorkshopContractDone(string year, string month, long accountId, List<long> workshopList)
|
||||
{
|
||||
return await _reportRepository.GetWorkshopContractDone(year, month, accountId, workshopList);
|
||||
return _reportRepository.GetWorkshopContractDone(year, month, accountId, workshopList);
|
||||
}
|
||||
|
||||
public async Task<WorkshopResult> GetWorkshopContractSignDone(string year, string month, long accountId, List<long> workshopList)
|
||||
public WorkshopResult GetWorkshopContractSignDone(string year, string month, long accountId, List<long> workshopList)
|
||||
{
|
||||
return await _reportRepository.GetWorkshopContractSignDone(year, month, accountId, workshopList);
|
||||
return _reportRepository.GetWorkshopContractSignDone(year, month, accountId, workshopList);
|
||||
}
|
||||
|
||||
public async Task<WorkshopResult> GetWorkshopCheckoutDone(string year, string month, long accountId, List<long> workshopList)
|
||||
public WorkshopResult GetWorkshopCheckoutDone(string year, string month, long accountId, List<long> workshopList)
|
||||
{
|
||||
return await _reportRepository.GetWorkshopCheckoutDone(year, month, accountId, workshopList);
|
||||
return _reportRepository.GetWorkshopCheckoutDone(year, month, accountId, workshopList);
|
||||
}
|
||||
|
||||
public async Task<WorkshopResult> GetWorkshopCheckoutSignDone(string year, string month, long accountId, List<long> workshopList)
|
||||
public WorkshopResult GetWorkshopCheckoutSignDone(string year, string month, long accountId, List<long> workshopList)
|
||||
{
|
||||
return await _reportRepository.GetWorkshopCheckoutSignDone(year, month, accountId, workshopList);
|
||||
return _reportRepository.GetWorkshopCheckoutSignDone(year, month, accountId, workshopList);
|
||||
}
|
||||
|
||||
public async Task<List<EmployeeNotDone>> GetEmployeeContract(string year, string month, long workshopId)
|
||||
public List<EmployeeNotDone> GetEmployeeContract(string year, string month, long workshopId)
|
||||
{
|
||||
return await _reportRepository.GetEmployeeContract(year, month, workshopId);
|
||||
return _reportRepository.GetEmployeeContract(year, month, workshopId);
|
||||
}
|
||||
|
||||
public async Task<List<EmployeeNotDone>> GetEmployeeContractSign(string year, string month, long workshopId)
|
||||
public List<EmployeeNotDone> GetEmployeeContractSign(string year, string month, long workshopId)
|
||||
{
|
||||
return await _reportRepository.GetEmployeeContractSign(year, month, workshopId);
|
||||
return _reportRepository.GetEmployeeContractSign(year, month, workshopId);
|
||||
}
|
||||
|
||||
public async Task<List<EmployeeNotDone>> GetEmployeeCheckout(string year, string month, long workshopId)
|
||||
public List<EmployeeNotDone> GetEmployeeCheckout(string year, string month, long workshopId)
|
||||
{
|
||||
return await _reportRepository.GetEmployeeCheckout(year, month, workshopId);
|
||||
return _reportRepository.GetEmployeeCheckout(year, month, workshopId);
|
||||
}
|
||||
|
||||
public async Task<List<EmployeeNotDone>> GetEmployeeCheckoutSign(string year, string month, long workshopId)
|
||||
public List<EmployeeNotDone> GetEmployeeCheckoutSign(string year, string month, long workshopId)
|
||||
{
|
||||
return await _reportRepository.GetEmployeeCheckoutSign(year, month, workshopId);
|
||||
return _reportRepository.GetEmployeeCheckoutSign(year, month, workshopId);
|
||||
}
|
||||
|
||||
#region Print
|
||||
|
||||
public async Task<PrintAllContractCheckout> GetPrintAllContractDone(string year, string month, long accountId,
|
||||
public PrintAllContractCheckout GetPrintAllContractDone(string year, string month, long accountId,
|
||||
List<long> workshopList)
|
||||
{
|
||||
return await _reportRepository.GetPrintAllContractDone(year, month, accountId, workshopList);
|
||||
return _reportRepository.GetPrintAllContractDone(year, month, accountId, workshopList);
|
||||
}
|
||||
public async Task<PrintAllContractCheckout> GetPrintAllContractSignDone(string year, string month, long accountId,
|
||||
public PrintAllContractCheckout GetPrintAllContractSignDone(string year, string month, long accountId,
|
||||
List<long> workshopList)
|
||||
{
|
||||
return await _reportRepository.GetPrintAllContractSignDone(year, month, accountId, workshopList);
|
||||
return _reportRepository.GetPrintAllContractSignDone(year, month, accountId, workshopList);
|
||||
}
|
||||
public async Task<PrintAllContractCheckout> GetPrintAllCheckoutDone(string year, string month, long accountId,
|
||||
public PrintAllContractCheckout GetPrintAllCheckoutDone(string year, string month, long accountId,
|
||||
List<long> workshopList)
|
||||
{
|
||||
return await _reportRepository.GetPrintAllCheckoutDone(year, month, accountId, workshopList);
|
||||
return _reportRepository.GetPrintAllCheckoutDone(year, month, accountId, workshopList);
|
||||
}
|
||||
public async Task<PrintAllContractCheckout> GetPrintAllCheckoutSignDone(string year, string month, long accountId,
|
||||
public PrintAllContractCheckout GetPrintAllCheckoutSignDone(string year, string month, long accountId,
|
||||
List<long> workshopList)
|
||||
{
|
||||
return await _reportRepository.GetPrintAllCheckoutSignDone(year, month, accountId, workshopList);
|
||||
return _reportRepository.GetPrintAllCheckoutSignDone(year, month, accountId, workshopList);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.QualityTools.Testing.Fakes" Version="16.11.230815" />
|
||||
<PackageReference Include="MongoDB.Driver" Version="3.5.0" />
|
||||
<PackageReference Include="Parbad.Gateway.Sepehr" Version="1.7.0" />
|
||||
<PackageReference Include="PersianTools.Core" Version="2.0.4" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using Company.Domain.AndroidApkVersionAgg;
|
||||
using CompanyManagment.App.Contracts.AndroidApkVersion;
|
||||
|
||||
using Company.Domain.AndroidApkVersionAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Hosting.Builder;
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping;
|
||||
@@ -18,15 +19,10 @@ public class AndroidApkVersionMapping:IEntityTypeConfiguration<AndroidApkVersion
|
||||
v => v.ToString(),
|
||||
v => (IsActive)Enum.Parse(typeof(IsActive), v)).HasMaxLength(5);
|
||||
|
||||
builder.Property(x => x.ApkType).HasConversion(
|
||||
v => v.ToString(),
|
||||
v => (ApkType)Enum.Parse(typeof(ApkType), v)).HasMaxLength(20);
|
||||
|
||||
builder.Property(x => x.Title).HasMaxLength(50);
|
||||
builder.Property(x => x.VersionCode).HasMaxLength(20);
|
||||
builder.Property(x => x.VersionName).HasMaxLength(35);
|
||||
builder.Property(x => x.Path).HasMaxLength(255);
|
||||
builder.Property(x => x.IsForce);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -15,12 +15,8 @@ public class PaymentTransactionMapping:IEntityTypeConfiguration<PaymentTransacti
|
||||
builder.Property(x => x.CardNumber).HasMaxLength(25);
|
||||
builder.Property(x => x.BankName).HasMaxLength(50);
|
||||
builder.Property(x => x.Status).HasConversion<string>().HasMaxLength(35);
|
||||
builder.Property(x => x.Gateway).HasConversion<string>().HasMaxLength(35);
|
||||
builder.Property(x => x.ContractingPartyName).HasMaxLength(255);
|
||||
builder.Property(x => x.CallBackUrl).HasMaxLength(500);
|
||||
builder.Property(x => x.Rrn).HasMaxLength(50);
|
||||
builder.Property(x => x.DigitalReceipt).HasMaxLength(50);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,30 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addGatewaysintransaction : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Gateway",
|
||||
table: "PaymentTransactions",
|
||||
type: "nvarchar(35)",
|
||||
maxLength: 35,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Gateway",
|
||||
table: "PaymentTransactions");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,40 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addrrnanddigitalreceipt : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "DigitalReceipt",
|
||||
table: "PaymentTransactions",
|
||||
type: "nvarchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Rrn",
|
||||
table: "PaymentTransactions",
|
||||
type: "nvarchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DigitalReceipt",
|
||||
table: "PaymentTransactions");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Rrn",
|
||||
table: "PaymentTransactions");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,30 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddApkTypeToAndroidApkVersion : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ApkType",
|
||||
table: "AndroidApkVersions",
|
||||
type: "nvarchar(20)",
|
||||
maxLength: 20,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ApkType",
|
||||
table: "AndroidApkVersions");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,29 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddIsForceFieldToAndroidApkVersions : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsForce",
|
||||
table: "AndroidApkVersions",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsForce",
|
||||
table: "AndroidApkVersions");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -61,11 +61,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<string>("ApkType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -74,9 +69,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(5)
|
||||
.HasColumnType("nvarchar(5)");
|
||||
|
||||
b.Property<bool>("IsForce")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Path")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)");
|
||||
@@ -4998,19 +4990,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("DigitalReceipt")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Gateway")
|
||||
.IsRequired()
|
||||
.HasMaxLength(35)
|
||||
.HasColumnType("nvarchar(35)");
|
||||
|
||||
b.Property<string>("Rrn")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.IsRequired()
|
||||
.HasMaxLength(35)
|
||||
|
||||
@@ -3,7 +3,6 @@ using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.AndroidApkVersionAgg;
|
||||
using CompanyManagment.App.Contracts.AndroidApkVersion;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
@@ -16,21 +15,13 @@ public class AndroidApkVersionRepository:RepositoryBase<long, AndroidApkVersion>
|
||||
_companyContext = companyContext;
|
||||
}
|
||||
|
||||
public IQueryable<AndroidApkVersion> GetActives(ApkType apkType)
|
||||
public IQueryable<AndroidApkVersion> GetActives()
|
||||
{
|
||||
return _companyContext.AndroidApkVersions.Where(x => x.IsActive == IsActive.True && x.ApkType == apkType);
|
||||
return _companyContext.AndroidApkVersions.Where(x => x.IsActive == IsActive.True);
|
||||
}
|
||||
|
||||
public async Task<string> GetLatestActiveVersionPath(ApkType apkType)
|
||||
public async Task<string> GetLatestActiveVersionPath()
|
||||
{
|
||||
return (await _companyContext.AndroidApkVersions.OrderByDescending(x=>x.CreationDate).FirstOrDefaultAsync(x => x.IsActive == IsActive.True && x.ApkType == apkType)).Path;
|
||||
}
|
||||
|
||||
public AndroidApkVersion GetLatestActive(ApkType apkType)
|
||||
{
|
||||
return _companyContext.AndroidApkVersions
|
||||
.Where(x => x.IsActive == IsActive.True && x.ApkType == apkType)
|
||||
.OrderByDescending(x => x.CreationDate)
|
||||
.FirstOrDefault();
|
||||
return (await _companyContext.AndroidApkVersions.OrderByDescending(x=>x.CreationDate).FirstOrDefaultAsync(x => x.IsActive == IsActive.True)).Path;
|
||||
}
|
||||
}
|
||||
@@ -1691,7 +1691,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
return new List<CheckoutViewModel>();
|
||||
}
|
||||
#endregion
|
||||
var query = _context.CheckoutSet.Include(w => w.CheckoutWarningMessageList)
|
||||
var query = _context.CheckoutSet
|
||||
.AsSplitQuery().Select(x => new CheckoutViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
@@ -1726,14 +1726,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
SalaryAidDateTimeFa = s.SalaryAidDateTimeFa,
|
||||
SalaryAidDateTimeGe = s.SalaryAidDateTime
|
||||
}).ToList(),
|
||||
HasAmountConflict = x.HasAmountConflict,
|
||||
IsUpdateNeeded = x.IsUpdateNeeded,
|
||||
CheckoutWarningMessageList = x.CheckoutWarningMessageList.Select(wm => new CheckoutWarningMessageModel
|
||||
{
|
||||
WarningMessage = wm.WarningMessage,
|
||||
TypeOfCheckoutWarning = wm.TypeOfCheckoutWarning,
|
||||
|
||||
}).ToList()
|
||||
HasAmountConflict = x.HasAmountConflict
|
||||
|
||||
}).Where(x => x.WorkshopId == searchModel.WorkshopId);
|
||||
if (searchModel.EmployeeId > 0)
|
||||
|
||||
@@ -19,41 +19,39 @@ using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class CustomizeWorkshopGroupSettingsRepository(
|
||||
CompanyContext companyContext,
|
||||
IRollCallEmployeeRepository _rollCallEmployeeRepository)
|
||||
public class CustomizeWorkshopGroupSettingsRepository(CompanyContext companyContext, IRollCallEmployeeRepository _rollCallEmployeeRepository)
|
||||
: RepositoryBase<long, CustomizeWorkshopGroupSettings>(companyContext),
|
||||
ICustomizeWorkshopGroupSettingsRepository
|
||||
{
|
||||
private readonly CompanyContext _companyContext = companyContext;
|
||||
private readonly IRollCallEmployeeRepository _rollCallEmployeeRepository = _rollCallEmployeeRepository;
|
||||
|
||||
public CustomizeWorkshopGroupSettings GetIncludeWorkshopSettings(long id)
|
||||
{
|
||||
|
||||
return _companyContext.CustomizeWorkshopGroupSettings.AsSplitQuery().Include(x => x.CustomizeWorkshopSettings)
|
||||
.FirstOrDefault(x => x.id == id);
|
||||
.FirstOrDefault(x => x.id == id);
|
||||
}
|
||||
|
||||
public CustomizeWorkshopGroupSettings GetWorkshopMainGroup(long workshopId)
|
||||
{
|
||||
return _companyContext.CustomizeWorkshopGroupSettings
|
||||
.Include(x => x.CustomizeWorkshopSettings)
|
||||
.Include(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
.AsSplitQuery().FirstOrDefault(x => x.MainGroup && x.CustomizeWorkshopSettings.WorkshopId == workshopId);
|
||||
return _companyContext.CustomizeWorkshopGroupSettings
|
||||
.Include(x=>x.CustomizeWorkshopSettings)
|
||||
.Include(x=> x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
.AsSplitQuery().FirstOrDefault(x => x.MainGroup && x.CustomizeWorkshopSettings.WorkshopId == workshopId);
|
||||
}
|
||||
|
||||
public List<EmployeeViewModel> GetEmployeesWithoutGroup(long customizeWorkshopSettingId)
|
||||
{
|
||||
var workshopSettings = _companyContext.CustomizeWorkshopSettings.Find(customizeWorkshopSettingId);
|
||||
var workshopSettings = _companyContext.CustomizeWorkshopSettings.Find(customizeWorkshopSettingId);
|
||||
|
||||
if (workshopSettings == null)
|
||||
return new();
|
||||
|
||||
var existsEmployees = _companyContext.CustomizeWorkshopEmployeeSettings
|
||||
.AsSplitQuery().Include(x => x.CustomizeWorkshopGroupSettings)
|
||||
.Where(x => x.WorkshopId == workshopSettings.WorkshopId && !x.CustomizeWorkshopGroupSettings.MainGroup)
|
||||
.Select(x => x.EmployeeId).ToList();
|
||||
|
||||
.AsSplitQuery().Include(x=>x.CustomizeWorkshopGroupSettings)
|
||||
.Where(x => x.WorkshopId == workshopSettings.WorkshopId && !x.CustomizeWorkshopGroupSettings.MainGroup)
|
||||
.Select(x=>x.EmployeeId).ToList();
|
||||
|
||||
var workshopId = workshopSettings.WorkshopId;
|
||||
var rollCallEmployees = _rollCallEmployeeRepository.GetActivePersonnelByWorkshopId(workshopId);
|
||||
|
||||
@@ -83,81 +81,79 @@ public class CustomizeWorkshopGroupSettingsRepository(
|
||||
|
||||
var dateNow = DateTime.Now.Date;
|
||||
|
||||
//var existsEmployees = _companyContext.CustomizeWorkshopEmployeeSettings
|
||||
// .AsSplitQuery().Include(x => x.CustomizeWorkshopGroupSettings)
|
||||
// .Where(x => x.WorkshopId == workshopId && !x.CustomizeWorkshopGroupSettings.MainGroup)
|
||||
// .Select(x => x.EmployeeId).ToList();
|
||||
//var existsEmployees = _companyContext.CustomizeWorkshopEmployeeSettings
|
||||
// .AsSplitQuery().Include(x => x.CustomizeWorkshopGroupSettings)
|
||||
// .Where(x => x.WorkshopId == workshopId && !x.CustomizeWorkshopGroupSettings.MainGroup)
|
||||
// .Select(x => x.EmployeeId).ToList();
|
||||
|
||||
//var rollCallEmployees = _rollCallEmployeeRepository.GetActivePersonnelByWorkshopId(workshopId);
|
||||
//var rollCallEmployees = _rollCallEmployeeRepository.GetActivePersonnelByWorkshopId(workshopId);
|
||||
|
||||
//var employees = rollCallEmployees
|
||||
// .Where(x => !existsEmployees.Contains(x.EmployeeId))
|
||||
// .Select(x => new EmployeeViewModel()
|
||||
// {
|
||||
// EmployeeFullName = x.EmployeeFullName,
|
||||
// Id = x.EmployeeId
|
||||
// }).ToList();
|
||||
//var employees = rollCallEmployees
|
||||
// .Where(x => !existsEmployees.Contains(x.EmployeeId))
|
||||
// .Select(x => new EmployeeViewModel()
|
||||
// {
|
||||
// EmployeeFullName = x.EmployeeFullName,
|
||||
// Id = x.EmployeeId
|
||||
// }).ToList();
|
||||
|
||||
var employees = _companyContext.RollCallEmployees
|
||||
.Include(x =>
|
||||
x.EmployeesStatus)
|
||||
.Where(x =>
|
||||
x.WorkshopId == workshopId &&
|
||||
x.EmployeesStatus.Any(y => y.StartDate.Date <= dateNow && y.EndDate.Date > dateNow) &&
|
||||
x.HasUploadedImage == "true")
|
||||
.GroupJoin(_companyContext.CustomizeWorkshopEmployeeSettings
|
||||
.AsSplitQuery()
|
||||
.Include(x => x.CustomizeWorkshopGroupSettings)
|
||||
.Where(x => !x.CustomizeWorkshopGroupSettings.MainGroup && x.WorkshopId == workshopId),
|
||||
rollCallEmployee => rollCallEmployee.EmployeeId,
|
||||
cws => cws.EmployeeId,
|
||||
(rollCallEmployee, cws) => new { rollCallEmployee, cws })
|
||||
.SelectMany(x => x.cws.DefaultIfEmpty(), (x, cws) => new { x.rollCallEmployee, cws })
|
||||
.Where(x => x.cws == null).Select(x => new EmployeeViewModel()
|
||||
{
|
||||
var employees = _companyContext.RollCallEmployees
|
||||
.Include(x =>
|
||||
x.EmployeesStatus)
|
||||
.Where(
|
||||
x =>
|
||||
x.WorkshopId == workshopId &&
|
||||
x.EmployeesStatus.Any(y => y.StartDate.Date <= dateNow && y.EndDate.Date > dateNow) &&
|
||||
x.HasUploadedImage == "true")
|
||||
.GroupJoin(_companyContext.CustomizeWorkshopEmployeeSettings
|
||||
.AsSplitQuery()
|
||||
.Include(x => x.CustomizeWorkshopGroupSettings)
|
||||
.Where(x => !x.CustomizeWorkshopGroupSettings.MainGroup && x.WorkshopId == workshopId), rollCallEmployee => rollCallEmployee.EmployeeId,
|
||||
cws => cws.EmployeeId,
|
||||
(rollCallEmployee, cws) => new { rollCallEmployee, cws })
|
||||
.SelectMany(x => x.cws.DefaultIfEmpty(), (x, cws) => new { x.rollCallEmployee, cws })
|
||||
.Where(x => x.cws == null).Select(x=> new EmployeeViewModel()
|
||||
{
|
||||
EmployeeFullName = x.rollCallEmployee.EmployeeFullName,
|
||||
Id = x.rollCallEmployee.EmployeeId
|
||||
});
|
||||
});
|
||||
|
||||
return employees.ToList();
|
||||
return employees.ToList();
|
||||
}
|
||||
|
||||
public bool HasAnyEmployeeWithoutGroup(long workshopId)
|
||||
{
|
||||
var dateNow = DateTime.Now.Date;
|
||||
var dateNow = DateTime.Now.Date;
|
||||
var leftWork = _companyContext.LeftWorkList.Where(x =>
|
||||
x.WorkshopId == workshopId && x.StartWorkDate <= dateNow && x.LeftWorkDate >= dateNow);
|
||||
|
||||
var rollCallEmployeesWithoutCWS = _companyContext.RollCallEmployees
|
||||
.Include(x =>
|
||||
x.EmployeesStatus)
|
||||
.Where(x =>
|
||||
x.WorkshopId == workshopId &&
|
||||
x.EmployeesStatus.Any(y => y.StartDate.Date <= dateNow && y.EndDate.Date > dateNow) &&
|
||||
x.HasUploadedImage == "true" &&
|
||||
leftWork.Any(l => l.EmployeeId == x.EmployeeId && l.WorkshopId == x.WorkshopId))
|
||||
.GroupJoin(_companyContext.CustomizeWorkshopEmployeeSettings
|
||||
.AsSplitQuery()
|
||||
.Include(x => x.CustomizeWorkshopGroupSettings)
|
||||
.Where(x => !x.CustomizeWorkshopGroupSettings.MainGroup && x.WorkshopId == workshopId),
|
||||
rollCallEmployee => rollCallEmployee.EmployeeId,
|
||||
cws => cws.EmployeeId,
|
||||
(rollCallEmployee, cws) => new { rollCallEmployee, cws })
|
||||
.SelectMany(x => x.cws.DefaultIfEmpty(), (x, cws) => new { x.rollCallEmployee, cws })
|
||||
.Any(x => x.cws == null);
|
||||
.Include(x =>
|
||||
x.EmployeesStatus)
|
||||
.Where(
|
||||
x =>
|
||||
x.WorkshopId == workshopId &&
|
||||
x.EmployeesStatus.Any(y => y.StartDate.Date <= dateNow && y.EndDate.Date > dateNow) &&
|
||||
x.HasUploadedImage == "true"&&
|
||||
leftWork.Any(l => l.EmployeeId == x.EmployeeId && l.WorkshopId == x.WorkshopId))
|
||||
.GroupJoin(_companyContext.CustomizeWorkshopEmployeeSettings
|
||||
.AsSplitQuery()
|
||||
.Include(x => x.CustomizeWorkshopGroupSettings)
|
||||
.Where(x => !x.CustomizeWorkshopGroupSettings.MainGroup && x.WorkshopId == workshopId), rollCallEmployee => rollCallEmployee.EmployeeId,
|
||||
cws => cws.EmployeeId,
|
||||
(rollCallEmployee, cws) => new { rollCallEmployee, cws })
|
||||
.SelectMany(x => x.cws.DefaultIfEmpty(), (x, cws) => new { x.rollCallEmployee, cws })
|
||||
.Any(x => x.cws == null);
|
||||
|
||||
return rollCallEmployeesWithoutCWS;
|
||||
|
||||
return rollCallEmployeesWithoutCWS;
|
||||
}
|
||||
|
||||
public CustomizeWorkshopGroupSettings GetWithEmployees(long groupId)
|
||||
{
|
||||
return _companyContext.CustomizeWorkshopGroupSettings.AsSplitQuery()
|
||||
.Include(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
return _companyContext.CustomizeWorkshopGroupSettings.AsSplitQuery().Include(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
.FirstOrDefault(x => x.id == groupId);
|
||||
}
|
||||
|
||||
public List<CustomizeWorkshopEmployeeSettingsViewModel> GetShiftChangedEmployeeSettingsByGroupSettingsId(
|
||||
long groupSettingsId)
|
||||
public List<CustomizeWorkshopEmployeeSettingsViewModel> GetShiftChangedEmployeeSettingsByGroupSettingsId(long groupSettingsId)
|
||||
{
|
||||
var groupEmployeeSettingsList = _companyContext.CustomizeWorkshopGroupSettings
|
||||
.AsSplitQuery().Include(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
@@ -173,26 +169,23 @@ public class CustomizeWorkshopGroupSettingsRepository(
|
||||
x.id
|
||||
}).ToList();
|
||||
|
||||
return groupEmployeeSettingsList.Join(employees, x => x.EmployeeId, y => y.id, (x, y) =>
|
||||
new CustomizeWorkshopEmployeeSettingsViewModel()
|
||||
return groupEmployeeSettingsList.Join(employees, x => x.EmployeeId, y => y.id, (x, y) => new CustomizeWorkshopEmployeeSettingsViewModel()
|
||||
{
|
||||
EmployeeId = x.EmployeeId,
|
||||
Id = x.id,
|
||||
IsShiftChanged = x.IsShiftChanged,
|
||||
IsSettingChanged = x.IsSettingChanged,
|
||||
Name = y.FullName,
|
||||
RollCallWorkshopShifts = x.CustomizeWorkshopEmployeeSettingsShifts.Select(z => new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EmployeeId = x.EmployeeId,
|
||||
Id = x.id,
|
||||
IsShiftChanged = x.IsShiftChanged,
|
||||
IsSettingChanged = x.IsSettingChanged,
|
||||
Name = y.FullName,
|
||||
RollCallWorkshopShifts = x.CustomizeWorkshopEmployeeSettingsShifts.Select(z =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = z.EndTime.ToString("HH:mm"),
|
||||
Placement = z.Placement,
|
||||
StartTime = z.StartTime.ToString("HH:mm")
|
||||
}).ToList()
|
||||
}).ToList();
|
||||
EndTime = z.EndTime.ToString("HH:mm"),
|
||||
Placement = z.Placement,
|
||||
StartTime = z.StartTime.ToString("HH:mm")
|
||||
}).ToList()
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public List<CustomizeWorkshopEmployeeSettingsViewModel> GetSettingChangedEmployeeSettingsByGroupSettingsId(
|
||||
long groupSettingsId)
|
||||
public List<CustomizeWorkshopEmployeeSettingsViewModel> GetSettingChangedEmployeeSettingsByGroupSettingsId(long groupSettingsId)
|
||||
{
|
||||
var groupEmployeeSettingsList = _companyContext.CustomizeWorkshopGroupSettings
|
||||
.AsSplitQuery().Include(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
@@ -208,52 +201,38 @@ public class CustomizeWorkshopGroupSettingsRepository(
|
||||
x.id
|
||||
}).ToList();
|
||||
|
||||
return groupEmployeeSettingsList.Join(employees, x => x.EmployeeId, y => y.id, (x, y) =>
|
||||
new CustomizeWorkshopEmployeeSettingsViewModel()
|
||||
return groupEmployeeSettingsList.Join(employees, x => x.EmployeeId, y => y.id, (x, y) => new CustomizeWorkshopEmployeeSettingsViewModel()
|
||||
{
|
||||
EmployeeId = x.EmployeeId,
|
||||
Id = x.id,
|
||||
IsSettingChanged = x.IsSettingChanged,
|
||||
IsShiftChanged = x.IsShiftChanged,
|
||||
Name = y.FullName,
|
||||
RollCallWorkshopShifts = x.CustomizeWorkshopEmployeeSettingsShifts.Select(z => new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EmployeeId = x.EmployeeId,
|
||||
Id = x.id,
|
||||
IsSettingChanged = x.IsSettingChanged,
|
||||
IsShiftChanged = x.IsShiftChanged,
|
||||
Name = y.FullName,
|
||||
RollCallWorkshopShifts = x.CustomizeWorkshopEmployeeSettingsShifts.Select(z =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = z.EndTime.ToString("HH:mm"),
|
||||
Placement = z.Placement,
|
||||
StartTime = z.StartTime.ToString("HH:mm")
|
||||
}).ToList()
|
||||
}).ToList();
|
||||
EndTime = z.EndTime.ToString("HH:mm"),
|
||||
Placement = z.Placement,
|
||||
StartTime = z.StartTime.ToString("HH:mm")
|
||||
}).ToList()
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public List<CustomizeWorkshopEmployeeSettingsViewModel> GetEmployeeSettingsByGroupSettingsId(long groupSettingsId)
|
||||
{
|
||||
var entity = _companyContext.CustomizeWorkshopGroupSettings.AsSplitQuery()
|
||||
.Include(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
.FirstOrDefault(x => x.id == groupSettingsId);
|
||||
|
||||
var entity = _companyContext.CustomizeWorkshopGroupSettings.AsSplitQuery().Include(x=>x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
.FirstOrDefault(x => x.id == groupSettingsId);
|
||||
|
||||
if (entity == null)
|
||||
return new();
|
||||
|
||||
var employees = entity.CustomizeWorkshopEmployeeSettingsCollection;
|
||||
if (employees.Count == 0)
|
||||
return [];
|
||||
|
||||
var workshopId = employees.FirstOrDefault()?.WorkshopId??0;
|
||||
|
||||
if (workshopId == 0)
|
||||
return [];
|
||||
|
||||
|
||||
var employeeIds = employees.Select(x => x.EmployeeId).ToList();
|
||||
|
||||
|
||||
var names = _companyContext.Employees.Where(x => employeeIds.Contains(x.id))
|
||||
.Select(x => new { x.id, x.FullName }).ToList();
|
||||
var employeeIds = employees.Select(x => x.EmployeeId);
|
||||
|
||||
var leftWork = _companyContext.LeftWorkList.Where(x =>
|
||||
x.WorkshopId == workshopId &&
|
||||
employeeIds.Contains(x.EmployeeId)).ToList();
|
||||
|
||||
var names = _companyContext.Employees.Where(x => employeeIds.Contains(x.id)).Select(x => new { x.id, x.FullName }).ToList();
|
||||
|
||||
var joinedList = employees.Join(names, x => x.EmployeeId, y => y.id, (x, y) =>
|
||||
new CustomizeWorkshopEmployeeSettingsViewModel
|
||||
@@ -264,86 +243,82 @@ public class CustomizeWorkshopGroupSettingsRepository(
|
||||
Salary = x.Salary,
|
||||
IsSettingChanged = x.IsSettingChanged,
|
||||
IsShiftChanged = x.IsShiftChanged,
|
||||
RollCallWorkshopShifts = x.CustomizeWorkshopEmployeeSettingsShifts
|
||||
.Select(z => new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = z.EndTime.ToString("HH:mm"),
|
||||
StartTime = z.StartTime.ToString("HH:mm"),
|
||||
Placement = z.Placement
|
||||
}).ToList(),
|
||||
RollCallWorkshopShifts = x.CustomizeWorkshopEmployeeSettingsShifts.Select(z => new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = z.EndTime.ToString("HH:mm"),
|
||||
StartTime = z.StartTime.ToString("HH:mm"),
|
||||
Placement = z.Placement
|
||||
}).ToList(),
|
||||
IrregularShift = x.IrregularShift,
|
||||
WorkshopShiftStatus = x.WorkshopShiftStatus,
|
||||
LeavePermittedDays = x.LeavePermittedDays,
|
||||
CustomizeRotatingShiftsViewModels = x.CustomizeRotatingShifts
|
||||
.Select(r => new CustomizeRotatingShiftsViewModel
|
||||
{
|
||||
StartTime = r.StartTime.ToString("HH:mm"),
|
||||
EndTime = r.EndTime.ToString("HH:mm")
|
||||
}).ToList(),
|
||||
HasLeft = leftWork.OrderByDescending(l=>l.StartWorkDate).FirstOrDefault(l => x.EmployeeId == l.EmployeeId)?.HasLeft ?? false
|
||||
.Select(r=> new CustomizeRotatingShiftsViewModel(){StartTime = r.StartTime.ToString("HH:mm") , EndTime =r.EndTime.ToString("HH:mm") }).ToList()
|
||||
|
||||
});
|
||||
return joinedList.OrderBy(x=>x.HasLeft).ToList();
|
||||
return joinedList.ToList();
|
||||
}
|
||||
|
||||
public EditCustomizeWorkshopGroupSettings GetCustomizeWorkshopGroupSettingsDetails(long groupId)
|
||||
{
|
||||
|
||||
var entity = _companyContext.CustomizeWorkshopGroupSettings.AsSplitQuery().FirstOrDefault(x => x.id == groupId);
|
||||
return new EditCustomizeWorkshopGroupSettings()
|
||||
{
|
||||
//FridayWork = entity.FridayWork,
|
||||
FridayPay = new() { FridayPayType = entity.FridayPay.FridayPayType, Value = entity.FridayPay.Value },
|
||||
FridayPay = new (){ FridayPayType = entity.FridayPay.FridayPayType, Value = entity.FridayPay.Value },
|
||||
LateToWork = new()
|
||||
{
|
||||
{
|
||||
LateToWorkTimeFinesVewModels = entity.LateToWork.LateToWorkTimeFines.Select(x =>
|
||||
new LateToWorkTimeFineVewModel() { FineMoney = x.FineMoney, Minute = x.Minute }).ToList(),
|
||||
Value = entity.LateToWork.Value, LateToWorkType = entity.LateToWork.LateToWorkType
|
||||
},
|
||||
HolidayWork = entity.HolidayWork,
|
||||
FineAbsenceDeduction = new()
|
||||
{
|
||||
{
|
||||
Value = entity.FineAbsenceDeduction.Value,
|
||||
FineAbsenceDayOfWeekViewModels = entity.FineAbsenceDeduction.FineAbsenceDayOfWeekCollection
|
||||
.Select(x => new FineAbsenceDayOfWeekViewModel() { DayOfWeek = x.DayOfWeek }).ToList(),
|
||||
FineAbsenceDeductionType = entity.FineAbsenceDeduction.FineAbsenceDeductionType
|
||||
},
|
||||
EarlyExit = new()
|
||||
{
|
||||
{
|
||||
EarlyExitTimeFinesViewModels = entity.EarlyExit.EarlyExitTimeFines.Select(x =>
|
||||
new EarlyExitTimeFineViewModel() { FineMoney = x.FineMoney, Minute = x.Minute }).ToList(),
|
||||
Value = entity.EarlyExit.Value, EarlyExitType = entity.EarlyExit.EarlyExitType
|
||||
},
|
||||
BonusesPay = new()
|
||||
{
|
||||
{
|
||||
Value = entity.BonusesPay.Value, BonusesPayType = entity.BonusesPay.BonusesPayType,
|
||||
PaymentType = entity.BonusesPay.PaymentType
|
||||
},
|
||||
ShiftPay = new()
|
||||
{
|
||||
{
|
||||
Value = entity.ShiftPay.Value, ShiftPayType = entity.ShiftPay.ShiftPayType,
|
||||
ShiftType = entity.ShiftPay.ShiftType
|
||||
},
|
||||
InsuranceDeduction = new()
|
||||
{
|
||||
{
|
||||
Value = entity.InsuranceDeduction.Value,
|
||||
InsuranceDeductionType = entity.InsuranceDeduction.InsuranceDeductionType
|
||||
},
|
||||
OverTimePay = new()
|
||||
{ OverTimePayType = entity.OverTimePay.OverTimePayType, Value = entity.OverTimePay.Value },
|
||||
{ OverTimePayType = entity.OverTimePay.OverTimePayType, Value = entity.OverTimePay.Value },
|
||||
BaseYearsPay = new()
|
||||
{
|
||||
{
|
||||
BaseYearsPayType = entity.BaseYearsPay.BaseYearsPayType,
|
||||
Value = entity.BaseYearsPay.Value
|
||||
},
|
||||
NightWorkPay = new()
|
||||
{ NightWorkingType = entity.NightWorkPay.NightWorkingType, Value = entity.NightWorkPay.Value },
|
||||
LeavePay = new() { Value = entity.LeavePay.Value, LeavePayType = entity.LeavePay.LeavePayType },
|
||||
{ NightWorkingType = entity.NightWorkPay.NightWorkingType, Value = entity.NightWorkPay.Value },
|
||||
LeavePay =new() { Value = entity.LeavePay.Value, LeavePayType = entity.LeavePay.LeavePayType },
|
||||
MarriedAllowance = new()
|
||||
{
|
||||
{
|
||||
Value = entity.MarriedAllowance.Value,
|
||||
MarriedAllowanceType = entity.MarriedAllowance.MarriedAllowanceType
|
||||
},
|
||||
FamilyAllowance = new()
|
||||
{
|
||||
{
|
||||
FamilyAllowanceType = entity.FamilyAllowance.FamilyAllowanceType,
|
||||
Value = entity.FamilyAllowance.Value
|
||||
},
|
||||
@@ -357,27 +332,23 @@ public class CustomizeWorkshopGroupSettingsRepository(
|
||||
IsShiftChanged = entity.IsShiftChange,
|
||||
ShiftViewModel = entity.CustomizeWorkshopGroupSettingsShifts.Select(x =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = x.EndTime.ToString("HH:mm"), Placement = x.Placement,
|
||||
StartTime = x.StartTime.ToString("HH:mm")
|
||||
}).ToList(),
|
||||
{ EndTime = x.EndTime.ToString("HH:mm"), Placement = x.Placement, StartTime = x.StartTime.ToString("HH:mm") }).ToList(),
|
||||
LeavePermittedDays = entity.LeavePermittedDays,
|
||||
CustomizeRotatingShiftsViewModels = entity.CustomizeRotatingShifts.Select(x =>
|
||||
new CustomizeRotatingShiftsViewModel()
|
||||
{
|
||||
EndTime = x.EndTime.ToString("HH:mm"),
|
||||
StartTime = x.StartTime.ToString("HH:mm")
|
||||
}).ToList(),
|
||||
OffDayOfWeeks = entity.WeeklyOffDays.Select(x => x.DayOfWeek).ToList()
|
||||
CustomizeRotatingShiftsViewModels = entity.CustomizeRotatingShifts.Select(x=> new CustomizeRotatingShiftsViewModel()
|
||||
{
|
||||
EndTime = x.EndTime.ToString("HH:mm"),
|
||||
StartTime = x.StartTime.ToString("HH:mm")
|
||||
}).ToList(),
|
||||
OffDayOfWeeks = entity.WeeklyOffDays.Select(x=>x.DayOfWeek).ToList()
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
public List<CustomizeWorkshopGroupSettings> GetAllGroupsIncludeEmployeeSettingsByWorkshopSettingsId(
|
||||
long workshopSettingsId)
|
||||
public List<CustomizeWorkshopGroupSettings> GetAllGroupsIncludeEmployeeSettingsByWorkshopSettingsId(long workshopSettingsId)
|
||||
{
|
||||
return _companyContext.CustomizeWorkshopGroupSettings
|
||||
.AsSplitQuery().Include(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
.Where(x => x.CustomizeWorkshopSettingId == workshopSettingsId).ToList();
|
||||
return _companyContext.CustomizeWorkshopGroupSettings
|
||||
.AsSplitQuery().Include(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
.Where(x => x.CustomizeWorkshopSettingId == workshopSettingsId).ToList();
|
||||
}
|
||||
|
||||
public void Remove(long groupId)
|
||||
@@ -389,8 +360,7 @@ public class CustomizeWorkshopGroupSettingsRepository(
|
||||
_companyContext.SaveChanges();
|
||||
}
|
||||
|
||||
public CustomizeWorkshopGroupSettingsViewModel GetEmployeesGroupSettingsByEmployeeId(long employeeId,
|
||||
long workshopId)
|
||||
public CustomizeWorkshopGroupSettingsViewModel GetEmployeesGroupSettingsByEmployeeId(long employeeId, long workshopId)
|
||||
{
|
||||
return _companyContext.CustomizeWorkshopGroupSettings
|
||||
.Include(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
|
||||
@@ -1135,21 +1135,21 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.ContractDateFrom) &&
|
||||
!string.IsNullOrWhiteSpace(searchModel.ContractDateTo))
|
||||
{
|
||||
if (!searchModel.ContractDateFrom.TryToGeorgianDateTime(out var dateFrom))
|
||||
if (!searchModel.ContractDateFrom.TryToGeorgianDateTime(out var dateStart))
|
||||
throw new BadRequestException("تاریخ وارد شده نامعتبر است");
|
||||
|
||||
if (!searchModel.ContractDateTo.TryToGeorgianDateTime(out var dateTo))
|
||||
if (!searchModel.ContractDateTo.TryToGeorgianDateTime(out var dateEnd))
|
||||
{
|
||||
throw new BadRequestException("تاریخ وارد شده نامعتبر است");
|
||||
}
|
||||
|
||||
if (dateFrom > dateTo)
|
||||
if (dateStart > dateEnd)
|
||||
{
|
||||
throw new BadRequestException("تاریخ شروع نمیتواند بزرگ تر از تاریخ پایان باشد");
|
||||
}
|
||||
|
||||
joinedQuery = joinedQuery.Where(x =>
|
||||
x.contract.ContractStartGr <= dateTo && x.contract.ContractEndGr <= dateFrom);
|
||||
x.contract.ContractStartGr <= dateEnd && x.contract.ContractEndGr >= dateStart);
|
||||
}
|
||||
|
||||
if (searchModel.HasSignature != null)
|
||||
@@ -1422,23 +1422,22 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.ContractDateFrom) &&
|
||||
!string.IsNullOrWhiteSpace(searchModel.ContractDateTo))
|
||||
{
|
||||
if (!searchModel.ContractDateFrom.TryToGeorgianDateTime(out var dateFrom))
|
||||
if (!searchModel.ContractDateFrom.TryToGeorgianDateTime(out var dateStart))
|
||||
throw new BadRequestException("تاریخ وارد شده نامعتبر است");
|
||||
|
||||
if (!searchModel.ContractDateTo.TryToGeorgianDateTime(out var dateTo))
|
||||
if (!searchModel.ContractDateTo.TryToGeorgianDateTime(out var dateEnd))
|
||||
{
|
||||
throw new BadRequestException("تاریخ وارد شده نامعتبر است");
|
||||
}
|
||||
|
||||
if (dateFrom > dateTo)
|
||||
if (dateStart > dateEnd)
|
||||
{
|
||||
throw new BadRequestException("تاریخ شروع نمیتواند بزرگ تر از تاریخ پایان باشد");
|
||||
}
|
||||
|
||||
joinedQuery = joinedQuery.Where(x =>
|
||||
x.contract.ContractStartGr <= dateTo && x.contract.ContractEndGr <= dateFrom);
|
||||
x.contract.ContractStartGr <= dateEnd && x.contract.ContractEndGr >= dateStart);
|
||||
}
|
||||
|
||||
if (searchModel.HasSignature != null)
|
||||
{
|
||||
var hasSignature = searchModel.HasSignature == true ? "1" : "0";
|
||||
@@ -1512,10 +1511,10 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
|
||||
#endregion
|
||||
|
||||
var totalAmount = await joinedQuery.SumAsync(x => x.contract.ContractAmount);
|
||||
var totalAmount = await joinedQuery.Where(x=>x.contract.ContractStartGr<=DateTime.Today).SumAsync(x => x.contract.ContractAmount);
|
||||
|
||||
var totalDebt = await _context.FinancialStatments.Include(x => x.FinancialTransactionList)
|
||||
.Where(x => joinedQuery.Select(i => i.contract.ContractingPartyId).Contains(x.ContractingPartyId))
|
||||
.Where(x => joinedQuery.Where(i=>i.contract.ContractStartGr<=DateTime.Today).Select(i => i.contract.ContractingPartyId).Contains(x.ContractingPartyId))
|
||||
.SelectMany(x => x.FinancialTransactionList)
|
||||
.SumAsync(x => x.Deptor - x.Creditor);
|
||||
var counts = new List<InstitutionContractStatusCount>();
|
||||
@@ -2342,7 +2341,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
|
||||
await SaveChangesAsync();
|
||||
|
||||
await _smsService.SendInstitutionCreationVerificationLink(contractingParty.Phone, contractingPartyFullName,
|
||||
await _smsService.SendInstitutionVerificationLink(contractingParty.Phone, contractingPartyFullName,
|
||||
entity.PublicId, contractingParty.id, entity.id);
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -18,8 +18,6 @@ public class SmsService : ISmsService
|
||||
{
|
||||
private readonly IConfiguration _configuration;
|
||||
private readonly ISmsResultRepository _smsResultRepository;
|
||||
private readonly bool _isDevEnvironment;
|
||||
private readonly List<string> _testNumbers;
|
||||
public SmsIr SmsIr { get; set; }
|
||||
|
||||
|
||||
@@ -29,33 +27,6 @@ public class SmsService : ISmsService
|
||||
_smsResultRepository = smsResultRepository;
|
||||
SmsIr = new SmsIr("Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa");
|
||||
|
||||
// خواندن تنظیمات SMS از appsettings
|
||||
var smsSettings = _configuration.GetSection("SmsSettings");
|
||||
_isDevEnvironment = smsSettings.GetValue<bool>("IsTestMode");
|
||||
_testNumbers = smsSettings.GetSection("TestNumbers").Get<List<string>>() ?? new List<string>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// متد مرکزی برای ارسال پیامک که محیط dev را چک میکند
|
||||
/// </summary>
|
||||
private async Task<SmsIrResult<VerifySendResult>> VerifySendSmsAsync(string number, int templateId, VerifySendParameter[] parameters)
|
||||
{
|
||||
// اگر محیط dev است و شمارههای تست وجود دارد، به شمارههای تست ارسال میشود
|
||||
if (_isDevEnvironment && _testNumbers is { Count: > 0 })
|
||||
{
|
||||
// ارسال به همه شمارههای تست
|
||||
SmsIrResult<VerifySendResult> lastResult = null;
|
||||
foreach (var testNumber in _testNumbers)
|
||||
{
|
||||
lastResult = await SmsIr.VerifySendAsync(testNumber, templateId, parameters);
|
||||
}
|
||||
return lastResult; // برگرداندن نتیجه آخرین ارسال
|
||||
}
|
||||
else
|
||||
{
|
||||
// ارسال به شماره واقعی
|
||||
return await SmsIr.VerifySendAsync(number, templateId, parameters);
|
||||
}
|
||||
}
|
||||
|
||||
public void Send(string number, string message)
|
||||
@@ -85,7 +56,12 @@ public class SmsService : ISmsService
|
||||
}
|
||||
public bool VerifySend(string number, string message)
|
||||
{
|
||||
var verificationSendResult = VerifySendSmsAsync(number, 768382, new VerifySendParameter[] { new VerifySendParameter("VerificationCode", message) });
|
||||
|
||||
SmsIr smsIr = new SmsIr("Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa");
|
||||
|
||||
//var bulkSendResult = smsIr.BulkSendAsync(95007079000006, "your text message", new string[] { "9120000000" });
|
||||
|
||||
var verificationSendResult = smsIr.VerifySendAsync(number, 768382, new VerifySendParameter[] { new VerifySendParameter("VerificationCode", message) });
|
||||
Thread.Sleep(2000);
|
||||
if (verificationSendResult.IsCompletedSuccessfully)
|
||||
{
|
||||
@@ -114,7 +90,11 @@ public class SmsService : ISmsService
|
||||
|
||||
public bool LoginSend(string number, string message)
|
||||
{
|
||||
var verificationSendResult = VerifySendSmsAsync(number, 635330, new VerifySendParameter[] { new VerifySendParameter("LOGINCODE", message) });
|
||||
SmsIr smsIr = new SmsIr("Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa");
|
||||
|
||||
//var bulkSendResult = smsIr.BulkSendAsync(95007079000006, "your text message", new string[] { "9120000000" });
|
||||
|
||||
var verificationSendResult = smsIr.VerifySendAsync(number, 635330, new VerifySendParameter[] { new VerifySendParameter("LOGINCODE", message) });
|
||||
Thread.Sleep(2000);
|
||||
if (verificationSendResult.IsCompletedSuccessfully)
|
||||
{
|
||||
@@ -139,8 +119,11 @@ public class SmsService : ISmsService
|
||||
|
||||
public async Task<SentSmsViewModel> SendVerifyCodeToClient(string number, string code)
|
||||
{
|
||||
SmsIr smsIr = new SmsIr("Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa");
|
||||
var result = new SentSmsViewModel();
|
||||
var sendResult = await VerifySendSmsAsync(number, 768382, new VerifySendParameter[] { new VerifySendParameter("VerificationCode", code) });
|
||||
//var bulkSendResult = smsIr.BulkSendAsync(95007079000006, "your text message", new string[] { "9120000000" });
|
||||
|
||||
var sendResult = await smsIr.VerifySendAsync(number, 768382, new VerifySendParameter[] { new VerifySendParameter("VerificationCode", code) });
|
||||
Thread.Sleep(2000);
|
||||
|
||||
if (sendResult.Message == "موفق")
|
||||
@@ -165,8 +148,9 @@ public class SmsService : ISmsService
|
||||
var checkLength = fullName.Length;
|
||||
if (checkLength > 25)
|
||||
fullName = fullName.Substring(0, 24);
|
||||
SmsIr smsIr = new SmsIr("Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa");
|
||||
|
||||
var sendResult = VerifySendSmsAsync(number, 725814, new VerifySendParameter[] { new VerifySendParameter("FULLNAME", fullName), new VerifySendParameter("USERNAME", userName), new VerifySendParameter("PASSWORD", userName) });
|
||||
var sendResult = smsIr.VerifySendAsync(number, 725814, new VerifySendParameter[] { new VerifySendParameter("FULLNAME", fullName), new VerifySendParameter("USERNAME", userName), new VerifySendParameter("PASSWORD", userName) });
|
||||
|
||||
|
||||
Console.WriteLine(userName + " - " + sendResult.Result.Status);
|
||||
@@ -348,39 +332,18 @@ public class SmsService : ISmsService
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public async Task<bool> SendInstitutionCreationVerificationLink(string number, string fullName, Guid institutionId, long contractingPartyId, long institutionContractId)
|
||||
public async Task<bool> SendInstitutionVerificationLink(string number, string fullName, Guid institutionId, long contractingPartyId, long institutionContractId)
|
||||
{
|
||||
var guidStr=institutionId.ToString();
|
||||
var firstPart = guidStr.Substring(0, 15);
|
||||
var secondPart = guidStr.Substring(15);
|
||||
var verificationSendResult =await VerifySendSmsAsync(number, 527519, new VerifySendParameter[]
|
||||
var verificationSendResult =await SmsIr.VerifySendAsync(number, 527519, new VerifySendParameter[]
|
||||
{
|
||||
new("FULLNAME", fullName),
|
||||
new("CODE1",firstPart),
|
||||
new("CODE2",secondPart)
|
||||
});
|
||||
|
||||
var smsResult = new SmsResult(verificationSendResult.Data.MessageId, verificationSendResult.Message, "لینک تاییدیه ایجاد قرارداد مالی",
|
||||
fullName, number, contractingPartyId, institutionContractId);
|
||||
await _smsResultRepository.CreateAsync(smsResult);
|
||||
await _smsResultRepository.SaveChangesAsync();
|
||||
return verificationSendResult.Status == 0;
|
||||
}
|
||||
|
||||
public async Task<bool> SendInstitutionAmendmentVerificationLink(string number, string fullName, Guid institutionId,
|
||||
long contractingPartyId, long institutionContractId)
|
||||
{
|
||||
var guidStr=institutionId.ToString();
|
||||
var firstPart = guidStr.Substring(0, 15);
|
||||
var secondPart = guidStr.Substring(15);
|
||||
var verificationSendResult =await VerifySendSmsAsync(number, 527519, new VerifySendParameter[]
|
||||
{
|
||||
new("FULLNAME", fullName),
|
||||
new("CODE1",firstPart),
|
||||
new("CODE2",secondPart)
|
||||
});
|
||||
var smsResult = new SmsResult(verificationSendResult.Data.MessageId, verificationSendResult.Message, "لینک تاییدیه ارتقا قرارداد مالی",
|
||||
var smsResult = new SmsResult(verificationSendResult.Data.MessageId, verificationSendResult.Message, "لینک تاییدیه قرارداد مالی",
|
||||
fullName, number, contractingPartyId, institutionContractId);
|
||||
await _smsResultRepository.CreateAsync(smsResult);
|
||||
await _smsResultRepository.SaveChangesAsync();
|
||||
@@ -390,7 +353,7 @@ public class SmsService : ISmsService
|
||||
public async Task<bool> SendInstitutionVerificationCode(string number, string code, string contractingPartyFullName,
|
||||
long contractingPartyId, long institutionContractId)
|
||||
{
|
||||
var verificationSendResult =await VerifySendSmsAsync(number, 965348, new VerifySendParameter[]
|
||||
var verificationSendResult =await SmsIr.VerifySendAsync(number, 965348, new VerifySendParameter[]
|
||||
{
|
||||
new("VERIFYCODE", code)
|
||||
});
|
||||
|
||||
@@ -220,12 +220,9 @@ using CompanyManagment.App.Contracts.PaymentInstrument;
|
||||
using CompanyManagment.App.Contracts.PaymentTransaction;
|
||||
using CompanyManagment.App.Contracts.AuthorizedPerson;
|
||||
using Company.Domain.AuthorizedPersonAgg;
|
||||
using Company.Domain.EmployeeFaceEmbeddingAgg;
|
||||
using Company.Domain.InstitutionContractExtensionTempAgg;
|
||||
using Company.Domain.LawAgg;
|
||||
using CompanyManagement.Infrastructure.Mongo.EmployeeFaceEmbeddingRepo;
|
||||
using CompanyManagement.Infrastructure.Mongo.InstitutionContractInsertTempRepo;
|
||||
using CompanyManagment.App.Contracts.EmployeeFaceEmbedding;
|
||||
using CompanyManagment.App.Contracts.Law;
|
||||
using CompanyManagment.EFCore.Repository;
|
||||
|
||||
@@ -482,10 +479,6 @@ public class PersonalBootstrapper
|
||||
|
||||
services
|
||||
.AddTransient<IInstitutionContractExtenstionTempRepository, InstitutionContractExtenstionTempRepository>();
|
||||
|
||||
services.AddTransient<IEmployeeFaceEmbeddingRepository, EmployeeFaceEmbeddingRepository>();
|
||||
services.AddTransient<IEmployeeFaceEmbeddingApplication, EmployeeFaceEmbeddingApplication>();
|
||||
|
||||
#endregion
|
||||
|
||||
#region Pooya
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
|
||||
using CompanyManagment.App.Contracts.AndroidApkVersion;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Controllers;
|
||||
|
||||
[AllowAnonymous]
|
||||
[ApiController]
|
||||
[Route("api/android-apk")]
|
||||
public class AndroidApkController:AdminBaseController
|
||||
{
|
||||
private readonly IAndroidApkVersionApplication _apkApp;
|
||||
public AndroidApkController(IAndroidApkVersionApplication apkApp)
|
||||
{
|
||||
_apkApp = apkApp;
|
||||
}
|
||||
|
||||
[HttpGet("check-update")]
|
||||
public async Task<IActionResult> CheckUpdate([FromQuery] ApkType type, [FromQuery] int currentVersionCode = 0)
|
||||
{
|
||||
|
||||
var info = await _apkApp.GetLatestActiveInfo(type, currentVersionCode);
|
||||
return Ok(new
|
||||
{
|
||||
latestVersionCode = info.LatestVersionCode,
|
||||
latestVersionName = info.LatestVersionName,
|
||||
shouldUpdate = info.ShouldUpdate,
|
||||
isForceUpdate = info.IsForceUpdate,
|
||||
downloadUrl = info.DownloadUrl,
|
||||
releaseNotes = info.ReleaseNotes
|
||||
});
|
||||
}
|
||||
|
||||
[HttpGet("download")]
|
||||
public async Task<IActionResult> Download([FromQuery] ApkType type)
|
||||
{
|
||||
// Check if APK exists
|
||||
if (!_apkApp.HasAndroidApkToDownload(type))
|
||||
{
|
||||
return NotFound(new { message = $"هیچ فایل APK فعالی برای {type} یافت نشد" });
|
||||
}
|
||||
|
||||
// Get the path to the latest active APK
|
||||
var path = await _apkApp.GetLatestActiveVersionPath(type);
|
||||
|
||||
if (string.IsNullOrEmpty(path) || !System.IO.File.Exists(path))
|
||||
{
|
||||
return NotFound(new { message = "فایل APK یافت نشد" });
|
||||
}
|
||||
|
||||
// Set appropriate file name for download
|
||||
var fileName = type == ApkType.WebView
|
||||
? "Gozareshgir.apk"
|
||||
: "Gozareshgir-FaceDetection.apk";
|
||||
|
||||
// Return the file for download
|
||||
return PhysicalFile(path, "application/vnd.android.package-archive", fileName);
|
||||
}
|
||||
}
|
||||
@@ -287,7 +287,7 @@
|
||||
|
||||
<div class="textsChart">
|
||||
<p class="alltxt">
|
||||
<span style="width: 40px;display: inline-block;">@Model.ContractSignToBe</span> : <span style="width: 62px;display: inline-block;">کل</span>
|
||||
<span style="width: 40px;display: inline-block;">@Model.ContrcatDone</span> : <span style="width: 62px;display: inline-block;">کل</span>
|
||||
</p>
|
||||
<p class="alldonetxt">
|
||||
<span style="width: 40px;display: inline-block;">@Model.ContractSignDone</span> : <span style="width: 62px;display: inline-block;color: #283344;">انجام شده</span>
|
||||
@@ -353,7 +353,7 @@
|
||||
|
||||
<div class="textsChart">
|
||||
<p class="alltxt">
|
||||
<span style="width: 40px;display: inline-block;">@Model.CheckoutSignToBe</span> : <span style="width: 62px;display: inline-block;">کل</span>
|
||||
<span style="width: 40px;display: inline-block;">@Model.CheckoutDone</span> : <span style="width: 62px;display: inline-block;">کل</span>
|
||||
</p>
|
||||
<p class="alldonetxt">
|
||||
<span style="width: 40px;display: inline-block;">@Model.CheckoutSignDone</span> : <span style="width: 62px;display: inline-block;color: #283344;">انجام شده</span>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using _0_Framework.Application;
|
||||
using AccountMangement.Infrastructure.EFCore;
|
||||
using CompanyManagment.App.Contracts.Report;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using CompanyManagment.App.Contracts.YearlySalary;
|
||||
@@ -43,7 +42,6 @@ public class IndexModel : PageModel
|
||||
public int ContrcatDone { get; set; }
|
||||
public int ContractSignNotDone { get; set; }
|
||||
public int ContractSignDone { get; set; }
|
||||
public int ContractSignToBe { get; set; }
|
||||
|
||||
//تصفیه
|
||||
public int AllCheckout { get; set; }
|
||||
@@ -51,9 +49,8 @@ public class IndexModel : PageModel
|
||||
public int CheckoutDone { get; set; }
|
||||
public int CheckoutSignNotDone { get; set; }
|
||||
public int CheckoutSignDone { get; set; }
|
||||
public int CheckoutSignToBe { get; set; }
|
||||
|
||||
public async Task OnGet(string year, string month)
|
||||
public async Task OnGet(string year, string month)
|
||||
{
|
||||
YearlyList = _yearlySalaryApplication.GetYears();
|
||||
var allReports = await _reportApplication.GetAllReports(year, month);
|
||||
@@ -76,23 +73,19 @@ public class IndexModel : PageModel
|
||||
ContrcatDone = allReports.ContrcatDone;
|
||||
ContractSignNotDone = allReports.ContractSignNotDone;
|
||||
ContractSignDone = allReports.ContractSignDone;
|
||||
ContractSignToBe = allReports.ContractSignToBe;
|
||||
|
||||
AllCheckout = allReports.AllCheckout;
|
||||
AllCheckout = allReports.AllCheckout;
|
||||
CheckoutNotDone = allReports.CheckoutNotDone;
|
||||
CheckoutDone = allReports.CheckoutDone;
|
||||
CheckoutSignNotDone = allReports.CheckoutSignNotDone;
|
||||
CheckoutSignDone = allReports.CheckoutSignDone;
|
||||
CheckoutSignToBe = allReports.CheckoutSignToBe;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#region workshopFirstLoad
|
||||
|
||||
public IActionResult OnGetWorkshopContractDone(string year, string month, long accountId, List<long> workshopList)
|
||||
{
|
||||
var res = _reportApplication.GetWorkshopContractDone(year, month, accountId, workshopList).GetAwaiter().GetResult();
|
||||
var res = _reportApplication.GetWorkshopContractDone(year, month, accountId, workshopList);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
@@ -103,7 +96,7 @@ public class IndexModel : PageModel
|
||||
|
||||
public IActionResult OnGetWorkshopContractSignDone(string year, string month, long accountId, List<long> workshopList)
|
||||
{
|
||||
var res = _reportApplication.GetWorkshopContractSignDone(year, month, accountId, workshopList).GetAwaiter().GetResult();
|
||||
var res = _reportApplication.GetWorkshopContractSignDone(year, month, accountId, workshopList);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
@@ -114,7 +107,7 @@ public class IndexModel : PageModel
|
||||
|
||||
public IActionResult OnGetWorkshopCheckoutDone(string year, string month, long accountId, List<long> workshopList)
|
||||
{
|
||||
var res = _reportApplication.GetWorkshopCheckoutDone(year, month, accountId, workshopList).GetAwaiter().GetResult();
|
||||
var res = _reportApplication.GetWorkshopCheckoutDone(year, month, accountId, workshopList);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
@@ -125,7 +118,7 @@ public class IndexModel : PageModel
|
||||
|
||||
public IActionResult OnGetWorkshopCheckoutSignDone(string year, string month, long accountId, List<long> workshopList)
|
||||
{
|
||||
var res = _reportApplication.GetWorkshopCheckoutSignDone(year, month, accountId, workshopList).GetAwaiter().GetResult();
|
||||
var res = _reportApplication.GetWorkshopCheckoutSignDone(year, month, accountId, workshopList);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
@@ -140,7 +133,7 @@ public class IndexModel : PageModel
|
||||
|
||||
public IActionResult OnGetEmployeeContract(string year, string month, long workshopId)
|
||||
{
|
||||
var res = _reportApplication.GetEmployeeContract(year, month, workshopId).GetAwaiter().GetResult();
|
||||
var res = _reportApplication.GetEmployeeContract(year, month, workshopId);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
@@ -150,7 +143,7 @@ public class IndexModel : PageModel
|
||||
|
||||
public IActionResult OnGetEmployeeContractSign(string year, string month, long workshopId)
|
||||
{
|
||||
var res = _reportApplication.GetEmployeeContractSign(year, month, workshopId).GetAwaiter().GetResult();
|
||||
var res = _reportApplication.GetEmployeeContractSign(year, month, workshopId);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
@@ -160,7 +153,7 @@ public class IndexModel : PageModel
|
||||
|
||||
public IActionResult OnGetEmployeeCheckout(string year, string month, long workshopId)
|
||||
{
|
||||
var res = _reportApplication.GetEmployeeCheckout(year, month, workshopId).GetAwaiter().GetResult();
|
||||
var res = _reportApplication.GetEmployeeCheckout(year, month, workshopId);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
@@ -170,7 +163,7 @@ public class IndexModel : PageModel
|
||||
|
||||
public IActionResult OnGetEmployeeCheckoutSign(string year, string month, long workshopId, long accountId)
|
||||
{
|
||||
var res = _reportApplication.GetEmployeeCheckoutSign(year, month, workshopId).GetAwaiter().GetResult();
|
||||
var res = _reportApplication.GetEmployeeCheckoutSign(year, month, workshopId);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
@@ -187,14 +180,14 @@ public class IndexModel : PageModel
|
||||
{
|
||||
|
||||
var workshopIds = Tools.ExtractNumbers(workshopList);
|
||||
var res = _reportApplication.GetPrintAllContractDone(year, month, accountId, workshopIds).GetAwaiter().GetResult();
|
||||
var res = _reportApplication.GetPrintAllContractDone(year, month, accountId, workshopIds);
|
||||
return Partial("PrintAll", res);
|
||||
}
|
||||
|
||||
public IActionResult OnGetPrintAllContractSignDone(string year, string month, long accountId, string workshopList)
|
||||
{
|
||||
var workshopIds = Tools.ExtractNumbers(workshopList);
|
||||
var res = _reportApplication.GetPrintAllContractSignDone(year, month, accountId, workshopIds).GetAwaiter().GetResult();
|
||||
var res = _reportApplication.GetPrintAllContractSignDone(year, month, accountId, workshopIds);
|
||||
return Partial("PrintAll", res);
|
||||
}
|
||||
|
||||
@@ -202,14 +195,14 @@ public class IndexModel : PageModel
|
||||
{
|
||||
var workshopIds = Tools.ExtractNumbers(workshopList);
|
||||
|
||||
var res = _reportApplication.GetPrintAllCheckoutDone(year, month, accountId, workshopIds).GetAwaiter().GetResult();
|
||||
var res = _reportApplication.GetPrintAllCheckoutDone(year, month, accountId, workshopIds);
|
||||
return Partial("PrintAll", res);
|
||||
}
|
||||
|
||||
public IActionResult OnGetPrintAllCheckoutSignDone(string year, string month, long accountId, string workshopList)
|
||||
{
|
||||
var workshopIds = Tools.ExtractNumbers(workshopList);
|
||||
var res = _reportApplication.GetPrintAllCheckoutSignDone(year, month, accountId, workshopIds).GetAwaiter().GetResult();
|
||||
var res = _reportApplication.GetPrintAllCheckoutSignDone(year, month, accountId, workshopIds);
|
||||
return Partial("PrintAll", res);
|
||||
}
|
||||
//================Employee
|
||||
@@ -218,7 +211,7 @@ public class IndexModel : PageModel
|
||||
public IActionResult OnGetPrintEmployeeContract(string year, string month, long workshopId, string accountFullName)
|
||||
{
|
||||
var workshop = _workshopApplication.GetDetails(workshopId);
|
||||
var res = _reportApplication.GetEmployeeContract(year, month, workshopId).GetAwaiter().GetResult();
|
||||
var res = _reportApplication.GetEmployeeContract(year, month, workshopId);
|
||||
var next = $"{year}/{month}/01";
|
||||
var y = Convert.ToInt32(year);
|
||||
var m = Convert.ToInt32(month);
|
||||
@@ -242,7 +235,7 @@ public class IndexModel : PageModel
|
||||
string accountFullName)
|
||||
{
|
||||
var workshop = _workshopApplication.GetDetails(workshopId);
|
||||
var res = _reportApplication.GetEmployeeContractSign(year, month, workshopId).GetAwaiter().GetResult();
|
||||
var res = _reportApplication.GetEmployeeContractSign(year, month, workshopId);
|
||||
var next = $"{year}/{month}/01";
|
||||
var y = Convert.ToInt32(year);
|
||||
var m = Convert.ToInt32(month);
|
||||
@@ -265,7 +258,7 @@ public class IndexModel : PageModel
|
||||
public IActionResult OnGetPrintEmployeeCheckout(string year, string month, long workshopId, string accountFullName)
|
||||
{
|
||||
var workshop = _workshopApplication.GetDetails(workshopId);
|
||||
var res = _reportApplication.GetEmployeeCheckout(year, month, workshopId).GetAwaiter().GetResult();
|
||||
var res = _reportApplication.GetEmployeeCheckout(year, month, workshopId);
|
||||
|
||||
var final = new PrintEmployeeNotDone
|
||||
{
|
||||
@@ -284,7 +277,7 @@ public class IndexModel : PageModel
|
||||
string accountFullName)
|
||||
{
|
||||
var workshop = _workshopApplication.GetDetails(workshopId);
|
||||
var res = _reportApplication.GetEmployeeCheckoutSign(year, month, workshopId).GetAwaiter().GetResult();
|
||||
var res = _reportApplication.GetEmployeeCheckoutSign(year, month, workshopId);
|
||||
|
||||
var final = new PrintEmployeeNotDone
|
||||
{
|
||||
|
||||
@@ -10,17 +10,7 @@
|
||||
<label asp-for="File">Choose a file:</label>
|
||||
<input asp-for="File" type="file" required>
|
||||
</div>
|
||||
<div style="margin-top:12px;">
|
||||
<label asp-for="SelectedApkType">نوع اپلیکیشن:</label>
|
||||
<select asp-for="SelectedApkType" asp-items="Html.GetEnumSelectList<CompanyManagment.App.Contracts.AndroidApkVersion.ApkType>()"></select>
|
||||
</div>
|
||||
<div style="margin-top:12px;">
|
||||
<label asp-for="IsForce">
|
||||
<input asp-for="IsForce" type="checkbox">
|
||||
آپدیت اجباری (Force Update)
|
||||
</label>
|
||||
</div>
|
||||
<button type="submit" style="margin-top:12px;">Upload</button>
|
||||
<button type="submit">Upload</button>
|
||||
</form>
|
||||
|
||||
<form asp-page-handler="ShiftDate" id="8" method="post">
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
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.RewardAgg;
|
||||
@@ -19,14 +18,9 @@ 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 static ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk.IndexModel2;
|
||||
|
||||
namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
@@ -40,28 +34,21 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
private readonly AccountContext _accountContext;
|
||||
private readonly IPaymentGateway _paymentGateway;
|
||||
private readonly ITemporaryClientRegistrationApplication _clientRegistrationApplication;
|
||||
private readonly IHttpClientFactory _httpClientFactory;
|
||||
private readonly IOnlinePayment _onlinePayment;
|
||||
|
||||
|
||||
|
||||
[BindProperty] public IFormFile File { 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)
|
||||
ITemporaryClientRegistrationApplication clientRegistrationApplication)
|
||||
{
|
||||
_application = application;
|
||||
_rollCallDomainService = rollCallDomainService;
|
||||
_context = context;
|
||||
_accountContext = accountContext;
|
||||
_httpClientFactory = httpClientFactory;
|
||||
_clientRegistrationApplication = clientRegistrationApplication;
|
||||
_onlinePayment = onlinePayment;
|
||||
_paymentGateway = new SepehrPaymentGateway(httpClientFactory);
|
||||
_paymentGateway = new AqayePardakhtPaymentGateway(httpClientFactory, appSetting);
|
||||
}
|
||||
|
||||
public void OnGet()
|
||||
@@ -70,13 +57,13 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
|
||||
public async Task<IActionResult> OnPostUpload()
|
||||
{
|
||||
var result = await _application.CreateAndActive(File, SelectedApkType, IsForce);
|
||||
var result = await _application.CreateAndActive(File);
|
||||
ViewData["message"] = result.Message;
|
||||
return Page();
|
||||
}
|
||||
|
||||
|
||||
public async Task<IActionResult> OnPostShiftDate()
|
||||
public IActionResult OnPostShiftDate()
|
||||
{
|
||||
//var startRollCall = new DateTime(2025, 2, 19);
|
||||
//var rollCalls = _context.RollCalls.Where(x => x.ShiftDate >= startRollCall);
|
||||
@@ -86,116 +73,10 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
//var notEndedRollCalls = rollCalls.Where(x => x.EndDate == null).ToList();
|
||||
//RefactorAllTheRollCallsOnEsfand(endedRollCalls, notEndedRollCalls);
|
||||
//CreateRewardForKebabMahdi().GetAwaiter().GetResult();
|
||||
|
||||
var callBack = Url.Action("Verify", "General", null, Request.Scheme);
|
||||
|
||||
|
||||
var amount = 10000;
|
||||
var transaction = new PaymentTransaction(30427, amount, "سید حسن مصباح", "https://client.gozareshgir.ir", PaymentTransactionGateWay.SepehrPay);
|
||||
|
||||
_context.PaymentTransactions.Add(transaction);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
var command = new CreatePaymentGatewayRequest()
|
||||
{
|
||||
InvoiceId = transaction.id.ToString(),
|
||||
Amount = amount,
|
||||
CallBackUrl = callBack
|
||||
};
|
||||
|
||||
var createRes = await _paymentGateway.Create(command);
|
||||
|
||||
if (createRes.IsSuccess)
|
||||
{
|
||||
var payUrl = _paymentGateway.GetStartPayUrl(createRes.Token);
|
||||
return Redirect(payUrl);
|
||||
}
|
||||
else
|
||||
{
|
||||
return BadRequest(createRes.Status + "خطا در ارسال به درگاه پرداخت");
|
||||
}
|
||||
}
|
||||
|
||||
private async System.Threading.Tasks.Task CreateDadmehrWorkshopFaceEmbedding()
|
||||
{
|
||||
var basePath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "faces");
|
||||
|
||||
if (!Directory.Exists(basePath))
|
||||
{
|
||||
ViewData["message"] = "مسیر پوشه یافت نشد";
|
||||
return;
|
||||
}
|
||||
|
||||
var directories = Directory.GetDirectories(basePath);
|
||||
|
||||
var client = new HttpClient();
|
||||
|
||||
foreach (var mainDirectory in directories)
|
||||
{
|
||||
var subDirectories = Directory.GetDirectories(mainDirectory);
|
||||
var workshopName = Path.GetFileName(mainDirectory);
|
||||
foreach (var directory in subDirectories)
|
||||
{
|
||||
var directoryName = Path.GetFileName(directory);
|
||||
|
||||
var employee = await _context.Employees
|
||||
.FirstOrDefaultAsync(x => x.id == Convert.ToInt64(directoryName));
|
||||
var fullname = employee != null ? employee.FullName : "نامشخص";
|
||||
|
||||
var imageFiles = Directory.GetFiles(directory, "*.*")
|
||||
.Take(2)
|
||||
.ToArray();
|
||||
|
||||
if (imageFiles.Length < 2)
|
||||
{
|
||||
Console.WriteLine($"تعداد تصاویر کافی برای {directoryName} وجود ندارد");
|
||||
continue;
|
||||
}
|
||||
|
||||
using var formData = new MultipartFormDataContent();
|
||||
formData.Add(new StringContent(directoryName), "employee_id");
|
||||
formData.Add(new StringContent(workshopName), "workshop_id");
|
||||
formData.Add(new StringContent(fullname), "employee_full_name");
|
||||
|
||||
FileStream file1Stream = null;
|
||||
FileStream file2Stream = null;
|
||||
|
||||
try
|
||||
{
|
||||
// ارسال فایل اول
|
||||
file1Stream = new FileStream(imageFiles[0], FileMode.Open, FileAccess.Read);
|
||||
var file1Content = new StreamContent(file1Stream);
|
||||
file1Content.Headers.ContentType =
|
||||
new System.Net.Http.Headers.MediaTypeHeaderValue("image/jpeg");
|
||||
formData.Add(file1Content, "picture1", Path.GetFileName(imageFiles[0]));
|
||||
|
||||
// ارسال فایل دوم
|
||||
file2Stream = new FileStream(imageFiles[1], FileMode.Open, FileAccess.Read);
|
||||
var file2Content = new StreamContent(file2Stream);
|
||||
file2Content.Headers.ContentType =
|
||||
new System.Net.Http.Headers.MediaTypeHeaderValue("image/jpeg");
|
||||
formData.Add(file2Content, "picture2", Path.GetFileName(imageFiles[1]));
|
||||
|
||||
var response = await client.PostAsync("http://127.0.0.1:8000/embeddings", formData);
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
var result = await response.Content.ReadAsStringAsync();
|
||||
Console.WriteLine($"✓ {directoryName}: {result}");
|
||||
}
|
||||
else
|
||||
{
|
||||
var error = await response.Content.ReadAsStringAsync();
|
||||
Console.WriteLine($"✗ {directoryName}: {response.StatusCode} - {error}");
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
file1Stream?.Dispose();
|
||||
file2Stream?.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
SetEntityIdForCheckoutValues();
|
||||
SetEntityIdForCheckoutValuesTemp();
|
||||
ViewData["message"] = "ایجاد شد";
|
||||
return Page();
|
||||
}
|
||||
|
||||
public IActionResult OnPostShiftDateNew()
|
||||
@@ -247,7 +128,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
|
||||
if (createResponse.Status == "success")
|
||||
{
|
||||
return Redirect(_paymentGateway.GetStartPayUrl(createResponse.Token));
|
||||
return Redirect(_paymentGateway.GetStartPayUrl(createResponse.TransactionId));
|
||||
}
|
||||
|
||||
//TranslateCode(result?.ErrorCode);
|
||||
@@ -814,7 +695,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
//TODO: set data for institution price
|
||||
var workshops = item.contractingParty.Employers
|
||||
.SelectMany(e => e.WorkshopEmployers.Select(we => we.Workshop)).ToList()
|
||||
.DistinctBy(x => x.id).ToList();
|
||||
.DistinctBy(x=>x.id).ToList();
|
||||
|
||||
var initialWorkshop = workshops
|
||||
.Select(w =>
|
||||
@@ -869,56 +750,56 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
|
||||
//var oneMonthSum = current.Sum(x => x.Price);
|
||||
item.contract.SetWorkshopGroup(group);
|
||||
// var totalPaymentAndWorkshopList = await _clientRegistrationApplication.GetTotalPaymentAndWorkshopList(oneMonthSum,duration: InstitutionContractDuration.TwelveMonths,false);
|
||||
// item.contract.SetAmount(totalPaymentAndWorkshopList.OneTimeTotalPaymentStr.MoneyToDouble(),
|
||||
// totalPaymentAndWorkshopList.OneTimeValueAddedTaxStr.MoneyToDouble(),totalPaymentAndWorkshopList.DiscountedAmountForOneMonth.MoneyToDouble());
|
||||
// var totalPaymentAndWorkshopList = await _clientRegistrationApplication.GetTotalPaymentAndWorkshopList(oneMonthSum,duration: InstitutionContractDuration.TwelveMonths,false);
|
||||
// item.contract.SetAmount(totalPaymentAndWorkshopList.OneTimeTotalPaymentStr.MoneyToDouble(),
|
||||
// totalPaymentAndWorkshopList.OneTimeValueAddedTaxStr.MoneyToDouble(),totalPaymentAndWorkshopList.DiscountedAmountForOneMonth.MoneyToDouble());
|
||||
}
|
||||
|
||||
var remoteIds = remoteContractsQuery.Select(x => x.contract.id);
|
||||
var inPersonContracts = await query
|
||||
.Where(x => !remoteIds.Contains(x.contractingParty.id)).ToListAsync();
|
||||
var inPersonContracts =await query
|
||||
.Where(x=>!remoteIds.Contains(x.contractingParty.id)).ToListAsync();
|
||||
foreach (var item in inPersonContracts)
|
||||
{
|
||||
var workshops = item.contractingParty.Employers
|
||||
.SelectMany(e => e.WorkshopEmployers.Select(we => we.Workshop)).ToList()
|
||||
.DistinctBy(x => x.id).ToList();
|
||||
.DistinctBy(x=>x.id).ToList();
|
||||
|
||||
var initialWorkshop = workshops
|
||||
.Select(w =>
|
||||
{
|
||||
var personnelCount =
|
||||
w.LeftWorks.Count(lw => lw.StartWorkDate <= today && lw.LeftWorkDate >= today);
|
||||
|
||||
|
||||
bool hasRollCallPlan = true;
|
||||
bool hasRollCallPlanInPerson = false;
|
||||
bool hasCustomizeCheckoutPlan = w.id == 170;
|
||||
bool hasContractPlan = true;
|
||||
bool hasContractPlanInPerson = true;
|
||||
bool hasInsurancePlan = true;
|
||||
bool hasInsurancePlan =true;
|
||||
bool hasInsurancePlanInPerson = true;
|
||||
|
||||
var initial = InstitutionContractWorkshopInitial.CreateManual(w.WorkshopFullName,
|
||||
hasRollCallPlan,
|
||||
hasRollCallPlanInPerson, hasCustomizeCheckoutPlan,
|
||||
hasContractPlan, hasContractPlanInPerson,
|
||||
hasInsurancePlan, hasInsurancePlanInPerson, personnelCount, 0,
|
||||
|
||||
var initial = InstitutionContractWorkshopInitial.CreateManual(w.WorkshopFullName, hasRollCallPlan,
|
||||
hasRollCallPlanInPerson,hasCustomizeCheckoutPlan,
|
||||
hasContractPlan,hasContractPlanInPerson,
|
||||
hasInsurancePlan,hasInsurancePlanInPerson,personnelCount,0,
|
||||
w.id, w.WorkshopEmployers.Select(x => x.EmployerId
|
||||
).ToList());
|
||||
return initial;
|
||||
}).ToList();
|
||||
|
||||
var group = new InstitutionContractWorkshopGroup(item.contract.id, initialWorkshop);
|
||||
|
||||
|
||||
await _context.AddAsync(group);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
|
||||
initialWorkshop.ForEach(x =>
|
||||
{
|
||||
var workshopId = workshops.First(w => x.WorkshopId.Value == w.id).id;
|
||||
x.SetWorkshopId(workshopId);
|
||||
});
|
||||
|
||||
|
||||
item.contract.SetWorkshopGroup(group);
|
||||
|
||||
}
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
@@ -1,352 +0,0 @@
|
||||
using ServiceHost.BaseControllers;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Exceptions;
|
||||
using AccountManagement.Application.Contracts.Account;
|
||||
using AccountManagement.Application.Contracts.CameraAccount;
|
||||
using AccountManagement.Domain.TaskAgg;
|
||||
using CompanyManagment.App.Contracts.AndroidApkVersion;
|
||||
using CompanyManagment.App.Contracts.PersonnleCode;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using CompanyManagment.App.Contracts.RollCallEmployee;
|
||||
using CompanyManagment.App.Contracts.RollCallService;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.EmployeeFaceEmbedding;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
|
||||
namespace ServiceHost.Areas.Camera.Controllers;
|
||||
|
||||
public class CameraController : CameraBaseController
|
||||
{
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
private readonly IConfiguration _configuration;
|
||||
private readonly IEmployeeApplication _employeeApplication;
|
||||
private readonly IRollCallApplication _rollCallApplication;
|
||||
private readonly IRollCallServiceApplication _rollCallServiceApplication;
|
||||
private readonly IRollCallEmployeeApplication _rollCallEmployeeApplication;
|
||||
private readonly IAuthHelper _authHelper;
|
||||
private readonly IPersonnelCodeApplication _personnelCodeApplication;
|
||||
private readonly IAccountApplication _accountApplication;
|
||||
private readonly IPasswordHasher _passwordHasher;
|
||||
private readonly ICameraAccountApplication _cameraAccountApplication;
|
||||
private readonly IEmployeeFaceEmbeddingApplication _employeeFaceEmbeddingApplication;
|
||||
private long _workshopId;
|
||||
private readonly IHttpClientFactory _httpClientFactory;
|
||||
private readonly HttpClient _faceEmbeddingHttpClient;
|
||||
private readonly IAndroidApkVersionApplication _androidApkVersionApplication;
|
||||
|
||||
public CameraController(IWebHostEnvironment webHostEnvironment,
|
||||
IConfiguration configuration,
|
||||
IEmployeeApplication employeeApplication,
|
||||
IRollCallApplication rollCallApplication,
|
||||
IAuthHelper authHelper,
|
||||
IRollCallServiceApplication rollCallServiceApplication,
|
||||
IRollCallEmployeeApplication rollCallEmployeeApplication,
|
||||
IPersonnelCodeApplication personnelCodeApplication,
|
||||
IAccountApplication accountApplication,
|
||||
IPasswordHasher passwordHasher,
|
||||
ICameraAccountApplication cameraAccountApplication,
|
||||
IEmployeeFaceEmbeddingApplication employeeFaceEmbeddingApplication, IHttpClientFactory httpClientFactory, IAndroidApkVersionApplication androidApkVersionApplication)
|
||||
{
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
_configuration = configuration;
|
||||
_employeeApplication = employeeApplication;
|
||||
_rollCallApplication = rollCallApplication;
|
||||
_authHelper = authHelper;
|
||||
_rollCallServiceApplication = rollCallServiceApplication;
|
||||
_rollCallEmployeeApplication = rollCallEmployeeApplication;
|
||||
_personnelCodeApplication = personnelCodeApplication;
|
||||
_accountApplication = accountApplication;
|
||||
_passwordHasher = passwordHasher;
|
||||
_cameraAccountApplication = cameraAccountApplication;
|
||||
_employeeFaceEmbeddingApplication = employeeFaceEmbeddingApplication;
|
||||
_httpClientFactory = httpClientFactory;
|
||||
_androidApkVersionApplication = androidApkVersionApplication;
|
||||
_faceEmbeddingHttpClient = httpClientFactory.CreateClient();
|
||||
_faceEmbeddingHttpClient.BaseAddress = new Uri("http://localhost:8000/");
|
||||
_workshopId= authHelper.GetWorkshopId();
|
||||
|
||||
}
|
||||
|
||||
[HttpPost("login")]
|
||||
[AllowAnonymous]
|
||||
public IActionResult CameraLogin([FromBody] CameraLoginRequest request)
|
||||
{
|
||||
_accountApplication.CameraLogin(request);
|
||||
return Ok();
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("embedding")]
|
||||
[AllowAnonymous]
|
||||
public async Task<ActionResult<List<EmployeeFaceEmbeddingDto>>> WorkshopEmbedding()
|
||||
{
|
||||
if (!User.Identity?.IsAuthenticated ?? false)
|
||||
{
|
||||
return Unauthorized();
|
||||
}
|
||||
_workshopId = _authHelper.GetWorkshopId();
|
||||
var data = await _employeeFaceEmbeddingApplication
|
||||
.GetByWorkshopIdsAsync([_workshopId]);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
[HttpPost("flag/{employeeId:long}")]
|
||||
public async Task<IActionResult> GetFlag(long employeeId)
|
||||
{
|
||||
var flagId = _rollCallApplication.Flag(employeeId, _workshopId);
|
||||
return Ok(new
|
||||
{
|
||||
flagId = flagId,
|
||||
status = flagId == 0 ? "enter": "exit"
|
||||
});
|
||||
}
|
||||
|
||||
[HttpPost("exit")]
|
||||
public IActionResult Exit([FromBody]RollCallExitRequest request)
|
||||
{
|
||||
var employeeId = request.EmployeeId;
|
||||
var flagId = request.FlagId;
|
||||
bool rollCallEmployee = _rollCallEmployeeApplication.IsEmployeeRollCallActive(employeeId,
|
||||
_workshopId);
|
||||
|
||||
if (!rollCallEmployee)
|
||||
{
|
||||
throw new BadRequestException("پرسنل مورد نظر غیر فعال است");
|
||||
}
|
||||
|
||||
_faceEmbeddingHttpClient.PostAsync("embeddings/refine",
|
||||
JsonContent.Create(new {
|
||||
employeeId,
|
||||
workshopId = _workshopId,
|
||||
embedding =request.Embeddings ,
|
||||
confidence =request.Confidence ,
|
||||
metadata =new{},
|
||||
|
||||
}));
|
||||
|
||||
|
||||
|
||||
var repeatStatus = _rollCallApplication.CheckRepeat(employeeId, _workshopId);
|
||||
switch (repeatStatus)
|
||||
{
|
||||
case "IncomRegistred-InvalidOut":
|
||||
throw new BadRequestException("شما به تازگی ثبت ورود نموده اید ,تا 2 دقیقه نمی توانید ثبت خروج نمایید");
|
||||
|
||||
case "outRegistred-InvalidIncom":
|
||||
throw new BadRequestException("شما به تازگی ثبت خروج نموده اید تا 2 دقیقه نمی توانید ثبت ورود نمایید");
|
||||
|
||||
}
|
||||
|
||||
var res = _rollCallApplication.Edit(flagId);
|
||||
|
||||
if (res.IsSuccedded)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccess = true,
|
||||
});
|
||||
}
|
||||
|
||||
throw new BadRequestException(res.Message);
|
||||
}
|
||||
|
||||
[HttpPost("enter")]
|
||||
public IActionResult Enter([FromBody]RollCallEnterRequest request)
|
||||
{
|
||||
var employeeId = request.EmployeeId;
|
||||
var now = DateTime.Now;
|
||||
var command = new CreateRollCall()
|
||||
{
|
||||
WorkshopId = _workshopId,
|
||||
EmployeeId = request.EmployeeId,
|
||||
StartDate = now,
|
||||
};
|
||||
bool rollCallEmployee = _rollCallEmployeeApplication.IsEmployeeRollCallActive(employeeId,
|
||||
_workshopId);
|
||||
|
||||
if (!rollCallEmployee)
|
||||
{
|
||||
throw new BadRequestException("پرسنل مورد نظر غیر فعال است");
|
||||
}
|
||||
|
||||
_faceEmbeddingHttpClient.PostAsync("embeddings/refine",
|
||||
JsonContent.Create(new {
|
||||
employeeId,
|
||||
workshopId = _workshopId,
|
||||
embedding =request.Embeddings ,
|
||||
confidence =request.Confidence ,
|
||||
metadata =new{},
|
||||
|
||||
|
||||
}));
|
||||
|
||||
|
||||
|
||||
var repeatStatus = _rollCallApplication.CheckRepeat(employeeId, _workshopId);
|
||||
switch (repeatStatus)
|
||||
{
|
||||
case "IncomRegistred-InvalidOut":
|
||||
throw new BadRequestException("شما به تازگی ثبت ورود نموده اید ,تا 2 دقیقه نمی توانید ثبت خروج نمایید");
|
||||
|
||||
case "outRegistred-InvalidIncom":
|
||||
throw new BadRequestException("شما به تازگی ثبت خروج نموده اید تا 2 دقیقه نمی توانید ثبت ورود نمایید");
|
||||
|
||||
}
|
||||
|
||||
|
||||
var res = _rollCallApplication.Create(command);
|
||||
if (res.IsSuccedded)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccess = true,
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccess = false,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpGet("check-update")]
|
||||
public async Task<IActionResult> CheckUpdate([FromQuery] ApkType type, [FromQuery] int currentVersionCode = 0)
|
||||
{
|
||||
|
||||
var info = await _androidApkVersionApplication.GetLatestActiveInfo(type, currentVersionCode);
|
||||
return Ok(new
|
||||
{
|
||||
latestVersionCode = 6000,
|
||||
latestVersionName = "2.0.0",
|
||||
shouldUpdate = info.ShouldUpdate,
|
||||
isForceUpdate = info.IsForceUpdate,
|
||||
downloadUrl = info.DownloadUrl,
|
||||
releaseNotes = info.ReleaseNotes
|
||||
});
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpGet("download")]
|
||||
public async Task<IActionResult> Download([FromQuery] ApkType type)
|
||||
{
|
||||
// Check if APK exists
|
||||
if (!_androidApkVersionApplication.HasAndroidApkToDownload(type))
|
||||
{
|
||||
return NotFound(new { message = $"هیچ فایل APK فعالی برای {type} یافت نشد" });
|
||||
}
|
||||
|
||||
// Get the path to the latest active APK
|
||||
var path = await _androidApkVersionApplication.GetLatestActiveVersionPath(type);
|
||||
|
||||
if (string.IsNullOrEmpty(path) || !System.IO.File.Exists(path))
|
||||
{
|
||||
return NotFound(new { message = "فایل APK یافت نشد" });
|
||||
}
|
||||
|
||||
// Set appropriate file name for download
|
||||
var fileName = type == ApkType.WebView
|
||||
? "Gozareshgir.apk"
|
||||
: "Gozareshgir-FaceDetection.apk";
|
||||
|
||||
// Return the file for download
|
||||
return PhysicalFile(path, "application/vnd.android.package-archive", fileName);
|
||||
}
|
||||
|
||||
|
||||
[HttpGet("SendPersonelCodeToGetEmployeeId")]
|
||||
public IActionResult SendPersonelCodeToGetEmployeeId(long personelCode, long workshopId)
|
||||
{
|
||||
long employeeId = _personnelCodeApplication.GetEmployeeIdByPersonelCode(personelCode, workshopId);
|
||||
|
||||
if (employeeId == 0)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccess = false,
|
||||
message = "کد پرسنلی یافت نشد",
|
||||
});
|
||||
}
|
||||
|
||||
bool rollcallEmployee = _rollCallEmployeeApplication.IsEmployeeRollCallActive(employeeId, workshopId);
|
||||
if (!rollcallEmployee)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccess = false,
|
||||
message = "پرسنل مورد نظر غیر فعال است",
|
||||
});
|
||||
}
|
||||
|
||||
var repeatStatus = _rollCallApplication.CheckRepeat(employeeId, workshopId);
|
||||
switch (repeatStatus)
|
||||
{
|
||||
case "IncomRegistred-InvalidOut":
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccess = false,
|
||||
message = "شما به تازگی ثبت ورود نموده اید ,تا 2 دقیقه نمی توانید ثبت خروج نمایید",
|
||||
});
|
||||
case "outRegistred-InvalidIncom":
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccess = false,
|
||||
message = "شما به تازگی ثبت خروج نموده اید تا 2 دقیقه نمی توانید ثبت ورود نمایید",
|
||||
});
|
||||
}
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccess = true,
|
||||
message = "",
|
||||
personId = $"{employeeId}",
|
||||
});
|
||||
}
|
||||
|
||||
[HttpGet("EmployeeFlag")]
|
||||
public IActionResult EmployeeFlag(long employeeId, long workshopId)
|
||||
{
|
||||
var employee = _rollCallEmployeeApplication.GetByEmployeeIdAndWorkshopId(employeeId, workshopId);
|
||||
var employeeFullName = employee?.EmployeeFullName ?? string.Empty;
|
||||
var flagId = _rollCallApplication.Flag(employeeId, workshopId);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
employeeName = employeeFullName,
|
||||
flag = flagId
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
[HttpGet("Logout")]
|
||||
public IActionResult Logout()
|
||||
{
|
||||
_accountApplication.Logout();
|
||||
return new JsonResult(new { isSuccess = true });
|
||||
}
|
||||
}
|
||||
|
||||
public class RollCallExitRequest:RollCallEnterRequest
|
||||
{
|
||||
public long FlagId { get; set; }
|
||||
}
|
||||
public class RollCallEnterRequest
|
||||
{
|
||||
public long EmployeeId { get; set; }
|
||||
public List<double> Embeddings { get; set; }
|
||||
public float Confidence { get; set; }
|
||||
}
|
||||
|
||||
public class CameraFlagRequest
|
||||
{
|
||||
public long EmployeeId { get; set; }
|
||||
public long WorkshopId { get; set; }
|
||||
}
|
||||
@@ -93,8 +93,8 @@ public class FinancialController : ClientBaseController
|
||||
|
||||
if (gatewayResponse.IsSuccess)
|
||||
{
|
||||
_ = await _paymentTransactionApplication.SetTransactionId(transaction.SendId, gatewayResponse.Token);
|
||||
return Redirect(_paymentGateway.GetStartPayUrl(gatewayResponse.Token));
|
||||
_ = await _paymentTransactionApplication.SetTransactionId(transaction.SendId, gatewayResponse.TransactionId);
|
||||
return Redirect(_paymentGateway.GetStartPayUrl(gatewayResponse.TransactionId));
|
||||
}
|
||||
|
||||
if (gatewayResponse.ErrorCode.HasValue)
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
Layout = "Shared/_ClientLayout";
|
||||
ViewData["Title"] = " - " + "فیش حقوقی";
|
||||
int i = 0;
|
||||
|
||||
const string hasAmountConflictText = "توجه داشته باشید این فیش حقوقی دارای تغییرات اعمال نشده میباشد. جهت صدور فیش حقوقی استاندارد مجددا فیش را ایجاد کنید!";
|
||||
const string needUpdateText = "جهت صدور فیش حقوقی استاندارد مجددا فیش را ایجاد کنید";
|
||||
}
|
||||
|
||||
@section Styles {
|
||||
@@ -338,7 +335,7 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="Rtable-cell column-heading d-none d-lg-block width11"> </div>
|
||||
<div class="Rtable-cell column-heading d-none d-lg-block width2">شماره پرسنلی</div>
|
||||
<div class="Rtable-cell column-heading d-none d-lg-block width2" >شماره پرسنلی</div>
|
||||
<div class="Rtable-cell column-heading d-none d-md-block width3">سال</div>
|
||||
<div class="Rtable-cell column-heading d-none d-md-block width4">ماه</div>
|
||||
<div class="Rtable-cell column-heading d-none d-md-block width5">شماره قرارداد</div>
|
||||
@@ -367,10 +364,7 @@
|
||||
<div class="Rtable-cell d-lg-block d-none width11">
|
||||
<div class="Rtable-cell--heading"> </div>
|
||||
<div class="Rtable-cell--content">
|
||||
|
||||
|
||||
|
||||
@if (item.IsUpdateNeeded || item.HasAmountConflict)
|
||||
@if (item.HasAmountConflict)
|
||||
{
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" fill="red"
|
||||
@@ -379,30 +373,11 @@
|
||||
style="cursor: pointer; margin-left: 10px;"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title='@{
|
||||
var tooltipText = ""; int messCounter = 1;
|
||||
if (item.HasAmountConflict && !item.IsUpdateNeeded)
|
||||
{
|
||||
tooltipText += @hasAmountConflictText;
|
||||
|
||||
}else if (item.HasAmountConflict && item.IsUpdateNeeded)
|
||||
{
|
||||
foreach (var warning in item.CheckoutWarningMessageList) { tooltipText += " " + messCounter + " - " + warning.WarningMessage; messCounter++;}
|
||||
|
||||
|
||||
tooltipText += " " + @needUpdateText; }
|
||||
else if (!item.HasAmountConflict && item.IsUpdateNeeded)
|
||||
{ foreach (var warning in item.CheckoutWarningMessageList) { tooltipText += " " + messCounter + " - " + warning.WarningMessage; messCounter++; }
|
||||
tooltipText += " " + @needUpdateText;}
|
||||
@Html.Raw(tooltipText)
|
||||
|
||||
}'>
|
||||
<path d="M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14zm0 1A8 8 0 1 1 8 0a8 8 0 0 1 0 16z" />
|
||||
<path d="M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0zm.1-5.995a.905.905 0 0 1 1.8 0l-.35 3.5a.552.552 0 0 1-1.1 0l-.35-3.5z" />
|
||||
title="توجه داشته باشید این فیش حقوقی دارای تغییرات اعمال نشده میباشد. جهت صدور فیش حقوقی استاندارد مجددا فیش را ایجاد کنید!">
|
||||
<path d="M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14zm0 1A8 8 0 1 1 8 0a8 8 0 0 1 0 16z"/>
|
||||
<path d="M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0zm.1-5.995a.905.905 0 0 1 1.8 0l-.35 3.5a.552.552 0 0 1-1.1 0l-.35-3.5z"/>
|
||||
</svg>
|
||||
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="Rtable-cell d-lg-block d-none width2">
|
||||
|
||||
@@ -65,7 +65,6 @@ namespace ServiceHost.Areas.Client.Pages
|
||||
#region Mahan
|
||||
public bool HasInsuranceToConfirm { get; set; }
|
||||
public bool HasApkToDownload { get; set; }
|
||||
public bool HasFaceDetectionApkToDownload { get; set; }
|
||||
|
||||
#endregion
|
||||
public IndexModel(IAuthHelper authHelper, IPasswordHasher passwordHasher, IWorkshopApplication workshopApplication, ILeaveApplication leaveApplication, IEmployeeApplication employeeApplication, IPaymentToEmployeeItemApplication paymentToEmployeeItemApplication, IPaymentToEmployeeApplication paymentToEmployeeApplication, IHolidayItemApplication holidayItemApplication, IInsuranceListApplication insuranceListApplication, IAndroidApkVersionApplication androidApkVersionApplication, IRollCallServiceApplication rollCallServiceApplication, IPersonnelCodeApplication personnelCodeApplication, ICustomizeWorkshopSettingsApplication customizeWorkshopSettingsApplication, IBankApplication bankApplication, ILeftWorkTempApplication leftWorkTempApplication, IJobApplication jobApplication, ICustomizeWorkshopSettingsApplication customizeWorkshopEmployee, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, ICameraAccountApplication cameraAccountApplication)
|
||||
@@ -101,8 +100,7 @@ namespace ServiceHost.Areas.Client.Pages
|
||||
profilePicture = account.ProfilePhoto;
|
||||
AccountFullName = account.Fullname;
|
||||
var todayGr = DateTime.Now;
|
||||
HasApkToDownload = _androidApkVersionApplication.HasAndroidApkToDownload(ApkType.WebView);
|
||||
HasFaceDetectionApkToDownload = _androidApkVersionApplication.HasAndroidApkToDownload(ApkType.FaceDetection);
|
||||
HasApkToDownload = _androidApkVersionApplication.HasAndroidApkToDownload();
|
||||
|
||||
|
||||
#region Mahan
|
||||
|
||||
@@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
namespace ServiceHost.BaseControllers;
|
||||
|
||||
|
||||
[ApiExplorerSettings(GroupName = "Camera")]
|
||||
//[ApiExplorerSettings(GroupName = "Camera")]
|
||||
[Authorize(Policy = "CameraArea")]
|
||||
[Area("Camera")]
|
||||
[Route("api/[area]/[controller]")]
|
||||
|
||||
@@ -1,24 +1,14 @@
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.PaymentGateway;
|
||||
using Company.Domain.BankAgg;
|
||||
using Company.Domain.PaymentTransactionAgg;
|
||||
using CompanyManagment.App.Contracts.FinancialStatment;
|
||||
using CompanyManagment.App.Contracts.FinancilTransaction;
|
||||
using CompanyManagment.App.Contracts.PaymentTransaction;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using CompanyManagment.EFCore.Migrations;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Newtonsoft.Json;
|
||||
using NuGet.Protocol;
|
||||
using Parbad;
|
||||
using ServiceHost.BaseControllers;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Globalization;
|
||||
using System.Net.Http;
|
||||
using System.Security.Cryptography;
|
||||
using System.Threading;
|
||||
using _0_Framework.Application.PaymentGateway;
|
||||
using Microsoft.Extensions.Options;
|
||||
using CompanyManagment.App.Contracts.FinancialStatment;
|
||||
using CompanyManagment.App.Contracts.FinancilTransaction;
|
||||
|
||||
namespace ServiceHost.Controllers;
|
||||
|
||||
@@ -28,14 +18,12 @@ public class GeneralController : GeneralBaseController
|
||||
private readonly IPaymentTransactionApplication _paymentTransactionApplication;
|
||||
private readonly IPaymentGateway _paymentGateway;
|
||||
private readonly IFinancialStatmentApplication _financialStatmentApplication;
|
||||
private readonly IOnlinePayment _onlinePayment;
|
||||
|
||||
public GeneralController(IPaymentTransactionApplication paymentTransactionApplication,IHttpClientFactory clientFactory, IFinancialStatmentApplication financialStatmentApplication, IOptions<AppSettingConfiguration> appSetting, IOnlinePayment onlinePayment)
|
||||
public GeneralController(IPaymentTransactionApplication paymentTransactionApplication,IHttpClientFactory clientFactory, IFinancialStatmentApplication financialStatmentApplication, IOptions<AppSettingConfiguration> appSetting)
|
||||
{
|
||||
_paymentTransactionApplication = paymentTransactionApplication;
|
||||
_paymentGateway = new SepehrPaymentGateway(clientFactory);
|
||||
_paymentGateway = new AqayePardakhtPaymentGateway(clientFactory, appSetting);
|
||||
_financialStatmentApplication = financialStatmentApplication;
|
||||
_onlinePayment = onlinePayment;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -59,103 +47,7 @@ public class GeneralController : GeneralBaseController
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
[HttpGet("/api/callback"), HttpPost("/api/callback")]
|
||||
public async Task<IActionResult> Verify(SepehrGatewayPayResponse payResponse)
|
||||
{
|
||||
if (!long.TryParse(payResponse.invoiceid, out var paymentTransactionId))
|
||||
{
|
||||
return BadRequest("Invalid invoice_id");
|
||||
}
|
||||
|
||||
var transaction = await _paymentTransactionApplication.GetDetails(paymentTransactionId);
|
||||
|
||||
if (transaction == null)
|
||||
{
|
||||
return NotFound("Transaction not found");
|
||||
}
|
||||
|
||||
if (transaction.Status != PaymentTransactionStatus.Pending)
|
||||
{
|
||||
return BadRequest("این تراکنش قبلا پرداخت شده است");
|
||||
}
|
||||
|
||||
|
||||
if (payResponse.respcode != 0)
|
||||
{
|
||||
return await HandleFailedTransaction(transaction);
|
||||
}
|
||||
|
||||
var verifyCommand = new VerifyPaymentGateWayRequest()
|
||||
{
|
||||
Amount = transaction.Amount,
|
||||
TransactionId = payResponse.invoiceid,
|
||||
DigitalReceipt = payResponse.digitalreceipt
|
||||
};
|
||||
var verifyRes = await _paymentGateway.Verify(verifyCommand, CancellationToken.None);
|
||||
|
||||
|
||||
|
||||
|
||||
if (verifyRes.IsSuccess)
|
||||
{
|
||||
var command = new CreateFinancialStatment()
|
||||
{
|
||||
ContractingPartyId = transaction.ContractingPartyId,
|
||||
Deptor = 0,
|
||||
Creditor = transaction.Amount,
|
||||
DeptorString = "0",
|
||||
TypeOfTransaction = "credit",
|
||||
DescriptionOption = "بابت قرارداد مابین (روابط کار)",
|
||||
Description = "درگاه بانکی",
|
||||
|
||||
};
|
||||
var statementResult = _financialStatmentApplication.CreateFromBankGateway(command);
|
||||
if (!statementResult.IsSuccedded)
|
||||
{
|
||||
return new JsonResult(statementResult);
|
||||
}
|
||||
|
||||
var setSuccessResult = _paymentTransactionApplication.SetSuccess(paymentTransactionId, payResponse.cardnumber, payResponse.issuerbank, payResponse.rrn.ToString(), payResponse.digitalreceipt);
|
||||
|
||||
if (!setSuccessResult.IsSuccedded)
|
||||
{
|
||||
return await HandleFailedTransaction(transaction);
|
||||
}
|
||||
return Redirect(BuildCallbackUrl(transaction.CallBackUrl, true, transaction.Id));
|
||||
}
|
||||
|
||||
// در غیر این صورت تراکنش ناموفق است
|
||||
return await HandleFailedTransaction(transaction);
|
||||
|
||||
|
||||
//var data = JsonConvert.SerializeObject(invoice.AdditionalData);
|
||||
//var statics =
|
||||
//JsonConvert.SerializeObject(res);
|
||||
|
||||
//await _onlinePayment.CancelAsync(invoice);
|
||||
//return new JsonResult(new
|
||||
//{
|
||||
// data,
|
||||
// statics
|
||||
//});
|
||||
|
||||
//// Check if the invoice is new, or it's already processed before.
|
||||
//if (invoice.Status != PaymentFetchResultStatus.ReadyForVerifying)
|
||||
//{
|
||||
// // You can also see if the invoice is already verified before.
|
||||
// var isAlreadyVerified = invoice.IsAlreadyVerified;
|
||||
|
||||
// return Content("The payment was not successful.");
|
||||
//}
|
||||
|
||||
//// Note: Save the verifyResult.TransactionCode in your database.
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
[HttpPost("/api/callback3232")]
|
||||
[HttpPost("/api/callback")]
|
||||
public async Task<IActionResult> OnGetCallBack(string? transid, string? cardnumber, string? tracking_number,
|
||||
string bank, string invoice_id, string? status,CancellationToken cancellationToken)
|
||||
{
|
||||
@@ -178,7 +70,7 @@ public class GeneralController : GeneralBaseController
|
||||
// اگر شماره کارت یا شماره پیگیری خالی باشد، تراکنش ناموفق است
|
||||
if (string.IsNullOrWhiteSpace(cardnumber) || string.IsNullOrWhiteSpace(tracking_number))
|
||||
{
|
||||
return await HandleFailedTransaction(transaction);
|
||||
return await HandleFailedTransaction(transaction, paymentTransactionId);
|
||||
}
|
||||
|
||||
var verifyCommand = new VerifyPaymentGateWayRequest()
|
||||
@@ -205,10 +97,10 @@ public class GeneralController : GeneralBaseController
|
||||
var statementResult = _financialStatmentApplication.CreateFromBankGateway(command);
|
||||
if (!statementResult.IsSuccedded)
|
||||
{
|
||||
return await HandleFailedTransaction(transaction);
|
||||
return await HandleFailedTransaction(transaction, paymentTransactionId);
|
||||
}
|
||||
|
||||
var setSuccessResult = _paymentTransactionApplication.SetSuccess(paymentTransactionId, cardnumber, bank,null,null);
|
||||
var setSuccessResult = _paymentTransactionApplication.SetSuccess(paymentTransactionId, cardnumber, bank);
|
||||
|
||||
if (!setSuccessResult.IsSuccedded)
|
||||
{
|
||||
@@ -218,12 +110,12 @@ public class GeneralController : GeneralBaseController
|
||||
}
|
||||
|
||||
// در غیر این صورت تراکنش ناموفق است
|
||||
return await HandleFailedTransaction(transaction);
|
||||
return await HandleFailedTransaction(transaction, paymentTransactionId);
|
||||
}
|
||||
|
||||
private async Task<IActionResult> HandleFailedTransaction(PaymentTransactionDetailsViewModel transaction)
|
||||
private async Task<IActionResult> HandleFailedTransaction(PaymentTransactionDetailsViewModel transaction, long transactionId)
|
||||
{
|
||||
var result = _paymentTransactionApplication.SetFailed(transaction.Id);
|
||||
var result = _paymentTransactionApplication.SetFailed(transactionId);
|
||||
if (!result.IsSuccedded)
|
||||
{
|
||||
return new JsonResult(result);
|
||||
@@ -239,81 +131,4 @@ public class GeneralController : GeneralBaseController
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class TokenReq
|
||||
{
|
||||
|
||||
public long Amount { get; set; }
|
||||
|
||||
public string CallbackUrl { get; set; }
|
||||
[Display(Name = "شماره فاکتور")]
|
||||
[MaxLength(100)]
|
||||
[Required]
|
||||
[Key]
|
||||
// be ezaye har pazirande bayad yekta bashad
|
||||
public string invoiceID { get; set; }
|
||||
[Required]
|
||||
public long terminalID { get; set; }
|
||||
/*
|
||||
* JSON Bashad
|
||||
* etelaate takmili site harchi
|
||||
* nabayad char khas dashte bashe (*'"xp_%!+- ...)
|
||||
*/
|
||||
public string Payload { get; set; } = "";
|
||||
public string email { get; set; }
|
||||
}
|
||||
public class TokenResp
|
||||
{
|
||||
// if 0 = success
|
||||
public int Status { get; set; }
|
||||
public string AccessToken { get; set; }
|
||||
}
|
||||
public class PayRequest
|
||||
{
|
||||
[Required]
|
||||
[MaxLength(3000)]
|
||||
public string token { get; set; }
|
||||
[Required]
|
||||
public long terminalID { get; set; }
|
||||
public string nationalCode { get; set; }
|
||||
|
||||
}
|
||||
public class SepehrGatewayPayResponse
|
||||
{
|
||||
/* 0 yni movafaq
|
||||
* -1 yni enseraf
|
||||
* -2 yni etmam zaman
|
||||
*/
|
||||
public int respcode { get; set; }
|
||||
[Display(Name = "متن نتیجه تراکنش")]
|
||||
public string respmsg { get; set; }
|
||||
[Display(Name = "مبلغ کسر شده از مشتری")]
|
||||
public long amount { get; set; }
|
||||
[Display(Name = " شماره فاکتور ")]
|
||||
public string invoiceid { get; set; }
|
||||
[Display(Name = " اطلاعاتی که پذیرنده ارسال کرد ")]
|
||||
public string payload { get; set; }
|
||||
[Display(Name = " شماره ترمینال ")]
|
||||
public long terminalid { get; set; }
|
||||
[Display(Name = " شماره پیگیری ")]
|
||||
public long tracenumber { get; set; }
|
||||
// bayad negah dari she hatman to db
|
||||
[Display(Name = " شماره سند بانکی ")]
|
||||
public long rrn { get; set; }
|
||||
[Display(Name = " زمان و تاریخ پرداخت ")]
|
||||
public string datepaid { get; set; }
|
||||
[Display(Name = " رسید دیجیتال ")]
|
||||
public string digitalreceipt { get; set; }
|
||||
[Display(Name = " نام بانک صادر کننده کارت ")]
|
||||
public string issuerbank { get; set; }
|
||||
[Display(Name = " شماره کارت ")]
|
||||
public string cardnumber { get; set; }
|
||||
}
|
||||
|
||||
public class AdviceReq
|
||||
{
|
||||
[Display(Name = " رسید دیجیتال ")]
|
||||
public string digitalreceipt { get; set; }
|
||||
public long Tid { get; set; }
|
||||
}
|
||||
@@ -13,11 +13,9 @@ public class AndroidApk : Controller
|
||||
}
|
||||
|
||||
[Route("Apk/Android")]
|
||||
public async Task<IActionResult> Index([FromQuery] string type = "WebView")
|
||||
public async Task<IActionResult> Index()
|
||||
{
|
||||
ApkType apkType = type.ToLower() == "facedetection" ? ApkType.FaceDetection : ApkType.WebView;
|
||||
var path = await _androidApkVersionApplication.GetLatestActiveVersionPath(apkType);
|
||||
var fileName = apkType == ApkType.WebView ? "Gozareshgir.apk" : "Gozareshgir-FaceDetection.apk";
|
||||
return PhysicalFile(path,"application/vnd.android.package-archive", fileName);
|
||||
var path = await _androidApkVersionApplication.GetLatestActiveVersionPath();
|
||||
return PhysicalFile(path,"application/vnd.android.package-archive","Gozareshgir.apk");
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,6 @@ public class IndexModel : PageModel
|
||||
[BindProperty] public string Password { get; set; }
|
||||
[BindProperty] public string CaptchaResponse { get; set; }
|
||||
public bool HasApkToDownload { get; set; }
|
||||
public bool HasFaceDetectionApkToDownload { get; set; }
|
||||
private static Timer aTimer;
|
||||
public Login login;
|
||||
public AccountViewModel Search;
|
||||
@@ -77,8 +76,7 @@ public class IndexModel : PageModel
|
||||
|
||||
//_context.SaveChanges();
|
||||
|
||||
HasApkToDownload = _androidApkVersionApplication.HasAndroidApkToDownload(ApkType.WebView);
|
||||
HasFaceDetectionApkToDownload = _androidApkVersionApplication.HasAndroidApkToDownload(ApkType.FaceDetection);
|
||||
HasApkToDownload = _androidApkVersionApplication.HasAndroidApkToDownload();
|
||||
if (User.Identity is { IsAuthenticated: true })
|
||||
{
|
||||
if (User.FindFirstValue("IsCamera") == "true")
|
||||
|
||||
@@ -24,15 +24,12 @@ using ServiceHost.Test;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json;
|
||||
using _0_Framework.InfraStructure.Mongo;
|
||||
using Bogus;
|
||||
using CompanyManagment.EFCore.Services;
|
||||
using Microsoft.AspNetCore.CookiePolicy;
|
||||
using Microsoft.AspNetCore.Mvc.Infrastructure;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Diagnostics;
|
||||
using MongoDB.Driver;
|
||||
using Parbad.Builder;
|
||||
using Parbad.Gateway.Sepehr;
|
||||
using Swashbuckle.AspNetCore.SwaggerUI;
|
||||
|
||||
|
||||
@@ -309,29 +306,11 @@ builder.Services.AddCors(options =>
|
||||
|
||||
builder.Services.AddExceptionHandler<CustomExceptionHandler>();
|
||||
|
||||
var sepehrTerminalId = builder.Configuration.GetValue<long>("SepehrGateWayTerminalId");
|
||||
|
||||
builder.Services.AddParbad().ConfigureGateways(gateways =>
|
||||
{
|
||||
gateways.AddSepehr().WithAccounts(accounts =>
|
||||
{
|
||||
accounts.AddInMemory(account =>
|
||||
{
|
||||
account.TerminalId = sepehrTerminalId;
|
||||
account.Name="Sepehr Account";
|
||||
});
|
||||
});
|
||||
}).ConfigureHttpContext(httpContext=>httpContext.UseDefaultAspNetCore())
|
||||
.ConfigureStorage(storage =>
|
||||
{
|
||||
storage.UseMemoryCache();
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
app.UseCors("AllowSpecificOrigins");
|
||||
|
||||
|
||||
|
||||
#region Mahan
|
||||
|
||||
//app.UseStatusCodePagesWithRedirects("/error/{0}");
|
||||
@@ -345,7 +324,6 @@ if (builder.Environment.IsDevelopment())
|
||||
await tester.Test();
|
||||
}
|
||||
|
||||
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseSwagger();
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
"sqlDebugging": true,
|
||||
"dotnetRunMessages": "true",
|
||||
"nativeDebugging": true,
|
||||
"applicationUrl": "https://localhost:5004;http://localhost:5003;https://192.168.0.117:5005;http://192.168.0.117:5006;",
|
||||
"applicationUrl": "https://localhost:5004;http://localhost:5003;",
|
||||
"jsWebView2Debugging": false,
|
||||
"hotReloadEnabled": true
|
||||
},
|
||||
|
||||
@@ -90,8 +90,6 @@
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.2" />
|
||||
<PackageReference Include="MongoDB.Driver" Version="3.5.0" />
|
||||
<PackageReference Include="Parbad.AspNetCore" Version="1.5.0" />
|
||||
<PackageReference Include="Parbad.Storage.Cache" Version="1.5.0" />
|
||||
<PackageReference Include="SocialExplorer.FastDBF" Version="1.0.0" />
|
||||
<PackageReference Include="System.Data.OleDb" Version="8.0.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="8.1.4" />
|
||||
|
||||
@@ -38,12 +38,7 @@
|
||||
"MongoDb": {
|
||||
"ConnectionString": "mongodb://localhost:27017",
|
||||
"DatabaseName": "Gozareshgir"
|
||||
},
|
||||
"SmsSettings": {
|
||||
"IsTestMode": true,
|
||||
"TestNumbers": [ "09116967898", "09116067106", "09114221321" ]
|
||||
},
|
||||
"SepehrGateWayTerminalId": 99213700
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -31,11 +31,5 @@
|
||||
"MongoDb": {
|
||||
"ConnectionString": "mongodb://localhost:27017",
|
||||
"DatabaseName": "Gozareshgir"
|
||||
},
|
||||
"SmsSettings": {
|
||||
"IsTestMode": false,
|
||||
"TestNumbers": []
|
||||
},
|
||||
"SepehrGateWayTerminalId": 99213700
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,8 @@ $(document).ready(function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
new Cleave(this, {
|
||||
|
||||
new Cleave('.dateInput', {
|
||||
delimiters: ['/', '/'],
|
||||
blocks: [4, 2, 2],
|
||||
numericOnly: true
|
||||
@@ -77,7 +78,6 @@ $(document).ready(function () {
|
||||
// datePattern: ['Y', 'm', 'd']
|
||||
// });
|
||||
});
|
||||
|
||||
|
||||
//******************** انتخاب همه ی چک باکس ها ********************
|
||||
$(".checkAll").change(function () {
|
||||
|
||||
@@ -254,14 +254,14 @@ function loadEmployeeAjax(groupSettingId) {
|
||||
<input type="text" class="form-control" id="searchEmployee" placeholder="جستجو ..." />
|
||||
</div>
|
||||
</div>`;
|
||||
console.log(responseDataEmployee);
|
||||
|
||||
responseDataEmployee.forEach(function (itemEmployee) {
|
||||
if (itemEmployee.isShiftChanged === true) {
|
||||
isShiftChangedGlobal = true;
|
||||
}
|
||||
|
||||
htmlEmployee += `<div></div>
|
||||
<div class="my-1 Rtable-row align-items-center position-relative itemResultEmployee ${itemEmployee.hasLeft?'disable':''}" data-employee-id="${itemEmployee.employeeId}">
|
||||
<div class="my-1 Rtable-row align-items-center position-relative itemResultEmployee" data-employee-id="${itemEmployee.employeeId}">
|
||||
<div class="Rtable-cell width1 widthMobile1">
|
||||
<div class="Rtable-cell--content">
|
||||
<span class="d-flex justify-content-center row-index2">
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,184 +0,0 @@
|
||||
# Plan: Add ApkType to AndroidApkVersion for WebView and FaceDetection separation
|
||||
|
||||
## Overview
|
||||
|
||||
The user wants to integrate the `ApkType` enum (WebView/FaceDetection) into the `AndroidApkVersion` entity to distinguish between the two different APK types. Currently, all APKs are treated as WebView. The system needs to be updated to support both types with separate handling.
|
||||
|
||||
## Steps
|
||||
|
||||
### 1. Update AndroidApkVersion.cs domain entity
|
||||
**File:** `Company.Domain\AndroidApkVersionAgg\AndroidApkVersion.cs`
|
||||
|
||||
- Add `ApkType` property to the class
|
||||
- Update constructor to accept `ApkType` parameter
|
||||
- Modify `Title` property generation to include APK type information
|
||||
- Update the constructor logic to handle both WebView and FaceDetection types
|
||||
|
||||
### 2. Update AndroidApkVersionMapping.cs EF configuration
|
||||
**File:** `CompanyManagment.EFCore\Mapping\AndroidApkVersionMapping.cs`
|
||||
|
||||
- Add mapping configuration for `ApkType` property
|
||||
- Use enum-to-string conversion (similar to existing `IsActive` mapping)
|
||||
- Set appropriate column max length for the enum value
|
||||
|
||||
### 3. Create database migration
|
||||
**Files:** Generated migration files in `CompanyManagment.EFCore\Migrations\`
|
||||
|
||||
- Generate new migration to add `ApkType` column to `AndroidApkVersions` table
|
||||
- Set default value to `ApkType.WebView` for existing records
|
||||
- Apply migration to update database schema
|
||||
|
||||
### 4. Update IAndroidApkVersionRepository.cs interface
|
||||
**File:** `Company.Domain\AndroidApkVersionAgg\IAndroidApkVersionRepository.cs`
|
||||
|
||||
- Modify `GetActives()` to accept `ApkType` parameter for filtering
|
||||
- Modify `GetLatestActiveVersionPath()` to accept `ApkType` parameter
|
||||
- Add methods to handle type-specific queries
|
||||
|
||||
### 5. Update AndroidApkVersionRepository.cs implementation
|
||||
**File:** `CompanyManagment.EFCore\Repository\AndroidApkVersionRepository.cs`
|
||||
|
||||
- Implement type-based filtering in `GetActives()` method
|
||||
- Implement type-based filtering in `GetLatestActiveVersionPath()` method
|
||||
- Add appropriate WHERE clauses to filter by `ApkType`
|
||||
|
||||
### 6. Update IAndroidApkVersionApplication.cs interface
|
||||
**File:** `CompanyManagment.App.Contracts\AndroidApkVersion\IAndroidApkVersionApplication.cs`
|
||||
|
||||
- Add `ApkType` parameter to `CreateAndActive()` method
|
||||
- Add `ApkType` parameter to `CreateAndDeActive()` method
|
||||
- Add `ApkType` parameter to `GetLatestActiveVersionPath()` method
|
||||
- Add `ApkType` parameter to `HasAndroidApkToDownload()` method
|
||||
|
||||
### 7. Update AndroidApkVersionApplication.cs implementation
|
||||
**File:** `CompanyManagment.Application\AndroidApkVersionApplication.cs`
|
||||
|
||||
- Update `CreateAndActive()` method:
|
||||
- Accept `ApkType` parameter
|
||||
- Change storage path from hardcoded "GozreshgirWebView" to dynamic based on type
|
||||
- Use "GozreshgirWebView" for `ApkType.WebView`
|
||||
- Use "GozreshgirFaceDetection" for `ApkType.FaceDetection`
|
||||
- Pass `ApkType` to repository methods when getting/deactivating existing APKs
|
||||
- Pass `ApkType` to entity constructor
|
||||
|
||||
- Update `CreateAndDeActive()` method:
|
||||
- Accept `ApkType` parameter
|
||||
- Update storage path logic similar to `CreateAndActive()`
|
||||
- Pass `ApkType` to entity constructor
|
||||
|
||||
- Update `GetLatestActiveVersionPath()` method:
|
||||
- Accept `ApkType` parameter
|
||||
- Pass type to repository method
|
||||
|
||||
- Update `HasAndroidApkToDownload()` method:
|
||||
- Accept `ApkType` parameter
|
||||
- Filter by type when checking for active APKs
|
||||
|
||||
### 8. Update AndroidApk.cs controller
|
||||
**File:** `ServiceHost\Pages\Apk\AndroidApk.cs`
|
||||
|
||||
- Modify the download endpoint to accept `ApkType` parameter
|
||||
- Options:
|
||||
- Add query string parameter: `/Apk/Android?type=WebView` or `/Apk/Android?type=FaceDetection`
|
||||
- Create separate routes: `/Apk/Android/WebView` and `/Apk/Android/FaceDetection`
|
||||
- Pass the type parameter to `GetLatestActiveVersionPath()` method
|
||||
- Maintain backward compatibility by defaulting to `ApkType.WebView` if no type specified
|
||||
|
||||
### 9. Update admin UI Index.cshtml.cs
|
||||
**File:** `ServiceHost\Areas\AdminNew\Pages\Company\AndroidApk\Index.cshtml.cs`
|
||||
|
||||
- Add property to store selected `ApkType`
|
||||
- Add `[BindProperty]` for ApkType selection
|
||||
- Modify `OnPostUpload()` to pass selected `ApkType` to application method
|
||||
- Create corresponding UI changes in Index.cshtml (if exists) to allow type selection
|
||||
|
||||
### 10. Update client-facing pages
|
||||
**Files:**
|
||||
- `ServiceHost\Pages\login\Index.cshtml.cs`
|
||||
- `ServiceHost\Areas\Client\Pages\Index.cshtml.cs`
|
||||
|
||||
- Update calls to `HasAndroidApkToDownload()` to specify which APK type to check
|
||||
- Consider showing different download buttons/links for WebView vs FaceDetection apps
|
||||
- Update download links to include APK type parameter
|
||||
|
||||
## Migration Strategy
|
||||
|
||||
### Handling Existing Data
|
||||
- All existing `AndroidApkVersion` records should be marked as `ApkType.WebView` by default
|
||||
- Use migration to set default value
|
||||
- No manual data update required if migration includes default value
|
||||
|
||||
### Database Schema Change
|
||||
```sql
|
||||
ALTER TABLE AndroidApkVersions
|
||||
ADD ApkType NVARCHAR(20) NOT NULL DEFAULT 'WebView';
|
||||
```
|
||||
|
||||
## UI Design Considerations
|
||||
|
||||
### Admin Upload Page
|
||||
**Recommended approach:** Single form with radio buttons or dropdown
|
||||
|
||||
- Add radio buttons or dropdown to select APK type before upload
|
||||
- Labels: "WebView Application" and "Face Detection Application"
|
||||
- Group uploads by type in the list/table view
|
||||
- Show type column in the APK list
|
||||
|
||||
### Client Download Pages
|
||||
**Recommended approach:** Separate download buttons
|
||||
|
||||
- Show "Download Gozareshgir WebView" button (existing functionality)
|
||||
- Show "Download Gozareshgir FaceDetection" button (new functionality)
|
||||
- Only show buttons if corresponding APK type is available
|
||||
- Use different icons or colors to distinguish between types
|
||||
|
||||
## Download URL Structure
|
||||
|
||||
**Recommended approach:** Single endpoint with query parameter
|
||||
|
||||
- Current: `/Apk/Android` (defaults to WebView for backward compatibility)
|
||||
- New WebView: `/Apk/Android?type=WebView`
|
||||
- New FaceDetection: `/Apk/Android?type=FaceDetection`
|
||||
|
||||
**Alternative approach:** Separate endpoints
|
||||
- `/Apk/Android/WebView`
|
||||
- `/Apk/Android/FaceDetection`
|
||||
|
||||
## Testing Checklist
|
||||
|
||||
1. ✅ Upload WebView APK successfully
|
||||
2. ✅ Upload FaceDetection APK successfully
|
||||
3. ✅ Both types can coexist in database
|
||||
4. ✅ Activating WebView APK doesn't affect FaceDetection APK
|
||||
5. ✅ Activating FaceDetection APK doesn't affect WebView APK
|
||||
6. ✅ Download correct APK based on type parameter
|
||||
7. ✅ Admin UI shows type information correctly
|
||||
8. ✅ Client pages show correct download availability
|
||||
9. ✅ Backward compatibility maintained (existing links still work)
|
||||
10. ✅ Migration applies successfully to existing database
|
||||
|
||||
## File Summary
|
||||
|
||||
**Files to modify:**
|
||||
1. `Company.Domain\AndroidApkVersionAgg\AndroidApkVersion.cs`
|
||||
2. `CompanyManagment.EFCore\Mapping\AndroidApkVersionMapping.cs`
|
||||
3. `Company.Domain\AndroidApkVersionAgg\IAndroidApkVersionRepository.cs`
|
||||
4. `CompanyManagment.EFCore\Repository\AndroidApkVersionRepository.cs`
|
||||
5. `CompanyManagment.App.Contracts\AndroidApkVersion\IAndroidApkVersionApplication.cs`
|
||||
6. `CompanyManagment.Application\AndroidApkVersionApplication.cs`
|
||||
7. `ServiceHost\Pages\Apk\AndroidApk.cs`
|
||||
8. `ServiceHost\Areas\AdminNew\Pages\Company\AndroidApk\Index.cshtml.cs`
|
||||
9. `ServiceHost\Pages\login\Index.cshtml.cs`
|
||||
10. `ServiceHost\Areas\Client\Pages\Index.cshtml.cs`
|
||||
|
||||
**Files to create:**
|
||||
1. New migration file (auto-generated)
|
||||
2. Possibly `ServiceHost\Areas\AdminNew\Pages\Company\AndroidApk\Index.cshtml` (if doesn't exist)
|
||||
|
||||
## Notes
|
||||
|
||||
- The `ApkType` enum is already defined in `AndroidApkVersion.cs`
|
||||
- Storage folders will be separate: `Storage/Apk/Android/GozreshgirWebView` and `Storage/Apk/Android/GozreshgirFaceDetection`
|
||||
- Each APK type maintains its own active/inactive state independently
|
||||
- Consider adding validation to ensure APK file matches selected type (optional enhancement)
|
||||
|
||||
@@ -1,151 +0,0 @@
|
||||
# Plan: Add IsForce Field to Android APK Version Management
|
||||
|
||||
## Overview
|
||||
Add support for force update functionality to the Android APK version management system. This allows administrators to specify whether an APK update is mandatory (force update) or optional when uploading new versions. The system now supports two separate APK types: WebView and FaceDetection.
|
||||
|
||||
## Context
|
||||
- The system manages Android APK versions for two different application types
|
||||
- Previously, all updates were treated as optional
|
||||
- Need to add ability to mark certain updates as mandatory
|
||||
- Force update flag should be stored in database and returned via API
|
||||
|
||||
## Requirements
|
||||
1. Add `IsForce` boolean field to the `AndroidApkVersion` entity
|
||||
2. Allow administrators to specify force update status when uploading APK
|
||||
3. Store force update status in database
|
||||
4. Return force update status via API endpoint
|
||||
5. Separate handling for WebView and FaceDetection APK types
|
||||
|
||||
## Implementation Steps
|
||||
|
||||
### 1. Domain Layer Updates
|
||||
- ✅ Add `IsForce` property to `AndroidApkVersion` entity
|
||||
- ✅ Update constructor to accept `isForce` parameter with default value of `false`
|
||||
- ✅ File: `Company.Domain/AndroidApkVersionAgg/AndroidApkVersion.cs`
|
||||
|
||||
### 2. Database Mapping
|
||||
- ✅ Add `IsForce` property mapping in `AndroidApkVersionMapping`
|
||||
- ✅ File: `CompanyManagment.EFCore/Mapping/AndroidApkVersionMapping.cs`
|
||||
|
||||
### 3. Application Layer Updates
|
||||
- ✅ Update `IAndroidApkVersionApplication` interface:
|
||||
- Add `isForce` parameter to `CreateAndActive` method
|
||||
- Add `isForce` parameter to `CreateAndDeActive` method
|
||||
- Remove `isForceUpdate` parameter from `GetLatestActiveInfo` method
|
||||
- ✅ File: `CompanyManagment.App.Contracts/AndroidApkVersion/IAndroidApkVersionApplication.cs`
|
||||
|
||||
### 4. Application Implementation
|
||||
- ✅ Update `AndroidApkVersionApplication`:
|
||||
- Pass `isForce` to `AndroidApkVersion` constructor in `CreateAndActive`
|
||||
- Pass `isForce` to `AndroidApkVersion` constructor in `CreateAndDeActive`
|
||||
- Update `GetLatestActiveInfo` to return `IsForce` from database entity instead of parameter
|
||||
- ✅ File: `CompanyManagment.Application/AndroidApkVersionApplication.cs`
|
||||
|
||||
### 5. API Controller Updates
|
||||
- ✅ Update `AndroidApkController`:
|
||||
- Remove `force` parameter from `CheckUpdate` endpoint
|
||||
- API now returns `IsForce` from database
|
||||
- ✅ File: `ServiceHost/Areas/Admin/Controllers/AndroidApkController.cs`
|
||||
|
||||
### 6. Admin UI Updates
|
||||
- ✅ Add `IsForce` property to `IndexModel`
|
||||
- ✅ Add checkbox for force update in upload form
|
||||
- ✅ Pass `IsForce` value to `CreateAndActive` method
|
||||
- ✅ Files:
|
||||
- `ServiceHost/Areas/AdminNew/Pages/Company/AndroidApk/Index.cshtml.cs`
|
||||
- `ServiceHost/Areas/AdminNew/Pages/Company/AndroidApk/Index.cshtml`
|
||||
|
||||
### 7. Database Migration (To Be Done)
|
||||
- ⚠️ **REQUIRED**: Create and run migration to add `IsForce` column to `AndroidApkVersions` table
|
||||
- Command: `Add-Migration AddIsForceToAndroidApkVersion`
|
||||
- Then: `Update-Database`
|
||||
|
||||
## API Endpoints
|
||||
|
||||
### Check for Updates
|
||||
```http
|
||||
GET /api/android-apk/check-update?type={ApkType}¤tVersionCode={int}
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
- `type`: Enum value - `WebView` or `FaceDetection`
|
||||
- `currentVersionCode`: Current version code of installed app (integer)
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"latestVersionCode": 120,
|
||||
"latestVersionName": "1.2.0",
|
||||
"shouldUpdate": true,
|
||||
"isForceUpdate": false,
|
||||
"downloadUrl": "/Apk/Android?type=WebView",
|
||||
"releaseNotes": "Bug fixes and improvements"
|
||||
}
|
||||
```
|
||||
|
||||
## APK Type Separation
|
||||
|
||||
The system now fully supports two separate APK types:
|
||||
1. **WebView**: Original web-view based application
|
||||
- Stored in: `Storage/Apk/Android/GozreshgirWebView/`
|
||||
- Title format: `Gozareshgir-WebView-{version}-{date}`
|
||||
|
||||
2. **FaceDetection**: New face detection application
|
||||
- Stored in: `Storage/Apk/Android/GozreshgirFaceDetection/`
|
||||
- Title format: `Gozareshgir-FaceDetection-{version}-{date}`
|
||||
|
||||
Each APK type maintains its own:
|
||||
- Version history
|
||||
- Active version
|
||||
- Force update settings
|
||||
- Download endpoint
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Admin Upload with Force Update
|
||||
1. Navigate to admin APK upload page
|
||||
2. Select APK file
|
||||
3. Choose APK type (WebView or FaceDetection)
|
||||
4. Check "آپدیت اجباری (Force Update)" if update should be mandatory
|
||||
5. Click Upload
|
||||
|
||||
### Client Check for Update (WebView)
|
||||
```http
|
||||
GET /api/android-apk/check-update?type=WebView¤tVersionCode=100
|
||||
```
|
||||
|
||||
### Client Check for Update (FaceDetection)
|
||||
```http
|
||||
GET /api/android-apk/check-update?type=FaceDetection¤tVersionCode=50
|
||||
```
|
||||
|
||||
## Testing Checklist
|
||||
- [ ] Test uploading APK with force update enabled for WebView
|
||||
- [ ] Test uploading APK with force update disabled for WebView
|
||||
- [ ] Test uploading APK with force update enabled for FaceDetection
|
||||
- [ ] Test uploading APK with force update disabled for FaceDetection
|
||||
- [ ] Verify API returns correct `isForceUpdate` value for WebView
|
||||
- [ ] Verify API returns correct `isForceUpdate` value for FaceDetection
|
||||
- [ ] Verify only one active version exists per APK type
|
||||
- [ ] Test migration creates `IsForce` column correctly
|
||||
- [ ] Verify existing records default to `false` for `IsForce`
|
||||
|
||||
## Notes
|
||||
- Default value for `IsForce` is `false` (optional update)
|
||||
- When uploading new active APK, all previous active versions of same type are deactivated
|
||||
- Each APK type is managed independently
|
||||
- Force update flag is stored per version, not globally
|
||||
- API returns force update status from the latest active version in database
|
||||
|
||||
## Files Modified
|
||||
1. `Company.Domain/AndroidApkVersionAgg/AndroidApkVersion.cs`
|
||||
2. `CompanyManagment.EFCore/Mapping/AndroidApkVersionMapping.cs`
|
||||
3. `CompanyManagment.App.Contracts/AndroidApkVersion/IAndroidApkVersionApplication.cs`
|
||||
4. `CompanyManagment.Application/AndroidApkVersionApplication.cs`
|
||||
5. `ServiceHost/Areas/Admin/Controllers/AndroidApkController.cs`
|
||||
6. `ServiceHost/Areas/AdminNew/Pages/Company/AndroidApk/Index.cshtml.cs`
|
||||
7. `ServiceHost/Areas/AdminNew/Pages/Company/AndroidApk/Index.cshtml`
|
||||
|
||||
## Migration Required
|
||||
⚠️ **Important**: Don't forget to create and run the database migration to add the `IsForce` column.
|
||||
|
||||
Reference in New Issue
Block a user