生产完成率

This commit is contained in:
chenlin 2026-01-23 14:04:37 +08:00
parent 7b81765c29
commit 5a694f7288
2 changed files with 5 additions and 5 deletions

View File

@ -108,7 +108,7 @@ namespace DOAN.Model.MES.report
public int CompletionNum { get; set; }
public double CompletionRate { get; set; }
public string Status { get; set; }
public List<PlanModel> List { get; set; }
public List<PlanModel> List { get; set; } = new List<PlanModel>();
public DateTime? StartTime { get; set; }
public DateTime? EndTime { get; set; }

View File

@ -198,7 +198,7 @@ namespace DOAN.Service.MES.report
{
WorkOrder = t.Workorder,
GroupName = t.GroupName,
WorkTimePeriod = $"{t.StartTime}-{t.EndTime}",
WorkTimePeriod = $"{t.StartTime?.ToString("HH:mm")}-{t.EndTime?.ToString("HH:mm")}",
DeliveryNum = t.DeliveryNum ?? 0,
Status = GetStatusName(t.Status??0),
StartTime=t.StartTime,
@ -212,12 +212,12 @@ namespace DOAN.Service.MES.report
for (int i = 0; i < hours; i++)
{
var productionCompletionModel = productionCompletionList.Where(t => t.TimePeriod.Hour == (8 + i)).FirstOrDefault();
var mod = new PlanModel
t.List.Add(new PlanModel
{
StartTime = $"{8 + i}00",
PlanNum = t.DeliveryNum / 8,
CompletionNum = productionCompletionModel.Count,
};
CompletionNum = productionCompletionModel?.Count ?? 0,
});
}
t.CompletionNum = productionCompletionList.Sum(t => t.Count);
t.CompletionRate = Math.Round(t.CompletionNum*100.0 / t.DeliveryNum,2);