20250924 修改排产计划

This commit is contained in:
2025-09-24 15:27:48 +08:00
parent f24e6a366e
commit 6e6f3d42fd
5 changed files with 215 additions and 77 deletions
+106 -24
View File
@@ -640,9 +640,9 @@ namespace BLL
/// <param name="flowingSection">流水段</param>
/// <param name="steelType">材质</param>
/// <param name="caliber">口径</param>
/// <param name="type">1-达因,2-完成达因</param>
/// <param name="type">1-达因,2-完成达因</param>
/// <returns></returns>
public static decimal? GetSizeSum(string projectId, string unitWorkId, string flowingSection, string steelType, string caliber,string type)
public static decimal? GetSizeSum(string projectId, string unitWorkId, string flowingSection, string steelType, string caliber, string type)
{
Model.SGGLDB db = Funs.DB;
decimal? sizeSum = 0;
@@ -655,38 +655,40 @@ namespace BLL
join z in db.Base_Material on y.MaterialId equals z.MaterialId
where x.ProjectId == projectId && y.UnitWorkId == unitWorkId && y.FlowingSection == flowingSection && z.SteelType == steelType
&& y.PipeArea == "1" && x.JointAttribute == "预制口"
//&& Convert.ToInt32(x.DNDia.Substring(2, x.DNDia.Length - 2)) < c
select x);
foreach (var item in weldjoints)
{
int s = Convert.ToInt32(item.DNDia.Substring(2, item.DNDia.Length - 2));
if (caliber.Substring(0, 1) == "<" && s < c)
if (!string.IsNullOrEmpty(item.DNDia) && item.DNDia != null)
{
if (type == "1")
int s = Convert.ToInt32(item.DNDia.Substring(2, item.DNDia.Length - 2));
if (caliber.Substring(0, 1) == "<" && s < c)
{
sizeSum += item.Size;
}
else
{
if (!string.IsNullOrEmpty(item.WeldingDailyId))
if (type == "1")
{
sizeSum += item.Size;
}
else
{
if (!string.IsNullOrEmpty(item.WeldingDailyId))
{
sizeSum += item.Size;
}
}
}
}
else if (caliber.Substring(0, 1) == "≥" && s >= c)
{
if (type == "1")
else if (caliber.Substring(0, 1) == "≥" && s >= c)
{
sizeSum += item.Size;
}
else
{
if (!string.IsNullOrEmpty(item.WeldingDailyId))
if (type == "1")
{
sizeSum += item.Size;
}
else
{
if (!string.IsNullOrEmpty(item.WeldingDailyId))
{
sizeSum += item.Size;
}
}
}
}
}
@@ -695,14 +697,14 @@ namespace BLL
}
/// <summary>
/// 根据单位工程、流水段获取总达因
/// 根据单位工程、流水段获取优先级总达因、完成总达因
/// </summary>
/// <param name="projectId">项目id</param>
/// <param name="unitWorkId">单位工程</param>
/// <param name="flowingSection">流水段</param>
/// <param name="type">1-总达因,2-完成总达因</param>
/// <returns></returns>
public static decimal? GetSizeSumByUnitWorkIdAndFlowingSection(string projectId, string unitWorkId, string flowingSection,string type)
public static decimal? GetSizeSumByUnitWorkIdAndFlowingSection(string projectId, string unitWorkId, string flowingSection, string type)
{
Model.SGGLDB db = Funs.DB;
decimal? sizeSum = 0;
@@ -710,7 +712,7 @@ namespace BLL
{
sizeSum = (from x in db.HJGL_WeldJoint
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
join z in db.Base_Material on y.MaterialId equals z.MaterialId
//join z in db.Base_Material on y.MaterialId equals z.MaterialId
where x.ProjectId == projectId && y.UnitWorkId == unitWorkId && y.FlowingSection == flowingSection
&& y.PipeArea == "1" && x.JointAttribute == "预制口"
select x.Size).Sum();
@@ -719,7 +721,7 @@ namespace BLL
{
sizeSum = (from x in db.HJGL_WeldJoint
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
join z in db.Base_Material on y.MaterialId equals z.MaterialId
//join z in db.Base_Material on y.MaterialId equals z.MaterialId
where x.ProjectId == projectId && y.UnitWorkId == unitWorkId && y.FlowingSection == flowingSection
&& y.PipeArea == "1" && x.JointAttribute == "预制口"
&& x.WeldingDailyId != "" && x.WeldingDailyId != null
@@ -727,5 +729,85 @@ namespace BLL
}
return sizeSum;
}
/// <summary>
/// 根据单位工程、流水段、材质获取总达因(按材质)
/// </summary>
/// <param name="projectId">项目id</param>
/// <param name="unitWorkId">单位工程id</param>
/// <param name="flowingSection">流水号</param>
/// <param name="material">材质</param>
/// <returns></returns>
public static decimal? GetSizeSumByUnitWorkIdAndFlowingSectionAndMaterial(string projectId, string unitWorkId, string flowingSection, string steelType)
{
Model.SGGLDB db = Funs.DB;
decimal? sizeSum = 0;
sizeSum = (from x in db.HJGL_WeldJoint
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
join z in db.Base_Material on y.MaterialId equals z.MaterialId
where x.ProjectId == projectId && y.UnitWorkId == unitWorkId && y.FlowingSection == flowingSection
&& y.PipeArea == "1" && x.JointAttribute == "预制口"
&& z.SteelType == steelType
select x.Size).Sum();
return sizeSum;
}
/// <summary>
/// 获取当日已完成量
/// </summary>
/// <param name="projectId"></param>
/// <param name="unitWorkId"></param>
/// <param name="flowingSection"></param>
/// <param name="steelType"></param>
/// <param name="caliber"></param>
/// <returns></returns>
public static decimal? GetCurrentDaySizeSum(string projectId, string unitWorkId, string flowingSection, string steelType, string caliber)
{
Model.SGGLDB db = Funs.DB;
decimal? sizeSum = 0;
int c = 0;
if (!string.IsNullOrEmpty(caliber))
{
c = Convert.ToInt32(caliber.Substring(1, caliber.Length - 1));
var weldjoints = (from x in db.HJGL_WeldJoint
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
join z in db.Base_Material on y.MaterialId equals z.MaterialId
where x.ProjectId == projectId && y.UnitWorkId == unitWorkId && y.FlowingSection == flowingSection && z.SteelType == steelType
&& y.PipeArea == "1" && x.JointAttribute == "预制口"
select x);
foreach (var item in weldjoints)
{
if (!string.IsNullOrEmpty(item.DNDia) && item.DNDia != null)
{
int s = Convert.ToInt32(item.DNDia.Substring(2, item.DNDia.Length - 2));
if (caliber.Substring(0, 1) == "<" && s < c)
{
if (!string.IsNullOrEmpty(item.WeldingDailyId))
{
var weldingDaily = BLL.WeldingDailyService.GetPipeline_WeldingDailyByWeldingDailyId(item.WeldingDailyId);
if (weldingDaily != null && weldingDaily.WeldingDate.HasValue && weldingDaily.WeldingDate.Value.ToShortDateString() == DateTime.Now.ToShortDateString())
{
sizeSum += item.Size;
}
}
}
else if (caliber.Substring(0, 1) == "≥" && s >= c)
{
if (!string.IsNullOrEmpty(item.WeldingDailyId))
{
var weldingDaily = BLL.WeldingDailyService.GetPipeline_WeldingDailyByWeldingDailyId(item.WeldingDailyId);
if (weldingDaily != null && weldingDaily.WeldingDate.HasValue && weldingDaily.WeldingDate.Value.ToShortDateString() == DateTime.Now.ToShortDateString())
{
sizeSum += item.Size;
}
}
}
}
}
}
return sizeSum;
}
}
}