Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
Education
Commits
d8c7edee
Commit
d8c7edee
authored
Sep 14, 2024
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
老师排课表和学员发课表下载调整
parent
e3dfad48
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
45 deletions
+80
-45
ClassModule.cs
Edu.Module.Course/ClassModule.cs
+7
-5
TeacherClassController.cs
Edu.WebApi/Controllers/Course/TeacherClassController.cs
+73
-40
No files found.
Edu.Module.Course/ClassModule.cs
View file @
d8c7edee
...
@@ -4400,7 +4400,7 @@ namespace Edu.Module.Course
...
@@ -4400,7 +4400,7 @@ namespace Edu.Module.Course
/// <summary>
/// <summary>
/// 预约课管理
/// 预约课管理
导出
/// </summary>
/// </summary>
/// <param name="StartDate"></param>
/// <param name="StartDate"></param>
/// <param name="EndDate"></param>
/// <param name="EndDate"></param>
...
@@ -4410,7 +4410,7 @@ namespace Edu.Module.Course
...
@@ -4410,7 +4410,7 @@ namespace Edu.Module.Course
/// <param name="appointState"></param>
/// <param name="appointState"></param>
/// <param name="group_Id"></param>
/// <param name="group_Id"></param>
/// <returns></returns>
/// <returns></returns>
public
List
<
RB_Teacher_ViewModel
>
GetAppointmentPlanStatExport
(
string
StartDate
,
string
EndDate
,
int
teacherId
,
int
classRoomId
,
int
ClassType
,
int
appointState
,
int
group_Id
,
out
List
<
RB_Class_Plan_ViewModel
>
list
,
out
List
<
RB_Reserve_Class_Extend
>
reserveList
,
out
List
<
RB_Scroll_Appointment_ViewModel
>
appointList
,
out
List
<
RB_Class_Time_ViewModel
>
timeList
,
out
List
<
RB_Order_Guest_ViewModel
>
guestList
,
out
List
<
RB_Order_Guest_ViewModel
>
tempGuestList
,
out
List
<
RB_Visitor_Reserve_Extend
>
visitorList
,
out
List
<
RB_Course_Chapter_ViewModel
>
chatperList
)
public
List
<
RB_Teacher_ViewModel
>
GetAppointmentPlanStatExport
(
string
StartDate
,
string
EndDate
,
int
teacherId
,
int
classRoomId
,
int
ClassType
,
int
appointState
,
int
group_Id
,
out
List
<
RB_Class_Plan_ViewModel
>
list
,
out
List
<
RB_Reserve_Class_Extend
>
reserveList
,
out
List
<
RB_Scroll_Appointment_ViewModel
>
appointList
,
out
List
<
RB_Class_Time_ViewModel
>
timeList
,
out
List
<
RB_Order_Guest_ViewModel
>
guestList
,
out
List
<
RB_Order_Guest_ViewModel
>
tempGuestList
,
out
List
<
RB_Visitor_Reserve_Extend
>
visitorList
,
out
List
<
RB_Course_Chapter_ViewModel
>
chatperList
,
out
List
<
RB_Course_ViewModel
>
courseList
)
{
{
var
sDTime
=
Convert
.
ToDateTime
(
StartDate
);
var
sDTime
=
Convert
.
ToDateTime
(
StartDate
);
var
eDTime
=
Convert
.
ToDateTime
(
EndDate
);
var
eDTime
=
Convert
.
ToDateTime
(
EndDate
);
...
@@ -4428,6 +4428,7 @@ namespace Edu.Module.Course
...
@@ -4428,6 +4428,7 @@ namespace Edu.Module.Course
tempGuestList
=
new
List
<
RB_Order_Guest_ViewModel
>();
//2021-07-20 Add By:W临时上课邀请
tempGuestList
=
new
List
<
RB_Order_Guest_ViewModel
>();
//2021-07-20 Add By:W临时上课邀请
visitorList
=
new
List
<
RB_Visitor_Reserve_Extend
>();
visitorList
=
new
List
<
RB_Visitor_Reserve_Extend
>();
chatperList
=
new
List
<
RB_Course_Chapter_ViewModel
>();
chatperList
=
new
List
<
RB_Course_Chapter_ViewModel
>();
courseList
=
new
List
<
RB_Course_ViewModel
>();
List
<
RB_Teacher_ViewModel
>
TeacherList
=
new
List
<
RB_Teacher_ViewModel
>();
List
<
RB_Teacher_ViewModel
>
TeacherList
=
new
List
<
RB_Teacher_ViewModel
>();
var
reserveQuery
=
new
RB_Reserve_Class_Extend
()
var
reserveQuery
=
new
RB_Reserve_Class_Extend
()
{
{
...
@@ -4515,15 +4516,15 @@ namespace Edu.Module.Course
...
@@ -4515,15 +4516,15 @@ namespace Edu.Module.Course
item
.
OrderCourseList
=
orderCourseList
?.
Where
(
qitem
=>
qitem
.
OrderId
==
item
.
OrderId
)?.
ToList
()
??
new
List
<
RB_Order_Course_ViewModel
>();
item
.
OrderCourseList
=
orderCourseList
?.
Where
(
qitem
=>
qitem
.
OrderId
==
item
.
OrderId
)?.
ToList
()
??
new
List
<
RB_Order_Course_ViewModel
>();
}
}
List
<
int
>
courseList
=
Common
.
ConvertHelper
.
StringToList
(
courseIds
);
List
<
int
>
course
Id
List
=
Common
.
ConvertHelper
.
StringToList
(
courseIds
);
List
<
int
>
newList
=
new
List
<
int
>();
List
<
int
>
newList
=
new
List
<
int
>();
if
(
learnList
!=
null
)
if
(
learnList
!=
null
)
{
{
newList
.
AddRange
(
learnList
);
newList
.
AddRange
(
learnList
);
}
}
if
(
courseList
!=
null
)
if
(
course
Id
List
!=
null
)
{
{
newList
.
AddRange
(
courseList
);
newList
.
AddRange
(
course
Id
List
);
}
}
if
(
orderCourseIdList
!=
null
&&
orderCourseIdList
.
Count
>
0
)
if
(
orderCourseIdList
!=
null
&&
orderCourseIdList
.
Count
>
0
)
{
{
...
@@ -4536,6 +4537,7 @@ namespace Edu.Module.Course
...
@@ -4536,6 +4537,7 @@ namespace Edu.Module.Course
{
{
CourseIds
=
string
.
Join
(
","
,
newList
.
Distinct
())
CourseIds
=
string
.
Join
(
","
,
newList
.
Distinct
())
});
;
});
;
courseList
=
courseRepository
.
GetCourseListRepository
(
new
RB_Course_ViewModel
()
{
QCourseIds
=
string
.
Join
(
","
,
courseIdList
.
Distinct
())
});
}
}
}
}
//获取所有老师的列表
//获取所有老师的列表
...
...
Edu.WebApi/Controllers/Course/TeacherClassController.cs
View file @
d8c7edee
...
@@ -549,21 +549,22 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -549,21 +549,22 @@ namespace Edu.WebApi.Controllers.Course
var
visitorList
=
new
List
<
Model
.
ViewModel
.
Reserve
.
RB_Visitor_Reserve_Extend
>();
var
visitorList
=
new
List
<
Model
.
ViewModel
.
Reserve
.
RB_Visitor_Reserve_Extend
>();
var
chatperList
=
new
List
<
RB_Course_Chapter_ViewModel
>();
var
chatperList
=
new
List
<
RB_Course_Chapter_ViewModel
>();
List
<
RB_Teacher_ViewModel
>
TeacherList
=
new
List
<
RB_Teacher_ViewModel
>();
List
<
RB_Teacher_ViewModel
>
TeacherList
=
new
List
<
RB_Teacher_ViewModel
>();
TeacherList
=
classModule
.
GetAppointmentPlanStatExport
(
StartDate
,
EndDate
,
TeacherId
,
ClassRoomId
,
ClassType
,
AppointState
,
base
.
UserInfo
.
Group_Id
,
out
list
,
out
reserveList
,
out
appointList
,
out
timeList
,
out
guestList
,
out
tempGuestList
,
out
visitorList
,
out
chatperList
);
List
<
RB_Course_ViewModel
>
courseList
=
new
List
<
RB_Course_ViewModel
>();
TeacherList
=
classModule
.
GetAppointmentPlanStatExport
(
StartDate
,
EndDate
,
TeacherId
,
ClassRoomId
,
ClassType
,
AppointState
,
base
.
UserInfo
.
Group_Id
,
out
list
,
out
reserveList
,
out
appointList
,
out
timeList
,
out
guestList
,
out
tempGuestList
,
out
visitorList
,
out
chatperList
,
out
courseList
);
TeacherList
=
TeacherList
?.
Where
(
qitem
=>
qitem
.
Dept_Id
==
8
)?.
OrderBy
(
qitem
=>
qitem
.
SortNum
)?.
ToList
();
try
try
{
{
ExcelDataSource
headerTimeFrist
=
new
ExcelDataSource
()
ExcelDataSource
headerTimeFrist
=
new
ExcelDataSource
()
{
{
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
{
{
new
ExcelColumn
(
value
:
"第一节课:9:30~11:00"
){
Colspan
=
3
,
CellWidth
=
10
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"第一节课:9:30~11:00"
){
Colspan
=
3
,
CellWidth
=
10
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
""
){
CellWidth
=
10
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
""
){
CellWidth
=
10
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"第二节课:11:10~12:40"
){
Colspan
=
3
,
CellWidth
=
10
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"第二节课:11:10~12:40"
){
Colspan
=
3
,
CellWidth
=
10
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
""
){
CellWidth
=
10
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
""
){
CellWidth
=
10
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"第三节课:13:30~15:00"
){
Colspan
=
3
,
CellWidth
=
10
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"第三节课:13:30~15:00"
){
Colspan
=
3
,
CellWidth
=
10
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
""
){
Colspan
=(
9
+
TeacherList
.
Count
)>
12
?(
9
+
TeacherList
.
Count
-
12
):
0
,
CellWidth
=
10
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
}
new
ExcelColumn
(
value
:
""
){
Colspan
=(
9
+
TeacherList
.
Count
)>
12
?(
9
+
TeacherList
.
Count
-
12
):
0
,
CellWidth
=
10
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
}
}
}
};
};
slist
.
Add
(
headerTimeFrist
);
slist
.
Add
(
headerTimeFrist
);
ExcelDataSource
headerTimeLast
=
new
ExcelDataSource
()
ExcelDataSource
headerTimeLast
=
new
ExcelDataSource
()
...
@@ -571,7 +572,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -571,7 +572,7 @@ namespace Edu.WebApi.Controllers.Course
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
{
{
new
ExcelColumn
(
value
:
"第四节课:15:10~16:40"
){
Colspan
=
3
,
CellWidth
=
10
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"第四节课:15:10~16:40"
){
Colspan
=
3
,
CellWidth
=
10
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
""
){
CellWidth
=
10
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
""
){
CellWidth
=
10
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"第五节课:16:50~18:20"
){
Colspan
=
3
,
CellWidth
=
10
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"第五节课:16:50~18:20"
){
Colspan
=
3
,
CellWidth
=
10
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
""
){
CellWidth
=
10
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
""
){
CellWidth
=
10
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"第六节课:19:00~20:30"
){
Colspan
=
3
,
CellWidth
=
10
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"第六节课:19:00~20:30"
){
Colspan
=
3
,
CellWidth
=
10
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
...
@@ -589,13 +590,11 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -589,13 +590,11 @@ namespace Edu.WebApi.Controllers.Course
{
{
var
DayList
=
new
List
<
object
>();
var
DayList
=
new
List
<
object
>();
var
ClassDate
=
sDTime
.
AddDays
(
i
);
var
ClassDate
=
sDTime
.
AddDays
(
i
);
ExcelDataSource
classDs
=
new
ExcelDataSource
()
ExcelDataSource
classDs
=
new
ExcelDataSource
()
{
{
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
{
{
new
ExcelColumn
(
value
:
ClassDate
.
ToString
(
"MM月dd日"
)){
Colspan
=
2
,
CellWidth
=
30
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
ClassDate
.
ToString
(
"MM月dd日"
)){
Colspan
=
2
,
CellWidth
=
30
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
}
}
};
//日期老师名字
};
//日期老师名字
foreach
(
var
itemTeacher
in
TeacherList
)
foreach
(
var
itemTeacher
in
TeacherList
)
...
@@ -691,7 +690,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -691,7 +690,7 @@ namespace Edu.WebApi.Controllers.Course
timeClassInfo1
+=
subItem
.
LessonName
;
timeClassInfo1
+=
subItem
.
LessonName
;
}
}
#
region
试听
课
#
region
预约
课
var
tempAppointList
=
appointList
.
Where
(
x
=>
x
.
TeacherId
==
itemTime
.
TId
&&
x
.
Date
==
ClassDate
&&
x
.
CourseSTime
==
startTime
)
var
tempAppointList
=
appointList
.
Where
(
x
=>
x
.
TeacherId
==
itemTime
.
TId
&&
x
.
Date
==
ClassDate
&&
x
.
CourseSTime
==
startTime
)
.
GroupBy
(
x
=>
new
.
GroupBy
(
x
=>
new
{
{
...
@@ -718,28 +717,50 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -718,28 +717,50 @@ namespace Edu.WebApi.Controllers.Course
qitem
.
RoomId
==
item
.
Key
.
RoomId
&&
qitem
.
RoomId
==
item
.
Key
.
RoomId
&&
qitem
.
RoomName
==
item
.
Key
.
RoomName
&&
qitem
.
RoomName
==
item
.
Key
.
RoomName
&&
qitem
.
CourseId
==
item
.
Key
.
CourseId
&&
qitem
.
CourseId
==
item
.
Key
.
CourseId
&&
qitem
.
ChapterNo
==
item
.
Key
.
ChapterNo
&&
qitem
.
ChapterNo
==
item
.
Key
.
ChapterNo
&&
qitem
.
ShiftSort
==
item
.
Key
.
ShiftSort
&&
qitem
.
ShiftSort
==
item
.
Key
.
ShiftSort
&&
qitem
.
CourseSTime
==
item
.
Key
.
CourseSTime
qitem
.
CourseSTime
==
item
.
Key
.
CourseSTime
).
ToList
();
).
ToList
();
var
tempChatper
=
chatperList
?.
Where
(
qitem
=>
qitem
.
CourseId
==
item
.
Key
.
CourseId
&&
qitem
.
ChapterNo
==
item
.
Key
.
ChapterNo
.
ToString
())?.
FirstOrDefault
();
var
tempChatper
=
chatperList
?.
Where
(
qitem
=>
qitem
.
CourseId
==
item
.
Key
.
CourseId
&&
qitem
.
ChapterNo
==
item
.
Key
.
ChapterNo
.
ToString
())?.
FirstOrDefault
();
string
ChapterName
=
""
;
int
CourseGradeId
=
0
;
int
CourseGradeId
=
0
;
if
(
tempChatper
!=
null
)
if
(
tempChatper
!=
null
)
{
{
CourseGradeId
=
tempChatper
.
CourseRate
.
ToInt
();
CourseGradeId
=
tempChatper
.
CourseRate
.
ToInt
();
ChapterName
=
tempChatper
?.
ChapterName
??
""
;
}
}
var
tempCourse
=
courseList
?.
FirstOrDefault
(
qitem
=>
qitem
.
CourseId
==
item
.
Key
.
CourseId
)
??
new
RB_Course_ViewModel
();
if
(
CourseGradeId
==
0
&&
(
tempCourse
?.
CourseRate
??
0
)
>
0
)
{
CourseGradeId
=
(
int
)
tempCourse
.
CourseRate
;
if
(
string
.
IsNullOrEmpty
(
ChapterName
)
&&
(
tempCourse
.
CourseRate
==
CourseRateEnum
.
OneFor
||
tempCourse
.
CourseRate
==
CourseRateEnum
.
OneCH
))
{
ChapterName
=
string
.
Format
(
"第{0}次课"
,
item
.
Key
.
ChapterNo
);
}
}
if
(
CourseGradeId
>
0
)
{
CourseRateEnum
CourseGradeIdRate
=
(
CourseRateEnum
)
CourseGradeId
;
if
(!
ChapterName
.
Contains
(
CourseGradeIdRate
.
ToName
().
Replace
(
"课程"
,
""
)))
{
ChapterName
=
CourseGradeIdRate
.
ToName
().
Replace
(
"课程"
,
""
)
+
"-"
+
ChapterName
;
}
}
if
(!
string
.
IsNullOrWhiteSpace
(
guestClassInfo1
))
if
(!
string
.
IsNullOrWhiteSpace
(
guestClassInfo1
))
{
{
guestClassInfo1
+=
"\r\n"
;
guestClassInfo1
+=
"\r\n"
;
}
}
guestClassInfo1
+=
item
.
Key
.
CourseName
+
"-"
+
item
.
Key
.
ChapterNo
+
":"
+
string
.
Join
(
"、"
,
subAppointList
?.
Select
(
qitem
=>
qitem
.
StuName
));
guestClassInfo1
+=
ChapterName
+
":"
+
string
.
Join
(
"、"
,
subAppointList
?.
Select
(
qitem
=>
qitem
.
StuName
));
if
(!
string
.
IsNullOrWhiteSpace
(
timeClassInfo1
))
if
(!
string
.
IsNullOrWhiteSpace
(
timeClassInfo1
))
{
{
timeClassInfo1
+=
"\r\n"
;
timeClassInfo1
+=
"\r\n"
;
}
}
timeClassInfo1
+=
item
.
Key
.
CourseName
+
"-"
+
item
.
Key
.
ChapterNo
;
timeClassInfo1
+=
ChapterName
;
}
}
#
endregion
#
endregion
...
@@ -750,7 +771,6 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -750,7 +771,6 @@ namespace Edu.WebApi.Controllers.Course
}
}
}
}
}
}
var
byteData
=
ExcelTempLateHelper
.
ToExcelExtend
(
slist
);
var
byteData
=
ExcelTempLateHelper
.
ToExcelExtend
(
slist
);
return
File
(
byteData
,
"application/octet-stream"
,
ExcelName
);
return
File
(
byteData
,
"application/octet-stream"
,
ExcelName
);
}
}
...
@@ -798,7 +818,8 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -798,7 +818,8 @@ namespace Edu.WebApi.Controllers.Course
var
visitorList
=
new
List
<
Model
.
ViewModel
.
Reserve
.
RB_Visitor_Reserve_Extend
>();
var
visitorList
=
new
List
<
Model
.
ViewModel
.
Reserve
.
RB_Visitor_Reserve_Extend
>();
var
chatperList
=
new
List
<
RB_Course_Chapter_ViewModel
>();
var
chatperList
=
new
List
<
RB_Course_Chapter_ViewModel
>();
List
<
RB_Teacher_ViewModel
>
TeacherList
=
new
List
<
RB_Teacher_ViewModel
>();
List
<
RB_Teacher_ViewModel
>
TeacherList
=
new
List
<
RB_Teacher_ViewModel
>();
TeacherList
=
classModule
.
GetAppointmentPlanStatExport
(
StartDate
,
EndDate
,
TeacherId
,
ClassRoomId
,
ClassType
,
AppointState
,
base
.
UserInfo
.
Group_Id
,
out
list
,
out
reserveList
,
out
appointList
,
out
timeList
,
out
guestList
,
out
tempGuestList
,
out
visitorList
,
out
chatperList
);
var
courseList
=
new
List
<
RB_Course_ViewModel
>();
TeacherList
=
classModule
.
GetAppointmentPlanStatExport
(
StartDate
,
EndDate
,
TeacherId
,
ClassRoomId
,
ClassType
,
AppointState
,
base
.
UserInfo
.
Group_Id
,
out
list
,
out
reserveList
,
out
appointList
,
out
timeList
,
out
guestList
,
out
tempGuestList
,
out
visitorList
,
out
chatperList
,
out
courseList
);
try
try
{
{
ExcelDataSource
headerTimeLast
=
new
ExcelDataSource
()
ExcelDataSource
headerTimeLast
=
new
ExcelDataSource
()
...
@@ -810,7 +831,6 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -810,7 +831,6 @@ namespace Edu.WebApi.Controllers.Course
new
ExcelColumn
(
value
:
"星期"
){
CellWidth
=
24
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"星期"
){
CellWidth
=
24
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"时间"
){
CellWidth
=
24
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"时间"
){
CellWidth
=
24
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"章节"
){
CellWidth
=
50
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"章节"
){
CellWidth
=
50
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
//new ExcelColumn(value:"上课地点"){CellWidth=24,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
}
}
};
};
slist
.
Add
(
headerTimeLast
);
slist
.
Add
(
headerTimeLast
);
...
@@ -826,24 +846,38 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -826,24 +846,38 @@ namespace Edu.WebApi.Controllers.Course
new
ExcelColumn
(
value
:
Common
.
ConvertHelper
.
GetWeekDay
(
itemGuest
.
Date
))
{
CellWidth
=
24
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
Common
.
ConvertHelper
.
GetWeekDay
(
itemGuest
.
Date
))
{
CellWidth
=
24
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
(
itemGuest
.
CourseSTime
??
""
)
+
"-"
+
(
itemGuest
.
CourseETime
??
""
))
{
CellWidth
=
24
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
}
new
ExcelColumn
(
value
:
(
itemGuest
.
CourseSTime
??
""
)
+
"-"
+
(
itemGuest
.
CourseETime
??
""
))
{
CellWidth
=
24
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
}
};
};
string
CourseChapterNoName
=
""
;
var
tempChapter
=
new
RB_Course_Chapter_ViewModel
();
if
(
itemGuest
.
CourseGradeId
==
CourseRateEnum
.
OneCH
||
itemGuest
.
CourseGradeId
==
CourseRateEnum
.
OneFor
)
if
(
itemGuest
.
OrderCourseList
!=
null
&&
itemGuest
.
OrderCourseList
.
Count
>
0
)
{
{
tempChapter
=
chatperList
.
FirstOrDefault
(
qitem
=>
itemGuest
.
OrderCourseList
.
Any
(
sItem
=>
sItem
.
CourseId
==
qitem
.
CourseId
)
&&
qitem
.
CourseRate
==
itemGuest
.
CourseGradeId
&&
qitem
.
ChapterNo
==
itemGuest
.
CourseGradeNo
.
ToString
())
??
new
RB_Course_Chapter_ViewModel
(
);
CourseChapterNoName
=
string
.
Format
(
"{0}-第{1}次课"
,
itemGuest
.
CourseGradeId
.
ToName
(),
itemGuest
.
CourseGradeNo
);
}
}
else
else
{
{
tempChapter
=
chatperList
.
FirstOrDefault
(
qitem
=>
qitem
.
CourseId
==
itemGuest
.
LearnCourseId
&&
qitem
.
ChapterNo
==
itemGuest
.
CourseGradeNo
.
ToString
())
??
new
RB_Course_Chapter_ViewModel
();
var
chapterCurrent
=
new
RB_Course_Chapter_ViewModel
();
}
//新订单
if
(
itemGuest
.
OrderCourseList
!=
null
&&
itemGuest
.
OrderCourseList
.
Count
>
0
)
string
chapterName
=
itemGuest
.
CourseName
+
"-"
+
itemGuest
.
CourseGradeNo
;
{
if
(
tempChapter
!=
null
&&
tempChapter
.
ChapterId
>
0
)
chapterCurrent
=
chatperList
.
FirstOrDefault
(
qitem
=>
itemGuest
.
OrderCourseList
.
Any
(
sItem
=>
sItem
.
CourseId
==
qitem
.
CourseId
)
&&
qitem
.
CourseRate
==
itemGuest
.
CourseGradeId
&&
qitem
.
ChapterNo
==
itemGuest
.
CourseGradeNo
.
ToString
())
??
new
RB_Course_Chapter_ViewModel
();
{
}
chapterName
=
tempChapter
.
ChapterName
;
//老订单
else
{
chapterCurrent
=
chatperList
.
FirstOrDefault
(
qitem
=>
qitem
.
CourseId
==
itemGuest
.
LearnCourseId
&&
qitem
.
ChapterNo
==
itemGuest
.
CourseGradeNo
.
ToString
())
??
new
RB_Course_Chapter_ViewModel
();
}
if
(
chapterCurrent
!=
null
&&
chapterCurrent
.
ChapterId
>
0
)
{
if
(
chapterCurrent
.
ChapterName
.
Contains
(
chapterCurrent
.
CourseRate
.
ToName
().
Replace
(
"课程"
,
""
)))
{
CourseChapterNoName
=
chapterCurrent
?.
ChapterName
;
}
else
{
CourseChapterNoName
=
chapterCurrent
?.
CourseRate
.
ToName
().
Replace
(
"课程"
,
""
)
+
"-"
+
chapterCurrent
?.
ChapterName
;
}
}
}
}
excelColumns
.
Add
(
new
ExcelColumn
(
value
:
chapter
Name
)
{
CellWidth
=
50
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
});
excelColumns
.
Add
(
new
ExcelColumn
(
value
:
CourseChapterNo
Name
)
{
CellWidth
=
50
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
});
ExcelDataSource
rowGuest
=
new
ExcelDataSource
()
ExcelDataSource
rowGuest
=
new
ExcelDataSource
()
{
{
ExcelRows
=
excelColumns
ExcelRows
=
excelColumns
...
@@ -853,14 +887,13 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -853,14 +887,13 @@ namespace Edu.WebApi.Controllers.Course
ExcelDataSource
rowKGuest
=
new
ExcelDataSource
()
ExcelDataSource
rowKGuest
=
new
ExcelDataSource
()
{
{
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
{
{
new
ExcelColumn
(
value
:
""
){
CellWidth
=
24
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
""
){
CellWidth
=
24
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
""
){
CellWidth
=
24
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
""
){
CellWidth
=
24
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
""
){
CellWidth
=
24
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
""
){
CellWidth
=
24
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
""
){
CellWidth
=
24
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
""
){
CellWidth
=
24
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
""
){
CellWidth
=
50
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
""
){
CellWidth
=
50
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
//new ExcelColumn(value:""){CellWidth=24,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
}
}
};
};
slist
.
Add
(
rowKGuest
);
slist
.
Add
(
rowKGuest
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment