SVN r1025

SVN-Revision: r1025
This commit is contained in:
tdx
2025-11-04 03:34:52 +00:00
parent 3e56401eec
commit f00aa61886
2 changed files with 75 additions and 42 deletions
+33 -1
View File
@@ -2578,6 +2578,38 @@ namespace Lskj.PubBomImport
FrmBillInfo frmBillInfo = new FrmBillInfo();
int.TryParse(Model.FirstRowIndex + "", out int firstRowIndex);
DataTable parentTable = ExcelToDatatable(mxInfo.FullName, Model, Model.SheetName, firstRowIndex);
//string[] condArray = Model.ReadTableCond.Split('^');
//string endCond = condArray.Length > 1 ? condArray[1] : "";
//if (!string.IsNullOrEmpty(endCond))
//{
// List<DataRow> condRows = new List<DataRow>();
// foreach (DataRow item in parentTable.Rows)
// {
// if (ReplaceHelper.ReplaceRowParamCond(item, endCond))
// {
// break;
// }
// else
// {
// condRows.Add(item);
// }
// }
// parentTable = condRows.CopyToDataTable();
//}
string endCond = "'{物料编码}'='END'";
List<DataRow> condRows = new List<DataRow>();
foreach (DataRow item in parentTable.Rows)
{
if (ReplaceHelper.ReplaceRowParamCond(item, endCond))
{
break;
}
else
{
condRows.Add(item);
}
}
parentTable = condRows.CopyToDataTable();
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)
@@ -3743,7 +3775,7 @@ namespace Lskj.PubBomImport
for (int i = startRow; i <= rowCount; i++)//循环遍历所有行
{
IRow row = sheet.GetRow(i);//第几行
if (row == null)
if (row == null || row.ZeroHeight)
{
continue; //没有数据的行默认是null;
}