diff --git a/Aucma.Core.BoxFoam/Business/CollectionFoamMachine.cs b/Aucma.Core.BoxFoam/Business/CollectionFoamMachine.cs index 814e9b28..9330ff24 100644 --- a/Aucma.Core.BoxFoam/Business/CollectionFoamMachine.cs +++ b/Aucma.Core.BoxFoam/Business/CollectionFoamMachine.cs @@ -91,7 +91,7 @@ namespace Aucma.Core.BoxFoam.Business if (record == null) { kvPair.Value.ProductLineCode = "CX_02"; - kvPair.Value.StationNumber = "1004"; + kvPair.Value.StationNumber = "1005"; // 数据库也没数据 int a = _lastShotRecordServices.AddAsync(kvPair.Value).Result; RefreshLastShotDataDelegateEvent?.Invoke(kvPair.Value); @@ -102,7 +102,7 @@ namespace Aucma.Core.BoxFoam.Business if (!kvPair.Value.MixpistOff.Equals(tempKeys[kvPair.Key].MixpistOff)) { kvPair.Value.ProductLineCode = "CX_02"; - kvPair.Value.StationNumber = "1004"; + kvPair.Value.StationNumber = "1005"; int b = _lastShotRecordServices.AddAsync(kvPair.Value).Result; RefreshLastShotDataDelegateEvent?.Invoke(kvPair.Value); diff --git a/Aucma.Core.BoxFoam/ViewModels/FoamMachinesPageViewModel.cs b/Aucma.Core.BoxFoam/ViewModels/FoamMachinesPageViewModel.cs index 647454dc..e20462b6 100644 --- a/Aucma.Core.BoxFoam/ViewModels/FoamMachinesPageViewModel.cs +++ b/Aucma.Core.BoxFoam/ViewModels/FoamMachinesPageViewModel.cs @@ -223,7 +223,7 @@ namespace Aucma.Core.BoxFoam.ViewModels LastShotRecordDataGrid.Clear(); int i = 1; - var list = _boxLastShotRecordServices.QueryAsync().Result.OrderBy(d => d.CreateTime).Take(10); + var list = _boxLastShotRecordServices.QueryAsync(x=>x.StationNumber == "1005").Result.OrderByDescending(d => d.CreateTime).Take(10); if (list == null) return; //list.OrderByDescending(d => d.CreateTime); foreach (var item in list) diff --git a/Aucma.Core.BoxFoam/ViewModels/FoamPlanPageViewModel.cs b/Aucma.Core.BoxFoam/ViewModels/FoamPlanPageViewModel.cs index 5b47e60a..408f1e7b 100644 --- a/Aucma.Core.BoxFoam/ViewModels/FoamPlanPageViewModel.cs +++ b/Aucma.Core.BoxFoam/ViewModels/FoamPlanPageViewModel.cs @@ -41,23 +41,29 @@ namespace Aucma.Core.BoxFoam.ViewModels public void InitData() { - MaterialCode.Clear(); - MaterialName.Clear(); - PlanAmount.Clear(); - ComplateAmount.Clear(); - DifferenceAmount.Clear(); + try + { + MaterialCode.Clear(); + MaterialName.Clear(); + PlanAmount.Clear(); + ComplateAmount.Clear(); + DifferenceAmount.Clear(); - var task = _boxFoamPlanServices.QueryAsync(x=>x.ProductLineCode == "CX_02" && x.StationCode == "1005" && x.ShiftType == 1).Result; - if (task == null) return; - task.OrderBy(d=>d.ObjId); - foreach (var item in task) + var task = _boxFoamPlanServices.QueryAsync(x => x.ProductLineCode == "CX_02" && x.StationCode == "1005" && x.ShiftType == 1).Result; + if (task == null) return; + task.OrderBy(d => d.ObjId); + foreach (var item in task) + { + Id.Add(item.ObjId); + MaterialCode.Add(item.MaterialCode); + MaterialName.Add(item.MaterialName); + PlanAmount.Add(item.PlanAmount); + ComplateAmount.Add(item.CompleteAmount); + DifferenceAmount.Add(item.PlanAmount - item.CompleteAmount); + } + }catch(Exception ex) { - Id.Add(item.ObjId); - MaterialCode.Add(item.MaterialCode); - MaterialName.Add(item.MaterialName); - PlanAmount.Add(item.PlanAmount); - ComplateAmount.Add(item.CompleteAmount); - DifferenceAmount.Add(item.PlanAmount - item.CompleteAmount); + Console.WriteLine($"刷新计划列表异常:{ex.Message}"); } } diff --git a/Aucma.Core.BoxFoam/appsettings.json b/Aucma.Core.BoxFoam/appsettings.json index b8b65ea6..6b386026 100644 --- a/Aucma.Core.BoxFoam/appsettings.json +++ b/Aucma.Core.BoxFoam/appsettings.json @@ -226,9 +226,9 @@ "EquipName": "foamMachinePlc", "PlcType": "Siemens", "Enabled": true, - //"IP": "10.10.93.180", - "IP": "127.0.0.1", - "Port": 105 + "IP": "10.10.93.180", + //"IP": "127.0.0.1", + "Port": 102 } ], "StoreInfo": {