空载具入库,获取目标库位集合代码还原,用于测试CTU

This commit is contained in:
yang.lee
2023-12-13 14:05:44 +08:00
parent 886f3a1661
commit 89e7f0dd50
7 changed files with 65 additions and 50 deletions

View File

@@ -15,6 +15,7 @@ namespace Tnb.WarehouseMgr
private static readonly Lazy<Task> initializationTask;
private static SqlSugarScope context;
private readonly ISqlSugarClient _db;
public static Dictionary<string, int> s_eleUseStatusDic = new();
static DevServBase()
{
@@ -57,9 +58,13 @@ namespace Tnb.WarehouseMgr
protected async Task<WmsElevatorH> FindElevatorFromPars(ElevagorInfoQuery input)
{
var ele = await _db.CopyNew().Queryable<WmsElevatorH>().InnerJoin<WmsElevatorD>((a, b) => a.id == b.bill_id)
.InnerJoin<WmsDistaskH>((a, b, c) => b.location_code == c.endlocation_code)
.InnerJoin<WmsDistaskH>((a, b, c) => b.location_code == c.endlocation_code || b.location_code == c.startpoint_code)
.Where((a, b, c) => a.enabled == 1)
.WhereIF(!SqlFunc.IsNullOrEmpty(input.taskCode), (a, b, c) => c.bill_code == input.taskCode)
.WhereIF(!SqlFunc.IsNullOrEmpty(input.endlocation_id), (a, b, c) => b.location_id == input.endlocation_id)
.WhereIF(!SqlFunc.IsNullOrEmpty(input.startlocation_id), (a, b, c) => b.location_id == input.startlocation_id)
.WhereIF(!SqlFunc.IsNullOrEmpty(input.sourceName) && SqlFunc.StartsWith("DT-R", input.sourceName), (a, b, c) => c.startpoint_code == input.sourceName)
.WhereIF(!SqlFunc.IsNullOrEmpty(input.sourceName) && SqlFunc.StartsWith("DT-C", input.sourceName), (a, b, c) => c.endpoint_code == input.sourceName)
.Select((a, b, c) => new WmsElevatorH
{
bill_code = c.bill_code,