This commit is contained in:
FanLian
2023-07-17 14:29:00 +08:00
parent 92a8389efa
commit e2a03ded93

View File

@@ -75,9 +75,9 @@ namespace Tnb.WarehouseMgr
foreach (var ko in kittingOuts) foreach (var ko in kittingOuts)
{ {
var carrys = await _db.Queryable<WmsCarryH>() var carrys = await _db.Queryable<WmsCarryH>()
.InnerJoin<WmsCollocationSchemeH>((a,b) => a.collocation_scheme_id == b.id) .InnerJoin<WmsCollocationSchemeH>((a, b) => a.collocation_scheme_id == b.id)
.Where(a => a.collocation_scheme_id == ko.collocation_scheme_id && a.is_lock == 0) .Where(a => a.collocation_scheme_id == ko.collocation_scheme_id && a.is_lock == 0)
.OrderBy((a,b)=>b.seq) .OrderBy((a, b) => b.seq)
.ToListAsync(); .ToListAsync();
if (carrys?.Count > 0) if (carrys?.Count > 0)
{ {
@@ -158,7 +158,7 @@ namespace Tnb.WarehouseMgr
var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == ko.carry_id); var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == ko.carry_id);
if (carry != null) if (carry != null)
{ {
WmsPointH sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == carry.location_id); WmsPointH sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == carry.location_id);
WmsPointH ePoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == ko.location_id); WmsPointH ePoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == ko.location_id);
if (sPoint != null && ePoint != null) if (sPoint != null && ePoint != null)
@@ -237,7 +237,6 @@ namespace Tnb.WarehouseMgr
var carryId = input.carryIds[^input.carryIds.Count]; var carryId = input.carryIds[^input.carryIds.Count];
var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == carryId); var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == carryId);
var kods = await _db.Queryable<WmsKittingoutD>().Where(it => it.bill_id == input.requireId).ToListAsync(); var kods = await _db.Queryable<WmsKittingoutD>().Where(it => it.bill_id == input.requireId).ToListAsync();
//载具为料架时,取所有料箱的条码 //载具为料架时,取所有料箱的条码
List<string> carryMIds = new(); List<string> carryMIds = new();
if (carry.carrystd_id == WmsWareHouseConst.CARRY_LJSTD_ID) if (carry.carrystd_id == WmsWareHouseConst.CARRY_LJSTD_ID)
@@ -293,7 +292,7 @@ namespace Tnb.WarehouseMgr
//判断当前载具是否为料架,如果是料架 清空所有料架/料箱数据, //判断当前载具是否为料架,如果是料架 清空所有料架/料箱数据,
if (carry.carrystd_id == WmsWareHouseConst.CARRY_LJSTD_ID) if (carry.carrystd_id == WmsWareHouseConst.CARRY_LJSTD_ID)
{ {
var carrys = await _db.Queryable<WmsCarryH>().Where(it => carryMIds.Contains(it.id)).ToListAsync(); var carrys = await _db.Queryable<WmsCarryH>().Where(it => carryMIds.Contains(it.id)).ToListAsync();
carrys.Add(carry); carrys.Add(carry);
if (carrys?.Count > 0) if (carrys?.Count > 0)
{ {
@@ -329,7 +328,7 @@ namespace Tnb.WarehouseMgr
if (input.IsNull()) throw new ArgumentNullException("input"); if (input.IsNull()) throw new ArgumentNullException("input");
try try
{ {
await _db.Ado.BeginTranAsync(); await _db.Ado.BeginTranAsync();
List<WmsKittingoutD> kittingOutDs = new(); List<WmsKittingoutD> kittingOutDs = new();
var kittingOuts = input.Adapt<List<WmsKittingoutH>>(); var kittingOuts = input.Adapt<List<WmsKittingoutH>>();