edit
This commit is contained in:
+20
-8
@@ -54,7 +54,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 from view_erptradecell where orderstate=5 and ctid in ({0})", tids);
|
||||
sql.AppendFormat("select ctid,seller_memo,FinishDesignTime,OrderState,SupplierName,OrderSn,tid 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)
|
||||
{
|
||||
@@ -81,12 +81,23 @@ public partial class copydownload : System.Web.UI.Page
|
||||
dTime = getDesignTimeWithDay(dr["FinishDesignTime"]);//这个时间以后得按天分文件夹
|
||||
}
|
||||
else
|
||||
dTime = getDesignTime(dr["FinishDesignTime"]);//上传原来按月分文件夹
|
||||
{
|
||||
|
||||
dTime = getDesignTime(dr["FinishDesignTime"]);//上传原来按月分文件夹
|
||||
}
|
||||
string tid = dr["tid"].ToString();
|
||||
string orderSn = dr["OrderSn"].ToString();
|
||||
string rname = "";
|
||||
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;
|
||||
if (!hasFile)
|
||||
{
|
||||
if (File.Exists(fname))
|
||||
@@ -103,7 +114,7 @@ public partial class copydownload : System.Web.UI.Page
|
||||
}
|
||||
hasFile = true;
|
||||
files.Add(fname);
|
||||
copyFile(getDesignDate(dr["FinishDesignTime"]), dr["SupplierName"].ToString(), fname, payment);
|
||||
copyFile(getDesignDate(dr["FinishDesignTime"]), dr["SupplierName"].ToString(), fname, payment, rname);
|
||||
fc++;
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -264,7 +275,7 @@ public partial class copydownload : System.Web.UI.Page
|
||||
{ "素芸", "棉卡" },
|
||||
{ "玉蕊", "蛋壳" }
|
||||
};
|
||||
private void copyFile(string date, string supplier, string file, double payment)
|
||||
private void copyFile(string date, string supplier, string file, double payment, string rname)
|
||||
{
|
||||
|
||||
string SupName = supplier;
|
||||
@@ -277,12 +288,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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user