2022-12-22 焊接设计基础数据导入修改

This commit is contained in:
李鹏飞 2022-12-22 10:35:20 +08:00
parent 9ecee60d03
commit 98ca42dfa1
2 changed files with 57 additions and 36 deletions

Binary file not shown.

View File

@ -755,7 +755,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
private Model.ResponeData AddDatasetToSQL(List<dynamic> pds, int count) private Model.ResponeData AddDatasetToSQL(List<dynamic> pds, int count)
{ {
Model.ResponeData responeData = new Model.ResponeData(); Model.ResponeData responeData = new Model.ResponeData();
string result = string.Empty; // string result = string.Empty;
List<string> result = new List<string>();
//pds = BLL.Funs.FilterBlankLines(pds); //pds = BLL.Funs.FilterBlankLines(pds);
if (count < 28) if (count < 28)
{ {
@ -795,7 +796,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
string pipeLineId = string.Empty; string pipeLineId = string.Empty;
if (string.IsNullOrEmpty(col0)) if (string.IsNullOrEmpty(col0))
{ {
result += "第" + (i + 1).ToString() + "行," + "管线号" + "," + "此项为必填项!" + "|"; result.Add( "第" + (i + 1).ToString() + "行," + "管线号" + "," + "此项为必填项!" + "|");
} }
else else
{ {
@ -808,14 +809,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage
string col3 = pds[i].D; string col3 = pds[i].D;
if (string.IsNullOrEmpty(col3)) if (string.IsNullOrEmpty(col3))
{ {
result += "第" + (i + 1).ToString() + "行," + "介质名称" + "," + "此项为必填项!" + "|"; result.Add("第" + (i + 1).ToString() + "行," + "介质名称" + "," + "此项为必填项!" + "|");
} }
else else
{ {
var Medium = getMedium.FirstOrDefault(x => x.MediumName == col3); var Medium = getMedium.FirstOrDefault(x => x.MediumName == col3);
if (Medium == null) if (Medium == null)
{ {
result += "第" + (i + 1).ToString() + "行," + "该介质不存在!" + "|"; // result += "第" + (i + 1).ToString() + "行," + "该介质不存在!" + "|";
result .Add( col3 + "-该介质不存在!" + "|");
} }
else else
{ {
@ -826,14 +828,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage
string col4 = pds[i].E; string col4 = pds[i].E;
if (string.IsNullOrEmpty(col4)) if (string.IsNullOrEmpty(col4))
{ {
result += "第" + (i + 1).ToString() + "行," + "管道等级" + "," + "此项为必填项!" + "|"; result.Add("第" + (i + 1).ToString() + "行," + "管道等级" + "," + "此项为必填项!" + "|");
} }
else else
{ {
var PipeLineClass = getPipeLineClass.FirstOrDefault(x => x.PipingClassCode == col4); var PipeLineClass = getPipeLineClass.FirstOrDefault(x => x.PipingClassCode == col4);
if (PipeLineClass == null) if (PipeLineClass == null)
{ {
result += "第" + (i + 1).ToString() + "行," + "该管道等级不存在!" + "|"; // result += "第" + (i + 1).ToString() + "行," + "该管道等级不存在!" + "|";
result.Add(col4 + "-该管道等级不存在!" + "|");
} }
else else
{ {
@ -847,7 +850,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var DetectionRate = getDetectionRate.FirstOrDefault(x => x.DetectionRateValue.ToString() == col5.Replace("%", "") || x.DetectionRateCode == col5); var DetectionRate = getDetectionRate.FirstOrDefault(x => x.DetectionRateValue.ToString() == col5.Replace("%", "") || x.DetectionRateCode == col5);
if (DetectionRate == null) if (DetectionRate == null)
{ {
result += "第" + (i + 1).ToString() + "行," + "该探伤比例不存在!" + "|"; // result += "第" + (i + 1).ToString() + "行," + "该探伤比例不存在!" + "|";
result.Add(col5 + "-该探伤比例不存在!" + "|");
} }
else else
{ {
@ -857,7 +861,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
} }
else else
{ {
result += "第" + (i + 1).ToString() + "行," + "探伤比例" + "," + "此项为必填项!" + "|"; result.Add("第" + (i + 1).ToString() + "行," + "探伤比例" + "," + "此项为必填项!" + "|");
} }
string col6 = pds[i].G; string col6 = pds[i].G;
@ -869,7 +873,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var type = getDetectionType.FirstOrDefault(x => x.DetectionTypeCode == t); var type = getDetectionType.FirstOrDefault(x => x.DetectionTypeCode == t);
if (type == null) if (type == null)
{ {
result += "第" + (i + 1).ToString() + "行," + "探伤类型【" + t + "】不存在!" + "|"; //result += "第" + (i + 1).ToString() + "行," + "探伤类型【" + t + "】不存在!" + "|";
result.Add("探伤类型【" + t + "】不存在!" + "|");
} }
else else
{ {
@ -885,7 +890,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
} }
else else
{ {
result += "第" + (i + 1).ToString() + "行," + "探伤类型" + "," + "此项为必填项!" + "|"; result.Add("第" + (i + 1).ToString() + "行," + "探伤类型" + "," + "此项为必填项!" + "|");
} }
string col7 = pds[i].H; string col7 = pds[i].H;
@ -904,7 +909,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var TestMedium = getTestMedium.FirstOrDefault(x => x.MediumName == col9); var TestMedium = getTestMedium.FirstOrDefault(x => x.MediumName == col9);
if (TestMedium == null) if (TestMedium == null)
{ {
result += "第" + (i + 1).ToString() + "行," + "该压力试验介质不存在!" + "|"; //result += "第" + (i + 1).ToString() + "行," + "该压力试验介质不存在!" + "|";
result.Add(col9 + "-该压力试验介质不存在!" + "|");
} }
else else
{ {
@ -923,7 +929,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var PressurePipingClass = getPressurePipingClass.FirstOrDefault(x => x.PressurePipingClassCode == col11); var PressurePipingClass = getPressurePipingClass.FirstOrDefault(x => x.PressurePipingClassCode == col11);
if (PressurePipingClass == null) if (PressurePipingClass == null)
{ {
result += "第" + (i + 1).ToString() + "行," + "该压力管道级别不存在!" + "|"; // result += "第" + (i + 1).ToString() + "行," + "该压力管道级别不存在!" + "|";
result.Add(col11 + "-该压力管道级别不存在!" + "|");
} }
else else
{ {
@ -941,7 +948,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
} }
catch (Exception) catch (Exception)
{ {
result += "第" + (i + 1).ToString() + "行," + "管线长度(m)格式输入有误" + "|"; result.Add("第" + (i + 1).ToString() + "行," + "管线长度(m)格式输入有误" + "|");
} }
} }
string col13 = pds[i].N; string col13 = pds[i].N;
@ -950,7 +957,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var LeakMedium = getLeakMedium.FirstOrDefault(x => x.MediumName == col13); var LeakMedium = getLeakMedium.FirstOrDefault(x => x.MediumName == col13);
if (LeakMedium == null) if (LeakMedium == null)
{ {
result += "第" + (i + 1).ToString() + "行," + "该泄露试验介质不存在!" + "|"; //result += "第" + (i + 1).ToString() + "行," + "该泄露试验介质不存在!" + "|";
result.Add(col13 + "-该泄露试验介质不存在!" + "|");
} }
else else
{ {
@ -969,7 +977,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var PurgeMethod = getPurgeMethod.FirstOrDefault(x => x.PurgeMethodCode == col15); var PurgeMethod = getPurgeMethod.FirstOrDefault(x => x.PurgeMethodCode == col15);
if (PurgeMethod == null) if (PurgeMethod == null)
{ {
result += "第" + (i + 1).ToString() + "行," + "该吹洗要求不存在!" + "|"; //result += "第" + (i + 1).ToString() + "行," + "该吹洗要求不存在!" + "|";
result.Add(col15 + "-该吹洗要求不存在!" + "|");
} }
else else
{ {
@ -989,7 +998,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var material = getMaterial.FirstOrDefault(x => x.MaterialCode == col17); var material = getMaterial.FirstOrDefault(x => x.MaterialCode == col17);
if (material == null) if (material == null)
{ {
result += "第" + (i + 1).ToString() + "行," + "该材质不存在!" + "|"; // result += "第" + (i + 1).ToString() + "行," + "该材质不存在!" + "|";
result.Add(col17 + "-该材质不存在!" + "|");
} }
else else
{ {
@ -1003,7 +1013,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
string col19 = pds[i].T; string col19 = pds[i].T;
if (string.IsNullOrEmpty(col19)) if (string.IsNullOrEmpty(col19))
{ {
result += "第" + (i + 1).ToString() + "行," + "焊口号" + "," + "此项为必填项!" + "|"; result.Add("第" + (i + 1).ToString() + "行," + "焊口号" + "," + "此项为必填项!" + "|");
} }
else else
{ {
@ -1025,7 +1035,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var material = getMaterial.FirstOrDefault(x => x.MaterialCode == col20); var material = getMaterial.FirstOrDefault(x => x.MaterialCode == col20);
if (material == null) if (material == null)
{ {
result += "第" + (i + 1).ToString() + "行," + "该材质1不存在" + "|"; // result += "第" + (i + 1).ToString() + "行," + "该材质1不存在" + "|";
result.Add(col20 + "-该材质1不存在" + "|");
} }
else else
{ {
@ -1035,7 +1046,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
} }
else else
{ {
result += "第" + (i + 1).ToString() + "行," + "材质1" + "," + "此项为必填项!" + "|"; result.Add("第" + (i + 1).ToString() + "行," + "材质1" + "," + "此项为必填项!" + "|");
} }
string col21 = pds[i].V.ToString(); string col21 = pds[i].V.ToString();
@ -1044,7 +1055,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var material = getMaterial.FirstOrDefault(x => x.MaterialCode == col21); var material = getMaterial.FirstOrDefault(x => x.MaterialCode == col21);
if (material == null) if (material == null)
{ {
result += "第" + (i + 1).ToString() + "行," + "该材质2不存在" + "|"; //result += "第" + (i + 1).ToString() + "行," + "该材质2不存在" + "|";
result.Add(col21 + "-该材质2不存在" + "|");
} }
else else
{ {
@ -1054,11 +1066,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage
} }
else else
{ {
result += "第" + (i + 1).ToString() + "行," + "材质2" + "," + "此项为必填项!" + "|"; result.Add("第" + (i + 1).ToString() + "行," + "材质2" + "," + "此项为必填项!" + "|");
} }
string col22 = pds[i].W; string col22 = pds[i].W;
string col27 = pds[i].AB; string col27 = "";
if (pds[i].AB!=null)
{
col27= pds[i].AB.ToString();
}
if (rbDiaType.SelectedValue == "1") if (rbDiaType.SelectedValue == "1")
{ {
if (!string.IsNullOrEmpty(col27)) if (!string.IsNullOrEmpty(col27))
@ -1076,12 +1092,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage
} }
catch (Exception) catch (Exception)
{ {
result += "第" + (i + 1).ToString() + "行," + "外径格式输入有误" + "|"; result.Add("第" + (i + 1).ToString() + "行," + "外径格式输入有误" + "|");
} }
} }
else else
{ {
result += "第" + (i + 1).ToString() + "行," + "外径" + "," + "此项为必填项!" + "|"; result.Add("第" + (i + 1).ToString() + "行," + "外径" + "," + "此项为必填项!" + "|");
} }
} }
else else
@ -1093,7 +1109,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
} }
else else
{ {
result += "第" + (i + 1).ToString() + "行," + "DN公称直径" + "," + "此项为必填项!" + "|"; result.Add("第" + (i + 1).ToString() + "行," + "DN公称直径" + "," + "此项为必填项!" + "|");
} }
} }
@ -1109,12 +1125,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage
} }
catch (Exception) catch (Exception)
{ {
result += "第" + (i + 1).ToString() + "行," + "达因格式输入有误" + "|"; result.Add("第" + (i + 1).ToString() + "行," + "达因格式输入有误" + "|");
} }
} }
else else
{ {
result += "第" + (i + 1).ToString() + "行," + "达因" + "," + "此项为必填项!" + "|"; result.Add("第" + (i + 1).ToString() + "行," + "达因" + "," + "此项为必填项!" + "|");
} }
var col24 = pds[i].Y; var col24 = pds[i].Y;
@ -1136,12 +1152,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage
} }
catch (Exception) catch (Exception)
{ {
result += "第" + (i + 1).ToString() + "行," + "壁厚格式输入有误" + "|"; result.Add("第" + (i + 1).ToString() + "行," + "壁厚格式输入有误" + "|") ;
} }
} }
else else
{ {
result += "第" + (i + 1).ToString() + "行," + "壁厚" + "," + "此项为必填项!" + "|"; result.Add("第" + (i + 1).ToString() + "行," + "壁厚" + "," + "此项为必填项!" + "|");
} }
if (rbDiaType.SelectedValue == "1") if (rbDiaType.SelectedValue == "1")
{ {
@ -1160,7 +1176,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var weldType = getWeldType.FirstOrDefault(x => x.WeldTypeCode == col25); var weldType = getWeldType.FirstOrDefault(x => x.WeldTypeCode == col25);
if (weldType == null) if (weldType == null)
{ {
result += "第" + (i + 1).ToString() + "行," + "该焊缝类型不存在!" + "|"; // result += "第" + (i + 1).ToString() + "行," + "该焊缝类型不存在!" + "|";
result.Add(col25 + "-该焊缝类型不存在!" + "|");
} }
else else
{ {
@ -1209,7 +1226,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
} }
else else
{ {
result += "第" + (i + 1).ToString() + "行," + "焊缝类型" + "," + "此项为必填项!" + "|"; result.Add("第" + (i + 1).ToString() + "行," + "焊缝类型" + "," + "此项为必填项!" + "|");
} }
string col26 = pds[i].AA; string col26 = pds[i].AA;
if (!string.IsNullOrEmpty(col26)) if (!string.IsNullOrEmpty(col26))
@ -1219,7 +1236,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var q = JointAttribute.Where(x => x.Value == col26); var q = JointAttribute.Where(x => x.Value == col26);
if (q == null) if (q == null)
{ {
result += "第" + (i + 1).ToString() + "行," + "该焊口属性不存在!" + "|"; result.Add("第" + (i + 1).ToString() + "行," + "该焊口属性不存在!" + "|");
} }
else else
@ -1230,7 +1247,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
} }
else else
{ {
result += "第" + (i + 1).ToString() + "行," + "焊口属性" + "," + "此项为必填项!" + "|"; result.Add("第" + (i + 1).ToString() + "行," + "焊口属性" + "," + "此项为必填项!" + "|");
} }
@ -1241,11 +1258,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage
} }
} }
if (!string.IsNullOrEmpty(result)) if (result.Count > 0)
{ {
PipelineList.Clear(); PipelineList.Clear();
result = result.Substring(0, result.LastIndexOf("|")); // result = result.Substring(0, result.LastIndexOf("|"));
errorInfos = result; errorInfos = string.Join("|", result.Distinct());
//Alert alert = new Alert();
//alert.Message = result;
//alert.Target = Target.Self;
//alert.Show();
responeData.code = 0; responeData.code = 0;
responeData.message = errorInfos; responeData.message = errorInfos;
} }