From df26b9944f813171ad704d769a016c09bb8136d3 Mon Sep 17 00:00:00 2001 From: wyf Date: Thu, 15 May 2025 05:45:24 +0000 Subject: [PATCH] SVN r585 SVN-Revision: r585 --- 插件库/Lskj.PubBomImport/FrmProgress.cs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/插件库/Lskj.PubBomImport/FrmProgress.cs b/插件库/Lskj.PubBomImport/FrmProgress.cs index 622fde7..9bc99d3 100644 --- a/插件库/Lskj.PubBomImport/FrmProgress.cs +++ b/插件库/Lskj.PubBomImport/FrmProgress.cs @@ -1166,6 +1166,7 @@ namespace Lskj.PubBomImport { throw new Exception($"{mxsourceCode}的版次为{mxsourceBC},大于最大版次{mxMaxBc}\r\n请进行变更"); } + mxsourceBC = mxsourceBC >= mxMaxBc ? mxsourceBC : mxMaxBc; FrmBillInfo frmBillInfo = new FrmBillInfo(); DataTable parentTable = ExcelToDatatable(mxInfo.FullName, Model, "", 5); parentTable = parentTable.Rows.Cast().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 childDirPath = childInfoRow["BomFieldNameDir"] + ""; FileInfo childInfo = new FileInfo(childDirPath); - if (childInfo != null) - { - 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) - { - throw new Exception($"{childsourceCode}的版次为{childsourceBC},大于最大版次{childMaxBc}\r\n请进行变更"); - } - } + //if (childInfo != null) + //{ + // 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) + // { + // throw new Exception($"{childsourceCode}的版次为{childsourceBC},大于最大版次{childMaxBc}\r\n请进行变更"); + // } + //} if (childInfo == null && maxBcFileDic.ContainsKey(code) && maxBcFileDic[code] != null) { using (WebClient webClient = new WebClient()) @@ -1273,6 +1274,7 @@ namespace Lskj.PubBomImport { throw new Exception($"{childsourceCode}的版次为{childsourceBC},大于最大版次{childMaxBc}\r\n请进行变更"); } + childsourceBC = childsourceBC >= childMaxBc ? childsourceBC : childMaxBc; if (code.StartsWith("ZZQD")) { DataTable zzqdTable = ExcelToDatatable(childInfo.FullName, Model, "", index);