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fHdjMHv#vsj+g)jr2ga1
zsv=8LtLGU6KsX>m!&$%N%-kTiKa=bjVo@rcG{%Npal`&IXZ9ioh3EbiRZfqHv1BES
z^MSxhAh+p2Y}ZM+xcy;96HBKFZ8tX|2Nr4CU@~Whl1)r*q*9{S-aWcXS(%7qCg68K
ztc(U1s9{+a>brfS=}NBiCw=SwU?y?NC9^JA|CiZl>dh&PtmIw2hiCa6e91$NHa#=i
z%JjVxdYtAhmagRdh3{gl1@p}xk0(5yCnf44JqlP>Bja%hVLsaF9Di`V&pFhvF@aoV
zQ6Y8TdvZxr3}|6%WMQkT;%I4PqkVs!EsW}whhcfkfPqgrxcV!DCEY&rR
z$qjcdL$AYhZ~HZerpmqGv;Yke7HpOVWEsxtBWpqzVR_%Yuc{%F$D_G1!uTjMm?}e+
z1;WuD6r@zBLf|_?8IncobH?<_%XdpKkyWv5==d?}YqIA(mH=_M6EIn_rw=pGz0NPEM}O=5TrvO4+5M9I)$X0$w|`LgfBJh!-ro!V
z@<;towf|804lETyGtYfRQ-#R`g4XnB&B|PwECyoZ;I;SkRKN7ej7-D@V1a4{}Z
-->
-
+
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx
index ff4b0ce8..46d743df 100644
--- a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx
+++ b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx
@@ -119,6 +119,10 @@
FieldType="String" HeaderText="预制组件" HeaderTextAlign="Center"
TextAlign="Left">
+
+
@@ -178,6 +182,10 @@
+
+
@@ -235,6 +243,10 @@
+
+
diff --git a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs
index 36f6deb8..c4889bdc 100644
--- a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs
+++ b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs
@@ -195,7 +195,7 @@ namespace FineUIPro.Web.HJGL.DataImport
return (from x in Funs.DB.HJGL_Pipeline
join y in Funs.DB.PTP_PipelineList on x.PipelineId equals y.PipelineId
join z in Funs.DB.PTP_TestPackage on y.PTP_ID equals z.PTP_ID
- join m in Funs.DB.HJGL_PipeLineMat.Where(e => e.MaterialCode.Contains(txtMaterialCode.Text.Trim()))
+ join m in Funs.DB.HJGL_PipeLineMat.Where(e => (e.MaterialCode != null && e.MaterialCode.Contains(txtMaterialCode.Text.Trim())) || (e.MaterialCode2 != null && e.MaterialCode2.Contains(txtMaterialCode.Text.Trim())))
on x.PipelineId equals m.PipelineId into temp
from m in temp.DefaultIfEmpty()
where x.ProjectId == this.CurrUser.LoginProjectId
@@ -241,7 +241,7 @@ namespace FineUIPro.Web.HJGL.DataImport
{
return (from x in Funs.DB.HJGL_Pipeline
join y in Funs.DB.PTP_PipelineList on x.PipelineId equals y.PipelineId
- join m in Funs.DB.HJGL_PipeLineMat.Where(e => e.MaterialCode.Contains(txtMaterialCode.Text.Trim()))
+ join m in Funs.DB.HJGL_PipeLineMat.Where(e => (e.MaterialCode != null && e.MaterialCode.Contains(txtMaterialCode.Text.Trim())) || (e.MaterialCode2 != null && e.MaterialCode2.Contains(txtMaterialCode.Text.Trim())))
on x.PipelineId equals m.PipelineId into temp
from m in temp.DefaultIfEmpty()
where y.PTP_ID == ptpId
@@ -320,11 +320,18 @@ namespace FineUIPro.Web.HJGL.DataImport
///
private void BindGrid1(string pipelineId, string unitworkid)
{
- string strSql = @" SELECT pipe.PipeLineMatId, lib.MaterialCode,lib.Code,lib.HeatNo,lib.BatchNo,lib.MaterialName,lib.MaterialUnit,
- lib.MaterialSpec,lib.MaterialMade,lib.MaterialDef,pipe.Number,pipe.PrefabricatedComponents
+ string strSql = @" SELECT pipe.PipeLineMatId, pipe.MaterialCode,ISNULL(pipe.MaterialCode2, lib.Code) AS Code,lib.HeatNo,lib.BatchNo,
+ 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,
+ pipe.Number,pipe.PrefabricatedComponents,weld.WeldJointCode
FROM dbo.HJGL_PipeLineMat pipe
LEFT JOIN dbo.HJGL_MaterialCodeLib lib ON lib.MaterialCode = pipe.MaterialCode
LEFT JOIN HJGL_Pipeline line ON pipe.PipelineId=line.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
+ LEFT JOIN dbo.HJGL_WeldJoint weld ON weld.WeldJointId = pipe.WeldJointId
WHERE line.UnitWorkId=@UnitWorkId and line.PipeArea='1' and pipe.PrefabricatedComponents !='' ";
List listStr = new List();
//if (!string.IsNullOrEmpty(txtMaterialCode.Text.Trim()))
@@ -340,7 +347,7 @@ namespace FineUIPro.Web.HJGL.DataImport
}
if (!string.IsNullOrEmpty(txtMaterialCode2.Text.Trim()))
{
- strSql += " and lib.MaterialCode like @MaterialCode ";
+ strSql += " and (pipe.MaterialCode2 like @MaterialCode or lib.MaterialCode like @MaterialCode or lib.Code like @MaterialCode) ";
listStr.Add(new SqlParameter("@MaterialCode", "%" + txtMaterialCode2.Text.Trim() + "%"));
}
@@ -355,11 +362,18 @@ namespace FineUIPro.Web.HJGL.DataImport
}
private void BindGrid2(string pipelineId, string unitworkid)
{
- string strSql = @" SELECT pipe.PipeLineMatId, lib.MaterialCode,lib.Code,lib.HeatNo,lib.BatchNo,lib.MaterialName,lib.MaterialUnit,
- lib.MaterialSpec,lib.MaterialMade,lib.MaterialDef,pipe.Number
+ string strSql = @" SELECT pipe.PipeLineMatId, pipe.MaterialCode,ISNULL(pipe.MaterialCode2, lib.Code) AS Code,lib.HeatNo,lib.BatchNo,
+ 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,
+ pipe.Number,weld.WeldJointCode
FROM dbo.HJGL_PipeLineMat pipe
LEFT JOIN dbo.HJGL_MaterialCodeLib lib ON lib.MaterialCode = pipe.MaterialCode
LEFT JOIN HJGL_Pipeline line ON pipe.PipelineId=line.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
+ LEFT JOIN dbo.HJGL_WeldJoint weld ON weld.WeldJointId = pipe.WeldJointId
WHERE line.UnitWorkId=@UnitWorkId and line.PipeArea='2' ";
List listStr = new List();
if (!string.IsNullOrEmpty(pipelineId))
@@ -370,7 +384,7 @@ namespace FineUIPro.Web.HJGL.DataImport
}
if (!string.IsNullOrEmpty(txtMaterialCode2.Text.Trim()))
{
- strSql += " and lib.MaterialCode like @MaterialCode ";
+ strSql += " and (pipe.MaterialCode2 like @MaterialCode or lib.MaterialCode like @MaterialCode or lib.Code like @MaterialCode) ";
listStr.Add(new SqlParameter("@MaterialCode", "%" + txtMaterialCode2.Text.Trim() + "%"));
}
@@ -386,11 +400,18 @@ namespace FineUIPro.Web.HJGL.DataImport
private void BindGrid3(string pipelineId, string unitworkid)
{
- string strSql = @" SELECT pipe.PipeLineMatId, lib.MaterialCode,lib.Code,lib.HeatNo,lib.BatchNo,lib.MaterialName,lib.MaterialUnit,
- lib.MaterialSpec,lib.MaterialMade,lib.MaterialDef,pipe.Number,pipe.PrefabricatedComponents
+ string strSql = @" SELECT pipe.PipeLineMatId, pipe.MaterialCode,ISNULL(pipe.MaterialCode2, lib.Code) AS Code,lib.HeatNo,lib.BatchNo,
+ 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,
+ pipe.Number,pipe.PrefabricatedComponents,weld.WeldJointCode
FROM dbo.HJGL_PipeLineMat pipe
LEFT JOIN dbo.HJGL_MaterialCodeLib lib ON lib.MaterialCode = pipe.MaterialCode
LEFT JOIN HJGL_Pipeline line ON pipe.PipelineId=line.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
+ LEFT JOIN dbo.HJGL_WeldJoint weld ON weld.WeldJointId = pipe.WeldJointId
WHERE line.UnitWorkId=@UnitWorkId and line.PipeArea='1' and (pipe.PrefabricatedComponents is null or pipe.PrefabricatedComponents='') ";
List listStr = new List();
//if (!string.IsNullOrEmpty(txtMaterialCode.Text.Trim()))
@@ -406,7 +427,7 @@ namespace FineUIPro.Web.HJGL.DataImport
}
if (!string.IsNullOrEmpty(txtMaterialCode2.Text.Trim()))
{
- strSql += " and lib.MaterialCode like @MaterialCode ";
+ strSql += " and (pipe.MaterialCode2 like @MaterialCode or lib.MaterialCode like @MaterialCode or lib.Code like @MaterialCode) ";
listStr.Add(new SqlParameter("@MaterialCode", "%" + txtMaterialCode2.Text.Trim() + "%"));
}
diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineMatIn.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineMatIn.aspx.cs
index 719ec24c..34e12ba8 100644
--- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineMatIn.aspx.cs
+++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineMatIn.aspx.cs
@@ -138,7 +138,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
Model.ResponeData responeData = new Model.ResponeData();
List result = new List();
- if (count < 6)
+ if (count < 5)
{
responeData.code = 0;
responeData.message = "导入Excel格式错误!Excel只有" + count.ToString().Trim() + "列";
@@ -182,43 +182,48 @@ namespace FineUIPro.Web.HJGL.WeldingManage
if (pds[i].C != null && !string.IsNullOrEmpty(pds[i].C.ToString()))
{
- string materialCode = pds[i].C.ToString().Trim();
- string furnaceNo = pds[i].D == null ? string.Empty : pds[i].D.ToString().Trim();
- string batchNo = pds[i].E == null ? string.Empty : pds[i].E.ToString().Trim();
- if (pds[i].D == null || string.IsNullOrEmpty(pds[i].D.ToString()))
+ if (!string.IsNullOrEmpty(item.PipelineId))
{
- result.Add((i + 2) + "Line, [炉号] 不能为空");
- }
- if (pds[i].E == null || string.IsNullOrEmpty(pds[i].E.ToString()))
- {
- result.Add((i + 2) + "Line, [批号] 不能为空");
- }
- if (!string.IsNullOrEmpty(materialCode) && !string.IsNullOrEmpty(furnaceNo) && !string.IsNullOrEmpty(batchNo))
- {
- string fullMaterialCode = materialCode + "-" + furnaceNo + "-" + batchNo;
- var lib = from x in Funs.DB.HJGL_MaterialCodeLib where x.MaterialCode == fullMaterialCode select x;
- if (lib.Count() > 0)
+ string weldJointCode = pds[i].C.ToString().Trim();
+ var weldJoint = BLL.WeldJointService.GetWeldJointsByWeldJointCode(item.PipelineId, weldJointCode);
+ if (weldJoint != null)
{
- item.MaterialCode = fullMaterialCode;
+ item.WeldJointId = weldJoint.WeldJointId;
}
else
{
- result.Add("不存在此材料:" + fullMaterialCode);
-
+ result.Add("第" + (i + 2).ToString() + "行,当前管线不存在此焊口号-" + weldJointCode + "");
}
}
+ }
+ else
+ {
+ result.Add((i + 2) + "Line, [焊口号] 不能为空");
+ }
+ if (pds[i].D != null && !string.IsNullOrEmpty(pds[i].D.ToString()))
+ {
+ string materialCode = pds[i].D.ToString().Trim();
+ var lib = from x in Funs.DB.HJGL_MaterialCodeLib where x.Code == materialCode select x;
+ if (lib.Count() > 0)
+ {
+ item.MaterialCode2 = materialCode;
+ }
+ else
+ {
+ result.Add("第" + (i + 2).ToString() + "行,材料编码库不存在此材料编码-" + materialCode + "");
+ }
}
else
{
result.Add((i + 2) + "Line, [材料编码] 不能为空");
}
- if (pds[i].F != null && !string.IsNullOrEmpty(pds[i].F.ToString()))
+ if (pds[i].E != null && !string.IsNullOrEmpty(pds[i].E.ToString()))
{
try
{
- var number = Funs.GetNewDecimal(pds[i].F.ToString());
+ var number = Funs.GetNewDecimal(pds[i].E.ToString());
item.Number = number;
}
catch (Exception)
@@ -247,7 +252,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
// result.Add((i + 2) + "Line, [预制组件] 不能为空");
}
}
- var model = matList.Where(x => x.PipelineId == item.PipelineId && x.MaterialCode == item.MaterialCode && x.PrefabricatedComponents == item.PrefabricatedComponents);
+ var model = matList.Where(x => x.PipelineId == item.PipelineId && x.MaterialCode2 == item.MaterialCode2 && x.WeldJointId == item.WeldJointId && x.PrefabricatedComponents == item.PrefabricatedComponents);
if (model.Count() == 0)
{
matList.Add(item);
@@ -478,7 +483,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
foreach (var item in matList)
{
- var pipeLineMat = from x in Funs.DB.HJGL_PipeLineMat where x.MaterialCode == item.MaterialCode && x.PipelineId == item.PipelineId && x.PrefabricatedComponents == item.PrefabricatedComponents select x;
+ var pipeLineMat = from x in Funs.DB.HJGL_PipeLineMat
+ where x.MaterialCode2 == item.MaterialCode2
+ && x.WeldJointId == item.WeldJointId
+ && x.PipelineId == item.PipelineId
+ && x.PrefabricatedComponents == item.PrefabricatedComponents
+ select x;
if (pipeLineMat.Count() == 0 || pipeLineMat == null)
{
item.PipeLineMatId = SQLHelper.GetNewID(typeof(Model.HJGL_PipeLineMat));
@@ -486,7 +496,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
else
{
- item.PipeLineMatId = pipeLineMat.First().PipeLineMatId;
+ var oldPipeLineMat = pipeLineMat.First();
+ item.PipeLineMatId = oldPipeLineMat.PipeLineMatId;
+ if (string.IsNullOrEmpty(item.MaterialCode))
+ {
+ item.MaterialCode = oldPipeLineMat.MaterialCode;
+ }
BLL.PipelineMatService.UpdatePipeLineMat(item);
}
BLL.HJGL_PipelineComponentService.SyncPipelineComponentByMatId(item.PipeLineMatId);
diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx
index e49f353f..edfe3aae 100644
--- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx
+++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx
@@ -27,16 +27,19 @@
}
.f-grid-row.red {
- background-color: red;
+ color: red;
+ font-weight: bold;
}
.f-grid-row.green {
- background-color: green;
+ color: green;
+ font-weight: bold;
}
.f-grid-row.priority {
- background-color: #1e88e5;
+ /* background-color: #1e88e5;*/
color: #fff;
+ font-weight: bold;
}
.f-grid-row {
@@ -143,10 +146,12 @@
-
-
+
+
-
+
+
+
@@ -181,7 +186,7 @@
@@ -193,10 +198,18 @@
FieldType="String" HeaderText="预制组件号" HeaderTextAlign="Center"
TextAlign="Left">
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs
index 884a1bb0..b188911d 100644
--- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs
+++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs
@@ -70,21 +70,21 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
}
- public Dictionary> priorityComponents
+ public Dictionary> priorityWeldJoints
{
get
{
- var value = ViewState["priorityComponents"] as Dictionary>;
+ var value = ViewState["priorityWeldJoints"] as Dictionary>;
if (value == null)
{
value = new Dictionary>();
- ViewState["priorityComponents"] = value;
+ ViewState["priorityWeldJoints"] = value;
}
return value;
}
set
{
- ViewState["priorityComponents"] = value;
+ ViewState["priorityWeldJoints"] = value;
}
}
@@ -104,7 +104,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
; HJGL_MaterialService.materialStockItems_FIELD = new List();
HJGL_MaterialService.materialStockItems_SHOP = new List();
dicSeclectPipeLine = new Dictionary();
- priorityComponents = new Dictionary>();
+ priorityWeldJoints = new Dictionary>();
var pipeline = (from x in Funs.DB.HJGL_Pipeline
where x.ProjectId == this.CurrUser.LoginProjectId
select x.FlowingSection).Distinct().ToList();
@@ -377,14 +377,25 @@ namespace FineUIPro.Web.HJGL.WeldingManage
#region 数据绑定
private void BindGrid()
{
- string strSql = @"SELECT lib.MaterialCode,lib.MaterialName,lib.MaterialUnit,
- lib.MaterialSpec,lib.MaterialMade,lib.MaterialDef,sum(pipe.Number)as Number ,
+ 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 lib.MaterialCode,lib.MaterialName,lib.MaterialUnit,
- lib.MaterialSpec,lib.MaterialMade,lib.MaterialDef ";
+ 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 listStr = new List();
listStr.Add(new SqlParameter("@PipelineId", this.tvControlItem.SelectedNodeID));
SqlParameter[] parameter = listStr.ToArray();
@@ -394,7 +405,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
Grid1.DataSource = dt;
Grid1.DataBind();
}
- void BindGrid2()
+ void BindGrid2(IEnumerable keepSelectedPipelineIds = null)
{
//var result = tw_PipeMatMatchOutputs
// .GroupBy(item => new { item.PipelineId, item.PipelineCode,item.UnitWorkName }) // 按 PipelineId 和 PipelineCode 分组
@@ -424,6 +435,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
Rate = Math.Round((decimal)output.Average(item => item.MatchRate) * 100, 2);
lbRate.Text = "匹配率:" + Rate.ToString() + "%";
}*/
+ var keepSelectedList = keepSelectedPipelineIds == null ? new List() : keepSelectedPipelineIds.Where(x => !string.IsNullOrEmpty(x)).Distinct().ToList();
var selectList = new List();
for (int i = 0; i < Grid2.Rows.Count; i++)
{
@@ -443,7 +455,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
if (cbSelectCom.Checked)
{
- Grid2.SelectedRowIDArray = selectList.ToArray();
+ selectList.AddRange(keepSelectedList);
+ Grid2.SelectedRowIDArray = selectList.Distinct().ToArray();
+ }
+ else if (keepSelectedList.Any())
+ {
+ Grid2.SelectedRowIDArray = keepSelectedList.ToArray();
}
}
@@ -486,7 +503,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage
private void BindMaterialDetail(string pipelineId)
{
- var tb = tw_PipeMatMatchOutputs.Where(x => x.PipelineId == pipelineId).ToList();
+ var tb = GetNoTaskMaterialDetails()
+ .Where(x => x.PipelineId == pipelineId)
+ .ToList();
Grid1.DataSource = tb;
Grid1.DataBind();
@@ -499,7 +518,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
continue;
}
- if (IsPriorityComponent(model.PipelineId, model.PrefabricatedComponents))
+ if (IsPriorityWeldJoint(model.PipelineId, model.WeldJointId))
{
Grid1.Rows[i].RowCssClass = "priority";
selectList.Add(model.Id);
@@ -513,30 +532,54 @@ namespace FineUIPro.Web.HJGL.WeldingManage
Grid1.SelectedRowIDArray = selectList.ToArray();
}
- private bool IsPriorityComponent(string pipelineId, string prefabricatedComponents)
+ private List GetNoTaskMaterialDetails()
{
- return !string.IsNullOrEmpty(pipelineId)
- && !string.IsNullOrEmpty(prefabricatedComponents)
- && priorityComponents.ContainsKey(pipelineId)
- && priorityComponents[pipelineId].Contains(prefabricatedComponents);
+ var matchOutputs = tw_PipeMatMatchOutputs ?? new List();
+ var weldJointIds = matchOutputs
+ .Where(x => !string.IsNullOrEmpty(x.WeldJointId))
+ .Select(x => x.WeldJointId)
+ .Distinct()
+ .ToList();
+ if (!weldJointIds.Any())
+ {
+ return matchOutputs;
+ }
+
+ var taskWeldJointIds = Funs.DB.HJGL_WeldTask
+ .Where(x => weldJointIds.Contains(x.WeldJointId))
+ .Select(x => x.WeldJointId)
+ .Distinct()
+ .ToList();
+ return matchOutputs
+ .Where(x => string.IsNullOrEmpty(x.WeldJointId) || !taskWeldJointIds.Contains(x.WeldJointId))
+ .ToList();
}
- private Dictionary> GetPriorityComponentList()
+ private bool IsPriorityWeldJoint(string pipelineId, string weldJointId)
{
- return priorityComponents
+ return !string.IsNullOrEmpty(pipelineId)
+ && !string.IsNullOrEmpty(weldJointId)
+ && priorityWeldJoints.ContainsKey(pipelineId)
+ && priorityWeldJoints[pipelineId].Contains(weldJointId);
+ }
+
+ private Dictionary> GetPriorityWeldJointList()
+ {
+ return priorityWeldJoints
.Where(x => x.Value != null && x.Value.Any())
.ToDictionary(x => x.Key, x => x.Value.ToList());
}
private void RefreshMatchResult()
{
+ var keepSelectedPipelineIds = Grid2.SelectedRowIDArray == null ? new List() : Grid2.SelectedRowIDArray.ToList();
tw_PipeMatMatchOutputs = TwArrivalStatisticsService.GetPipeMatMatch(
this.CurrUser.LoginProjectId,
dicSeclectPipeLine.Keys.ToList(),
drpWarehouse.SelectedValue,
- GetPriorityComponentList());
+ GetPriorityWeldJointList());
BindGrid3();
- BindGrid2();
+ BindGrid2(keepSelectedPipelineIds);
}
protected void Grid2_RowClick(object sender, GridRowClickEventArgs e)
@@ -692,7 +735,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
foreach (string rowId in Grid3.SelectedRowIDArray)
{
dicSeclectPipeLine.Remove(rowId);
- priorityComponents.Remove(rowId);
+ priorityWeldJoints.Remove(rowId);
var node = tvControlItem.FindNode(rowId);
if (node != null)
{
@@ -713,38 +756,85 @@ namespace FineUIPro.Web.HJGL.WeldingManage
return;
}
- var selectedComponents = new HashSet();
+ var selectedWeldJoints = new HashSet();
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
- if (Grid1.DataKeys[rowIndex].Length < 3)
+ if (Grid1.DataKeys[rowIndex].Length < 4)
{
continue;
}
string pipelineId = Grid1.DataKeys[rowIndex][1]?.ToString();
- string componentCode = Grid1.DataKeys[rowIndex][2]?.ToString();
- if (pipelineId == selectedPipelineId && !string.IsNullOrEmpty(componentCode))
+ string weldJointId = Grid1.DataKeys[rowIndex][3]?.ToString();
+ if (pipelineId == selectedPipelineId && !string.IsNullOrEmpty(weldJointId))
{
- selectedComponents.Add(componentCode);
+ selectedWeldJoints.Add(weldJointId);
}
}
- if (selectedComponents.Any())
+ if (selectedWeldJoints.Any())
{
- priorityComponents[selectedPipelineId] = selectedComponents;
+ priorityWeldJoints[selectedPipelineId] = selectedWeldJoints;
}
else
{
- priorityComponents.Remove(selectedPipelineId);
+ priorityWeldJoints.Remove(selectedPipelineId);
}
+ var keepSelectedPipelineIds = Grid2.SelectedRowIDArray == null ? new List() : Grid2.SelectedRowIDArray.ToList();
+ if (!keepSelectedPipelineIds.Contains(selectedPipelineId))
+ {
+ keepSelectedPipelineIds.Add(selectedPipelineId);
+ }
RefreshMatchResult();
+ Grid2.SelectedRowIDArray = keepSelectedPipelineIds.Distinct().ToArray();
BindMaterialDetail(selectedPipelineId);
}
+ protected void btnConfirmMaterialCode_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 matchedMaterials = tw_PipeMatMatchOutputs
+ .Where(x => selectedPipelineIds.Contains(x.PipelineId))
+ .ToList();
+ if (!matchedMaterials.Any())
+ {
+ ShowNotify("未找到保存的材料匹配明细!", MessageBoxIcon.Warning);
+ 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());
+ }
+ }
+
protected void btnGenTask_Click(object sender, EventArgs e)
{
- if (Grid2.SelectedRowIDArray.Count() > 0)
+ if (GetSelectedWeldJointIdsFromGrid1().Any())
{
if (SaveTask())
{
@@ -760,23 +850,30 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
else
{
- ShowNotify("请先选择需要发起任单的管线!", MessageBoxIcon.Warning);
+ ShowNotify("请先在材料匹配明细中选择需要生成任务单的焊口!", MessageBoxIcon.Warning);
}
}
private bool SaveTask()
{
+ var selectedWeldJointIds = GetSelectedWeldJointIdsFromGrid1();
+ if (!selectedWeldJointIds.Any())
+ {
+ ShowNotify("请先在材料匹配明细中选择需要生成任务单的焊口!", MessageBoxIcon.Warning);
+ return false;
+ }
var weldingRods = from x in Funs.DB.Base_Consumables where x.ConsumablesType == "2" select x;
var weldingWires = from x in Funs.DB.Base_Consumables where x.ConsumablesType == "1" select x;
+ var selectedWeldJointIdList = selectedWeldJointIds.ToList();
var selectRowId = (from x in Funs.DB.View_HJGL_NoWeldJointFind
- where Grid2.SelectedRowIDArray.ToList().Contains(x.PipelineId) && x.WeldingDailyId == null &&
+ where selectedWeldJointIdList.Contains(x.WeldJointId) && x.WeldingDailyId == null &&
x.WeldTaskId == null && x.WeldingMethodCode != null
select x).ToList();
Dictionary unitworkTaskCode = new Dictionary();
Dictionary unitworkSerialNumber = new Dictionary();
Dictionary matchPipeline = new Dictionary();
- foreach (var rowIndex in Grid2.SelectedRowIndexArray)
+ for (int rowIndex = 0; rowIndex < Grid2.Rows.Count; rowIndex++)
{
matchPipeline.Add(rowIndex + 1, Grid2.Rows[rowIndex].RowID);
}
@@ -784,16 +881,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
selectRowId = selectRowId.Where(x => x.JointAttribute == "预制口").ToList();
}
- var priorityWeldJointIds = GetPriorityWeldJointIds(Grid2.SelectedRowIDArray.ToList());
- if (priorityWeldJointIds.Any())
- {
- if (priorityWeldJointIds.Any(x => !x.Value.Any()))
- {
- ShowNotify("选中组件未找到关联焊口,无法按组件生成任务单!", MessageBoxIcon.Warning);
- return false;
- }
- selectRowId = selectRowId.Where(x => !priorityWeldJointIds.ContainsKey(x.PipelineId) || priorityWeldJointIds[x.PipelineId].Contains(x.WeldJointId)).ToList();
- }
if (!selectRowId.Any())
{
ShowNotify("未找到可生成任务单的焊口!", MessageBoxIcon.Warning);
@@ -909,28 +996,41 @@ namespace FineUIPro.Web.HJGL.WeldingManage
return true;
}
+ private HashSet GetSelectedWeldJointIdsFromGrid1()
+ {
+ var selectedWeldJointIds = new HashSet();
+ if (Grid1.SelectedRowIndexArray == null)
+ {
+ return selectedWeldJointIds;
+ }
+
+ foreach (int rowIndex in Grid1.SelectedRowIndexArray)
+ {
+ if (Grid1.DataKeys[rowIndex].Length < 4)
+ {
+ continue;
+ }
+
+ string weldJointId = Grid1.DataKeys[rowIndex][3]?.ToString();
+ if (!string.IsNullOrEmpty(weldJointId))
+ {
+ selectedWeldJointIds.Add(weldJointId);
+ }
+ }
+
+ return selectedWeldJointIds;
+ }
+
private Dictionary> GetPriorityWeldJointIds(List selectedPipelineIds)
{
var result = new Dictionary>();
- var selectedPriority = priorityComponents
+ var selectedPriority = priorityWeldJoints
.Where(x => selectedPipelineIds.Contains(x.Key) && x.Value != null && x.Value.Any())
.ToList();
foreach (var item in selectedPriority)
{
- string pipelineId = item.Key;
- var componentCodes = item.Value.ToList();
- var weldJointIds = (from joint in Funs.DB.HJGL_Pipeline_ComponentJoint
- join weldJoint in Funs.DB.HJGL_WeldJoint on joint.WeldJointId equals weldJoint.WeldJointId
- join component in Funs.DB.HJGL_Pipeline_Component on joint.PipelineComponentId equals component.PipelineComponentId into componentJoin
- from componentItem in componentJoin.DefaultIfEmpty()
- where joint.WeldJointId != null
- && weldJoint.PipelineId == pipelineId
- && ((componentItem != null && componentCodes.Contains(componentItem.PipelineComponentCode))
- || componentCodes.Contains(joint.PipelineComponentCode))
- select joint.WeldJointId).Distinct().ToList();
-
- result[pipelineId] = new HashSet(weldJointIds);
+ result[item.Key] = new HashSet(item.Value);
}
return result;
diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.designer.cs
index 1095bf1c..d66e65e6 100644
--- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.designer.cs
@@ -266,6 +266,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage
///
protected global::FineUIPro.Button btnPriorityComponents;
+ ///
+ /// btnConfirmMaterialCode 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnConfirmMaterialCode;
+
///
/// btnGenTask 控件。
///
diff --git a/SGGL/Model/CLGL/Tw_PipeMatMatchOutput.cs b/SGGL/Model/CLGL/Tw_PipeMatMatchOutput.cs
index eb058fda..63b6fa80 100644
--- a/SGGL/Model/CLGL/Tw_PipeMatMatchOutput.cs
+++ b/SGGL/Model/CLGL/Tw_PipeMatMatchOutput.cs
@@ -11,12 +11,16 @@ namespace Model
public class Tw_PipeMatMatchOutput
{
public string Id { get; set; }
+ public string PipeLineMatId { get; set; }
public string PipelineId { get; set; }
public string PipelineCode { get; set; }
public string UnitWorkId { get; set; }
public string UnitWorkName { get; set; }
public string PrefabricatedComponents { get; set; }
+ public string WeldJointId { get; set; }
+ public string WeldJointCode { get; set; }
public string MaterialCode { get; set; }
+ public string MatchMaterialCode { get; set; }
public string Code { get; set; }
public string HeatNo { get; set; }
public string BatchNo { get; set; }
diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs
index 8f3f6bdb..616c58fa 100644
--- a/SGGL/Model/Model.cs
+++ b/SGGL/Model/Model.cs
@@ -105869,6 +105869,10 @@ namespace Model
private System.Nullable _IsLooseParts;
+ private string _WeldJointId;
+
+ private string _MaterialCode2;
+
private EntityRef _HJGL_MaterialCodeLib;
private EntityRef _HJGL_Pipeline;
@@ -105889,6 +105893,10 @@ namespace Model
partial void OnPrefabricatedComponentsChanged();
partial void OnIsLoosePartsChanging(System.Nullable value);
partial void OnIsLoosePartsChanged();
+ partial void OnWeldJointIdChanging(string value);
+ partial void OnWeldJointIdChanged();
+ partial void OnMaterialCode2Changing(string value);
+ partial void OnMaterialCode2Changed();
#endregion
public HJGL_PipeLineMat()
@@ -106026,6 +106034,46 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WeldJointId", DbType="NVarChar(50)")]
+ public string WeldJointId
+ {
+ get
+ {
+ return this._WeldJointId;
+ }
+ set
+ {
+ if ((this._WeldJointId != value))
+ {
+ this.OnWeldJointIdChanging(value);
+ this.SendPropertyChanging();
+ this._WeldJointId = value;
+ this.SendPropertyChanged("WeldJointId");
+ this.OnWeldJointIdChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode2", DbType="NVarChar(50)")]
+ public string MaterialCode2
+ {
+ get
+ {
+ return this._MaterialCode2;
+ }
+ set
+ {
+ if ((this._MaterialCode2 != value))
+ {
+ this.OnMaterialCode2Changing(value);
+ this.SendPropertyChanging();
+ this._MaterialCode2 = value;
+ this.SendPropertyChanged("MaterialCode2");
+ this.OnMaterialCode2Changed();
+ }
+ }
+ }
+
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_HJGL_PipeLineMat_HJGL_MaterialCodeLib", Storage="_HJGL_MaterialCodeLib", ThisKey="MaterialCode", OtherKey="MaterialCode", IsForeignKey=true)]
public HJGL_MaterialCodeLib HJGL_MaterialCodeLib
{
@@ -277039,6 +277087,8 @@ namespace Model
private System.Nullable _Number;
+ private string _WeldJointId;
+
#region 可扩展性方法定义
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
@@ -277055,6 +277105,8 @@ namespace Model
partial void OnPrefabricatedComponentsChanged();
partial void OnNumberChanging(System.Nullable value);
partial void OnNumberChanged();
+ partial void OnWeldJointIdChanging(string value);
+ partial void OnWeldJointIdChanged();
#endregion
public Tw_InOutPlanDetail_Relation()
@@ -277182,6 +277234,26 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WeldJointId", DbType="NVarChar(50)")]
+ public string WeldJointId
+ {
+ get
+ {
+ return this._WeldJointId;
+ }
+ set
+ {
+ if ((this._WeldJointId != value))
+ {
+ this.OnWeldJointIdChanging(value);
+ this.SendPropertyChanging();
+ this._WeldJointId = value;
+ this.SendPropertyChanged("WeldJointId");
+ this.OnWeldJointIdChanged();
+ }
+ }
+ }
+
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;