Commit 55511f50 authored by 吴春's avatar 吴春

提交代码

parent f7229c80
...@@ -6,8 +6,11 @@ using Mall.Repository.TradePavilion; ...@@ -6,8 +6,11 @@ using Mall.Repository.TradePavilion;
using Mall.Repository.User; using Mall.Repository.User;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing;
using System.IO; using System.IO;
using System.IO.Compression;
using System.Linq; using System.Linq;
using System.Net;
using System.Text; using System.Text;
using VT.FW.DB; using VT.FW.DB;
...@@ -898,7 +901,7 @@ namespace Mall.Module.TradePavilion ...@@ -898,7 +901,7 @@ namespace Mall.Module.TradePavilion
errorMsg = ""; errorMsg = "";
//存储的临时文件地址 //存储的临时文件地址
string rootBook = AppDomain.CurrentDomain.BaseDirectory; 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 }); var listModel = firstShop_ListRepository.GetList(new RB_FirstShop_List_Extend { MallBaseId = mallBaseId, QIds = listIds });
...@@ -941,7 +944,7 @@ namespace Mall.Module.TradePavilion ...@@ -941,7 +944,7 @@ namespace Mall.Module.TradePavilion
if (elist.Any()) if (elist.Any())
{ {
var companyName = clist.Where(x => x.CreateBy == enrollModel.UserId).FirstOrDefault()?.CompanyName ?? System.DateTime.Now.ToString("yyyyMMddHHmmssfff"); 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)) if (!Directory.Exists(templistPath))
{ {
Directory.CreateDirectory(templistPath); Directory.CreateDirectory(templistPath);
...@@ -957,12 +960,48 @@ namespace Mall.Module.TradePavilion ...@@ -957,12 +960,48 @@ namespace Mall.Module.TradePavilion
string Name = obj.Name; string Name = obj.Name;
foreach (var qitem in obj.FileList) 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") 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)
// {
// }
//}
} }
} }
...@@ -970,7 +1009,11 @@ namespace Mall.Module.TradePavilion ...@@ -970,7 +1009,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 #endregion
return ""; 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