提交试车代码

This commit is contained in:
2023-11-23 09:28:55 +08:00
parent 5e5ad08320
commit 88d09e2602
66 changed files with 10754 additions and 161 deletions
@@ -171,6 +171,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
string IsXls = Path.GetExtension(this.fileData.FileName).ToString().Trim().ToLower();
if (IsXls != ".xls" && IsXls != ".xlsx")
{
this.fileData.Reset();
ShowNotify("excel文件类型错误!", MessageBoxIcon.Warning);
return;
}
@@ -192,6 +193,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
DataSet ds = NPOIHelper.ExcelToDataSet(fileName, out string message, false);
if (ds == null)
{
this.fileData.Reset();
ShowNotify("模板错误,请从系统下载正确的模板!", MessageBoxIcon.Warning);
return;
}
@@ -205,6 +207,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
var fileVerify = VerifyFile(ds);
if (!fileVerify)
{
this.fileData.Reset();
ShowNotify("请获取正确模板!", MessageBoxIcon.Warning);
return;
}
@@ -221,6 +224,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
}
if (StrIsNumm(item[0]) || StrIsNumm(item[1]))
{
this.fileData.Reset();
ShowNotify($"{index}行装置编码或名称为空!", MessageBoxIcon.Warning);
break;
}
@@ -267,7 +271,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
}
else
{
this.fileData.Reset();
ShowNotify($"{index}行数据存在错误,数据格式具体见模板说明为空!", MessageBoxIcon.Warning);
break;
}
@@ -284,6 +288,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
var importCodes = installationCodes.GroupBy(x => x).Where(x => x.Count() > 1).Select(x => x.Key).ToList();
if (importCodes.Count > 0)
{
this.fileData.Reset();
ShowNotify($"EXCEL中装置编码{string.Join(",", importCodes)}重复,请调整模板数据!", MessageBoxIcon.Warning);
return;
}
@@ -293,6 +298,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
var existInstallations = Funs.DB.PreRun_SysDevice.Where(a => installationCodes.Contains(a.PreRunCode) && a.PreRunLevel == 1 && a.ProjectId == this.CurrUser.LoginProjectId).ToList();
if (existInstallations.Count > 0)
{
this.fileData.Reset();
ShowNotify($"装置编码({string.Join(",", existInstallations.ConvertAll(s => s.PreRunCode))})已存在!", MessageBoxIcon.Warning);
return;
}
@@ -306,6 +312,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
var importCodes = processesCodes.GroupBy(x => x).Where(x => x.Count() > 1).Select(x => x.Key).ToList();
if (importCodes.Count > 0)
{
this.fileData.Reset();
ShowNotify($"EXCEL中工序编码{string.Join(",", importCodes)}重复,请调整模板数据!", MessageBoxIcon.Warning);
return;
}
@@ -315,6 +322,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
var existProcessess = Funs.DB.PreRun_SysDevice.Where(a => processesCodes.Contains(a.PreRunCode) && a.PreRunLevel == 2 && a.ProjectId == this.CurrUser.LoginProjectId).ToList();
if (existProcessess.Count > 0)
{
this.fileData.Reset();
ShowNotify($"工序编码({string.Join(",", existProcessess.ConvertAll(s => s.PreRunCode))})已存在!", MessageBoxIcon.Warning);
return;
}
@@ -327,6 +335,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
var importCodes = systemCodes.GroupBy(x => x).Where(x => x.Count() > 1).Select(x => x.Key).ToList();
if (importCodes.Count > 0)
{
this.fileData.Reset();
ShowNotify($"EXCEL中系统编码{string.Join(",", importCodes)}重复,请调整模板数据!", MessageBoxIcon.Warning);
return;
}
@@ -336,6 +345,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
var existSystems = Funs.DB.PreRun_SysDevice.Where(a => systemCodes.Contains(a.PreRunCode) && a.PreRunLevel == 3 && a.ProjectId == this.CurrUser.LoginProjectId).ToList();
if (existSystems.Count > 0)
{
this.fileData.Reset();
ShowNotify($"系统编码({string.Join(",", existSystems.ConvertAll(s => s.PreRunCode))})已存在!", MessageBoxIcon.Warning);
return;
}
@@ -348,6 +358,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
var importCodes = subsystemCodes.GroupBy(x => x).Where(x => x.Count() > 1).Select(x => x.Key).ToList();
if (importCodes.Count > 0)
{
this.fileData.Reset();
ShowNotify($"EXCEL中子系统编码{string.Join(",", importCodes)}重复,请调整模板数据!", MessageBoxIcon.Warning);
return;
}
@@ -357,6 +368,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
var existSubsystems = Funs.DB.PreRun_SysDevice.Where(a => subsystemCodes.Contains(a.PreRunCode) && a.PreRunLevel == 4 && a.ProjectId == this.CurrUser.LoginProjectId).ToList();
if (existSubsystems.Count > 0)
{
this.fileData.Reset();
ShowNotify($"子系统编码({string.Join(",", existSubsystems.ConvertAll(s => s.PreRunCode))})已存在!", MessageBoxIcon.Warning);
return;
}
@@ -551,12 +563,15 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
}
else
{
this.fileData.Reset();
ShowNotify("文件无数据!", MessageBoxIcon.Warning);
}
DataBrid();
this.fileData.Reset();
}
catch (Exception ex)
{
this.fileData.Reset();
ShowNotify(ex.Message, MessageBoxIcon.Warning);
}
}
@@ -592,6 +607,22 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
}
}
/// <summary>
/// 右击修改
/// </summary>
protected void btnMenuModify_Click(object sender, EventArgs e)
{
btnEdit_Click(sender, e);
}
/// <summary>
/// 右击新增子级别
/// </summary>
protected void btnMenuParentAdd_Click(object sender, EventArgs e)
{
btnParentAdd_Click(sender, e);
}
#endregion
#region