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
16eba78f
Commit
16eba78f
authored
Sep 03, 2021
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
29e0f1b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
115 deletions
+18
-115
FirstShopListModule.cs
Mall.Module.TradePavilion/FirstShopListModule.cs
+18
-115
No files found.
Mall.Module.TradePavilion/FirstShopListModule.cs
View file @
16eba78f
...
@@ -1056,7 +1056,6 @@ namespace Mall.Module.TradePavilion
...
@@ -1056,7 +1056,6 @@ namespace Mall.Module.TradePavilion
string
tempFoldr
=
""
;
string
tempFoldr
=
""
;
#
region
解析表单内容
#
region
解析表单内容
foreach
(
var
enrollItem
in
enrollList
.
GroupBy
(
x
=>
x
.
UserId
))
foreach
(
var
enrollItem
in
enrollList
.
GroupBy
(
x
=>
x
.
UserId
))
{
{
var
companyName
=
clist
.
Where
(
x
=>
x
.
CreateBy
==
enrollItem
.
Key
).
FirstOrDefault
()?.
CompanyName
??
System
.
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmssfff"
);
var
companyName
=
clist
.
Where
(
x
=>
x
.
CreateBy
==
enrollItem
.
Key
).
FirstOrDefault
()?.
CompanyName
??
System
.
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmssfff"
);
...
@@ -1156,104 +1155,7 @@ namespace Mall.Module.TradePavilion
...
@@ -1156,104 +1155,7 @@ namespace Mall.Module.TradePavilion
}
}
}
}
}
}
#
endregion
//foreach (var listItem in listModel)
//{
// foreach (var enrollModel in enrollList.Where(x => x.ListId == listItem.Id))//榜单下面的公司
// {
// 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())
// {
// var companyName = clist.Where(x => x.CreateBy == enrollModel.UserId).FirstOrDefault()?.CompanyName ?? System.DateTime.Now.ToString("yyyyMMddHHmmssfff");
// var templistPath = Path.Combine(tempPath + "file\\" + timeStr + "\\" + listItem.ListName + "\\" + companyName + "\\");//路径
// if (!Directory.Exists(templistPath))
// {
// Directory.CreateDirectory(templistPath);
// }
// //开始下载图片视频至临时文件
// 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)
// {
// try
// {
// Uri uri = new Uri(qitem); //imgPath :网络图片地址
// WebRequest webRequest = WebRequest.Create(uri);
// // byte[] bytes;
// using (WebResponse webResponse = webRequest.GetResponse())
// {
// Bitmap bitmap = new Bitmap(webResponse.GetResponseStream());
// bitmap.Save(templistPath + Path.GetFileName(qitem), System.Drawing.Imaging.ImageFormat.Jpeg);
// }
// }
// catch (Exception ex)
// {
// }
// }
// }
// else if (itemFile.CompKey == "VideoUploadComp"||itemFile.CompKey == "CommonUploadComp")
// {
// //视频处理
// foreach (var qitem in obj.FileList)
// {
// try
// {
// HttpWebRequest request = (HttpWebRequest)WebRequest.Create(qitem);
// request.Method = "GET";
// byte[] fileBytes;
// using (WebResponse webRes = request.GetResponse())
// {
// int length = (int)webRes.ContentLength;
// HttpWebResponse response = webRes as HttpWebResponse;
// Stream stream = response.GetResponseStream();
// var contentdisposition = response.Headers["Content-Disposition"];
// var filename = Path.GetFileName(qitem);
// //读取到内存
// MemoryStream stmMemory = new MemoryStream();
// byte[] buffer = new byte[length];
// int i;
// //将字节逐个放入到Byte中
// while ((i = stream.Read(buffer, 0, buffer.Length)) > 0)
// {
// stmMemory.Write(buffer, 0, i);
// }
// fileBytes = stmMemory.ToArray();//文件流Byte
// FileStream fs = new FileStream(templistPath + Path.GetFileName(qitem), FileMode.OpenOrCreate);
// stmMemory.WriteTo(fs);
// stmMemory.Close();
// fs.Close();
// }
// }
// catch (Exception ex)
// {
// }
// }
// }
// }
// }
// }
//}
var
templistZipPath
=
Path
.
Combine
(
tempPath
+
"zip\\"
+
timeStr
+
"\\"
);
//路径
var
templistZipPath
=
Path
.
Combine
(
tempPath
+
"zip\\"
+
timeStr
+
"\\"
);
//路径
if
(!
Directory
.
Exists
(
templistZipPath
))
if
(!
Directory
.
Exists
(
templistZipPath
))
{
{
...
@@ -1289,7 +1191,7 @@ namespace Mall.Module.TradePavilion
...
@@ -1289,7 +1191,7 @@ namespace Mall.Module.TradePavilion
{
{
return
""
;
return
""
;
}
}
#
endregion
}
}
...
@@ -1306,18 +1208,19 @@ namespace Mall.Module.TradePavilion
...
@@ -1306,18 +1208,19 @@ namespace Mall.Module.TradePavilion
{
{
//存储的临时文件地址
//存储的临时文件地址
string
rootBook
=
AppDomain
.
CurrentDomain
.
BaseDirectory
;
string
rootBook
=
AppDomain
.
CurrentDomain
.
BaseDirectory
;
string
tempPath
=
Path
.
Combine
(
rootBook
+
Url
.
TrimStart
(
'/'
));
try
#
region
解析表单内容
string
timeStr
=
Url
.
TrimStart
(
'/'
).
Split
(
"/"
)[
4
];
if
(!
File
.
Exists
(
tempPath
))
{
return
true
;
}
else
{
{
try
string
tempPath
=
Path
.
Combine
(
rootBook
+
Url
.
TrimStart
(
'/'
));
#
region
解析表单内容
string
timeStr
=
Url
.
TrimStart
(
'/'
).
Split
(
"/"
)[
4
];
if
(!
File
.
Exists
(
tempPath
))
{
{
return
true
;
}
else
{
DirectoryInfo
dir
=
new
DirectoryInfo
(
Path
.
Combine
(
rootBook
+
"upfile\\temporary\\firstshopenrollzip\\"
+
"zip\\"
));
DirectoryInfo
dir
=
new
DirectoryInfo
(
Path
.
Combine
(
rootBook
+
"upfile\\temporary\\firstshopenrollzip\\"
+
"zip\\"
));
DirectoryInfo
[]
dirArr
=
dir
.
GetDirectories
();
DirectoryInfo
[]
dirArr
=
dir
.
GetDirectories
();
foreach
(
DirectoryInfo
item
in
dirArr
)
foreach
(
DirectoryInfo
item
in
dirArr
)
...
@@ -1332,15 +1235,15 @@ namespace Mall.Module.TradePavilion
...
@@ -1332,15 +1235,15 @@ namespace Mall.Module.TradePavilion
}
}
}
}
return
true
;
return
true
;
}
catch
(
Exception
ex
)
{
return
false
;
}
}
}
}
catch
(
Exception
ex
)
{
return
false
;
}
#
endregion
#
endregion
...
...
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