From a5f7ded7d3e12447c93ec994775e63780d140aa7 Mon Sep 17 00:00:00 2001 From: FanLian Date: Tue, 18 Jul 2023 11:35:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E6=BC=8F=EF=BC=8C=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WmsEmptyInstockService.cs | 2 -- .../Tnb.WarehouseMgr/WmsInStockService.cs | 19 +++++++++++-------- .../Tnb.WarehouseMgr/WmsPDAInStockService.cs | 4 ++++ 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyInstockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyInstockService.cs index 0909866f..cb64b15e 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyInstockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyInstockService.cs @@ -187,8 +187,6 @@ namespace Tnb.WarehouseMgr { var carry = await _db.Queryable().SingleAsync(it => it.carry_code == input.carry_code); var loc = await _db.Queryable().SingleAsync(it => it.location_code == input.location_code); - var isMatch = await IsCarryAndLocationMatchByCarryStd(carry, loc); - if (!isMatch) throw new AppFriendlyException("库位与载具规格不匹配", 500); var emptyInstock = await _db.Queryable().FirstAsync(it => it.carry_code == input.carry_code && it.status == WmsWareHouseConst.BILLSTATUS_ADD_ID); if (emptyInstock != null) { diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsInStockService.cs index 2915a375..e47c878a 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsInStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsInStockService.cs @@ -270,10 +270,19 @@ namespace Tnb.WarehouseMgr //入库申请条码明细表 List instockcodes = input.instockcodes.Adapt>(); - var loc = await _db.Queryable().FirstAsync(it => it.location_code == input.instock.location_code && it.is_type != EnumLocationType.存储库位.ToString()); + //入库取终点 //出库起点 + var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = instock?.warehouse_id!, Size = 1 }; + var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput); + WmsPointH sPoint = await _db.Queryable().FirstAsync(it => it.location_id == instock.location_id); + WmsPointH ePoint = await _db.Queryable().FirstAsync(it => it.location_id == endLocations[0].id); + var carry = await _db.Queryable().SingleAsync(it => it.carry_code == input.instock.carry_code); + var loc = await _db.Queryable().FirstAsync(it => it.id == endLocations[0].id); var isMatch = await IsCarryAndLocationMatchByCarryStd(carry, loc); if (!isMatch) throw new AppFriendlyException("库位与载具规格不匹配", 500); + + loc = await _db.Queryable().FirstAsync(it => it.location_code == input.instock.location_code && it.is_type != EnumLocationType.存储库位.ToString()); + //如果数据不全或有误, if (carry.IsNull() || loc.IsNull() || instockds?.Count < 1 || instockcodes?.Count < 1) { @@ -329,13 +338,7 @@ namespace Tnb.WarehouseMgr await _db.Insertable(instockCOdes).CallEntityMethod(it => it.Create(orgId)).ExecuteCommandAsync(); //生成预任务申请 - //入库取终点 //出库起点 - var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = instock?.warehouse_id!, Size = 1 }; - var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput); - WmsPointH sPoint = await _db.Queryable().FirstAsync(it => it.location_id == instock.location_id); - WmsPointH ePoint = await _db.Queryable().FirstAsync(it => it.location_id == endLocations[0].id); - - + if (sPoint != null && ePoint != null) { var points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id); diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs index d1f52154..d18391c3 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs @@ -92,6 +92,10 @@ namespace Tnb.WarehouseMgr } if (endLocations?.Count > 0) { + var carry = await _db.Queryable().SingleAsync(it => it.id == input.data[nameof(WmsCarryD.carry_id)].ToString()); + var loc = await _db.Queryable().SingleAsync(it => it.id == endLocations[0].id); + var isMatch = await IsCarryAndLocationMatchByCarryStd(carry, loc); + if (!isMatch) throw new AppFriendlyException("库位与载具规格不匹配", 500); ePoint = await _db.Queryable().FirstAsync(it => it.location_id == endLocations[0].id); }