SVN-Revision: r585
This commit is contained in:
wyf
2025-05-15 05:45:24 +00:00
parent 0a3fc209b6
commit df26b9944f
+11 -9
View File
@@ -1166,6 +1166,7 @@ namespace Lskj.PubBomImport
{ {
throw new Exception($"{mxsourceCode}的版次为{mxsourceBC},大于最大版次{mxMaxBc}\r\n请进行变更"); throw new Exception($"{mxsourceCode}的版次为{mxsourceBC},大于最大版次{mxMaxBc}\r\n请进行变更");
} }
mxsourceBC = mxsourceBC >= mxMaxBc ? mxsourceBC : mxMaxBc;
FrmBillInfo frmBillInfo = new FrmBillInfo(); FrmBillInfo frmBillInfo = new FrmBillInfo();
DataTable parentTable = ExcelToDatatable(mxInfo.FullName, Model, "", 5); DataTable parentTable = ExcelToDatatable(mxInfo.FullName, Model, "", 5);
parentTable = parentTable.Rows.Cast<DataRow>().Where(n => int.TryParse(n["序号"] + "", out _) && !string.IsNullOrEmpty(n["图号"] + "") && !string.IsNullOrEmpty(n["名称"] + "")).ToList().CopyToDataTable(); parentTable = parentTable.Rows.Cast<DataRow>().Where(n => int.TryParse(n["序号"] + "", out _) && !string.IsNullOrEmpty(n["图号"] + "") && !string.IsNullOrEmpty(n["名称"] + "")).ToList().CopyToDataTable();
@@ -1233,15 +1234,15 @@ namespace Lskj.PubBomImport
string childFileName = childInfoRow[Model.AfterBomFieldName] + ""; string childFileName = childInfoRow[Model.AfterBomFieldName] + "";
string childDirPath = childInfoRow["BomFieldNameDir"] + ""; string childDirPath = childInfoRow["BomFieldNameDir"] + "";
FileInfo childInfo = new FileInfo(childDirPath); FileInfo childInfo = new FileInfo(childDirPath);
if (childInfo != null) //if (childInfo != null)
{ //{
GetFileCodeInfo(Path.GetFileNameWithoutExtension(childInfo.Name).Trim(), out string childsourceCode, out string childname, out string childsourceBB, out int childsourceBC); // GetFileCodeInfo(Path.GetFileNameWithoutExtension(childInfo.Name).Trim(), out string childsourceCode, out string childname, out string childsourceBB, out int childsourceBC);
//如果文件夹中有附件,则比较版次,如果大于最大版次,则提示 // //如果文件夹中有附件,则比较版次,如果大于最大版次,则提示
if (childsourceBC > childMaxBc && filetable.Rows.Count > 0) // if (childsourceBC > childMaxBc && filetable.Rows.Count > 0)
{ // {
throw new Exception($"{childsourceCode}的版次为{childsourceBC},大于最大版次{childMaxBc}\r\n请进行变更"); // throw new Exception($"{childsourceCode}的版次为{childsourceBC},大于最大版次{childMaxBc}\r\n请进行变更");
} // }
} //}
if (childInfo == null && maxBcFileDic.ContainsKey(code) && maxBcFileDic[code] != null) if (childInfo == null && maxBcFileDic.ContainsKey(code) && maxBcFileDic[code] != null)
{ {
using (WebClient webClient = new WebClient()) using (WebClient webClient = new WebClient())
@@ -1273,6 +1274,7 @@ namespace Lskj.PubBomImport
{ {
throw new Exception($"{childsourceCode}的版次为{childsourceBC},大于最大版次{childMaxBc}\r\n请进行变更"); throw new Exception($"{childsourceCode}的版次为{childsourceBC},大于最大版次{childMaxBc}\r\n请进行变更");
} }
childsourceBC = childsourceBC >= childMaxBc ? childsourceBC : childMaxBc;
if (code.StartsWith("ZZQD")) if (code.StartsWith("ZZQD"))
{ {
DataTable zzqdTable = ExcelToDatatable(childInfo.FullName, Model, "", index); DataTable zzqdTable = ExcelToDatatable(childInfo.FullName, Model, "", index);