20251009 排产计划

This commit is contained in:
2025-10-09 09:30:37 +08:00
parent 0ac7d74b5e
commit 87fb529521
5 changed files with 234 additions and 79 deletions
@@ -4,6 +4,7 @@ using MiniExcelLibs;
using Model;
using Newtonsoft.Json.Linq;
using NPOI.SS.Formula.Functions;
using Org.BouncyCastle.Bcpg.OpenPgp;
using System;
using System.Collections.Generic;
using System.Data;
@@ -483,8 +484,8 @@ namespace FineUIPro.Web.HJGL.PreDesign
p.AvgDailyWorkload,
w.ProjectType,
p.CompletedCount,
p.CompletedRate,
p.TotalCompletedRate,
(cast(p.CompletedRate as nvarchar(10))+'%') as CompletedRate,
(cast(p.TotalCompletedRate as nvarchar(10))+'%') as TotalCompletedRate,
p.OnDayCompleteDyne,
p.NextDayCompleteDyne
FROM HJGL_ProductionSchedulingPlan p
@@ -597,6 +598,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
if (this.Grid1.Rows.Count > 0)
{
string totalPriority = string.Empty;
foreach (JObject mergedRow in Grid1.GetMergedData())
{
JObject values = mergedRow.Value<JObject>("values");
@@ -605,18 +607,34 @@ namespace FineUIPro.Web.HJGL.PreDesign
var newPlan = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlanById(rowId);
if (newPlan != null)
{
newPlan.TotalPriority = values.Value<string>("TotalPriority");
newPlan.PriorityTotalDyne = Funs.GetNewDecimal(values.Value<string>("PriorityTotalDyne"));
if (!string.IsNullOrEmpty(values.Value<string>("TotalPriority")))
{
newPlan.TotalPriority = values.Value<string>("TotalPriority");
}
else
{
newPlan.TotalPriority = totalPriority;
totalPriority = string.Empty;
}
newPlan.PlanStartDate = Funs.GetNewDateTime(values.Value<string>("PlanStartDate"));
newPlan.PlanEndDate = Funs.GetNewDateTime(values.Value<string>("PlanEndDate"));
newPlan.Days = Funs.GetNewInt(values.Value<string>("Days"));
newPlan.AvgDailyWorkload = Funs.GetNewDecimal(values.Value<string>("AvgDailyWorkload"));
newPlan.OnDayCompleteDyne = Funs.GetNewDecimal(values.Value<string>("OnDayCompleteDyne"));
newPlan.NextDayCompleteDyne = Funs.GetNewDecimal(values.Value<string>("NextDayCompleteDyne"));
newPlan.CompletedCount = Funs.GetNewInt(values.Value<string>("CompletedCount"));
newPlan.CompletedRate = Funs.GetNewDecimal(values.Value<string>("CompletedRate"));
newPlan.TotalCompletedRate = Funs.GetNewDecimal(values.Value<string>("TotalCompletedRate"));
BLL.ProductionSchedulingPlanService.UpdateProductionSchedulingPlan(newPlan);
//更新合并单元格的总达因(按材质)优先级
if (!string.IsNullOrEmpty(newPlan.TotalPriority))
{
var pLists = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlanByMaterialLists(this.CurrUser.LoginProjectId, newPlan.FlowNum, newPlan.PipelineId, newPlan.Material);
foreach (var item in pLists)
{
if (string.IsNullOrEmpty(item.TotalPriority))
{
totalPriority = newPlan.TotalPriority;
}
}
}
}
}
ShowNotify("保存成功!", MessageBoxIcon.Success);
@@ -945,6 +963,31 @@ namespace FineUIPro.Web.HJGL.PreDesign
Grid2.DataSource = table;
Grid2.DataBind();
}
/// <summary>
/// 当次日应完成量高于平均每日应完成工作量发出预警(标红)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid2_RowDataBound(object sender, GridRowEventArgs e)
{
DataRowView row = e.DataItem as DataRowView;
double avgDailyWorkload = 0;
double nextDayCompleteDyne = 0;
if (row["AvgDayCompleteDia"] != null && !string.IsNullOrEmpty(row["AvgDayCompleteDia"].ToString()))
{
avgDailyWorkload = Convert.ToDouble(row["AvgDayCompleteDia"]);//平均每日应完成工作量
}
if (row["NextDayComplete"] != null && !string.IsNullOrEmpty(row["NextDayComplete"].ToString()))
{
nextDayCompleteDyne = Convert.ToDouble(row["NextDayComplete"]);//次日应完成量
}
if (avgDailyWorkload < nextDayCompleteDyne)
{
e.RowCssClass = "color1";
}
}
#endregion
}
}