车间下载重命名

This commit is contained in:
2026-07-04 17:08:25 +08:00
parent 75a672d862
commit 300c9b4910
3 changed files with 21 additions and 6 deletions
+4
View File
@@ -129,6 +129,10 @@ public partial class copydownload : System.Web.UI.Page
{
rname = dealMemoName(rname);
}
if ("138".Equals(dr["SupplierId"].ToString()))
{
rname = formatMemo(dr["seller_memo"]) + string.Format("《{0}》", dr["ctid"]) + ext;
}
if (!hasFile)
{
if (File.Exists(fname))
+13 -6
View File
@@ -131,6 +131,11 @@ public partial class supplierBuildFile : System.Web.UI.Page
break;
}
string fname = df_name + ext;
string rname = formatMemo(row["seller_memo"]) + ext;
if (supplierId == 138)
{
rname = formatMemo(row["seller_memo"]) + string.Format("《{0}》", ctid) + ext;
}
if (Convert.ToInt16(row["OrderState"]) != 6)
{
updateSql += string.Format("update CE_ErpPackDataItem set message = '订单状态不正确!' where packId= {0} and ctid='{1}' ;", packId, ctid);
@@ -168,7 +173,8 @@ public partial class supplierBuildFile : System.Web.UI.Page
}
try
{
copyFile(getDesignDate(row["FinishDesignTime"]), suppierName, fname, zipFileName.Replace(".zip", ""));
copyFile(getDesignDate(row["FinishDesignTime"]), suppierName, fname, rname, zipFileName.Replace(".zip", ""));
writeLog("打包复制文件!" + zipFileName.Replace(".zip", "") + ":" + fname);
files.Add(fname);
supplierId = 0;
@@ -253,7 +259,7 @@ public partial class supplierBuildFile : System.Web.UI.Page
return name;
}
private string formatMemo(object memo)
{
string m = memo.ToString();
@@ -261,16 +267,16 @@ public partial class supplierBuildFile : System.Web.UI.Page
return m;
}
private void copyFile(string date, string supplier, string file, string zipName = "")
private void copyFile(string date, string supplier, string file, string rname, string zipName = "")
{
string path = getCopyPath(date, supplier, zipName);
if (!Directory.Exists(path)) Directory.CreateDirectory(path);
string fname = Path.GetFileName(file);
File.Copy(file, path + "\\" + fname, true);
if (!File.Exists(path + "\\" + fname))
File.Copy(file, path + "\\" + rname, true);
if (!File.Exists(path + "\\" + rname))
{
File.Copy(file, path + "\\" + fname, true);
File.Copy(file, path + "\\" + rname, true);
}
}
@@ -623,6 +629,7 @@ public partial class supplierBuildFile : System.Web.UI.Page
{
fileName = dealMemoName(fileName);
}
foreach (var rule in replaceRules)
{
fileName = fileName.Replace(rule.Key, rule.Value);
+4
View File
@@ -176,6 +176,10 @@ public partial class supplierDownload : System.Web.UI.Page
{
rname = dealMemoName(rname);
}
if ("138".Equals(dr["SupplierId"].ToString()))
{
rname = formatMemo(dr["seller_memo"]) + string.Format("《{0}》", dr["ctid"]) + ext;
}
int IsFileEncrypt = IsFileEncrypted(fname);
if (IsFileEncrypt == 1 && File.Exists(fname))
{