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
038ee419
Commit
038ee419
authored
Sep 02, 2021
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
d1b322a4
090ed4e7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
3 deletions
+78
-3
FirstShopListModule.cs
Mall.Module.TradePavilion/FirstShopListModule.cs
+41
-1
TradeController.cs
Mall.WebApi/Controllers/TradePavilion/TradeController.cs
+37
-2
No files found.
Mall.Module.TradePavilion/FirstShopListModule.cs
View file @
038ee419
...
...
@@ -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
"该品牌/载体已报名,无法重复报名"
;
...
...
@@ -496,6 +496,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 @
038ee419
...
...
@@ -613,7 +613,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// 获取商会活动报名分页列表
/// </summary>
/// <returns></returns>
public
ApiResult
GetCommerceConsultStaticPage
()
[
HttpPost
]
public
ApiResult
GetConsultStaticPage
()
{
ResultPageModel
pageModel
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
msg
.
ToString
());
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
...
...
@@ -630,7 +631,6 @@ namespace Mall.WebApi.Controllers.TradePavilion
}
/// <summary>
/// 根据编号获取商会活动报名实体
/// </summary>
...
...
@@ -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