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

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>