20250924 修改排产计划
This commit is contained in:
parent
f24e6a366e
commit
6e6f3d42fd
|
|
@ -55,6 +55,8 @@ namespace BLL
|
|||
newPlan.CompletedCount = plan.CompletedCount;
|
||||
newPlan.CompletedRate = plan.CompletedRate;
|
||||
newPlan.TotalCompletedRate = plan.TotalCompletedRate;
|
||||
newPlan.OnDayCompleteDyne = plan.OnDayCompleteDyne;
|
||||
newPlan.NextDayCompleteDyne = plan.NextDayCompleteDyne;
|
||||
db.HJGL_ProductionSchedulingPlan.InsertOnSubmit(newPlan);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,12 @@
|
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>排产计划</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
.color1 {
|
||||
background:#ff0000;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
|
@ -56,7 +62,7 @@
|
|||
EnableColumnLines="true" ClicksToEdit="1" DataIDField="ProductionSchedulingPlanId"
|
||||
AllowSorting="true" SortField="FlowNum,Material,Caliber" SortDirection="ASC" OnSort="Grid1_Sort"
|
||||
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
EnableTextSelection="True">
|
||||
EnableTextSelection="True" OnRowDataBound="Grid1_RowDataBound">
|
||||
<Columns>
|
||||
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号"
|
||||
Width="60px" HeaderTextAlign="Center" TextAlign="Center" />
|
||||
|
|
@ -80,23 +86,23 @@
|
|||
DataField="Dain" SortField="Dain" FieldType="Float" HeaderTextAlign="Center" TextAlign="Left"
|
||||
Width="90px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="总达因" ColumnID="TotalDyne"
|
||||
<f:RenderField HeaderText="总达因(按材质)" ColumnID="TotalDyne"
|
||||
DataField="TotalDyne" SortField="TotalDyne" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
|
||||
Width="90px">
|
||||
Width="150px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="总优先级" ColumnID="TotalPriority"
|
||||
<f:RenderField HeaderText="总达因(按材质)优先级" ColumnID="TotalPriority"
|
||||
DataField="TotalPriority" SortField="TotalPriority" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
|
||||
Width="100px">
|
||||
Width="190px">
|
||||
<Editor>
|
||||
<f:TextBox ID="txtTotalPriority" runat="server"></f:TextBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="优先级总达因" ColumnID="PriorityTotalDyne"
|
||||
<f:RenderField HeaderText="总达因" ColumnID="PriorityTotalDyne"
|
||||
DataField="PriorityTotalDyne" SortField="PriorityTotalDyne" FieldType="Float" HeaderTextAlign="Center" TextAlign="Left"
|
||||
Width="120px">
|
||||
<Editor>
|
||||
<%--<Editor>
|
||||
<f:NumberBox ID="txtPriorityTotalDyne" runat="server"></f:NumberBox>
|
||||
</Editor>
|
||||
</Editor>--%>
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="计划开始时间" ColumnID="PlanStartDate"
|
||||
DataField="PlanStartDate" SortField="PlanStartDate" FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderTextAlign="Center" TextAlign="Left"
|
||||
|
|
@ -119,7 +125,7 @@
|
|||
<f:NumberBox ID="txtDays" runat="server" NoDecimal="true" NoNegative="true" ></f:NumberBox>
|
||||
</Editor>--%>
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="平均每天工作量" ColumnID="AvgDailyWorkload"
|
||||
<f:RenderField HeaderText="平均每日应完成工作量" ColumnID="AvgDailyWorkload"
|
||||
DataField="AvgDailyWorkload" FieldType="Float" HeaderTextAlign="Center" TextAlign="Left"
|
||||
Width="140px">
|
||||
<Editor>
|
||||
|
|
@ -129,9 +135,9 @@
|
|||
<f:RenderField HeaderText="当日已完成量" ColumnID="OnDayCompleteDyne"
|
||||
DataField="OnDayCompleteDyne" FieldType="Float" HeaderTextAlign="Center" TextAlign="Left"
|
||||
Width="120px">
|
||||
<Editor>
|
||||
<%--<Editor>
|
||||
<f:NumberBox ID="NumberBox1" runat="server" NoNegative="true"></f:NumberBox>
|
||||
</Editor>
|
||||
</Editor>--%>
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="次日应完成量" ColumnID="NextDayCompleteDyne"
|
||||
DataField="NextDayCompleteDyne" FieldType="Float" HeaderTextAlign="Center" TextAlign="Left"
|
||||
|
|
@ -196,7 +202,7 @@
|
|||
}
|
||||
|
||||
function onGridDataLoad(event) {
|
||||
this.mergeColumns(['FlowNum', 'Material', 'TotalDyne', 'TotalCompletedRate']);
|
||||
this.mergeColumns(['FlowNum', 'Material', 'TotalDyne','TotalPriority','PriorityTotalDyne', 'TotalCompletedRate']);
|
||||
}
|
||||
|
||||
//自动计算天数、平均每天工作量
|
||||
|
|
|
|||
|
|
@ -223,10 +223,11 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
|||
{
|
||||
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
|
||||
{
|
||||
string projectId = this.CurrUser.LoginProjectId;
|
||||
if (tvControlItem.SelectedNode.CommandName == "流水段")
|
||||
{
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId));
|
||||
listStr.Add(new SqlParameter("@projectId", projectId));
|
||||
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNode.ParentNode.NodeID))
|
||||
{
|
||||
listStr.Add(new SqlParameter("@unitWorkId", this.tvControlItem.SelectedNode.ParentNode.NodeID));
|
||||
|
|
@ -252,7 +253,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
|||
DataTable tb = SQLHelper.GetDataTableRunProc("Sp_ProductionSchedulingPlanStatistics", parameter);
|
||||
|
||||
//删除原有数据
|
||||
BLL.ProductionSchedulingPlanService.DeleteProductionSchedulingPlanByUnitWorkIdAndFlowNum(this.CurrUser.LoginProjectId,this.tvControlItem.SelectedNode.ParentNode.Text, this.tvControlItem.SelectedNode.Text);
|
||||
BLL.ProductionSchedulingPlanService.DeleteProductionSchedulingPlanByUnitWorkIdAndFlowNum(projectId, this.tvControlItem.SelectedNode.ParentNode.Text, this.tvControlItem.SelectedNode.Text);
|
||||
for (int i = 0; i < tb.Rows.Count; i++)
|
||||
{
|
||||
string unitWorkId = tb.Rows[i]["UnitWorkId"].ToString();//单位工程
|
||||
|
|
@ -261,32 +262,52 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
|||
string material = tb.Rows[i]["Material"].ToString();//材质Text
|
||||
string caliber = tb.Rows[i]["Caliber"].ToString();//寸径
|
||||
|
||||
var plan = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlan(this.CurrUser.LoginProjectId, flowingSection, unitWorkId, material, caliber);
|
||||
var plan = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlan(projectId, flowingSection, unitWorkId, material, caliber);
|
||||
if (plan == null)
|
||||
{
|
||||
Model.HJGL_ProductionSchedulingPlan newPlan = new HJGL_ProductionSchedulingPlan();
|
||||
newPlan.ProductionSchedulingPlanId = SQLHelper.GetNewID(typeof(Model.HJGL_ProductionSchedulingPlan));
|
||||
newPlan.ProjectId = this.CurrUser.LoginProjectId;
|
||||
newPlan.ProjectId = projectId;
|
||||
newPlan.PipelineId = unitWorkId;
|
||||
newPlan.FlowNum = flowingSection;
|
||||
newPlan.MainItemName = tb.Rows[i]["UnitWorkName"].ToString();
|
||||
newPlan.Material = material;
|
||||
newPlan.Caliber = caliber;
|
||||
newPlan.Dain = BLL.WeldJointService.GetSizeSum(this.CurrUser.LoginProjectId, unitWorkId, flowingSection, steelType, caliber,"1");
|
||||
newPlan.TotalDyne = BLL.WeldJointService.GetSizeSumByUnitWorkIdAndFlowingSection(this.CurrUser.LoginProjectId, unitWorkId, flowingSection,"1");
|
||||
newPlan.CompletedCount = BLL.WeldJointService.GetSizeSum(this.CurrUser.LoginProjectId, unitWorkId, flowingSection, steelType, caliber, "2");
|
||||
newPlan.Dain = BLL.WeldJointService.GetSizeSum(projectId, unitWorkId, flowingSection, steelType, caliber, "1");//达因数
|
||||
var dyne = BLL.WeldJointService.GetSizeSumByUnitWorkIdAndFlowingSectionAndMaterial(projectId, unitWorkId, flowingSection, steelType);//总达因(按材质)
|
||||
if (dyne != null)
|
||||
{
|
||||
newPlan.TotalDyne = dyne;
|
||||
}
|
||||
else
|
||||
{
|
||||
newPlan.TotalDyne = 0;
|
||||
}
|
||||
newPlan.PriorityTotalDyne = BLL.WeldJointService.GetSizeSumByUnitWorkIdAndFlowingSection(projectId, unitWorkId, flowingSection, "1");//总达因
|
||||
//当日已完成量
|
||||
var currentDay = BLL.WeldJointService.GetCurrentDaySizeSum(projectId, unitWorkId, flowingSection, steelType, caliber);
|
||||
if (currentDay != null)
|
||||
{
|
||||
newPlan.OnDayCompleteDyne = currentDay;
|
||||
}
|
||||
else
|
||||
{
|
||||
newPlan.OnDayCompleteDyne = 0;
|
||||
}
|
||||
|
||||
newPlan.CompletedCount = BLL.WeldJointService.GetSizeSum(projectId, unitWorkId, flowingSection, steelType, caliber, "2");//累计已完成量
|
||||
if (newPlan.Dain > 0)
|
||||
{
|
||||
newPlan.CompletedRate = (newPlan.CompletedCount / newPlan.Dain) * 100;
|
||||
newPlan.CompletedRate = (newPlan.CompletedCount / newPlan.Dain) * 100;//已完成百分比
|
||||
}
|
||||
else
|
||||
{
|
||||
newPlan.CompletedRate = 0;
|
||||
}
|
||||
if (newPlan.TotalDyne > 0)
|
||||
if (newPlan.PriorityTotalDyne > 0)
|
||||
{
|
||||
decimal? completeDinSum = BLL.WeldJointService.GetSizeSumByUnitWorkIdAndFlowingSection(this.CurrUser.LoginProjectId, unitWorkId, flowingSection, "2");
|
||||
newPlan.TotalCompletedRate = (completeDinSum / newPlan.TotalDyne) * 100;
|
||||
decimal? completeDinSum = BLL.WeldJointService.GetSizeSumByUnitWorkIdAndFlowingSection(projectId, unitWorkId, flowingSection, "2");//完成总达因
|
||||
newPlan.TotalCompletedRate = (completeDinSum / newPlan.PriorityTotalDyne) * 100;//已完成百分比汇总
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -299,7 +320,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
|||
else if (tvControlItem.SelectedNode.CommandName.Split('|').Length == 2)//单位工程
|
||||
{
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId));
|
||||
listStr.Add(new SqlParameter("@projectId", projectId));
|
||||
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNode.NodeID))
|
||||
{
|
||||
listStr.Add(new SqlParameter("@unitWorkId", this.tvControlItem.SelectedNode.NodeID));
|
||||
|
|
@ -317,7 +338,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
|||
DataTable tb = SQLHelper.GetDataTableRunProc("Sp_ProductionSchedulingPlanStatistics", parameter);
|
||||
|
||||
//删除原有数据
|
||||
BLL.ProductionSchedulingPlanService.DeleteProductionSchedulingPlanByUnitWork(this.CurrUser.LoginProjectId, this.tvControlItem.SelectedNode.Text);
|
||||
BLL.ProductionSchedulingPlanService.DeleteProductionSchedulingPlanByUnitWork(projectId, this.tvControlItem.SelectedNode.Text);
|
||||
for (int i = 0; i < tb.Rows.Count; i++)
|
||||
{
|
||||
string unitWorkId = tb.Rows[i]["UnitWorkId"].ToString();//单位工程
|
||||
|
|
@ -325,32 +346,51 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
|||
string steelType = tb.Rows[i]["SteelType"].ToString();//材质Value
|
||||
string material = tb.Rows[i]["Material"].ToString();//材质Text
|
||||
string caliber = tb.Rows[i]["Caliber"].ToString();//寸径
|
||||
var plan = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlan(this.CurrUser.LoginProjectId, flowingSection, unitWorkId, material, caliber);
|
||||
var plan = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlan(projectId, flowingSection, unitWorkId, material, caliber);
|
||||
if (plan == null)
|
||||
{
|
||||
Model.HJGL_ProductionSchedulingPlan newPlan = new HJGL_ProductionSchedulingPlan();
|
||||
newPlan.ProductionSchedulingPlanId = SQLHelper.GetNewID(typeof(Model.HJGL_ProductionSchedulingPlan));
|
||||
newPlan.ProjectId = this.CurrUser.LoginProjectId;
|
||||
newPlan.ProjectId = projectId;
|
||||
newPlan.PipelineId = unitWorkId;
|
||||
newPlan.FlowNum = flowingSection;
|
||||
newPlan.MainItemName = tb.Rows[i]["UnitWorkName"].ToString();
|
||||
newPlan.Material = material;
|
||||
newPlan.Caliber = caliber;
|
||||
newPlan.Dain = BLL.WeldJointService.GetSizeSum(this.CurrUser.LoginProjectId, unitWorkId, flowingSection, steelType, caliber, "1");
|
||||
newPlan.TotalDyne = BLL.WeldJointService.GetSizeSumByUnitWorkIdAndFlowingSection(this.CurrUser.LoginProjectId, unitWorkId, flowingSection, "1");
|
||||
newPlan.CompletedCount = BLL.WeldJointService.GetSizeSum(this.CurrUser.LoginProjectId, unitWorkId, flowingSection, steelType, caliber, "2");
|
||||
newPlan.Dain = BLL.WeldJointService.GetSizeSum(projectId, unitWorkId, flowingSection, steelType, caliber, "1");//达因数
|
||||
var dyne = BLL.WeldJointService.GetSizeSumByUnitWorkIdAndFlowingSectionAndMaterial(projectId, unitWorkId, flowingSection, steelType);//总达因(按材质)
|
||||
if (dyne != null)
|
||||
{
|
||||
newPlan.TotalDyne = dyne;
|
||||
}
|
||||
else
|
||||
{
|
||||
newPlan.TotalDyne = 0;
|
||||
}
|
||||
newPlan.PriorityTotalDyne = BLL.WeldJointService.GetSizeSumByUnitWorkIdAndFlowingSection(projectId, unitWorkId, flowingSection, "1");//总达因
|
||||
//当日已完成量
|
||||
var currentDay = BLL.WeldJointService.GetCurrentDaySizeSum(projectId, unitWorkId, flowingSection, steelType, caliber);
|
||||
if (currentDay != null)
|
||||
{
|
||||
newPlan.OnDayCompleteDyne = currentDay;
|
||||
}
|
||||
else
|
||||
{
|
||||
newPlan.OnDayCompleteDyne = 0;
|
||||
}
|
||||
newPlan.CompletedCount = BLL.WeldJointService.GetSizeSum(projectId, unitWorkId, flowingSection, steelType, caliber, "2");//累计已完成量
|
||||
if (newPlan.Dain > 0)
|
||||
{
|
||||
newPlan.CompletedRate = (newPlan.CompletedCount / newPlan.Dain) * 100;
|
||||
newPlan.CompletedRate = (newPlan.CompletedCount / newPlan.Dain) * 100;//已完成百分比
|
||||
}
|
||||
else
|
||||
{
|
||||
newPlan.CompletedRate = 0;
|
||||
}
|
||||
if (newPlan.TotalDyne > 0)
|
||||
if (newPlan.PriorityTotalDyne > 0)
|
||||
{
|
||||
decimal? completeDinSum = BLL.WeldJointService.GetSizeSumByUnitWorkIdAndFlowingSection(this.CurrUser.LoginProjectId, unitWorkId, flowingSection, "2");
|
||||
newPlan.TotalCompletedRate = (completeDinSum / newPlan.TotalDyne) * 100;
|
||||
decimal? completeDinSum = BLL.WeldJointService.GetSizeSumByUnitWorkIdAndFlowingSection(projectId, unitWorkId, flowingSection, "2");//完成总达因
|
||||
newPlan.TotalCompletedRate = (completeDinSum / newPlan.PriorityTotalDyne) * 100;//已完成百分比汇总
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -636,7 +676,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
|||
var font = workbook.CreateFont();
|
||||
font.FontHeightInPoints = 11;
|
||||
cellStyle.SetFont(font);
|
||||
|
||||
|
||||
// 第二步:创建新数据行
|
||||
NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0);
|
||||
NPOI.SS.UserModel.IRow row = sheet.GetRow(0);
|
||||
|
|
@ -846,5 +886,31 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
|||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Grid行绑定事件
|
||||
/// <summary>
|
||||
/// 次日应完成量高于平均每日应完成工作量发出预警,预警要统一着色显示红色
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
|
||||
{
|
||||
DataRowView row = e.DataItem as DataRowView;
|
||||
double avgDailyWorkload = 0;
|
||||
double nextDayCompleteDyne = 0;
|
||||
if (row["AvgDailyWorkload"] != null && !string.IsNullOrEmpty(row["AvgDailyWorkload"].ToString()))
|
||||
{
|
||||
avgDailyWorkload = Convert.ToDouble(row["AvgDailyWorkload"]);
|
||||
}
|
||||
if (row["NextDayCompleteDyne"] != null && !string.IsNullOrEmpty(row["NextDayCompleteDyne"].ToString()))
|
||||
{
|
||||
nextDayCompleteDyne = Convert.ToDouble(row["NextDayCompleteDyne"]);
|
||||
}
|
||||
if (avgDailyWorkload < nextDayCompleteDyne)
|
||||
{
|
||||
e.RowCssClass = "color1";
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
@ -147,15 +147,6 @@ namespace FineUIPro.Web.HJGL.PreDesign {
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtTotalPriority;
|
||||
|
||||
/// <summary>
|
||||
/// txtPriorityTotalDyne 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtPriorityTotalDyne;
|
||||
|
||||
/// <summary>
|
||||
/// txtPlanStartDate 控件。
|
||||
/// </summary>
|
||||
|
|
@ -183,15 +174,6 @@ namespace FineUIPro.Web.HJGL.PreDesign {
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtAvgDailyWorkload;
|
||||
|
||||
/// <summary>
|
||||
/// NumberBox1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox NumberBox1;
|
||||
|
||||
/// <summary>
|
||||
/// NumberBox2 控件。
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Reference in New Issue