SVN-Revision: r555
This commit is contained in:
wyf
2025-05-08 07:58:42 +00:00
parent 7f0230243f
commit c84e00e9ff
+29 -27
View File
@@ -1258,7 +1258,7 @@ namespace Lskj.PubBomImport
//string updateParentVerSql = @"update bom_BillListTab set Ver = '{0}' where Billdocument_Id='{1}' and ProductId='{0}'"; //string updateParentVerSql = @"update bom_BillListTab set Ver = '{0}' where Billdocument_Id='{1}' and ProductId='{0}'";
//SqlHelper.ExecuteNonQuery(string.Format(updateParentVerSql, idValue, billdocumentId)); //SqlHelper.ExecuteNonQuery(string.Format(updateParentVerSql, idValue, billdocumentId));
//上传文件 //上传文件
isUpload = UploadFileToAudit(mxInfo.FullName, productId, "010107", out msg, out string fileId); isUpload = UploadFileToAudit(mxInfo.FullName, productId, "010106", out msg, out string fileId);
if (!isUpload) if (!isUpload)
{ {
throw new Exception($"{mxInfo.Name}附件上传失败\r\n{msg}"); throw new Exception($"{mxInfo.Name}附件上传失败\r\n{msg}");
@@ -1283,7 +1283,7 @@ namespace Lskj.PubBomImport
} }
else else
{ {
isUpload = UploadFileToAudit(mxInfo.FullName, productId, "010107", out msg, out string fileId); isUpload = UploadFileToAudit(mxInfo.FullName, productId, "010106", out msg, out string fileId);
StaticControl.RightMenuGridView.GridControl.Invoke(new Action(() => StaticControl.RightMenuGridView.GridControl.Invoke(new Action(() =>
{ {
if (mxRow.Table.Columns.Contains("qms_laddf_FileId")) if (mxRow.Table.Columns.Contains("qms_laddf_FileId"))
@@ -1361,7 +1361,7 @@ namespace Lskj.PubBomImport
//string updateChildVerSql = @"update bom_BillListTab set Ver = (select top 1 billdocument_id from bom_billListTab where ParentProduct = '{0}') where Billdocument_Id = (select top 1 billdocument_id from bom_billListTab where ParentProduct = '{1}') and ProductId='{0}'"; //string updateChildVerSql = @"update bom_BillListTab set Ver = (select top 1 billdocument_id from bom_billListTab where ParentProduct = '{0}') where Billdocument_Id = (select top 1 billdocument_id from bom_billListTab where ParentProduct = '{1}') and ProductId='{0}'";
//SqlHelper.ExecuteNonQuery(string.Format(updateChildVerSql, code, productId)); //SqlHelper.ExecuteNonQuery(string.Format(updateChildVerSql, code, productId));
SetProcessBar(80, allCount); SetProcessBar(80, allCount);
isUpload = UploadFileToAudit(childInfo.FullName, code, "010107", out msg, out string childFieldId); isUpload = UploadFileToAudit(childInfo.FullName, code, "010106", out msg, out string childFieldId);
if (!isUpload) if (!isUpload)
{ {
throw new Exception($"{childInfo.Name}附件上传失败\r\n{msg}"); throw new Exception($"{childInfo.Name}附件上传失败\r\n{msg}");
@@ -1390,7 +1390,7 @@ namespace Lskj.PubBomImport
else else
{ {
SetProcessBar(0, allCount); SetProcessBar(0, allCount);
isUpload = UploadFileToAudit(childInfo.FullName, code, "010107", out msg, out string existFieldId); isUpload = UploadFileToAudit(childInfo.FullName, code, "010106", out msg, out string existFieldId);
if (!isUpload) if (!isUpload)
{ {
throw new Exception($"{childInfo.Name}附件上传失败\r\n{msg}"); throw new Exception($"{childInfo.Name}附件上传失败\r\n{msg}");
@@ -1427,7 +1427,7 @@ namespace Lskj.PubBomImport
} }
if (childInfo != null) if (childInfo != null)
{ {
isUpload = UploadFileToAudit(childInfo.FullName, productId, "010107", out msg, out string otherFieldId); isUpload = UploadFileToAudit(childInfo.FullName, productId, "010106", out msg, out string otherFieldId);
if (!isUpload) if (!isUpload)
{ {
throw new Exception($"{childInfo.Name}附件上传失败\r\n{msg}"); throw new Exception($"{childInfo.Name}附件上传失败\r\n{msg}");
@@ -1630,28 +1630,29 @@ namespace Lskj.PubBomImport
throw new Exception($"保存Bom失败\r\n{tipMsg}"); throw new Exception($"保存Bom失败\r\n{tipMsg}");
} }
} }
using (WebClient webClient = new WebClient()) //using (WebClient webClient = new WebClient())
{ //{
try // try
{ // {
int.TryParse(fileId, out int convertFileId); // int.TryParse(fileId, out int convertFileId);
DataRow fileRow = BaseImpl.GetDataRowResult($"select webpath,sname from p_fm_filetab where fileId = '{fileId}'"); // DataRow fileRow = BaseImpl.GetDataRowResult($"select webpath,sname from p_fm_filetab where fileId = '{fileId}'");
if (convertFileId > 0 && fileRow != null) // if (convertFileId > 0 && fileRow != null)
{ // {
string webpath = fileRow["webpath"] + ""; // string webpath = fileRow["webpath"] + "";
string sName = fileRow["sname"] + ""; // string sName = fileRow["sname"] + "";
webpath = webpath.StartsWith("/") ? webpath : $"/{webpath}"; // webpath = webpath.StartsWith("/") ? webpath : $"/{webpath}";
string url = $"{SystemInfo.Instance.OAUrl}/{webpath}"; // string url = $"{SystemInfo.Instance.OAUrl}/{webpath}";
string tempFileName = $"BomImportTemp/{sName}"; // string tempFileName = $"BomImportTemp/{sName}";
webClient.DownloadFile(url, tempFileName); // webClient.DownloadFile(url, tempFileName);
bool isUpload = UploadFileToAudit(tempFileName, productid, "010106", out string msg, out string otherFieldId); // bool isUpload = UploadFileToAudit(tempFileName, productid, "010106", out string msg, out string otherFieldId);
} // }
} // }
catch (Exception) // catch (Exception)
{ // {
throw new Exception($"Bom明细附件{productid}获取失败\r\nBom导入失败"); // throw new Exception($"Bom明细附件{productid}获取失败\r\nBom导入失败");
} // }
} //}
BaseImpl.ExecSqlValue($"update p_fm_filetab set isdisabled = 0 where fileid = '{fileId}'");
SetProcessBar(100, finishCount); SetProcessBar(100, finishCount);
SetProcessLabelAllMsg($"总进度:{nowCount + 1}/{sourceTable.Rows.Count + 1}"); SetProcessLabelAllMsg($"总进度:{nowCount + 1}/{sourceTable.Rows.Count + 1}");
} }
@@ -2142,6 +2143,7 @@ namespace Lskj.PubBomImport
if (jsonObject.ContainsKey("other")) if (jsonObject.ContainsKey("other"))
{ {
fileId = jsonObject["other"] + ""; fileId = jsonObject["other"] + "";
BaseImpl.ExecSqlValue($"update p_fm_filetab set isdisabled = 2 where fileid = '{fileId}'");
} }
isUpload = true; isUpload = true;
} }