SVN-Revision: r469
This commit is contained in:
wyf
2025-04-10 02:56:37 +00:00
parent 62a5bc8f66
commit ed3970aba7
2 changed files with 66 additions and 36 deletions
+11 -13
View File
@@ -505,18 +505,18 @@ namespace Lskj.PubBomImport
/// 开始导入3
/// </summary>
/// <param name="dirPaths"></param>
public void StartImportInQDFile(DataTable sourceTable, Dictionary<string, string> filesDic)
public void StartImportInQDFile(List<DataRow> selectRows, Dictionary<DataRow, string> filesDic)
{
try
{
foreach (DataRow sourceRow in sourceTable.Rows)
foreach (DataRow sourceRow in selectRows)
{
if (sourceRow.RowState == DataRowState.Deleted)
{
continue;
}
string fileName = sourceRow[Model.AfterBomFieldName] + "";
string dirPath = filesDic.ContainsKey(fileName) ? filesDic[fileName] : "";
string dirPath = filesDic.ContainsKey(sourceRow) ? filesDic[sourceRow] : "";
FileInfo parentInfo = null;
if (string.IsNullOrEmpty(dirPath))
{
@@ -553,17 +553,17 @@ namespace Lskj.PubBomImport
{
try
{
foreach (DataRow sourceRow in sourceTable.Rows)
foreach (DataRow sourceRow in selectRows)
{
if (sourceRow.RowState == DataRowState.Deleted)
{
continue;
}
int childIndex = sourceTable.Rows.IndexOf(sourceRow);
int allCount = (int)((decimal)(childIndex) / (sourceTable.Rows.Count) * 100);
int finishCount = (int)((decimal)(1 + childIndex) / (sourceTable.Rows.Count) * 100);
int childIndex = selectRows.IndexOf(sourceRow);
int allCount = (int)((decimal)(childIndex) / (selectRows.Count) * 100);
int finishCount = (int)((decimal)(1 + childIndex) / (selectRows.Count) * 100);
string fileName = sourceRow[Model.AfterBomFieldName] + "";
string dirPath = filesDic.ContainsKey(fileName) ? filesDic[fileName] : "";
string dirPath = filesDic.ContainsKey(sourceRow) ? filesDic[sourceRow] : "";
FileInfo parentInfo = null;
if (string.IsNullOrEmpty(dirPath))
{
@@ -652,7 +652,7 @@ namespace Lskj.PubBomImport
//上传文件
bool isUpload = UploadFile(childInfo.FullName, billNo, out string msg);
SetProcessBar(100, finishCount);
SetProcessLabelAllMsg($"总进度:{childIndex + 1}/{sourceTable.Rows.Count }");
SetProcessLabelAllMsg($"总进度:{childIndex + 1}/{selectRows.Count }");
}
else
{
@@ -667,10 +667,7 @@ namespace Lskj.PubBomImport
}
else
{
MessageUtil.Show("不是QD或ZZQD文件");
this.DialogResult = DialogResult.Cancel;
Close();
ImportTimer?.Dispose();
throw new Exception($"{parentInfo.Name}不是QD或ZZQD文件");
}
}
else
@@ -1193,5 +1190,6 @@ namespace Lskj.PubBomImport
catch (Exception ex)
{
returnMsg = ex.Message;
throw new Exception($"文件{Path.GetFileName(filePath)}上传失败\r\n{ex.Message}");
isUpload = false;