提交代码

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
@@ -117,16 +117,41 @@ namespace FineUIPro.Web.HJGL.PointTrust
{
foreach (var q in unitWork2)
{
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);
TreeNode tn2 = new TreeNode();
tn2.NodeID = q.UnitWorkId;
tn2.Text = q.UnitWorkName;
tn2.ToolTip = "施工单位:" + unitNamesUnitIds;
tn2.EnableExpandEvent = true;
tn2.CommandName = "单位工程";
rootNode2.Nodes.Add(tn2);
BindNodes(tn2);
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);
TreeNode tn2 = new TreeNode();
tn2.NodeID = q.UnitWorkId;
tn2.Text = q.UnitWorkName;
tn2.ToolTip = "施工单位:" + unitNamesUnitIds;
tn2.EnableExpandEvent = true;
tn2.CommandName = "单位工程";
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);
}
}
}
}
}
@@ -136,20 +161,36 @@ namespace FineUIPro.Web.HJGL.PointTrust
/// <param name="node"></param>
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 = "<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);
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 = "<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);
}
}
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);
}
}
}
}