amo merged
This commit is contained in:
@@ -4,5 +4,5 @@ public enum IsActive
|
||||
{
|
||||
False,
|
||||
True,
|
||||
|
||||
None
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace AccountManagement.Application.Contracts.Account;
|
||||
|
||||
public class AccountSelectListViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
}
|
||||
@@ -41,6 +41,8 @@ public interface IAccountApplication
|
||||
List<AccountViewModel> GetAccountsByPositionId(long positionId);
|
||||
|
||||
List<AccountViewModel> GetAccountEqualToLowerPositionValue();
|
||||
Task<List<AccountSelectListViewModel>> GetAdminSelectList();
|
||||
|
||||
OperationResult ReLogin();
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -627,7 +627,10 @@ public class AccountApplication : IAccountApplication
|
||||
|
||||
}
|
||||
|
||||
|
||||
public async Task<List<AccountSelectListViewModel>> GetAdminSelectList()
|
||||
{
|
||||
return await _accountRepository.GetAdminSelectList();
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region Pooya
|
||||
|
||||
@@ -27,6 +27,8 @@ namespace AccountManagement.Domain.AccountAgg
|
||||
List<AccountViewModel> GetAccountEqualToLowerPositionValue();
|
||||
AccountViewModel GetAccountViewModel(long id);
|
||||
List<AccountViewModel> GetAccountsDeactivePositionValue(long Positionid);
|
||||
Task<List<AccountSelectListViewModel>> GetAdminSelectList();
|
||||
|
||||
#endregion
|
||||
|
||||
List<AccountViewModel> GetAdminAccountsNew();
|
||||
|
||||
@@ -312,6 +312,16 @@ public class AccountRepository : RepositoryBase<long, Account>, IAccountReposito
|
||||
IsActiveString = x.IsActive ? "true" : "false",
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public async Task<List<AccountSelectListViewModel>> GetAdminSelectList()
|
||||
{
|
||||
return await _context.Accounts.Where(x => x.AdminAreaPermission == "true").Select(x => new AccountSelectListViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
Name = x.Fullname
|
||||
}).ToListAsync();
|
||||
}
|
||||
|
||||
//public List<AccountViewModel> GetAdminAccounts()
|
||||
//{
|
||||
// return _context.Accounts.Where(x=>x.AdminAreaPermission == "true" && x.IsActiveString == "true").Select(x => new AccountViewModel()
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.AdminMonthlyOverview;
|
||||
using Microsoft.AspNetCore.JsonPatch.Operations;
|
||||
|
||||
namespace Company.Domain.AdminMonthlyOverviewAgg;
|
||||
|
||||
public class AdminMonthlyOverview:EntityBase
|
||||
{
|
||||
public AdminMonthlyOverview(long workshopId, int month, int year, AdminMonthlyOverviewStatus status)
|
||||
{
|
||||
WorkshopId = workshopId;
|
||||
Month = month;
|
||||
Year = year;
|
||||
Status = status;
|
||||
}
|
||||
|
||||
public long WorkshopId { get; set; }
|
||||
public int Month { get; set; }
|
||||
public int Year { get; set; }
|
||||
public AdminMonthlyOverviewStatus Status { get; set; }
|
||||
|
||||
public void Next()
|
||||
{
|
||||
var maxValue = Enum.GetValues(typeof(AdminMonthlyOverviewStatus))
|
||||
.Cast<AdminMonthlyOverviewStatus>()
|
||||
.Max();
|
||||
|
||||
if (Status >= maxValue)
|
||||
{
|
||||
throw new InvalidDataException("تغییر وضعیت وارد شده نامعتبر است");
|
||||
}
|
||||
Status += 1;
|
||||
}
|
||||
|
||||
public void Back()
|
||||
{
|
||||
var minValue = Enum.GetValues(typeof(AdminMonthlyOverviewStatus))
|
||||
.Cast<AdminMonthlyOverviewStatus>()
|
||||
.Min();
|
||||
|
||||
if (Status <= minValue)
|
||||
{
|
||||
throw new InvalidDataException("تغییر وضعیت وارد شده نامعتبر است");
|
||||
}
|
||||
Status -= 1;
|
||||
}
|
||||
|
||||
public void SetStatus(AdminMonthlyOverviewStatus status)
|
||||
{
|
||||
Status = status;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.AdminMonthlyOverview;
|
||||
|
||||
namespace Company.Domain.AdminMonthlyOverviewAgg;
|
||||
|
||||
public interface IAdminMonthlyOverviewRepository:IRepository<long, AdminMonthlyOverview>
|
||||
{
|
||||
Task<List<AdminMonthlyOverviewListViewModel>> GetWorkshopStatus(AdminMonthlyOverviewSearchModel searchModel);
|
||||
Task<AdminMonthlyOverViewCounterVm> GetCounter(int year, int month, long accountId);
|
||||
}
|
||||
@@ -69,6 +69,8 @@ public interface IWorkshopRepository : IRepository<long, Workshop>
|
||||
Task<int> GetWorkshopsForEmployeeStartWorkCount(long accountId);
|
||||
Task<List<WorkshopWithLeftWorkTempEmployeesDto>> GetWorkshopsForLeftWorkTemp(long accountId);
|
||||
Task<int> GetWorkshopsForLeftWorkTempCount(long accountId);
|
||||
Task<List<WorkshopSelectListViewModel>> GetSelectList(string search);
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
@@ -33,6 +34,9 @@ public interface IEmployerRepository : IRepository<long, Employer>
|
||||
|
||||
List<EmployerViewModel> GetEmployersHasWorkshop();
|
||||
|
||||
Task<List<EmployerSelectListViewModel>> GetSelectList(string search);
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region NewByHeydari
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace CompanyManagment.App.Contracts.AdminMonthlyOverview;
|
||||
|
||||
public enum AdminMonthlyOverviewStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// تنظیم مستندات - فیش و قرارداد
|
||||
/// </summary>
|
||||
CreateDocuments = 0,
|
||||
/// <summary> در انتظار مراجعه </summary>
|
||||
VisitPending = 1,
|
||||
/// <summary> در حال مراجعه </summary>
|
||||
VisitInProgress = 2,
|
||||
/// <summary> اتمام مراجعه </summary>
|
||||
VisitCompleted = 3,
|
||||
/// <summary> بایگانی شد </summary>
|
||||
Archived = 4
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.AdminMonthlyOverview;
|
||||
|
||||
public interface IAdminMonthlyOverviewApplication
|
||||
{
|
||||
/// <summary>
|
||||
/// نمایش لیست ماهانه کارگاه ها - درصورت وجود نداشتن اطلاعات در این ماه، یک رکورد جدید ایجاد میکند
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<AdminMonthlyOverviewListViewModel>> GetWorkshopListByStatus(AdminMonthlyOverviewSearchModel searchModel);
|
||||
|
||||
/// <summary>
|
||||
/// شمارش تعداد هر تب
|
||||
/// </summary>
|
||||
/// <param name="year"></param>
|
||||
/// <param name="month"></param>
|
||||
/// <param name="accountId"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminMonthlyOverViewCounterVm> GetCounter(int year, int month, long accountId);
|
||||
|
||||
/// <summary>
|
||||
/// رفتن به مرحله بعدی
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> Next(long id);
|
||||
|
||||
/// <summary>
|
||||
/// برگشت به مرحله قبل
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> Back(long id);
|
||||
}
|
||||
|
||||
public class AdminMonthlyOverViewCounterVm
|
||||
{
|
||||
public int CreateDocument { get; set; }
|
||||
public int VisitPending { get; set; }
|
||||
public int VisitInProgress { get; set; }
|
||||
public int VisitCompleted { get; set; }
|
||||
public int Archived { get; set; }
|
||||
public int All { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class AdminMonthlyOverviewSearchModel
|
||||
{
|
||||
public int Year { get; set; }
|
||||
public int Month { get; set; }
|
||||
public long WorkshopId { get; set; }
|
||||
public long EmployerId { get; set; }
|
||||
public long AdminAccountId { get; set; }
|
||||
public IsActive ActivationStatus { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class AdminMonthlyOverviewListViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public long WorkshopId { get; set; }
|
||||
public string WorkshopName { get; set; }
|
||||
public string WorkshopArchiveCode { get; set; }
|
||||
public string Province { get; set; }
|
||||
public string City { get; set; }
|
||||
public string Address { get; set; }
|
||||
public string AgentPhoneNumber { get; set; }
|
||||
public string AdminFullName { get; set; }
|
||||
public string EmployerName { get; set; }
|
||||
public string EmployerPhoneNumber { get; set; }
|
||||
public int EmployeeCount { get; set; }
|
||||
public AdminMonthlyOverviewStatus Status { get; set; }
|
||||
public bool IsBlock { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
|
||||
public class EmployerSelectListViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
|
||||
@@ -35,6 +36,8 @@ public interface IEmployerApplication
|
||||
#region Mahan
|
||||
|
||||
List<EmployerViewModel> GetEmployersHasWorkshop();
|
||||
Task<List<EmployerSelectListViewModel>> GetSelectList(string search);
|
||||
|
||||
#endregion
|
||||
#region NewByHeydari
|
||||
OperationResult DeleteEmployer(long id);
|
||||
|
||||
@@ -85,6 +85,8 @@ public interface IWorkshopApplication
|
||||
|
||||
Task<List<WorkshopWithLeftWorkTempEmployeesDto>> GetWorkshopsForLeftWorkTemp(long accountId);
|
||||
Task<int> GetWorkshopsForLeftWorkTempCount(long accountId);
|
||||
Task<List<WorkshopSelectListViewModel>> GetSelectList(string search);
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace CompanyManagment.App.Contracts.Workshop;
|
||||
|
||||
public class WorkshopSelectListViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string ArchiveCode { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.AdminMonthlyOverviewAgg;
|
||||
using CompanyManagment.App.Contracts.AdminMonthlyOverview;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
public class AdminMonthlyOverviewApplication:IAdminMonthlyOverviewApplication
|
||||
{
|
||||
private readonly IAdminMonthlyOverviewRepository _adminMonthlyOverviewRepository;
|
||||
|
||||
public AdminMonthlyOverviewApplication(IAdminMonthlyOverviewRepository adminMonthlyOverviewRepository)
|
||||
{
|
||||
_adminMonthlyOverviewRepository = adminMonthlyOverviewRepository;
|
||||
}
|
||||
|
||||
public async Task<List<AdminMonthlyOverviewListViewModel>> GetWorkshopListByStatus(AdminMonthlyOverviewSearchModel searchModel)
|
||||
{
|
||||
return await _adminMonthlyOverviewRepository.GetWorkshopStatus(searchModel);
|
||||
}
|
||||
|
||||
public async Task<AdminMonthlyOverViewCounterVm> GetCounter(int year, int month, long accountId)
|
||||
{
|
||||
return await _adminMonthlyOverviewRepository.GetCounter(year, month, accountId);
|
||||
}
|
||||
|
||||
public async Task<OperationResult> Next(long id)
|
||||
{
|
||||
var operation= new OperationResult();
|
||||
var monthlyOverview = _adminMonthlyOverviewRepository.Get(id);
|
||||
if (monthlyOverview == null)
|
||||
{
|
||||
return operation.Failed("آیتم موردنظر یافت نشد");
|
||||
}
|
||||
|
||||
if (monthlyOverview.Status== AdminMonthlyOverviewStatus.CreateDocuments)
|
||||
{
|
||||
return operation.Failed("شما نمیتوانید تا زمانی که قرارداد و تصفیه را تنظیم نکردید به مرحله بعد بروید");
|
||||
}
|
||||
|
||||
var maxValue = Enum.GetValues(typeof(AdminMonthlyOverviewStatus))
|
||||
.Cast<AdminMonthlyOverviewStatus>()
|
||||
.Max();
|
||||
|
||||
if (monthlyOverview.Status >= maxValue)
|
||||
{
|
||||
return operation.Failed("مرحله بعدی انتخاب شده نامعتبر است");
|
||||
}
|
||||
|
||||
monthlyOverview.Next();
|
||||
await _adminMonthlyOverviewRepository.SaveChangesAsync();
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
public async Task<OperationResult> Back(long id)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
var monthlyOverview = _adminMonthlyOverviewRepository.Get(id);
|
||||
if (monthlyOverview == null)
|
||||
{
|
||||
return operation.Failed("آیتم موردنظر یافت نشد");
|
||||
}
|
||||
|
||||
if (monthlyOverview.Status == AdminMonthlyOverviewStatus.CreateDocuments+1)
|
||||
{
|
||||
return operation.Failed("شما امکان برگشت به مرحله قبل را ندارید");
|
||||
}
|
||||
|
||||
var minValue = Enum.GetValues(typeof(AdminMonthlyOverviewStatus))
|
||||
.Cast<AdminMonthlyOverviewStatus>()
|
||||
.Min();
|
||||
|
||||
if (monthlyOverview.Status <= minValue)
|
||||
{
|
||||
return operation.Failed("مرحله قبلی انتخاب شده نامعتبر است");
|
||||
}
|
||||
|
||||
monthlyOverview.Back();
|
||||
await _adminMonthlyOverviewRepository.SaveChangesAsync();
|
||||
|
||||
return operation.Succcedded();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.empolyerAgg;
|
||||
using Company.Domain.WorkshopAgg;
|
||||
@@ -892,6 +893,11 @@ public class EmployerApplication : IEmployerApplication
|
||||
{
|
||||
return _EmployerRepository.GetEmployersHasWorkshop();
|
||||
}
|
||||
|
||||
public async Task<List<EmployerSelectListViewModel>> GetSelectList(string search)
|
||||
{
|
||||
return await _EmployerRepository.GetSelectList(search);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region NewByHeydari
|
||||
|
||||
@@ -864,6 +864,11 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
return _workshopRepository.GetWorkshopsForLeftWorkTempCount(accountId);
|
||||
}
|
||||
|
||||
public async Task<List<WorkshopSelectListViewModel>> GetSelectList(string search)
|
||||
{
|
||||
return await _workshopRepository.GetSelectList(search);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Company.Domain.AndroidApkVersionAgg;
|
||||
using Company.Domain.AdminMonthlyOverviewAgg;
|
||||
using Company.Domain.AndroidApkVersionAgg;
|
||||
using Company.Domain.BankAgg;
|
||||
using Company.Domain.BillAgg;
|
||||
using Company.Domain.Board;
|
||||
@@ -176,6 +177,7 @@ public class CompanyContext : DbContext
|
||||
public DbSet<LeftWorkTemp> LeftWorkTemps { get; set; }
|
||||
|
||||
public DbSet<EmployeeAuthorizeTemp> EmployeeAuthorizeTemps { get; set; }
|
||||
public DbSet<AdminMonthlyOverview> AdminMonthlyOverviews { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Pooya
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
using Company.Domain.AdminMonthlyOverviewAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping;
|
||||
|
||||
public class AdminMonthlyOverviewMapping:IEntityTypeConfiguration<AdminMonthlyOverview>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<AdminMonthlyOverview> builder)
|
||||
{
|
||||
builder.HasKey(x => x.id);
|
||||
builder.Property(x => x.Status).HasConversion<string>().HasMaxLength(155);
|
||||
}
|
||||
}
|
||||
9563
CompanyManagment.EFCore/Migrations/20250518144114_add admin monthly overview table.Designer.cs
generated
Normal file
9563
CompanyManagment.EFCore/Migrations/20250518144114_add admin monthly overview table.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addadminmonthlyoverviewtable : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AdminMonthlyOverviews",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
WorkshopId = table.Column<long>(type: "bigint", nullable: false),
|
||||
Month = table.Column<int>(type: "int", nullable: false),
|
||||
Year = table.Column<int>(type: "int", nullable: false),
|
||||
Status = table.Column<string>(type: "nvarchar(155)", maxLength: 155, nullable: false),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AdminMonthlyOverviews", x => x.id);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "AdminMonthlyOverviews");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,36 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Company.Domain.AdminMonthlyOverviewAgg.AdminMonthlyOverview", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("Month")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.IsRequired()
|
||||
.HasMaxLength(155)
|
||||
.HasColumnType("nvarchar(155)");
|
||||
|
||||
b.Property<long>("WorkshopId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<int>("Year")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("AdminMonthlyOverviews");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.AndroidApkVersionAgg.AndroidApkVersion", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
|
||||
@@ -0,0 +1,274 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using _0_Framework.InfraStructure;
|
||||
using AccountMangement.Infrastructure.EFCore;
|
||||
using Company.Domain.AdminMonthlyOverviewAgg;
|
||||
using CompanyManagment.App.Contracts.AdminMonthlyOverview;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class AdminMonthlyOverviewRepository : RepositoryBase<long, AdminMonthlyOverview>, IAdminMonthlyOverviewRepository
|
||||
{
|
||||
private readonly CompanyContext _companyContext;
|
||||
private readonly AccountContext _accountContext;
|
||||
public AdminMonthlyOverviewRepository(CompanyContext companyContext, AccountContext accountContext) : base(companyContext)
|
||||
{
|
||||
_companyContext = companyContext;
|
||||
_accountContext = accountContext;
|
||||
}
|
||||
|
||||
public async Task<List<AdminMonthlyOverviewListViewModel>> GetWorkshopStatus(AdminMonthlyOverviewSearchModel searchModel)
|
||||
{
|
||||
|
||||
var year = searchModel.Year;
|
||||
var month = searchModel.Month;
|
||||
var accountId = searchModel.AdminAccountId;
|
||||
// اگر تبدیل تاریخ به میلادی موفق نبود، لیست خالی برگردان
|
||||
if ($"{year:0000}/{month:00}/01".TryToGeorgianDateTime(out var targetDate) == false)
|
||||
return [];
|
||||
|
||||
// دریافت اطلاعات ادمین
|
||||
var adminAccount = await _accountContext.Accounts.FirstOrDefaultAsync(x => x.id == searchModel.AdminAccountId);
|
||||
|
||||
// اگر ادمین پیدا نشد، لیست خالی برگردان
|
||||
if (adminAccount == null)
|
||||
return [];
|
||||
|
||||
// دریافت طرف حساب های معتبر برای تاریخ مورد نظر
|
||||
var contractingPartyIds = _companyContext.InstitutionContractSet.AsNoTracking()
|
||||
.Where(c => c.ContractStartGr <= targetDate && c.ContractEndGr >= targetDate && c.IsActiveString == "true")
|
||||
.Select(c => c.ContractingPartyId);
|
||||
|
||||
// دریافت کارگاههای مرتبط با اکانت
|
||||
var accountWorkshopIds = _companyContext.WorkshopAccounts
|
||||
.AsNoTracking()
|
||||
.Where(w => w.AccountId == accountId)
|
||||
.Select(w => w.WorkshopId);
|
||||
|
||||
// دریافت کارگاههای مربوط به طرف حساب و اکانت
|
||||
// Replace the selected code with the following to return a list of anonymous objects containing both workshop and contractingParty
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var workshopsWithContractingParty =await _companyContext.Workshops
|
||||
.AsNoTracking()
|
||||
.Where(w => accountWorkshopIds.Contains(w.id))
|
||||
.Include(w => w.WorkshopEmployers)
|
||||
.ThenInclude(we => we.Employer)
|
||||
.ThenInclude(e => e.ContractingParty).AsSplitQuery().
|
||||
Where(w => w.WorkshopEmployers.Any(we =>
|
||||
we.Employer != null &&
|
||||
contractingPartyIds.Contains(we.Employer.ContractingPartyId)))
|
||||
.Select(w => new
|
||||
{
|
||||
Workshop = w,
|
||||
ContractingParty = w.WorkshopEmployers
|
||||
.Where(we => we.Employer != null && contractingPartyIds.Contains(we.Employer.ContractingPartyId))
|
||||
.Select(we => we.Employer.ContractingParty)
|
||||
.FirstOrDefault()
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
var workshopIds = workshopsWithContractingParty.Select(x => x.Workshop.id).ToList();
|
||||
|
||||
// پیدا کردن کارگاههایی که قبلاً برای این ماه/سال AdminMonthlyOverview دارند
|
||||
var adminMonthlyOverviewWorkshopIds = await _companyContext.AdminMonthlyOverviews
|
||||
.AsNoTracking()
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.Month == month && x.Year == year)
|
||||
.Select(x => x.WorkshopId)
|
||||
.ToListAsync();
|
||||
|
||||
// پیدا کردن کارگاههایی که نیاز به ایجاد AdminMonthlyOverview جدید دارند
|
||||
var notExistAdminMonthlyReviewsWorkshopIds = workshopIds
|
||||
.Except(adminMonthlyOverviewWorkshopIds)
|
||||
.ToList();
|
||||
|
||||
|
||||
// ایجاد رکوردهای AdminMonthlyOverview که وجود ندارند
|
||||
if (notExistAdminMonthlyReviewsWorkshopIds.Any())
|
||||
await CreateRangeAdminMonthlyOverview(notExistAdminMonthlyReviewsWorkshopIds, month, year);
|
||||
|
||||
// بهروزرسانی وضعیتها
|
||||
await UpdateAdminMonthlyOverviewStatus(year, month, workshopIds);
|
||||
|
||||
if (searchModel.ActivationStatus != IsActive.None)
|
||||
{
|
||||
var isBlock = searchModel.ActivationStatus == IsActive.True ? "true" : "false";
|
||||
|
||||
workshopsWithContractingParty = workshopsWithContractingParty
|
||||
.Where(x => x.ContractingParty?.IsBlock == isBlock).ToList();
|
||||
|
||||
workshopIds = workshopsWithContractingParty.Select(x => x.Workshop.id).ToList();
|
||||
}
|
||||
|
||||
// دریافت همه AdminMonthlyOverview برای این کارگاهها/ماه/سال
|
||||
var adminMonthlyOverviewsQuery = _companyContext.AdminMonthlyOverviews
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.Month == month && x.Year == year);
|
||||
|
||||
if (searchModel.WorkshopId > 0)
|
||||
{
|
||||
adminMonthlyOverviewsQuery = adminMonthlyOverviewsQuery.Where(x => x.WorkshopId == searchModel.WorkshopId);
|
||||
}
|
||||
|
||||
if (searchModel.EmployerId > 0)
|
||||
{
|
||||
var searchWorkshopId = workshopsWithContractingParty.Where(x => x.Workshop.WorkshopEmployers.Any(e => e.EmployerId == searchModel.EmployerId)).Select(x => x.Workshop.id).ToList();
|
||||
adminMonthlyOverviewsQuery = adminMonthlyOverviewsQuery.Where(x => searchWorkshopId.Contains(x.WorkshopId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
var adminMonthlyOverviewsList = await adminMonthlyOverviewsQuery.ToListAsync();
|
||||
var employeeCounts = _companyContext.LeftWorkList.Where(x =>
|
||||
x.StartWorkDate < targetDate && x.LeftWorkDate > targetDate && workshopIds.Contains(x.WorkshopId))
|
||||
.GroupBy(x => x.WorkshopId).Select(x => new { EmployeeCounts = x.Count(), WorkshopId = x.Key }).ToList();
|
||||
|
||||
var adminMonthlyOverviewList = adminMonthlyOverviewsList.Select(x =>
|
||||
{
|
||||
var employeeCount = employeeCounts.FirstOrDefault(e => e.WorkshopId == x.WorkshopId);
|
||||
var workshopWithContractingParty =
|
||||
workshopsWithContractingParty.FirstOrDefault(w => w.Workshop.id == x.WorkshopId);
|
||||
|
||||
var workshop = workshopWithContractingParty?.Workshop;
|
||||
var contractingParty = workshopWithContractingParty?.ContractingParty;
|
||||
var employer = workshop?.WorkshopEmployers.FirstOrDefault()?.Employer;
|
||||
return new AdminMonthlyOverviewListViewModel
|
||||
{
|
||||
WorkshopId = x.WorkshopId,
|
||||
Status = x.Status,
|
||||
Id = x.id,
|
||||
WorkshopName = workshop?.WorkshopFullName ?? "",
|
||||
WorkshopArchiveCode = workshop?.ArchiveCode ?? "",
|
||||
Address = workshop?.Address ?? "",
|
||||
City = workshop?.City ?? "",
|
||||
Province = workshop?.State ?? "",
|
||||
EmployerName = employer?.FullName ?? "",
|
||||
EmployerPhoneNumber = employer?.Phone ?? "",
|
||||
AdminFullName = adminAccount.Fullname,
|
||||
EmployeeCount = employeeCount?.EmployeeCounts ?? 0,
|
||||
AgentPhoneNumber = "",
|
||||
IsBlock = contractingParty?.IsBlock == "true"
|
||||
};
|
||||
}).OrderBy(x => x.IsBlock).ToList();
|
||||
|
||||
|
||||
return adminMonthlyOverviewList;
|
||||
}
|
||||
|
||||
public async Task<AdminMonthlyOverViewCounterVm> GetCounter(int year, int month, long accountId)
|
||||
{
|
||||
var searchModel = new AdminMonthlyOverviewSearchModel()
|
||||
{
|
||||
AdminAccountId = accountId,
|
||||
Month = month,
|
||||
Year = year
|
||||
};
|
||||
var list = await GetWorkshopStatus(searchModel);
|
||||
|
||||
var allCount = list.Count;
|
||||
var archivedCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.Archived);
|
||||
var createDocCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.CreateDocuments);
|
||||
var visitCompleteCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitCompleted);
|
||||
var visitInProgressCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitInProgress);
|
||||
var visitPendingCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitPending);
|
||||
|
||||
return new AdminMonthlyOverViewCounterVm
|
||||
{
|
||||
All = allCount,
|
||||
Archived = archivedCount,
|
||||
VisitPending = visitPendingCount,
|
||||
VisitInProgress = visitInProgressCount,
|
||||
VisitCompleted = visitCompleteCount,
|
||||
CreateDocument = createDocCount
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
private async Task UpdateAdminMonthlyOverviewStatus(int year, int month, List<long> workshopIds)
|
||||
{
|
||||
var targetDate = $"{year:0000}/{month:00}/01".ToGeorgianDateTime();
|
||||
_ = $"{year:0000}/{month:00}/01".ToGeorgianDateTime().AddMonthsFa(1, out var nextMonth);
|
||||
|
||||
|
||||
var workingEmployeeIds = (await _companyContext.LeftWorkList.AsNoTracking()
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.StartWorkDate <= targetDate && x.LeftWorkDate >= targetDate)
|
||||
.Select(x => new { x.WorkshopId, x.EmployeeId })
|
||||
.ToListAsync()).Distinct();
|
||||
|
||||
var contractSet = (await _companyContext.Contracts.AsNoTracking()
|
||||
.Where(x => x.ContarctStart <= nextMonth && x.ContractEnd >= nextMonth)
|
||||
.Select(x => new { x.WorkshopIds, x.EmployeeId })
|
||||
.ToListAsync())
|
||||
.Select(x => (x.WorkshopIds, x.EmployeeId))
|
||||
.ToHashSet();
|
||||
|
||||
var checkoutSet = (await _companyContext.CheckoutSet.AsNoTracking()
|
||||
.Where(x => x.ContractStart <= targetDate && x.ContractEnd >= targetDate)
|
||||
.Select(x => new { x.WorkshopId, x.EmployeeId })
|
||||
.ToListAsync())
|
||||
.Select(x => (x.WorkshopId, x.EmployeeId))
|
||||
.ToHashSet();
|
||||
|
||||
var grouped = workingEmployeeIds.GroupBy(x => x.WorkshopId).ToList();
|
||||
|
||||
var workshopsWithFullContracts = grouped
|
||||
.Where(g => g.All(emp => contractSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||
.Select(g => g.Key)
|
||||
.ToList();
|
||||
|
||||
var workshopsWithFullCheckout = grouped
|
||||
.Where(g => g.All(emp => checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||
.Select(g => g.Key)
|
||||
.ToList();
|
||||
|
||||
var fullyCoveredWorkshops = workshopsWithFullContracts.Intersect(workshopsWithFullCheckout).ToList();
|
||||
|
||||
var notFullyCoveredWorkshops = grouped
|
||||
.Where(g => g.Any(emp =>
|
||||
!contractSet.Contains((emp.WorkshopId, emp.EmployeeId)) ||
|
||||
!checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||
.Select(g => g.Key)
|
||||
.ToList();
|
||||
|
||||
var adminMonthlyOverviews = _companyContext.AdminMonthlyOverviews
|
||||
.Where(x => x.Month == month && x.Year == year);
|
||||
|
||||
var adminMonthlyOverviewsWithFullContracts = await adminMonthlyOverviews
|
||||
.Where(x => fullyCoveredWorkshops.Contains(x.WorkshopId) && x.Status == AdminMonthlyOverviewStatus.CreateDocuments)
|
||||
.ToListAsync();
|
||||
|
||||
var adminMonthlyOverviewsWithNotFullContracts = await adminMonthlyOverviews
|
||||
.Where(x => notFullyCoveredWorkshops.Contains(x.WorkshopId) && x.Status != AdminMonthlyOverviewStatus.CreateDocuments)
|
||||
.ToListAsync();
|
||||
|
||||
foreach (var adminMonthlyOverview in adminMonthlyOverviewsWithFullContracts)
|
||||
adminMonthlyOverview.SetStatus(AdminMonthlyOverviewStatus.VisitPending);
|
||||
|
||||
foreach (var adminMonthlyOverview in adminMonthlyOverviewsWithNotFullContracts)
|
||||
adminMonthlyOverview.SetStatus(AdminMonthlyOverviewStatus.CreateDocuments);
|
||||
|
||||
await _companyContext.SaveChangesAsync();
|
||||
}
|
||||
|
||||
private async Task CreateRangeAdminMonthlyOverview(List<long> workshopIds, int month, int year)
|
||||
{
|
||||
foreach (var workshopId in workshopIds)
|
||||
{
|
||||
var adminMonthlyOverview =
|
||||
new AdminMonthlyOverview(workshopId, month, year, AdminMonthlyOverviewStatus.CreateDocuments);
|
||||
await _companyContext.AddAsync(adminMonthlyOverview);
|
||||
}
|
||||
|
||||
await _companyContext.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.EmployerAccountAgg;
|
||||
@@ -580,6 +581,21 @@ public class EmployerRepository : RepositoryBase<long, Employer>, IEmployerRepos
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public async Task<List<EmployerSelectListViewModel>> GetSelectList(string search)
|
||||
{
|
||||
var query = _context.Employers.Select(x => new EmployerSelectListViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
Name = x.FullName
|
||||
});
|
||||
if (!string.IsNullOrWhiteSpace(search))
|
||||
{
|
||||
query = query.Where(x => x.Name.Contains(search));
|
||||
}
|
||||
|
||||
return await query.Take(100).ToListAsync();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region NewByHeydari
|
||||
|
||||
@@ -1148,6 +1148,21 @@ public class WorkshopRepository : RepositoryBase<long, Company.Domain.WorkshopAg
|
||||
|
||||
}
|
||||
|
||||
public async Task<List<WorkshopSelectListViewModel>> GetSelectList(string search)
|
||||
{
|
||||
var query = _context.Workshops.Select(x => new WorkshopSelectListViewModel()
|
||||
{
|
||||
ArchiveCode = x.ArchiveCode,
|
||||
Id = x.id,
|
||||
Name = x.WorkshopFullName
|
||||
});
|
||||
if (!string.IsNullOrWhiteSpace(search))
|
||||
{
|
||||
query = query.Where(x => x.Name.Contains(search));
|
||||
}
|
||||
|
||||
return await query.Take(100).ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -206,6 +206,8 @@ using CompanyManagment.App.Contracts.InstitutionPlan;
|
||||
using CompanyManagment.App.Contracts.LeftWorkTemp;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
using Company.Domain.AdminMonthlyOverviewAgg;
|
||||
using CompanyManagment.App.Contracts.AdminMonthlyOverview;
|
||||
|
||||
namespace PersonalContractingParty.Config;
|
||||
|
||||
@@ -427,6 +429,8 @@ public class PersonalBootstrapper
|
||||
|
||||
services.AddTransient<IEmployeeAuthorizeTempRepository, EmployeeAuthorizeTempRepository>();
|
||||
|
||||
services.AddTransient<IAdminMonthlyOverviewRepository, AdminMonthlyOverviewRepository>();
|
||||
services.AddTransient<IAdminMonthlyOverviewApplication, AdminMonthlyOverviewApplication>();
|
||||
#endregion
|
||||
#region Pooya
|
||||
|
||||
|
||||
@@ -455,6 +455,14 @@
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a asp-area="AdminNew" asp-page="/Company/MonthlyOverview/Index" class="waves-effect btnWorkFlow" style="display: flex;align-items: center;justify-content: space-between;">
|
||||
<div class="menuTitle">
|
||||
<i class="md md-home"></i>
|
||||
<span> بررسی امور ماهانه </span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,115 @@
|
||||
using _0_Framework.Application;
|
||||
using AccountManagement.Application.Contracts.Account;
|
||||
using CompanyManagment.App.Contracts.AdminMonthlyOverview;
|
||||
using CompanyManagment.App.Contracts.CustomizeCheckout;
|
||||
using CompanyManagment.App.Contracts.YearlySalary;
|
||||
using CompanyManagment.Application;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using ServiceHost.Areas.Client.Pages.Company.CustomizeCheckout;
|
||||
using System.Globalization;
|
||||
|
||||
namespace ServiceHost.Areas.AdminNew.Pages.Company.MonthlyOverview
|
||||
{
|
||||
public class IndexModel : PageModel
|
||||
{
|
||||
private readonly IAdminMonthlyOverviewApplication _adminMonthlyOverviewApplication;
|
||||
private readonly IAuthHelper _authHelper;
|
||||
private readonly IYearlySalaryApplication _yearlySalaryApplication;
|
||||
public List<string> YearlyList;
|
||||
public AdminMonthlyOverviewSearchModel SearchModel;
|
||||
private readonly IWorkshopApplication _workshopApplication;
|
||||
private readonly IEmployerApplication _employerApplication;
|
||||
private readonly IAccountApplication _accountApplication;
|
||||
|
||||
public IndexModel(IAdminMonthlyOverviewApplication adminMonthlyOverviewApplication, IAuthHelper authHelper,
|
||||
IWorkshopApplication workshopApplication, IEmployerApplication employerApplication,
|
||||
IAccountApplication accountApplication, IYearlySalaryApplication yearlySalaryApplication)
|
||||
{
|
||||
_adminMonthlyOverviewApplication = adminMonthlyOverviewApplication;
|
||||
_yearlySalaryApplication = yearlySalaryApplication;
|
||||
_authHelper = authHelper;
|
||||
_workshopApplication = workshopApplication;
|
||||
_employerApplication = employerApplication;
|
||||
_accountApplication = accountApplication;
|
||||
}
|
||||
|
||||
public IActionResult OnGet()
|
||||
{
|
||||
var accountId = _authHelper.CurrentAccountId();
|
||||
|
||||
YearlyList = _yearlySalaryApplication.GetYears();
|
||||
|
||||
PersianCalendar pc = new PersianCalendar();
|
||||
DateTime now = DateTime.Now;
|
||||
|
||||
int year = pc.GetYear(now);
|
||||
int month = pc.GetMonth(now);
|
||||
|
||||
SearchModel = new AdminMonthlyOverviewSearchModel()
|
||||
{
|
||||
Year = year,
|
||||
Month = month,
|
||||
AdminAccountId = accountId
|
||||
};
|
||||
return Page();
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetWorkshops(AdminMonthlyOverviewSearchModel searchModel)
|
||||
{
|
||||
var workshopListByStatus = await _adminMonthlyOverviewApplication.GetWorkshopListByStatus(searchModel);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
data = workshopListByStatus
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostNext(long id)
|
||||
{
|
||||
var result = await _adminMonthlyOverviewApplication.Next(id);
|
||||
|
||||
return new JsonResult(result);
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostBack(long id)
|
||||
{
|
||||
var result = await _adminMonthlyOverviewApplication.Back(id);
|
||||
|
||||
return new JsonResult(result);
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetCounter(int year , int month , long accountId)
|
||||
{
|
||||
var counter = await _adminMonthlyOverviewApplication.GetCounter(year, month, accountId);
|
||||
return new JsonResult(counter);
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetEmployerSelectList(string search)
|
||||
{
|
||||
var res = await _employerApplication.GetSelectList(search);
|
||||
return new JsonResult(new
|
||||
{
|
||||
data = res
|
||||
});
|
||||
}
|
||||
public async Task<IActionResult> OnGetWorkshopSelectList(string search)
|
||||
{
|
||||
var res = await _workshopApplication.GetSelectList(search);
|
||||
return new JsonResult(new
|
||||
{
|
||||
data = res
|
||||
});
|
||||
}
|
||||
public async Task<IActionResult> OnGetAccountSelectList()
|
||||
{
|
||||
var res = await _accountApplication.GetAdminSelectList();
|
||||
return new JsonResult(new
|
||||
{
|
||||
data = res
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@
|
||||
<script src="~/AdminTheme/assets/notifications/notifications.js"></script>
|
||||
|
||||
<script src="~/assetsadminnew/sidbar_adminnew/sidebar_admin.js"></script>
|
||||
<script src="~/assetsclient/js/services/ajax-service.js"></script>
|
||||
<script src="~/assetsclient/js/services/ajax-service.js?ver=@Version.AdminVersion"></script>
|
||||
|
||||
|
||||
@* <script src="~/assetsclient/js/smooth-scrollbar.js"></script> *@
|
||||
|
||||
@@ -659,7 +659,14 @@
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a asp-area="AdminNew" asp-page="/Company/MonthlyOverview/Index" class="waves-effect btnWorkFlow">
|
||||
<div class="menuTitle">
|
||||
<i class="md md-home"></i>
|
||||
<span> بررسی امور ماهانه </span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
|
||||
@@ -17,6 +17,7 @@ using ServiceHost.Hubs;
|
||||
using ServiceHost.MiddleWare;
|
||||
using WorkFlow.Infrastructure.Config;
|
||||
using _0_Framework.Application.UID;
|
||||
using ServiceHost.Test;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
@@ -51,6 +52,12 @@ builder.Services.AddTransient<IUidService, UidService>();
|
||||
//services.AddSingleton<IWorkingTest, WorkingTest>();
|
||||
//services.AddHostedService<JobWorker>();
|
||||
|
||||
#region Mahan
|
||||
|
||||
builder.Services.AddTransient<Tester>();
|
||||
|
||||
#endregion
|
||||
|
||||
builder.Services.Configure<FormOptions>(options =>
|
||||
{
|
||||
options.ValueCountLimit = int.MaxValue;
|
||||
@@ -153,6 +160,15 @@ builder.Services.AddSignalR();
|
||||
var app = builder.Build();
|
||||
#region Mahan
|
||||
app.UseStatusCodePagesWithRedirects("/error/{0}");
|
||||
|
||||
//the backend Tester
|
||||
if (builder.Environment.IsDevelopment())
|
||||
{
|
||||
using var scope = app.Services.CreateScope();
|
||||
var tester = scope.ServiceProvider.GetRequiredService<Tester>();
|
||||
await tester.Test();
|
||||
}
|
||||
|
||||
#endregion
|
||||
//Create Http Pipeline
|
||||
|
||||
|
||||
38
ServiceHost/Test/Tester.cs
Normal file
38
ServiceHost/Test/Tester.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System.Diagnostics;
|
||||
using CompanyManagment.App.Contracts.AdminMonthlyOverview;
|
||||
using CompanyManagment.EFCore;
|
||||
using ServiceHost.Areas.AdminNew.Pages.Company.RollCall;
|
||||
|
||||
namespace ServiceHost.Test;
|
||||
|
||||
public class Tester
|
||||
{
|
||||
private readonly IAdminMonthlyOverviewApplication _adminMonthlyOverviewApplication;
|
||||
private readonly CompanyContext _companyContext;
|
||||
public Tester(IAdminMonthlyOverviewApplication adminMonthlyOverviewApplication, CompanyContext companyContext)
|
||||
{
|
||||
_adminMonthlyOverviewApplication = adminMonthlyOverviewApplication;
|
||||
_companyContext = companyContext;
|
||||
}
|
||||
|
||||
public async Task Test()
|
||||
{
|
||||
|
||||
// await AdminMonthlyOverviewTest();
|
||||
|
||||
}
|
||||
private async Task AdminMonthlyOverviewTest()
|
||||
{
|
||||
var acc = _companyContext.WorkshopAccounts.FirstOrDefault(x => x.AccountId == 322);
|
||||
var searchModel = new AdminMonthlyOverviewSearchModel()
|
||||
{
|
||||
Year = 1403,
|
||||
Month = 12,
|
||||
AdminAccountId = 322
|
||||
};
|
||||
var stopwatch = new Stopwatch();
|
||||
stopwatch.Start();
|
||||
var workshopsStatus = await _adminMonthlyOverviewApplication.GetWorkshopListByStatus(searchModel);
|
||||
Console.WriteLine(stopwatch.Elapsed);
|
||||
}
|
||||
}
|
||||
3003
ServiceHost/package-lock.json
generated
Normal file
3003
ServiceHost/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
22
ServiceHost/package.json
Normal file
22
ServiceHost/package.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "servicehost",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"build:css": "tailwindcss -i ./wwwroot/AssetsTailwind/app.css -o ./wwwroot/AssetsTailwind/main.css --minify",
|
||||
"dev": "tailwindcss -i ./wwwroot/AssetsTailwind/app.css -o ./wwwroot/AssetsTailwind/main.css --watch"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"description": "",
|
||||
"devDependencies": {
|
||||
"autoprefixer": "^10.4.21",
|
||||
"eslint": "^9.27.0",
|
||||
"postcss": "^8.5.3",
|
||||
"postcss-cli": "^11.0.1",
|
||||
"tailwindcss": "^3.4.17"
|
||||
}
|
||||
}
|
||||
د
|
||||
15
ServiceHost/tailwind.config.js
Normal file
15
ServiceHost/tailwind.config.js
Normal file
@@ -0,0 +1,15 @@
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
prefix: 'tw-',
|
||||
content: [
|
||||
'./Pages/**/*.cshtml',
|
||||
'./Areas/**/*.cshtml',
|
||||
'./Views/**/*.cshtml',
|
||||
'./wwwroot/**/*.js',
|
||||
'./wwwroot/**/*.css'
|
||||
],
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [],
|
||||
}
|
||||
281
ServiceHost/wwwroot/AssetsAdminNew/MonthlyOverview/css/style.css
Normal file
281
ServiceHost/wwwroot/AssetsAdminNew/MonthlyOverview/css/style.css
Normal file
@@ -0,0 +1,281 @@
|
||||
|
||||
|
||||
.custom-scrollbar-x::-webkit-scrollbar {
|
||||
height: 6px;
|
||||
}
|
||||
|
||||
.custom-scrollbar-x::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.custom-scrollbar-x::-webkit-scrollbar-thumb {
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
border-radius: 4px;
|
||||
}
|
||||
.tab-bar {
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
.tab-bar__tab {
|
||||
width: 128px;
|
||||
height: 33px;
|
||||
background-color: #275197;
|
||||
color: white;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding:0 6px;
|
||||
|
||||
border-radius: 7px 7px 0 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
.tab-bar__tab--active {
|
||||
background-color: #FFFFFF;
|
||||
color: #1A3E7B;
|
||||
border-top: 1px solid #2A5398
|
||||
}
|
||||
|
||||
.tab-bar__tab-label {
|
||||
font-weight: 600;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
|
||||
@media(min-width:768px){
|
||||
.tab-bar__tab-label {
|
||||
font-weight: 600;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.tab-bar__tab-badge {
|
||||
background-color: #FF6363;
|
||||
color: white;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border-radius: 30px;
|
||||
font-size: 9px;
|
||||
font-weight: 600;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
line-height: 16px;
|
||||
}
|
||||
.card-container {
|
||||
border-radius: 10px;
|
||||
padding: 10px 10px 20px;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
background-color:white;
|
||||
|
||||
}
|
||||
|
||||
|
||||
.monthly-card-mobile {
|
||||
background-color: #fff;
|
||||
border-radius: 10px;
|
||||
background-color: white;
|
||||
padding: 20px 10px;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.monthly-table__head {
|
||||
position: sticky;
|
||||
top: 2px;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.u-tactile {
|
||||
cursor: pointer;
|
||||
transition: opacity 300ms ease-in-out;
|
||||
}
|
||||
|
||||
.u-tactile:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.monthly-table__cell-title {
|
||||
width: 96%;
|
||||
display: block;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.monthly-table__cell-card {
|
||||
display: inline-block;
|
||||
border-radius: 5px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.monthly-table__cell-card--small {
|
||||
background-color: #28529833;
|
||||
color: #0B5959;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
|
||||
.monthly-table__cell-card--medium {
|
||||
background-color: #8DDD8D;
|
||||
color: #FFFFFF;
|
||||
width: 57px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
font-weight: 600;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.monthly-table__cell-card--large {
|
||||
background-color: #8DDD8D;
|
||||
color: #FFFFFF;
|
||||
width: 33.3%;
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
font-weight: 600;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.tooltip-container {
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.tooltip__trigger {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.tooltip-container__text {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
width: max-content;
|
||||
max-width: 300px;
|
||||
background-color: #333;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
border-radius: 4px;
|
||||
padding: 5px 8px;
|
||||
z-index: 100000;
|
||||
bottom: 35px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
transition: opacity 0.3s;
|
||||
white-space: normal
|
||||
}
|
||||
|
||||
.tooltip-container:hover .tooltip-container__text {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
|
||||
.monthly-table__toggle {
|
||||
background-color: #F1F5F9 !important;
|
||||
border: 0.5px solid #E9E9E9;
|
||||
border-bottom-left-radius: 10px;
|
||||
border-bottom-right-radius: 10px;
|
||||
opacity: 0;
|
||||
max-height: 0;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
overflow: hidden;
|
||||
transition: opacity 0.4s ease, max-height 0.4s ease, padding 0.4s ease, margin 0.4s ease;
|
||||
will-change: max-height, opacity, padding, margin;
|
||||
}
|
||||
|
||||
.monthly-table__toggle.show {
|
||||
opacity: 1;
|
||||
max-height: 350px;
|
||||
padding-top: 0.5rem;
|
||||
padding-bottom: 0.5rem;
|
||||
margin-top: 0.5rem;
|
||||
margin-bottom: 0.5rem !important;
|
||||
}
|
||||
|
||||
|
||||
.monthly-table__operation-button {
|
||||
width: 71px;
|
||||
height: 27px;
|
||||
border-radius: 5px;
|
||||
background-color: #275197;
|
||||
color:white
|
||||
}
|
||||
|
||||
|
||||
|
||||
.monthly-table__toggle-label {
|
||||
font-weight: 400;
|
||||
font-size: 12px;
|
||||
color: #202020
|
||||
}
|
||||
|
||||
.monthly-table__toggle-value {
|
||||
font-weight: 400;
|
||||
font-size: 12px;
|
||||
color: #818181
|
||||
}
|
||||
/*Awaiting reference Table*/
|
||||
.monthly-table__stage-button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 23px;
|
||||
border-radius: 5px;
|
||||
background-color: #84CC16;
|
||||
color: white;
|
||||
font-size: 10px;
|
||||
padding: 0 4px;
|
||||
white-space: nowrap
|
||||
}
|
||||
|
||||
/* The whole workshop */
|
||||
.monthly-table__status-button {
|
||||
width: 88px;
|
||||
height:32px;
|
||||
|
||||
font-weight: 600;
|
||||
font-size: 12px;
|
||||
border-radius:0
|
||||
}
|
||||
.monthly-table__status-button--documents-setup {
|
||||
background-color: #C8C8C8 !important;
|
||||
}
|
||||
|
||||
.monthly-table__status-button--step1 {
|
||||
background-color: #87DFFF !important;
|
||||
}
|
||||
|
||||
.monthly-table__status-button--step2 {
|
||||
background-color: #FEA99A !important;
|
||||
}
|
||||
|
||||
.monthly-table__status-button--step3 {
|
||||
background-color: #FEDE76 !important;
|
||||
}
|
||||
|
||||
.monthly-table__status-button--step4 {
|
||||
background-color: #A3FF87 !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@media(min-width:768px){
|
||||
.monthly-table__status-button {
|
||||
width: 166px;
|
||||
height: 35px;
|
||||
|
||||
}
|
||||
|
||||
.monthly-table__status-button--documents-setup {
|
||||
background-color: #C8C8C8 !important;
|
||||
}
|
||||
}
|
||||
1400
ServiceHost/wwwroot/AssetsAdminNew/MonthlyOverview/js/Index.js
Normal file
1400
ServiceHost/wwwroot/AssetsAdminNew/MonthlyOverview/js/Index.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -11,7 +11,7 @@
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: method,
|
||||
data: method === "GET" ? data : JSON.stringify(data),
|
||||
data: data,
|
||||
dataType: "json",
|
||||
async: async,
|
||||
headers: {
|
||||
|
||||
3
ServiceHost/wwwroot/AssetsTailwind/app.css
Normal file
3
ServiceHost/wwwroot/AssetsTailwind/app.css
Normal file
@@ -0,0 +1,3 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
1
ServiceHost/wwwroot/AssetsTailwind/main.css
Normal file
1
ServiceHost/wwwroot/AssetsTailwind/main.css
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user