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
0b8d012d
Commit
0b8d012d
authored
Sep 03, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
ead17e6b
c9284fe9
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 @
0b8d012d
...
...
@@ -1056,7 +1056,6 @@ namespace Mall.Module.TradePavilion
string
tempFoldr
=
""
;
#
region
解析表单内容
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"
);
...
...
@@ -1156,104 +1155,7 @@ namespace Mall.Module.TradePavilion
}
}
}
//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)
// {
// }
// }
// }
// }
// }
// }
//}
#
endregion
var
templistZipPath
=
Path
.
Combine
(
tempPath
+
"zip\\"
+
timeStr
+
"\\"
);
//路径
if
(!
Directory
.
Exists
(
templistZipPath
))
{
...
...
@@ -1289,7 +1191,7 @@ namespace Mall.Module.TradePavilion
{
return
""
;
}
#
endregion
}
...
...
@@ -1306,18 +1208,19 @@ namespace Mall.Module.TradePavilion
{
//存储的临时文件地址
string
rootBook
=
AppDomain
.
CurrentDomain
.
BaseDirectory
;
string
tempPath
=
Path
.
Combine
(
rootBook
+
Url
.
TrimStart
(
'/'
));
#
region
解析表单内容
string
timeStr
=
Url
.
TrimStart
(
'/'
).
Split
(
"/"
)[
4
];
if
(!
File
.
Exists
(
tempPath
))
{
return
true
;
}
else
try
{
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
[]
dirArr
=
dir
.
GetDirectories
();
foreach
(
DirectoryInfo
item
in
dirArr
)
...
...
@@ -1332,15 +1235,15 @@ namespace Mall.Module.TradePavilion
}
}
return
true
;
}
catch
(
Exception
ex
)
{
return
false
;
}
}
}
catch
(
Exception
ex
)
{
return
false
;
}
#
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