This commit is contained in:
佘春生 2024-05-25 14:13:05 +08:00
commit c0c2738e7f
1 changed files with 17 additions and 3 deletions

View File

@ -950,7 +950,6 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
if (unitInfo == null)
{
errorMsg += "未知的单位编号 | ";
}
var installInfo = Funs.DB.Project_Installation.FirstOrDefault(t => t.InstallationCode == model.InstallCode);
if (installInfo == null)
@ -1020,6 +1019,8 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
//查询当前的焊口是否被使用了
if (isALL == "否")
{
var baseDict = GetJointCodeByPipelineIdDic(newPipelineInfo.PipelineId);
var dict = GetJointCodeDic(newPipelineInfo.PipelineId);
string[] modelCodes = model.JointCode.Split(',');
for (int i = 0; i < modelCodes.Length; i++)
@ -1028,6 +1029,10 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
{
errorMsg += $"焊口【{modelCodes[i]}】已被使用 | ";
}
if (!baseDict.ContainsValue(modelCodes[i]))
{
errorMsg += $"未知的焊口【{modelCodes[i]}】| ";
}
}
int baseCount = BLL.TestPackageManageEditService.countBaseWeldJointCode(newPipelineInfo.PipelineId);
if (dict.Count == baseCount)
@ -1036,9 +1041,10 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
}
}
}
model.Remark = errorMsg;
}
if(!string.IsNullOrEmpty(model.Remark))
model.Remark = errorMsg;
if (!string.IsNullOrEmpty(model.Remark))
flag = true;
listData.Add(model);
@ -1070,5 +1076,13 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
}
return dict;
}
private Dictionary<string,string> GetJointCodeByPipelineIdDic(string piplineId)
{
var dict = Funs.DB.Pipeline_WeldJoint.Where(t => t.PipelineId == piplineId)
.ToDictionary(t => t.WeldJointId, t => t.WeldJointCode);
return dict;
}
}
}