diff --git a/.gitignore b/.gitignore index e82d945..6230803 100644 --- a/.gitignore +++ b/.gitignore @@ -5732,3 +5732,4 @@ HJGLPackFile/版本日志/HJGLDB_2024.05.02.sql /HJGLPackFile/PackFile /HJGL/.vs/HJGL/v17/.suo /CreateModel2017.bat +/DataBase/版本日志/HJGLDB_2024.05.12.sql diff --git a/DataBase/版本日志/HJGLDB_2024.05.12.sql b/DataBase/版本日志/HJGLDB_2024.05.12.sql deleted file mode 100644 index f0570d5..0000000 --- a/DataBase/版本日志/HJGLDB_2024.05.12.sql +++ /dev/null @@ -1,289 +0,0 @@ --- ߺ Ƿ PMI -alter table Pipeline_WeldJoint add isPMI bit NULL -GO -update Pipeline_WeldJoint set isPMI=0 -GO - -ALTER VIEW [dbo].[View_Pipeline_WeldJoint] -AS -/************Ϣͼ*****************/ -SELECT WeldJoint.WeldJointId, -WeldJoint.ProjectId, -WeldJoint.PipelineId, -WeldJoint.WeldJointCode, -dbo.Fun_GetParseInt(WeldJoint.WeldJointCode) AS ConvertWeldJoint, -WeldJoint.WeldTypeId, -WeldJoint.Material1Id, -WeldJoint.Material2Id, -WeldJoint.ANSISCH, -WeldJoint.Thickness, -WeldJoint.Dia, -WeldJoint.Size, -WeldJoint.JointAttribute, -WeldJoint.JointArea, -WeldJoint.WeldingMethodId, -WeldJoint.IsHotProess, -WeldJoint.WeldingLocationId, -WeldJoint.WeldMatId, -WeldJoint.WeldSilkId, -WeldJoint.GrooveTypeId, -WeldJoint.PipeSegment, -WeldJoint.PipeAssembly1Id, -WeldJoint.PipeAssembly2Id, -WeldJoint.PipeAssemblyCount, -WeldJoint.HeartNo1, -WeldJoint.HeartNo2, -WeldJoint.LastTemp, -WeldJoint.CellTemp, -WeldJoint.PrepareTemp, -WeldJoint.Electricity, -WeldJoint.SystemNumber, -WeldJoint.Remark, -WeldJoint.DoneDin, -WeldJoint.Voltage, -WeldJoint.TestPackageNo, -WeldJoint.WeldingDailyCode, -WeldJoint.WeldingDailyId, -WeldJoint.BackingWelderId, -WeldJoint.CoverWelderId, -WeldJoint.PipingClassId, -WeldJoint.Specification, -WeldJoint.CancelResult, -Project.ProjectCode, -Project.ProjectName, -Pipeline.PipelineCode, -Pipeline.InstallationId, -Pipeline.UnitId, -Pipeline.SingleNumber, -Pipeline.WorkAreaId, -WeldType.WeldTypeCode, -Material1.MaterialCode AS Material1Code, -Material2.MaterialCode AS Material2Code, -WeldingMethod.WeldingMethodCode, -WeldingLocation.WeldingLocationCode, -WeldMat.ConsumablesCode AS WeldMatCode, ---WeldSilk.ConsumablesCode AS WeldSilkCode, -'' AS WeldSilkCode, -GrooveType.GrooveTypeCode, -CASE WHEN WeldJoint.WeldingDailyId IS NULL THEN '' ELSE '' END AS Is_hjName, -CASE WHEN WeldJoint.IsHotProess=1 THEN '' ELSE '' END AS IsHotProessStr, -Components1.ComponentsCode AS ComponentsCode1, -Components2.ComponentsCode AS ComponentsCode2, -BackingWelder.WelderCode AS BackingWelderCode, -BackingWelder.WelderName AS BackingWelderName, -CoverWelder.WelderCode AS CoverWelderCode, -CoverWelder.WelderName AS CoverWelderName, -(CASE WHEN CoverWelder.WelderCode IS NOT NULL AND BackingWelder.WelderCode IS NOT NULL - THEN CoverWelder.WelderCode + '/' + BackingWelder.WelderCode - ELSE (ISNULL(CoverWelder.WelderCode,'') + ISNULL(BackingWelder.WelderCode,'')) END) AS WelderCode, -- - (CASE WHEN Material1.MaterialCode IS NOT NULL AND Material2.MaterialCode IS NOT NULL - THEN Material1.MaterialCode + '/' + Material2.MaterialCode - ELSE (ISNULL(Material1.MaterialCode,'') + ISNULL(Material2.MaterialCode,'')) END) AS MaterialCode, -- -pipingClass.PipingClassCode,pip.PIPClassCode, -CONVERT(VARCHAR(100), WeldingDaily.WeldingDate, 23) AS WeldingDate, -WeldJoint.IsCancel, -WeldJoint.IsPMI, -WeldJoint.IsGoldJoint, -WeldJoint.WPQId,wps.WPQCode, -WeldJoint.DetectionType, -WeldJoint.PageNum -FROM Pipeline_WeldJoint AS WeldJoint -LEFT JOIN Base_Project AS Project ON Project.ProjectId=WeldJoint.ProjectId -LEFT JOIN Pipeline_Pipeline AS Pipeline ON Pipeline.PipelineId = WeldJoint.PipelineId -LEFT JOIN Base_WeldType AS WeldType ON WeldType.WeldTypeId=WeldJoint.WeldTypeId -LEFT JOIN Base_Material AS Material1 ON Material1.MaterialId = WeldJoint.Material1Id -LEFT JOIN Base_Material AS Material2 ON Material2.MaterialId = WeldJoint.Material2Id -LEFT JOIN Base_WeldingMethod AS WeldingMethod ON WeldingMethod.WeldingMethodId=WeldJoint.WeldingMethodId -LEFT JOIN Base_WeldingLocation AS WeldingLocation ON WeldingLocation.WeldingLocationId=WeldJoint.WeldingLocationId -LEFT JOIN Base_Consumables AS WeldMat ON WeldMat.ConsumablesId=WeldJoint.WeldMatId ---LEFT JOIN Base_Consumables AS WeldSilk ON WeldSilk.ConsumablesId=WeldJoint.WeldSilkId -LEFT JOIN Base_GrooveType AS GrooveType ON GrooveType.GrooveTypeId=WeldJoint.GrooveTypeId -LEFT JOIN Base_Components AS Components1 ON Components1.ComponentsId = WeldJoint.PipeAssembly1Id -LEFT JOIN Base_Components AS Components2 ON Components2.ComponentsId = WeldJoint.PipeAssembly2Id -LEFT JOIN Welder_Welder AS BackingWelder ON BackingWelder.WelderId=WeldJoint.BackingWelderId -LEFT JOIN Welder_Welder AS CoverWelder ON CoverWelder.WelderId=WeldJoint.CoverWelderId -LEFT JOIN Pipeline_WeldingDaily AS WeldingDaily ON WeldingDaily.WeldingDailyId=WeldJoint.WeldingDailyId -LEFT JOIN Base_PipingClass AS pipingClass ON pipingClass.PipingClassId=WeldJoint.PipingClassId -LEFT JOIN dbo.Base_PIPClass pip ON pip.PIPClassId = Pipeline.PIPClassId -LEFT JOIN dbo.WPQ_WPQList wps ON wps.WPQId=WeldJoint.WPQId - - - -GO - - - - -ALTER PROC [dbo].[sp_rpt_JointComprehensive] - @projectId NVARCHAR(50), - @workAreaId NVARCHAR(50)=NULL, - @pipelineIds NVARCHAR(MAX) = NULL - -AS -/**********ۺϢ**********/ -SELECT - weldJoint.WeldJointId, - weldJoint.ProjectId, - WorkArea.WorkAreaId, - WorkArea.WorkAreaCode, - weldJoint.SystemNumber, - weldJoint.TestPackageNo, - pipeline.SingleNumber, - pipeline.PipelineCode, - pipeline.DrawingsNum, - pipingClass.PipingClassCode,pip.PIPClassCode, - weldJoint.PageNum, - weldJoint.PipeSegment,--ܶ - weldJoint.WeldJointCode, - weldType.WeldTypeCode, - weldJoint.JointAttribute, - wl.WeldingLocationCode, - weldJoint.Dia, - weldJoint.Thickness,--ں - weldJoint.HeartNo1, - weldJoint.HeartNo2, - com1.ComponentsName AS PipeAssembly1, - com2.ComponentsName AS PipeAssembly2, - --material.MaterialCode, - mat1.MaterialCode AS MaterialCode1, - mat2.MaterialCode AS MaterialCode2, - cw.WelderCode AS CoverWelderCode, - fw.WelderCode AS BackingWelderCode, - WeldMethod.WeldingMethodName, - medium.MediumName, - weldingDaily.WeldingDate, - weldingDaily.WeldingDailyCode, - trust.TrustBatchCode, - --TrustBatchCode.DetectionRateCode, - --TrustBatchCode.AcceptLevel, - (CASE WHEN weldJoint.IsHotProess=1 THEN '' ELSE '' END) AS IsHotProess, - null as TrustBatchCode, - null as DetectionRateCode, - null as AcceptLevel, - nde.NDEDate AS CHT_CHECKDATE, - ndeItem.NDEReportNo, - CAST(CAST(ISNULL(weldJoint.Size,0) AS REAL) AS NVARCHAR(8)) AS JOT_Size, - WeldMaterialMat.ConsumablesCode AS WMT_MatCode, - WeldMaterialMat.ConsumablesName AS WMT_Matname, - weldJoint.WeldSilkId, - --WeldMaterialSilk.ConsumablesCode AS hsCode, - --WeldMaterialSilk.ConsumablesName AS hsname, - --WeldMaterialSilk.UserFlux, - weldJoint.Specification, - wps.WPQCode,ndttype.DetectionTypeCode,NULL AS HotReportCode, - (CASE WHEN (PointBatchItem.PointState='1' OR PointBatchItem.PointState='2') - THEN (CASE WHEN PointBatchItem.IsWelderFirst=1 THEN '' ELSE '' END) ELSE '' END) AS if_dk -FROM Pipeline_WeldJoint AS weldJoint - LEFT JOIN Pipeline_Pipeline AS pipeline ON pipeline.PipelineId = weldJoint.PipelineId - LEFT JOIN Project_WorkArea AS WorkArea ON WorkArea.WorkAreaId = pipeline.WorkAreaId - LEFT JOIN Base_Material AS mat1 ON mat1.MaterialId = weldJoint.Material1Id - LEFT JOIN Base_Material AS mat2 ON mat2.MaterialId = weldJoint.Material2Id - LEFT JOIN Base_WeldingMethod AS WeldMethod ON WeldMethod.WeldingMethodId = weldJoint.WeldingMethodId - LEFT JOIN dbo.Base_WeldType weldType ON weldType.WeldTypeId = weldJoint.WeldTypeId - LEFT JOIN dbo.Base_WeldingLocation wl ON wl.WeldingLocationId = weldJoint.WeldingLocationId - LEFT JOIN Base_Medium AS medium ON medium.MediumId = pipeline.MediumId - LEFT JOIN Base_Components com1 ON com1.ComponentsId=weldJoint.PipeAssembly1Id - LEFT JOIN Base_Components com2 ON com2.ComponentsId=weldJoint.PipeAssembly2Id - LEFT JOIN Base_PipingClass AS pipingClass ON pipingClass.PipingClassId=WeldJoint.PipingClassId - LEFT JOIN dbo.Base_PIPClass pip ON pip.PIPClassId = Pipeline.PIPClassId - LEFT JOIN Pipeline_WeldingDaily AS weldingDaily ON weldingDaily.WeldingDailyId = weldJoint.WeldingDailyId - LEFT JOIN dbo.WPQ_WPQList wps ON wps.WPQId = weldJoint.WPQId - left join Welder_Welder AS fw on weldJoint.BackingWelderId = fw.WelderId - left join Welder_Welder AS cw on weldJoint.CoverWelderId = cw.WelderId - LEFT JOIN Base_Consumables AS WeldMaterialMat ON WeldMaterialMat.ConsumablesId =weldJoint.WeldMatId - --LEFT JOIN Base_Consumables AS WeldMaterialSilk ON WeldMaterialSilk.ConsumablesId =weldJoint.WeldSilkId - LEFT JOIN Batch_PointBatchItem AS PointBatchItem ON PointBatchItem.WeldJointId =weldJoint.WeldJointId - LEFT JOIN dbo.Batch_PointBatch point ON point.PointBatchId = PointBatchItem.PointBatchId - LEFT JOIN dbo.Base_DetectionType ndttype ON ndttype.DetectionTypeId = point.DetectionTypeId - LEFT JOIN dbo.Batch_BatchTrustItem trustItem ON trustItem.PointBatchItemId = PointBatchItem.PointBatchItemId - LEFT JOIN dbo.Batch_BatchTrust trust ON trust.TrustBatchId = trustItem.TrustBatchId - LEFT JOIN dbo.Batch_NDEItem ndeItem ON ndeItem.TrustBatchItemId = trustItem.TrustBatchItemId - LEFT JOIN dbo.Batch_NDE nde ON nde.NDEID = ndeItem.NDEID - - WHERE weldJoint.ProjectId=@projectId - AND(pipeline.WorkAreaId=@workAreaId OR @workAreaId IS NULL) - AND (CHARINDEX(weldJoint.PipelineId,@pipelineIds)>0 or @pipelineIds IS NULl) - --AND(pipeline.PipelineCode=@pipelineCode OR @pipelineCode IS NULl) - - GO - -UPDATE dbo.Template_Files SET title=REPLACE(title,cast(sortindex as nvarchar(50))+'-','') -GO - -UPDATE dbo.Template_Files SET SortIndex=SortIndex+1 where SortIndex>24 -GO - -INSERT INTO [dbo].[Template_Files]([id],[title],[filePath],[SortIndex]) -VALUES('95125974-3DD4-4E16-B4F0-A9D9C9A1406D','ܵӽͷPMIȷϱ','',25) -GO - --- PMIί -create table PMI_Delegation -( - Id nvarchar(50) not null primary key, - DelegationNo nvarchar(50) not null, - DelegationDate datetime, - ProjectId nvarchar(50) not null, - InstallationId nvarchar(50), - UnitId nvarchar(50), - DetectionStandard nvarchar(50), - Tabler nvarchar(50), - Remark nvarchar(255), - CreatedTime datetime default getdate() -) -go ----- PMIί ϸ -create table PMI_DelegationDetails -( - Id nvarchar(50) not null primary key, - PMIId nvarchar(50) not null, - JointId nvarchar(50) not null, - QualityNo nvarchar(255), - Acceptance nvarchar(255), - Status int not null, - CreatedTime datetime default getdate() -) -go - - --- PMIίв˵ -insert into Sys_Menu values('A6FB44C3-0920-4F77-862F-D814FD5E5D23','PMI','PMI detection management','',21,0,3,NUll,1) -insert into Sys_Menu values(NEWID(),'PMIί','PMI delegation','/WeldingProcess/PMI/PMIDelegation.aspx',1,'A6FB44C3-0920-4F77-862F-D814FD5E5D23',3,NULL,1) -insert into Sys_Menu values(NEWID(),'PMI¼','PMI detection entry','/WeldingProcess/PMI/PMIDetectionEntry.aspx',2,'A6FB44C3-0920-4F77-862F-D814FD5E5D23',3,NULL,1) -GO - - -/*******PMIίϸͼ***********/ - -ALTER VIEW [dbo].[View_PMI_DelegationDetails] -AS -/********ȴϸ********/ -SELECT -TrustItem.Id, -TrustItem.Acceptance, -TrustItem.CreatedTime, -TrustItem.JointId as WeldJointId, -TrustItem.status, -TrustItem.QualityNo, -TrustItem.PMIId, -Trust.ProjectId, -Trust.DelegationNo, -Trust.DelegationDate, -WeldJoint.WeldJointCode, -Pipeline.PipelineCode, -WeldJoint.Specification, -Material.MaterialCode, -Pipeline.WorkAreaId -FROM PMI_DelegationDetails AS TrustItem -LEFT JOIN PMI_Delegation AS Trust ON Trust.Id=TrustItem.PMIId -LEFT JOIN Pipeline_WeldJoint AS WeldJoint ON WeldJoint.WeldJointId=TrustItem.JointId -LEFT JOIN Pipeline_Pipeline AS Pipeline ON Pipeline.PipelineId=WeldJoint.PipelineId -LEFT JOIN Base_Material AS Material ON Material.MaterialId=WeldJoint.Material1Id -GO - - - - - - - diff --git a/HJGL/.vs/HJGL/config/applicationhost.config b/HJGL/.vs/HJGL/config/applicationhost.config index 1963de0..e47cfd0 100644 --- a/HJGL/.vs/HJGL/config/applicationhost.config +++ b/HJGL/.vs/HJGL/config/applicationhost.config @@ -162,7 +162,7 @@ - + @@ -250,7 +250,7 @@ - + diff --git a/HJGL/FineUIPro.Web/Web.config b/HJGL/FineUIPro.Web/Web.config index 8868ed3..f550ed2 100644 --- a/HJGL/FineUIPro.Web/Web.config +++ b/HJGL/FineUIPro.Web/Web.config @@ -9,7 +9,7 @@
- + diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegation.aspx b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegation.aspx index 0e754d0..5e21a51 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegation.aspx +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegation.aspx @@ -145,17 +145,11 @@ - - - - + - - - - + diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegation.aspx.cs b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegation.aspx.cs index 7f8e72d..7c2658d 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegation.aspx.cs +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegation.aspx.cs @@ -309,7 +309,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI } else { - ShowNotify(Resources.Lan.PleaseSelectModifyHotProessTrust, MessageBoxIcon.Warning); + ShowNotify("请选择要处理的PMI委托", MessageBoxIcon.Warning); } } else @@ -335,7 +335,8 @@ namespace FineUIPro.Web.WeldingProcess.PMI //删除主表数据 Funs.DB.PMI_Delegation.DeleteOnSubmit(trustManage); //删除 明细表 - + var details = Funs.DB.PMI_DelegationDetails.Where(t => t.PMIId == trustManage.Id).ToList(); + Funs.DB.PMI_DelegationDetails.DeleteAllOnSubmit(details); Funs.DB.SubmitChanges(); Alert.ShowInTop(Resources.Lan.DeletedSuccessfully, MessageBoxIcon.Success); this.InitTreeMenu(); diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegation.aspx.designer.cs b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegation.aspx.designer.cs index 432558e..420aa75 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegation.aspx.designer.cs +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegation.aspx.designer.cs @@ -257,24 +257,6 @@ namespace FineUIPro.Web.WeldingProcess.PMI /// protected global::FineUIPro.ToolbarFill ToolbarFill2; - /// - /// tbxEditorQualityNo 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextBox tbxEditorQualityNo; - - /// - /// txtEditorAcceptance 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextBox txtEditorAcceptance; - /// /// ToolbarSeparator1 控件。 /// diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationEdit.aspx.cs b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationEdit.aspx.cs index 74c1a36..1a2744a 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationEdit.aspx.cs +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationEdit.aspx.cs @@ -1,6 +1,9 @@ using BLL; +using FineUIPro.Web.common.BaseInfo; using Model; using Newtonsoft.Json.Linq; +using NPOI.SS.Formula.Functions; +using NPOI.SS.Formula.PTG; using System; using System.Collections.Generic; using System.Data; @@ -159,16 +162,23 @@ namespace FineUIPro.Web.WeldingProcess.PMI { weldJointIds = hdItemsString.Text.Substring(0, hdItemsString.Text.LastIndexOf('|')); - List lists = BLL.PMIDelegation_Service.GetPMI_DelegationAddItem(weldJointIds); + var lists = GetGridDataTable(weldJointIds); this.BindGrid(lists); - //获取单位 - string unitCode = Funs.DB.Base_Unit.FirstOrDefault(t => t.UnitId == drpUnitId.SelectedValue)?.UnitCode; - //获取区域code - var workdAreaIdList = lists.Select(t => t.WorkAreaId).ToList(); + if (string.IsNullOrEmpty(this.txtDelegationNo.Text)) + { + //获取单位 + string unitCode = Funs.DB.Base_Unit.FirstOrDefault(t => t.UnitId == drpUnitId.SelectedValue)?.UnitCode; + //获取区域code + var workdAreaIdList = lists.Select(t => t.WorkAreaId).ToList(); - var workAreaCode = Funs.DB.Project_WorkArea.AsQueryable().Where(t => workdAreaIdList.Contains(t.WorkAreaId)).Distinct().FirstOrDefault()?.WorkAreaCode; + var workAreaCode = Funs.DB.Project_WorkArea.AsQueryable().Where(t => workdAreaIdList.Contains(t.WorkAreaId)).Distinct().FirstOrDefault()?.WorkAreaCode; + + string perfix = string.Empty; + perfix = $"PMI-{unitCode}-{workAreaCode}-PI-"; + this.txtDelegationNo.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode", "dbo.PMI_Delegation", "DelegationNo", this.CurrUser.LoginProjectId, perfix); + + } - this.txtDelegationNo.Text = $"PMI-{unitCode}-{workAreaCode}-PI-"; } } #endregion @@ -270,7 +280,59 @@ namespace FineUIPro.Web.WeldingProcess.PMI } #endregion + #region 获取Grid里面的数据返回集合 + private List GetGridDataTable(string weldJointIds) + { + string[] arr = weldJointIds.Split('|'); + JArray mergedData = Grid1.GetMergedData(); + var result = Funs.DB.View_Pipeline_WeldJoint.Select(t => new View_PMI_DelegationDetails { + WeldJointId= t.WeldJointId, + PipelineCode= t.PipelineCode, + ProjectId= t.ProjectId, + Acceptance="", + QualityNo="", + WeldJointCode=t.WeldJointCode, + Specification=t.Specification, + MaterialCode=t.MaterialCode, + WorkAreaId=t.WorkAreaId, + Status=0, + PMIId=this.PMIDelegationId + }).Where(t => arr.Contains(t.WeldJointId)).ToList(); + result.ForEach(item => + { + item.Id = SQLHelper.GetNewID(typeof(PMI_DelegationDetails)); + }); + if (mergedData.Count == 0) + { + return result; + } + else + { + foreach (JObject mergedRow in mergedData) + { + JObject values = mergedRow.Value("values"); + Model.View_PMI_DelegationDetails newTrustItem = new Model.View_PMI_DelegationDetails(); + newTrustItem.Id = values.Value("Id").ToString(); + newTrustItem.PipelineCode = values.Value("PipelineCode").ToString(); + newTrustItem.WeldJointId = values.Value("WeldJointId").ToString(); + newTrustItem.Acceptance = values.Value("Acceptance").ToString(); + newTrustItem.QualityNo = values.Value("QualityNo").ToString(); + newTrustItem.WeldJointCode = values.Value("WeldJointCode").ToString(); + newTrustItem.Specification =HttpUtility.HtmlDecode(values.Value("Specification").ToString()); + newTrustItem.MaterialCode = values.Value("MaterialCode").ToString(); + newTrustItem.Status = 0; + newTrustItem.PMIId = this.PMIDelegationId; + result.Add(newTrustItem); + } + } + + return result; + } + + #endregion + #region 收集Grid页面信息,提交明细 + /// /// 收集Grid页面信息,提交明细 /// @@ -309,28 +371,19 @@ namespace FineUIPro.Web.WeldingProcess.PMI { this.hdItemsString.Text = this.hdItemsString.Text.Substring(0, this.hdItemsString.Text.LastIndexOf('|')); } - var trust = Funs.DB.PMI_Delegation.FirstOrDefault(t=>t.Id==this.PMIDelegationId); if (Grid1.SelectedRowIndexArray.Length > 0) { - List GetHotProessTrustItem = new List(); - if (!string.IsNullOrEmpty(this.hdItemsString.Text)) - { - GetHotProessTrustItem = BLL.PMIDelegation_Service.GetPMI_DelegationAddItem(this.hdItemsString.Text); - } - else if (string.IsNullOrEmpty(this.hdItemsString.Text) && this.PMIDelegationId != null) - { - GetHotProessTrustItem = BLL.PMIDelegation_Service.GetPMI_DelegationItem(this.CurrUser.LoginProjectId, this.PMIDelegationId); - } + var listData = GetGridDataTable(""); foreach (int rowIndex in Grid1.SelectedRowIndexArray) { string rowID = Grid1.DataKeys[rowIndex][0].ToString(); - var item = GetHotProessTrustItem.FirstOrDefault(x => x.WeldJointId == rowID); + var item = listData.FirstOrDefault(x => x.WeldJointId == rowID); if (item != null) { - GetHotProessTrustItem.Remove(item); + listData.Remove(item); } } - BindGrid(GetHotProessTrustItem); + BindGrid(listData); ShowNotify(Resources.Lan.DeletedSuccessfully, MessageBoxIcon.Success); } } diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx index de1f1f9..f60120b 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx @@ -107,7 +107,7 @@ - + + @@ -129,7 +131,7 @@ Width="50px" HeaderTextAlign="Center" TextAlign="Center" /> + TextAlign="Left" Width="200px" Locked="true"> + TextAlign="Left" Width="160px"> + TextAlign="Center" Width="160px"> - - + + + + + - + + + + + + + <%-- 报告编号 --%> + + + + + - - - - + <%-- 是否合格 --%> + + + + + + diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.cs b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.cs index 48fd5fd..b073d35 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.cs +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.cs @@ -9,6 +9,7 @@ using System.Collections; using Model; using static System.Windows.Forms.VisualStyles.VisualStyleElement; using FineUIPro.Web.common.ProjectSet; +using Newtonsoft.Json.Linq; namespace FineUIPro.Web.WeldingProcess.PMI { @@ -105,7 +106,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI where x.UnitId == unitId && x.ProjectId == this.CurrUser.LoginProjectId && x.DelegationDate >= startTime && x.DelegationDate <= endTime - &&( x.DelegationNo.Contains(searchCode)|| searchCode=="") + && (x.DelegationNo.Contains(searchCode) || searchCode == "") select x; //if (!string.IsNullOrWhiteSpace(searchCode)) // ndt = ndt.Where(q => q.DelegationNo.Contains(searchCode)); @@ -120,7 +121,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI node.Nodes.Add(newNode); BindNodes(newNode); } - } + } } #endregion @@ -189,13 +190,6 @@ namespace FineUIPro.Web.WeldingProcess.PMI } } - private string StatusText(int status) { - if (status == 0) - return "合格"; - else - return "不合格"; - } - #region 加载页面输入提交信息 /// /// 加载页面输入提交信息 @@ -208,26 +202,28 @@ namespace FineUIPro.Web.WeldingProcess.PMI join n in Funs.DB.Project_Installation on x.InstallationId equals n.InstallationId join u in Funs.DB.Sys_User on x.DetectionStandard equals u.UserId into u1 //左连接查询 from u in u1.DefaultIfEmpty() - where x.Id==hdPMIId.Text - select new { DelegationNo=x.DelegationNo, - DelegationDate=x.DelegationDate, - InstallationName=n.InstallationName, - UnitName=y.UnitName, - DetectionMethod="PMI光谱分析", - Tabler=x.Tabler, - Remark=x.Remark, - DetectionStandard=x.DetectionStandard, + where x.Id == hdPMIId.Text + select new + { + DelegationNo = x.DelegationNo, + DelegationDate = x.DelegationDate, + InstallationName = n.InstallationName, + UnitName = y.UnitName, + DetectionMethod = "PMI光谱分析", + Tabler = x.Tabler, + Remark = x.Remark, + DetectionStandard = x.DetectionStandard, }).ToList(); - if (pageInfo.Count>0) + if (pageInfo.Count > 0) { this.txtDelegationNo.Text = pageInfo[0].DelegationNo; - this.txtDelegationDate.Text = pageInfo[0].DelegationDate.ToString(); + this.txtDelegationDate.Text = pageInfo[0].DelegationDate.Value.ToString("yyyy-MM-dd"); this.txtInstallationName.Text = pageInfo[0].InstallationName; this.txtUnitName.Text = pageInfo[0].UnitName; this.txtDetectionMethod.Text = pageInfo[0].DetectionMethod; this.txtTabler.Text = pageInfo[0].Tabler; this.txtRemark.Text = pageInfo[0].Remark; - this.txtDetectionStandard.Text= pageInfo[0].DetectionStandard; + this.txtDetectionStandard.Text = pageInfo[0].DetectionStandard; } } #endregion @@ -325,5 +321,60 @@ namespace FineUIPro.Web.WeldingProcess.PMI return str; } #endregion + + /// + /// + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + //if (!CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.BItemEndCheckMenuId, Const.BtnSave)) + //{ + // ShowNotify("您没有这个权限,请与管理员联系!"); + // return; + //} + + if (Grid1.GetModifiedData().Count > 0) + { + JArray teamGroupData = Grid1.GetMergedData(); + foreach (JObject teamGroupRow in teamGroupData) + { + string status = teamGroupRow.Value("status"); + if (status == "modified") + { + JObject values = teamGroupRow.Value("values"); + string id = teamGroupRow.Value("id"); + Model.PMI_DelegationDetails onePMIDelegationDetails = Funs.DB.PMI_DelegationDetails.FirstOrDefault(p => p.Id == id); + if (onePMIDelegationDetails == null) + continue; + //检测日期(缺失) + string DelegationDate = values.Value("DelegationDate"); + if (string.IsNullOrWhiteSpace(DelegationDate)) + ; + else + ; + //报告日期 + string createdTime = values.Value("CreatedTime"); + if (string.IsNullOrWhiteSpace(createdTime)) + onePMIDelegationDetails.CreatedTime=null; + else + onePMIDelegationDetails.CreatedTime=Convert.ToDateTime(createdTime); + //报告编号 + onePMIDelegationDetails.ReportNo = values.Value("reportNo").ToString(); + //是否合格 0合格 1不合格 + string statusText = values.Value("StatusText"); + if (statusText == "合格") + onePMIDelegationDetails.Status = 0; + else + onePMIDelegationDetails.Status = 1; + Funs.DB.SubmitChanges(); + } + } + this.BindGrid(); + } + + ShowNotify(Resources.Lan.SaveSuccessfully, MessageBoxIcon.Success); + } } } \ No newline at end of file diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.designer.cs b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.designer.cs index 76109ee..285256e 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.designer.cs +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.designer.cs @@ -248,6 +248,51 @@ namespace FineUIPro.Web.WeldingProcess.PMI /// protected global::FineUIPro.ToolbarFill ToolbarFill2; + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// tbxTrustDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker tbxTrustDate; + + /// + /// tbxCreatedTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker tbxCreatedTime; + + /// + /// tbxreportNo 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox tbxreportNo; + + /// + /// drpstatus 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpstatus; + /// /// ToolbarSeparator1 控件。 /// diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMISelectList.aspx.cs b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMISelectList.aspx.cs index 1693b43..5734da7 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMISelectList.aspx.cs +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMISelectList.aspx.cs @@ -23,12 +23,12 @@ namespace FineUIPro.Web.WeldingProcess.PMI /// protected void Page_Load(object sender, EventArgs e) { + this.UnitId = Request.Params["unitId"] ?? ""; + this.ProjectId = this.CurrUser.LoginProjectId; + this.PMIId = Request.Params["PMIId"] ?? ""; + this.weldJointIds = Request.Params["weldJointIds"] ?? ""; if (!IsPostBack) { - this.UnitId = Request.Params["unitId"] ??""; - this.ProjectId = this.CurrUser.LoginProjectId; - this.PMIId = Request.Params["PMIId"]??""; - this.weldJointIds = Request.Params["weldJointIds"] ?? ""; this.InitTreeMenu();//加载树 this.BindGrid(); } @@ -127,32 +127,12 @@ namespace FineUIPro.Web.WeldingProcess.PMI select b.JointId ).Distinct().ToList(); - // string sql = @"SELECT WeldJointId,ProjectId,PipelineId,WeldJointCode,WPQCode,DetectionType, - // convert(int,dbo.Fun_GetParseInt(WeldJointCode)) AS ConvertJointNo, - //dbo.Fun_GetParseString(WeldJointCode) AS PreJotNo, - // PipingClassCode,PipeSegment,JointAttribute,PageNum, - // ComponentsCode1,ComponentsCode2,Is_hjName,IsHotProessStr,Material1Code,Material2Code, - // WeldTypeCode,Specification,HeartNo1,HeartNo2,Size,Dia,Thickness,GrooveTypeCode, - // WeldingMethodCode,WeldSilkId,WeldMatCode,WeldingDate,WeldingDailyCode,DoneDin, - // BackingWelderCode,CoverWelderCode,SystemNumber,TestPackageNo,Remark, - // MaterialCode,WeldingDate, - // (CASE WHEN IsCancel=1 THEN '是' ELSE '否' END) AS IsCancel,isPMI - // FROM View_Pipeline_WeldJoint WHERE isPMI=1 "; - - - // List paramsList = new List(); - // if (!string.IsNullOrEmpty(this.txtJointNo.Text)) - // { - // sql += @" and WeldJointCode=@WeldJointCode"; - // paramsList.Add(new SqlParameter("@WeldJointCode", txtJointNo.Text.Trim())); - // } - // if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) - // { - // sql += @" and PipelineId=@PipelineId "; - // paramsList.Add(new SqlParameter("@PipelineId", this.tvControlItem.SelectedNodeID)); - // } - // var dt = SQLHelper.GetDataTableRunText(sql, paramsList.ToArray()); + string[] arr = this.weldJointIds.Split('|'); var query = Funs.DB.View_Pipeline_WeldJoint.Where(t => t.IsPMI == true); + if (arr.Length > 0) + { + listData.Add(arr[0]); + } if (listData.Count > 0) { query = query.Where(t => !listData.Contains(t.WeldJointId)); @@ -165,7 +145,14 @@ namespace FineUIPro.Web.WeldingProcess.PMI { query = query.Where(t => t.PipelineId == this.tvControlItem.SelectedNodeID); } - Grid1.DataSource = query.ToList(); + var data= query.ToList() ; + if (!string.IsNullOrEmpty(weldJointIds)) + { + string[] jots = weldJointIds.Split('|'); + data = data.Where(t => !jots.Contains(t.WeldJointId)).ToList(); + } + data = data.OrderBy(t => t.WeldJointCode).ToList(); + Grid1.DataSource = data; Grid1.DataBind(); } #endregion diff --git a/HJGL/Model/Model.cs b/HJGL/Model/Model.cs index e3f8ab1..8c4334e 100644 --- a/HJGL/Model/Model.cs +++ b/HJGL/Model/Model.cs @@ -21304,7 +21304,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")] public string ProjectId { get @@ -21481,9 +21481,11 @@ namespace Model private string _Acceptance; + private System.Nullable _CreatedTime; + private int _Status; - private System.Nullable _CreatedTime; + private string _ReportNo; #region 可扩展性方法定义 partial void OnLoaded(); @@ -21499,10 +21501,12 @@ namespace Model partial void OnQualityNoChanged(); partial void OnAcceptanceChanging(string value); partial void OnAcceptanceChanged(); - partial void OnStatusChanging(int value); - partial void OnStatusChanged(); partial void OnCreatedTimeChanging(System.Nullable value); partial void OnCreatedTimeChanged(); + partial void OnStatusChanging(int value); + partial void OnStatusChanged(); + partial void OnReportNoChanging(string value); + partial void OnReportNoChanged(); #endregion public PMI_DelegationDetails() @@ -21610,7 +21614,27 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Status", DbType="Int NOT NULL")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CreatedTime", DbType="DateTime")] + public System.Nullable CreatedTime + { + get + { + return this._CreatedTime; + } + set + { + if ((this._CreatedTime != value)) + { + this.OnCreatedTimeChanging(value); + this.SendPropertyChanging(); + this._CreatedTime = value; + this.SendPropertyChanged("CreatedTime"); + this.OnCreatedTimeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Name="status", Storage="_Status", DbType="Int NOT NULL")] public int Status { get @@ -21630,22 +21654,22 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CreatedTime", DbType="DateTime")] - public System.Nullable CreatedTime + [global::System.Data.Linq.Mapping.ColumnAttribute(Name="reportNo", Storage="_ReportNo", DbType="NVarChar(50)")] + public string ReportNo { get { - return this._CreatedTime; + return this._ReportNo; } set { - if ((this._CreatedTime != value)) + if ((this._ReportNo != value)) { - this.OnCreatedTimeChanging(value); + this.OnReportNoChanging(value); this.SendPropertyChanging(); - this._CreatedTime = value; - this.SendPropertyChanged("CreatedTime"); - this.OnCreatedTimeChanged(); + this._ReportNo = value; + this.SendPropertyChanged("ReportNo"); + this.OnReportNoChanged(); } } } @@ -37270,6 +37294,8 @@ namespace Model private string _ProjectId; + private System.Nullable _IsPMI; + private string _PipelineCode; private string _PipelineId; @@ -37400,6 +37426,22 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Name="isPMI", Storage="_IsPMI", DbType="Bit")] + public System.Nullable IsPMI + { + get + { + return this._IsPMI; + } + set + { + if ((this._IsPMI != value)) + { + this._IsPMI = value; + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PipelineCode", DbType="NVarChar(100)")] public string PipelineCode { @@ -39408,8 +39450,6 @@ namespace Model private string _PipingClassCode; - private string _PIPClassCode; - private string _WeldingDate; private System.Nullable _IsCancel; @@ -40518,22 +40558,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PIPClassCode", DbType="NVarChar(50)")] - public string PIPClassCode - { - get - { - return this._PIPClassCode; - } - set - { - if ((this._PIPClassCode != value)) - { - this._PIPClassCode = value; - } - } - } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WeldingDate", DbType="VarChar(100)")] public string WeldingDate {