提交代码

This commit is contained in:
高飞 2023-12-02 10:50:09 +08:00
parent fd8a66326c
commit 9b98f48748
6 changed files with 409 additions and 133 deletions

View File

@ -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

View File

@ -44,6 +44,13 @@
</f:TextBox>
</Items>
</f:Toolbar>
<f:Toolbar ID="Toolbar6" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:TextBox ID="txtWeldJointCode" runat="server" Label="焊口号" LabelAlign="Right" Width="300px"
EmptyText="输入查询条件" LabelWidth="90px" AutoPostBack="true" OnTextChanged="Tree_TextChanged">
</f:TextBox>
</Items>
</f:Toolbar>
<f:Toolbar ID="Toolbar5" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:DatePicker runat="server" DateFormatString="yyyy-MM" Label="批开始日期" ID="txtStartTime"

View File

@ -116,6 +116,8 @@ namespace FineUIPro.Web.HJGL.PointTrust
if (unitWork2.Count() > 0)
{
foreach (var q in unitWork2)
{
if (string.IsNullOrEmpty(this.txtWeldJointCode.Text.Trim()))
{
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count();
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
@ -128,6 +130,29 @@ namespace FineUIPro.Web.HJGL.PointTrust
rootNode2.Nodes.Add(tn2);
BindNodes(tn2);
}
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.UnitWorkId == q.UnitWorkId
&& y.WeldJointCode.Contains(this.txtWeldJointCode.Text.Trim())
select x).FirstOrDefault();
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
TreeNode tn2 = new TreeNode();
tn2.NodeID = q.UnitWorkId;
tn2.Text = q.UnitWorkName;
tn2.ToolTip = "施工单位:" + unitNamesUnitIds;
tn2.EnableExpandEvent = true;
tn2.CommandName = "单位工程";
rootNode2.Nodes.Add(tn2);
if (pointManages != null)
{
BindNodes(tn2);
this.txtStartTime.Text = string.Format("{0:yyyy-MM}", pointManages.StartDate);
}
}
}
}
}
/// <summary>
@ -136,7 +161,8 @@ namespace FineUIPro.Web.HJGL.PointTrust
/// <param name="node"></param>
private void BindNodes(TreeNode node)
{
if (string.IsNullOrEmpty(this.txtWeldJointCode.Text.Trim()))
{
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)
@ -149,7 +175,22 @@ namespace FineUIPro.Web.HJGL.PointTrust
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
@ -160,6 +201,8 @@ namespace FineUIPro.Web.HJGL.PointTrust
{
e.Node.Nodes.Clear();
if (e.Node.CommandName == "单位工程")
{
if (string.IsNullOrEmpty(this.txtWeldJointCode.Text.Trim()))
{
var detectionTypes = from x in Funs.DB.Base_DetectionType
orderby x.DetectionTypeCode
@ -191,8 +234,46 @@ namespace FineUIPro.Web.HJGL.PointTrust
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 (string.IsNullOrEmpty(this.txtWeldJointCode.Text.Trim()))
{
var detectionRates = from x in Funs.DB.Base_DetectionRate
orderby x.DetectionRateCode
@ -230,8 +311,52 @@ namespace FineUIPro.Web.HJGL.PointTrust
}
}
}
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)
{
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
@ -294,7 +419,74 @@ namespace FineUIPro.Web.HJGL.PointTrust
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 = "<font color='#FA58D0'>" + code + "【" + startdate + "】" + "【" + item.UnitName + "】" + "</font>";
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 = "<font color='#EE0000'>" + code + "【" + startdate + "】" + "【" + item.UnitName + "】" + "</font>";
newNode.ToolTip = "当天批";
}
else
{
newNode.Text = code + "【" + startdate + "】" + "【" + item.UnitName + "】";
}
e.Node.Nodes.Add(newNode);
}
}
}
}

View File

@ -84,6 +84,24 @@ namespace FineUIPro.Web.HJGL.PointTrust {
/// </remarks>
protected global::FineUIPro.TextBox txtWelderCode;
/// <summary>
/// Toolbar6 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar6;
/// <summary>
/// txtWeldJointCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtWeldJointCode;
/// <summary>
/// Toolbar5 控件。
/// </summary>

View File

@ -77,7 +77,7 @@
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="焊口信息"
EnableCollapse="true" KeepCurrentSelection="true" runat="server" BoxFlex="1" OnRowDataBound="Grid1_RowDataBound" DisableUnselectableRows="true"
DataKeyNames="WeldJointId" EnableColumnLines="true"
DataIDField="WeldJointId" EnableTextSelection="True" AllowSorting="true" SortField="WeldJointNum"
DataIDField="WeldJointId" EnableTextSelection="True" AllowSorting="true" SortField="WeldJointNum,WeldJointNumStr"
SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="false" IsDatabasePaging="true" OnRowCommand="Grid1_RowCommand"
PageSize="1000" EnableCheckBoxSelect="true">
<Toolbars>
@ -113,8 +113,8 @@
</f:Toolbar>
</Toolbars>
<Columns>
<f:RenderField HeaderText="焊口序号" ColumnID="WeldJointNum"
DataField="WeldJointNum" SortField="WeldJointNum" FieldType="String" HeaderTextAlign="Center"
<f:RenderField HeaderText="焊口序号" ColumnID="WeldJointNumStr"
DataField="WeldJointNumStr" SortField="WeldJointNumStr" FieldType="String" HeaderTextAlign="Center"
TextAlign="Center" Width="50px" >
</f:RenderField>
<f:RenderField HeaderText="焊口号" ColumnID="WeldJointCode"

View File

@ -271806,6 +271806,8 @@ namespace Model
private System.Nullable<int> _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
{