diff --git a/DataBase/版本日志/SGGLDB_WH_2023-08-29.sql b/DataBase/版本日志/SGGLDB_WH_2023-08-29.sql new file mode 100644 index 00000000..549a4d24 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_WH_2023-08-29.sql @@ -0,0 +1,40 @@ + +--޸ֶγ +ALTER TABLE PreRun_TechnologySysPiping ALTER Column NameSpecifications varchar(max) null; +ALTER TABLE PreRun_TechnologySysPiping ALTER Column Materials varchar(max) null; +GO +--ɾеı +ALTER TABLE PreRun_WorkPackage DROP COLUMN WorkPackCode +GO +--ϵͳ +truncate table PreRun_SubSysWorkPackage +--ϵͳϵͳ +alter table PreRun_SubSysWorkPackage add SystemId varchar(50) NULL +GO + +IF object_id(N'PreRun_TechnologySysPiping',N'U') is not null +drop table dbo.PreRun_TechnologySysPiping +CREATE TABLE [dbo].[PreRun_TechnologySysPiping]( + [TechnologyId] [varchar](50) NOT NULL, + [SystemId] [varchar](50) NULL, + [ProjectId] [varchar](50) NULL, + [TagNumber] [varchar](50) NULL, + [NameSpecifications] [varchar](max) NULL, + [DrawingNo] [varchar](50) NULL, + [Materials] [varchar](max) NULL, + [NumOperate] [varchar](50) NULL, + [NumStandby] [varchar](50) NULL, + [WeightSingle] [varchar](50) NULL, + [WeightTotal] [varchar](50) NULL, + [Remark] [nvarchar](150) NULL, + [AddUser] [varchar](50) NULL, + [AddTime] [datetime] NULL, + [Sort] [int] NULL, + CONSTRAINT [PK_PreRun_TechnologySysPiping] PRIMARY KEY CLUSTERED +( + [TechnologyId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + + diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx index 8a061f51..e4b3418d 100644 --- a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx @@ -73,7 +73,7 @@ - + @@ -262,7 +262,7 @@ - + @@ -374,7 +374,7 @@ - + @@ -513,7 +513,7 @@ - + diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx.cs b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx.cs index d3ecedd1..5a290c54 100644 --- a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx.cs @@ -48,7 +48,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun rootNode.EnableClickEvent = true; this.tvControlItem.Nodes.Add(rootNode); var allPreRunLs = Funs.DB.PreRun_SysDevice.Where(p => p.ProjectId == this.CurrUser.LoginProjectId).ToList(); - var onePreRunLs = allPreRunLs.Where(p => p.PreRunLevel == 1); + var onePreRunLs = allPreRunLs.Where(p => p.PreRunLevel == 1).OrderBy(x => x.Sort); foreach (var item in onePreRunLs) { TreeNode rootUnitNode = new TreeNode();//定义根节点 @@ -71,7 +71,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun private void BindNodes(TreeNode node, List list, string parentId) { - var itemList = list.Where(p => p.ParentId == parentId).ToList(); + var itemList = list.Where(p => p.ParentId == parentId).OrderBy(x => x.Sort).ToList(); if (itemList.Count > 0) { foreach (var item in itemList) @@ -305,8 +305,11 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun var existPropertys = Funs.DB.PreRun_PropertySysPiping.Where(a => pipingCodes.Contains(a.PipingCode) && a.SystemId == tvControlItem.SelectedNodeID && a.ProjectId == this.CurrUser.LoginProjectId).ToList(); if (existPropertys.Count > 0) { - ShowNotify($"管道号({string.Join(",", existPropertys.ConvertAll(s => s.PipingCode))})已存在!", MessageBoxIcon.Warning); - return; + //删除已经存在的信息 + Funs.DB.PreRun_PropertySysPiping.DeleteAllOnSubmit(existPropertys); + Funs.DB.SubmitChanges(); + //ShowNotify($"管道号({string.Join(",", existPropertys.ConvertAll(s => s.PipingCode))})已存在!", MessageBoxIcon.Warning); + //return; } List list = new List(); //数据导入 @@ -350,6 +353,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun ShowNotify("文件无数据!", MessageBoxIcon.Warning); } ZxtgdBrid(); + ShowNotify("导入成功!", MessageBoxIcon.Success); } catch (Exception ex) { @@ -533,8 +537,11 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun var existTechnologys = Funs.DB.PreRun_TechnologySysPiping.Where(a => tagNumbers.Contains(a.TagNumber) && a.SystemId == tvControlItem.SelectedNodeID && a.ProjectId == this.CurrUser.LoginProjectId).ToList(); if (existTechnologys.Count > 0) { - ShowNotify($"设备位号({string.Join(",", existTechnologys.ConvertAll(s => s.TagNumber))})已存在!", MessageBoxIcon.Warning); - return; + //删除已经存在的信息 + Funs.DB.PreRun_TechnologySysPiping.DeleteAllOnSubmit(existTechnologys); + Funs.DB.SubmitChanges(); + //ShowNotify($"设备位号({string.Join(",", existTechnologys.ConvertAll(s => s.TagNumber))})已存在!", MessageBoxIcon.Warning); + //return; } string nameSpecificationStr = string.Empty; string materialStr = string.Empty; @@ -621,6 +628,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun ShowNotify("文件无数据!", MessageBoxIcon.Warning); } ZxtgyBrid(); + ShowNotify("导入成功!", MessageBoxIcon.Success); } catch (Exception ex) { diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 41cac1d2..51b60f25 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -90816,7 +90816,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InspectionMachineCode", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InspectionMachineCode", DbType="NVarChar(100)")] public string InspectionMachineCode { get @@ -91747,7 +91747,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InspectionPersonCode", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InspectionPersonCode", DbType="NVarChar(100)")] public string InspectionPersonCode { get @@ -320055,7 +320055,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConstValue", DbType="NVarChar(200)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConstValue", DbType="NVarChar(500)")] public string ConstValue { get