From f31a761f7680a17811107e17dddfe6ce66807837 Mon Sep 17 00:00:00 2001 From: 18923810322 <1666941798@qq.com> Date: Sat, 24 May 2025 15:40:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=8D=E6=AC=A1=E4=BF=AE=E6=94=B9=E4=BA=86?= =?UTF-8?q?=E6=94=B6=E8=B4=A7=E4=B8=8A=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml | 4 ++-- src/WMS.Web.Domain/Entitys/Box.cs | 15 ++++++++++++--- src/WMS.Web.Domain/IService/IBoxService.cs | 2 +- .../Services/BoxInventoryService.cs | 12 ++++++------ src/WMS.Web.Domain/Services/BoxService.cs | 4 ++-- 5 files changed, 23 insertions(+), 14 deletions(-) diff --git a/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml b/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml index 2c741d43..01f83540 100644 --- a/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml +++ b/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml @@ -207,7 +207,7 @@ - + 箱库存同步箱信息 @@ -5449,7 +5449,7 @@ 箱服务信息 - + 箱库存同步箱信息 diff --git a/src/WMS.Web.Domain/Entitys/Box.cs b/src/WMS.Web.Domain/Entitys/Box.cs index 0354cffb..e4415a45 100644 --- a/src/WMS.Web.Domain/Entitys/Box.cs +++ b/src/WMS.Web.Domain/Entitys/Box.cs @@ -184,7 +184,7 @@ namespace WMS.Web.Domain.Entitys /// /// /// - public Result BoxInventory(BoxInventory inventory) + public Result BoxInventory(BoxInventory inventory,string isNotUpdateBoxInv) { var detailClone = this.Details.Clone(); foreach (var d in detailClone) @@ -203,8 +203,17 @@ namespace WMS.Web.Domain.Entitys var md = this.Details.FirstOrDefault(w => w.MaterialNumber == d.MaterialNumber); if (md == null) this.Details.Add(new BoxDetails() { MaterialNumber = d.MaterialNumber, Qty = d.Qty }); - //else//alter by yzh - // md.Qty = d.Qty; + else//alter by yzh + { + if (isNotUpdateBoxInv == "1") + { + } + else + { + md.Qty = d.Qty; + } + + } } return Result.ReSuccess(); diff --git a/src/WMS.Web.Domain/IService/IBoxService.cs b/src/WMS.Web.Domain/IService/IBoxService.cs index ae90f69d..d4a22c02 100644 --- a/src/WMS.Web.Domain/IService/IBoxService.cs +++ b/src/WMS.Web.Domain/IService/IBoxService.cs @@ -14,6 +14,6 @@ namespace WMS.Web.Domain.IService // 同步老Ops箱信息 Task Sync(List list = null); // 箱库存同步箱信息 - Task BoxInventorySync(List list, bool isTransaction = true); + Task BoxInventorySync(List list, bool isTransaction = true,string isNotUpdateBoxInv="0"); } } diff --git a/src/WMS.Web.Domain/Services/BoxInventoryService.cs b/src/WMS.Web.Domain/Services/BoxInventoryService.cs index d33e8e92..efb32cb3 100644 --- a/src/WMS.Web.Domain/Services/BoxInventoryService.cs +++ b/src/WMS.Web.Domain/Services/BoxInventoryService.cs @@ -838,7 +838,7 @@ namespace WMS.Web.Domain.Services } //改箱 - var changeBox_result = await _boxService.BoxInventorySync(changeBox_inventoryList, isTransaction); + var changeBox_result = await _boxService.BoxInventorySync(changeBox_inventoryList, isTransaction,"0"); if (!changeBox_result.IsSuccess) return changeBox_result; @@ -1255,7 +1255,7 @@ namespace WMS.Web.Domain.Services } //改箱 - var changeBox_result = await _boxService.BoxInventorySync(changeBox_inventoryList, isTransaction); + var changeBox_result = await _boxService.BoxInventorySync(changeBox_inventoryList, isTransaction,"1"); if (!changeBox_result.IsSuccess) return changeBox_result; @@ -1464,7 +1464,7 @@ namespace WMS.Web.Domain.Services } //改箱 - var changeBox_result = await _boxService.BoxInventorySync(changeBox_inventoryList, isTransaction); + var changeBox_result = await _boxService.BoxInventorySync(changeBox_inventoryList, isTransaction, "0"); if (!changeBox_result.IsSuccess) return changeBox_result; @@ -1584,7 +1584,7 @@ namespace WMS.Web.Domain.Services } //改箱 - var changeBox_result = await _boxService.BoxInventorySync(changeBox_inventoryList, isTransaction); + var changeBox_result = await _boxService.BoxInventorySync(changeBox_inventoryList, isTransaction, "0"); if (!changeBox_result.IsSuccess) return changeBox_result; @@ -1758,7 +1758,7 @@ namespace WMS.Web.Domain.Services } //改箱 - var changeBox_result = await _boxService.BoxInventorySync(changeBox_inventoryList, isTransaction); + var changeBox_result = await _boxService.BoxInventorySync(changeBox_inventoryList, isTransaction, "0"); if (!changeBox_result.IsSuccess) return changeBox_result; @@ -1923,7 +1923,7 @@ namespace WMS.Web.Domain.Services } //改箱 - var changeBox_result = await _boxService.BoxInventorySync(changeBox_inventoryList, isTransaction); + var changeBox_result = await _boxService.BoxInventorySync(changeBox_inventoryList, isTransaction, "0"); if (!changeBox_result.IsSuccess) return changeBox_result; diff --git a/src/WMS.Web.Domain/Services/BoxService.cs b/src/WMS.Web.Domain/Services/BoxService.cs index 20f18a31..60a01c96 100644 --- a/src/WMS.Web.Domain/Services/BoxService.cs +++ b/src/WMS.Web.Domain/Services/BoxService.cs @@ -154,7 +154,7 @@ namespace WMS.Web.Domain.Services /// /// /// - public async Task BoxInventorySync(List list, bool isTransaction = true) + public async Task BoxInventorySync(List list, bool isTransaction = true,string isNotUpdateBoxInv="0") { if (list.Count() == 0) return Result.ReSuccess(); @@ -165,7 +165,7 @@ namespace WMS.Web.Domain.Services { var box = boxs.FirstOrDefault(f => f.Id == db.BoxId); if (box == null) continue; - box.BoxInventory(db); + box.BoxInventory(db, isNotUpdateBoxInv); } _Logger.LogInformation($"即时库存改箱信息 改之后:{JsonConvert.SerializeObject(boxs)}"); IDbContextTransaction _transaction = null;