原材料转库逻辑变更

This commit is contained in:
2024-05-24 14:24:21 +08:00
parent 2a66f244dd
commit 36622b35cf
8 changed files with 376 additions and 112 deletions

View File

@@ -233,21 +233,34 @@ namespace Tnb.WarehouseMgr
/// <returns></returns>
public string[] GetFloor1OutstockLocation()
{
return new string[3] { WmsWareHouseConst.FinishproductOutstockStation1 , WmsWareHouseConst.FinishproductOutstockStation2
, WmsWareHouseConst.FinishproductOutstockStation3 };
return new string[23] { "30018211902485", "34355463261205", "34355450098709", "34355446145813"
, "34355443336981", "34355440377365", "34355436327189", "34355432397077", "34355428852501", "34355424568341"
, "34355421064213", "34355416966165", "34355407509269", "34355402216469", "34355397484565", "34355394965013"
, "34355391740181", "34355387110933", "34355383562005", "34355377989397", "34355374481173", "34355369617173"
, "30018211902485"};
}
/// <summary>
/// 是否为三工位库位
/// 是否为供料三工位库位
/// </summary>
/// <param name="location_id"></param>
/// <returns></returns>
public string[] GetFloor1SGWOutstockLocation()
public string[] GetFloor1GLSGWOutstockLocation()
{
return new string[3] { WmsWareHouseConst.Floor1SGWOutstockStation1 , WmsWareHouseConst.Floor1SGWOutstockStation2
, WmsWareHouseConst.Floor1SGWOutstockStation3 };
return new string[3] { WmsWareHouseConst.Floor1GLSGWOutstockStation1 , WmsWareHouseConst.Floor1GLSGWOutstockStation2
, WmsWareHouseConst.Floor1GLSGWOutstockStation3 };
}
/// <summary>
/// 是否为外协三工位库位
/// </summary>
/// <param name="location_id"></param>
/// <returns></returns>
public string[] GetFloor1WXSGWOutstockLocation()
{
return new string[3] { WmsWareHouseConst.Floor1WXSGWOutstockStation1 , WmsWareHouseConst.Floor1WXSGWOutstockStation2
, WmsWareHouseConst.Floor1WXSGWOutstockStation3 };
}
/// <summary>
/// 出库策略-销售出库下发
@@ -310,7 +323,7 @@ namespace Tnb.WarehouseMgr
public async Task<List<WmsCarryH>> OutStockStrategy([FromQuery] OutStockStrategyQuery input)
{
Expressionable<WmsCarryH, WmsCarryCode, BasLocation> whereExprable = Expressionable.Create<WmsCarryH, WmsCarryCode, BasLocation>()
.And((a, b, c) => a.is_lock == 0)
.And((a, b, c) => a.is_lock == 0 && c.is_lock == 0)
.And((a, b, c) => !string.IsNullOrEmpty(a.location_id))
.And((a, b, c) => c.is_type == ((int)EnumLocationType.).ToString())
.And((a, b, c) => a.out_status == "0")
@@ -2526,6 +2539,21 @@ namespace Tnb.WarehouseMgr
Logger.LogInformation($"【CommonCreatePretask】 GenPreTask 结果 {result}");
if (result)
{
GenPreTaskUpInput preTaskUpInput = new()
{
RquireId = input.require_id,
CarryId = carry_id,
CarryStartLocationId = points.FirstOrDefault()!.location_id!,
CarryStartLocationCode = points.FirstOrDefault()!.location_code!,
LocationIds = points.Select(x => x.location_id).ToList()!
};
//根据载具移入Id回更单据状态
_ = await _db.Updateable<WmsMoveInstock>().SetColumns(it => new WmsMoveInstock { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync();
await GenInStockTaskHandleAfter(preTaskUpInput,
it => new WmsCarryH { is_lock = 1, location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode },
it => new BasLocation { is_lock = 1 });
Logger.LogInformation($"【CommonCreatePretask】 成功生成预任务:{preTasks.First().bill_code}");
return await ToApiResult(JNPF.Common.Enums.HttpStatusCode.OK, "成功");
}