From 90156f4dfde449056c294576edb14a4fc9f4c79a Mon Sep 17 00:00:00 2001 From: FanLian Date: Fri, 16 Jun 2023 15:15:19 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E8=BD=BD=E5=85=B7=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E3=80=81=E8=BD=BD=E5=85=B7=E8=A7=A3=E7=BB=91=EF=BC=9A=E6=B8=85?= =?UTF-8?q?=E7=90=86=E4=B8=8D=E7=94=A8=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WarehouseMgr/Tnb.WarehouseMgr/WmsCarryBindService.cs | 8 +------- WarehouseMgr/Tnb.WarehouseMgr/WmsCarryUnbindService.cs | 9 ++------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryBindService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryBindService.cs index 7d486bf9..d3a395a2 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryBindService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryBindService.cs @@ -35,23 +35,17 @@ namespace Tnb.WarehouseMgr private readonly ISqlSugarClient _db; private readonly IRunService _runService; private readonly IVisualDevService _visualDevService; - private readonly IWareHouseService _wareHouseService; - private readonly IBillRullService _billRullService; private readonly IUserManager _userManager; public WmsCarryBindService( ISqlSugarRepository repository, IRunService runService, IVisualDevService visualDevService, - IWareHouseService wareHouseService, - IUserManager userManager, - IBillRullService billRullService) + IUserManager userManager) { _db = repository.AsSugarClient(); _runService = runService; _visualDevService = visualDevService; - _wareHouseService = wareHouseService; _userManager = userManager; - _billRullService = billRullService; OverideFuncs.CreateAsync = CarryBind; } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryUnbindService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryUnbindService.cs index dbb7daf3..cfa60d8b 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryUnbindService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryUnbindService.cs @@ -35,23 +35,18 @@ namespace Tnb.WarehouseMgr private readonly ISqlSugarClient _db; private readonly IRunService _runService; private readonly IVisualDevService _visualDevService; - private readonly IWareHouseService _wareHouseService; - private readonly IBillRullService _billRullService; private readonly IUserManager _userManager; public WmsCarryUnbindService( ISqlSugarRepository repository, IRunService runService, IVisualDevService visualDevService, - IWareHouseService wareHouseService, - IUserManager userManager, - IBillRullService billRullService) + + IUserManager userManager) { _db = repository.AsSugarClient(); _runService = runService; _visualDevService = visualDevService; - _wareHouseService = wareHouseService; _userManager = userManager; - _billRullService = billRullService; OverideFuncs.CreateAsync = CarryUnbind; } From 5f8ab0c9e27efefaa3cf5e27626d7123557b3186 Mon Sep 17 00:00:00 2001 From: hlb <894797954@qq.com> Date: Fri, 16 Jun 2023 15:21:07 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=B1=BB=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs | 2 +- WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs | 2 +- .../Tnb.WarehouseMgr/WmsPDAExceptionCompleteService.cs | 4 ++-- .../Tnb.WarehouseMgr/WmsPDAExceptionReexcuteService.cs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs index 103d3016..7362a54b 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs @@ -57,7 +57,7 @@ namespace Tnb.WarehouseMgr _runService = runService; _visualDevService = visualDevService; _basLocationService = basLocationService; - //OverideFuncs.CreateAsync = Create; + OverideFuncs.CreateAsync = Create; } /// /// 根据载具编号获取起始库位点 diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs index e75fab6a..88b53868 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs @@ -56,7 +56,7 @@ namespace Tnb.WarehouseMgr _runService = runService; _visualDevService = visualDevService; _basLocationService = basLocationService; - //OverideFuncs.CreateAsync = Create; + OverideFuncs.CreateAsync = Create; } /// /// 根据载具编号获取起始库位点 diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionCompleteService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionCompleteService.cs index 550289fb..1bfe6b43 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionCompleteService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionCompleteService.cs @@ -53,10 +53,10 @@ namespace Tnb.WarehouseMgr _wareHouseService = wareHouseService; _userManager = userManager; _billRullService = billRullService; - OverideFuncs.CreateAsync = ExceptionCancel; + OverideFuncs.CreateAsync = ExceptionComplete; } - private async Task ExceptionCancel(VisualDevModelDataCrInput input) + private async Task ExceptionComplete(VisualDevModelDataCrInput input) { try diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionReexcuteService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionReexcuteService.cs index 10551597..0ce755de 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionReexcuteService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionReexcuteService.cs @@ -52,10 +52,10 @@ namespace Tnb.WarehouseMgr _wareHouseService = wareHouseService; _userManager = userManager; _billRullService = billRullService; - OverideFuncs.CreateAsync = ExceptionCancel; + OverideFuncs.CreateAsync = ExceptionReexcute; } - private async Task ExceptionCancel(VisualDevModelDataCrInput input) + private async Task ExceptionReexcute(VisualDevModelDataCrInput input) { try From 4229d602713c84aa76e0cc3523476327d0897d71 Mon Sep 17 00:00:00 2001 From: FanLian Date: Fri, 16 Jun 2023 15:46:23 +0800 Subject: [PATCH 3/6] 1 --- .../Tnb.WarehouseMgr/WmsCarryBindService.cs | 42 ++++++++++++------- .../Tnb.WarehouseMgr/WmsCarryUnbindService.cs | 12 +++++- 2 files changed, 38 insertions(+), 16 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryBindService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryBindService.cs index d3a395a2..0cebc9d1 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryBindService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryBindService.cs @@ -84,21 +84,33 @@ namespace Tnb.WarehouseMgr if (!isOk) throw Oops.Oh(ErrorCode.COM1001); } - /* //更新主载具明细表,增加新的数据 - var row = await _db.Insertable(new WmsCarryD { - id = SnowflakeIdHelper.NextId(), - org_id = carry.org_id, - carry_id = carry.id, - membercarry_id = subCarry.id, - membercarry_code = subCarry.carry_code, - loc = input.data[nameof(WmsCarrybindH.loc)].ToString(), - create_id = _userManager.UserId, - create_time = DateTime.Now - }) - .ExecuteCommandAsync(); - if (row <= 0) throw Oops.Oh(ErrorCode.COM1000); - _db.Updateable().SetColumns(it=>it.carry_status == "1").Where(it=>it.id == input.data[nameof(WmsCarrybindH.carry_id)].ToString());*/ - await _db.Ado.CommitTranAsync(); + else + { + if (carry == null) + { + throw new AppFriendlyException("没有可用的主载具", 500); + } + if (subCarry == null) + { + throw new AppFriendlyException("没有可用的子载具", 500); + } + + } + /* //更新主载具明细表,增加新的数据 + var row = await _db.Insertable(new WmsCarryD { + id = SnowflakeIdHelper.NextId(), + org_id = carry.org_id, + carry_id = carry.id, + membercarry_id = subCarry.id, + membercarry_code = subCarry.carry_code, + loc = input.data[nameof(WmsCarrybindH.loc)].ToString(), + create_id = _userManager.UserId, + create_time = DateTime.Now + }) + .ExecuteCommandAsync(); + if (row <= 0) throw Oops.Oh(ErrorCode.COM1000); + _db.Updateable().SetColumns(it=>it.carry_status == "1").Where(it=>it.id == input.data[nameof(WmsCarrybindH.carry_id)].ToString());*/ + await _db.Ado.CommitTranAsync(); } catch (Exception ex) { diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryUnbindService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryUnbindService.cs index cfa60d8b..0ff573bc 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryUnbindService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryUnbindService.cs @@ -75,7 +75,17 @@ namespace Tnb.WarehouseMgr row = await _db.Updateable(subCarry).ExecuteCommandAsync(); isOk = (row > 0); if (!isOk) throw Oops.Oh(ErrorCode.COM1001); - + } + else + { + if (carry == null) + { + throw new AppFriendlyException("没有可用的主载具", 500); + } + if (subCarry == null) + { + throw new AppFriendlyException("没有可用的子载具", 500); + } } await _db.Ado.CommitTranAsync(); From 5c21b4fc88e700e970e123d12372303bf4632fa4 Mon Sep 17 00:00:00 2001 From: FanLian Date: Fri, 16 Jun 2023 16:16:06 +0800 Subject: [PATCH 4/6] 1 --- WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs index b5e68a47..d9723a8d 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs @@ -77,7 +77,7 @@ namespace Tnb.WarehouseMgr var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);*/ //出库取起点,获取所有符合输入的载具规格的载具 - var setQty = await _db.Queryable().FirstAsync(it => it.bill_code == input.data[nameof(WmsEmptyOutstockH.bill_code)]); + var setQty = await _db.Queryable().FirstAsync(it => it.bill_code == input.data[nameof(WmsEmptyOutstockH.bill_code)].ToString()); var carrys = await _db.Queryable().LeftJoin((a, b) => a.location_id == b.id) .Select((a,b) => new { From 32c3de6dac6832e2d76cf5e7de1b2d82ac4c8db8 Mon Sep 17 00:00:00 2001 From: hlb <894797954@qq.com> Date: Fri, 16 Jun 2023 16:28:37 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E5=9B=9E=E6=9B=B4=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WmsCarryMoveOutStockService.cs | 7 ++++- .../Tnb.WarehouseMgr/WmsDeliveryService.cs | 24 ++++++++------- .../WmsEmptyInstockService.cs | 4 ++- .../WmsEmptyOutstockService .cs | 17 +++++------ .../WmsPDACarryMoveInStockService.cs | 7 ++++- .../WmsPDACarryMoveOutStockService.cs | 8 ++++- .../Tnb.WarehouseMgr/WmsPDADeliveryService.cs | 29 ++++++++++++------- .../WmsPDAEmptyInstockService.cs | 5 ++-- .../WmsPDAEmptyOutstockService .cs | 16 +++++----- .../Tnb.WarehouseMgr/WmsPDATransferService.cs | 27 ++++++++++------- .../Tnb.WarehouseMgr/WmsTransferService.cs | 27 ++++++++++------- 11 files changed, 107 insertions(+), 64 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveOutStockService.cs index 5ded01a5..4def37fe 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveOutStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveOutStockService.cs @@ -124,7 +124,12 @@ namespace Tnb.WarehouseMgr preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList(); preTaskUpInput.PreTaskRecords = preTasks.Adapt>(); preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId()); - await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput, null, null); + //根据载具移出Id,回更单据状态 + await _db.Updateable().SetColumns(it => new WmsMoveOutstock { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync(); + + await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput, + it => new WmsCarryH { is_lock = 1, location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode }, + it => new BasLocation { is_lock = 1 }); } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs index 7362a54b..a36a1dd7 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs @@ -152,16 +152,20 @@ namespace Tnb.WarehouseMgr var isOk = await _wareHouseService.GenPreTask(preTasks,null); if (isOk) { - //不需要插入操作表 - /* var preTaskUpInput = new GenPreTaskUpInput(); - preTaskUpInput.PreTaskId = input.data["ReturnIdentity"].ToString(); - preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!; - preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id; - preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code; - preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList(); - preTaskUpInput.PreTaskRecords = preTasks.Adapt>(); - preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId()); - await _wareHouseService.GenTaskHandleAfter(preTaskUpInput);*/ + 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) + { + //查询库位表 + 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(); + } + + //所有库位加锁 + 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(); + } } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyInstockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyInstockService.cs index b9052459..883caf0e 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyInstockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyInstockService.cs @@ -142,7 +142,9 @@ namespace Tnb.WarehouseMgr //根据空载具入库Id,回更单据状态 await _db.Updateable().SetColumns(it => new WmsEmptyInstock { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync(); - await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,null,null); + await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput, + it => new WmsCarryH { is_lock = 1, location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode }, + it => new BasLocation { is_lock = 1 }); } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs index b5e68a47..c4924038 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs @@ -21,6 +21,7 @@ using Tnb.WarehouseMgr.Entities; using Tnb.WarehouseMgr.Entities.Attributes; using Tnb.WarehouseMgr.Entities.Consts; using Tnb.WarehouseMgr.Entities.Dto; +using Tnb.WarehouseMgr.Entities.Enums; using Tnb.WarehouseMgr.Interfaces; namespace Tnb.WarehouseMgr @@ -141,15 +142,13 @@ namespace Tnb.WarehouseMgr var isOk = await _wareHouseService.GenPreTask(preTasks,null); if (isOk) { - var preTaskUpInput = new GenPreTaskUpInput(); - preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString(); - preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!; - preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id; - preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code; - preTaskUpInput.LocationIds = points.Select(x => x.id).ToList(); - preTaskUpInput.PreTaskRecords = preTasks.Adapt>(); - preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId()); - await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,null,null); + //所有载具加锁 + var ids = carrys.Select(x => x.carry_id).ToList(); + await _db.Updateable().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => ids.Contains(it.id)).ExecuteCommandAsync(); + //所有库位加锁 + var loc = carrys.Select(x => x.location_id).ToList(); + await _db.Updateable().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => loc.Contains(it.id)).ExecuteCommandAsync(); + } } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveInStockService.cs index 7aa45c35..2127ef2d 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveInStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveInStockService.cs @@ -127,7 +127,12 @@ namespace Tnb.WarehouseMgr preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList(); preTaskUpInput.PreTaskRecords = preTasks.Adapt>(); preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId()); - await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput, null, null); + //根据载具移入Id,回更单据状态 + await _db.Updateable().SetColumns(it => new WmsMoveInstock { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync(); + + await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput, + it => new WmsCarryH { is_lock = 1, location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode }, + it => new BasLocation { is_lock = 1 }); } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveOutStockService.cs index 7fffb397..3995219f 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveOutStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveOutStockService.cs @@ -122,9 +122,15 @@ namespace Tnb.WarehouseMgr preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id; preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code; preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList(); + preTaskUpInput.PreTaskRecords = preTasks.Adapt>(); preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId()); - await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,null,null); + //根据载具移出Id,回更单据状态 + await _db.Updateable().SetColumns(it => new WmsMoveOutstock { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync(); + + await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput, + it => new WmsCarryH { is_lock = 1, location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode }, + it => new BasLocation { is_lock = 1 }); } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs index 88b53868..53c2a70d 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs @@ -151,16 +151,25 @@ namespace Tnb.WarehouseMgr var isOk = await _wareHouseService.GenPreTask(preTasks,null); if (isOk) { - //不需要插入操作表 - /* var preTaskUpInput = new GenPreTaskUpInput(); - preTaskUpInput.PreTaskId = input.data["ReturnIdentity"].ToString(); - preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!; - preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id; - preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code; - preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList(); - preTaskUpInput.PreTaskRecords = preTasks.Adapt>(); - preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId()); - await _wareHouseService.GenTaskHandleAfter(preTaskUpInput);*/ + f(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) + { + //查询库位表 + 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(); + } + + //所有库位加锁 + 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(); + } } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyInstockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyInstockService.cs index 9a748c50..195c4813 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyInstockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyInstockService.cs @@ -140,8 +140,9 @@ namespace Tnb.WarehouseMgr preTaskUpInput.PreTaskRecord = handleH; //根据空载具入库Id,回更单据状态 await _db.Updateable().SetColumns(it => new WmsEmptyInstock { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync(); - - await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,null,null); + await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput, + it => new WmsCarryH { is_lock = 1, location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode }, + it => new BasLocation { is_lock = 1 }); } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyOutstockService .cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyOutstockService .cs index e8e0d87e..f6086b8d 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyOutstockService .cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyOutstockService .cs @@ -141,15 +141,13 @@ namespace Tnb.WarehouseMgr var isOk = await _wareHouseService.GenPreTask(preTasks,null); if (isOk) { - var preTaskUpInput = new GenPreTaskUpInput(); - preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString(); - preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!; - preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id; - preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code; - preTaskUpInput.LocationIds = points.Select(x => x.id).ToList(); - preTaskUpInput.PreTaskRecords = preTasks.Adapt>(); - preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId()); - await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput, null, null); + //所有载具加锁 + var ids = carrys.Select(x => x.carry_id).ToList(); + await _db.Updateable().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => ids.Contains(it.id)).ExecuteCommandAsync(); + //所有库位加锁 + var loc = carrys.Select(x => x.location_id).ToList(); + await _db.Updateable().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => loc.Contains(it.id)).ExecuteCommandAsync(); + } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDATransferService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDATransferService.cs index 128b1b23..6a4766df 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDATransferService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDATransferService.cs @@ -22,6 +22,7 @@ using Tnb.WarehouseMgr.Entities; using Tnb.WarehouseMgr.Entities.Attributes; using Tnb.WarehouseMgr.Entities.Consts; using Tnb.WarehouseMgr.Entities.Dto; +using Tnb.WarehouseMgr.Entities.Enums; using Tnb.WarehouseMgr.Interfaces; namespace Tnb.WarehouseMgr { @@ -115,16 +116,22 @@ namespace Tnb.WarehouseMgr var isOk = await _wareHouseService.GenPreTask(preTasks, null); if (isOk) { - //不需要插入操作表 - /* var preTaskUpInput = new GenPreTaskUpInput(); - preTaskUpInput.PreTaskId = input.data["ReturnIdentity"].ToString(); - preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!; - preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id; - preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code; - preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList(); - preTaskUpInput.PreTaskRecords = preTasks.Adapt>(); - preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId()); - await _wareHouseService.GenTaskHandleAfter(preTaskUpInput);*/ + //查询库位表 + var location = await _db.Queryable().SingleAsync(it => it.id == input.data[nameof(WmsTransfer.startlocation_id)].ToString()); + { + //载具加锁,增加库位信息 + await _db.Updateable().SetColumns(it => new WmsCarryH + { + carry_status = ((int)EnumCarryStatus.占用).ToString(), + is_lock = 1, + location_id = input.data[nameof(WmsTransfer.startlocation_id)].ToString(), + location_code = location.location_code + }).Where(it => it.id == input.data[nameof(WmsTransfer.carry_id)].ToString()).ExecuteCommandAsync(); + } + + //所有库位加锁 + var ids = new[] { input.data[nameof(WmsTransfer.startlocation_id)].ToString(), input.data[nameof(WmsTransfer.endlocation_id)].ToString() }; + await _db.Updateable().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => ids.Contains(it.id)).ExecuteCommandAsync(); } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsTransferService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsTransferService.cs index d8f21d47..844c41c6 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsTransferService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsTransferService.cs @@ -22,6 +22,7 @@ using Tnb.WarehouseMgr.Entities; using Tnb.WarehouseMgr.Entities.Attributes; using Tnb.WarehouseMgr.Entities.Consts; using Tnb.WarehouseMgr.Entities.Dto; +using Tnb.WarehouseMgr.Entities.Enums; using Tnb.WarehouseMgr.Interfaces; namespace Tnb.WarehouseMgr { @@ -115,16 +116,22 @@ namespace Tnb.WarehouseMgr var isOk = await _wareHouseService.GenPreTask(preTasks,null); if (isOk) { - //不需要插入操作表 - /* var preTaskUpInput = new GenPreTaskUpInput(); - preTaskUpInput.PreTaskId = input.data["ReturnIdentity"].ToString(); - preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!; - preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id; - preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code; - preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList(); - preTaskUpInput.PreTaskRecords = preTasks.Adapt>(); - preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId()); - await _wareHouseService.GenTaskHandleAfter(preTaskUpInput);*/ + //查询库位表 + var location = await _db.Queryable().SingleAsync(it => it.id == input.data[nameof(WmsTransfer.startlocation_id)].ToString()); + { + //载具加锁,增加库位信息 + await _db.Updateable().SetColumns(it => new WmsCarryH + { + carry_status = ((int)EnumCarryStatus.占用).ToString(), + is_lock = 1, + location_id = input.data[nameof(WmsTransfer.startlocation_id)].ToString(), + location_code = location.location_code + }).Where(it => it.id == input.data[nameof(WmsTransfer.carry_id)].ToString()).ExecuteCommandAsync(); + } + + //所有库位加锁 + var ids = new[] { input.data[nameof(WmsTransfer.startlocation_id)].ToString(), input.data[nameof(WmsTransfer.endlocation_id)].ToString() }; + await _db.Updateable().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => ids.Contains(it.id)).ExecuteCommandAsync(); } } From 3cb377cb86b24c06d9b6dae03f508e05d8ae7cc2 Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Fri, 16 Jun 2023 16:59:53 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E6=8A=95=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Consts/DictionaryConstants.cs | 10 ++ .../Entity/PrdFeedingD.cs | 57 ++++++++ .../Entity/PrdFeedingH.cs | 102 +++++++++++++ .../Entity/PrdMaterialReceiptD.cs | 15 ++ .../IPrdFeedingService.cs | 18 +++ .../IPrdMaterialReceiptService.cs | 5 + .../Tnb.ProductionMgr/PrdFeedingService.cs | 138 ++++++++++++++++++ .../PrdMaterialReceiptService.cs | 13 +- .../Consts/WmsCarryConst.cs | 5 - 9 files changed, 352 insertions(+), 11 deletions(-) create mode 100644 ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdFeedingD.cs create mode 100644 ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdFeedingH.cs create mode 100644 ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdFeedingService.cs create mode 100644 ProductionMgr/Tnb.ProductionMgr/PrdFeedingService.cs diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Consts/DictionaryConstants.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Consts/DictionaryConstants.cs index a72a4fcb..a97b121c 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Consts/DictionaryConstants.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Consts/DictionaryConstants.cs @@ -19,6 +19,16 @@ namespace Tnb.ProductionMgr.Entities.Consts /// 待排产 /// public const string WaitProductId = "25019244276501"; + + /// + /// 物料签收编码 + /// + public const string MATERIAL_RECEIPT_CODE = "MaterialReceipt"; + + /// + /// 生产投料编码 + /// + public const string FEEDING_CODE = "Feeding"; } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdFeedingD.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdFeedingD.cs new file mode 100644 index 00000000..29bc4b6c --- /dev/null +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdFeedingD.cs @@ -0,0 +1,57 @@ +using JNPF.Common.Contracts; +using JNPF.Common.Security; +using SqlSugar; + +namespace Tnb.ProductionMgr.Entities; + +/// +/// 生产投料子表 +/// +[SugarTable("prd_feeding_d")] +public partial class PrdFeedingD : BaseEntity +{ + public PrdFeedingD() + { + id = SnowflakeIdHelper.NextId(); + } + /// + /// 生产投料id + /// + public string feeding_id { get; set; } = string.Empty; + + /// + /// 物料id + /// + public string material_id { get; set; } = string.Empty; + + /// + /// 数量 + /// + public decimal num { get; set; } + + /// + /// 批次 + /// + public string? batch { get; set; } + + /// + /// 单位id + /// + public string? unit_id { get; set; } + + /// + /// 载具id + /// + public string carry_id { get; set; } = string.Empty; + + /// + /// 物料签收单id + /// + public string? material_receipt_id { get; set; } + + /// + /// 物料签收单子表id + /// + public string? material_receipt_detail_id { get; set; } + +} \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdFeedingH.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdFeedingH.cs new file mode 100644 index 00000000..c761f0ec --- /dev/null +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdFeedingH.cs @@ -0,0 +1,102 @@ +using JNPF.Common.Contracts; +using JNPF.Common.Security; +using SqlSugar; + +namespace Tnb.ProductionMgr.Entities; + +/// +/// 生产投料主表 +/// +[SugarTable("prd_feeding_h")] +public partial class PrdFeedingH : BaseEntity +{ + public PrdFeedingH() + { + id = SnowflakeIdHelper.NextId(); + } + /// + /// 工位id + /// + public string station_id { get; set; } = string.Empty; + + /// + /// 任务单id + /// + public string? mo_task_id { get; set; } + + /// + /// 工序id + /// + public string? process_id { get; set; } + + /// + /// 设备id + /// + public string? equip_id { get; set; } + + /// + /// 车间id + /// + public string? workshop_id { get; set; } + + /// + /// 载具id + /// + public string? carry_id { get; set; } + + /// + /// 产线id + /// + public string? workline_id { get; set; } + + /// + /// 创建用户 + /// + public string? create_id { get; set; } + + /// + /// 创建时间 + /// + public DateTime? create_time { get; set; } + + /// + /// 二维码信息 + /// + public string? carry_code { get; set; } + + /// + /// 备注 + /// + public string? remark { get; set; } + + /// + /// 流程引擎Id + /// + public string? f_flowid { get; set; } + + /// + /// 流程任务Id + /// + public string? f_flowtaskid { get; set; } + + /// + /// 所属组织 + /// + public string? org_id { get; set; } + + /// + /// 生产bom工序id + /// + public string? mbom_process_id { get; set; } + + /// + /// 投料单号 + /// + public string code { get; set; } = string.Empty; + + /// + /// 物料签收单id + /// + public string? material_receipt_id { get; set; } + +} \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMaterialReceiptD.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMaterialReceiptD.cs index dec2b972..71ade71f 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMaterialReceiptD.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMaterialReceiptD.cs @@ -39,4 +39,19 @@ public partial class PrdMaterialReceiptD : BaseEntity /// public string? unit_id { get; set; } + /// + /// 载具id + /// + public string carry_id { get; set; } = string.Empty; + + /// + /// 是否全部投料 + /// + public int is_all_feeding { get; set; } + + /// + /// 已投料数量 + /// + public decimal feeding_num { get; set; } + } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdFeedingService.cs b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdFeedingService.cs new file mode 100644 index 00000000..0cbfd649 --- /dev/null +++ b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdFeedingService.cs @@ -0,0 +1,18 @@ +using Tnb.ProductionMgr.Entities.Dto; + +namespace Tnb.ProductionMgr.Interfaces +{ + /// + /// 物料签收服务接口 + /// + public interface IPrdFeedingService + { + + /// + /// 保存数据 + /// + /// + /// + public Task SaveData(MaterialReceiptInput input); + } +} \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdMaterialReceiptService.cs b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdMaterialReceiptService.cs index 3810560c..460fbbcc 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdMaterialReceiptService.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdMaterialReceiptService.cs @@ -14,6 +14,11 @@ namespace Tnb.ProductionMgr.Interfaces /// public Task GetInfoByQrCode(string qrCode); + /// + /// 保存数据 + /// + /// + /// public Task SaveData(MaterialReceiptInput input); } } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdFeedingService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdFeedingService.cs new file mode 100644 index 00000000..06c5e640 --- /dev/null +++ b/ProductionMgr/Tnb.ProductionMgr/PrdFeedingService.cs @@ -0,0 +1,138 @@ +using JNPF.Common.Core.Manager; +using JNPF.Common.Enums; +using JNPF.Common.Security; +using JNPF.DependencyInjection; +using JNPF.DynamicApiController; +using JNPF.FriendlyException; +using JNPF.Systems.Interfaces.System; +using Microsoft.AspNetCore.Mvc; +using Microsoft.ClearScript.Util.Web; +using SqlSugar; +using Tnb.BasicData.Entities; +using Tnb.ProductionMgr.Entities; +using Tnb.ProductionMgr.Entities.Dto; +using Tnb.ProductionMgr.Interfaces; +using Tnb.ProductionMgr.Entities.Consts; + +namespace Tnb.ProductionMgr +{ + /// + /// 业务实现:物料签收 + /// + [ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 700)] + [Route("api/[area]/[controller]/[action]")] + public class PrdFeedingService : IPrdFeedingService, IDynamicApiController, ITransient + { + private readonly ISqlSugarRepository _repository; + private readonly IUserManager _userManager; + private readonly IBillRullService _billRullService; + + + public PrdFeedingService( + ISqlSugarRepository repository, + IBillRullService billRullService, + IUserManager userManager + ) + { + _repository = repository; + _userManager = userManager; + _billRullService = billRullService; + } + + + [HttpPost] + public async Task SaveData(MaterialReceiptInput input) + { + var db = _repository.AsSugarClient(); + DbResult result = await db.Ado.UseTranAsync(async () => + { + var moTask = await db.Queryable().FirstAsync(x => x.id == input.mo_task_id); + var inputMaterials = await db.Queryable() + .Where(x => x.mbom_id == moTask.bom_id && x.mbom_process_id == input.mbom_process_id) + .Select(x=>x.material_id) + .ToListAsync(); + + string code = await _billRullService.GetBillNumber(MoStatus.FEEDING_CODE); + PrdFeedingH prdFeedingH = new PrdFeedingH() + { + code = code, + station_id = input.station_id, + mo_task_id = input.mo_task_id, + process_id = input.process_id, + equip_id = input.equip_id, + workshop_id = input.workshop_id, + carry_id = input.carry_id, + workline_id = input.workline_id, + carry_code = input.carry_code, + remark = input.remark, + mbom_process_id = input.mbom_process_id, + create_id = _userManager.UserId, + create_time = DateTime.Now, + org_id = _userManager.GetUserInfo().Result.organizeId + }; + + List list = new List(); + if (input.details != null && input.details.Count > 0) + { + foreach (var item in input.details) + { + if(!inputMaterials.Contains(item["material_id"])) + throw new Exception("该物料不是生产bom投入物料,不能签收"); + + var detail = await db.Queryable() + .Where(x => x.carry_id == input.carry_id && x.is_all_feeding == 0).FirstAsync(); + decimal num = Convert.ToDecimal(item["num"]); + list.Add(new PrdFeedingD + { + feeding_id = prdFeedingH.id, + material_receipt_detail_id = detail?.id, + material_id = item["material_id"], + num = num, + batch = item["batch"], + unit_id = item["unit_id"], + carry_id = input.carry_id, + }); + + if (detail != null) + { + if(detail.feeding_num + num > detail.num) + { + throw new Exception("投料数量不能大于签收数量"); + }else if (detail.feeding_num + num == detail.num) + { + await db.Updateable() + .SetColumns(x => x.feeding_num == x.feeding_num + num) + .SetColumns(x => x.is_all_feeding == 1) + .Where(x => x.id == detail.id) + .ExecuteCommandAsync(); + } + else + { + await db.Updateable() + .SetColumns(x => x.feeding_num == x.feeding_num + num) + .Where(x => x.id == detail.id) + .ExecuteCommandAsync(); + } + } + else + { + throw new Exception("没有签收单,无法投料"); + } + } + } + else + { + throw new Exception("没有签收物料"); + } + + + await db.Insertable(prdFeedingH).ExecuteCommandAsync(); + await db.Insertable(list).ExecuteCommandAsync(); + + }); + + if(!result.IsSuccess) throw Oops.Oh(result.ErrorMessage); + return result.IsSuccess ? "签收成功" : result.ErrorMessage; + } + } +} \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs index 5493423d..7a2baec7 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs @@ -6,16 +6,14 @@ using JNPF.DynamicApiController; using JNPF.FriendlyException; using JNPF.Systems.Interfaces.System; using Microsoft.AspNetCore.Mvc; -using Microsoft.ClearScript.Util.Web; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.ProductionMgr.Entities; using Tnb.ProductionMgr.Entities.Dto; -using Tnb.ProductionMgr.Entities.Dto.PrdManage; using Tnb.ProductionMgr.Interfaces; using Tnb.WarehouseMgr.Entities; using Tnb.WarehouseMgr.Entities.Dto; -using Tnb.WarehouseMgr.Entities.Consts; +using Tnb.ProductionMgr.Entities.Consts; namespace Tnb.ProductionMgr { @@ -26,13 +24,13 @@ namespace Tnb.ProductionMgr [Route("api/[area]/[controller]/[action]")] public class PrdMaterialReceiptService : IPrdMaterialReceiptService, IDynamicApiController, ITransient { - private readonly ISqlSugarRepository _repository; + private readonly ISqlSugarRepository _repository; private readonly IUserManager _userManager; private readonly IBillRullService _billRullService; public PrdMaterialReceiptService( - ISqlSugarRepository repository, + ISqlSugarRepository repository, IBillRullService billRullService, IUserManager userManager ) @@ -81,7 +79,7 @@ namespace Tnb.ProductionMgr .Select(x=>x.material_id) .ToListAsync(); - string code = await _billRullService.GetBillNumber(WmsCarryConst.MATERIAL_RECEIPT_CODE); + string code = await _billRullService.GetBillNumber(MoStatus.MATERIAL_RECEIPT_CODE); PrdMaterialReceiptH prdMaterialReceiptH = new PrdMaterialReceiptH() { code = code, @@ -115,6 +113,9 @@ namespace Tnb.ProductionMgr num = Convert.ToDecimal(item["num"]), batch = item["batch"], unit_id = item["unit_id"], + carry_id = input.carry_id, + is_all_feeding = 0, + feeding_num = 0, }); } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsCarryConst.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsCarryConst.cs index 468463fd..df345851 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsCarryConst.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsCarryConst.cs @@ -13,11 +13,6 @@ namespace Tnb.WarehouseMgr.Entities.Consts /// public const string WMS_CARRY_REPLACE_ENCODE = "WmsCarryReplace"; - /// - /// 物料签收编码 - /// - public const string MATERIAL_RECEIPT_CODE = "MaterialReceipt"; - } }