правки_и_отчёты_поручитель #13
@ -72,7 +72,7 @@ namespace ServiceStationBusinessLogic.BusinessLogics
|
|||||||
}
|
}
|
||||||
return allList;
|
return allList;
|
||||||
}
|
}
|
||||||
public List<ReportCarsViewModel> GetCars(ReportBindingModel model)
|
public List<ReportCarsViewModel> GetCars(ReportExecutorBindingModel model)
|
||||||
{
|
{
|
||||||
List<ReportCarsViewModel> allList = new List<ReportCarsViewModel>();
|
List<ReportCarsViewModel> allList = new List<ReportCarsViewModel>();
|
||||||
|
|
||||||
@ -116,17 +116,17 @@ namespace ServiceStationBusinessLogic.BusinessLogics
|
|||||||
return allList;
|
return allList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SaveComponentsToWordFile(ReportBindingModel model)
|
public void SaveWorkByCarsWordFile(ReportExecutorBindingModel model)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SaveOrdersToPdfFile(ReportBindingModel model)
|
public void SaveTechWorkAndRepairsByCarsToPdfFile(ReportExecutorBindingModel model)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SaveRepairComponentToExcelFile(ReportBindingModel model)
|
public void SaveWorkByCarsToExcelFile(ReportExecutorBindingModel model)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,133 @@
|
|||||||
|
using ServiceStationContracts.BindingModels;
|
||||||
|
using ServiceStationContracts.BusinessLogicsContracts;
|
||||||
|
using ServiceStationContracts.SearchModels;
|
||||||
|
using ServiceStationContracts.StoragesContracts;
|
||||||
|
using ServiceStationContracts.ViewModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationBusinessLogic.BusinessLogics
|
||||||
|
{
|
||||||
|
public class GuarantorReportLogic : IGuarantorReportLogic
|
||||||
|
{
|
||||||
|
private readonly IDefectStorage _defectStorage;
|
||||||
|
private readonly ISparePartStorage _sparepartStorage;
|
||||||
|
private readonly IRepairStorage _repairStorage;
|
||||||
|
private readonly ITechnicalWorkStorage _techWorkStorage;
|
||||||
|
|
||||||
|
public GuarantorReportLogic(IDefectStorage defectStorage, ISparePartStorage sparepartStorage, IRepairStorage repairStorage, ITechnicalWorkStorage techWorkStorage)
|
||||||
|
{
|
||||||
|
_defectStorage = defectStorage;
|
||||||
|
_sparepartStorage = sparepartStorage;
|
||||||
|
_repairStorage = repairStorage;
|
||||||
|
_techWorkStorage = techWorkStorage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ReportDefectsViewModel> GetDefects(List<int> Ids)
|
||||||
|
{
|
||||||
|
if (Ids == null) return new List<ReportDefectsViewModel>();
|
||||||
|
|
||||||
|
List<ReportDefectsViewModel> allList = new List<ReportDefectsViewModel>();
|
||||||
|
|
||||||
|
var defects = _defectStorage.GetFullList();
|
||||||
|
List<SparePartViewModel> spareparts = new List<SparePartViewModel>();
|
||||||
|
foreach (var sparepartId in Ids)
|
||||||
|
{
|
||||||
|
var sparepart = _sparepartStorage.GetElement(new SparePartSearchModel
|
||||||
|
{
|
||||||
|
Id = sparepartId,
|
||||||
|
});
|
||||||
|
if (sparepart != null)
|
||||||
|
{
|
||||||
|
spareparts.Add(sparepart);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var sparepart in spareparts)
|
||||||
|
{
|
||||||
|
var rec = new ReportDefectsViewModel
|
||||||
|
{
|
||||||
|
SparePartName = sparepart.SparePartName,
|
||||||
|
DefectsInfo = new List<(string, double)>()
|
||||||
|
};
|
||||||
|
foreach (var defect in defects)
|
||||||
|
{
|
||||||
|
var repair = _repairStorage.GetElement(new RepairSearchModel
|
||||||
|
{
|
||||||
|
Id = defect.RepairId,
|
||||||
|
});
|
||||||
|
foreach (var repSpareParts in repair.RepairSpareParts.Values)
|
||||||
|
{
|
||||||
|
if (repSpareParts.Id == sparepart.Id)
|
||||||
|
{
|
||||||
|
rec.DefectsInfo.Add(new(defect.DefectType, defect.DefectPrice));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
allList.Add(rec);
|
||||||
|
}
|
||||||
|
return allList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ReportSparePartsViewModel> GetSpareParts(ReportGuarantorBindingModel model)
|
||||||
|
{
|
||||||
|
List<ReportSparePartsViewModel> allList = new List<ReportSparePartsViewModel>();
|
||||||
|
|
||||||
|
List<RepairViewModel> repairList = _repairStorage.GetFilteredList(new RepairSearchModel
|
||||||
|
{
|
||||||
|
DateFrom = model.DateFrom,
|
||||||
|
DateTo = model.DateTo,
|
||||||
|
});
|
||||||
|
|
||||||
|
foreach (var repair in repairList)
|
||||||
|
{
|
||||||
|
foreach (var sparepart in repair.RepairSpareParts.Values)
|
||||||
|
{
|
||||||
|
allList.Add(new ReportSparePartsViewModel
|
||||||
|
{
|
||||||
|
SparePartName = sparepart.SparePartName,
|
||||||
|
SparePartPrice = sparepart.SparePartPrice,
|
||||||
|
RepairName = repair.RepairName,
|
||||||
|
RepairStartDate = repair.RepairStartDate,
|
||||||
|
RepairPrice = repair.RepairPrice,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<TechnicalWorkViewModel> techWorkList = _techWorkStorage.GetFilteredList(new TechnicalWorkSearchModel
|
||||||
|
{
|
||||||
|
DateFrom = model.DateFrom,
|
||||||
|
DateTo = model.DateTo,
|
||||||
|
});
|
||||||
|
|
||||||
|
foreach (var techWork in techWorkList)
|
||||||
|
{
|
||||||
|
allList.Add(new ReportSparePartsViewModel
|
||||||
|
{
|
||||||
|
WorkType = techWork.WorkType,
|
||||||
|
TechnicalWorkDate = techWork.DateStartWork,
|
||||||
|
TechnicalWorkPrice = techWork.WorkPrice,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return allList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SaveDefectsToWordFile(ReportGuarantorBindingModel model)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SaveDefectsToExcelFile(ReportGuarantorBindingModel model)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SaveSparePartsToPdfFile(ReportGuarantorBindingModel model)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace ServiceStationContracts.BindingModels
|
namespace ServiceStationContracts.BindingModels
|
||||||
{
|
{
|
||||||
public class ReportBindingModel
|
public class ReportExecutorBindingModel
|
||||||
{
|
{
|
||||||
public string FileName { get; set; } = string.Empty;
|
public string FileName { get; set; } = string.Empty;
|
||||||
|
|
@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationContracts.BindingModels
|
||||||
|
{
|
||||||
|
public class ReportGuarantorBindingModel
|
||||||
|
{
|
||||||
|
public string FileName { get; set; } = string.Empty;
|
||||||
|
public DateTime? DateFrom { get; set; }
|
||||||
|
public DateTime? DateTo { get; set; }
|
||||||
|
public int GuarantorId { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -11,12 +11,12 @@ namespace ServiceStationContracts.BusinessLogicsContracts
|
|||||||
public interface IExecutorReportLogic
|
public interface IExecutorReportLogic
|
||||||
{
|
{
|
||||||
List<ReportWorksViewModel> GetWorks(List<int> Ids);
|
List<ReportWorksViewModel> GetWorks(List<int> Ids);
|
||||||
List<ReportCarsViewModel> GetCars(ReportBindingModel model);
|
List<ReportCarsViewModel> GetCars(ReportExecutorBindingModel model);
|
||||||
|
|
||||||
void SaveComponentsToWordFile(ReportBindingModel model);
|
void SaveWorkByCarsWordFile(ReportExecutorBindingModel model);
|
||||||
|
|
||||||
void SaveRepairComponentToExcelFile(ReportBindingModel model);
|
void SaveWorkByCarsToExcelFile(ReportExecutorBindingModel model);
|
||||||
|
|
||||||
void SaveOrdersToPdfFile(ReportBindingModel model);
|
void SaveTechWorkAndRepairsByCarsToPdfFile(ReportExecutorBindingModel model);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,22 @@
|
|||||||
|
using ServiceStationContracts.BindingModels;
|
||||||
|
using ServiceStationContracts.ViewModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationContracts.BusinessLogicsContracts
|
||||||
|
{
|
||||||
|
public interface IGuarantorReportLogic
|
||||||
|
{
|
||||||
|
List<ReportDefectsViewModel> GetDefects(List<int> Ids);
|
||||||
|
List<ReportSparePartsViewModel> GetSpareParts(ReportGuarantorBindingModel model);
|
||||||
|
|
||||||
|
void SaveDefectsToWordFile(ReportGuarantorBindingModel model);
|
||||||
|
|
||||||
|
void SaveDefectsToExcelFile(ReportGuarantorBindingModel model);
|
||||||
|
|
||||||
|
void SaveSparePartsToPdfFile(ReportGuarantorBindingModel model);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationContracts.ViewModels
|
||||||
|
{
|
||||||
|
public class ReportDefectsViewModel
|
||||||
|
{
|
||||||
|
public string SparePartName { get; set; } = string.Empty;
|
||||||
|
public List<(string, double)> DefectsInfo { get; set; } = new();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationContracts.ViewModels
|
||||||
|
{
|
||||||
|
public class ReportSparePartsViewModel
|
||||||
|
{
|
||||||
|
public string SparePartName { get; set; } = string.Empty;
|
||||||
|
public double SparePartPrice { get; set; }
|
||||||
|
public string RepairName { get; set; } = string.Empty;
|
||||||
|
public DateTime? RepairStartDate { get; set; } = DateTime.Now;
|
||||||
|
public double RepairPrice { get; set; }
|
||||||
|
public string WorkType { get; set; } = string.Empty;
|
||||||
|
public DateTime? TechnicalWorkDate { get; set; } = DateTime.Now;
|
||||||
|
public double TechnicalWorkPrice { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -10,7 +10,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="p-2">
|
<div class="p-2">
|
||||||
<img src="~/Images/sashka.png" width="100px" />
|
<img src="~/Images/sashka.png" width="100px" />
|
||||||
Табеев А.Р. Роль Поручителя
|
Табеев А.П. Роль Поручителя
|
||||||
</div>
|
</div>
|
||||||
<p class="pt-4">Рады видеть вас на нашем сайте ^.^</p>
|
<p class="pt-4">Рады видеть вас на нашем сайте ^.^</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
Название ремонта
|
Название ремонта
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th>
|
||||||
Статус ремонта
|
Дата начала ремонта
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th>
|
||||||
Стоимость ремонта
|
Стоимость ремонта
|
||||||
|
Loading…
x
Reference in New Issue
Block a user