diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsHandleCode.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsHandleCode.cs index 4d421b74..591b7576 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsHandleCode.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsHandleCode.cs @@ -47,7 +47,7 @@ public partial class WmsHandleCode : BaseEntity /// /// 条码数量 /// - public int codeqty { get; set; } + public decimal codeqty { get; set; } /// /// 单位ID diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAScanInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAScanInStockService.cs index 11e7004a..2a32939c 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAScanInStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAScanInStockService.cs @@ -20,6 +20,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 @@ -131,6 +132,7 @@ namespace Tnb.WarehouseMgr await _db.Insertable(instockD).ExecuteCommandAsync(); await _db.Insertable(instockCode).ExecuteCommandAsync(); + var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = "26103372441637", Size = 1 }; var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput); WmsPointH sPoint = new(); @@ -200,6 +202,7 @@ namespace Tnb.WarehouseMgr var isOk = await _wareHouseService.GenPreTask(preTasks, pretaskCodes); if (isOk) { + var preTaskUpInput = new GenPreTaskUpInput(); preTaskUpInput.RquireId = instock.id; preTaskUpInput.CarryId = carry.id; @@ -207,6 +210,7 @@ namespace Tnb.WarehouseMgr preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!; preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!; + //生成操作记录 WmsHandleH handleH = new(); handleH.org_id = _userManager.User.OrganizeId; handleH.startlocation_id = loc.id; @@ -220,12 +224,35 @@ namespace Tnb.WarehouseMgr handleH.create_id = _userManager.UserId; handleH.create_time = DateTime.Now; preTaskUpInput.PreTaskRecord = handleH; - //根据载具移入Id,回更单据状态 - await _db.Updateable().SetColumns(it => new WmsInstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync(); + //生成操作记录条码表 + WmsHandleCode handleCode = instockCode.Adapt(); + handleCode.id = SnowflakeIdHelper.NextId(); + handleCode.org_id = _userManager.User.OrganizeId; + handleCode.bill_id = handleH.id; + handleCode.create_id = _userManager.UserId; + handleCode.create_time = DateTime.Now; + preTaskUpInput.PreTaskHandleCodes.Add(handleCode); + + //生成载具条码表 + WmsCarryCode wmsCarryCode = instockCode.Adapt(); + { + wmsCarryCode.id = SnowflakeIdHelper.NextId(); + wmsCarryCode.carry_id = carry.id; + wmsCarryCode.is_out = 0; + wmsCarryCode.location_id = loc.id; + wmsCarryCode.location_code = loc.location_code; + wmsCarryCode.warehouse_id = instock.warehouse_id; + } + await _db.Insertable(wmsCarryCode).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 }); + it => new WmsCarryH { carry_code = instock!.carry_code!, is_lock = 1, carry_status = ((int)EnumCarryStatus.占用).ToString(), location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode }, + it => new BasLocation { is_lock = 1, is_use = ((int)EnumCarryStatus.占用).ToString() }); + await _db.Updateable().SetColumns(it => new WmsInstockD { line_status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => instockCode.bill_d_id == it.id).ExecuteCommandAsync(); + await _db.Updateable().SetColumns(it => new WmsInstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == instock!.id).ExecuteCommandAsync(); + } } } diff --git a/apihost/Tnb.API.Entry/Tnb.API.Entry.csproj b/apihost/Tnb.API.Entry/Tnb.API.Entry.csproj index e3a54fc6..61fcc8dc 100644 --- a/apihost/Tnb.API.Entry/Tnb.API.Entry.csproj +++ b/apihost/Tnb.API.Entry/Tnb.API.Entry.csproj @@ -14,6 +14,14 @@ + + + + + + + +