diff --git a/DataBase/版本日志/SGGLDB_V2023-12-02.sql b/DataBase/版本日志/SGGLDB_V2023-12-02.sql new file mode 100644 index 00000000..475912be --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-12-02.sql @@ -0,0 +1,41 @@ + +ALTER VIEW [dbo].[View_HJGL_NoWeldJointFind] +AS +--δڲ +SELECT jot.WeldJointId, +jot.WeldJointCode, +cast((case when charindex('/',jot.WeldJointCode)>0 +then (case when ISNUMERIC(RIGHT(jot.WeldJointCode,CHARINDEX('/',REVERSE(jot.WeldJointCode))-1))=1 then RIGHT(jot.WeldJointCode,CHARINDEX('/',REVERSE(jot.WeldJointCode))-1) else '1000' end) +else '1000' end) as int) as WeldJointNum, +(case when charindex('/',jot.WeldJointCode)>0 +then RIGHT(jot.WeldJointCode,CHARINDEX('/',REVERSE(jot.WeldJointCode))-1) +else jot.WeldJointCode end) as WeldJointNumStr, +jot.PipelineId, +jot.WeldingDailyId, +jot.JointAttribute, +jot.Dia, +jot.DNDia, +jot.Size, +jot.Thickness, +jot.Remark, +WeldType.WeldTypeCode, +method.WeldingMethodCode, +rod.ConsumablesCode AS WeldingRodCode, +wire.ConsumablesCode AS WeldingWireCode, +mat1.MaterialCode AS Material1Code , +mat2.MaterialCode AS Material2Code +FROM dbo.HJGL_WeldJoint jot +LEFT JOIN dbo.HJGL_PreWeldingDaily pre ON pre.WeldJointId = jot.WeldJointId +LEFT JOIN Base_WeldType AS WeldType ON WeldType.WeldTypeId=jot.WeldTypeId +LEFT JOIN Base_WeldingMethod AS method ON method.WeldingMethodId=jot.WeldingMethodId +LEFT JOIN Base_Material AS mat1 ON mat1.MaterialId = jot.Material1Id +LEFT JOIN Base_Material AS mat2 ON mat2.MaterialId = jot.Material2Id +LEFT JOIN Base_Consumables AS wire ON wire.ConsumablesId=jot.WeldingWire +LEFT JOIN Base_Consumables AS rod ON rod.ConsumablesId=jot.WeldingRod +WHERE pre.PreWeldingDailyId IS NULL +and jot.WeldJointId not in (select WeldJointId from HJGL_WeldJoint where IsTwoJoint = 1 and (AuditDate is null or AuditDate='')) + + +GO + + diff --git a/SGGL/FineUIPro.Web/HJGL/PointTrust/PointBatch.aspx b/SGGL/FineUIPro.Web/HJGL/PointTrust/PointBatch.aspx index 4920bdb9..3aceb227 100644 --- a/SGGL/FineUIPro.Web/HJGL/PointTrust/PointBatch.aspx +++ b/SGGL/FineUIPro.Web/HJGL/PointTrust/PointBatch.aspx @@ -44,6 +44,13 @@ + + + + + + private void BindNodes(TreeNode node) { - - var p = from x in Funs.DB.HJGL_Batch_PointBatch - where x.UnitWorkId == node.NodeID - && x.StartDate < Convert.ToDateTime(this.txtStartTime.Text.Trim() + "-01").AddMonths(1) - && x.StartDate >= Convert.ToDateTime(this.txtStartTime.Text.Trim() + "-01") - select x; - if (p.Count() > 0) + if (string.IsNullOrEmpty(this.txtWeldJointCode.Text.Trim())) { - TreeNode newNode = new TreeNode(); - newNode.Text = "探伤类型"; - newNode.NodeID = "探伤类型"; - node.Nodes.Add(newNode); + var p = from x in Funs.DB.HJGL_Batch_PointBatch + where x.UnitWorkId == node.NodeID + && x.StartDate < Convert.ToDateTime(this.txtStartTime.Text.Trim() + "-01").AddMonths(1) + && x.StartDate >= Convert.ToDateTime(this.txtStartTime.Text.Trim() + "-01") + select x; + if (p.Count() > 0) + { + TreeNode newNode = new TreeNode(); + newNode.Text = "探伤类型"; + newNode.NodeID = "探伤类型"; + node.Nodes.Add(newNode); + } + } + else + { + var p = from x in Funs.DB.HJGL_Batch_PointBatch + where x.UnitWorkId == node.NodeID + //&& x.StartDate < Convert.ToDateTime(this.txtStartTime.Text.Trim() + "-01").AddMonths(1) + //&& x.StartDate >= Convert.ToDateTime(this.txtStartTime.Text.Trim() + "-01") + select x; + if (p.Count() > 0) + { + TreeNode newNode = new TreeNode(); + newNode.Text = "探伤类型"; + newNode.NodeID = "探伤类型"; + node.Nodes.Add(newNode); + } } - } #endregion #endregion @@ -161,140 +202,291 @@ namespace FineUIPro.Web.HJGL.PointTrust e.Node.Nodes.Clear(); if (e.Node.CommandName == "单位工程") { - var detectionTypes = from x in Funs.DB.Base_DetectionType - orderby x.DetectionTypeCode - select new { x.DetectionTypeId, x.DetectionTypeCode, x.DetectionTypeName }; - foreach (var item in detectionTypes) + if (string.IsNullOrEmpty(this.txtWeldJointCode.Text.Trim())) { - var pointManages = from x in Funs.DB.View_HJGL_Batch_PointBatch - where x.ProjectId == this.CurrUser.LoginProjectId - && x.UnitWorkId == e.Node.NodeID - && x.DetectionTypeId == item.DetectionTypeId - select x; - - TreeNode newNode = new TreeNode(); - if (pointManages.Count() > 0) + var detectionTypes = from x in Funs.DB.Base_DetectionType + orderby x.DetectionTypeCode + select new { x.DetectionTypeId, x.DetectionTypeCode, x.DetectionTypeName }; + foreach (var item in detectionTypes) { - newNode.Text = item.DetectionTypeCode; - newNode.NodeID = item.DetectionTypeId + "|" + e.Node.NodeID; - newNode.EnableExpandEvent = true; - newNode.ToolTip = item.DetectionTypeName; - newNode.CommandName = "探伤类型"; - e.Node.Nodes.Add(newNode); - } + var pointManages = from x in Funs.DB.View_HJGL_Batch_PointBatch + where x.ProjectId == this.CurrUser.LoginProjectId + && x.UnitWorkId == e.Node.NodeID + && x.DetectionTypeId == item.DetectionTypeId + select x; - TreeNode tn1 = new TreeNode - { - Text = "检测比例", - NodeID = "检测比例", - }; - newNode.Nodes.Add(tn1); - } - } - - if (e.Node.CommandName == "探伤类型") - { - var detectionRates = from x in Funs.DB.Base_DetectionRate - orderby x.DetectionRateCode - select new { x.DetectionRateId, x.DetectionRateCode, x.DetectionRateValue }; - foreach (var item in detectionRates) - { - var pointManages = from x in Funs.DB.View_HJGL_Batch_PointBatch - where x.ProjectId == this.CurrUser.LoginProjectId - && x.UnitWorkId == e.Node.ParentNode.NodeID - && x.DetectionTypeId == e.Node.NodeID.Split('|')[0] - && x.DetectionRateId == item.DetectionRateId - && x.StartDate < Convert.ToDateTime(this.txtStartTime.Text.Trim() + "-01").AddMonths(1) - && x.StartDate >= Convert.ToDateTime(this.txtStartTime.Text.Trim() + "-01") - select x; - if (item.DetectionRateValue > 0) //探伤比例为0的批不显示 - { TreeNode newNode = new TreeNode(); if (pointManages.Count() > 0) { - newNode.Text = item.DetectionRateValue.ToString() + "%"; - newNode.NodeID = item.DetectionRateId + "|" + e.Node.NodeID; + newNode.Text = item.DetectionTypeCode; + newNode.NodeID = item.DetectionTypeId + "|" + e.Node.NodeID; newNode.EnableExpandEvent = true; - newNode.ToolTip = item.DetectionRateCode; - newNode.CommandName = "检测比例"; - + newNode.ToolTip = item.DetectionTypeName; + newNode.CommandName = "探伤类型"; e.Node.Nodes.Add(newNode); } TreeNode tn1 = new TreeNode { - Text = "检测批", - NodeID = "检测批", + Text = "检测比例", + NodeID = "检测比例", + }; + newNode.Nodes.Add(tn1); + } + } + else + { + var detectionTypes = from x in Funs.DB.Base_DetectionType + join y in Funs.DB.HJGL_Pipeline on x.DetectionTypeId equals y.DetectionType + join z in Funs.DB.HJGL_WeldJoint on y.PipelineId equals z.PipelineId + where z.WeldJointCode.Contains(this.txtWeldJointCode.Text.Trim()) + orderby x.DetectionTypeCode + select new { x.DetectionTypeId, x.DetectionTypeCode, x.DetectionTypeName }; + foreach (var item in detectionTypes) + { + var pointManages = from x in Funs.DB.View_HJGL_Batch_PointBatch + where x.ProjectId == this.CurrUser.LoginProjectId + && x.UnitWorkId == e.Node.NodeID + && x.DetectionTypeId == item.DetectionTypeId + select x; + + TreeNode newNode = new TreeNode(); + if (pointManages.Count() > 0) + { + newNode.Text = item.DetectionTypeCode; + newNode.NodeID = item.DetectionTypeId + "|" + e.Node.NodeID; + newNode.EnableExpandEvent = true; + newNode.ToolTip = item.DetectionTypeName; + newNode.CommandName = "探伤类型"; + e.Node.Nodes.Add(newNode); + } + + TreeNode tn1 = new TreeNode + { + Text = "检测比例", + NodeID = "检测比例", }; newNode.Nodes.Add(tn1); } } } - if (e.Node.CommandName == "检测比例") + if (e.Node.CommandName == "探伤类型") { - var pointManages = from x in Funs.DB.View_HJGL_Batch_PointBatch - where x.ProjectId == this.CurrUser.LoginProjectId - && x.DetectionRateId == e.NodeID.Split('|')[0] - && x.DetectionTypeId == e.Node.ParentNode.NodeID.Split('|')[0] - && x.UnitWorkId == e.Node.ParentNode.ParentNode.NodeID - && x.StartDate < Convert.ToDateTime(this.txtStartTime.Text.Trim() + "-01").AddMonths(1) - && x.StartDate >= Convert.ToDateTime(this.txtStartTime.Text.Trim() + "-01") - select x; - - if (!string.IsNullOrEmpty(this.txtWelderCode.Text)) + if (string.IsNullOrEmpty(this.txtWeldJointCode.Text.Trim())) { - pointManages = pointManages.Where(x => x.WelderCode.Contains(this.txtWelderCode.Text.Trim())); - } - if (this.drpUnit.SelectedValue != BLL.Const._Null) - { - pointManages = pointManages.Where(x => x.UnitId == this.drpUnit.SelectedValue); - } - - - foreach (var item in pointManages) - { - - TreeNode newNode = new TreeNode + var detectionRates = from x in Funs.DB.Base_DetectionRate + orderby x.DetectionRateCode + select new { x.DetectionRateId, x.DetectionRateCode, x.DetectionRateValue }; + foreach (var item in detectionRates) { - NodeID = item.PointBatchId, - ToolTip = "批", - EnableClickEvent = true, - }; - var pipeline = PointBatchService.GetPointBatchById(item.PointBatchId); - string startdate = string.Format("{0:yyyy-MM-dd}", pipeline.StartDate); - string PipeArea = ""; - if (!string.IsNullOrEmpty(pipeline.PipelineId)) - { - switch (PipelineService.GetPipelineByPipelineId(pipeline.PipelineId).PipeArea) + var pointManages = from x in Funs.DB.View_HJGL_Batch_PointBatch + where x.ProjectId == this.CurrUser.LoginProjectId + && x.UnitWorkId == e.Node.ParentNode.NodeID + && x.DetectionTypeId == e.Node.NodeID.Split('|')[0] + && x.DetectionRateId == item.DetectionRateId + && x.StartDate < Convert.ToDateTime(this.txtStartTime.Text.Trim() + "-01").AddMonths(1) + && x.StartDate >= Convert.ToDateTime(this.txtStartTime.Text.Trim() + "-01") + select x; + if (item.DetectionRateValue > 0) //探伤比例为0的批不显示 { - case PipelineService.PipeArea_SHOP: - PipeArea = "(工厂)"; - break; - case PipelineService.PipeArea_FIELD: - PipeArea = "(现场)"; - break; + TreeNode newNode = new TreeNode(); + if (pointManages.Count() > 0) + { + newNode.Text = item.DetectionRateValue.ToString() + "%"; + newNode.NodeID = item.DetectionRateId + "|" + e.Node.NodeID; + newNode.EnableExpandEvent = true; + newNode.ToolTip = item.DetectionRateCode; + newNode.CommandName = "检测比例"; + + e.Node.Nodes.Add(newNode); + } + + TreeNode tn1 = new TreeNode + { + Text = "检测批", + NodeID = "检测批", + }; + newNode.Nodes.Add(tn1); } } - string code = "DK-" + item.PointBatchCode.Substring(item.PointBatchCode.Length - 4) + PipeArea; - if (!item.EndDate.HasValue) ////批 没有关闭 粉色 + } + else + { + var detectionRates = from x in Funs.DB.Base_DetectionRate + join y in Funs.DB.HJGL_Pipeline on x.DetectionRateId equals y.DetectionRateId + join z in Funs.DB.HJGL_WeldJoint on y.PipelineId equals z.PipelineId + where z.WeldJointCode.Contains(this.txtWeldJointCode.Text.Trim()) + orderby x.DetectionRateCode + select new { x.DetectionRateId, x.DetectionRateCode, x.DetectionRateValue }; + foreach (var item in detectionRates) { - newNode.Text = "" + code + "【" + startdate + "】" + "【" + item.UnitName + "】" + ""; - newNode.ToolTip = "批尚未关闭"; - } - // 当天批 - else if (string.Format("{0:yyyy-MM-dd}", item.StartDate) == string.Format("{0:yyyy-MM-dd}", System.DateTime.Now) - || string.Format("{0:yyyy-MM-dd}", item.EndDate) == string.Format("{0:yyyy-MM-dd}", System.DateTime.Now)) - { - newNode.Text = "" + code + "【" + startdate + "】" + "【" + item.UnitName + "】" + ""; - newNode.ToolTip = "当天批"; - } - else - { - newNode.Text = code + "【" + startdate + "】" + "【" + item.UnitName + "】"; - } - e.Node.Nodes.Add(newNode); + var pointManages = from x in Funs.DB.View_HJGL_Batch_PointBatch + where x.ProjectId == this.CurrUser.LoginProjectId + && x.UnitWorkId == e.Node.ParentNode.NodeID + && x.DetectionTypeId == e.Node.NodeID.Split('|')[0] + && x.DetectionRateId == item.DetectionRateId + //&& x.StartDate < Convert.ToDateTime(this.txtStartTime.Text.Trim() + "-01").AddMonths(1) + //&& x.StartDate >= Convert.ToDateTime(this.txtStartTime.Text.Trim() + "-01") + select x; + if (item.DetectionRateValue > 0) //探伤比例为0的批不显示 + { + TreeNode newNode = new TreeNode(); + if (pointManages.Count() > 0) + { + newNode.Text = item.DetectionRateValue.ToString() + "%"; + newNode.NodeID = item.DetectionRateId + "|" + e.Node.NodeID; + newNode.EnableExpandEvent = true; + newNode.ToolTip = item.DetectionRateCode; + newNode.CommandName = "检测比例"; + e.Node.Nodes.Add(newNode); + } + + TreeNode tn1 = new TreeNode + { + Text = "检测批", + NodeID = "检测批", + }; + newNode.Nodes.Add(tn1); + } + } + } + } + + if (e.Node.CommandName == "检测比例") + { + if (string.IsNullOrEmpty(this.txtWeldJointCode.Text.Trim())) + { + var pointManages = from x in Funs.DB.View_HJGL_Batch_PointBatch + where x.ProjectId == this.CurrUser.LoginProjectId + && x.DetectionRateId == e.NodeID.Split('|')[0] + && x.DetectionTypeId == e.Node.ParentNode.NodeID.Split('|')[0] + && x.UnitWorkId == e.Node.ParentNode.ParentNode.NodeID + && x.StartDate < Convert.ToDateTime(this.txtStartTime.Text.Trim() + "-01").AddMonths(1) + && x.StartDate >= Convert.ToDateTime(this.txtStartTime.Text.Trim() + "-01") + select x; + + if (!string.IsNullOrEmpty(this.txtWelderCode.Text)) + { + pointManages = pointManages.Where(x => x.WelderCode.Contains(this.txtWelderCode.Text.Trim())); + } + if (this.drpUnit.SelectedValue != BLL.Const._Null) + { + pointManages = pointManages.Where(x => x.UnitId == this.drpUnit.SelectedValue); + } + + + foreach (var item in pointManages) + { + + TreeNode newNode = new TreeNode + { + NodeID = item.PointBatchId, + ToolTip = "批", + EnableClickEvent = true, + }; + var pipeline = PointBatchService.GetPointBatchById(item.PointBatchId); + string startdate = string.Format("{0:yyyy-MM-dd}", pipeline.StartDate); + string PipeArea = ""; + if (!string.IsNullOrEmpty(pipeline.PipelineId)) + { + switch (PipelineService.GetPipelineByPipelineId(pipeline.PipelineId).PipeArea) + { + case PipelineService.PipeArea_SHOP: + PipeArea = "(工厂)"; + break; + case PipelineService.PipeArea_FIELD: + PipeArea = "(现场)"; + break; + } + } + string code = "DK-" + item.PointBatchCode.Substring(item.PointBatchCode.Length - 4) + PipeArea; + if (!item.EndDate.HasValue) ////批 没有关闭 粉色 + { + newNode.Text = "" + code + "【" + startdate + "】" + "【" + item.UnitName + "】" + ""; + newNode.ToolTip = "批尚未关闭"; + } + // 当天批 + else if (string.Format("{0:yyyy-MM-dd}", item.StartDate) == string.Format("{0:yyyy-MM-dd}", System.DateTime.Now) + || string.Format("{0:yyyy-MM-dd}", item.EndDate) == string.Format("{0:yyyy-MM-dd}", System.DateTime.Now)) + { + newNode.Text = "" + code + "【" + startdate + "】" + "【" + item.UnitName + "】" + ""; + newNode.ToolTip = "当天批"; + } + else + { + newNode.Text = code + "【" + startdate + "】" + "【" + item.UnitName + "】"; + } + e.Node.Nodes.Add(newNode); + } + } + else + { + var pointManages = from x in Funs.DB.View_HJGL_Batch_PointBatch + join y in Funs.DB.View_HJGL_Batch_PointBatchItem on x.PointBatchId equals y.PointBatchId + where x.ProjectId == this.CurrUser.LoginProjectId + && x.DetectionRateId == e.NodeID.Split('|')[0] + && x.DetectionTypeId == e.Node.ParentNode.NodeID.Split('|')[0] + && x.UnitWorkId == e.Node.ParentNode.ParentNode.NodeID + //&& x.StartDate < Convert.ToDateTime(this.txtStartTime.Text.Trim() + "-01").AddMonths(1) + //&& x.StartDate >= Convert.ToDateTime(this.txtStartTime.Text.Trim() + "-01") + && y.WeldJointCode.Contains(this.txtWeldJointCode.Text.Trim()) + select x; + + if (!string.IsNullOrEmpty(this.txtWelderCode.Text)) + { + pointManages = pointManages.Where(x => x.WelderCode.Contains(this.txtWelderCode.Text.Trim())); + } + if (this.drpUnit.SelectedValue != BLL.Const._Null) + { + pointManages = pointManages.Where(x => x.UnitId == this.drpUnit.SelectedValue); + } + + + foreach (var item in pointManages) + { + + TreeNode newNode = new TreeNode + { + NodeID = item.PointBatchId, + ToolTip = "批", + EnableClickEvent = true, + }; + var pipeline = PointBatchService.GetPointBatchById(item.PointBatchId); + string startdate = string.Format("{0:yyyy-MM-dd}", pipeline.StartDate); + string PipeArea = ""; + if (!string.IsNullOrEmpty(pipeline.PipelineId)) + { + switch (PipelineService.GetPipelineByPipelineId(pipeline.PipelineId).PipeArea) + { + case PipelineService.PipeArea_SHOP: + PipeArea = "(工厂)"; + break; + case PipelineService.PipeArea_FIELD: + PipeArea = "(现场)"; + break; + } + } + string code = "DK-" + item.PointBatchCode.Substring(item.PointBatchCode.Length - 4) + PipeArea; + if (!item.EndDate.HasValue) ////批 没有关闭 粉色 + { + newNode.Text = "" + code + "【" + startdate + "】" + "【" + item.UnitName + "】" + ""; + newNode.ToolTip = "批尚未关闭"; + } + // 当天批 + else if (string.Format("{0:yyyy-MM-dd}", item.StartDate) == string.Format("{0:yyyy-MM-dd}", System.DateTime.Now) + || string.Format("{0:yyyy-MM-dd}", item.EndDate) == string.Format("{0:yyyy-MM-dd}", System.DateTime.Now)) + { + newNode.Text = "" + code + "【" + startdate + "】" + "【" + item.UnitName + "】" + ""; + newNode.ToolTip = "当天批"; + } + else + { + newNode.Text = code + "【" + startdate + "】" + "【" + item.UnitName + "】"; + } + e.Node.Nodes.Add(newNode); + } } } } diff --git a/SGGL/FineUIPro.Web/HJGL/PointTrust/PointBatch.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/PointTrust/PointBatch.aspx.designer.cs index e2887ee5..91cc2edf 100644 --- a/SGGL/FineUIPro.Web/HJGL/PointTrust/PointBatch.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HJGL/PointTrust/PointBatch.aspx.designer.cs @@ -84,6 +84,24 @@ namespace FineUIPro.Web.HJGL.PointTrust { /// protected global::FineUIPro.TextBox txtWelderCode; + /// + /// Toolbar6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar6; + + /// + /// txtWeldJointCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtWeldJointCode; + /// /// Toolbar5 控件。 /// diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx index cf566ee8..f36eef1e 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx @@ -77,7 +77,7 @@ @@ -113,8 +113,8 @@ - _WeldJointNum; + private string _WeldJointNumStr; + private string _PipelineId; private string _WeldingDailyId; @@ -271886,6 +271888,22 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WeldJointNumStr", DbType="NVarChar(50)")] + public string WeldJointNumStr + { + get + { + return this._WeldJointNumStr; + } + set + { + if ((this._WeldJointNumStr != value)) + { + this._WeldJointNumStr = value; + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PipelineId", DbType="NVarChar(50)")] public string PipelineId {