SVN-Revision: r745
This commit is contained in:
wyf
2025-06-16 03:52:35 +00:00
parent c88ed34ef8
commit 425f2db273
+12 -5
View File
@@ -1528,6 +1528,11 @@ namespace Lskj.PubBomImport
{
int.TryParse(parentRow["套数"] + "", out int tamount);
string childCode = parentRow["图号"] + "";
GetFileCodeInfo(childCode, out string childsourceCode0, out string childsourceName0, out string childsourceBB0, out int childsourceBC0);
if (childsourceBC0 > 0)
{
throw new Exception($"{childsourceCode0}的版次为{childsourceBC0}\r\n录入的版次不允许大于0");
}
string unionTzName = parentRow.Table.Columns.Contains("关联清单") ? (parentRow["关联清单"] + "").Trim() : "";
insertbulider.AppendLine($"insert into FileAttachmentMapping (MaterialCode,MxFileName,RelatedAttachmentName,OperatorUser,ChangeStatus,UnionTZName) values ('{topProductId}','{sourceCode }','{childCode}','{ERPInfo.Instance.UserName}','变更','{unionTzName}');");
if (childCode.StartsWith("QD") || childCode.StartsWith("ZZQD"))
@@ -1542,10 +1547,6 @@ namespace Lskj.PubBomImport
{
//throw new Exception($"MX明细中不包含文件{childCode}");
GetFileCodeInfo(childCode, out string childsourceCode, out string childsourceName, out string childsourceBB, out int childsourceBC);
if (childsourceBC > 0)
{
throw new Exception($"{childsourceCode}的版次为{childsourceBC},版次不允许大于0");
}
if (childCode.StartsWith("QD"))
{
DataRow childRow = childTable.NewRow();
@@ -1853,6 +1854,11 @@ namespace Lskj.PubBomImport
{
int.TryParse(parentRow["套数"] + "", out int tamount);
string code = (parentRow["图号"] + "").Trim();
GetFileCodeInfo(code, out string childsourceCode0, out string childsourceName0, out string childsourceBB0, out int childsourceBC0);
if (childsourceBC0 > 0)
{
throw new Exception($"{childsourceCode0}的版次为{childsourceBC0}\r\n录入的版次不允许大于0");
}
string unionTzName = parentRow.Table.Columns.Contains("关联清单") ? (parentRow["关联清单"] + "").Trim() : "";
int codeCount = mxCodeRows.Where(n => (n["图号"] + "").Trim().StartsWith(code)).Count();
if (codeCount > 1)//只允许存在一个
@@ -2397,7 +2403,8 @@ namespace Lskj.PubBomImport
throw new Exception($"该文件已存在,请确认后再创建BOM");
}
FrmBillInfo frmBillInfo = new FrmBillInfo();
DataTable parentTable = ExcelToDatatable(mxInfo.FullName, Model, "", 1);
int.TryParse(Model.FirstRowIndex + "", out int firstRowIndex);
DataTable parentTable = ExcelToDatatable(mxInfo.FullName, Model, Model.SheetName, firstRowIndex);
parentTable = parentTable.Rows.Cast<DataRow>().Where(n => int.TryParse(n["序号"] + "", out _) && !string.IsNullOrEmpty(n["物料编码"] + "")).ToList().CopyToDataTable();
//StringBuilder stringBuilder = new StringBuilder();
//foreach (DataRow dataRow in parentTable.Rows)