add rollcall title case history query

This commit is contained in:
2026-01-11 15:12:08 +03:30
parent 587fa40d81
commit 05d860795e
7 changed files with 764 additions and 507 deletions

View File

@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using _0_Framework.Application;
using _0_Framework.Domain;
using CompanyManagment.App.Contracts.RollCall;
using CompanyManagment.App.Contracts.WorkingHoursTemp;
@@ -91,5 +92,9 @@ namespace Company.Domain.RollCallAgg
Task<List<RollCall>> GetRollCallsUntilNowWithWorkshopIdEmployeeIds(long workshopId, List<long> employeeIds,
DateTime fromDate);
#endregion
Task<PagedResult<RollCallCaseHistoryTitleDto>> GetCaseHistoryTitles(long workshopId,RollCallCaseHistorySearchModel searchModel);
Task<PagedResult<RollCallCaseHistoryDetail>> GetCaseHistoryDetails(long workshopId,
string titleId, RollCallCaseHistorySearchModel searchModel);
}
}

View File

@@ -4,6 +4,8 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using _0_Framework.Application;
using CompanyManagment.App.Contracts.Workshop;
using Microsoft.AspNetCore.Mvc;
namespace CompanyManagment.App.Contracts.RollCall
{
@@ -125,7 +127,51 @@ namespace CompanyManagment.App.Contracts.RollCall
/// <param name="command"></param>
/// <returns></returns>
Task<OperationResult> RecalculateValues(long workshopId, List<ReCalculateRollCallValues> command);
Task<PagedResult<RollCallCaseHistoryTitleDto>> GetCaseHistoryTitles(long workshopId,RollCallCaseHistorySearchModel searchModel);
Task<PagedResult<RollCallCaseHistoryDetail>> GetCaseHistoryDetails(long workshopId, string titleId, RollCallCaseHistorySearchModel searchModel);
}
public class RollCallCaseHistoryDetail
{
public string EmployeeFullName { get; set; }
public string PersonnelCode { get; set; }
public TimeSpan TotalWorkingTime { get; set; }
public List<RollCallCaseHistoryDetailRecord> Records { get; set; }
public RollCallRecordStatus Status { get; set; }
}
public enum RollCallRecordStatus
{
Worked = 0,
Absent = 1,
Leaved = 2
}
public class RollCallCaseHistoryDetailRecord
{
public TimeSpan EntryTimeDifference { get; set; }
public string StartTime { get; set; }
public string EndTime { get; set; }
public TimeSpan ExitTimeDifference { get; set; }
}
public class RollCallCaseHistorySearchModel:PaginationRequest
{
public string StartDate { get; set; }
public string EndDate { get; set; }
public string OneDayDate { get; set; }
public long? EmployeeId { get; set; }
}
public class RollCallCaseHistoryTitleDto
{
public string Id { get; set; }
public string Title { get; set; }
}
public class ReCalculateRollCallValues
{
public long EmployeeId { get; set; }

View File

@@ -858,4 +858,15 @@ public class RollCallApplication : IRollCallApplication
}
}
public async Task<PagedResult<RollCallCaseHistoryTitleDto>> GetCaseHistoryTitles(long workshopId,
RollCallCaseHistorySearchModel searchModel)
{
return await _rollCallRepository.GetCaseHistoryTitles(workshopId,searchModel);
}
public async Task<PagedResult<RollCallCaseHistoryDetail>> GetCaseHistoryDetails(long workshopId,
string titleId, RollCallCaseHistorySearchModel searchModel)
{
return await _rollCallRepository.GetCaseHistoryDetails(workshopId, titleId, searchModel);
}
}

View File

@@ -713,10 +713,15 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
var itemsQuery = _companyContext.EmployeeDocumentItems
.Where(x => x.DocumentStatus != DocumentStatus.Unsubmitted)
.Include(x => x.EmployeeDocuments)
.ThenInclude(x => x.Workshop).ThenInclude(x => x.WorkshopEmployers).ThenInclude(x => x.Employer)
.GroupBy(x => x.WorkshopId).Select(x => new WorkshopWithEmployeeDocumentsViewModel()
.ThenInclude(x => x.Workshop)
.ThenInclude(x => x.WorkshopEmployers)
.ThenInclude(x => x.Employer)
.GroupBy(x => x.WorkshopId)
.Select(x => new WorkshopWithEmployeeDocumentsViewModel()
{
SubmittedItemsCount = x.Count(y => y.DocumentStatus == DocumentStatus.SubmittedByAdmin || y.DocumentStatus == DocumentStatus.SubmittedByClient),
SubmittedItemsCount = x
.Count(y => y.DocumentStatus == DocumentStatus.SubmittedByAdmin
|| y.DocumentStatus == DocumentStatus.SubmittedByClient),
WorkshopId = x.Key,
WorkshopFullName = x.First().EmployeeDocuments.Workshop.WorkshopName,
EmployerName = x.First().EmployeeDocuments.Workshop.WorkshopEmployers.First().Employer.FullName

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,31 @@
using _0_Framework.Application;
using CompanyManagment.App.Contracts.RollCall;
using Microsoft.AspNetCore.Mvc;
using ServiceHost.BaseControllers;
namespace ServiceHost.Areas.Client.Controllers.RollCall;
public class CaseHistoryController:ClientBaseController
{
private readonly IRollCallApplication _rollCallApplication;
private long _workshopId;
public CaseHistoryController(IRollCallApplication rollCallApplication,
IAuthHelper authHelper)
{
_rollCallApplication = rollCallApplication;
_workshopId = authHelper.GetWorkshopId();
}
[HttpGet]
public async Task<ActionResult<PagedResult<RollCallCaseHistoryTitleDto>>> GetTitles(RollCallCaseHistorySearchModel searchModel)
{
return await _rollCallApplication.GetCaseHistoryTitles(_workshopId, searchModel);
}
[HttpGet("{titleId}")]
public async Task<IActionResult> GetDetails(string titleId, RollCallCaseHistorySearchModel searchModel)
{
return await _rollCallApplication.GetCaseHistoryDetails(_workshopId, titleId, searchModel);
}
}

View File

@@ -19,7 +19,7 @@
"sqlDebugging": true,
"dotnetRunMessages": "true",
"nativeDebugging": true,
"applicationUrl": "https://localhost:5004;http://localhost:5003;",
"applicationUrl": "https://localhost:5004;http://localhost:5003;https://192.168.0.117:5006",
"jsWebView2Debugging": false,
"hotReloadEnabled": true
},