diff --git a/.vs/SGGL_SeDin/v17/.wsuo b/.vs/SGGL_SeDin/v17/.wsuo index ec072382..4781fef6 100644 Binary files a/.vs/SGGL_SeDin/v17/.wsuo and b/.vs/SGGL_SeDin/v17/.wsuo differ diff --git a/DataBase/版本日志/SGGLDB_V2022-11-23.sql b/DataBase/版本日志/SGGLDB_V2022-11-23.sql new file mode 100644 index 00000000..6379d691 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2022-11-23.sql @@ -0,0 +1,6 @@ +alter table [dbo].[HJGL_MaterialCodeLib] alter column [MaterialName] nvarchar(300) +alter table [dbo].[HJGL_MaterialCodeLib] alter column MaterialSpec nvarchar(300) +alter table [dbo].[HJGL_MaterialCodeLib] alter column MaterialMade nvarchar(300) +alter table [dbo].[HJGL_MaterialCodeLib] alter column [MaterialDef] nvarchar(3000) +alter table [dbo].[HJGL_MaterialCodeLib] alter column PipeGrade nvarchar(300) +alter table [dbo].[HJGL_MaterialCodeLib] alter column MaterialUnit nvarchar(300) \ No newline at end of file diff --git a/SGGL/BLL/HJGL/BaseInfo/MaterialCodeLibService.cs b/SGGL/BLL/HJGL/BaseInfo/MaterialCodeLibService.cs index f8ced0a0..ad2f067c 100644 --- a/SGGL/BLL/HJGL/BaseInfo/MaterialCodeLibService.cs +++ b/SGGL/BLL/HJGL/BaseInfo/MaterialCodeLibService.cs @@ -1,6 +1,7 @@ namespace BLL { using Model; + using System.Collections.Generic; using System.Linq; public static class MaterialCodeLibService { @@ -12,7 +13,11 @@ { return Funs.DB.HJGL_MaterialCodeLib.FirstOrDefault(e => e.MaterialCode == materialCode); } - + public static List GetMaterialCodeLibList() + { + var q = (from x in Funs.DB.HJGL_MaterialCodeLib select x).ToList(); + return q; + } /// /// 增加材料库信息 /// @@ -34,7 +39,12 @@ db.HJGL_MaterialCodeLib.InsertOnSubmit(newCodeLib); db.SubmitChanges(); } - + public static void AddBulkMaterialCodeLib(List codeLib) + { + Model.SGGLDB db = Funs.DB; + db.HJGL_MaterialCodeLib.InsertAllOnSubmit(codeLib); + db.SubmitChanges(); + } /// /// 修改材料库信息 /// diff --git a/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs b/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs index 1ec71b3c..6ee295b8 100644 --- a/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs +++ b/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs @@ -60,7 +60,11 @@ namespace BLL list[1] = new ListItem("现场安装", PipeArea_FIELD); return list; } - + public static void RestPipelineAndJoints(string projectid ) + { + PipelineService.hJGL_Pipelines = PipelineService.GetPipelinesByProjectId(projectid); + WeldJointService.hJGL_WeldJoints = WeldJointService.GetWeldJointByProjectid(projectid); + } /// /// 根据管线ID获取管线信息 /// @@ -71,11 +75,7 @@ namespace BLL return Funs.DB.HJGL_Pipeline.FirstOrDefault(e => e.PipelineId == pipelineId); } public static void GetStateByPipelineId(string pipelineId) - {//< f:ListItem Value = "0" Text = "未开始" /> - // < f:ListItem Value = "1" Text = "未开始且延误" /> - // < f:ListItem Value = "2" Text = "开始" /> - // < f:ListItem Value = "3" Text = "已开始且延误" /> - // < f:ListItem Value = "4" Text = "完成" /> + { var mdoel = GetPipelineByPipelineId(pipelineId); var PlanStartDate = mdoel.PlanStartDate; var PlanEndDate = mdoel.PlanEndDate; diff --git a/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLibIn.aspx.cs b/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLibIn.aspx.cs index 276504bc..f41e3f9a 100644 --- a/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLibIn.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLibIn.aspx.cs @@ -85,7 +85,8 @@ namespace FineUIPro.Web.HJGL.BaseInfo string message = string.Empty; errorInfos = string.Empty; List codeLib = new List(); - + List codeLib_update = new List(); + var materialcodelist =MaterialCodeLibService.GetMaterialCodeLibList(); if (this.fuAttachUrl.HasFile == false) { ShowNotify("请选择Excel文件!", MessageBoxIcon.Warning); @@ -155,7 +156,17 @@ namespace FineUIPro.Web.HJGL.BaseInfo //= SQLHelper.GetNewID(typeof(Model.Editor_CostReport)); if (!codeLib.Select(x => x.MaterialCode).Contains(item.MaterialCode)) { - codeLib.Add(item); + + if (materialcodelist.Select(x => x.MaterialCode).Contains(item.MaterialCode)) + { + codeLib_update.Add(item); + } + else + { + codeLib.Add(item); + + } + } #endregion @@ -173,8 +184,41 @@ namespace FineUIPro.Web.HJGL.BaseInfo Alert.ShowInTop(errorInfos, MessageBoxIcon.Warning); return; } + codeLib = (from x in codeLib + select new HJGL_MaterialCodeLib + { + MaterialCode=x.MaterialCode, + MaterialDef=x.MaterialDef, + MaterialSpec=x.MaterialSpec, + MaterialUnit=x.MaterialUnit, + MaterialName=x.MaterialName, - foreach (var item in codeLib) + }).DistinctBy(temp=> new + { + temp.MaterialCode, + temp.MaterialDef, + temp.MaterialSpec, + temp.MaterialUnit, + temp.MaterialName + }).ToList(); + codeLib_update = (from x in codeLib_update + select new HJGL_MaterialCodeLib + { + MaterialCode = x.MaterialCode, + MaterialDef = x.MaterialDef, + MaterialSpec = x.MaterialSpec, + MaterialUnit = x.MaterialUnit, + MaterialName = x.MaterialName, + + }).DistinctBy(temp => new + { + temp.MaterialCode, + temp.MaterialDef, + temp.MaterialSpec, + temp.MaterialUnit, + temp.MaterialName + }).ToList(); + foreach (var item in codeLib_update) { var mewCostReport = BLL.MaterialCodeLibService.GetMaterialCodeLib(item.MaterialCode); if (mewCostReport == null) @@ -186,7 +230,7 @@ namespace FineUIPro.Web.HJGL.BaseInfo BLL.MaterialCodeLibService.UpdateMaterialCodeLib(item); } } - + MaterialCodeLibService.AddBulkMaterialCodeLib(codeLib); ShowNotify("数据导入成功!", MessageBoxIcon.Success); PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); diff --git a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs index 1bce8272..d1f23245 100644 --- a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs @@ -174,14 +174,14 @@ namespace FineUIPro.Web.HJGL.DataImport e.Node.Nodes.Clear(); if (e.Node.CommandName == "单位工程") { - var pipeline = (from x in Funs.DB.HJGL_Pipeline + var pipeline = (from x in PipelineService.hJGL_Pipelines where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == e.Node.NodeID && x.PipelineCode.Contains(this.tvPipeCode.Text.Trim()) orderby x.PipelineCode select x).ToList(); foreach (var item in pipeline) { - var jotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == item.PipelineId && x.IsTwoJoint == null select x).Count(); + var jotCount = (from x in WeldJointService.hJGL_WeldJoints where x.PipelineId == item.PipelineId && x.IsTwoJoint == null select x).Count(); //var weldJotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == item.PipelineId && x.IsTwoJoint == null && x.WeldingDailyId != null select x).Count(); TreeNode newNode = new TreeNode(); //if (jotCount > weldJotCount) diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/PipelingDivide.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PreDesign/PipelingDivide.aspx.cs index 600e016a..640bfefa 100644 --- a/SGGL/FineUIPro.Web/HJGL/PreDesign/PipelingDivide.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/PipelingDivide.aspx.cs @@ -185,7 +185,7 @@ namespace FineUIPro.Web.HJGL.PreDesign /// private void BindGrid() { - + PipelineService.RestPipelineAndJoints(this.CurrUser.LoginProjectId); Model.HJGL_Pipeline view_HJGL_Pipeline = new Model.HJGL_Pipeline(); view_HJGL_Pipeline.ProjectId = this.CurrUser.LoginProjectId; view_HJGL_Pipeline.UnitWorkId = this.tvControlItem.SelectedNodeID; diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineListIn.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineListIn.aspx.cs index 6f168e0a..dc1629e3 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineListIn.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineListIn.aspx.cs @@ -70,7 +70,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage return; } string IsXls = Path.GetExtension(this.fuAttachUrl.FileName).ToString().Trim().ToLower(); - if (IsXls != ".xls") + if (IsXls != ".xlsx") { ShowNotify("只可以选择Excel文件!", MessageBoxIcon.Warning); return; @@ -108,37 +108,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// Excel文件路径名 private void ImportXlsToData(string fileName) { - //支持.xls和.xlsx,即包括office2010等版本的 HDR=Yes代表第一行是标题,不是数据; - //string cmdText = "Provider=Microsoft.ACE.OLEDB.4.0;Data Source={0};Extended Properties='Excel 8.0; HDR=Yes; IMEX=1'"; - - ////建立连接 - //OleDbConnection conn = new OleDbConnection(string.Format(cmdText, fileName)); - try + try { - //打开连接 - //if (conn.State == ConnectionState.Broken || conn.State == ConnectionState.Closed) - //{ - // conn.Open(); - //} - //OleDbDataAdapter oleAdMaster = null; - //DataTable m_tableName = new DataTable(); - //DataSet ds = new DataSet(); - //m_tableName = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); - - //if (m_tableName != null && m_tableName.Rows.Count > 0) - //{ - - // m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim(); - - //} - //string sqlMaster; - //sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]"; - //oleAdMaster = new OleDbDataAdapter(sqlMaster, conn); - //oleAdMaster.Fill(ds, "m_tableName"); - //oleAdMaster.Dispose(); - //conn.Close(); - //conn.Dispose(); - string oleDBConnString = String.Empty; + string oleDBConnString = String.Empty; oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;"; oleDBConnString += "Data Source="; oleDBConnString += fileName; diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineListPDMSIn.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineListPDMSIn.aspx.cs index 79a71ef4..5db62e06 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineListPDMSIn.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineListPDMSIn.aspx.cs @@ -1381,8 +1381,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage } ShowNotify("导入成功!", MessageBoxIcon.Success); - PipelineService.hJGL_Pipelines = PipelineService.GetPipelinesByProjectId(this.CurrUser.LoginProjectId); - WeldJointService.hJGL_WeldJoints = WeldJointService.GetWeldJointByProjectid(this.CurrUser.LoginProjectId); + PipelineService.RestPipelineAndJoints(this.CurrUser.LoginProjectId); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } else @@ -1684,6 +1684,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage } BLL.HJGL_DesignBasisDataImportVerSionLogService.UpdateVersion(this.CurrUser.LoginProjectId, unitworkId, version, DataClassification); + PipelineService.RestPipelineAndJoints(this.CurrUser.LoginProjectId); ShowNotify("恢复成功!"); diff --git a/SGGL/FineUIPro.Web/common/mainMenu_HJGL_AVEVA.aspx.cs b/SGGL/FineUIPro.Web/common/mainMenu_HJGL_AVEVA.aspx.cs index d07f5746..eba3b6d3 100644 --- a/SGGL/FineUIPro.Web/common/mainMenu_HJGL_AVEVA.aspx.cs +++ b/SGGL/FineUIPro.Web/common/mainMenu_HJGL_AVEVA.aspx.cs @@ -8,8 +8,8 @@ namespace FineUIPro.Web { ctlAuditFlow.Url = BLL.Project_SysSetService.GetAvevaNetUrl(this.CurrUser.LoginProjectId); ctlAuditFlow.Url_item = BLL.Project_SysSetService.GetAvevaNetUrl(this.CurrUser.LoginProjectId) + "item/IPE%7CVPD%7CArea-15A"; - PipelineService.hJGL_Pipelines= PipelineService.GetPipelinesByProjectId(this.CurrUser.LoginProjectId); - WeldJointService.hJGL_WeldJoints=WeldJointService.GetWeldJointByProjectid(this.CurrUser.LoginProjectId); + PipelineService.RestPipelineAndJoints(this.CurrUser.LoginProjectId); + } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/index.aspx b/SGGL/FineUIPro.Web/index.aspx index fe888059..c7e979cc 100644 --- a/SGGL/FineUIPro.Web/index.aspx +++ b/SGGL/FineUIPro.Web/index.aspx @@ -665,7 +665,7 @@ // updateLocationHash: 切换Tab时,是否更新地址栏Hash值 // refreshWhenExist: 添加选项卡时,如果选项卡已经存在,是否刷新内部IFrame // refreshWhenTabChange: 切换选项卡时,是否刷新内部IFrame - //F.initTreeTabStrip(mainMenu, mainTabStrip, true, false, false); + F.initTreeTabStrip(mainMenu, mainTabStrip, true, false, false); //var themeTitle = F.cookie('Theme_Pro_Title'); //var themeName = F.cookie('Theme_Pro'); //if (themeTitle) {