forked from Alex13658/SchoolServer
/
reports.go
218 lines (180 loc) · 5.61 KB
/
reports.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
// Copyright (C) 2018 Mikhail Masyagin & Andrey Koshelev
package datatypes
/*
01 тип.
*/
// TotalMarkReport struct - отчет первого типа.
type TotalMarkReport struct {
Table []TotalMarkReportNote `json:"table"`
}
func NewTotalMarkReport() *TotalMarkReport {
return &TotalMarkReport{
Table: []TotalMarkReportNote{},
}
}
// TotalMarkReportNote struct - подотчет об одном предмете.
type TotalMarkReportNote struct {
Subject string `json:"subject"`
Period1 int `json:"period1"`
Period2 int `json:"period2"`
Period3 int `json:"period3"`
Period4 int `json:"period4"`
Year int `json:"year"`
Exam int `json:"exam"`
Final int `json:"final"`
}
/*
02 тип.
*/
// AverageMarkReport struct - отчет второго типа.
type AverageMarkReport struct {
Table []AverageMarkReportNote `json:"table"`
}
func NewAverageMarkReport() *AverageMarkReport {
return &AverageMarkReport{
Table: []AverageMarkReportNote{},
}
}
// AverageMarkReportNote - подотчет об одном предмете.
type AverageMarkReportNote struct {
Subject string `json:"subject"`
StudentMark float32 `json:"student_mark"`
ClassMark float32 `json:"class_mark"`
}
/*
03 тип.
*/
// AverageMarkDynReport struct - отчет третьего типа.
type AverageMarkDynReport struct {
Data []AverageMarkDynReportNote `json:"table"`
}
func NewAverageMarkDynReport() *AverageMarkDynReport {
return &AverageMarkDynReport{
Data: []AverageMarkDynReportNote{},
}
}
// AverageMarkDynReportNote struct - одна запись в отчёте "Динамика среднего балла".
type AverageMarkDynReportNote struct {
Date string `json:"date"`
StudentWorksAmount int `json:"student_works_amount"`
StudentAverageMark float32 `json:"student_average_mark"`
ClassWorksAmount int `json:"class_works_amount"`
ClassAverageMark float32 `json:"class_average_mark"`
}
/*
04 тип.
*/
// StudentGradeReport struct - отчет четвертого типа.
type StudentGradeReport struct {
Data []StudentGradeReportNote `json:"table"`
}
func NewStudentGradeReport() *StudentGradeReport {
return &StudentGradeReport{
Data: []StudentGradeReportNote{},
}
}
// StudentGradeReportNote struct - одна запись в отчете об успеваемости.
type StudentGradeReportNote struct {
Type string `json:"type"`
Theme string `json:"theme"`
DateOfCompletion string `json:"date_of_completion"`
Mark int `json:"mark"`
}
/*
05 тип.
*/
// StudentTotalReport struct - отчет пятого типа.
type StudentTotalReport struct {
MainTable []Month `json:"months"`
AverageMarks []SubjectAverageMark `json:"average_marks"`
}
func NewStudentTotalReport() *StudentTotalReport {
return &StudentTotalReport{
MainTable: []Month{},
AverageMarks: []SubjectAverageMark{},
}
}
type SubjectMarks struct {
Name string `json:"name"`
Marks []string `json:"marks"`
}
type Day struct {
Number int `json:"number"`
Subjects []SubjectMarks `json:"subjects"`
}
type Month struct {
Name string `json:"name"`
Days []Day `json:"days"`
}
type SubjectAverageMark struct {
Name string `json:"name"`
Mark float32 `json:"mark"`
}
/*
06 тип.
*/
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// StudentAttendanceGradeReport - отчет шестого типа пока что пропускаем.
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
/*
07 тип.
*/
// JournalAccessReport struct - отчет седьмого типа.
type JournalAccessReport struct {
Data []JournalAccessReportNote `json:"table"`
}
func NewJournalAccessReport() *JournalAccessReport {
return &JournalAccessReport{
Data: []JournalAccessReportNote{},
}
}
// JournalAccessReportNote struct - одна запись в отчёте о доступе к классному журналу
type JournalAccessReportNote struct {
Class int `json:"class"`
Subject string `json:"subject"`
Date string `json:"date"`
User string `json:"user"`
LessonDate string `json:"lesson_date"`
Period string `json:"period"`
Action string `json:"action"`
}
/*
08 тип.
*/
// ParentInfoLetterData struct - данные для отчета восьмого типа(Информационное письмо для родителей).
type ParentInfoLetterData struct {
ReportTypes []ReportType `json:"report_types"`
Periods []Period `json:"periods"`
}
func NewParentInfoLetterData() *ParentInfoLetterData {
return &ParentInfoLetterData{
ReportTypes: []ReportType{},
Periods: []Period{},
}
}
// ReportType struct - тип отчёта
type ReportType struct {
ReportTypeID int `json:"report_type_id"`
ReportTypeName string `json:"report_type_name"`
}
// Period struct - период
type Period struct {
PeriodID int `json:"period_id"`
PeriodName string `json:"period_name"`
}
// ParentInfoLetterReport struct - отчет восьмого типа.
type ParentInfoLetterReport struct {
Data []ParentInfoLetterReportNote `json:"table"`
}
func NewParentInfoLetterReport() *ParentInfoLetterReport {
return &ParentInfoLetterReport{
Data: []ParentInfoLetterReportNote{},
}
}
// ParentInfoLetterReportNote struct - одна запись в отчёте "Информационное письмо для родителей"
type ParentInfoLetterReportNote struct {
Name string `json:"name"`
Marks []int `json:"marks"`
AverageMark float32 `json:"average_mark"`
MarkForPeriod int `json:"mark_for_period"`
}