provider #6

Merged
ker73rus merged 29 commits from provider into main 2023-04-09 03:11:27 +04:00
7 changed files with 123 additions and 44 deletions
Showing only changes of commit 9f23e79186 - Show all commits

View File

@ -0,0 +1,90 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UniversityContracts.BindingModels;
using UniversityContracts.BusinessLogicContracts;
using UniversityContracts.ViewModels;
using UniversityContracts.SearchModels;
using UniversityContracts.StoragesContracts;
using UniversityBusinessLogic.OfficePackage;
namespace UniversityBusinessLogic.BusinessLogics
{
public class ReportCustomerLogic : IReportCustomerLogic
{
private readonly IDocumentStorage _documentStorage;
private readonly IStudentStorage _studentStorage;
private readonly IEducationStatusStorage _educationStatusStorage;
private readonly IEducationGroupStorage _educationGroupStorage;
private readonly IDisciplineStorage _disciplineStorage;
private readonly IStreamStorage _streamStorage;
private readonly AbstractSaveToExcelProvider _saveToExcel;
private readonly AbstractSaveToWordProvider _saveToWord;
private readonly AbstractSaveToPdfProvider _saveToPdf;
public ReportCustomerLogic(IDocumentStorage documentStorage,
IStudentStorage studentStorage,
IEducationStatusStorage educationStatusStorage,
IEducationGroupStorage educationGroupStorage,
IDisciplineStorage disciplineStorage,
IStreamStorage streamStorage,
AbstractSaveToExcelProvider saveToExcel,
AbstractSaveToWordProvider saveToWord,
AbstractSaveToPdfProvider saveToPdf)
{
_documentStorage = documentStorage;
_studentStorage = studentStorage;
_educationStatusStorage = educationStatusStorage;
_educationGroupStorage = educationGroupStorage;
_disciplineStorage = disciplineStorage;
_streamStorage = streamStorage;
_saveToExcel = saveToExcel;
_saveToWord = saveToWord;
_saveToPdf = saveToPdf;
}
public List<ReportDisciplineViewModel> GetDisciplineReport(List<StudentViewModel> students)
{
throw new NotImplementedException();
}
public List<ReportStreamEducationStatusViewModel> GetStreamEdStat(ReportBindingModel model)
{
var result = _streamStorage
.GetFilteredList(new StreamSearchModel { UserId = model.UserId })
.Select(stream => new ReportStreamStudentEdStatPeriodViewModel
{
StreamName = stream.Name,
StudentEdStatus = stream.StudentStream
.Where(student => _documentStorage.GetFilteredList(new DocumentSearchModel
{
UserId = model.UserId,
})
.Select(student => (
StudentFIO: $"{student.Value.Name} {student.Value.Surname}",
EdStatus: _educationStatusStorage.GetElement(new EducationStatusSearchModel { Id = student.Value.EducationStatusId })?.Name ?? "не удалось получить"))
.ToList())
})
.ToList();
return result;
}
public void SaveBlanksToWordFile(ReportBindingModel model)
{
throw new NotImplementedException();
}
public void SaveDocumentBlankToExcelFile(ReportBindingModel model)
{
throw new NotImplementedException();
}
public void SaveOrdersToPdfFile(ReportBindingModel model)
{
throw new NotImplementedException();
}
}
}

View File

@ -1,42 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UniversityContracts.BindingModels;
using UniversityContracts.BusinessLogicContracts;
using UniversityContracts.ViewModels;
using UniversityContracts.SearchModels;
using UniversityContracts.StoragesContracts;
namespace UniversityBusinessLogic.BusinessLogics
{
public class ReportProviderLogic : IReportProviderLogic
{
private readonly IDocumentStorage _documentStorage;
public List<ReportStudentsDisciplineViewModel> GetStudentsDiscipline()
{
throw new NotImplementedException();
}
public List<ReportStreamStudentEdStatPeriodViewModel> StreamStudentEdStatPeriod(ReportBindingModel model)
{
throw new NotImplementedException();
}
public void SaveBlanksToWordFile(ReportBindingModel model)
{
throw new NotImplementedException();
}
public void SaveDocumentBlankToExcelFile(ReportBindingModel model)
{
throw new NotImplementedException();
}
public void SaveOrdersToPdfFile(ReportBindingModel model)
{
throw new NotImplementedException();
}
}
}

View File

@ -11,5 +11,6 @@ namespace UniversityContracts.BindingModels
public string FileName { get; set; } = string.Empty;
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }
public int? UserId { get; set; }
}
}

View File

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UniversityContracts.BindingModels;
using UniversityContracts.ViewModels;
namespace UniversityContracts.BusinessLogicContracts
{
public interface IReportCustomerLogic
{
List<ReportStudentsDisciplineViewModel> GetStudentsDiscipline(List<StudentViewModel> students);
List<ReportStreamEducationStatusViewModel> StreamStudentEdStatPeriod(ReportBindingModel model);
void SaveBlanksToWordFile(ReportBindingModel model);
void SaveDocumentBlankToExcelFile(ReportBindingModel model);
void SaveOrdersToPdfFile(ReportBindingModel model);
}
}

View File

@ -6,8 +6,10 @@ using System.Threading.Tasks;
namespace UniversityContracts.ViewModels
{
public class ReportDiscipline
public class ReportDisciplineViewModel
{
public string DisciplineName { get; set; } = string.Empty;
public List<(string StudentFIO, string DocumentDate, string EdStatus)> StudentEdStatus { get; set; } = new();
//выбираем дисциплину, выбираем период, отображаются студенты зачисленные через приказ в этот период со статусами обучения
}
}

View File

@ -6,8 +6,11 @@ using System.Threading.Tasks;
namespace UniversityContracts.ViewModels
{
public class ReportStreamEducationGroup
public class ReportStreamEducationStatusViewModel
{
public string StreamName { get; set; } = string.Empty;
public List<(string StudentFIO, string EdStatus)> StudentEdStatus { get; set; } = new();
// при выборе потока показывается список студентов на потоке и их статус обучения
}
}

View File

@ -4,6 +4,7 @@ using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UniversityModels.Models;
namespace UniversityContracts.ViewModels
{
@ -15,5 +16,7 @@ namespace UniversityContracts.ViewModels
public string Name { get; set; } = string.Empty;
[DisplayName("Номер курса")]
public int Course { get; set; }
public Dictionary<int, IStudentModel> StudentStream { get; set; } = new();
}
}