Browse Source

调整上传文件的接口

master
lilili 2 years ago
parent
commit
cafb014bc1
  1. 2
      WMS-BS/NFine.Application/WMS/PickMaterialApp.cs
  2. 7
      WMS-BS/NFine.Web/Areas/WMS/Controllers/HomeWorkController.cs

2
WMS-BS/NFine.Application/WMS/PickMaterialApp.cs

@ -461,7 +461,7 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
//left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint //left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
//left join ICSMOPickMerge e on a.ID=e.SourceID and a.WorkPoint=e.WorkPoint"; //left join ICSMOPickMerge e on a.ID=e.SourceID and a.WorkPoint=e.WorkPoint";
// sql += " WHERE 1=1 and a.Type='1' and e.ID is null"; // sql += " WHERE 1=1 and a.Type='1' and e.ID is null";
sqlString.Append($@"SELECT a.SDNCode AS CODE,
sqlString.Append($@"SELECT a.SDNCode AS Code,
a.CreateDateTime AS MTIME, a.CreateDateTime AS MTIME,
a.CreatePerson AS MUSER, a.CreatePerson AS MUSER,
(CASE WHEN max(e.SourceID) IS NULL THEN '' ELSE '' END) AS IsNew, (CASE WHEN max(e.SourceID) IS NULL THEN '' ELSE '' END) AS IsNew,

7
WMS-BS/NFine.Web/Areas/WMS/Controllers/HomeWorkController.cs

@ -50,7 +50,12 @@ namespace NFine.Web.Areas.WMS.Controllers
return "只可以选择Excel(.xls .xlsx)文件";//当选择的不是Excel文件时,返回 return "只可以选择Excel(.xls .xlsx)文件";//当选择的不是Excel文件时,返回
} }
string filename = DateTime.Now.ToString("yyyyMMddhhmmss") + UPLoadType + IsXls; //获取Execle文件名 DateTime日期函数 string filename = DateTime.Now.ToString("yyyyMMddhhmmss") + UPLoadType + IsXls; //获取Execle文件名 DateTime日期函数
string savePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\UPLoadFile\\" + filename);//Server.MapPath 获得虚拟服务器相对路径
var folder = System.Web.HttpContext.Current.Server.MapPath("~\\File\\UPLoadFile"); //Server.MapPath 获得虚拟服务器相对路径
if(!Directory.Exists(folder))
Directory.CreateDirectory(folder);
string savePath = Path.Combine(folder, filename);
int iLen = hpFiles[0].ContentLength; int iLen = hpFiles[0].ContentLength;
if (Directory.Exists(savePath)) return "文件已存在"; if (Directory.Exists(savePath)) return "文件已存在";

Loading…
Cancel
Save