桌面端新增密炼计划获取

This commit is contained in:
2026-06-17 17:52:31 +08:00
parent 816af5df6e
commit 372dc10be2
23 changed files with 1335 additions and 92 deletions

View File

@@ -25,9 +25,10 @@ public class MixingPlanShiftOption
public string? PlanId { get; set; }
public string? OrderNo { get; set; }
public string? FormulaName { get; set; }
public string? MaterialName { get; set; }
public string DisplayText => string.IsNullOrWhiteSpace(OrderNo)
? FormulaName ?? string.Empty
: $"{OrderNo} | {FormulaName}";
? MaterialName ?? FormulaName ?? string.Empty
: $"{OrderNo} | {MaterialName ?? FormulaName}";
}
public class QuickTestInspectCellViewModel : BindableBase
@@ -217,7 +218,7 @@ public class RubberQuickTestOperationViewModel : BaseViewModel
public string? ProductionOrderNo => _selectedPlan?.OrderNo;
public string? MachineName => _selectedPlan?.MachineName ?? SelectedMachine;
public string? WorkShiftDisplay => SelectedShift?.Name ?? string.Empty;
public string? RubberMaterialName => _selectedPlan?.FormulaName;
public string? RubberMaterialName => _selectedPlan?.MaterialName ?? _selectedPlan?.FormulaName;
private string? _trainNo;
public string? TrainNo
@@ -286,32 +287,25 @@ public class RubberQuickTestOperationViewModel : BaseViewModel
_allShiftOptions.Clear();
foreach (var row in _allPlans)
{
AddShiftOption(row, "morning", "1", "早班", row.MorningPlanId, row.MorningOrderDate, row.MorningOrderNo, row.MorningFormulaName);
AddShiftOption(row, "noon", "2", "中班", row.NoonPlanId, row.NoonOrderDate, row.NoonOrderNo, row.NoonFormulaName);
AddShiftOption(row, "night", "3", "晚班", row.NightPlanId, row.NightOrderDate, row.NightOrderNo, row.NightFormulaName);
if (string.IsNullOrWhiteSpace(row.PlanId)) continue;
var shiftCode = row.ShiftFlag?.ToString() ?? string.Empty;
_allShiftOptions.Add(new MixingPlanShiftOption
{
PlanRowId = row.Id ?? string.Empty,
MachineId = row.MachineId,
MachineName = row.MachineName,
ShiftKey = shiftCode,
ShiftCode = shiftCode,
ShiftName = row.ShiftFlagText,
OrderDate = row.PlanDate,
PlanId = row.PlanId,
OrderNo = row.OrderNo,
FormulaName = row.FormulaName,
MaterialName = row.MaterialName
});
}
}
private void AddShiftOption(
MesXslMixingProductionPlan row, string shiftKey, string shiftCode, string shiftName,
string? planId, DateTime? orderDate, string? orderNo, string? formulaName)
{
if (string.IsNullOrWhiteSpace(planId) || string.IsNullOrWhiteSpace(orderNo)) return;
_allShiftOptions.Add(new MixingPlanShiftOption
{
PlanRowId = row.Id ?? string.Empty,
MachineId = row.MachineId,
MachineName = row.MachineName,
ShiftKey = shiftKey,
ShiftCode = shiftCode,
ShiftName = shiftName,
OrderDate = orderDate,
PlanId = planId,
OrderNo = orderNo,
FormulaName = formulaName
});
}
private IEnumerable<MixingPlanShiftOption> FilteredByDate =>
_allShiftOptions.Where(o => o.OrderDate?.Date == MixingDate.Date);