包装管理修改
This commit is contained in:
@@ -85,6 +85,95 @@ namespace BLL
|
||||
return Funs.DB.HJGL_Pipeline_Component.FirstOrDefault(e => e.PipeLineMatId == pipeLineMatId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取预制散件
|
||||
/// </summary>
|
||||
/// <param name="unitworkId">单位工程Id</param>
|
||||
/// <param name="pipelineId">管线Id</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<PipelinePrefabricatedComponentsItem> GetPipelinePrefabricatedComponent(string unitworkId, string pipelineId)
|
||||
{
|
||||
var query = from pipe in Funs.DB.HJGL_PipeLineMat
|
||||
join lib in Funs.DB.HJGL_MaterialCodeLib on pipe.MaterialCode equals lib.MaterialCode into libJoin
|
||||
from libItem in libJoin.DefaultIfEmpty()
|
||||
join line in Funs.DB.HJGL_Pipeline on pipe.PipelineId equals line.PipelineId into lineJoin
|
||||
from lineItem in lineJoin.DefaultIfEmpty()
|
||||
where lineItem != null && lineItem.UnitWorkId == unitworkId && lineItem.PipeArea == "1"
|
||||
&& (pipe.PrefabricatedComponents == null || pipe.PrefabricatedComponents == "")
|
||||
select new PipelinePrefabricatedComponentsItem
|
||||
{
|
||||
Id = pipe.PipeLineMatId,
|
||||
MaterialCode = libItem.MaterialCode,
|
||||
MaterialName = libItem.MaterialName,
|
||||
MaterialUnit = libItem.MaterialUnit,
|
||||
MaterialSpec = libItem.MaterialSpec,
|
||||
MaterialMade = libItem.MaterialMade,
|
||||
MaterialDef = libItem.MaterialDef,
|
||||
Number = pipe.Number,
|
||||
PrefabricatedComponents = pipe.PrefabricatedComponents,
|
||||
PipelineId = lineItem.PipelineId,
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(pipelineId))
|
||||
{
|
||||
query = query.Where(x => x.PipelineId == pipelineId);
|
||||
}
|
||||
|
||||
query = query.OrderBy(x => x.PrefabricatedComponents);
|
||||
|
||||
|
||||
return query.ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取预制散件
|
||||
/// </summary>
|
||||
/// <param name="pipelineId">管线Id</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<PipelinePrefabricatedComponentsItem> GetPipelinePrefabricatedComponent(string pipelineId)
|
||||
{
|
||||
var query = from pipe in Funs.DB.HJGL_PipeLineMat
|
||||
join lib in Funs.DB.HJGL_MaterialCodeLib on pipe.MaterialCode equals lib.MaterialCode into libJoin
|
||||
from libItem in libJoin.DefaultIfEmpty()
|
||||
join line in Funs.DB.HJGL_Pipeline on pipe.PipelineId equals line.PipelineId into lineJoin
|
||||
from lineItem in lineJoin.DefaultIfEmpty()
|
||||
where lineItem != null && lineItem.PipeArea == "1"
|
||||
&& (pipe.PrefabricatedComponents == null || pipe.PrefabricatedComponents == "")
|
||||
select new PipelinePrefabricatedComponentsItem
|
||||
{
|
||||
Id = pipe.PipeLineMatId,
|
||||
MaterialCode = libItem.MaterialCode,
|
||||
MaterialName = libItem.MaterialName,
|
||||
MaterialUnit = libItem.MaterialUnit,
|
||||
MaterialSpec = libItem.MaterialSpec,
|
||||
MaterialMade = libItem.MaterialMade,
|
||||
MaterialDef = libItem.MaterialDef,
|
||||
Number = pipe.Number,
|
||||
PrefabricatedComponents = pipe.PrefabricatedComponents,
|
||||
PipelineId = lineItem.PipelineId,
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(pipelineId))
|
||||
{
|
||||
query = query.Where(x => x.PipelineId == pipelineId);
|
||||
}
|
||||
|
||||
query = query.OrderBy(x => x.PrefabricatedComponents);
|
||||
|
||||
var inoutplandetail = (from x in Funs.DB.HJGL_PackagingManageDetail
|
||||
where x.PipelineId == pipelineId
|
||||
&& (x.PipelineComponentId == null || x.PipelineComponentId == "")
|
||||
select x).ToList();
|
||||
var queryList = query.ToList();
|
||||
// 优化 Linq 过滤条件
|
||||
var result = (from x in queryList
|
||||
join y in inoutplandetail on x.MaterialCode equals y.MaterialCode into yy
|
||||
from y in yy.DefaultIfEmpty()
|
||||
where y == null
|
||||
select x).ToList();
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取打印实体
|
||||
/// </summary>
|
||||
@@ -92,8 +181,7 @@ namespace BLL
|
||||
/// <param name="PipelineId"></param>
|
||||
/// <param name="IsCheckPrint"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<PipelineComponentPrintDto> GetPrintModelByPipelineComponentIds(
|
||||
string[] PipelineComponentId, string[] PipelineId, bool IsCheckPrint)
|
||||
public static IEnumerable<PipelineComponentPrintDto> GetPrintModelByPipelineComponentIds(string[] PipelineComponentId, string[] PipelineId, bool IsCheckPrint)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
var query =
|
||||
@@ -154,9 +242,6 @@ namespace BLL
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 判断管线组件Code是否存在
|
||||
/// </summary>
|
||||
@@ -226,7 +311,7 @@ namespace BLL
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 添加作业管线
|
||||
/// 添加管线预制组件
|
||||
/// </summary>
|
||||
/// <param name="pipeline"></param>
|
||||
public static void AddPipelineComponent(Model.HJGL_Pipeline_Component pipeline)
|
||||
@@ -258,7 +343,7 @@ namespace BLL
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改作业管线
|
||||
/// 修改管线预制组件
|
||||
/// </summary>
|
||||
/// <param name="pipeline"></param>
|
||||
public static void UpdatePipelineComponent(Model.HJGL_Pipeline_Component pipeline)
|
||||
@@ -289,7 +374,7 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改出库状态
|
||||
/// 修改组件出库状态
|
||||
/// </summary>
|
||||
/// <param name="pipelineComponentId"></param>
|
||||
/// <param name="BoxNumber"></param>
|
||||
@@ -306,7 +391,7 @@ namespace BLL
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改打印状态
|
||||
/// 修改组件打印状态
|
||||
/// </summary>
|
||||
/// <param name="PipelineComponentId"></param>
|
||||
public static void UpdateIsPrint(string[] PipelineComponentId)
|
||||
@@ -324,7 +409,7 @@ namespace BLL
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改生产状态
|
||||
/// 修改组件生产状态
|
||||
/// </summary>
|
||||
/// <param name="pipelineComponentId"></param>
|
||||
/// <param name="BoxNumber"></param>
|
||||
@@ -358,7 +443,7 @@ namespace BLL
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据作业管线Id删除一个作业管线信息
|
||||
/// 根据管线组件Id删除一个管线组件信息
|
||||
/// </summary>
|
||||
/// <param name="pipelineId"></param>
|
||||
public static void DeletePipelineComponent(string pipelineComponentId)
|
||||
@@ -372,7 +457,7 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据管线材料id删除对应组件
|
||||
/// 根据管线组件id删除对应组件
|
||||
/// </summary>
|
||||
/// <param name="pipeLineMatId"></param>
|
||||
public static void DeletePipelineComponentByMatId(string pipeLineMatId)
|
||||
@@ -387,7 +472,7 @@ namespace BLL
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据管线id删除组件
|
||||
/// 根据管线组件id删除组件
|
||||
/// </summary>
|
||||
/// <param name="pipelineId"></param>
|
||||
public static void DeletePipelineComponentBypipelineId(string pipelineId)
|
||||
@@ -473,25 +558,4 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
public class PipelineComponentPrintDto
|
||||
|
||||
{
|
||||
public string PipelineComponentId { get; set; }
|
||||
public string PipelineComponentCode { get; set; }
|
||||
public string BoxNumber { get; set; }
|
||||
public string UnitWorkName { get; set; }
|
||||
public string PipelineId { get; set; }
|
||||
public string PreUnit { get; set; }
|
||||
public string AssembleUnit { get; set; }
|
||||
public string PrefabricatedComponents { get; set; }
|
||||
public string QRCode { get; set; }
|
||||
public int? State { get; set; }
|
||||
public string PlanStartDate { get; set; }
|
||||
public string PipelineCode { get; set; }
|
||||
public string FlowingSection { get; set; }
|
||||
public string QRCode2 { get; set; }
|
||||
public string MaterialCode { get; set; }
|
||||
public bool? IsPrint { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user