diff --git a/插件库/Lskj.PubBomImport/FrmProgress.cs b/插件库/Lskj.PubBomImport/FrmProgress.cs index 4f40912..16d3071 100644 --- a/插件库/Lskj.PubBomImport/FrmProgress.cs +++ b/插件库/Lskj.PubBomImport/FrmProgress.cs @@ -1258,7 +1258,7 @@ namespace Lskj.PubBomImport //string updateParentVerSql = @"update bom_BillListTab set Ver = '{0}' where Billdocument_Id='{1}' and ProductId='{0}'"; //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) { throw new Exception($"{mxInfo.Name}附件上传失败\r\n{msg}"); @@ -1283,7 +1283,7 @@ namespace Lskj.PubBomImport } 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(() => { 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}'"; //SqlHelper.ExecuteNonQuery(string.Format(updateChildVerSql, code, productId)); 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) { throw new Exception($"{childInfo.Name}附件上传失败\r\n{msg}"); @@ -1390,7 +1390,7 @@ namespace Lskj.PubBomImport else { 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) { throw new Exception($"{childInfo.Name}附件上传失败\r\n{msg}"); @@ -1427,7 +1427,7 @@ namespace Lskj.PubBomImport } 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) { throw new Exception($"{childInfo.Name}附件上传失败\r\n{msg}"); @@ -1630,28 +1630,29 @@ namespace Lskj.PubBomImport throw new Exception($"保存Bom失败\r\n{tipMsg}"); } } - using (WebClient webClient = new WebClient()) - { - try - { - int.TryParse(fileId, out int convertFileId); - DataRow fileRow = BaseImpl.GetDataRowResult($"select webpath,sname from p_fm_filetab where fileId = '{fileId}'"); - if (convertFileId > 0 && fileRow != null) - { - string webpath = fileRow["webpath"] + ""; - string sName = fileRow["sname"] + ""; - webpath = webpath.StartsWith("/") ? webpath : $"/{webpath}"; - string url = $"{SystemInfo.Instance.OAUrl}/{webpath}"; - string tempFileName = $"BomImportTemp/{sName}"; - webClient.DownloadFile(url, tempFileName); - bool isUpload = UploadFileToAudit(tempFileName, productid, "010106", out string msg, out string otherFieldId); - } - } - catch (Exception) - { - throw new Exception($"Bom明细附件{productid}获取失败\r\nBom导入失败"); - } - } + //using (WebClient webClient = new WebClient()) + //{ + // try + // { + // int.TryParse(fileId, out int convertFileId); + // DataRow fileRow = BaseImpl.GetDataRowResult($"select webpath,sname from p_fm_filetab where fileId = '{fileId}'"); + // if (convertFileId > 0 && fileRow != null) + // { + // string webpath = fileRow["webpath"] + ""; + // string sName = fileRow["sname"] + ""; + // webpath = webpath.StartsWith("/") ? webpath : $"/{webpath}"; + // string url = $"{SystemInfo.Instance.OAUrl}/{webpath}"; + // string tempFileName = $"BomImportTemp/{sName}"; + // webClient.DownloadFile(url, tempFileName); + // bool isUpload = UploadFileToAudit(tempFileName, productid, "010106", out string msg, out string otherFieldId); + // } + // } + // catch (Exception) + // { + // throw new Exception($"Bom明细附件{productid}获取失败\r\nBom导入失败"); + // } + //} + BaseImpl.ExecSqlValue($"update p_fm_filetab set isdisabled = 0 where fileid = '{fileId}'"); SetProcessBar(100, finishCount); SetProcessLabelAllMsg($"总进度:{nowCount + 1}/{sourceTable.Rows.Count + 1}"); } @@ -2142,6 +2143,7 @@ namespace Lskj.PubBomImport if (jsonObject.ContainsKey("other")) { fileId = jsonObject["other"] + ""; + BaseImpl.ExecSqlValue($"update p_fm_filetab set isdisabled = 2 where fileid = '{fileId}'"); } isUpload = true; }