修改材料编码库导入功能,焊口台账增加焊接日期筛选

This commit is contained in:
2026-08-31 15:11:03 +08:00
parent ad6ef33ce2
commit ffb9c2a95c
9 changed files with 97 additions and 82 deletions
@@ -273,18 +273,36 @@ namespace BLL
/// </summary>
public static void SyncPipelineComponentByMatId(string pipeLineMatId)
{
if (string.IsNullOrEmpty(pipeLineMatId))
{
return;
}
var model_mat = BLL.PipelineMatService.GetPipeLineMat(pipeLineMatId);
if (model_mat == null || string.IsNullOrEmpty(model_mat.PipelineId))
{
return;
}
var PipelineId = model_mat.PipelineId;
var PipeArea = BLL.PipelineService.GetPipelineByPipelineId(PipelineId).PipeArea;
if (PipeArea == "1" && !string.IsNullOrEmpty(model_mat.PrefabricatedComponents))
var pipelineModel = BLL.PipelineService.GetPipelineByPipelineId(PipelineId);
if (pipelineModel == null)
{
return;
}
var PipeArea = pipelineModel.PipeArea;
if (PipeArea == PipelineService.PipeArea_SHOP && !string.IsNullOrEmpty(model_mat.PrefabricatedComponents))
{
// var model = GetPipelineComponentByMatId(pipeLineMatId);
var model = GetPipelineComponentByCodeandpipelineId(model_mat.PrefabricatedComponents, PipelineId);
// 组件号可能来自导入数据,未包含分隔符时直接使用原值,避免截取时报错。
var drawingName = GetDrawingNameByComponentCode(model_mat.PrefabricatedComponents);
if (model != null)
{
model.PipelineId = PipelineId;
model.PipelineComponentCode = model_mat.PrefabricatedComponents;
model.DrawingName = model_mat.PrefabricatedComponents.Substring(0, model_mat.PrefabricatedComponents.LastIndexOf('-')).Replace("\"", "");
model.DrawingName = drawingName;
model.State = State0;
model.ProductionState = 0;
UpdatePipelineComponent(model);
@@ -295,7 +313,7 @@ namespace BLL
model.PipelineComponentId = SQLHelper.GetNewID();
model.PipelineId = PipelineId;
model.PipelineComponentCode = model_mat.PrefabricatedComponents;
model.DrawingName = model_mat.PrefabricatedComponents?.Substring(0, model_mat.PrefabricatedComponents.LastIndexOf('-')).Replace("\"", "");
model.DrawingName = drawingName;
model.State = State0;
model.ProductionState = 0;
model.IsPrint = false;
@@ -308,6 +326,19 @@ namespace BLL
}
private static string GetDrawingNameByComponentCode(string pipelineComponentCode)
{
if (string.IsNullOrEmpty(pipelineComponentCode))
{
return string.Empty;
}
int splitIndex = pipelineComponentCode.LastIndexOf('-');
string drawingName = splitIndex > 0 ? pipelineComponentCode.Substring(0, splitIndex) : pipelineComponentCode;
return drawingName.Replace("\"", "");
}
/// <summary>
/// 添加管线预制组件
/// </summary>
@@ -510,7 +510,8 @@ namespace BLL
baseQuery = baseQuery.Where(x => x.WeldJointCode.Contains(model.WeldJointCode));
if (!string.IsNullOrEmpty(model.IsWeldOK))
baseQuery = baseQuery.Where(x => x.IsWeldOK == model.IsWeldOK);
if (!string.IsNullOrEmpty(model.WeldingDate))
baseQuery = baseQuery.Where(x => x.WeldingDate == model.WeldingDate);
// 阶段三:排序与分页控制(索引优化关键)
var orderedQuery = baseQuery.OrderBy(x => x.PipelineCode).ThenBy(x => x.WeldJointCode);
@@ -235,6 +235,7 @@ namespace FineUIPro.Web.HJGL.BaseInfo
select new HJGL_MaterialCodeLib
{
MaterialCode = x.MaterialCode,
Code = x.MaterialCode,
MaterialDef = x.MaterialDef,
MaterialSpec = x.MaterialSpec,
MaterialUnit = x.MaterialUnit,
@@ -244,6 +245,7 @@ namespace FineUIPro.Web.HJGL.BaseInfo
}).DistinctBy(temp => new
{
temp.MaterialCode,
temp.Code,
temp.MaterialDef,
temp.MaterialSpec,
temp.MaterialUnit,
@@ -254,6 +256,7 @@ namespace FineUIPro.Web.HJGL.BaseInfo
select new HJGL_MaterialCodeLib
{
MaterialCode = x.MaterialCode,
Code = x.MaterialCode,
MaterialDef = x.MaterialDef,
MaterialSpec = x.MaterialSpec,
MaterialUnit = x.MaterialUnit,
@@ -263,6 +266,7 @@ namespace FineUIPro.Web.HJGL.BaseInfo
}).DistinctBy(temp => new
{
temp.MaterialCode,
temp.Code,
temp.MaterialDef,
temp.MaterialSpec,
temp.MaterialUnit,
@@ -58,7 +58,7 @@
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="焊口台账总览"
EnableCollapse="true" runat="server" BoxFlex="1" EnableColumnLines="true" DataKeyNames="WeldJointId"
ClicksToEdit="2" DataIDField="WeldJointId" AllowSorting="true" EnableCheckBoxSelect="true"
SortField="WeldJointCode" OnSort="Grid1_Sort" OnRowClick="Grid1_RowClick" EnableRowClickEvent="true"
SortField="WeldJointCode" OnSort="Grid1_Sort" EnableRowClickEvent="true"
OnPageIndexChange="Grid1_PageIndexChange" EnableTextSelection="True" AllowPaging="true" IsDatabasePaging="true" PageSize="15" >
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
@@ -73,6 +73,9 @@
<f:ListItem Text="已完成" Value="已完成" />
<f:ListItem Text="未完成" Value="未完成" />
</f:DropDownList>
<f:DatePicker ID="txtWeldingDate" runat="server" Label="焊接日期" LabelAlign="Right"
LabelWidth="90px" Width="220px" AutoShowClearIcon="true">
</f:DatePicker>
<f:ToolbarFill ID="ToolbarFill2" runat="server">
</f:ToolbarFill>
<f:Button ID="BtnAnalyse" Text="查询" Icon="SystemSearch"
@@ -384,6 +384,10 @@ namespace FineUIPro.Web.HJGL.InfoQuery
if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2)
{
model.UnitWorkId = this.tvControlItem.SelectedNodeID;
if (!string.IsNullOrEmpty(this.txtWeldingDate.Text.Trim()))
{
model.WeldingDate = this.txtWeldingDate.Text.Trim();
}
var list = BLL.WeldJointService.GetDataBymodel(model, Grid1.PageIndex, Grid1.PageSize);
Grid1.RecordCount = list.Total;
Grid1.DataSource = list.Data;
@@ -392,6 +396,10 @@ namespace FineUIPro.Web.HJGL.InfoQuery
else if (this.tvControlItem.SelectedNode.CommandName == "管线")
{
model.PipelineId = this.tvControlItem.SelectedNodeID;
if (!string.IsNullOrEmpty(this.txtWeldingDate.Text.Trim()))
{
model.WeldingDate = this.txtWeldingDate.Text.Trim();
}
var list = BLL.WeldJointService.GetViewWeldJointsBymodel(model);
View_HJGL_WeldJoint = list;
Grid1.RecordCount = list.Count;
@@ -1069,49 +1077,5 @@ namespace FineUIPro.Web.HJGL.InfoQuery
}
#endregion
protected void Grid1_RowClick(object sender, GridRowClickEventArgs e)
{
var Id = Grid1.SelectedRowIDArray;
List<string> weldjointcodes = new List<string>();
foreach (var item in Id)
{
var WeldJointCode = WeldJointService.GetViewWeldJointById(item).WeldJointCode;
weldjointcodes.Add("/" + WeldJointCode);
}
//var q = WeldJointService.GetViewWeldJointById(Grid1.SelectedRowID).PipelineCode;
//var pipecode = "/" + q;
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 = string.Join(",", weldjointcodes);
parameter3D.ButtonType = "2.1";
parameter3D.Crater_data = "1";
if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2)
{
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(tvControlItem.SelectedNodeID);
}
else if (this.tvControlItem.SelectedNode.CommandName == "管线")
{
var model = PipelineService.GetPipelineByPipelineId(tvControlItem.SelectedNodeID);
if (model != null && !string.IsNullOrEmpty(model.UnitWorkId))
{
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(model.UnitWorkId);
}
}
parameter3D.Transparency = colorModel.PipelineComplete;
parameter3D.Finished_color = colorModel.JointCompleteColor;
parameter3D.Incomplete_color = colorModel.JointNOCompleteColor;
//ctlAuditFlow.Url_item = BLL.Project_SysSetService.GetAvevaNetUrl_Item(this.CurrUser.LoginProjectId) + parameter3D.ModelName;
//ctlAuditFlow.data = parameter3D;
//ctlAuditFlow.BindData();
}
}
}
+13 -2
View File
@@ -7,10 +7,12 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HJGL.InfoQuery {
namespace FineUIPro.Web.HJGL.InfoQuery
{
public partial class JointQuery {
public partial class JointQuery
{
/// <summary>
/// form1 控件。
@@ -165,6 +167,15 @@ namespace FineUIPro.Web.HJGL.InfoQuery {
/// </remarks>
protected global::FineUIPro.DropDownList ddlWeldState;
/// <summary>
/// txtWeldingDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtWeldingDate;
/// <summary>
/// ToolbarFill2 控件。
/// </summary>
@@ -533,6 +533,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
else
{
var oldPipeLineMat = pipeLineMat.First();
item.PipeLineMatId = oldPipeLineMat.PipeLineMatId;
oldPipeLineMat.Number=item.Number;
oldPipeLineMat.MaterialCode2 = item.MaterialCode2;
if (!string.IsNullOrEmpty(item.MaterialCode))