试压看板增加排序和单位工程的试压包完成率
This commit is contained in:
@@ -253,7 +253,6 @@ namespace FineUIPro.Web.HJGL.TestPackage
|
||||
return;
|
||||
}
|
||||
Dictionary<string, string> printFiles = new Dictionary<string, string>();
|
||||
|
||||
foreach (var ptp_id in selectedRows)
|
||||
{
|
||||
var item = exportWord(ptp_id);
|
||||
@@ -262,6 +261,7 @@ namespace FineUIPro.Web.HJGL.TestPackage
|
||||
}
|
||||
if (printFiles.Count>1)
|
||||
{
|
||||
string zipName = "";
|
||||
string rootPath = Funs.RootPath;
|
||||
string startPath = rootPath + "FileUpload\\试压包资料" + DateTime.Now.GetHashCode();
|
||||
if (!Directory.Exists(startPath))
|
||||
@@ -273,18 +273,20 @@ namespace FineUIPro.Web.HJGL.TestPackage
|
||||
{
|
||||
var sourceFile = item.Key;
|
||||
var destFile = startPath + "\\" + item.Value;
|
||||
zipName+= item.Value.Replace(".pdf","")+"," ;
|
||||
if (File.Exists(sourceFile))
|
||||
{
|
||||
File.Copy(sourceFile, destFile, true);
|
||||
File.Delete(sourceFile);
|
||||
}
|
||||
}
|
||||
zipName= zipName.TrimEnd(',');
|
||||
System.IO.Compression.ZipFile.CreateFromDirectory(startPath, zipPath);
|
||||
FileInfo info = new FileInfo(zipPath);
|
||||
long fileSize = info.Length;
|
||||
System.Web.HttpContext.Current.Response.Clear();
|
||||
System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed";
|
||||
System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode("试压包资料.zip", System.Text.Encoding.UTF8));
|
||||
System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(zipName+".zip", System.Text.Encoding.UTF8));
|
||||
System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString());
|
||||
System.Web.HttpContext.Current.Response.TransmitFile(zipPath, 0, fileSize);
|
||||
System.Web.HttpContext.Current.Response.Flush();
|
||||
|
||||
Reference in New Issue
Block a user