Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
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
黄奎
mall.oytour.com
Commits
9a905338
Commit
9a905338
authored
Feb 05, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
点数订单excel导出
parent
d56bc07e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
1 deletion
+74
-1
PointController.cs
Mall.WebApi/Controllers/Education/PointController.cs
+74
-1
No files found.
Mall.WebApi/Controllers/Education/PointController.cs
View file @
9a905338
...
...
@@ -234,7 +234,6 @@ namespace Mall.WebApi.Controllers.Education
[
HttpPost
]
public
ApiResult
GetPointOrderPageList
()
{
var
parms
=
RequestParm
;
var
userInfo
=
UserInfo
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
msg
.
ToString
());
RB_Point_TeacherCourseOrder_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Point_TeacherCourseOrder_Extend
>(
RequestParm
.
msg
.
ToString
());
...
...
@@ -314,7 +313,81 @@ namespace Mall.WebApi.Controllers.Education
});
}
/// <summary>
/// 约课订单excel下载
/// </summary>
[
HttpPost
]
public
FileContentResult
GetPointOrderListToExcel
()
{
var
userInfo
=
UserInfo
;
RB_Point_TeacherCourseOrder_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Point_TeacherCourseOrder_Extend
>(
RequestParm
.
msg
.
ToString
());
string
ExcelName
=
"约课列表"
+
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmss"
)
+
".xls"
;
List
<
ExcelDataSource
>
slist
=
new
List
<
ExcelDataSource
>();
ExcelDataSource
header
=
new
ExcelDataSource
()
{
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
{
new
ExcelColumn
(
value
:
"单号"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"课程分类"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"课程名称"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"教师"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"学习时间"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"学习时长"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"学习总时长"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"房间信息"
)
{
CellWidth
=
25
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"总点数"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"实际点数"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"基础点数"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"用户名称"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"报名时间"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"状态"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
}
};
slist
.
Add
(
header
);
try
{
demodel
.
TenantId
=
userInfo
.
TenantId
;
demodel
.
MallBaseId
=
userInfo
.
MallBaseId
;
var
list
=
pointModule
.
GetPointOrderPageList
(
1
,
99999
,
out
long
count
,
demodel
);
#
region
组装数据
foreach
(
var
item
in
list
)
{
ExcelDataSource
datarow
=
new
ExcelDataSource
()
{
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
{
new
ExcelColumn
(
value
:
item
.
ID
.
ToString
()){
},
new
ExcelColumn
(
value
:
item
.
CourseClassType
.
GetEnumName
()){
},
new
ExcelColumn
(
value
:
item
.
CourseName
){
},
new
ExcelColumn
(
value
:
item
.
TeacherName
){
},
new
ExcelColumn
(
value
:
item
.
StudyDate
.
ToString
(
"yyyy-MM-dd HH:mm"
)){
},
new
ExcelColumn
(
value
:
item
.
StudyDuration
.
ToString
()){
},
new
ExcelColumn
(
value
:
item
.
TotalStudyDuration
.
ToString
()){
},
new
ExcelColumn
(
value
:
item
.
RoomInfo
){
},
new
ExcelColumn
(
value
:
item
.
TotalPointNum
.
ToString
()){
},
new
ExcelColumn
(
value
:
item
.
ActualPointNum
.
ToString
()){
},
new
ExcelColumn
(
value
:
item
.
BasePointNum
.
ToString
()){
},
new
ExcelColumn
(
value
:
item
.
UserName
+
"("
+
item
.
UserId
.
ToString
()+
")"
){
},
new
ExcelColumn
(
value
:(
item
.
CreateDate
.
HasValue
?
item
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
)){
},
new
ExcelColumn
(
value
:
item
.
OrderStaus
.
GetEnumName
()){
},
},
ColumnHight
=
30
};
slist
.
Add
(
datarow
);
}
#
endregion
var
byteData
=
ExcelTempLateHelper
.
ToExcelExtend
(
slist
);
return
File
(
byteData
,
"application/octet-stream"
,
ExcelName
);
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
ex
,
string
.
Format
(
"GetFileFromWebApi_requestData: {0}"
,
JsonHelper
.
Serialize
(
RequestParm
)));
var
byteData1
=
ExcelTempLateHelper
.
ToExcelExtend
(
slist
);
return
File
(
byteData1
,
"application/octet-stream"
,
ExcelName
);
}
}
/// <summary>
/// 获取订单状态枚举
...
...
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