fix
This commit is contained in:
parent
5f5f175a0d
commit
7bc6efdc0c
@ -79,7 +79,7 @@ namespace UniversityBusinessLogic.BusinessLogics
|
|||||||
ReportStreamStudentEdStatPeriodViewModel reportData = new ReportStreamStudentEdStatPeriodViewModel();
|
ReportStreamStudentEdStatPeriodViewModel reportData = new ReportStreamStudentEdStatPeriodViewModel();
|
||||||
reportData.StreamName = stream.Name;
|
reportData.StreamName = stream.Name;
|
||||||
|
|
||||||
var students = _streamStorage.GetStreamStudents(new() { Id = stream.Id })
|
var students = _streamStorage.GetStreamStudents(new() { Id = stream.Id, DateFrom = model.DateFrom, DateTo = model.DateTo })
|
||||||
.Select(s => new StudentStatusViewModel()
|
.Select(s => new StudentStatusViewModel()
|
||||||
{
|
{
|
||||||
StudentName = s.Name + " " + s.Surname,
|
StudentName = s.Name + " " + s.Surname,
|
||||||
@ -131,7 +131,7 @@ namespace UniversityBusinessLogic.BusinessLogics
|
|||||||
_mailSender.SendMailAsync(new ()
|
_mailSender.SendMailAsync(new ()
|
||||||
{
|
{
|
||||||
MailAddress = reportModel.UserEmail,
|
MailAddress = reportModel.UserEmail,
|
||||||
Subject = "Отчет по комплектациям",
|
Subject = "Отчет по статусам обучения",
|
||||||
Text = $"За период с {reportModel.DateFrom.ToShortDateString()} " +
|
Text = $"За период с {reportModel.DateFrom.ToShortDateString()} " +
|
||||||
$"по {reportModel.DateTo.ToShortDateString()}.",
|
$"по {reportModel.DateTo.ToShortDateString()}.",
|
||||||
File = file
|
File = file
|
||||||
|
@ -12,5 +12,7 @@ namespace UniversityContracts.SearchModels
|
|||||||
public int? UserId { get; set; }
|
public int? UserId { get; set; }
|
||||||
public string? Name { get; set; }
|
public string? Name { get; set; }
|
||||||
public int? Course { get; set; }
|
public int? Course { get; set; }
|
||||||
|
public DateTime? DateFrom { get; set; }
|
||||||
|
public DateTime? DateTo { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,6 +135,7 @@ namespace UniversityDataBaseImplemet.Implements
|
|||||||
using var context = new Database();
|
using var context = new Database();
|
||||||
var students = context.StudentStreams
|
var students = context.StudentStreams
|
||||||
.Where(x => x.StreamId == model.Id)
|
.Where(x => x.StreamId == model.Id)
|
||||||
|
.Where(x => x.Student.DateOfAddmission < model.DateTo && x.Student.DateOfAddmission >= model.DateFrom)
|
||||||
.Select(x => x.Student.GetViewModel)
|
.Select(x => x.Student.GetViewModel)
|
||||||
.ToList();
|
.ToList();
|
||||||
return students;
|
return students;
|
||||||
|
@ -164,6 +164,11 @@ namespace UniversityProvider.Controllers
|
|||||||
APIClient.PostRequest("api/reportprovider/sendbymailstatusreport", reportModel);
|
APIClient.PostRequest("api/reportprovider/sendbymailstatusreport", reportModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IActionResult Diagram()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||||
public IActionResult Error()
|
public IActionResult Error()
|
||||||
{
|
{
|
||||||
|
28
UniversityProvider/Views/Home/Diagram.cshtml
Normal file
28
UniversityProvider/Views/Home/Diagram.cshtml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<div>
|
||||||
|
<canvas id="myChart"></canvas>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const ctx = document.getElementById('myChart');
|
||||||
|
|
||||||
|
new Chart(ctx, {
|
||||||
|
type: 'bar',
|
||||||
|
data: {
|
||||||
|
labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'],
|
||||||
|
datasets: [{
|
||||||
|
label: '# of Votes',
|
||||||
|
data: [12, 19, 3, 5, 2, 3],
|
||||||
|
borderWidth: 1
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
scales: {
|
||||||
|
y: {
|
||||||
|
beginAtZero: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
@ -34,6 +34,9 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="GetReport">Отчет</a>
|
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="GetReport">Отчет</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Diagram">График</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -4,6 +4,16 @@ const nameInput = document.getElementById("name-input")
|
|||||||
var students = []
|
var students = []
|
||||||
var dataArray = [];
|
var dataArray = [];
|
||||||
|
|
||||||
|
const correctData = () => {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const validate = () => {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
window.addEventListener('load', () => {
|
window.addEventListener('load', () => {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "/student/getallbyuser",
|
url: "/student/getallbyuser",
|
||||||
@ -16,6 +26,12 @@ window.addEventListener('load', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
createBtn.addEventListener('click', () => {
|
createBtn.addEventListener('click', () => {
|
||||||
|
if (!correctData()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!validate()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var document = {
|
var document = {
|
||||||
"Name": nameInput.value,
|
"Name": nameInput.value,
|
||||||
"Date": new Date(),
|
"Date": new Date(),
|
||||||
|
@ -6,6 +6,16 @@ var students = [];
|
|||||||
var dataArray = [];
|
var dataArray = [];
|
||||||
var currentDocument = null;
|
var currentDocument = null;
|
||||||
|
|
||||||
|
const correctData = () => {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const validate = () => {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
window.addEventListener('load', async () => {
|
window.addEventListener('load', async () => {
|
||||||
await $.ajax({
|
await $.ajax({
|
||||||
url: "/student/getallbyuser",
|
url: "/student/getallbyuser",
|
||||||
@ -25,6 +35,12 @@ window.addEventListener('load', async () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
createBtn.addEventListener('click', () => {
|
createBtn.addEventListener('click', () => {
|
||||||
|
if (!correctData()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!validate()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var documentGroupsUpdate = {
|
var documentGroupsUpdate = {
|
||||||
"Id": currentDocument.id,
|
"Id": currentDocument.id,
|
||||||
"Name": nameInput.value,
|
"Name": nameInput.value,
|
||||||
|
@ -1,6 +1,16 @@
|
|||||||
const createBtn = document.getElementById("create-button");
|
const createBtn = document.getElementById("create-button");
|
||||||
const nameInput = document.getElementById("name-input");
|
const nameInput = document.getElementById("name-input");
|
||||||
|
|
||||||
|
const correctData = () => {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const validate = () => {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
createBtn.addEventListener("click", () => {
|
createBtn.addEventListener("click", () => {
|
||||||
if (!correctData()) {
|
if (!correctData()) {
|
||||||
return;
|
return;
|
||||||
@ -8,19 +18,6 @@ createBtn.addEventListener("click", () => {
|
|||||||
if (!validate()) {
|
if (!validate()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
const correctData = function () {
|
|
||||||
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
const validate = function () {
|
|
||||||
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
createBtn.addEventListener("click", () => {
|
|
||||||
let educationstatus = {
|
let educationstatus = {
|
||||||
"Name": nameInput.value,
|
"Name": nameInput.value,
|
||||||
};
|
};
|
||||||
|
@ -2,6 +2,16 @@
|
|||||||
const nameInput = document.getElementById("name-input")
|
const nameInput = document.getElementById("name-input")
|
||||||
const studId = document.getElementById("vb-id").dataset.id
|
const studId = document.getElementById("vb-id").dataset.id
|
||||||
|
|
||||||
|
const correctData = () => {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const validate = () => {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
updateBtn.addEventListener("click", () => {
|
updateBtn.addEventListener("click", () => {
|
||||||
if (!correctData()) {
|
if (!correctData()) {
|
||||||
return;
|
return;
|
||||||
@ -9,19 +19,6 @@ updateBtn.addEventListener("click", () => {
|
|||||||
if (!validate()) {
|
if (!validate()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
const correctData = function () {
|
|
||||||
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
const validate = function () {
|
|
||||||
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
updateBtn.addEventListener("click", () => {
|
|
||||||
let educationstatus = {
|
let educationstatus = {
|
||||||
"Id": parseInt(studId),
|
"Id": parseInt(studId),
|
||||||
"Name": nameInput.value,
|
"Name": nameInput.value,
|
||||||
|
@ -21,39 +21,7 @@ generateButton.addEventListener("click", () => {
|
|||||||
}).done((data) => {
|
}).done((data) => {
|
||||||
dateFromSpan.innerHTML = reportModel["DateFrom"].toLocaleDateString();
|
dateFromSpan.innerHTML = reportModel["DateFrom"].toLocaleDateString();
|
||||||
dateToSpan.innerHTML = reportModel["DateTo"].toLocaleDateString();
|
dateToSpan.innerHTML = reportModel["DateTo"].toLocaleDateString();
|
||||||
/*renderTable(reportData);*/
|
renderTable(data);
|
||||||
|
|
||||||
// Добавление данных
|
|
||||||
for (var i = 0; i < data.length; i++) {
|
|
||||||
var streamData = data[i];
|
|
||||||
var streamName = streamData.streamName;
|
|
||||||
|
|
||||||
// Добавление строки для каждого студента в потоке
|
|
||||||
for (var j = 0; j < streamData.studentStatus.length; j++) {
|
|
||||||
var student = streamData.studentStatus[j];
|
|
||||||
|
|
||||||
if (j === 0) {
|
|
||||||
var row = tbody.insertRow();
|
|
||||||
var streamNameCell = row.insertCell()
|
|
||||||
streamNameCell.textContent = streamName;
|
|
||||||
var studentNameCell = row.insertCell();
|
|
||||||
var dateOfAdmissionCell = row.insertCell();
|
|
||||||
var studentStatusCell = row.insertCell();
|
|
||||||
tbody.appendChild(row)
|
|
||||||
}
|
|
||||||
|
|
||||||
var row = tbody.insertRow();
|
|
||||||
var streamNameCell = row.insertCell()
|
|
||||||
var studentNameCell = row.insertCell();
|
|
||||||
studentNameCell.textContent = student.studentName;
|
|
||||||
var dateOfAdmissionCell = row.insertCell();
|
|
||||||
dateOfAdmissionCell.textContent = formatDate(student.dateOfAddmission);
|
|
||||||
var studentStatusCell = row.insertCell();
|
|
||||||
studentStatusCell.textContent = student.educationStatus;
|
|
||||||
|
|
||||||
tbody.appendChild(row);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -82,40 +50,40 @@ sendByMailButton.addEventListener("click", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
tbody.innerHTML = "";
|
|
||||||
/*reportData.forEach((record) => {
|
|
||||||
const cars = record.cars;
|
|
||||||
const works = record.works;
|
|
||||||
const recordHeight = Math.max(cars.length + 1, works.length + 1);
|
|
||||||
for (let i = 0; i < recordHeight; i++) {
|
|
||||||
let cellsData = ["", "", "", ""];
|
|
||||||
if (i === 0) {
|
|
||||||
cellsData[0] = record.equipmentName;
|
|
||||||
cellsData[1] = getDate(record.equipmentDateCreate);
|
|
||||||
createTableRow(cellsData);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
let k = i - 1;
|
|
||||||
if (k < cars.length) {
|
|
||||||
cellsData[2] = cars[k];
|
|
||||||
}
|
|
||||||
if (k < works.length) {
|
|
||||||
cellsData[3] = works[k];
|
|
||||||
}
|
|
||||||
createTableRow(cellsData);
|
|
||||||
}
|
|
||||||
});*/
|
|
||||||
|
|
||||||
const renderTable = (reportData) => {
|
|
||||||
console.log(reportData)
|
const renderTable = (data) => {
|
||||||
reportData.forEach((item) => {
|
tbody.innerHTML = "";
|
||||||
var streamName = item.streamName;
|
|
||||||
var students = []
|
for (var i = 0; i < data.length; i++) {
|
||||||
item.studentStatus.forEach((stud) => {
|
var streamData = data[i];
|
||||||
students.push({ studentName: stud.studentName, educationStatus: stud.educationName });
|
var streamName = streamData.streamName;
|
||||||
})
|
|
||||||
createTableSection(streamName, students);
|
for (var j = 0; j < streamData.studentStatus.length; j++) {
|
||||||
})
|
var student = streamData.studentStatus[j];
|
||||||
|
|
||||||
|
if (j === 0) {
|
||||||
|
var row = tbody.insertRow();
|
||||||
|
var streamNameCell = row.insertCell()
|
||||||
|
streamNameCell.textContent = streamName;
|
||||||
|
var studentNameCell = row.insertCell();
|
||||||
|
var dateOfAdmissionCell = row.insertCell();
|
||||||
|
var studentStatusCell = row.insertCell();
|
||||||
|
tbody.appendChild(row)
|
||||||
|
}
|
||||||
|
|
||||||
|
var row = tbody.insertRow();
|
||||||
|
var streamNameCell = row.insertCell()
|
||||||
|
var studentNameCell = row.insertCell();
|
||||||
|
studentNameCell.textContent = student.studentName;
|
||||||
|
var dateOfAdmissionCell = row.insertCell();
|
||||||
|
dateOfAdmissionCell.textContent = formatDate(student.dateOfAddmission);
|
||||||
|
var studentStatusCell = row.insertCell();
|
||||||
|
studentStatusCell.textContent = student.educationStatus;
|
||||||
|
|
||||||
|
tbody.appendChild(row);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const createTableSection = (streamName, students) => {
|
const createTableSection = (streamName, students) => {
|
||||||
|
@ -4,6 +4,16 @@ const surnameInput = document.getElementById("surname-input")
|
|||||||
const dateInput = document.getElementById("date-input")
|
const dateInput = document.getElementById("date-input")
|
||||||
const studCardInput = document.getElementById("studcard-input")
|
const studCardInput = document.getElementById("studcard-input")
|
||||||
|
|
||||||
|
const correctData = () => {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const validate = () => {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
createBtn.addEventListener("click", () => {
|
createBtn.addEventListener("click", () => {
|
||||||
if (!correctData()) {
|
if (!correctData()) {
|
||||||
return;
|
return;
|
||||||
@ -11,19 +21,6 @@ createBtn.addEventListener("click", () => {
|
|||||||
if (!validate()) {
|
if (!validate()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
const correctData = function () {
|
|
||||||
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
const validate = function () {
|
|
||||||
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
createBtn.addEventListener("click", () => {
|
|
||||||
let student = {
|
let student = {
|
||||||
"Name": nameInput.value,
|
"Name": nameInput.value,
|
||||||
"Surname": surnameInput.value,
|
"Surname": surnameInput.value,
|
||||||
|
@ -5,6 +5,16 @@ const dateInput = document.getElementById("date-input")
|
|||||||
const studCardInput = document.getElementById("studcard-input")
|
const studCardInput = document.getElementById("studcard-input")
|
||||||
const studId = document.getElementById("vb-id").dataset.id
|
const studId = document.getElementById("vb-id").dataset.id
|
||||||
|
|
||||||
|
const correctData = () => {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const validate = () => {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
updateBtn.addEventListener("click", () => {
|
updateBtn.addEventListener("click", () => {
|
||||||
if (!correctData()) {
|
if (!correctData()) {
|
||||||
return;
|
return;
|
||||||
@ -12,19 +22,6 @@ updateBtn.addEventListener("click", () => {
|
|||||||
if (!validate()) {
|
if (!validate()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
const correctData = function () {
|
|
||||||
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
const validate = function () {
|
|
||||||
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
updateBtn.addEventListener("click", () => {
|
|
||||||
let student = {
|
let student = {
|
||||||
"Id": parseInt(studId),
|
"Id": parseInt(studId),
|
||||||
"Name": nameInput.value,
|
"Name": nameInput.value,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user