change - 出入库逻辑优化

collectionStore
wenjy 1 year ago
parent 79748bbb8e
commit 4a9629bf46

Binary file not shown.

@ -51,6 +51,8 @@ namespace Aucma.Scada.Business
private IRealTaskInfoService _taskInfoService;
private IBaseSpaceDetailService _baseSpaceDetailService;
private IBaseBomInfoService _baseBomInfoService;
#endregion
#region 委托事件
@ -85,20 +87,24 @@ namespace Aucma.Scada.Business
_spaceInfoService = registerServices.GetService<IBaseSpaceInfoService>();
_taskInfoService = registerServices.GetService<IRealTaskInfoService>();
_baseSpaceDetailService = registerServices.GetService<IBaseSpaceDetailService>();
_baseBomInfoService = registerServices.GetService<IBaseBomInfoService>();
taskHandle.InStoreFinsihEvent += TaskFeedback;
grabImage.RefreshMaterialCodeStrEvent += InStore;
grabImage.RefreshLogMessageEvent += PrintLogInfoMessage;
StartPassDown();
//Task.Run(() =>
//{
// Thread.Sleep(6000);
// for(int i = 2;i<10;i++)
// {
// InStore(appConfig.shellStoreCode, "B23600000781101900"+i);
// InStore(appConfig.linerStoreCode, "L23600000788101900"+i);
// }
//});
Task.Run(() =>
{
Thread.Sleep(6000);
//for (int i = 2; i < 10; i++)
//{
// InStore(appConfig.shellStoreCode, "B23600000781101900" + i);
// InStore(appConfig.linerStoreCode, "L23600000788101900" + i);
//}
InStore(appConfig.shellStoreCode, "B236000007811019013");
});
}
/// <summary>
@ -116,7 +122,7 @@ namespace Aucma.Scada.Business
if (spaceInfo != null)
{
PrintLogInfoMessage($"匹配货道:{spaceInfo.spaceName}");
RefreshScanMateriaCodeEvent?.Invoke(materialCode, materialType, spaceInfo.spaceName, storeCode); //刷新界面扫码信息
RefreshScanMateriaCodeEvent?.Invoke(materialCode, GetMaterialName(materialType), spaceInfo.spaceName, storeCode); //刷新界面扫码信息
var result = CreateInStoreTask(spaceInfo, materialCode); //创建入库任务
if (result)
{
@ -386,6 +392,7 @@ namespace Aucma.Scada.Business
BaseSpaceDetail spaceDetail = new BaseSpaceDetail();
spaceDetail.materialType = taskInfo.materialType;
spaceDetail.materialCode = taskInfo.materialCode;
spaceDetail.materialName = GetMaterialName(taskInfo.materialType);
spaceDetail.storeCode = spaceInfo.storeCode;
spaceDetail.spaceCode = spaceInfo.spaceCode;
spaceDetail.materialAmount = 1;
@ -445,5 +452,22 @@ namespace Aucma.Scada.Business
{
return _taskInfoService.GetTaskInfosByStoreCode(new string[] { appConfig.shellStoreCode,appConfig.linerStoreCode }, 1);
}
/// <summary>
/// 通过BOM获取物料名称
/// </summary>
/// <param name="materialType"></param>
/// <returns></returns>
public string GetMaterialName(string materialType)
{
string materialName = string.Empty;
var info = _baseBomInfoService.GetBomInfoByMaterialCode(materialType);
if(info != null)
{
materialName = info.materialName;
}
return materialName;
}
}
}

@ -238,6 +238,7 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
App.Current.Dispatcher.Invoke((Action)(() =>
{
item.materialType = inStoreBusiness.GetMaterialName(item.materialType);
taskItems.Add(item);
InstoreTask = taskItems;
}));

@ -14,5 +14,12 @@ namespace HighWayIot.Repository.service
/// <param name="materialType"></param>
/// <returns></returns>
BaseBomInfo GetChildenBomInfoByMaterialCode(string materialCode, string materialType);
/// <summary>
/// 根据物料编号获取BOM信息
/// </summary>
/// <param name="materialCode"></param>
/// <returns></returns>
BaseBomInfo GetBomInfoByMaterialCode(string materialCode);
}
}

@ -44,6 +44,25 @@ namespace HighWayIot.Repository.service.Impl
return bomInfo;
}
/// <summary>
/// 根据物料编号获取BOM信息
/// </summary>
/// <param name="materialCode"></param>
/// <returns></returns>
public BaseBomInfo GetBomInfoByMaterialCode(string materialCode)
{
BaseBomInfo bomInfo = null;
try
{
bomInfo = _bomInfoRepository.GetFirst(x=>x.materialCode == materialCode);
}
catch (Exception ex)
{
logHelper.Error("根据物料编号获取BOM信息异常", ex);
}
return bomInfo;
}
private List<BaseBomInfo> GetChildenByParentId(string parentId, List<BaseBomInfo> result = null)
{
if (result == null)

Loading…
Cancel
Save