提交代码

This commit is contained in:
2023-11-23 16:50:57 +08:00
parent aedd071d96
commit 1530dd850b
27 changed files with 974 additions and 250 deletions
@@ -99,7 +99,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var table = this.GetPagedDataTable(Grid2, tb);
Grid2.DataSource = table;
Grid2.DataBind();
drpVersion.DataSource = BLL.HJGL_DesignBasisDataImportService.GetListVersionByUnitWorkId(Request.Params["UnitWorkId"], DataClassification);
drpVersion.DataSource = BLL.HJGL_DesignBasisDataImportService.GetListVersionByUnitWorkId(Request.Params["UnitWorkId"], DataClassification);
drpVersion.DataBind();
}
@@ -164,10 +164,10 @@ namespace FineUIPro.Web.HJGL.WeldingManage
try
{
var ds = MiniExcel.Query(fileName).ToList();
var columns = MiniExcel.GetColumns(fileName);
var cnt = columns.Count;
var reposedata = AddDatasetToSQL(ds, cnt);
if (reposedata.code==1)
var columns = MiniExcel.GetColumns(fileName);
var cnt = columns.Count;
var reposedata = AddDatasetToSQL(ds, cnt);
if (reposedata.code == 1)
{
State = (int)ButtonState.Import;
ShowNotify("审核完成请点击导入");
@@ -192,7 +192,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
#endregion
#region Dataset的数据导入数据库
/// <summary>
@@ -204,7 +204,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
private Model.ResponeData AddDatasetToSQL(List<dynamic> pds, int count)
{
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);
if (count < 28)
@@ -245,7 +245,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
string pipeLineId = string.Empty;
if (string.IsNullOrEmpty(col0))
{
result.Add( "第" + (i + 1).ToString() + "行," + "管线号" + "," + "此项为必填项!" + "|");
result.Add("第" + (i + 1).ToString() + "行," + "管线号" + "," + "此项为必填项!" + "|");
}
else
{
@@ -265,8 +265,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var Medium = getMedium.FirstOrDefault(x => x.MediumCode == col3);
if (Medium == null)
{
// result += "第" + (i + 1).ToString() + "行," + "该介质不存在!" + "|";
result .Add( col3 + "-该介质不存在!" + "|");
// result += "第" + (i + 1).ToString() + "行," + "该介质不存在!" + "|";
result.Add(col3 + "-该介质不存在!" + "|");
}
else
{
@@ -284,7 +284,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var PipeLineClass = getPipeLineClass.FirstOrDefault(x => x.PipingClassCode == col4);
if (PipeLineClass == null)
{
// result += "第" + (i + 1).ToString() + "行," + "该管道等级不存在!" + "|";
// result += "第" + (i + 1).ToString() + "行," + "该管道等级不存在!" + "|";
result.Add(col4 + "-该管道等级不存在!" + "|");
}
else
@@ -299,7 +299,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var DetectionRate = getDetectionRate.FirstOrDefault(x => x.DetectionRateValue.ToString() == col5.Replace("%", "") || x.DetectionRateCode == col5);
if (DetectionRate == null)
{
// result += "第" + (i + 1).ToString() + "行," + "该探伤比例不存在!" + "|";
// result += "第" + (i + 1).ToString() + "行," + "该探伤比例不存在!" + "|";
result.Add(col5 + "-该探伤比例不存在!" + "|");
}
else
@@ -316,26 +316,18 @@ namespace FineUIPro.Web.HJGL.WeldingManage
string col6 = pds[i].G;
if (!string.IsNullOrEmpty(col6))
{
string[] types = col6.ToString().Split(',');
foreach (string t in types)
string typeStr = col6.ToString();
var type = getDetectionType.FirstOrDefault(x => x.DetectionTypeCode == typeStr);
if (type == null)
{
var type = getDetectionType.FirstOrDefault(x => x.DetectionTypeCode == t);
if (type == null)
{
//result += "第" + (i + 1).ToString() + "行," + "探伤类型【" + t + "】不存在!" + "|";
result.Add("探伤类型【" + t + "】不存在!" + "|");
}
else
{
pipeline.DetectionType += type.DetectionTypeId + "|";
}
//result += "第" + (i + 1).ToString() + "行," + "探伤类型【" + t + "】不存在!" + "|";
result.Add("探伤类型【" + typeStr + "】不存在!" + "|");
}
if (!string.IsNullOrEmpty(pipeline.DetectionType))
else
{
pipeline.DetectionType = pipeline.DetectionType.Substring(0, pipeline.DetectionType.Length - 1);
pipeline.DetectionType = type.DetectionTypeId;
pipeline.DetectionTypeStr = col6;
}
}
else
{
@@ -378,7 +370,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var PressurePipingClass = getPressurePipingClass.FirstOrDefault(x => x.PressurePipingClassCode == col11);
if (PressurePipingClass == null)
{
// result += "第" + (i + 1).ToString() + "行," + "该压力管道级别不存在!" + "|";
// result += "第" + (i + 1).ToString() + "行," + "该压力管道级别不存在!" + "|";
result.Add(col11 + "-该压力管道级别不存在!" + "|");
}
else
@@ -447,7 +439,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var material = getMaterial.FirstOrDefault(x => x.MaterialCode == col17);
if (material == null)
{
// result += "第" + (i + 1).ToString() + "行," + "该材质不存在!" + "|";
// result += "第" + (i + 1).ToString() + "行," + "该材质不存在!" + "|";
result.Add(col17 + "-该材质不存在!" + "|");
}
else
@@ -456,7 +448,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
pipeline.PipeMaterialCode = col17;
}
}
pipeline.FlowingSection= Convert.ToString(pds[i].S);
pipeline.FlowingSection = Convert.ToString(pds[i].S);
pipeline.Remark = Convert.ToString(pds[i].T);
// 以下是焊口信息
@@ -480,17 +472,17 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
string col20 = "";
if (pds[i].V!=null)
if (pds[i].V != null)
{
col20 = pds[i].V.ToString();
}
if (!string.IsNullOrEmpty(col20))
{
var material = getMaterial.FirstOrDefault(x => x.MaterialCode == col20);
if (material == null)
{
// result += "第" + (i + 1).ToString() + "行," + "该材质1不存在!" + "|";
// result += "第" + (i + 1).ToString() + "行," + "该材质1不存在!" + "|";
result.Add(col20 + "-该材质1不存在!" + "|");
}
else
@@ -505,11 +497,11 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
string col21 = "";
if (pds[i].W!=null)
if (pds[i].W != null)
{
col21 = pds[i].W.ToString();
}
if (!string.IsNullOrEmpty(col21))
{
var material = getMaterial.FirstOrDefault(x => x.MaterialCode == col21);
@@ -530,10 +522,10 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
string col22 = Convert.ToString(pds[i].X);
string col27 = "";
if (pds[i].AC!=null)
string col27 = "";
if (pds[i].AC != null)
{
col27= pds[i].AC.ToString();
col27 = pds[i].AC.ToString();
}
if (rbDiaType.SelectedValue == "1")
{
@@ -576,7 +568,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var col23 = Convert.ToString(pds[i].Y);
if (col23!=null)
if (col23 != null)
{
try
{
@@ -594,8 +586,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
var col24 = Convert.ToString(pds[i].Z);
if (col24!=null)
{
if (col24 != null)
{
// var Thickness = Convert.ToDecimal(col24);
decimal Thickness = 0;
string thickness = col24.ToString();
@@ -603,12 +595,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
if (rbDiaType.SelectedValue == "1")//外径
{
Thickness = (decimal)BLL.Base_DNCompareService.GetThicknessByDia(pipeline.Dia,thickness);
Thickness = (decimal)BLL.Base_DNCompareService.GetThicknessByDia(pipeline.Dia, thickness);
pipeline.Thickness = Thickness;
}
else //DN直径
{
Thickness = (decimal)BLL.Base_DNCompareService.GetThicknessByDNDia(int.Parse( pipeline.DNDia.Replace("DN","")), thickness);
Thickness = (decimal)BLL.Base_DNCompareService.GetThicknessByDNDia(int.Parse(pipeline.DNDia.Replace("DN", "")), thickness);
pipeline.Thickness = Thickness;
}
}
@@ -635,7 +627,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
}
}
else
{
@@ -658,7 +650,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var weldType = getWeldType.FirstOrDefault(x => x.WeldTypeCode == col25);
if (weldType == null)
{
// result += "第" + (i + 1).ToString() + "行," + "该焊缝类型不存在!" + "|";
// result += "第" + (i + 1).ToString() + "行," + "该焊缝类型不存在!" + "|";
result.Add(col25 + "-该焊缝类型不存在!" + "|");
}
else
@@ -746,7 +738,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
pipeline.ProjectId = this.CurrUser.LoginProjectId;
PipelineList.Add(pipeline);
}
}
if (result.Count > 0)
@@ -840,21 +832,21 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
string rootPath = Server.MapPath("~/");
string oldefilePath = rootPath+initPath + this.hdFileName.Text;
string oldefilePath = rootPath + initPath + this.hdFileName.Text;
string unitworkId = Request.Params["UnitWorkId"];
string filePath = rootPath+ Const.DesignBasisDataImportPath + this.hdFileName.Text;
string filePath = rootPath + Const.DesignBasisDataImportPath + this.hdFileName.Text;
if (oldefilePath != string.Empty && System.IO.File.Exists(oldefilePath))
{
if (!Directory.Exists(rootPath + Const.DesignBasisDataImportPath))
{
Directory.CreateDirectory(rootPath + Const.DesignBasisDataImportPath);
}
File.Move(oldefilePath, filePath);
File.Move(oldefilePath, filePath);
//System.IO.File.Delete(oldefilePath);//删除上传的XLS文件
}
string FileName = this.fuAttachUrl.FileName;
if (DrpType.SelectedValue == "1")//更新导入
{
@@ -863,8 +855,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
BLL.PipelineService.DeletePipelineByUnitworkId(unitworkId);//删除原有管线
AddView_HJGL_WeldJoint(PipelineList);//导入数据
Model .HJGL_DesignBasisDataImport hJGL_DesignBasisDataImport = new Model .HJGL_DesignBasisDataImport();
hJGL_DesignBasisDataImport.DesignBasisDataImportId= SQLHelper.GetNewID();
Model.HJGL_DesignBasisDataImport hJGL_DesignBasisDataImport = new Model.HJGL_DesignBasisDataImport();
hJGL_DesignBasisDataImport.DesignBasisDataImportId = SQLHelper.GetNewID();
hJGL_DesignBasisDataImport.ProjectId = this.CurrUser.LoginProjectId;
hJGL_DesignBasisDataImport.UnitWorkId = unitworkId;
hJGL_DesignBasisDataImport.ImportType = "1";
@@ -872,14 +864,14 @@ namespace FineUIPro.Web.HJGL.WeldingManage
hJGL_DesignBasisDataImport.FileName = FileName;
hJGL_DesignBasisDataImport.FilePath = filePath.Replace(rootPath, "");
hJGL_DesignBasisDataImport.FileType = BLL.HJGL_DesignBasisDataImportService.GetFileType(FileName);
hJGL_DesignBasisDataImport.Version = BLL.HJGL_DesignBasisDataImportService.GetNewVersionByUnitWorkId(unitworkId,DataClassification);
hJGL_DesignBasisDataImport.Version = BLL.HJGL_DesignBasisDataImportService.GetNewVersionByUnitWorkId(unitworkId, DataClassification);
hJGL_DesignBasisDataImport.Remark = txtRemark.Text;
hJGL_DesignBasisDataImport.CreateMan = this.CurrUser.PersonId;
hJGL_DesignBasisDataImport.CreateDate = DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss");
BLL.HJGL_DesignBasisDataImportService.AddHJGL_DesignBasisDataImport(hJGL_DesignBasisDataImport);
BLL.HJGL_DesignBasisDataImportVerSionLogService.UpdateVersion(this.CurrUser.LoginProjectId, unitworkId, (decimal)hJGL_DesignBasisDataImport.Version, DataClassification);
}
else //补充导入