出库申请,出库策略
This commit is contained in:
@@ -73,8 +73,8 @@ namespace Tnb.WarehouseMgr
|
||||
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSCARRYMOOUTSTK_ID, true);
|
||||
await _runService.Create(templateEntity, input);
|
||||
//入库取终点
|
||||
var OutStockStrategyInput = new OutStockStrategyQuery { carry_id = input.data[nameof(OutStockStrategyQuery.carry_id)].ToString(), Size = 1 };
|
||||
var outStkCarry = await _wareHouseService.OutStockStrategy(OutStockStrategyInput);
|
||||
//var OutStockStrategyInput = new OutStockStrategyQuery { carry_id = input.data[nameof(OutStockStrategyQuery.carry_id)].ToString(), Size = 1 };
|
||||
//var outStkCarry = await _wareHouseService.OutStockStrategy(OutStockStrategyInput);
|
||||
WmsPointH? sPoint = null;
|
||||
WmsPointH? ePoint = null;
|
||||
if (input.data.ContainsKey(nameof(WmsPointH.location_id)))
|
||||
@@ -83,7 +83,7 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
if (carry != null)
|
||||
{
|
||||
sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == outStkCarry[0].location_id);
|
||||
sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == carry.location_id);
|
||||
}
|
||||
|
||||
if (sPoint != null && ePoint != null)
|
||||
|
||||
@@ -92,19 +92,10 @@ namespace Tnb.WarehouseMgr
|
||||
List<WmsCarryCode> carryCodes = new();
|
||||
foreach (var os in outStockDList)
|
||||
{
|
||||
var whereExpr = Expressionable.Create<WmsCarryH, WmsCarryCode, BasLocation>()
|
||||
.And((a, b, c) => b.material_id == os.material_id)
|
||||
.And((a, b, c) => a.is_lock == 0)
|
||||
.And((a, b, c) => !string.IsNullOrEmpty(a.location_id))
|
||||
.And((a, b, c) => a.status == (int)EnumCarryStatus.占用)
|
||||
.And((a, b, c) => c.is_type == ((int)EnumLocationType.存储库位).ToString())
|
||||
.And((a, b, c) => a.out_status == "0")
|
||||
.And((a, b, c) => c.wh_id == input.data[nameof(WmsOutstockH.warehouse_id)].ToString())
|
||||
.AndIF(!string.IsNullOrEmpty(os.code_batch), (a, b, c) => b.code_batch == os.code_batch)
|
||||
.ToExpression();
|
||||
|
||||
var OutStockStrategyInput = new OutStockStrategyQuery { carry_id = input.data[nameof(OutStockStrategyQuery.carry_id)].ToString(), Size = 1 };
|
||||
var outStkCarrys = await _wareHouseService.OutStockStrategy(OutStockStrategyInput);
|
||||
var carryCodesPart = await _db.Queryable<WmsCarryH>().InnerJoin<WmsCarryCode>((a, b) => a.id == b.carry_id).InnerJoin<BasLocation>((a, b, c) => a.location_id == c.id)
|
||||
.Where(whereExpr)
|
||||
.Where((a,b) => b.carry_id == outStkCarrys[0].id)
|
||||
.Select<WmsCarryCode>()
|
||||
.ToListAsync();
|
||||
if (carryCodesPart?.Count > 0)
|
||||
|
||||
Reference in New Issue
Block a user