Compare commits
13 Commits
Fix/instit
...
Fix/workfl
| Author | SHA1 | Date | |
|---|---|---|---|
| 4e8115ca0a | |||
|
|
397280d0a2 | ||
| 5975a92aa1 | |||
| 0cec7c0cce | |||
| be6cb6430f | |||
| 76aa1eae88 | |||
| f1106deff9 | |||
| 94a5741906 | |||
| 221d06a0fc | |||
| 2b993fb746 | |||
| 761ac352df | |||
| ecfb7af386 | |||
| 92fd8d6b0e |
@@ -70,6 +70,7 @@ public interface IWorkshopRepository : IRepository<long, Workshop>
|
||||
Task<List<WorkshopWithLeftWorkTempEmployeesDto>> GetWorkshopsForLeftWorkTemp(long accountId);
|
||||
Task<int> GetWorkshopsForLeftWorkTempCount(long accountId);
|
||||
Task<List<WorkshopSelectListViewModel>> GetSelectList(string search, long id);
|
||||
int GetLastArchiveCode();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.AccessControl;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using Company.Domain.ContarctingPartyAgg;
|
||||
using Company.Domain.ContractAgg;
|
||||
@@ -66,6 +68,11 @@ public class Employer : EntityBase
|
||||
public string SanaPassword { get; private set; }
|
||||
|
||||
public string EmployerNo { get; set; }
|
||||
public bool IsAuth { get; set; }
|
||||
public string IdNumberSerial { get; set; }
|
||||
|
||||
public string IdNumberSeri { get; set; }
|
||||
|
||||
public PersonalContractingParty ContractingParty { get; set; }
|
||||
|
||||
//public List<Workshop> Workshops { get; private set; }
|
||||
@@ -227,4 +234,35 @@ public class Employer : EntityBase
|
||||
this.IsActive = false;
|
||||
this.Address = "false";
|
||||
}
|
||||
|
||||
public void Authentication(string fName, string lName, string fatherName,string idNumber,
|
||||
string idNumberSeri, string idNumberSerial, string dateOfBirth, Gender gender,string phone)
|
||||
{
|
||||
this.FName = fName;
|
||||
this.LName = lName;
|
||||
this.FatherName = fatherName;
|
||||
this.IdNumberSeri = idNumberSeri;
|
||||
this.IdNumberSerial = idNumberSerial;
|
||||
this.DateOfBirth = !string.IsNullOrWhiteSpace(dateOfBirth) ? dateOfBirth.ToGeorgianDateTime() : new();
|
||||
this.IdNumber = idNumber;
|
||||
this.Gender = gender == _0_Framework.Application.Gender.Male? "مرد" : "زن";
|
||||
this.IsAuth = true;
|
||||
Phone = phone;
|
||||
}
|
||||
|
||||
|
||||
public void LegalAuthentication(string fName, string lName, string fatherName,string idNumber, string idNumberSeri,
|
||||
string idNumberSerial, string dateOfBirth, Gender gender,string phone)
|
||||
{
|
||||
FName = fName;
|
||||
EmployerLName = lName;
|
||||
this.FatherName = fatherName;
|
||||
this.IdNumberSeri = idNumberSeri;
|
||||
this.IdNumberSerial = idNumberSerial;
|
||||
this.DateOfBirth = !string.IsNullOrWhiteSpace(dateOfBirth) ? dateOfBirth.ToGeorgianDateTime() : new();
|
||||
this.IdNumber = idNumber;
|
||||
this.Gender =gender == _0_Framework.Application.Gender.Male? "مرد" : "زن";
|
||||
this.IsAuth = true;
|
||||
Phone = phone;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Company.Domain.empolyerAgg;
|
||||
|
||||
@@ -34,7 +36,7 @@ public interface IEmployerRepository : IRepository<long, Employer>
|
||||
|
||||
List<EmployerViewModel> GetEmployersHasWorkshop();
|
||||
|
||||
Task<List<EmployerSelectListViewModel>> GetSelectList(string search,long id);
|
||||
Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id, LegalType? legalType);
|
||||
|
||||
|
||||
#endregion
|
||||
@@ -68,5 +70,5 @@ public interface IEmployerRepository : IRepository<long, Employer>
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
Task<ActionResult<EditEmployerWorkflowRegistration>> GetWorkflowRegistrationForEdit(long employerId, long institutionWorkshopDetailsId);
|
||||
}
|
||||
@@ -6,6 +6,7 @@ using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
@@ -46,8 +47,9 @@ public interface IEmployerApplication
|
||||
/// </summary>
|
||||
/// <param name="search"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="legalType"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id);
|
||||
Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id, LegalType? legalType = null);
|
||||
|
||||
#endregion
|
||||
#region NewByHeydari
|
||||
@@ -145,6 +147,7 @@ public interface IEmployerApplication
|
||||
Task<OperationResult> DeleteWorkflowRegistration(long employerId, long institutionWorkshopDetailsId);
|
||||
|
||||
Task<OperationResult<AuthenticateUserViewModel>> AuthenticateEmployer(string nationalCode, string dateOfBirth, string mobile);
|
||||
Task<ActionResult<EditEmployerWorkflowRegistration>> GetWorkflowRegistrationForEdit(long employerId, long institutionWorkshopDetailsId);
|
||||
}
|
||||
|
||||
public class AuthenticateUserViewModel
|
||||
@@ -207,6 +210,11 @@ public class AuthenticateUserViewModel
|
||||
/// </summary>
|
||||
public class CreateEmployerWorkflowRegistration
|
||||
{
|
||||
/// <summary>
|
||||
/// درزمانی که یوزر کارفرمایی رو انتخاب کرد که از قبل ثبت شده است
|
||||
/// این فیلد باید مقدار داشته باشد
|
||||
/// </summary>
|
||||
public long EmployerId { get; set; }
|
||||
/// <summary>
|
||||
/// اطلاعات کارفرمای حقیقی
|
||||
/// </summary>
|
||||
@@ -323,7 +331,9 @@ public class CreateLegalEmployerWorkflowRegistration
|
||||
/// اطلاعات سیستم دولتی
|
||||
/// </summary>
|
||||
public GovernmentSystemInfo GovernmentSystemInfo { get; set; }
|
||||
|
||||
|
||||
public string IdNumberSeri { get; set; }
|
||||
public string IdNumberSerial { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -395,6 +405,9 @@ public class CreateRealEmployerWorkflowRegistration
|
||||
/// شماره تلفن
|
||||
/// </summary>
|
||||
public string Telephone { get; set; }
|
||||
|
||||
public string IdNumberSeri { get; set; }
|
||||
public string IdNumberSerial { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -3,4 +3,6 @@ namespace CompanyManagment.App.Contracts.InstitutionContract;
|
||||
public class InstitutionContractWorkshopDetailViewModel
|
||||
{
|
||||
public WorkshopServicesViewModel ServicesViewModel { get; set; }
|
||||
public string WorkshopName { get; set; }
|
||||
public int ArchiveCode { get; set; }
|
||||
}
|
||||
@@ -9,4 +9,5 @@ public class WorkshopAccountViewModel
|
||||
public string Insurance { get; set; }
|
||||
public string Tax { get; set; }
|
||||
public string IsActiveSting { get; set; }
|
||||
public string WorkshopIsActive { get; set; }
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.AccessControl;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using _0_Framework.Application.UID;
|
||||
@@ -13,6 +14,7 @@ using Company.Domain.WorkshopAgg;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using CompanyManagment.EFCore.Repository;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Identity.Client;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
@@ -42,7 +44,6 @@ public class EmployerApplication : IEmployerApplication
|
||||
}
|
||||
|
||||
|
||||
|
||||
public OperationResult Active(long id)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
@@ -1029,7 +1030,7 @@ public class EmployerApplication : IEmployerApplication
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Api
|
||||
|
||||
public async Task<List<GetEmployerListViewModel>> GetEmployerList(GetEmployerSearchModel searchModel)
|
||||
@@ -1285,9 +1286,10 @@ public class EmployerApplication : IEmployerApplication
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
public async Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id)
|
||||
public async Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id,
|
||||
LegalType? legalType = null)
|
||||
{
|
||||
return await _EmployerRepository.GetSelectList(search, id);
|
||||
return await _EmployerRepository.GetSelectList(search, id, legalType);
|
||||
}
|
||||
|
||||
async Task<OperationResult<string>> IEmployerApplication.Remove(long id)
|
||||
@@ -1312,19 +1314,32 @@ public class EmployerApplication : IEmployerApplication
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
var tranasction = await _EmployerRepository.BeginTransactionAsync();
|
||||
OperationResult<Employer> createEmployerResult = command.LegalType switch
|
||||
Employer employer;
|
||||
if (command.EmployerId != 0)
|
||||
{
|
||||
LegalType.Real => await CreateRealEmployerRegistration(command.RealEmployer, command.ContractingPartyId),
|
||||
LegalType.Legal => await CreateLegalEmployerRegistration(command.LegalEmployer, command.ContractingPartyId),
|
||||
_ => throw new ArgumentOutOfRangeException()
|
||||
};
|
||||
var employer = createEmployerResult.Data;
|
||||
employer = _EmployerRepository.Get(command.EmployerId);
|
||||
if (employer == null)
|
||||
throw new NotFoundException("کارفرمای مورد نظر یافت نشد");
|
||||
}
|
||||
else
|
||||
{
|
||||
OperationResult<Employer> createEmployerResult = command.LegalType switch
|
||||
{
|
||||
LegalType.Real =>
|
||||
await CreateRealEmployerRegistration(command.RealEmployer, command.ContractingPartyId),
|
||||
LegalType.Legal => await CreateLegalEmployerRegistration(command.LegalEmployer,
|
||||
command.ContractingPartyId),
|
||||
_ => throw new ArgumentOutOfRangeException()
|
||||
};
|
||||
employer = createEmployerResult.Data;
|
||||
|
||||
if (!createEmployerResult.IsSuccedded)
|
||||
return operation.Failed(createEmployerResult.Message);
|
||||
if (!createEmployerResult.IsSuccedded)
|
||||
return operation.Failed(createEmployerResult.Message);
|
||||
}
|
||||
|
||||
var workshopDetails =
|
||||
await _institutionContractRepository.GetInstitutionWorkshopInitialDetails(command.InstitutionWorkshopInitialId);
|
||||
await _institutionContractRepository.GetInstitutionWorkshopInitialDetails(command
|
||||
.InstitutionWorkshopInitialId);
|
||||
workshopDetails.AddEmployer(employer.id);
|
||||
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
@@ -1335,7 +1350,7 @@ public class EmployerApplication : IEmployerApplication
|
||||
public async Task<OperationResult> EditWorkflowRegistration(EditEmployerWorkflowRegistration command)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
|
||||
|
||||
// Get the existing employer
|
||||
var employer = _EmployerRepository.Get(command.EmployerId);
|
||||
if (employer == null)
|
||||
@@ -1364,55 +1379,56 @@ public class EmployerApplication : IEmployerApplication
|
||||
public async Task<OperationResult> DeleteWorkflowRegistration(long employerId, long institutionWorkshopDetailsId)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
|
||||
|
||||
// Check if employer exists
|
||||
var employer = _EmployerRepository.Get(employerId);
|
||||
if (employer == null)
|
||||
return operation.Failed("کارفرمای مورد نظر یافت نشد");
|
||||
|
||||
|
||||
// Get workshop details
|
||||
var workshopDetails = await _institutionContractRepository.GetInstitutionWorkshopInitialDetails(institutionWorkshopDetailsId);
|
||||
var workshopDetails =
|
||||
await _institutionContractRepository.GetInstitutionWorkshopInitialDetails(institutionWorkshopDetailsId);
|
||||
if (workshopDetails == null)
|
||||
return operation.Failed("جزئیات کارگاه موسسه یافت نشد");
|
||||
|
||||
|
||||
// Find and remove the employer from workshop details
|
||||
var employerDetail = workshopDetails.Employers.FirstOrDefault(e => e.EmployerId == employerId);
|
||||
if (employerDetail == null)
|
||||
return operation.Failed("کارفرما در لیست کارگاه یافت نشد");
|
||||
|
||||
|
||||
// Remove the employer from the list
|
||||
workshopDetails.Employers.Remove(employerDetail);
|
||||
|
||||
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
|
||||
|
||||
// Delete the employer
|
||||
_EmployerRepository.Remove(employerId);
|
||||
await _EmployerRepository.SaveChangesAsync();
|
||||
|
||||
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
|
||||
public async Task<OperationResult<AuthenticateUserViewModel>> AuthenticateEmployer(string nationalCode,
|
||||
string dateOfBirth,
|
||||
string mobile)
|
||||
{
|
||||
var op = new OperationResult<AuthenticateUserViewModel>();
|
||||
|
||||
|
||||
var dateOfBirthGr = dateOfBirth.ToGeorgianDateTime();
|
||||
|
||||
|
||||
var isMachMobilAndNationalCode = await _uidService.IsMachPhoneWithNationalCode(nationalCode, mobile);
|
||||
if (isMachMobilAndNationalCode == null)
|
||||
return op.Failed("خطا در سرویس احراز هویت");
|
||||
if (!isMachMobilAndNationalCode.IsMatched)
|
||||
return op.Failed("شماره همراه وارد شده با کد ملی مطابقت ندارد");
|
||||
var apiRespons = await _uidService.GetPersonalInfo(nationalCode, dateOfBirth);
|
||||
|
||||
|
||||
if (apiRespons == null)
|
||||
throw new InternalServerException("سیستم احراز هویت در دسترس نمی باشد");
|
||||
|
||||
if (apiRespons.ResponseContext.Status.Code ==14)
|
||||
|
||||
if (apiRespons.ResponseContext.Status.Code == 14)
|
||||
throw new InternalServerException("سیستم احراز هویت در دسترس نمی باشد");
|
||||
|
||||
|
||||
if (apiRespons.ResponseContext.Status.Code != 0)
|
||||
return op.Failed($"{apiRespons.ResponseContext.Status.Message}");
|
||||
|
||||
@@ -1420,6 +1436,7 @@ public class EmployerApplication : IEmployerApplication
|
||||
? apiRespons.IdentificationInformation.NationalId
|
||||
: apiRespons.IdentificationInformation.ShenasnamehNumber;
|
||||
|
||||
|
||||
var res = new AuthenticateUserViewModel()
|
||||
{
|
||||
DateOfBirth = dateOfBirth,
|
||||
@@ -1436,6 +1453,12 @@ public class EmployerApplication : IEmployerApplication
|
||||
return op.Succcedded(res);
|
||||
}
|
||||
|
||||
public Task<ActionResult<EditEmployerWorkflowRegistration>> GetWorkflowRegistrationForEdit(long employerId,
|
||||
long institutionWorkshopDetailsId)
|
||||
{
|
||||
return _EmployerRepository.GetWorkflowRegistrationForEdit(employerId, institutionWorkshopDetailsId);
|
||||
}
|
||||
|
||||
private async Task<OperationResult<Employer>> CreateLegalEmployerRegistration(
|
||||
CreateLegalEmployerWorkflowRegistration command, long contractingPartyId)
|
||||
{
|
||||
@@ -1502,6 +1525,11 @@ public class EmployerApplication : IEmployerApplication
|
||||
command.GovernmentSystemInfo.EServiceUsername, command.GovernmentSystemInfo.EServicePassword,
|
||||
command.GovernmentSystemInfo.TaxUsername, command.GovernmentSystemInfo.TaxPassword,
|
||||
command.GovernmentSystemInfo.SanaUsername, command.GovernmentSystemInfo.SanaPassword);
|
||||
if (command.IsAuth)
|
||||
{
|
||||
legalEmployerData.LegalAuthentication(command.CeoFName,command.CeoLName,command.CeoFatherName,
|
||||
command.CeoIdNumber,command.IdNumberSeri,command.IdNumberSerial,command.CeoDateOfBirth,command.Gender,command.PhoneNumber);
|
||||
}
|
||||
|
||||
await _EmployerRepository.CreateAsync(legalEmployerData);
|
||||
await _EmployerRepository.SaveChangesAsync();
|
||||
@@ -1555,6 +1583,12 @@ public class EmployerApplication : IEmployerApplication
|
||||
command.GovernmentSystemInfo.EServicePassword,
|
||||
command.GovernmentSystemInfo.TaxUsername, command.GovernmentSystemInfo.TaxPassword,
|
||||
command.GovernmentSystemInfo.SanaUsername, command.GovernmentSystemInfo.SanaPassword);
|
||||
if (command.IsAuth)
|
||||
{
|
||||
employerData.Authentication(command.FName, command.LName, command.FatherName, command.IdNumber,
|
||||
command.IdNumberSeri,
|
||||
command.IdNumberSerial, command.DateOfBirth, command.Gender, command.PhoneNumber);
|
||||
}
|
||||
|
||||
await _EmployerRepository.CreateAsync(employerData);
|
||||
await _EmployerRepository.SaveChangesAsync();
|
||||
@@ -1664,5 +1698,6 @@ public class EmployerApplication : IEmployerApplication
|
||||
await _EmployerRepository.SaveChangesAsync();
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -1259,6 +1259,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
{
|
||||
var details = await _institutionContractRepository.GetInstitutionWorkshopInitialDetails(workshopDetailsId);
|
||||
var services = details.Services;
|
||||
var newArchiveCode = _workshopRepository.GetLastArchiveCode() + 1;
|
||||
|
||||
var res = new InstitutionContractWorkshopDetailViewModel()
|
||||
{
|
||||
@@ -1271,7 +1272,9 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
InsuranceInPerson = services.InsuranceInPerson,
|
||||
RollCall = services.RollCall,
|
||||
RollCallInPerson = services.RollCallInPerson
|
||||
}
|
||||
},
|
||||
WorkshopName = details.WorkshopName,
|
||||
ArchiveCode =newArchiveCode
|
||||
};
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -1048,7 +1048,7 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
|
||||
var institutionContract =
|
||||
await _institutionContractRepository.GetIncludeWorkshopDetailsAsync(contractWorkshopInitial
|
||||
.InstitutionContractId);
|
||||
.WorkshopGroup.InstitutionContractId);
|
||||
if (institutionContract == null)
|
||||
{
|
||||
return operation.Failed("قرارداد مالی موسسه یافت نشد");
|
||||
|
||||
10971
CompanyManagment.EFCore/Migrations/20251014082438_add authenticate columns to employer.Designer.cs
generated
Normal file
10971
CompanyManagment.EFCore/Migrations/20251014082438_add authenticate columns to employer.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,49 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addauthenticatecolumnstoemployer : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "IdNumberSeri",
|
||||
table: "Employers",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "IdNumberSerial",
|
||||
table: "Employers",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsAuth",
|
||||
table: "Employers",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IdNumberSeri",
|
||||
table: "Employers");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IdNumberSerial",
|
||||
table: "Employers");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsAuth",
|
||||
table: "Employers");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6779,9 +6779,18 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("IdNumberSeri")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("IdNumberSerial")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsAuth")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("IsLegal")
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -30,6 +30,7 @@ public class WorkshopAccountRepository : RepositoryBase<long, WorkshopAccount>,
|
||||
Tax = x.Tax,
|
||||
IsActiveSting = x.IsActiveSting,
|
||||
WorkshopName = x.Workshop.WorkshopFullName,
|
||||
WorkshopIsActive = x.Workshop.IsActiveString
|
||||
|
||||
|
||||
}).ToList();
|
||||
|
||||
@@ -1181,6 +1181,33 @@ public class WorkshopRepository : RepositoryBase<long, Company.Domain.WorkshopAg
|
||||
return list.DistinctBy(x => x.Id).ToList();
|
||||
}
|
||||
|
||||
public int GetLastArchiveCode()
|
||||
{
|
||||
var archiveCodes = _context.Workshops
|
||||
.Where(x => !string.IsNullOrEmpty(x.ArchiveCode))
|
||||
.Select(x => x.ArchiveCode)
|
||||
.ToList();
|
||||
|
||||
int maxArchiveCode = 0;
|
||||
|
||||
foreach (var code in archiveCodes)
|
||||
{
|
||||
// Remove "b-" prefix if exists
|
||||
string cleanCode = code.StartsWith("b-") ? code.Substring(2) : code;
|
||||
|
||||
// Try to parse the clean code to an integer
|
||||
if (int.TryParse(cleanCode, out int codeValue))
|
||||
{
|
||||
if (codeValue > maxArchiveCode)
|
||||
{
|
||||
maxArchiveCode = codeValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return maxArchiveCode;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region NewByHeydari
|
||||
//public List<WorkshopViewModel> GetWorkshopByWorkshopIds(List<long> workshopIds)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.BaseControllers;
|
||||
@@ -115,9 +116,9 @@ public class EmployerController : AdminBaseController
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("select_list")]
|
||||
public async Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id)
|
||||
public async Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id,LegalType? legalType=null)
|
||||
{
|
||||
return await _employerApplication.GetSelectList(search, id);
|
||||
return await _employerApplication.GetSelectList(search, id,legalType);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -79,6 +79,13 @@ namespace ServiceHost.Areas.Admin.Controllers
|
||||
return result;
|
||||
}
|
||||
[HttpGet("edit-employer/{employerId}/{institutionWorkshopDetailsId}")]
|
||||
|
||||
public async Task<ActionResult<EditEmployerWorkflowRegistration>> GetEmployerForEdit(long employerId, long institutionWorkshopDetailsId)
|
||||
{
|
||||
var result = await _employerApplication.GetWorkflowRegistrationForEdit(employerId, institutionWorkshopDetailsId);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// حذف کارفرما از گردش کار ثبت نام
|
||||
/// </summary>
|
||||
|
||||
@@ -45,7 +45,8 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.WorkFlow
|
||||
public IActionResult OnGetWorkshopsWithDocumentsAwaitingUploadAjax()
|
||||
{
|
||||
var accountId = _authHelper.CurrentAccountId();
|
||||
var accountWorkshops = _workshopAccountRepository.GetList(accountId).Select(x => x.WorkshopId).ToList();
|
||||
var accountWorkshops = _workshopAccountRepository.GetList(accountId).Where(x=>x.WorkshopIsActive == "true")
|
||||
.Select(x => x.WorkshopId).ToList();
|
||||
var resultData = _adminWorkFlowApplication.GetWorkshopsWithDocumentsAwaitingUploadForAdmin(accountWorkshops);
|
||||
|
||||
return new JsonResult(new
|
||||
@@ -70,7 +71,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.WorkFlow
|
||||
public async Task<IActionResult> OnGetClientRejectedDocumentWorkshopsForAdmin()
|
||||
{
|
||||
var accountId = _authHelper.CurrentAccountId();
|
||||
var accountWorkshops = _workshopAccountRepository.GetList(accountId).Select(x => x.WorkshopId).ToList();
|
||||
var accountWorkshops = _workshopAccountRepository.GetList(accountId).Where(x=>x.WorkshopIsActive == "true").Select(x => x.WorkshopId).ToList();
|
||||
var resultData = await _employeeDocumentsApplication.GetClientRejectedDocumentWorkshopsForAdmin(accountWorkshops,_roleId);
|
||||
|
||||
return new JsonResult(new
|
||||
@@ -95,7 +96,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.WorkFlow
|
||||
public async Task<IActionResult> OnGetCreatedEmployeesWorkshopDocumentForAdmin()
|
||||
{
|
||||
var accountId = _authHelper.CurrentAccountId();
|
||||
var accountWorkshops = _workshopAccountRepository.GetList(accountId).Select(x => x.WorkshopId).ToList();
|
||||
var accountWorkshops = _workshopAccountRepository.GetList(accountId).Where(x=>x.WorkshopIsActive == "true").Select(x => x.WorkshopId).ToList();
|
||||
var resultData = await _employeeDocumentsApplication.GetCreatedEmployeesWorkshopDocumentForAdmin(accountWorkshops, _roleId);
|
||||
|
||||
return new JsonResult(new
|
||||
@@ -119,7 +120,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.WorkFlow
|
||||
public async Task<IActionResult> OnGetWorkshopDocumentRejectedForAdmin()
|
||||
{
|
||||
var accountId = _authHelper.CurrentAccountId();
|
||||
var accountWorkshops = _workshopAccountRepository.GetList(accountId).Select(x => x.WorkshopId).ToList();
|
||||
var accountWorkshops = _workshopAccountRepository.GetList(accountId).Where(x=>x.WorkshopIsActive == "true").Select(x => x.WorkshopId).ToList();
|
||||
var resultData =
|
||||
await _employeeDocumentsApplication.GetWorkshopDocumentRejectedForAdmin(accountWorkshops,
|
||||
_roleId);
|
||||
@@ -147,7 +148,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.WorkFlow
|
||||
public async Task<IActionResult> OnGetCountWorkFlowUploadDocument()
|
||||
{
|
||||
var accountId = _authHelper.CurrentAccountId();
|
||||
var accountWorkshops = _workshopAccountRepository.GetList(accountId).Select(x => x.WorkshopId).ToList();
|
||||
var accountWorkshops = _workshopAccountRepository.GetList(accountId).Where(x=>x.WorkshopIsActive == "true").Select(x => x.WorkshopId).ToList();
|
||||
|
||||
var resultDataWorkshopDocumentRejectedForAdmin = await _employeeDocumentsApplication.GetWorkshopDocumentRejectedForAdmin(accountWorkshops, _roleId);
|
||||
var resultDataCreatedEmployeesWorkshopDocumentForAdmin = await _employeeDocumentsApplication.GetCreatedEmployeesWorkshopDocumentForAdmin(accountWorkshops, _roleId);
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.WorkFlow
|
||||
public async System.Threading.Tasks.Task OnGet()
|
||||
{
|
||||
var accountId = _authHelper.CurrentAccountId();
|
||||
var accountWorkshops = _workshopAccountRepository.GetList(accountId).Select(x => x.WorkshopId).ToList();
|
||||
var accountWorkshops = _workshopAccountRepository.GetList(accountId).Where(x=>x.WorkshopIsActive == "true").Select(x => x.WorkshopId).ToList();
|
||||
EmployeeDocumentsAwaitingSubmitCount = await _adminWorkFlowApplication.GetEmployeeDocumentWorkFlowCountsForAdmin(accountWorkshops,_roleId );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user