This commit is contained in:
2025-10-31 11:26:55 +08:00
förälder 50cd510351
incheckning 670118a6d5
4 ändrade filer med 128 tillägg och 28 borttagningar
+42 -11
Visa fil
@@ -1,4 +1,5 @@
using BizCom;
using CorelDRAW;
using ICSharpCode.SharpZipLib.Zip;
using SQLData;
using System;
@@ -6,6 +7,7 @@ using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Web;
@@ -28,6 +30,36 @@ public partial class copydownload : System.Web.UI.Page
//Response.End();
}
private string dealMemoName(string name)
{
string[] al = name.Split('-');
List<string> list = new List<string>();
string pa = string.Empty;
for (int i = 0; i < al.Length; i++)
{
if (i == 1)
{
if (al[i].Contains("(") || al[i].Contains(""))
{
string tname = al[i].Replace(")", "").Replace("", "").Replace("", "").Replace("(", "");
if (!string.IsNullOrEmpty(tname))
{
pa = al[i];
}
continue;
}
}
list.Add(al[i]);
}
if (!string.IsNullOrEmpty(pa))
{
list.Insert(3, pa);
}
name = string.Join("-", list);
return name;
}
protected void Page_Load(object sender, EventArgs e)
{
if (Request["hexdata"] != null)
@@ -54,7 +86,7 @@ public partial class copydownload : System.Web.UI.Page
}
tids = string.Join(",", tLst.ToArray());
StringBuilder sql = new StringBuilder();
sql.AppendFormat("select ctid,seller_memo,FinishDesignTime,OrderState,SupplierName,OrderSn,tid from view_erptradecell where orderstate=5 and ctid in ({0})", tids);
sql.AppendFormat("select ctid,seller_memo,FinishDesignTime,OrderState,SupplierName,OrderSn,tid,SupplierId from view_erptradecell where orderstate=5 and ctid in ({0})", tids);
DataTable dt = CeErpTradeCell.ExecuteDataset(sql.ToString()).Tables[0];
if (dt == null || dt.Rows.Count < 1)
{
@@ -91,13 +123,12 @@ public partial class copydownload : System.Web.UI.Page
df_name = upPath + "\\" + dTime + "\\" + formatMemo(dr["seller_memo"]);
foreach (string ext in extArr)
{
if (!string.IsNullOrEmpty(tid) && !string.IsNullOrEmpty(orderSn))
{
rname = formatMemo(dr["seller_memo"]).Replace(orderSn, tid);
rname = rname + "《" + orderSn + "》";
}
fname = df_name + ext;
rname = rname + ext;
rname = formatMemo(dr["seller_memo"]) + ext;
if ("14".Equals(dr["SupplierId"].ToString()))
{
rname = dealMemoName(rname);
}
if (!hasFile)
{
if (File.Exists(fname))
@@ -288,13 +319,13 @@ public partial class copydownload : System.Web.UI.Page
string fname = Path.GetFileName(file);
foreach (var rule in replaceRules)
{
fname = fname.Replace(rule.Key, rule.Value);
rname = rname.Replace(rule.Key, rule.Value);
}
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);
}