电梯代码优化

This commit is contained in:
yang.lee
2023-12-12 14:28:38 +08:00
parent 5fde13ece9
commit fbdc7de3b9
17 changed files with 275 additions and 282 deletions

View File

@@ -17,6 +17,7 @@ using Tnb.Common.Extension;
using Tnb.WarehouseMgr.Entities;
using Tnb.WarehouseMgr.Entities.Configs;
using Tnb.WarehouseMgr.Entities.Consts;
using Tnb.WarehouseMgr.Entities.Dto.Queries;
using Tnb.WarehouseMgr.Entities.Entity;
using Tnb.WarehouseMgr.Entities.Enums;
@@ -113,5 +114,21 @@ namespace Tnb.WarehouseMgr
var locCfg = _configuration.Build<LocationConfiguration>();
return Task.FromResult(_configuration["TestLocation"]);
}
public async Task<WmsElevatorH> GetElevatorByBillCode(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)
.WhereIF(SqlFunc.IsNullOrEmpty(input.taskCode), (a, b, c) => c.bill_code == input.taskCode)
.WhereIF(SqlFunc.IsNullOrEmpty(input.endlocation_id), (a, b, c) => c.endlocation_id == input.endlocation_id)
.Select((a, b, c) => new WmsElevatorH { bill_code = c.bill_code, device_id = a.elevator_id }, true)
.FirstAsync();
//_db.Aop.OnLogExecuting = (sql, args) =>
//{
// var q = sql;
// Console.WriteLine("sql stat:" + sql);
//};
return ele;
}
}
}