修改材料编码库导入功能,焊口台账增加焊接日期筛选
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user