From 04c411b2227fee001e2e1b65ad2db9987fa6d810 Mon Sep 17 00:00:00 2001 From: liuwf Date: Tue, 9 Jan 2024 18:54:48 +0800 Subject: [PATCH] =?UTF-8?q?change-=E6=9B=B4=E6=96=B0=E6=96=B0=E7=BA=BF?= =?UTF-8?q?=E6=B3=A1=E5=89=8D=E5=BA=93=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Business/CollectionFoamLine.cs | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Aucma.Core.BoxFoam/Business/CollectionFoamLine.cs b/Aucma.Core.BoxFoam/Business/CollectionFoamLine.cs index f6ebf3cf..085002dd 100644 --- a/Aucma.Core.BoxFoam/Business/CollectionFoamLine.cs +++ b/Aucma.Core.BoxFoam/Business/CollectionFoamLine.cs @@ -1,6 +1,8 @@ using Admin.Core.Common.Helper; +using Admin.Core.IService; using Admin.Core.IService.IService_New; using Admin.Core.Model.Model_New; +using Admin.Core.Service; using Aucma.Core.BoxFoam.Models; using Aucma.Core.HwPLc; using Aucma.Core.Tasks.Models; @@ -33,11 +35,15 @@ namespace Aucma.Core.BoxFoam.Business public static List spaceDetailModel = new List(); public static List listFixtureStatus = new List(); private readonly IRecordBoxFoamFixtureComplateServices _fixtureComplateServices; + private readonly IOldBoxFoamTypeServices _oldBoxFoamTypeServices; + private readonly IBaseSpaceInfoServices _baseSpaceInfoServices; Semaphore semaphore = new Semaphore(1, 1); public CollectionFoamLine() { _fixtureComplateServices = App.ServiceProvider.GetService(); + _oldBoxFoamTypeServices = App.ServiceProvider.GetService(); + _baseSpaceInfoServices = App.ServiceProvider.GetService(); startCollect(); } @@ -58,6 +64,10 @@ namespace Aucma.Core.BoxFoam.Business var plc3 = PlcHelper.siemensList.FirstOrDefault(d => d.EquipName.Equals("泡前库Plc")); spaceDetailModel = ReadStoreTypeAndCount(plc3); + // 更新货道库存 + updateStoreAmount(spaceDetailModel); + + // InitData(spaceDetailModel); //RefreshSpaceEvent?.Invoke(spaceDetailModel); List boxTypeList = ReadBoxType(plc1, plc2); @@ -666,10 +676,33 @@ namespace Aucma.Core.BoxFoam.Business } return item1; } + + /// + /// 更新新线货道库存 + /// + /// + public async void updateStoreAmount(List spaceDetailModel) + { + if (spaceDetailModel == null) return; + + var spaceList = _baseSpaceInfoServices.QueryAsync(x=>x.StoreCode=="PQK-001").Result; + foreach (var item in spaceDetailModel) + { + var space = spaceList.FirstOrDefault(x => x.SpaceCode.Substring(7,1).Equals(item.ObjId.ToString())); + if (space != null) + { + space.SpaceStock = item.StoreAmount; + } + } + _baseSpaceInfoServices.UpdateAsync(spaceList); + } + } #endregion + + #region 注释方法 ///// ///// 固化时间显示值