SVN-Revision: r608
This commit is contained in:
wyf
2025-05-20 03:25:13 +00:00
parent 9dee0fb959
commit 6eff516c6f
2 changed files with 37 additions and 5 deletions
+37 -4
View File
@@ -173,12 +173,45 @@ namespace Lskj.PubBomImport
{
throw new Exception($"MX中的{code}不允许有版次");
}
var selectFiles = fileNames.Where(n => Path.GetFileName(n).Trim().StartsWith(code));
foreach (var selectFile in selectFiles)
DataTable filetable = BaseImpl.GetDataTableResult($"select sname,fileId,webpath from p_fm_filetab where parentid in (select dirid from P_fm_DirectoryTab where pid = '{sourceCode}' and dllcoid = '1000202') and speciesno = '010106' and sname like '{sourceCode}%'");
int childMaxBc = -1;
string childMaxSname = "";
foreach (DataRow fileRow in filetable.Rows)
{
if (!existsFileList.Contains(selectFile))
string fileName = fileRow["sname"] + "";
string fileId = fileRow["fileId"] + "";
string sname = fileRow["sname"] + "";
GetFileCodeInfo(fileName, out string fileCode, out string name, out string fileBB, out int fileBC);
if (fileBC >= childMaxBc)
{
existsFileList.Add(selectFile);
childMaxBc = fileBC;
childMaxSname = $"{fileCode}{(fileBC > 0 ? fileBC + "" : "")}{name}";
}
}
var selectFiles = fileNames.Where(n => Path.GetFileName(n).Trim().StartsWith(code));
if (filetable.Rows.Count > 0)
{
if (!existsFileList.Contains(childMaxSname))
{
existsFileList.Add(childMaxSname);
}
}
else
{
int maxBc = -1;
string maxSname = "";
foreach (var selectFile in selectFiles)
{
GetFileCodeInfo(Path.GetFileNameWithoutExtension(selectFile), out string fileCode, out string name, out string fileBB, out int fileBC);
if (fileBC >= childMaxBc)
{
maxBc = fileBC;
maxSname = selectFile;
}
if (!existsFileList.Contains(maxSname))
{
existsFileList.Add(maxSname);
}
}
}
}
@@ -1095,7 +1095,6 @@ namespace Lskj.PubBomImport
DataTable filetable = fileTableDic.ContainsKey(code) ? fileTableDic[code] : null;
if (code.StartsWith("QD"))
{
FileInfo childInfo = null;
DataRow childInfoRow = selectRows.Where(n => (n[Model.AfterBomFieldName] + "").StartsWith(code)).FirstOrDefault();
if (childInfoRow != null)