同上 优化出库自检错误流程

This commit is contained in:
hehaibing-1996
2024-06-11 22:25:02 +08:00
parent ad36e72b08
commit a40c17e5dc
3 changed files with 194 additions and 3 deletions

View File

@ -193,6 +193,7 @@ namespace WCS.BLL.Manager
#region
if (warning.WarningType == WarningTypeEnum.)
{
Logs.Write($"【出库自检】发现物料{inventoryDetail.MatSN}丢失,用户点击【处理】,删除数据",LogsType.Outstore);
//清掉需要出库的缓存
var shelf = ShelfManager.Shelves
.Where(t => t.ShelfId == warning.ShelfId)
@ -202,8 +203,23 @@ namespace WCS.BLL.Manager
var smartShelf = shelf as SmartShelf;
if (smartShelf != null)
{
//删除货架上缓存的那一条数据
smartShelf.CurrentOutStoreMatSNs.RemoveAll(t => t == inventoryDetail.MatSN);
//TODO 如何保证丢失的继续进行
Logs.Write($"【出库自检】发现物料{inventoryDetail.MatSN}丢失,已删除货架缓存,剩余物料为{string.Join(",", smartShelf.CurrentOutStoreMatSNs)}", LogsType.Outstore);
//删除模组上缓存的那一条数据
var module = smartShelf.Modules.Where(t => t.ModuleId == warning.ModuleId).FirstOrDefault();
if (module != null) {
module.CurrentOutSns.RemoveAll(t => t == inventoryDetail.MatSN);
Logs.Write($"【出库自检】发现物料{inventoryDetail.MatSN}丢失,已删除模组缓存,剩余物料为{string.Join(",", module.CurrentOutSns)}", LogsType.Outstore);
}
//删除已丢失的出库明细数据
var outOrderMatDetail = DbHelp.db.Queryable<OutOrderMatDetail>()
.Where(t => t.OrderId == smartShelf.CurrentOutOrder.Id)
.Where(t => t.MatSN == inventoryDetail.MatSN && t.IsSended == false)
.ToList();
Logs.Write($"【出库自检】发现物料{inventoryDetail.MatSN}丢失,删除出库物料明细数据{outOrderMatDetail.Count}条!");
DbHelp.db.Deleteable(outOrderMatDetail).ExecuteCommand();
}
}
}
@ -248,8 +264,9 @@ namespace WCS.BLL.Manager
smartShelf.WarningLight.BlueLight(smartShelf.TcpCleint);
break;
case Mode.:
module.GoInOutStoreMode(smartShelf.TcpCleint, module.CurrentOutSns);
smartShelf.WarningLight.GreenLight(smartShelf.TcpCleint);
//module.GoInOutStoreMode(smartShelf.TcpCleint, module.CurrentOutSns);
//smartShelf.WarningLight.GreenLight(smartShelf.TcpCleint);
smartShelf.GoInOutstoreByWebSocket(module.ModuleId);
break;
case Mode.:
module.Reset(smartShelf.TcpCleint);