From d3dfe96a161adec9c0c5da36a0faeef6d6fc80e9 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 29 Jun 2023 18:25:39 +0800 Subject: [PATCH] 1 --- .../Tnb.WarehouseMgr/WmsDeliveryService.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs index 94c43365..8b676601 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs @@ -35,7 +35,7 @@ namespace Tnb.WarehouseMgr [Route("api/[area]/[controller]/[action]")] [OverideVisualDev(ModuleConsts.MODULE_WMSDELIVERY_ID)] [ServiceModule(BizTypeId)] - public class WmsDeliveryService : BaseWareHouseService,IOverideVisualDevService, IWmsDeliveryService, IDynamicApiController, ITransient + public class WmsDeliveryService : BaseWareHouseService, IOverideVisualDevService, IWmsDeliveryService, IDynamicApiController, ITransient { private const string BizTypeId = "26125644258853"; private readonly ISqlSugarClient _db; @@ -149,7 +149,7 @@ namespace Tnb.WarehouseMgr preTask.create_time = DateTime.Now; return preTask; }).ToList(); - var isOk = await _wareHouseService.GenPreTask(preTasks,null); + var isOk = await _wareHouseService.GenPreTask(preTasks, null); if (isOk) { if (input.data.ContainsKey(nameof(WmsDelivery.startlocation_id)) && input.data.ContainsKey(nameof(WmsDelivery.endlocation_id)) && input.data[nameof(WmsDelivery.endlocation_id)] != null && input.data[nameof(WmsDelivery.endlocation_id)] != null) @@ -157,11 +157,16 @@ namespace Tnb.WarehouseMgr //查询库位表 var location = await _db.Queryable().SingleAsync(it => it.id == input.data[nameof(WmsDelivery.startlocation_id)].ToString()); { - //载具加锁,增加库位信息 - await _db.Updateable().SetColumns(it => new WmsCarryH { carry_status = ((int)EnumCarryStatus.占用).ToString(), - is_lock = 1, location_id = input.data[nameof(WmsDelivery.startlocation_id)].ToString(), location_code = location.location_code}).Where(it => it.id == input.data[nameof(WmsDelivery.carry_id)].ToString()).ExecuteCommandAsync(); + //载具加锁,增加库位信息 + await _db.Updateable().SetColumns(it => new WmsCarryH + { + carry_status = ((int)EnumCarryStatus.占用).ToString(), + is_lock = 1, + location_id = input.data[nameof(WmsDelivery.startlocation_id)].ToString(), + location_code = location.location_code + }).Where(it => it.id == input.data[nameof(WmsDelivery.carry_id)].ToString()).ExecuteCommandAsync(); } - + //所有库位加锁 var ids = new[] { input.data[nameof(WmsDelivery.startlocation_id)].ToString(), input.data[nameof(WmsDelivery.endlocation_id)].ToString() }; await _db.Updateable().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => ids.Contains(it.id)).ExecuteCommandAsync();