From 4245c26097e31155e224af4d67a6a4050a4e851a Mon Sep 17 00:00:00 2001 From: majian <780924089@qq.com> Date: Wed, 18 Sep 2024 13:53:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=B0=E5=9C=BA=E9=97=AE=E9=A2=98=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tnb.ProductionMgr/RedisBackGround.cs | 17 +++++++++-------- .../Dto/ErpInputs/ErpRawmatOutstockInput.cs | 8 ++++++++ .../Dto/ErpInputs/SaleShippingInput.cs | 8 ++++++++ .../Dto/ErpInputs/TransferOutstockInput.cs | 8 ++++++++ .../Entity/InventorycheckInput.cs | 10 ++++++++++ .../Tnb.WarehouseMgr/ErpToWmsService.cs | 13 +++++++++++++ .../Tnb.WarehouseMgr/WareHouseService.cs | 11 ++++++----- .../Tnb.WarehouseMgr/WmsPDACarryBindService.cs | 7 ++++++- 8 files changed, 68 insertions(+), 14 deletions(-) diff --git a/ProductionMgr/Tnb.ProductionMgr/RedisBackGround.cs b/ProductionMgr/Tnb.ProductionMgr/RedisBackGround.cs index ce23cc35..1e346ce8 100644 --- a/ProductionMgr/Tnb.ProductionMgr/RedisBackGround.cs +++ b/ProductionMgr/Tnb.ProductionMgr/RedisBackGround.cs @@ -2475,18 +2475,19 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA { if (s_taskFloor4DMC2CPKService.CurrentCount == 0) return; - var Floor4DMC2CPK = await db_Floor4DMC2CPK.Queryable().Where(p => p.key == "Floor4DMC2CPK").FirstAsync(); - // 0则不进行移转 - if (Floor4DMC2CPK != null && Floor4DMC2CPK.value == "0") - { - return; - } - - await s_taskFloor4DMC2CPKService.WaitAsync(); Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); + try { + var Floor4DMC2CPK = await db_Floor4DMC2CPK.Queryable().Where(p => p.key == "Floor4DMC2CPK").FirstAsync(); + // 0则不进行移转 + if (Floor4DMC2CPK != null && Floor4DMC2CPK.value == "0") + { + return; + } + + await s_taskFloor4DMC2CPKService.WaitAsync(); Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} 开始执行四楼灭菌仓到成品库"); LoggerTimer.LogInformation($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} 开始执行四楼灭菌仓到成品库"); diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/ErpInputs/ErpRawmatOutstockInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/ErpInputs/ErpRawmatOutstockInput.cs index 65f64bf5..d5b4fc4c 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/ErpInputs/ErpRawmatOutstockInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/ErpInputs/ErpRawmatOutstockInput.cs @@ -77,5 +77,13 @@ namespace Tnb.WarehouseMgr.Entities.Dto.ErpInputs /// 辅助属性 /// public string auxprop { get; set; } + /// + /// 辅助属性 + /// + public string auxprop_gys { get; set; } + /// + /// 辅助属性 + /// + public string auxprop_xph { get; set; } } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/ErpInputs/SaleShippingInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/ErpInputs/SaleShippingInput.cs index c5ed1ce5..8030ee23 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/ErpInputs/SaleShippingInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/ErpInputs/SaleShippingInput.cs @@ -86,5 +86,13 @@ namespace Tnb.WarehouseMgr.Entities.Dto.ErpInputs /// 辅助属性 /// public string auxprop { get; set; } + /// + /// 辅助属性 + /// + public string auxprop_gys { get; set; } + /// + /// 辅助属性 + /// + public string auxprop_xph { get; set; } } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/ErpInputs/TransferOutstockInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/ErpInputs/TransferOutstockInput.cs index eb38aa52..ca39119f 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/ErpInputs/TransferOutstockInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/ErpInputs/TransferOutstockInput.cs @@ -111,5 +111,13 @@ namespace Tnb.WarehouseMgr.Entities.Dto.ErpInputs /// 辅助属性 /// public string auxprop { get; set; } + /// + /// 辅助属性 + /// + public string auxprop_gys { get; set; } + /// + /// 辅助属性 + /// + public string auxprop_xph { get; set; } } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/InventorycheckInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/InventorycheckInput.cs index 108feca2..da9b5c62 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/InventorycheckInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/InventorycheckInput.cs @@ -82,5 +82,15 @@ namespace Tnb.WarehouseMgr.Entities.Dto.ErpInputs /// 辅助属性 /// public string auxprop { get; set; } + + /// + /// 辅助属性 + /// + public string auxprop_gys { get; set; } + + /// + /// 辅助属性 + /// + public string auxprop_xph { get; set; } } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/ErpToWmsService.cs b/WarehouseMgr/Tnb.WarehouseMgr/ErpToWmsService.cs index e0b0505d..5c7ef114 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/ErpToWmsService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/ErpToWmsService.cs @@ -1353,6 +1353,8 @@ namespace Tnb.WarehouseMgr wmsSaleD.material_specification = material.material_specification; } wmsSaleD.auxprop = detail.auxprop; + wmsSaleD.auxprop_gys = detail.auxprop_gys; + wmsSaleD.auxprop_xph = detail.auxprop_xph; wmsSaleDs.Add(wmsSaleD); } @@ -1557,6 +1559,8 @@ namespace Tnb.WarehouseMgr msRawmatTransferinstockD.matspecification = material.material_specification; } msRawmatTransferinstockD.auxprop = detail.auxprop; + msRawmatTransferinstockD.auxprop_gys = detail.auxprop_gys; + msRawmatTransferinstockD.auxprop_xph = detail.auxprop_xph; wmsRawmatTransferinstockDs.Add(msRawmatTransferinstockD); } @@ -1628,6 +1632,8 @@ namespace Tnb.WarehouseMgr wmsTransferInstockD.material_desc = material.material_specification; } wmsTransferInstockD.auxprop = detail.auxprop; + wmsTransferInstockD.auxprop_gys = detail.auxprop_gys; + wmsTransferInstockD.auxprop_xph = detail.auxprop_xph; wmsTransferInstockDs.Add(wmsTransferInstockD); } @@ -2226,6 +2232,8 @@ namespace Tnb.WarehouseMgr wmsRawmatOutstockD.material_specification = material.material_specification; } wmsRawmatOutstockD.auxprop = detail.auxprop; + wmsRawmatOutstockD.auxprop_gys = detail.auxprop_gys; + wmsRawmatOutstockD.auxprop_xph = detail.auxprop_xph; wmsRawmatOutstockDs.Add(wmsRawmatOutstockD); } @@ -2354,6 +2362,9 @@ namespace Tnb.WarehouseMgr wmsRawmatOutstockD.material_specification = material.material_specification; } + wmsRawmatOutstockD.auxprop = detail.auxprop; + wmsRawmatOutstockD.auxprop_gys = detail.auxprop_gys; + wmsRawmatOutstockD.auxprop_xph = detail.auxprop_xph; wmsRawmatOutstockDs.Add(wmsRawmatOutstockD); } @@ -2514,6 +2525,8 @@ namespace Tnb.WarehouseMgr throw new AppFriendlyException($@"表体明细中单位{detail.unit_code}在wms系统中未找到!", 500); } wmsInventorycheckD.auxprop = detail.auxprop; + wmsInventorycheckD.auxprop_gys = detail.auxprop_gys; + wmsInventorycheckD.auxprop_xph = detail.auxprop_xph; wmsInventorycheckDs.Add(wmsInventorycheckD); } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs index 4804d64b..c4b7857d 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs @@ -581,6 +581,7 @@ namespace Tnb.WarehouseMgr { throw new AppFriendlyException("没有可用策略", 500); } + List items = await cyDb.Queryable().LeftJoin((a, b) => a.id == b.carry_id) .LeftJoin((a, b, c) => a.location_id == c.id) .Where(whereExpr) @@ -3532,10 +3533,10 @@ namespace Tnb.WarehouseMgr string elevatorSno = wmsElevatorH.elevator_code.Replace("Elevator", ""); points.Add(wmsPointHs.Where(r => r.id == pStartId).First()); - points.Add(wmsPointHs.Where(r => r.point_code == $"DT-C-01-0{elevatorSno}").First()); + points.Add(wmsPointHs.Where(r => r.point_code == $"DT-01-0{elevatorSno}").First()); points.Add(wmsPointHs.Where(r => r.point_code == $"DT-1-{elevatorSno}").First()); points.Add(wmsPointHs.Where(r => r.point_code == $"DT-3-{elevatorSno}").First()); - points.Add(wmsPointHs.Where(r => r.point_code == $"DT-R-03-0{elevatorSno}").First()); + points.Add(wmsPointHs.Where(r => r.point_code == $"DT-03-0{elevatorSno}").First()); points.Add(wmsPointHs.Where(r => r.id == pEndId).First()); } // 2-4 @@ -3578,16 +3579,16 @@ namespace Tnb.WarehouseMgr points.Add(wmsPointHs.Where(r => r.id == pEndId).First()); } // 4-3 - if (startlocation.wh_id == WmsWareHouseConst.WAREHOUSE_MJC_ID && endlocation.wh_id == WmsWareHouseConst.WAREHOUSE_CP_ID) + else if (startlocation.wh_id == WmsWareHouseConst.WAREHOUSE_MJC_ID && endlocation.wh_id == WmsWareHouseConst.WAREHOUSE_CP_ID) { WmsElevatorH wmsElevatorH = await _db.Queryable().Where(it => it.elevator_group == "2" && it.enabled == 1).OrderBy(r => r.task_nums).FirstAsync(); string elevatorSno = wmsElevatorH.elevator_code.Replace("Elevator", ""); points.Add(wmsPointHs.Where(r => r.id == pStartId).First()); - points.Add(wmsPointHs.Where(r => r.point_code == $"DT-C-04-0{elevatorSno}").First()); + points.Add(wmsPointHs.Where(r => r.point_code == $"DT-04-0{elevatorSno}").First()); points.Add(wmsPointHs.Where(r => r.point_code == $"DT-4-{elevatorSno}").First()); points.Add(wmsPointHs.Where(r => r.point_code == $"DT-3-{elevatorSno}").First()); - points.Add(wmsPointHs.Where(r => r.point_code == $"DT-R-03-0{elevatorSno}").First()); + points.Add(wmsPointHs.Where(r => r.point_code == $"DT-03-0{elevatorSno}").First()); points.Add(wmsPointHs.Where(r => r.id == pEndId).First()); } else diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryBindService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryBindService.cs index 1921c7fd..76be5300 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryBindService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryBindService.cs @@ -319,7 +319,10 @@ namespace Tnb.WarehouseMgr _ = await _db.Updateable().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => ids.Contains(it.id)).ExecuteCommandAsync(); BasMaterial basMaterial = await _db.Queryable().FirstAsync(it => it.id == input.material_id); - + if (basMaterial == null) + { + throw new Exception($"找不到物料id为{input.material_id}的物料"); + } BindCarryCodeInput bindCarryCodeInput = new BindCarryCodeInput(); bindCarryCodeInput.carry_id = wmsCarryH.id; @@ -361,6 +364,8 @@ namespace Tnb.WarehouseMgr } catch (Exception ex) { + Logger.LogWarning($"外协入库出现异常 {ex.Message}"); + Logger.LogWarning($"外协入库出现异常 {ex.StackTrace}"); await _db.Ado.RollbackTranAsync(); return await ToApiResult(HttpStatusCode.InternalServerError, ex.Message); }