finish list of files
This commit is contained in:
@@ -20,9 +20,9 @@ public interface IFileRepository : IRepository<long, File1>
|
||||
|
||||
#region Mahan
|
||||
|
||||
List<FileViewModel> GetFileList(FileSearchModel searchModel);
|
||||
|
||||
#endregion
|
||||
|
||||
Task<List<FileExcelViewModel>> GetExcelDetails();
|
||||
Task<List<FileListViewModel>> GetList(GetFileSearchModel searchModel);
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -33,7 +33,13 @@ public class FileSearchModel
|
||||
public List<ArchiveNo_FileClass_UserIdList> ArchiveNo_FileClass_UserIdList { get; set; }
|
||||
|
||||
//public List<User> Users { get; set; }
|
||||
/// <summary>
|
||||
/// هیئت تشخیص
|
||||
/// </summary>
|
||||
public BoardSearchModel diagnosisBoard { get; set; }
|
||||
/// <summary>
|
||||
/// هیئت حل اختلاف
|
||||
/// </summary>
|
||||
public BoardSearchModel disputeResolutionBoard { get; set; }
|
||||
public ProceedingSessionSearchModel diagnosisProceedingSession { get; set; }
|
||||
public ProceedingSessionSearchModel disputeResolutionProceedingSession { get; set; }
|
||||
|
||||
@@ -24,5 +24,158 @@ public interface IFileApplication
|
||||
List<EmployeeViewModel> GetAllEmploees(bool filter = true);
|
||||
List<EmployerViewModel> GetAllEmployers(bool filter = true);
|
||||
//bool CheckValue(string viewModel, string searchModel);
|
||||
|
||||
#region Mahan
|
||||
/// <summary>
|
||||
/// اطلاعات برای نمایش اکسل
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<FileExcelViewModel>> GetExcelDetails();
|
||||
|
||||
|
||||
Task<List<FileListViewModel>> GetList(GetFileSearchModel searchModel);
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public class GetFileSearchModel
|
||||
{
|
||||
/// <summary>
|
||||
/// شماره بایگانی
|
||||
/// </summary>
|
||||
public long ArchiveNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کلاسه پرونده
|
||||
/// </summary>
|
||||
public string FileClass { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// اصیل دعوی (شامل جمع خواهان ها و خوانده ها)ء
|
||||
/// </summary>
|
||||
public (long id, bool IsRequester) ClientOrLitigationParty { get; set; }
|
||||
/// <summary>
|
||||
/// شعبه هیئت تشخیص
|
||||
/// </summary>
|
||||
public string DiagnosisBoardBranch { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شعبه هیئت حل اختلاف
|
||||
/// </summary>
|
||||
public string DisputeResolutionBranch { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// رییس هیئت تشخیص
|
||||
/// </summary>
|
||||
public string DiagnosisBoardChairMan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// رییس هیئت حل اختلاف
|
||||
/// </summary>
|
||||
public string DisputeResolutionBoardChairMan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ رسیدگی هیئت تشخیص - از
|
||||
/// </summary>
|
||||
public string DiagnosisBoardFromDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ رسیدگی هیئت تشخیص - تا
|
||||
/// </summary>
|
||||
public string DiagnosisBoardToDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ رسیدگی هیئت حل اختلاف - از
|
||||
/// </summary>
|
||||
public string DisputeResolutionBoardFromDate{ get; set; }
|
||||
/// <summary>
|
||||
/// تاریخ رسیدگی هیئت حل اختلاف - تا
|
||||
/// </summary>
|
||||
public string DisputeResolutionBoardToDate{ get; set; }
|
||||
|
||||
|
||||
public int PageIndex { get; set; }
|
||||
}
|
||||
|
||||
public class FileListViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره بایگانی
|
||||
/// </summary>
|
||||
public long ArchiveNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کلاسه پرونده
|
||||
/// </summary>
|
||||
public string FileClass { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// موکل
|
||||
/// </summary>
|
||||
public string Client { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// طرف دعوی
|
||||
/// </summary>
|
||||
public string LitigationParty { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// هیئت تشخیص
|
||||
/// </summary>
|
||||
public FileListBoardViewModel DiagnosisBoard { get; set; }
|
||||
/// <summary>
|
||||
/// هیئت حل اختلاف
|
||||
/// </summary>
|
||||
public FileListBoardViewModel DisputeResolutionBoard { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت پرونده. یک به معنی غیرفعال. دو به معنی فعال. سه به معنی خروج موقت
|
||||
/// </summary>
|
||||
public int Status { get; set; }
|
||||
}
|
||||
|
||||
public class FileListBoardViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// تاریخ دادخواست
|
||||
/// </summary>
|
||||
public string PetitionDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اولین تاریخ رسیدگی
|
||||
/// </summary>
|
||||
public string FirstResolutionPetitionDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آخرین تاریخ رسیدگی
|
||||
/// </summary>
|
||||
public string LastResolutionPetitionDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آخرین نوبت تاریخ رسیدگی
|
||||
/// </summary>
|
||||
public string LastResolutionPetitionTurn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ دادنامه
|
||||
/// </summary>
|
||||
public string PetitionIssuanceDate { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ جریمه
|
||||
/// </summary>
|
||||
public string TotalPenalty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شعبه
|
||||
/// </summary>
|
||||
public string Branch { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// رئیس هیئت مدیره
|
||||
/// </summary>
|
||||
public string BoardChairman { get; set; }
|
||||
}
|
||||
@@ -200,10 +200,9 @@ public class FileApplication : IFileApplication
|
||||
return employers;
|
||||
}
|
||||
|
||||
public async Task<List<FileExcelViewModel>> GetExcelDetails()
|
||||
{
|
||||
return await _fileRepository.GetExcelDetails();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public FileViewModel GetFileDetails(FileViewModel file)
|
||||
{
|
||||
@@ -518,4 +517,15 @@ public class FileApplication : IFileApplication
|
||||
|
||||
//return file;
|
||||
}
|
||||
|
||||
#region Mahan
|
||||
public async Task<List<FileExcelViewModel>> GetExcelDetails()
|
||||
{
|
||||
return await _fileRepository.GetExcelDetails();
|
||||
}
|
||||
public async Task<List<FileListViewModel>> GetList(GetFileSearchModel searchModel)
|
||||
{
|
||||
return await _fileRepository.GetList(searchModel);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework_b.InfraStructure;
|
||||
@@ -8,6 +10,7 @@ using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using CompanyManagment.App.Contracts.File1;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PersianTools.Core;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
@@ -390,8 +393,143 @@ public class FileRepository : RepositoryBase<long, Company.Domain.File1.File1>,
|
||||
MclsPassword = x.Client == 1 ? requester?.MclsPassword : summoned?.MclsPassword ?? "-",
|
||||
Status = x.Status
|
||||
};
|
||||
}).OrderBy(x=>x.Status ==1).ThenBy(x=>x.Status == 3).ThenBy(x=>x.Status==2);
|
||||
}).OrderBy(x => x.Status == 1).ThenBy(x => x.Status == 3).ThenBy(x => x.Status == 2);
|
||||
|
||||
return res.ToList();
|
||||
}
|
||||
|
||||
public async Task<List<FileListViewModel>> GetList(GetFileSearchModel searchModel)
|
||||
{
|
||||
|
||||
var fileQuery = _context.Files.Include(x => x.PetitionsList).Include(x => x.BoardsList).ThenInclude(x => x.ProceedingSessionsList).AsQueryable();
|
||||
|
||||
#region Search
|
||||
|
||||
if (searchModel.ArchiveNumber > 0)
|
||||
{
|
||||
fileQuery = fileQuery.Where(x => x.ArchiveNo == searchModel.ArchiveNumber);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.FileClass))
|
||||
{
|
||||
fileQuery = fileQuery.Where(x => x.FileClass.Contains(searchModel.FileClass));
|
||||
}
|
||||
|
||||
if (searchModel.ClientOrLitigationParty.id > 0)
|
||||
{
|
||||
if (searchModel.ClientOrLitigationParty.IsRequester)
|
||||
{
|
||||
fileQuery = fileQuery.Where(x => x.Reqester == searchModel.ClientOrLitigationParty.id);
|
||||
}
|
||||
else
|
||||
{
|
||||
fileQuery = fileQuery.Where(x => x.Summoned == searchModel.ClientOrLitigationParty.id);
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.DiagnosisBoardBranch))
|
||||
{
|
||||
fileQuery = fileQuery.Where(x => x.BoardsList.Any(b => b.Branch.Contains(searchModel.DiagnosisBoardBranch) && b.BoardType_Id == 1));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.DisputeResolutionBranch))
|
||||
{
|
||||
fileQuery = fileQuery.Where(x => x.BoardsList.Any(b => b.Branch.Contains(searchModel.DisputeResolutionBranch) && b.BoardType_Id == 2));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.DiagnosisBoardChairMan))
|
||||
{
|
||||
fileQuery = fileQuery.Where(x => x.BoardsList.Any(b => b.BoardChairman.Contains(searchModel.DiagnosisBoardChairMan) && b.BoardType_Id == 1));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.DisputeResolutionBoardChairMan))
|
||||
{
|
||||
fileQuery = fileQuery.Where(x => x.BoardsList.Any(b => b.BoardChairman.Contains(searchModel.DisputeResolutionBoardChairMan) && b.BoardType_Id == 2));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.DiagnosisBoardFromDate))
|
||||
{
|
||||
var fromDate = searchModel.DiagnosisBoardFromDate.ToGeorgianDateTime();
|
||||
fileQuery = fileQuery.Where(x => x.BoardsList.Any(b => b.BoardType_Id == 1 && b.DisputeResolutionPetitionDate >= fromDate));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.DiagnosisBoardToDate))
|
||||
{
|
||||
var toDate = searchModel.DiagnosisBoardToDate.ToGeorgianDateTime();
|
||||
fileQuery = fileQuery.Where(x => x.BoardsList.Any(b => b.BoardType_Id == 1 && b.DisputeResolutionPetitionDate <= toDate));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.DisputeResolutionBoardFromDate))
|
||||
{
|
||||
var fromDate = searchModel.DisputeResolutionBoardFromDate.ToGeorgianDateTime();
|
||||
fileQuery = fileQuery.Where(x => x.BoardsList.Any(b => b.BoardType_Id == 2 && b.DisputeResolutionPetitionDate >= fromDate));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.DisputeResolutionBoardToDate))
|
||||
{
|
||||
var toDate = searchModel.DisputeResolutionBoardToDate.ToGeorgianDateTime();
|
||||
fileQuery = fileQuery.Where(x => x.BoardsList.Any(b => b.BoardType_Id == 2 && b.DisputeResolutionPetitionDate <= toDate));
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
fileQuery = fileQuery.Skip(searchModel.PageIndex).Take(30);
|
||||
|
||||
var requesterEmployeeQuery = await _context.Employees.Where(x => fileQuery.Any(f => f.Reqester == x.id)).ToListAsync();
|
||||
var summonedEmployerQuery = await _context.Employers.Where(x => fileQuery.Any(f => f.Summoned == x.id)).ToListAsync();
|
||||
|
||||
var result = (await fileQuery.ToListAsync()).Select(x =>
|
||||
{
|
||||
var requester = requesterEmployeeQuery.FirstOrDefault(e => e.id == x.Reqester);
|
||||
var summoned = summonedEmployerQuery.FirstOrDefault(e => e.id == x.Summoned);
|
||||
var diagnosisBoard = x.BoardsList.FirstOrDefault(b => b.BoardType_Id == 1);
|
||||
var disputeResolutionBoard = x.BoardsList.FirstOrDefault(b => b.BoardType_Id == 2);
|
||||
var diagnosisPetition = x.PetitionsList.FirstOrDefault(p => p.BoardType_Id == 1);
|
||||
var disputeResolutionPetition = x.PetitionsList.FirstOrDefault(p => p.BoardType_Id == 2);
|
||||
return new FileListViewModel()
|
||||
{
|
||||
ArchiveNumber = x.ArchiveNo,
|
||||
FileClass = x.FileClass,
|
||||
Client = x.Client == 1 ? requester?.FullName : summoned?.FullName ?? "-",
|
||||
LitigationParty = x.Client == 1 ? summoned?.FullName : requester?.FullName ?? "-",
|
||||
Status = x.Status,
|
||||
DiagnosisBoard = new FileListBoardViewModel()
|
||||
{
|
||||
BoardChairman = diagnosisBoard?.BoardChairman ?? "-",
|
||||
Branch = diagnosisBoard?.Branch ?? "-",
|
||||
PetitionDate = diagnosisBoard?.DisputeResolutionPetitionDate.ToFarsi() ?? "-",
|
||||
PetitionIssuanceDate = diagnosisPetition?.PetitionIssuanceDate.ToFarsi() ?? "-",
|
||||
FirstResolutionPetitionDate =
|
||||
diagnosisBoard?.ProceedingSessionsList.FirstOrDefault()?.Date.ToFarsi() ?? "-",
|
||||
LastResolutionPetitionDate = diagnosisBoard?.ProceedingSessionsList.Count > 1
|
||||
? diagnosisBoard.ProceedingSessionsList.Last().Date.ToFarsi()
|
||||
: "-",
|
||||
LastResolutionPetitionTurn = diagnosisBoard?.ProceedingSessionsList.Count > 1
|
||||
? CharacterUtil.Convert((int)diagnosisBoard?.ProceedingSessionsList.Count)
|
||||
: "-",
|
||||
TotalPenalty = diagnosisPetition?.TotalPenalty ?? "-"
|
||||
},
|
||||
DisputeResolutionBoard = new FileListBoardViewModel()
|
||||
{
|
||||
BoardChairman = disputeResolutionBoard?.BoardChairman ?? "-",
|
||||
Branch = disputeResolutionBoard?.Branch ?? "-",
|
||||
PetitionDate = disputeResolutionBoard?.DisputeResolutionPetitionDate.ToFarsi() ?? "-",
|
||||
PetitionIssuanceDate = disputeResolutionPetition?.PetitionIssuanceDate.ToFarsi() ?? "-",
|
||||
FirstResolutionPetitionDate =
|
||||
disputeResolutionBoard?.ProceedingSessionsList.FirstOrDefault()?.Date.ToFarsi() ?? "-",
|
||||
LastResolutionPetitionDate = disputeResolutionBoard?.ProceedingSessionsList.Count > 1
|
||||
? disputeResolutionBoard.ProceedingSessionsList.Last().Date.ToFarsi()
|
||||
: "-",
|
||||
LastResolutionPetitionTurn = disputeResolutionBoard?.ProceedingSessionsList.Count > 1
|
||||
? CharacterUtil.Convert((int)disputeResolutionBoard?.ProceedingSessionsList.Count)
|
||||
: "-",
|
||||
TotalPenalty = diagnosisPetition?.TotalPenalty ?? "-"
|
||||
}
|
||||
|
||||
};
|
||||
}).ToList();
|
||||
return result;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@ using Company.Domain.RollCallAgg;
|
||||
using Company.Domain.RollCallAgg.DomainService;
|
||||
using Company.Domain.YearlySalaryAgg;
|
||||
using CompanyManagment.App.Contracts.AndroidApkVersion;
|
||||
using CompanyManagment.App.Contracts.File1;
|
||||
using CompanyManagment.App.Contracts.InstitutionPlan;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
@@ -53,13 +54,14 @@ namespace ServiceHost.Pages
|
||||
private readonly ITemporaryClientRegistrationApplication _clientRegistrationApplication;
|
||||
private readonly IYearlySalaryRepository _yearlySalaryRepository;
|
||||
private readonly IEmployeeComputeOptionsRepository _computeOptions;
|
||||
private readonly IFileApplication _fileApplication;
|
||||
|
||||
|
||||
|
||||
|
||||
public IndexModel(ILogger<IndexModel> logger, IAccountApplication accountApplication, IGoogleRecaptcha googleRecaptcha, ISmsService smsService, IWorker worker,
|
||||
IAuthHelper authHelper, ICameraAccountApplication cameraAccountApplication, IWebHostEnvironment webHostEnvironment,
|
||||
IAndroidApkVersionApplication androidApkVersionApplication, ITemporaryClientRegistrationApplication clientRegistrationApplication, IYearlySalaryRepository yearlySalaryRepository, IEmployeeComputeOptionsRepository computeOptions)
|
||||
IAndroidApkVersionApplication androidApkVersionApplication, ITemporaryClientRegistrationApplication clientRegistrationApplication, IYearlySalaryRepository yearlySalaryRepository, IEmployeeComputeOptionsRepository computeOptions, IFileApplication fileApplication)
|
||||
{
|
||||
_logger = logger;
|
||||
_accountApplication = accountApplication;
|
||||
@@ -73,9 +75,10 @@ namespace ServiceHost.Pages
|
||||
_clientRegistrationApplication = clientRegistrationApplication;
|
||||
_yearlySalaryRepository = yearlySalaryRepository;
|
||||
_computeOptions = computeOptions;
|
||||
_fileApplication = fileApplication;
|
||||
}
|
||||
|
||||
public IActionResult OnGet()
|
||||
public async Task<IActionResult> OnGet()
|
||||
{
|
||||
// _computeOptions.GetAllByWorkshopId(170);
|
||||
//_yearlySalaryRepository.TestDayliFeeCompute();
|
||||
|
||||
Reference in New Issue
Block a user