焊接管理修改

This commit is contained in:
2025-08-28 15:41:32 +08:00
parent edebefa3c9
commit 87bbd83e25
24 changed files with 444 additions and 170 deletions
@@ -94,16 +94,12 @@ namespace BLL
public static string GetMinPlanStartDate(string PackagingManageId)
{
string PlanStartDate = "";
DataTable tb = BLL.HJGL_PackagingmanageService.GetPackagingDetailById(PackagingManageId);
if (tb == null || tb.Rows.Count == 0)
var tb = GetPackagingDetailById(PackagingManageId);
if (tb == null || tb.Count == 0)
{
return PlanStartDate;
}
var dtTable = tb.AsEnumerable().OrderBy(o => o["PlanStartDate"]).CopyToDataTable();
if (dtTable.Rows != null && dtTable.Rows.Count > 0)
{
PlanStartDate = dtTable.Rows[0]["PlanStartDate"].ToString();
}
PlanStartDate = tb.OrderBy(x => x.PlanStartDate).FirstOrDefault()?.PlanStartDate.ToString();
return PlanStartDate;
}
@@ -172,7 +168,7 @@ namespace BLL
/// </summary>
/// <param name="PackagingManageId"></param>
/// <returns></returns>
public static DataTable GetPackagingDetailById(string PackagingManageId)
/* public static DataTable GetPackagingDetailById(string PackagingManageId)
{
DataTable tb = new DataTable();
var model = GetHJGL_PackagingManageById(PackagingManageId);
@@ -191,8 +187,54 @@ namespace BLL
tb = SQLHelper.GetDataTableRunText(strSql, parameter);
}
return tb;
}
}*/
public static List<Model.PackagingManagePrintOutput> GetPackagingDetailById(string PackagingManageId)
{
var model = GetHJGL_PackagingManageById(PackagingManageId);
var result = new List<Model.PackagingManagePrintOutput>();
if (string.IsNullOrEmpty(model.PipelineComponentId))
return new List<Model.PackagingManagePrintOutput>();
var PipelineComponentIds = model.PipelineComponentId.Split(',');
if (model.TypeInt == (int)HJGL_PackagingmanageService.TypeInt.)
{
var query = from com in Funs.DB.HJGL_Pipeline_Component
join pipe in Funs.DB.HJGL_Pipeline on com.PipelineId equals pipe.PipelineId into pipeGroup
from pipe in pipeGroup.DefaultIfEmpty()
join unitwork in Funs.DB.WBS_UnitWork on pipe.UnitWorkId equals unitwork.UnitWorkId into unitworkGroup
from unitwork in unitworkGroup.DefaultIfEmpty()
where PipelineComponentIds.Contains(com.PipelineComponentId)
orderby com.PipelineComponentCode
select new Model.PackagingManagePrintOutput
{
PipelineComponentId = com.PipelineComponentId,
PipelineComponentCode = com.PipelineComponentCode,
PlanStartDate = pipe != null && pipe.PlanStartDate != null ? pipe.PlanStartDate : DateTime.Now,
UnitWorkName = unitwork != null ? unitwork.UnitWorkName : "",
num = "1",
CU = "个",
FlowingSection = pipe != null ? pipe.FlowingSection : ""
};
result = query.ToList();
}
else
{
var query = HJGLPackagingmanagedetailService.GetPackagingData(PackagingManageId).ToList();
var detailList = from x in query
select new Model.PackagingManagePrintOutput
{
PipelineComponentId = x.Id,
PipelineComponentCode = x.MaterialCode,
num = x.Number.ToString(),
CU = x.MaterialUnit,
UnitWorkName = x.UnitWorkId == null ? "" : UnitWorkService.GetNameById(x.UnitWorkId),
FlowingSection = x.FlowingSection,
};
result = detailList.ToList();
}
return result;
}
/// <summary>
/// 根据项目号获取包装编号历史记录
/// </summary>