齐套开发
This commit is contained in:
@@ -2729,6 +2729,7 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
|
||||
|
||||
List<PrdMoTask> prdMoTasks = await db_WmsMaterialkit.Queryable<PrdMoTask>().Where(r => r.mo_task_status == DictConst.InProgressEnCode
|
||||
&& !string.IsNullOrEmpty(r.parent_id)).ToListAsync();
|
||||
LoggerWmsMaterialkit.LogInformation($"*********************************************************************************");
|
||||
LoggerWmsMaterialkit.LogInformation($"查找到进行中的任务单:{string.Join(',', prdMoTasks.Select(r => r.mo_task_code))}");
|
||||
|
||||
Dictionary<string, object> workstaiondic = db_WmsMaterialkit.Queryable<OrganizeEntity>().ToDictionary(k => k.Id, v => v.EnCode);
|
||||
@@ -2814,6 +2815,25 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
|
||||
codeqty = d.codeqty,
|
||||
unit_code = d.unit_id
|
||||
}).ToListAsync();
|
||||
LoggerWmsMaterialkit.LogWarning($"物料齐套计划{wmsMaterialkitRecordH.bill_code} 绑定工位{workstaiondic[prdMoTask.workstation_id].ToString()}的料箱物料{material.code}在暂存仓库存为{zccinventory.Sum(r => r.codeqty)}");
|
||||
|
||||
// 输送线库存
|
||||
var ssxinventory = await db_WmsMaterialkit.Queryable<WmsCarryH>()
|
||||
.InnerJoin<BasLocation>((a, b) => a.location_id == b.id)
|
||||
.InnerJoin<WmsCarryCode>((a, b, c) => a.id == c.carry_id)
|
||||
.InnerJoin<BasMaterial>((a, b, c, d) => d.id == c.material_id)
|
||||
.Where((a, b, c, d) => (b.id == WmsWareHouseConst.ZZCSSX121009 || b.id == WmsWareHouseConst.ZZCSSX121010) && d.id == material.id
|
||||
&& a.work_station == workstaiondic[prdMoTask.workstation_id].ToString())
|
||||
.Select((a, b, c, d) => new customInventoryEntity
|
||||
{
|
||||
material_id = d.id,
|
||||
material_code = d.code,
|
||||
material_name = d.name,
|
||||
material_specification = d.material_specification,
|
||||
codeqty = c.codeqty,
|
||||
unit_code = c.unit_id
|
||||
}).ToListAsync();
|
||||
LoggerWmsMaterialkit.LogWarning($"物料齐套计划{wmsMaterialkitRecordH.bill_code} 绑定工位{workstaiondic[prdMoTask.workstation_id].ToString()}的料箱物料{material.code}在输送线库存为{ssxinventory.Sum(r => r.codeqty)}");
|
||||
|
||||
// 正在配送
|
||||
var inroadinventory = await db_WmsMaterialkit.Queryable<WmsPretaskH>()
|
||||
@@ -2833,11 +2853,12 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
|
||||
codeqty = c.codeqty,
|
||||
unit_code = c.unit_id
|
||||
}).ToListAsync();
|
||||
|
||||
LoggerWmsMaterialkit.LogWarning($"物料齐套计划{wmsMaterialkitRecordH.bill_code} 绑定工位{workstaiondic[prdMoTask.workstation_id].ToString()}的料箱物料{material.code}正在配送中的数量为{inroadinventory.Sum(r => r.codeqty)}");
|
||||
|
||||
|
||||
List<customInventoryEntity> inventory = new List<customInventoryEntity>();
|
||||
inventory.AddRange(zccinventory);
|
||||
inventory.AddRange(ssxinventory);
|
||||
inventory.AddRange(inroadinventory);
|
||||
|
||||
inventory.GroupBy(g => new { g.material_id, g.material_code, g.material_name, g.material_specification, g.unit_code }).Select(g =>
|
||||
@@ -2935,7 +2956,8 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
|
||||
};
|
||||
List<WmsCarryH> items = await _wareHouseService.OutStockStrategy(outStockStrategyInput);
|
||||
List<WmsCarryCode> wmsCarryCodes = await db_WmsMaterialkit.Queryable<WmsCarryCode>()
|
||||
.Where(r => r.material_id == _wmsMaterialTransferD.material_id && r.code_batch == _wmsMaterialTransferD.code_batch).ToListAsync();
|
||||
.Where(r => r.material_id == _wmsMaterialTransferD.material_id && r.code_batch == _wmsMaterialTransferD.code_batch
|
||||
&& items.Select(x => x.id).Contains(r.carry_id)).ToListAsync();
|
||||
decimal? inv_qty = wmsCarryCodes.Sum(r => r.codeqty);
|
||||
can_qty = inv_qty > can_qty ? can_qty : inv_qty;
|
||||
LoggerWmsMaterialkit.LogWarning($"转库单id{_wmsMaterialTransferD.bill_id} 明细id{_wmsMaterialTransferD.id} 物料{_wmsMaterialTransferD.material_code} 批次{_wmsMaterialTransferD.code_batch} 中储仓出库时可出数量为{can_qty}");
|
||||
@@ -2981,7 +3003,7 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
|
||||
|
||||
List<WmsMaterialkitRecordD> WmsMaterialkitRecordDs = db_WmsMaterialkit.Queryable<WmsMaterialkitRecordD>()
|
||||
.Where(a => a.bill_id == wmsMaterialkitRecord.id && a.yxf_qty < a.plan_qty).ToList();
|
||||
if (wmsMaterialTransferDs.Count == 0)
|
||||
if (WmsMaterialkitRecordDs.Count == 0)
|
||||
{
|
||||
await db_WmsMaterialkit.Updateable<WmsMaterialkitRecordH>().SetColumns(it => new WmsMaterialkitRecordH { status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID })
|
||||
.Where(it => it.id == wmsMaterialkitRecord.id).ExecuteCommandHasChangeAsync();
|
||||
@@ -3055,7 +3077,7 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
|
||||
elevatorTimer = new Timer(ElevatorTaskExceptionHandle, null, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10));
|
||||
agvelevatorTimer = new Timer(AgvelevatorTimerTaskExceptionHandle, null, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10));
|
||||
|
||||
//WmsMaterialkittimer = new Timer(WmsMaterialkit, null, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(3600));
|
||||
//WmsMaterialkittimer = new Timer(WmsMaterialkit, null, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(20));
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user