feat(hjgl): 完善焊前检查和防腐检查流程
焊前检查需要同时覆盖下料、组对和防腐检查,并支持移动端查询与保存。 扩展焊前检查模型、服务和页面字段,补充检查结果、不合格原因、整改要求、 附件和防腐检查记录,便于按焊口和材料追溯检查过程。
This commit is contained in:
@@ -140,6 +140,10 @@
|
||||
FieldType="String" HeaderText="材质" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="PaintCode" DataField="PaintCode" SortField="PaintCode"
|
||||
FieldType="String" HeaderText="防腐等级" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="FlowingSection" DataField="FlowingSection" SortField="FlowingSection"
|
||||
FieldType="String" HeaderText="流水段" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
|
||||
@@ -204,7 +204,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
// string result = string.Empty;
|
||||
List<string> result = new List<string>();
|
||||
//pds = BLL.Funs.FilterBlankLines(pds);
|
||||
if (count < 28)
|
||||
if (count < 32)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = "导入Excel格式错误!Excel只有" + count.ToString().Trim() + "列";
|
||||
@@ -224,6 +224,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
var getPurgeMethod = from x in db.Base_PurgeMethod select x;
|
||||
var getMaterial = from x in db.Base_Material select x;
|
||||
var getWeldType = from x in db.Base_WeldType select x;
|
||||
var getPaintCodeDict = from x in db.Tw_PaintCodeDict where x.IsUsed select x;
|
||||
//var getComponents = from x in Funs.DB.Base_Components where x.ProjeceId == this.CurrUser.LoginProjectId select x;
|
||||
|
||||
Model.WBS_UnitWork unitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(Request.Params["UnitWorkId"]);
|
||||
@@ -254,6 +255,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
string col25 = Convert.ToString(pds[i].AA);
|
||||
string col26 = Convert.ToString(pds[i].AB);
|
||||
string col27 = Convert.ToString(pds[i].AC);
|
||||
string col28 = Convert.ToString(pds[i].AD);
|
||||
string col29 = Convert.ToString(pds[i].AE);
|
||||
string col30 = Convert.ToString(pds[i].AF);
|
||||
bool hasRequiredError = false;
|
||||
Action<string> addRequiredError = colName =>
|
||||
{
|
||||
@@ -780,7 +784,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
result.Add("第" + (i + 1).ToString() + "行," + "焊口属性" + "," + "此项为必填项!" + "|");
|
||||
|
||||
}
|
||||
string col28 = Convert.ToString(pds[i].AD);
|
||||
if (!string.IsNullOrEmpty(col28))
|
||||
{
|
||||
if (col28.Trim() == "是")
|
||||
@@ -790,12 +793,27 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
}
|
||||
|
||||
// 读取焊点坐标(AE列)
|
||||
string col29 = Convert.ToString(pds[i].AE);
|
||||
if (!string.IsNullOrEmpty(col29))
|
||||
{
|
||||
pipeline.WeldJointPoint = col29;
|
||||
}
|
||||
|
||||
// 读取防腐等级(AF列),按字典精确匹配后保存字典ID
|
||||
if (!string.IsNullOrEmpty(col30))
|
||||
{
|
||||
// AF列为非必填项,只有填写时才按防腐字典校验并回填字典ID
|
||||
var paint = getPaintCodeDict.FirstOrDefault(x => !string.IsNullOrEmpty(x.PaintCode) && x.PaintCode.Contains(col30));
|
||||
if (paint == null)
|
||||
{
|
||||
result.Add("第" + (i + 1).ToString() + "行," + "防腐等级" + "【" + col30 + "】不存在!" + "|");
|
||||
}
|
||||
else
|
||||
{
|
||||
pipeline.PaintCode = col30;
|
||||
pipeline.PaintId = paint.Id;
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(pipeline.PipelineCode) && !string.IsNullOrEmpty(pipeline.WeldJointCode))
|
||||
{
|
||||
pipeline.ProjectId = this.CurrUser.LoginProjectId;
|
||||
@@ -1006,6 +1024,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
VacuumPressure = x.VacuumPressure,
|
||||
PCMedium = x.PCMedium,
|
||||
MaterialId = x.MaterialId,
|
||||
PaintId = x.PaintId,
|
||||
Remark = x.Remark,
|
||||
FlowingSection = x.FlowingSection
|
||||
}).DistinctBy(temp => new
|
||||
@@ -1032,6 +1051,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
temp.VacuumPressure,
|
||||
temp.PCMedium,
|
||||
temp.MaterialId,
|
||||
temp.PaintId,
|
||||
temp.Remark,
|
||||
temp.FlowingSection
|
||||
}).ToList();
|
||||
@@ -1060,6 +1080,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
pipeline.VacuumPressure = pipelines[i].VacuumPressure;
|
||||
pipeline.PCMedium = pipelines[i].PCMedium;
|
||||
pipeline.MaterialId = pipelines[i].MaterialId;
|
||||
pipeline.PaintId = pipelines[i].PaintId;
|
||||
pipeline.Remark = pipelines[i].Remark;
|
||||
pipeline.FlowingSection = pipelines[i].FlowingSection;
|
||||
|
||||
|
||||
@@ -221,6 +221,10 @@
|
||||
FieldType="String" HeaderText="材质" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="PaintCode" DataField="PaintCode" SortField="PaintCode"
|
||||
FieldType="String" HeaderText="防腐等级" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="FlowingSection" DataField="FlowingSection" SortField="FlowingSection"
|
||||
FieldType="String" HeaderText="流水段" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
|
||||
@@ -266,12 +266,14 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
/// </summary>
|
||||
private void BindGrid1(string pipelineId)
|
||||
{
|
||||
string strSql = @"SELECT ProjectId,UnitWorkId,PipelineId,PipelineCode,UnitName,MediumCode,MediumName,PipingClassCode,UnitWorkCode,SingleName,
|
||||
TestPressure,SingleNumber,DetectionRateCode,DetectionType,Remark,FlowingSection,TestMediumCode,TotalDin,
|
||||
JointCount,PressurePipingClassCode,PipeLenth,DesignPress,DesignTemperature,LeakPressure,VacuumPressure,
|
||||
LeakMediumName,PCMediumName,MaterialCode
|
||||
FROM dbo.View_HJGL_Pipeline
|
||||
WHERE ProjectId= @ProjectId";
|
||||
string strSql = @"SELECT v.ProjectId,v.UnitWorkId,v.PipelineId,v.PipelineCode,v.UnitName,v.MediumCode,v.MediumName,v.PipingClassCode,v.UnitWorkCode,v.SingleName,
|
||||
v.TestPressure,v.SingleNumber,v.DetectionRateCode,v.DetectionType,v.Remark,v.FlowingSection,v.TestMediumCode,v.TotalDin,
|
||||
v.JointCount,v.PressurePipingClassCode,v.PipeLenth,v.DesignPress,v.DesignTemperature,v.LeakPressure,v.VacuumPressure,
|
||||
v.LeakMediumName,v.PCMediumName,v.MaterialCode,paint.PaintCode
|
||||
FROM dbo.View_HJGL_Pipeline v
|
||||
LEFT JOIN dbo.HJGL_Pipeline p ON p.PipelineId = v.PipelineId
|
||||
LEFT JOIN dbo.Tw_PaintCodeDict paint ON paint.Id = p.PaintId
|
||||
WHERE v.ProjectId= @ProjectId";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
strSql += " AND PipelineId = @PipelineId";
|
||||
@@ -1622,4 +1624,4 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,10 +90,7 @@
|
||||
EnablePostBack="true" OnClick="btnTreeFind_Click" runat="server">
|
||||
</f:Button>
|
||||
<f:Button ID="btnStatisticsMat" ToolTip="匹配材料" Icon="TabGo" runat="server" OnClick="btnStatisticsMat_Click" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnrefresh" ToolTip="同步NET" Icon="ArrowRefresh"
|
||||
EnablePostBack="true" OnClick="btnrefresh_Click" runat="server" Hidden="true">
|
||||
</f:Button>
|
||||
</f:Button>
|
||||
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
@@ -121,8 +118,8 @@
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Items>
|
||||
<f:Grid ID="Grid3" ShowBorder="false" ShowHeader="false" runat="server" EnableCollapse="false"
|
||||
DataKeyNames="Key" DataIDField="Key" ShowGridHeader="false" EnableRowLines="false" EnableAlternateRowColor="false">
|
||||
<f:Grid ID="Grid3" ShowBorder="false" ShowHeader="false" runat="server" EnableCollapse="false" EnableCheckBoxSelect="true"
|
||||
DataKeyNames="Key" DataIDField="Key" ShowGridHeader="true" EnableRowLines="false" EnableAlternateRowColor="false">
|
||||
<Columns>
|
||||
<f:RenderField Width="200px" ColumnID="Value" DataField="Value" SortField="Value"
|
||||
FieldType="String" HeaderText="管线" HeaderTextAlign="Center"
|
||||
@@ -145,11 +142,13 @@
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar3" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<f:Label ID="lbRate" runat="server" LabelWidth="100px" Hidden="true"></f:Label>
|
||||
<f:Button ID="btnPriorityComponents" Text="优先匹配选中焊口" Icon="TabGo" runat="server" OnClick="btnPriorityComponents_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnMatchMat" Text="匹配" Icon="ArrowRefresh" runat="server" OnClick="btnMatchMat_Click"> </f:Button>
|
||||
<f:Button ID="btnConfirmMaterialCode" Text="保存匹配结果" Icon="SystemSave" runat="server" OnClick="btnConfirmMaterialCode_Click" ConfirmText="确定根据当前匹配结果反写材料主编码吗?">
|
||||
</f:Button>
|
||||
<f:Button ID="btnClearMaterialCode" Text="清除匹配结果" Icon="Delete" runat="server" OnClick="btnClearMaterialCode_Click" ConfirmText="确定清除当前选中管线已反写的材料主编码吗?">
|
||||
</f:Button>
|
||||
<f:Button ID="btnGenTask" ToolTip="生成任务单" Text="生成任务单" Icon="ApplicationViewIcons" runat="server" OnClick="btnGenTask_Click" ConfirmText="确定生成任务单吗?">
|
||||
</f:Button>
|
||||
<f:CheckBox ID="cbSelectCom" ShowLabel="false" runat="server" Text="默认勾选匹配100%" Checked="true">
|
||||
@@ -162,10 +161,10 @@
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Items>
|
||||
<f:Grid ID="Grid2" ShowBorder="true" ShowHeader="false" Title="材料匹配" EnableRowClickEvent="true"
|
||||
<f:Grid ID="Grid2" ShowBorder="true" ShowHeader="false" Title="材料匹配"
|
||||
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="PipelineId" ForceFit="true"
|
||||
EnableColumnLines="true" DataIDField="PipelineId" AllowSorting="true" OnRowClick="Grid2_RowClick"
|
||||
SortField="PipelineId" SortDirection="ASC" EnableCheckBoxSelect="true">
|
||||
EnableColumnLines="true" DataIDField="PipelineId" AllowSorting="true"
|
||||
SortField="MatchRate" SortDirection="DESC" EnableCheckBoxSelect="true">
|
||||
<Columns>
|
||||
<f:RenderField Width="150px" ColumnID="UnitWorkName" DataField="UnitWorkName" SortField="UnitWorkName"
|
||||
FieldType="String" HeaderText="主项" HeaderTextAlign="Center"
|
||||
@@ -175,7 +174,7 @@
|
||||
FieldType="String" HeaderText="管线号" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="MatchRateString" DataField="MatchRateString" SortField="MatchRateString"
|
||||
<f:RenderField Width="150px" ColumnID="MatchRateString" DataField="MatchRateString" SortField="MatchRate"
|
||||
FieldType="String" HeaderText="匹配率" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
@@ -190,7 +189,7 @@
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="材料匹配明细" EnableRowClickEvent="true"
|
||||
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="Id,PipelineId,PrefabricatedComponents,WeldJointId" ForceFit="true"
|
||||
EnableColumnLines="true" DataIDField="Id" AllowSorting="true" OnRowDataBound="Grid1_RowDataBound" FixedRowHeight="true" RowHeight="46"
|
||||
EnableColumnLines="true" DataIDField="Id" AllowSorting="true" FixedRowHeight="true" RowHeight="46"
|
||||
SortField="PipelineCode" SortDirection="ASC" OnSort="Grid1_Sort" EnableCheckBoxSelect="true" EnableSummary="true" SummaryPosition="Bottom" >
|
||||
<Columns>
|
||||
<f:RenderField Width="200px" ColumnID="PipelineCode" DataField="PipelineCode" SortField="PipelineCode"
|
||||
|
||||
@@ -5,8 +5,6 @@ using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
|
||||
namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
@@ -14,7 +12,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
public partial class WeldMatMatch : PageBase
|
||||
{
|
||||
public int pageSize = PipelineService.pageSize;
|
||||
public static decimal Rate = 0;
|
||||
|
||||
public string WarehouseId
|
||||
{
|
||||
get
|
||||
@@ -26,6 +24,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
ViewState["WarehouseId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string PipeArea
|
||||
{
|
||||
get
|
||||
@@ -37,17 +36,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
ViewState["PipeArea"] = value;
|
||||
}
|
||||
}
|
||||
public string Line_No
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["Line_No"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["Line_No"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Dictionary<string, string> dicSeclectPipeLine
|
||||
{
|
||||
get
|
||||
@@ -59,6 +48,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
ViewState["dicSeclectPipeLine"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public List<Model.Tw_PipeMatMatchOutput> tw_PipeMatMatchOutputs
|
||||
{
|
||||
get
|
||||
@@ -106,7 +96,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
drpWarehouse.DataSource = BLL.TwInOutplanmasterService.GetWarehouseCode(this.CurrUser.LoginProjectId);
|
||||
drpWarehouse.DataBind();
|
||||
drpWarehouse_SelectedIndexChanged(null, null);
|
||||
; HJGL_MaterialService.materialStockItems_FIELD = new List<Model.MaterialStockItem>();
|
||||
HJGL_MaterialService.materialStockItems_FIELD = new List<Model.MaterialStockItem>();
|
||||
HJGL_MaterialService.materialStockItems_SHOP = new List<Model.MaterialStockItem>();
|
||||
dicSeclectPipeLine = new Dictionary<string, string>();
|
||||
priorityWeldJoints = new Dictionary<string, HashSet<string>>();
|
||||
@@ -123,6 +113,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
}
|
||||
|
||||
#region 加载树装置-单位-工作区
|
||||
|
||||
/// <summary>
|
||||
/// 加载树
|
||||
/// </summary>
|
||||
@@ -146,10 +137,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
rootNode2.EnableCheckBox = false;
|
||||
this.tvControlItem.Nodes.Add(rootNode2);
|
||||
|
||||
var pUnits = (from x in Funs.DB.Project_ProjectUnit where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList();
|
||||
// 获取当前用户所在单位
|
||||
var currUnit = pUnits.FirstOrDefault(x => x.UnitId == this.CurrUser.UnitId);
|
||||
|
||||
var unitWorkList = (from x in Funs.DB.WBS_UnitWork
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null
|
||||
@@ -158,27 +145,13 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
List<Model.WBS_UnitWork> unitWork1 = null;
|
||||
List<Model.WBS_UnitWork> unitWork2 = null;
|
||||
|
||||
//// 当前为施工单位,只能操作本单位的数据
|
||||
//if (currUnit != null && currUnit.UnitType == Const.ProjectUnitType_2)
|
||||
//{
|
||||
// unitWork1 = (from x in unitWorkList
|
||||
// where x.UnitId == this.CurrUser.UnitId && x.ProjectType == "1"
|
||||
// select x).ToList();
|
||||
// unitWork2 = (from x in unitWorkList
|
||||
// where x.UnitId == this.CurrUser.UnitId && x.ProjectType == "2"
|
||||
// select x).ToList();
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList();
|
||||
unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
|
||||
//}
|
||||
|
||||
if (unitWork1.Count() > 0)
|
||||
{
|
||||
foreach (var q in unitWork1)
|
||||
{
|
||||
|
||||
int a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId);
|
||||
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
|
||||
TreeNode tn1 = new TreeNode();
|
||||
@@ -201,8 +174,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
foreach (var q in unitWork2)
|
||||
{
|
||||
int a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId);
|
||||
// var NowComPipelineCode = PipelineService.GetNoComPipelinesByUnitWordId(q.UnitWorkId);
|
||||
//int a = NowComPipelineCode.Count();
|
||||
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
|
||||
TreeNode tn2 = new TreeNode();
|
||||
tn2.NodeID = q.UnitWorkId;
|
||||
@@ -225,24 +196,17 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 按分页方式向试压包节点追加管线子节点。
|
||||
/// </summary>
|
||||
/// <param name="node">需要加载管线的试压包树节点。</param>
|
||||
private void BindNodes(TreeNode node)
|
||||
{
|
||||
//var NowComPipelineCode = PipelineService.GetNoComPipelinesByUnitWordId(node.NodeID);
|
||||
//if (!node.Text.Contains("|"))
|
||||
//{
|
||||
// node.Text += "|" + NowComPipelineCode.Count();
|
||||
|
||||
//}
|
||||
var pipeline = GetTestPackagePipelineList(node.NodeID);
|
||||
//pipeline= pipeline.Where(x => NowComPipelineCode.Contains(x.PipelineCode)).ToList();
|
||||
if (!node.Text.Contains("|"))
|
||||
{
|
||||
node.Text += "|" + pipeline.Count();
|
||||
|
||||
}
|
||||
int pageindex = int.Parse(node.CommandName.Split('|')[0]);
|
||||
int pageCount = int.Parse(node.CommandName.Split('|')[1]);
|
||||
@@ -251,10 +215,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
pipeline = pipeline.Skip(pageSize * (pageindex - 1)).Take(pageSize).ToList();
|
||||
foreach (var item in pipeline)
|
||||
{
|
||||
/*if (!NowComPipelineCode.Contains(item.PipelineCode))
|
||||
{
|
||||
continue;
|
||||
}*/
|
||||
TreeNode newNode = new TreeNode();
|
||||
newNode.Text = item.PipelineCode;
|
||||
newNode.NodeID = item.PipelineId;
|
||||
@@ -371,8 +331,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 按当前筛选条件重新加载左侧WBS管线树。
|
||||
/// </summary>
|
||||
@@ -383,7 +341,10 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
this.InitTreeMenu();
|
||||
}
|
||||
|
||||
#endregion 加载树装置-单位-工作区
|
||||
|
||||
#region 点击TreeView
|
||||
|
||||
/// <summary>
|
||||
/// 点击TreeView
|
||||
/// </summary>
|
||||
@@ -395,86 +356,29 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
{
|
||||
string CommandName = e.Node.ParentNode.CommandName;
|
||||
e.Node.ParentNode.CommandName = (int.Parse(CommandName.Split('|')[0]) + 1) + "|" + int.Parse(CommandName.Split('|')[1]);
|
||||
TreeNode treeNode = e.Node.ParentNode;
|
||||
treeNode.Nodes.Remove(e.Node);
|
||||
e.Node.ParentNode.Nodes.Remove(e.Node);
|
||||
BindNodes(e.Node.ParentNode);
|
||||
}
|
||||
else
|
||||
{
|
||||
// this.BindGrid();
|
||||
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion 点击TreeView
|
||||
|
||||
#region 数据绑定
|
||||
/// <summary>
|
||||
/// 绑定当前选中管线的材料汇总信息。
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
string strSql = @"SELECT ISNULL(pipe.MaterialCode2, lib.Code) AS MaterialCode,
|
||||
ISNULL(lib.MaterialName, libCode.MaterialName) AS MaterialName,
|
||||
ISNULL(lib.MaterialUnit, libCode.MaterialUnit) AS MaterialUnit,
|
||||
ISNULL(lib.MaterialSpec, libCode.MaterialSpec) AS MaterialSpec,
|
||||
ISNULL(lib.MaterialMade, libCode.MaterialMade) AS MaterialMade,
|
||||
ISNULL(lib.MaterialDef, libCode.MaterialDef) AS MaterialDef,
|
||||
sum(pipe.Number)as Number ,
|
||||
'0' as MatchNum,'否' AS CheckState
|
||||
FROM dbo.HJGL_PipeLineMat pipe
|
||||
LEFT JOIN dbo.HJGL_MaterialCodeLib lib ON lib.MaterialCode = pipe.MaterialCode
|
||||
LEFT JOIN dbo.HJGL_Pipeline line ON line.PipelineId = pipe.PipelineId
|
||||
OUTER APPLY (SELECT TOP 1 * FROM dbo.HJGL_MaterialCodeLib codeLib WHERE codeLib.ProjectId=line.ProjectId AND codeLib.Code=pipe.MaterialCode2 ORDER BY codeLib.MaterialCode) libCode
|
||||
WHERE PipelineId=@PipelineId
|
||||
group by ISNULL(pipe.MaterialCode2, lib.Code),
|
||||
ISNULL(lib.MaterialName, libCode.MaterialName),
|
||||
ISNULL(lib.MaterialUnit, libCode.MaterialUnit),
|
||||
ISNULL(lib.MaterialSpec, libCode.MaterialSpec),
|
||||
ISNULL(lib.MaterialMade, libCode.MaterialMade),
|
||||
ISNULL(lib.MaterialDef, libCode.MaterialDef) ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@PipelineId", this.tvControlItem.SelectedNodeID));
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
// 2.获取当前分页数据
|
||||
Grid1.DataSource = dt;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// 绑定管线匹配汇总。重新匹配会刷新 Grid2,需要把用户原来勾选的管线恢复回来。
|
||||
/// </summary>
|
||||
/// <param name="keepSelectedPipelineIds">需要保留选中状态的管线ID</param>
|
||||
void BindGrid2(IEnumerable<string> keepSelectedPipelineIds = null)
|
||||
{
|
||||
//var result = tw_PipeMatMatchOutputs
|
||||
// .GroupBy(item => new { item.PipelineId, item.PipelineCode,item.UnitWorkName }) // 按 PipelineId 和 PipelineCode 分组
|
||||
// .Select(group => new
|
||||
// {
|
||||
// PipelineId = group.Key.PipelineId, // 当前组的 PipelineId
|
||||
// PipelineCode = group.Key.PipelineCode, // 当前组的 PipelineCode
|
||||
// UnitWorkName = group.Key.UnitWorkName, // 当前组的 UnitWorkName
|
||||
// AverageMatchRate = group.Average(item => item.MatchRate) // 计算平均 MatchRate
|
||||
// })
|
||||
// .ToList(); // 转换为 List
|
||||
|
||||
//// 如果需要将结果转换为自定义类型,可以这样做
|
||||
//List<Tw_PipeMatMatchOutput> output = result.Select(r => new Tw_PipeMatMatchOutput
|
||||
//{
|
||||
// PipelineId = r.PipelineId,
|
||||
// PipelineCode = r.PipelineCode,
|
||||
// UnitWorkName = r.UnitWorkName,
|
||||
// MatchRate = r.AverageMatchRate,
|
||||
// MatchRateString = Math.Round((decimal)r.AverageMatchRate * 100, 2).ToString() + "%"
|
||||
//}).ToList();
|
||||
var output = TwArrivalStatisticsService.GetPipeMatch(tw_PipeMatMatchOutputs);
|
||||
private void BindGrid2(IEnumerable<string> keepSelectedPipelineIds = null)
|
||||
{
|
||||
var output = TwArrivalStatisticsService.GetPipeMatch(tw_PipeMatMatchOutputs)
|
||||
// Grid2 默认展示按管线整体匹配率倒序,便于优先处理齐套率高的管线。
|
||||
.OrderByDescending(x => x.MatchRate ?? 0)
|
||||
.ThenBy(x => x.UnitWorkName)
|
||||
.ThenBy(x => x.PipelineCode)
|
||||
.ToList();
|
||||
Grid2.DataSource = output;
|
||||
Grid2.DataBind();
|
||||
/*if (output.Any())
|
||||
{
|
||||
Rate = Math.Round((decimal)output.Average(item => item.MatchRate) * 100, 2);
|
||||
lbRate.Text = "匹配率:" + Rate.ToString() + "%";
|
||||
}*/
|
||||
// “优先匹配选中焊口”会重新计算匹配结果,重新绑定后要继续保留原管线选中状态。
|
||||
var keepSelectedList = keepSelectedPipelineIds == null ? new List<string>() : keepSelectedPipelineIds.Where(x => !string.IsNullOrEmpty(x)).Distinct().ToList();
|
||||
var selectList = new List<string>();
|
||||
@@ -486,13 +390,11 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
{
|
||||
Grid2.Rows[i].RowCssClass = "green";
|
||||
selectList.Add(model.PipelineId);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Grid2.Rows[i].RowCssClass = "red";
|
||||
}
|
||||
|
||||
}
|
||||
if (cbSelectCom.Checked)
|
||||
{
|
||||
@@ -508,9 +410,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
/// <summary>
|
||||
/// 绑定已加入匹配的管线列表,并标识正在出库中的管线。
|
||||
/// </summary>
|
||||
void BindGrid3()
|
||||
private void BindGrid3()
|
||||
{
|
||||
|
||||
Grid3.DataSource = dicSeclectPipeLine;
|
||||
Grid3.DataBind();
|
||||
for (int i = 0; i < Grid3.Rows.Count; i++)
|
||||
@@ -524,41 +425,29 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
{
|
||||
Grid3.Rows[i].RowCssClass = "yellow";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion 数据绑定
|
||||
|
||||
#region 表格事件
|
||||
/// <summary>
|
||||
/// 材料匹配明细行绑定事件,保留历史行样式扩展入口。
|
||||
/// </summary>
|
||||
/// <param name="sender">事件源。</param>
|
||||
/// <param name="e">Grid行绑定事件参数。</param>
|
||||
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
|
||||
{
|
||||
// DataRowView row = e.DataItem as DataRowView;
|
||||
/* string code = Grid1.DataKeys[e.RowIndex][0].ToString();
|
||||
var num= decimal.Parse(Grid1.DataKeys[e.RowIndex][1].ToString()) ;
|
||||
bool istrue = HJGL_MaterialService.isInStockByMaterialCode(code,num,PipeArea, this.CurrUser.LoginProjectId);
|
||||
|
||||
if (istrue)
|
||||
{
|
||||
e.RowCssClass = "color1";
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定指定管线的材料匹配明细,设置行颜色、优先焊口选中状态和可生成任务单合计。
|
||||
/// 绑定 Grid2 当前选中管线的材料匹配明细,设置行颜色、优先焊口选中状态和可生成任务单合计。
|
||||
/// </summary>
|
||||
/// <param name="pipelineId">管线ID。</param>
|
||||
private void BindMaterialDetail(string pipelineId)
|
||||
private void BindMaterialDetail()
|
||||
{
|
||||
var selectedPipelineIds = Grid2.SelectedRowIDArray == null
|
||||
? new List<string>()
|
||||
: Grid2.SelectedRowIDArray.Where(x => !string.IsNullOrEmpty(x)).Distinct().ToList();
|
||||
if (!selectedPipelineIds.Any() && !string.IsNullOrEmpty(Grid2.SelectedRowID))
|
||||
{
|
||||
selectedPipelineIds.Add(Grid2.SelectedRowID);
|
||||
}
|
||||
|
||||
// 任务单只允许从未生成任务单的焊口材料中选择,避免重复生成焊接任务。
|
||||
var tb = GetNoTaskMaterialDetails()
|
||||
.Where(x => x.PipelineId == pipelineId)
|
||||
.Where(x => selectedPipelineIds.Contains(x.PipelineId))
|
||||
// 明细固定按管线号、预制组件号、焊口号、材料编码排序,便于同一焊口材料连续展示。
|
||||
.OrderBy(x => x.PipelineCode)
|
||||
.ThenBy(x => x.PrefabricatedComponents)
|
||||
@@ -614,7 +503,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
JObject summary = new JObject();
|
||||
summary.Add("PipelineCode", "合计");
|
||||
summary.Add("PrefabricatedComponents", "可生成任务单焊口数:");
|
||||
summary.Add("WeldJointCode", taskWeldJointCount.ToString());
|
||||
summary.Add("WeldJointCode", taskWeldJointCount.ToString());
|
||||
Grid1.SummaryData = summary;
|
||||
}
|
||||
|
||||
@@ -744,48 +633,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
/// <param name="e">Grid行点击事件参数。</param>
|
||||
protected void Grid2_RowClick(object sender, GridRowClickEventArgs e)
|
||||
{
|
||||
BindMaterialDetail(Grid2.SelectedRowID);
|
||||
|
||||
BindMaterialDetail();
|
||||
}
|
||||
/// <summary>
|
||||
/// 点击材料明细行时联动三维模型定位当前管线或单位工程。
|
||||
/// </summary>
|
||||
/// <param name="sender">事件源。</param>
|
||||
/// <param name="e">Grid行点击事件参数。</param>
|
||||
protected void Grid1_RowClick(object sender, GridRowClickEventArgs e)
|
||||
{
|
||||
Model.Parameter3D parameter3D = new Model.Parameter3D();
|
||||
Model.ColorModel colorModel = new Model.ColorModel();
|
||||
colorModel = BLL.Project_SysSetService.GetColorModel(this.CurrUser.LoginProjectId);
|
||||
parameter3D.ColorModel = colorModel;
|
||||
parameter3D.ButtonType = "3";
|
||||
if (this.tvControlItem.SelectedNode.CommandName == "单位工程")
|
||||
{
|
||||
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(tvControlItem.SelectedNodeID);
|
||||
|
||||
|
||||
}
|
||||
else if (this.tvControlItem.SelectedNode.CommandName == "管线")
|
||||
{
|
||||
var modelpipe = PipelineService.GetPipelineByPipelineId(tvControlItem.SelectedNodeID);
|
||||
if (modelpipe != null && !string.IsNullOrEmpty(modelpipe.UnitWorkId))
|
||||
{
|
||||
bool istrue = BLL.HJGL_MaterialService.isInStockByPipeline(tvControlItem.SelectedNodeID, this.CurrUser.LoginProjectId);
|
||||
if (istrue)
|
||||
{
|
||||
Line_No = "/" + modelpipe.PipelineCode;
|
||||
}
|
||||
// parameter3D.Line_No = Line_No;
|
||||
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(modelpipe.UnitWorkId);
|
||||
var pipecode = "/" + modelpipe.PipelineCode;
|
||||
parameter3D.TagNum = pipecode;
|
||||
}
|
||||
|
||||
}
|
||||
//ctlAuditFlow.Url_item = BLL.Project_SysSetService.GetAvevaNetUrl_Item(this.CurrUser.LoginProjectId) + parameter3D.ModelName;
|
||||
//ctlAuditFlow.data = parameter3D;
|
||||
//ctlAuditFlow.BindData();
|
||||
}
|
||||
/// <summary>
|
||||
/// 记录材料明细排序字段,并按当前选中管线重新绑定明细。
|
||||
/// </summary>
|
||||
@@ -795,86 +645,28 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
{
|
||||
Grid1.SortDirection = e.SortDirection;
|
||||
Grid1.SortField = e.SortField;
|
||||
if (!string.IsNullOrEmpty(Grid2.SelectedRowID) && tw_PipeMatMatchOutputs != null && tw_PipeMatMatchOutputs.Any())
|
||||
if (tw_PipeMatMatchOutputs != null && tw_PipeMatMatchOutputs.Any())
|
||||
{
|
||||
BindMaterialDetail(Grid2.SelectedRowID);
|
||||
}
|
||||
else
|
||||
{
|
||||
BindGrid();
|
||||
BindMaterialDetail();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion 表格事件
|
||||
|
||||
#region 按钮事件
|
||||
|
||||
/// <summary>
|
||||
/// 刷新三维模型参数,按当前树节点定位单位工程或管线。
|
||||
/// 仓库切换后刷新当前仓库ID并重新加载左侧管线树。
|
||||
/// </summary>
|
||||
/// <param name="sender">事件源。</param>
|
||||
/// <param name="e">事件参数。</param>
|
||||
protected void btnrefresh_Click(object sender, EventArgs e)
|
||||
protected void drpWarehouse_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
|
||||
{
|
||||
Model.Parameter3D parameter3D = new Model.Parameter3D();
|
||||
Model.ColorModel colorModel = new Model.ColorModel();
|
||||
colorModel = BLL.Project_SysSetService.GetColorModel(this.CurrUser.LoginProjectId);
|
||||
parameter3D.ColorModel = colorModel;
|
||||
parameter3D.TagNum = "";
|
||||
parameter3D.ButtonType = "3";
|
||||
|
||||
if (this.tvControlItem.SelectedNode.CommandName == "单位工程")
|
||||
{
|
||||
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(tvControlItem.SelectedNodeID);
|
||||
var pipeline = (from x in Funs.DB.HJGL_Pipeline
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == tvControlItem.SelectedNodeID && x.PipeArea == PipeArea && x.WarehouseId == WarehouseId
|
||||
orderby x.PipelineCode
|
||||
select x).ToList();
|
||||
List<string> pipelineList = new List<string>();
|
||||
foreach (var item in pipeline)
|
||||
{
|
||||
bool istrue = BLL.HJGL_MaterialService.isInStockByPipeline(item.PipelineId, this.CurrUser.LoginProjectId);
|
||||
if (istrue)
|
||||
{
|
||||
pipelineList.Add("/" + item.PipelineCode);
|
||||
}
|
||||
|
||||
}
|
||||
parameter3D.TagNum = string.Join(",", pipelineList);
|
||||
parameter3D.Line_No = string.Join(",", pipelineList);
|
||||
}
|
||||
else if (this.tvControlItem.SelectedNode.CommandName == "管线")
|
||||
{
|
||||
Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByPipelineId(this.tvControlItem.SelectedNodeID);
|
||||
this.hdUnitWorkId.Text = string.Empty;
|
||||
if (pipeline != null)
|
||||
{
|
||||
this.hdUnitWorkId.Text = pipeline.UnitWorkId;
|
||||
this.BindGrid();
|
||||
}
|
||||
|
||||
if (pipeline != null && !string.IsNullOrEmpty(pipeline.UnitWorkId))
|
||||
{
|
||||
bool istrue = BLL.HJGL_MaterialService.isInStockByPipeline(tvControlItem.SelectedNodeID, this.CurrUser.LoginProjectId);
|
||||
if (istrue)
|
||||
{
|
||||
Line_No = "/" + pipeline.PipelineCode;
|
||||
}
|
||||
//parameter3D.Line_No = Line_No;
|
||||
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(pipeline.UnitWorkId);
|
||||
var pipecode = "/" + pipeline.PipelineCode;
|
||||
parameter3D.TagNum = pipecode;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//ctlAuditFlow.Url_item = BLL.Project_SysSetService.GetAvevaNetUrl_Item(this.CurrUser.LoginProjectId) + parameter3D.ModelName;
|
||||
//ctlAuditFlow.data = parameter3D;
|
||||
//ctlAuditFlow.BindData();
|
||||
}
|
||||
|
||||
WarehouseId = Base_WarehouseService.GetWarehouseList(this.CurrUser.LoginProjectId)
|
||||
.Where(x => x.WarehouseId == drpWarehouse.SelectedValue || x.WarehouseName == drpWarehouse.SelectedValue)
|
||||
.Select(x => x.WarehouseId)
|
||||
.FirstOrDefault();
|
||||
this.InitTreeMenu();//加载树
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -896,20 +688,80 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将左侧勾选的管线加入本次材料匹配范围并刷新匹配结果。
|
||||
/// 按树节点获取可加入本次匹配的管线。单位工程节点会展开到其下所有试压包,再套用当前仓库、区域和页面筛选条件。
|
||||
/// </summary>
|
||||
/// <param name="node">左侧树节点。</param>
|
||||
/// <returns>符合材料匹配入口条件的管线列表。</returns>
|
||||
private List<Model.HJGL_Pipeline> GetMatchPipelinesByTreeNode(TreeNode node)
|
||||
{
|
||||
if (node == null)
|
||||
{
|
||||
return new List<Model.HJGL_Pipeline>();
|
||||
}
|
||||
|
||||
if (node.CommandName == "管线")
|
||||
{
|
||||
var pipeline = PipelineService.GetPipelineByPipelineId(node.NodeID);
|
||||
return pipeline == null ? new List<Model.HJGL_Pipeline>() : new List<Model.HJGL_Pipeline> { pipeline };
|
||||
}
|
||||
|
||||
if (node.CommandName == "单位工程")
|
||||
{
|
||||
var testPackageIds = (from x in Funs.DB.PTP_TestPackage
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.UnitWorkId == node.NodeID
|
||||
select x.PTP_ID).ToList();
|
||||
|
||||
return testPackageIds
|
||||
.SelectMany(x => GetTestPackagePipelineList(x))
|
||||
.GroupBy(x => x.PipelineId)
|
||||
.Select(x => x.First())
|
||||
.OrderBy(x => x.PipelineCode)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(node.CommandName) && node.CommandName.Contains("|"))
|
||||
{
|
||||
return GetTestPackagePipelineList(node.NodeID);
|
||||
}
|
||||
|
||||
return new List<Model.HJGL_Pipeline>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将左侧勾选管线或当前选中主项/试压包下的管线加入本次材料匹配范围并刷新匹配结果。
|
||||
/// </summary>
|
||||
/// <param name="sender">事件源。</param>
|
||||
/// <param name="e">事件参数。</param>
|
||||
protected void btnAddPipelineMatchMat_Click(object sender, EventArgs e)
|
||||
{
|
||||
int addCount = 0;
|
||||
var selectNodes = tvControlItem.GetCheckedNodes();
|
||||
foreach (var node in selectNodes)
|
||||
{
|
||||
if (dicSeclectPipeLine.Where(x => x.Key == node.NodeID).Count() == 0 && node.CommandName == "管线")
|
||||
{
|
||||
dicSeclectPipeLine.Add(node.NodeID, node.Text);
|
||||
addCount++;
|
||||
}
|
||||
}
|
||||
|
||||
var selectedNodePipelines = GetMatchPipelinesByTreeNode(tvControlItem.SelectedNode);
|
||||
foreach (var pipeline in selectedNodePipelines)
|
||||
{
|
||||
if (pipeline != null && !dicSeclectPipeLine.ContainsKey(pipeline.PipelineId))
|
||||
{
|
||||
dicSeclectPipeLine.Add(pipeline.PipelineId, pipeline.PipelineCode);
|
||||
addCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (addCount == 0)
|
||||
{
|
||||
ShowNotify("未找到可新增的匹配管线!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
RefreshMatchResult();
|
||||
}
|
||||
|
||||
@@ -936,6 +788,18 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
RefreshMatchResult();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 匹配
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMatchMat_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
BindMaterialDetail();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 优先匹配选中焊口
|
||||
/// </summary>
|
||||
@@ -984,7 +848,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
}
|
||||
RefreshMatchResult();
|
||||
Grid2.SelectedRowIDArray = keepSelectedPipelineIds.Distinct().ToArray();
|
||||
BindMaterialDetail(selectedPipelineId);
|
||||
BindMaterialDetail();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1015,21 +879,51 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
return;
|
||||
}
|
||||
|
||||
var invalidMaterials = matchedMaterials
|
||||
.Where(x => string.IsNullOrEmpty(x.MatchMaterialCode) || (x.MatchRate ?? 0) < 1)
|
||||
.ToList();
|
||||
/* if (invalidMaterials.Any())
|
||||
{
|
||||
ShowNotify("存在未100%匹配的材料,不能反写材料主编码!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}*/
|
||||
|
||||
int count = BLL.PipelineMatService.UpdateMaterialCodeByMatchOutputs(matchedMaterials);
|
||||
ShowNotify("已保存材料主编码" + count.ToString() + "条!", MessageBoxIcon.Success);
|
||||
RefreshMatchResult();
|
||||
if (Grid2.SelectedRowIDArray.Any())
|
||||
{
|
||||
BindMaterialDetail(Grid2.SelectedRowIDArray.First());
|
||||
BindMaterialDetail();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 清除 Grid2 当前选中管线中已反写到管线材料表的材料主编码。
|
||||
/// </summary>
|
||||
/// <param name="sender">事件源。</param>
|
||||
/// <param name="e">事件参数。</param>
|
||||
protected void btnClearMaterialCode_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid2.SelectedRowIDArray == null || !Grid2.SelectedRowIDArray.Any())
|
||||
{
|
||||
ShowNotify("请先选择需要清除匹配结果的管线!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (tw_PipeMatMatchOutputs == null || !tw_PipeMatMatchOutputs.Any())
|
||||
{
|
||||
RefreshMatchResult();
|
||||
}
|
||||
|
||||
var selectedPipelineIds = Grid2.SelectedRowIDArray.ToList();
|
||||
var pipeLineMatIds = tw_PipeMatMatchOutputs
|
||||
.Where(x => selectedPipelineIds.Contains(x.PipelineId))
|
||||
.Select(x => x.PipeLineMatId)
|
||||
.Distinct()
|
||||
.ToList();
|
||||
if (!pipeLineMatIds.Any())
|
||||
{
|
||||
ShowNotify("未找到需要清除的材料匹配明细!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
int count = BLL.PipelineMatService.ClearMaterialCodeByPipeLineMatIds(pipeLineMatIds);
|
||||
ShowNotify("已清除材料主编码" + count.ToString() + "条!", MessageBoxIcon.Success);
|
||||
RefreshMatchResult();
|
||||
if (Grid2.SelectedRowIDArray.Any())
|
||||
{
|
||||
BindMaterialDetail();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1066,7 +960,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
Grid3.DataSource = null;
|
||||
Grid3.DataBind();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1288,26 +1181,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
return new HashSet<string>(GetTaskableWeldJointRows(weldJointIds).Select(x => x.WeldJointId));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取指定管线范围内的优先匹配焊口集合。
|
||||
/// </summary>
|
||||
/// <param name="selectedPipelineIds">管线ID列表。</param>
|
||||
/// <returns>管线ID到优先焊口ID集合的映射。</returns>
|
||||
private Dictionary<string, HashSet<string>> GetPriorityWeldJointIds(List<string> selectedPipelineIds)
|
||||
{
|
||||
var result = new Dictionary<string, HashSet<string>>();
|
||||
var selectedPriority = priorityWeldJoints
|
||||
.Where(x => selectedPipelineIds.Contains(x.Key) && x.Value != null && x.Value.Any())
|
||||
.ToList();
|
||||
|
||||
foreach (var item in selectedPriority)
|
||||
{
|
||||
result[item.Key] = new HashSet<string>(item.Value);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断焊材钢号类别是否能覆盖母材类别。
|
||||
/// </summary>
|
||||
@@ -1338,21 +1211,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
return isCover;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 仓库切换后刷新当前仓库ID并重新加载左侧管线树。
|
||||
/// </summary>
|
||||
/// <param name="sender">事件源。</param>
|
||||
/// <param name="e">事件参数。</param>
|
||||
protected void drpWarehouse_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
WarehouseId = Base_WarehouseService.GetWarehouseList(this.CurrUser.LoginProjectId)
|
||||
.Where(x => x.WarehouseId == drpWarehouse.SelectedValue || x.WarehouseName == drpWarehouse.SelectedValue)
|
||||
.Select(x => x.WarehouseId)
|
||||
.FirstOrDefault();
|
||||
this.InitTreeMenu();//加载树
|
||||
}
|
||||
#endregion 按钮事件
|
||||
}
|
||||
}
|
||||
|
||||
+18
-18
@@ -140,15 +140,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnStatisticsMat;
|
||||
|
||||
/// <summary>
|
||||
/// btnrefresh 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnrefresh;
|
||||
|
||||
/// <summary>
|
||||
/// tvControlItem 控件。
|
||||
/// </summary>
|
||||
@@ -239,15 +230,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar3;
|
||||
|
||||
/// <summary>
|
||||
/// lbRate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label lbRate;
|
||||
|
||||
/// <summary>
|
||||
/// btnPriorityComponents 控件。
|
||||
/// </summary>
|
||||
@@ -257,6 +239,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnPriorityComponents;
|
||||
|
||||
/// <summary>
|
||||
/// btnMatchMat 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnMatchMat;
|
||||
|
||||
/// <summary>
|
||||
/// btnConfirmMaterialCode 控件。
|
||||
/// </summary>
|
||||
@@ -266,6 +257,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnConfirmMaterialCode;
|
||||
|
||||
/// <summary>
|
||||
/// btnClearMaterialCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnClearMaterialCode;
|
||||
|
||||
/// <summary>
|
||||
/// btnGenTask 控件。
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user