采购入库代码部分重写,回传bip调整,采购订单接收调整、小件移库到三层货架

This commit is contained in:
2024-09-29 18:10:14 +08:00
parent e6a0066616
commit 6517149d58
9 changed files with 396 additions and 230 deletions

View File

@@ -1808,6 +1808,38 @@ namespace Tnb.WarehouseMgr
await _db.Ado.BeginTranAsync();
await _db.Updateable<OtherOutstockD>().SetColumns(r => r.rk_qty == otherOutstockD_first.rk_qty + input.qty).Where(r => r.id == otherOutstockD_first.id).ExecuteCommandAsync();
//InStockStrategyQuery inStockStrategyInput = null;
//List<BasLocation> endlocations = new List<BasLocation>();
//BasMaterial mat = await _db.Queryable<WmsCarryCode>()
// .InnerJoin<BasMaterial>((a, b) => a.material_id == b.id)
// .Where((a, b) => a.carry_id == wmsCarryH.id).Select((a, b) => b).FirstAsync();
//List<string> categorys = new List<string>();
//if (!string.IsNullOrEmpty(mat.category_id))
//{
// categorys = JsonConvert.DeserializeObject<List<string>>(mat.category_id);
//}
//// 小件物料入外协存储区
//BasRegionMat basRegionMat = await _db.Queryable<BasRegionMat>()
// .InnerJoin<DictionaryDataEntity>((a, b) => a.material_type == b.Id)
// .Where((a, b) => categorys.Contains(b.EnCode)).FirstAsync();
//if (basRegionMat != null)
//{
// inStockStrategyInput = new() { warehouse_id = "1", Size = 1, AvoidBusyPassage = true, Region_id = basRegionMat.region_id };
// endlocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);
// Logger.LogInformation($"【ScanInStockByRedis】托盘物料{mat.code} 物料类型id为{basRegionMat.material_type} 配置的入库区域为{basRegionMat.region_code} 托盘{wmsCarryH.carry_code}在检查外协存储区库存时找到可入库位数量为{endlocations.Count}");
//}
//if (endlocations?.Count == 0)
//{
// inStockStrategyInput = new() { warehouse_id = "1", Size = 1, AvoidBusyPassage = true, Region_id = WmsWareHouseConst.REGION_YCLCache_ID };
// endlocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);
// Logger.LogInformation($"【ScanInStockByRedis】托盘{wmsCarryH.carry_code}在检查采购存储区库存时找到可入库位数量为{endlocations.Count}");
//}
InStockStrategyQuery inStockStrategyInput = new()
{
warehouse_id = WmsWareHouseConst.WAREHOUSE_YCL_ID,
@@ -2568,8 +2600,8 @@ namespace Tnb.WarehouseMgr
catch (Exception ex)
{
await _db.Ado.RollbackTranAsync();
Logger.LogWarning("【DistributeSCWToYCL】" + ex.Message);
Logger.LogWarning("【DistributeSCWToYCL】" + ex.StackTrace);
Logger.LogWarning("【DistributeSCWToZCC】" + ex.Message);
Logger.LogWarning("【DistributeSCWToZCC】" + ex.StackTrace);
return await ToApiResult(HttpStatusCode.InternalServerError, ex.Message);
}
finally