SVN-Revision: r514
This commit is contained in:
wyf
2025-04-29 07:53:59 +00:00
parent af54d4cf12
commit 598854470b
2 changed files with 45 additions and 11 deletions
+2 -1
View File
@@ -219,7 +219,7 @@ namespace Lskj.PubBomImport
//MessageUtil.Show("表格中数据内容重复,保存失败!");
return saveResult;
}
string billNo = this.lblOrderNo.Text.Trim();
string billNo = billModel.SaveState ? this.lblOrderNo.Text.Trim() : Guid.NewGuid() + "";
string detailGuid = Guid.NewGuid().ToString();
string masterSql = billModel.SaveState ? GetUpdateRecord(billNo) : GetAddRecord(ref billNo);
string detailSql = GetDetailRecord(detailGuid, billNo).ToString();
@@ -341,6 +341,7 @@ namespace Lskj.PubBomImport
if (!string.IsNullOrWhiteSpace(errorMessage)) SaveErrorMessage = "表头错误:" + errorMessage;
// 增加主键
fieldBuilder.Append(billModel.PrimaryKey);
//valueBuilder.Append("N'" + parmaryValue + "'");
valueBuilder.Append("N'" + parmaryValue + "'");
// 增加红蓝字单标记
fieldBuilder.Append("," + billModel.RtagidKey);
+36 -3
View File
@@ -939,6 +939,8 @@ namespace Lskj.PubBomImport
{
try
{
int.TryParse(Model.FirstRowIndex, out int index);
frmMain.FirstRowIndex = index;
bool isUpload = false;
string msg = "";
DataRow parentProductRow = BaseImpl.GetDataRowResult($"select top 1 billdocument_id from bom_BillTab where productid='{productId}'");
@@ -971,6 +973,38 @@ namespace Lskj.PubBomImport
throw new Exception($"MX明细中不包含文件{childFileName}");
}
if (childInfo != null)
{
if (code.StartsWith("ZZQD"))
{
DataTable zzqdTable = ExcelToDatatable(childInfo.FullName, Model, "", index);
//frmMain.Invoke(new Action(() =>
//{
// zzqdTable = frmMain.ToExcelDataTable(childInfo.FullName, out int count, out int errorCount, true);
//}));
DataView filterDataView = new DataView(zzqdTable);
try
{
if (!string.IsNullOrEmpty(Model.ReadTableCond))
{
filterDataView.RowFilter = Model.ReadTableCond;
}
}
catch (Exception)
{
}
zzqdTable = filterDataView.ToTable();
foreach (DataRow zzqdItem in zzqdTable.Rows)
{
DataRow childRow = childTable.NewRow();
childRow["ProductId"] = zzqdItem["物料编码"] + "";
childRow["appellation"] = zzqdItem["名称"] + "";
childRow["bak"] = code;
childRow["tamount"] = parentRow["套数"] + "";
childRow["amount"] = zzqdItem["数量"] + "";
childTable.Rows.Add(childRow);
}
}
else
{
DataRow childRow = childTable.NewRow();
childRow["ProductId"] = parentRow["图号"] + "";
@@ -983,6 +1017,7 @@ namespace Lskj.PubBomImport
}
}
}
}
SetProcessBar(20, 0);
if (childTable.Rows.Count == 0)
{
@@ -1036,8 +1071,6 @@ namespace Lskj.PubBomImport
}
SetProcessBar(100, (1 / (parentTable.Rows.Count + 1)) * 100);
SetProcessLabelAllMsg($"总进度:{1}/{parentTable.Rows.Count + 1}");
int.TryParse(Model.FirstRowIndex, out int index);
frmMain.FirstRowIndex = index;
foreach (DataRow dataRow in parentTable.Rows)
{
int childIndex = parentTable.Rows.IndexOf(dataRow);
@@ -1259,7 +1292,7 @@ namespace Lskj.PubBomImport
int.TryParse(execRow["comfirm"] + "", out int comfirm);
int.TryParse(execRow["auditFlag"] + "", out int auditFlag);
int.TryParse(execRow["newVer"] + "", out int newVer);
string billNo = billWay == 1 ? BillImpl.GetBillNo(billSeq) : execRow["billNo"] + "";
string billNo = execRow["billNo"] + "";
int result = BillImpl.BillSave(masterSql, detailSql, detailTable, ref billNo, detailGuid, billSeq, billWay, comfirm, out string tipMsg, auditFlag, newVer);
if (result == 1)
{