同上 优化出库自检错误流程
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user