From 7994db84521e82a26dae1621e9aea26675075b45 Mon Sep 17 00:00:00 2001 From: fly-l <1420031550@qq.com> Date: Wed, 23 Nov 2022 15:38:28 +0800 Subject: [PATCH] =?UTF-8?q?2022-11-23=20=E7=84=8A=E6=8E=A5=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vs/SGGL_SeDin/v17/.wsuo | Bin 22528 -> 24064 bytes DataBase/版本日志/SGGLDB_V2022-11-23.sql | 6 ++ .../HJGL/BaseInfo/MaterialCodeLibService.cs | 14 ++++- .../BLL/HJGL/WeldingManage/PipelineService.cs | 12 ++-- .../HJGL/BaseInfo/MaterialCodeLibIn.aspx.cs | 52 ++++++++++++++++-- .../DataImport/MaterialInformation.aspx.cs | 4 +- .../HJGL/PreDesign/PipelingDivide.aspx.cs | 2 +- .../HJGL/WeldingManage/PipelineListIn.aspx.cs | 34 +----------- .../WeldingManage/PipelineListPDMSIn.aspx.cs | 5 +- .../common/mainMenu_HJGL_AVEVA.aspx.cs | 4 +- SGGL/FineUIPro.Web/index.aspx | 2 +- 11 files changed, 84 insertions(+), 51 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_V2022-11-23.sql diff --git a/.vs/SGGL_SeDin/v17/.wsuo b/.vs/SGGL_SeDin/v17/.wsuo index ec0723823c109e517c18934028c90f0754c071eb..4781fef6603c40b33f13c65d1180881c3fa52c49 100644 GIT binary patch delta 1749 zcmdUwO-vhC5Xb$@+8DD20}D2aNeLge0dKoD1}~;fmyZ|-*oNXHmEuFOv8zZVO;Woe zO(R>X+Fo)f`;U66dZ5RuY8tDTs%ovMw@UQVLl3=H>LpTC#RqbL&RYy}6Dd-Uedy;m zZ|3d1nK!db`93TE!0vCE9gpLKChOtvtldNdx6J1;=L|ACYUYH)#7O5P4ryS=I)p+~ znXRMN^wN~Qu5O{Zjqni7gpc6c4+saz{q;51@o})T)`g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ql 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) {