1
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Dynamic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
@@ -477,7 +478,7 @@ namespace Tnb.WarehouseMgr
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
public async Task GenInStockTaskHandleAfter(GenPreTaskUpInput input)
|
||||
public async Task GenInStockTaskHandleAfter(GenPreTaskUpInput input, Expression<Func<WmsCarryH, WmsCarryH>> setCarryColumnsExp, Expression<Func<BasLocation, BasLocation>> setLocaionColumbExp)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -489,16 +490,16 @@ namespace Tnb.WarehouseMgr
|
||||
await _db.Insertable(input.PreTaskHandleCodes).ExecuteCommandAsync();
|
||||
}
|
||||
//根据载具ID,更新是否锁定和赋值起始库位
|
||||
//if (!input.IsCheck.HasValue)
|
||||
//{
|
||||
// await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { is_lock = 1, location_id = input.CarryStartLocationId, location_code = input.CarryStartLocationCode }).Where(it => it.id == input.CarryId).ExecuteCommandAsync();
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { is_check = input.IsCheck.Value, is_lock = 1, location_id = input.CarryStartLocationId, location_code = input.CarryStartLocationCode }).Where(it => it.id == input.CarryId).ExecuteCommandAsync();
|
||||
//}
|
||||
////根据所有库位更新库位的锁定状态为“锁定”
|
||||
//await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => input.LocationIds.Contains(it.id)).ExecuteCommandAsync();
|
||||
if (setCarryColumnsExp != null)
|
||||
{
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(setCarryColumnsExp).Where(it => it.id == input.CarryId).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
//根据所有库位更新库位的锁定状态为“锁定”
|
||||
if (setLocaionColumbExp != null)
|
||||
{
|
||||
await _db.Updateable<BasLocation>().SetColumns(setLocaionColumbExp).Where(it => input.LocationIds.Contains(it.id)).ExecuteCommandAsync();
|
||||
}
|
||||
await _db.Ado.CommitTranAsync();
|
||||
}
|
||||
catch (Exception)
|
||||
|
||||
@@ -141,7 +141,9 @@ namespace Tnb.WarehouseMgr
|
||||
//根据载具移入Id,回更单据状态
|
||||
await _db.Updateable<WmsMoveInstock>().SetColumns(it => new WmsMoveInstock { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).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 BasLocation { is_lock = 1 });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,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
|
||||
@@ -165,7 +166,7 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
}
|
||||
await _db.Insertable(preTaskUpInput.PreTaskRecord).ExecuteCommandAsync();
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { carry_code = input.data[nameof(WmsCarryH.carry_code)].ToString(), is_lock = 1, location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode }).Where(it => it.id == preTaskUpInput.CarryId).ExecuteCommandAsync();
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { carry_code = input.data[nameof(WmsCarryH.carry_code)].ToString(), is_lock = (int)EnumCarryStatus.占用, location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode }).Where(it => it.id == preTaskUpInput.CarryId).ExecuteCommandAsync();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -176,7 +177,7 @@ namespace Tnb.WarehouseMgr
|
||||
catch (Exception ex)
|
||||
{
|
||||
await _db.Ado.RollbackTranAsync();
|
||||
throw;
|
||||
return Task.FromResult(false);
|
||||
}
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user