成品调拨入库改为扫码
This commit is contained in:
@@ -22,6 +22,10 @@
|
||||
/// </summary>
|
||||
public string? startlocation_id { get; set; }
|
||||
/// <summary>
|
||||
/// 起点code
|
||||
/// </summary>
|
||||
public string? startlocation_code { get; set; }
|
||||
/// <summary>
|
||||
/// 需求单据
|
||||
/// </summary>
|
||||
public string? source_id { get; set; }
|
||||
|
||||
@@ -186,11 +186,15 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
throw new AppFriendlyException("成品调拨明细id不可为空", 500);
|
||||
}
|
||||
if (string.IsNullOrEmpty(input.startlocation_id))
|
||||
if (string.IsNullOrEmpty(input.startlocation_code))
|
||||
{
|
||||
throw new AppFriendlyException("起点不可为空", 500);
|
||||
}
|
||||
|
||||
var baseLocation = await _db.Queryable<BasLocation>().Where(r => r.location_code == input.startlocation_code).FirstAsync();
|
||||
if (baseLocation == null)
|
||||
throw new AppFriendlyException($"未找到编号{input.startlocation_code}的库位", 500);
|
||||
|
||||
WmsTransferInstockD wmsTransferInstockD = await _db.Queryable<WmsTransferInstockD>().Where(r => r.id == input.source_id).FirstAsync();
|
||||
if (wmsTransferInstockD.status == WmsWareHouseConst.TASK_BILL_STATUS_COMPLE_ID)
|
||||
{
|
||||
@@ -208,7 +212,7 @@ namespace Tnb.WarehouseMgr
|
||||
WmsPointH sPoint = null!;
|
||||
WmsPointH ePoint = null!;
|
||||
|
||||
sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == input.startlocation_id);
|
||||
sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == baseLocation.id);
|
||||
if (endLocations?.Count > 0)
|
||||
{
|
||||
WmsCarryH carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.carry_code == input.carry_code);
|
||||
@@ -303,20 +307,20 @@ namespace Tnb.WarehouseMgr
|
||||
if (endLocationId != null)
|
||||
{
|
||||
//查询库位表
|
||||
BasLocation location = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == input.startlocation_id);
|
||||
BasLocation location = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == baseLocation.id);
|
||||
{
|
||||
//载具加锁,增加库位信息
|
||||
_ = await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH
|
||||
{
|
||||
carry_status = ((int)EnumCarryStatus.占用).ToString(),
|
||||
is_lock = 1,
|
||||
location_id = input.startlocation_id,
|
||||
location_id = baseLocation.id,
|
||||
location_code = location.location_code
|
||||
}).Where(it => it.id == wmsCarryH.id).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
//所有库位加锁
|
||||
string?[] ids = new[] { input.startlocation_id, endLocationId };
|
||||
string?[] ids = new[] { baseLocation.id, endLocationId };
|
||||
_ = await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => ids.Contains(it.id)).ExecuteCommandAsync();
|
||||
|
||||
BasMaterial basMaterial = await _db.Queryable<BasMaterial>().FirstAsync(it => it.id == input.material_id);
|
||||
|
||||
Reference in New Issue
Block a user