Commit af214f81 authored by liudong1993's avatar liudong1993

Merge branch 'master' of http://gitlab.oytour.com/Kui2/mall.oytour.com into sdzq-ld

parents a48da09a 75d2342f
......@@ -6,8 +6,11 @@ using Mall.Repository.TradePavilion;
using Mall.Repository.User;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Net;
using System.Text;
using VT.FW.DB;
......@@ -1032,7 +1035,7 @@ namespace Mall.Module.TradePavilion
errorMsg = "";
//存储的临时文件地址
string rootBook = AppDomain.CurrentDomain.BaseDirectory;
string tempPath = rootBook + "/upfile/temporary/firstshopenrollzip";
string tempPath = rootBook + "/upfile/temporary/firstshopenrollzip/";
//获取榜单信息
var listModel = firstShop_ListRepository.GetList(new RB_FirstShop_List_Extend { MallBaseId = mallBaseId, QIds = listIds });
......@@ -1075,7 +1078,7 @@ namespace Mall.Module.TradePavilion
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;//路径
var templistPath = tempPath + "file/" + listItem.ListName + "/" + companyName+"/";//路径
if (!Directory.Exists(templistPath))
{
Directory.CreateDirectory(templistPath);
......@@ -1091,12 +1094,48 @@ namespace Mall.Module.TradePavilion
string Name = obj.Name;
foreach (var qitem in obj.FileList)
{
//FileHelper.CreateImage(); 下载腾讯云至本地
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")
{
//视频处理
//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)
// {
// }
//}
}
}
......@@ -1104,7 +1143,11 @@ namespace Mall.Module.TradePavilion
}
}
ZipHelper.Zip(tempPath, "榜单导出文件夹",ref tempFoldr); //打包方法
Common.Plugin.ZipHelper.Zip(tempPath + "file/", tempPath + "/zip/ziliao.zip", ref tempFoldr);
// ZipFile.CreateFromDirectory(tempPath+ "file/", tempPath + "/zip/ziliao.zip");
// ZipHelper.ZipDirectory(tempPath, rootBook + "/upfile/temporary/firstshopenrollzip/榜单导出文件夹/ .zip","");
// ZipHelper.Zip(tempPath, "榜单导出文件夹",ref tempFoldr); //打包方法
#endregion
return "";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment