change-更新新线泡前库数量

dev
liuwf 1 year ago
parent 5847503d58
commit 04c411b222

@ -1,6 +1,8 @@
using Admin.Core.Common.Helper; using Admin.Core.Common.Helper;
using Admin.Core.IService;
using Admin.Core.IService.IService_New; using Admin.Core.IService.IService_New;
using Admin.Core.Model.Model_New; using Admin.Core.Model.Model_New;
using Admin.Core.Service;
using Aucma.Core.BoxFoam.Models; using Aucma.Core.BoxFoam.Models;
using Aucma.Core.HwPLc; using Aucma.Core.HwPLc;
using Aucma.Core.Tasks.Models; using Aucma.Core.Tasks.Models;
@ -33,11 +35,15 @@ namespace Aucma.Core.BoxFoam.Business
public static List<SpaceDetailModel> spaceDetailModel = new List<SpaceDetailModel>(); public static List<SpaceDetailModel> spaceDetailModel = new List<SpaceDetailModel>();
public static List<FixtureStatus> listFixtureStatus = new List<FixtureStatus>(); public static List<FixtureStatus> listFixtureStatus = new List<FixtureStatus>();
private readonly IRecordBoxFoamFixtureComplateServices _fixtureComplateServices; private readonly IRecordBoxFoamFixtureComplateServices _fixtureComplateServices;
private readonly IOldBoxFoamTypeServices _oldBoxFoamTypeServices;
private readonly IBaseSpaceInfoServices _baseSpaceInfoServices;
Semaphore semaphore = new Semaphore(1, 1); Semaphore semaphore = new Semaphore(1, 1);
public CollectionFoamLine() public CollectionFoamLine()
{ {
_fixtureComplateServices = App.ServiceProvider.GetService<IRecordBoxFoamFixtureComplateServices>(); _fixtureComplateServices = App.ServiceProvider.GetService<IRecordBoxFoamFixtureComplateServices>();
_oldBoxFoamTypeServices = App.ServiceProvider.GetService<IOldBoxFoamTypeServices>();
_baseSpaceInfoServices = App.ServiceProvider.GetService<IBaseSpaceInfoServices>();
startCollect(); startCollect();
} }
@ -58,6 +64,10 @@ namespace Aucma.Core.BoxFoam.Business
var plc3 = PlcHelper.siemensList.FirstOrDefault(d => d.EquipName.Equals("泡前库Plc")); var plc3 = PlcHelper.siemensList.FirstOrDefault(d => d.EquipName.Equals("泡前库Plc"));
spaceDetailModel = ReadStoreTypeAndCount(plc3); spaceDetailModel = ReadStoreTypeAndCount(plc3);
// 更新货道库存
updateStoreAmount(spaceDetailModel);
// InitData(spaceDetailModel);
//RefreshSpaceEvent?.Invoke(spaceDetailModel); //RefreshSpaceEvent?.Invoke(spaceDetailModel);
List<FixtureStatus> boxTypeList = ReadBoxType(plc1, plc2); List<FixtureStatus> boxTypeList = ReadBoxType(plc1, plc2);
@ -666,10 +676,33 @@ namespace Aucma.Core.BoxFoam.Business
} }
return item1; return item1;
} }
/// <summary>
/// 更新新线货道库存
/// </summary>
/// <param name="spaceDetailModel"></param>
public async void updateStoreAmount(List<SpaceDetailModel> 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 #endregion
#region 注释方法 #region 注释方法
///// <summary> ///// <summary>
///// 固化时间显示值 ///// 固化时间显示值

Loading…
Cancel
Save