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
074f4b14
Commit
074f4b14
authored
Sep 02, 2021
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
038ee419
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
24 deletions
+51
-24
FirstShopListModule.cs
Mall.Module.TradePavilion/FirstShopListModule.cs
+49
-23
TradeController.cs
Mall.WebApi/Controllers/TradePavilion/TradeController.cs
+2
-1
No files found.
Mall.Module.TradePavilion/FirstShopListModule.cs
View file @
074f4b14
...
...
@@ -6,6 +6,7 @@ using Mall.Repository.TradePavilion;
using
Mall.Repository.User
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB
;
...
...
@@ -507,7 +508,8 @@ namespace Mall.Module.TradePavilion
{
List
<
ExcelDataSource
>
RList
=
new
List
<
ExcelDataSource
>();
var
enrollList
=
firstShop_ListEnrollRepository
.
GetList
(
new
RB_FirstShop_ListEnroll_Extend
()
{
MallBaseId
=
mallBaseId
,
ListId
=
listId
});
if
(
enrollList
.
Any
())
{
if
(
enrollList
.
Any
())
{
#
region
组装头部
var
enrollModel
=
enrollList
.
FirstOrDefault
();
if
(
string
.
IsNullOrEmpty
(
enrollModel
.
Content
))
...
...
@@ -905,46 +907,70 @@ namespace Mall.Module.TradePavilion
var
enrollList
=
firstShop_ListEnrollRepository
.
GetList
(
new
RB_FirstShop_ListEnroll_Extend
{
MallBaseId
=
mallBaseId
,
ListIds
=
listIds
});
if
(
enrollList
==
null
||
!
enrollList
.
Any
())
{
errorMsg
=
"报名信息不存在"
;
return
""
;
}
string
userIds
=
string
.
Join
(
","
,
enrollList
.
Select
(
x
=>
x
.
UserId
).
Distinct
());
var
clist
=
companyRepository
.
GetCompanyListRepository
(
new
RB_Company_Extend
()
{
MallBaseId
=
mallBaseId
,
UserIds
=
userIds
});
//创建一个临时文件夹
string
tempFoldr
=
""
;
#
region
解析表单内容
foreach
(
var
enrollModel
in
listModel
)
//foreach (var item in enrollList.Where(x => x.ListId == enrollModel.Id).GroupBy(x => x.UserId))//榜单下面的公司
//{
// var companyName = clist.Where(x => x.CreateBy == item.Key).FirstOrDefault()?.CompanyName ?? System.DateTime.Now.ToString("yyyyMMddHHmmssfff");
// var templistPath = rootBook + "/upfile/temporary/firstshopenrollzip/" + enrollModel.ListName + "/" + companyName;//路径
// if (!Directory.Exists(templistPath))
// {
// Directory.CreateDirectory(templistPath);
// }
//}
foreach
(
var
listItem
in
listModel
)
{
if
(
string
.
IsNullOrEmpty
(
enrollModel
.
Content
))
{
errorMsg
=
"报名内容不存在,请核实后再试"
;
return
""
;
}
List
<
FormDataItem
>
elist
=
JsonHelper
.
DeserializeObject
<
List
<
FormDataItem
>>(
enrollModel
.
Content
);
elist
=
elist
.
Where
(
x
=>
x
.
CompKey
==
"ImageUploadComp"
||
x
.
CompKey
==
"VideoUploadComp"
).
ToList
();
if
(
elist
.
Any
())
foreach
(
var
enrollModel
in
enrollList
.
Where
(
x
=>
x
.
ListId
==
listItem
.
Id
))
//榜单下面的公司
{
//开始下载图片视频至临时文件
foreach
(
var
item
in
elist
)
if
(
string
.
IsNullOrEmpty
(
enrollModel
.
Content
))
{
var
obj
=
JsonHelper
.
DeserializeObject
<
UploadItem
>(
item
.
CompData
.
ToString
());
if
(
item
.
CompKey
==
"ImageUploadComp"
)
errorMsg
=
"报名内容不存在,请核实后再试"
;
return
""
;
}
List
<
FormDataItem
>
elist
=
JsonHelper
.
DeserializeObject
<
List
<
FormDataItem
>>(
enrollModel
.
Content
);
elist
=
elist
.
Where
(
x
=>
x
.
CompKey
==
"ImageUploadComp"
||
x
.
CompKey
==
"VideoUploadComp"
).
ToList
();
if
(
elist
.
Any
())
{
var
companyName
=
clist
.
Where
(
x
=>
x
.
CreateBy
==
enrollModel
.
UserId
).
FirstOrDefault
()?.
CompanyName
??
System
.
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmssfff"
);
var
templistPath
=
rootBook
+
"/upfile/temporary/firstshopenrollzip/"
+
listItem
.
ListName
+
"/"
+
companyName
;
//路径
if
(!
Directory
.
Exists
(
templistPath
))
{
//图片处理
string
Name
=
obj
.
Name
;
foreach
(
var
qitem
in
obj
.
FileList
)
{
//FileHelper.CreateImage(); 下载腾讯云至本地
}
Directory
.
CreateDirectory
(
templistPath
);
}
else
if
(
item
.
CompKey
==
"VideoUploadComp"
)
//开始下载图片视频至临时文件
foreach
(
var
itemFile
in
elist
)
{
//视频处理
var
obj
=
JsonHelper
.
DeserializeObject
<
UploadItem
>(
itemFile
.
CompData
.
ToString
());
if
(
itemFile
.
CompKey
==
"ImageUploadComp"
)
{
//图片处理
string
Name
=
obj
.
Name
;
foreach
(
var
qitem
in
obj
.
FileList
)
{
//FileHelper.CreateImage(); 下载腾讯云至本地
}
}
else
if
(
itemFile
.
CompKey
==
"VideoUploadComp"
)
{
//视频处理
}
}
}
}
}
//ZipHelper.Zip();
打包方法
ZipHelper
.
Zip
(
tempPath
,
"榜单导出文件夹"
,
ref
tempFoldr
);
//
打包方法
#
endregion
return
""
;
...
...
Mall.WebApi/Controllers/TradePavilion/TradeController.cs
View file @
074f4b14
...
...
@@ -2433,12 +2433,13 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// </summary>
/// <returns></returns>
[
HttpPost
]
[
AllowAnonymous
]
public
ApiResult
GetFirstShopEnrollZipExport
()
{
var
req
=
base
.
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
string
ListIds
=
parms
.
GetStringValue
(
"ListIds"
);
if
(
!
string
.
IsNullOrWhiteSpace
(
ListIds
))
if
(
string
.
IsNullOrWhiteSpace
(
ListIds
))
{
return
ApiResult
.
ParamIsNull
(
"请传递绑定ids"
);
}
...
...
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