PDA扫码增加载具条码表,操作记录条码表,回更状态修改
This commit is contained in:
@@ -47,7 +47,7 @@ public partial class WmsHandleCode : BaseEntity<string>
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 条码数量
|
/// 条码数量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int codeqty { get; set; }
|
public decimal codeqty { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单位ID
|
/// 单位ID
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ using Tnb.WarehouseMgr.Entities;
|
|||||||
using Tnb.WarehouseMgr.Entities.Attributes;
|
using Tnb.WarehouseMgr.Entities.Attributes;
|
||||||
using Tnb.WarehouseMgr.Entities.Consts;
|
using Tnb.WarehouseMgr.Entities.Consts;
|
||||||
using Tnb.WarehouseMgr.Entities.Dto;
|
using Tnb.WarehouseMgr.Entities.Dto;
|
||||||
|
using Tnb.WarehouseMgr.Entities.Enums;
|
||||||
using Tnb.WarehouseMgr.Interfaces;
|
using Tnb.WarehouseMgr.Interfaces;
|
||||||
|
|
||||||
namespace Tnb.WarehouseMgr
|
namespace Tnb.WarehouseMgr
|
||||||
@@ -131,6 +132,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
await _db.Insertable(instockD).ExecuteCommandAsync();
|
await _db.Insertable(instockD).ExecuteCommandAsync();
|
||||||
await _db.Insertable(instockCode).ExecuteCommandAsync();
|
await _db.Insertable(instockCode).ExecuteCommandAsync();
|
||||||
|
|
||||||
|
|
||||||
var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = "26103372441637", Size = 1 };
|
var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = "26103372441637", Size = 1 };
|
||||||
var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);
|
var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);
|
||||||
WmsPointH sPoint = new();
|
WmsPointH sPoint = new();
|
||||||
@@ -200,6 +202,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
var isOk = await _wareHouseService.GenPreTask(preTasks, pretaskCodes);
|
var isOk = await _wareHouseService.GenPreTask(preTasks, pretaskCodes);
|
||||||
if (isOk)
|
if (isOk)
|
||||||
{
|
{
|
||||||
|
|
||||||
var preTaskUpInput = new GenPreTaskUpInput();
|
var preTaskUpInput = new GenPreTaskUpInput();
|
||||||
preTaskUpInput.RquireId = instock.id;
|
preTaskUpInput.RquireId = instock.id;
|
||||||
preTaskUpInput.CarryId = carry.id;
|
preTaskUpInput.CarryId = carry.id;
|
||||||
@@ -207,6 +210,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
|
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
|
||||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!;
|
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!;
|
||||||
|
|
||||||
|
//生成操作记录
|
||||||
WmsHandleH handleH = new();
|
WmsHandleH handleH = new();
|
||||||
handleH.org_id = _userManager.User.OrganizeId;
|
handleH.org_id = _userManager.User.OrganizeId;
|
||||||
handleH.startlocation_id = loc.id;
|
handleH.startlocation_id = loc.id;
|
||||||
@@ -220,12 +224,35 @@ namespace Tnb.WarehouseMgr
|
|||||||
handleH.create_id = _userManager.UserId;
|
handleH.create_id = _userManager.UserId;
|
||||||
handleH.create_time = DateTime.Now;
|
handleH.create_time = DateTime.Now;
|
||||||
preTaskUpInput.PreTaskRecord = handleH;
|
preTaskUpInput.PreTaskRecord = handleH;
|
||||||
//根据载具移入Id,回更单据状态
|
|
||||||
await _db.Updateable<WmsInstockH>().SetColumns(it => new WmsInstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync();
|
|
||||||
|
|
||||||
|
//生成操作记录条码表
|
||||||
|
WmsHandleCode handleCode = instockCode.Adapt<WmsHandleCode>();
|
||||||
|
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>();
|
||||||
|
{
|
||||||
|
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,
|
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
||||||
it => new WmsCarryH { is_lock = 1, location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode },
|
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 });
|
it => new BasLocation { is_lock = 1, is_use = ((int)EnumCarryStatus.占用).ToString() });
|
||||||
|
await _db.Updateable<WmsInstockD>().SetColumns(it => new WmsInstockD { line_status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => instockCode.bill_d_id == it.id).ExecuteCommandAsync();
|
||||||
|
await _db.Updateable<WmsInstockH>().SetColumns(it => new WmsInstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == instock!.id).ExecuteCommandAsync();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user