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
e613a71a
Commit
e613a71a
authored
Sep 02, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
675b3c19
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
1 deletion
+76
-1
FirstShopListModule.cs
Mall.Module.TradePavilion/FirstShopListModule.cs
+41
-1
TradeController.cs
Mall.WebApi/Controllers/TradePavilion/TradeController.cs
+35
-0
No files found.
Mall.Module.TradePavilion/FirstShopListModule.cs
View file @
e613a71a
...
...
@@ -369,7 +369,7 @@ namespace Mall.Module.TradePavilion
if
(
demodel
.
Id
>
0
)
{
#
region
验证
var
valistList
=
firstShop_ListEnrollRepository
.
GetList
(
new
RB_FirstShop_ListEnroll_Extend
()
{
MallBaseId
=
demodel
.
MallBaseId
,
UserId
=
demodel
.
UserId
,
ObjectType
=
demodel
.
ObjectType
,
ObjectId
=
demodel
.
ObjectId
});
var
valistList
=
firstShop_ListEnrollRepository
.
GetList
(
new
RB_FirstShop_ListEnroll_Extend
()
{
MallBaseId
=
demodel
.
MallBaseId
,
ListId
=
demodel
.
ListId
,
UserId
=
demodel
.
UserId
,
ObjectType
=
demodel
.
ObjectType
,
ObjectId
=
demodel
.
ObjectId
});
if
(
valistList
.
Where
(
x
=>
x
.
Id
!=
demodel
.
Id
).
Any
())
{
return
"该品牌/载体已报名,无法重复报名"
;
...
...
@@ -494,6 +494,46 @@ namespace Mall.Module.TradePavilion
return
list
;
}
#
region
报名
excel
导出
/// <summary>
/// 单榜单excel导出
/// </summary>
/// <param name="listId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public
List
<
ExcelDataSource
>
GetFirstShopListEnrollToExcel
(
int
listId
,
int
mallBaseId
)
{
List
<
ExcelDataSource
>
RList
=
new
List
<
ExcelDataSource
>();
var
enrollList
=
firstShop_ListEnrollRepository
.
GetList
(
new
RB_FirstShop_ListEnroll_Extend
()
{
MallBaseId
=
mallBaseId
,
ListId
=
listId
});
if
(
enrollList
.
Any
())
{
#
region
组装头部
var
enrollModel
=
enrollList
.
FirstOrDefault
();
if
(
string
.
IsNullOrEmpty
(
enrollModel
.
Content
))
{
return
new
List
<
ExcelDataSource
>();
}
ExcelDataSource
header
=
new
ExcelDataSource
()
{
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
{
new
ExcelColumn
(
value
:
"企业名称"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
}
},
ColumnHight
=
30
};
List
<
FormDataItem
>
elist
=
JsonHelper
.
DeserializeObject
<
List
<
FormDataItem
>>(
enrollModel
.
Content
);
if
(
elist
.
Any
())
{
foreach
(
var
item
in
elist
)
{
var
obj
=
JsonHelper
.
DeserializeObject
<
UploadItem
>(
item
.
CompData
.
ToString
());
header
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
obj
.
Name
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
});
}
}
#
endregion
}
return
RList
;
}
#
endregion
/// <summary>
/// 设置报名状态
/// </summary>
...
...
Mall.WebApi/Controllers/TradePavilion/TradeController.cs
View file @
e613a71a
...
...
@@ -2195,6 +2195,41 @@ namespace Mall.WebApi.Controllers.TradePavilion
return
ApiResult
.
Success
(
""
,
pageModel
);
}
/// <summary>
/// 获取榜单
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
FileContentResult
GetFirstShopListEnrollToExcel
()
{
string
ExcelName
=
"榜单报名"
+
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmss"
)
+
".xls"
;
List
<
ExcelDataSource
>
slist
=
new
List
<
ExcelDataSource
>();
var
req
=
base
.
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
ListId
=
parms
.
GetInt
(
"ListId"
,
0
);
//榜单id
if
(
ListId
<=
0
)
{
var
byteData1
=
ExcelTempLateHelper
.
ToExcelExtend
(
slist
);
return
File
(
byteData1
,
"application/octet-stream"
,
ExcelName
);
}
try
{
List
<
ExcelDataSource
>
RList
=
firstShopListModule
.
GetFirstShopListEnrollToExcel
(
ListId
,
req
.
MallBaseId
);
slist
.
AddRange
(
RList
);
var
byteData
=
ExcelTempLateHelper
.
ToExcelExtend
(
slist
);
return
File
(
byteData
,
"application/octet-stream"
,
ExcelName
);
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
ex
,
string
.
Format
(
"GetFirstShopListEnrollToExcel: {0}"
,
JsonHelper
.
Serialize
(
RequestParm
)));
var
byteData1
=
ExcelTempLateHelper
.
ToExcelExtend
(
slist
);
return
File
(
byteData1
,
"application/octet-stream"
,
ExcelName
);
}
}
/// <summary>
/// 报名列表word导出
/// </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