From 689dea70a6f4d8e8ec486fbcb7e87fb70be44982 Mon Sep 17 00:00:00 2001 From: "CANCERYS\\kw093" Date: Mon, 2 Feb 2026 10:27:48 +0800 Subject: [PATCH] update jo get stockinlineid --- .../modules/jobOrder/service/JoPickOrderService.kt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/ffii/fpsms/modules/jobOrder/service/JoPickOrderService.kt b/src/main/java/com/ffii/fpsms/modules/jobOrder/service/JoPickOrderService.kt index 4aea5fe..1c643b0 100644 --- a/src/main/java/com/ffii/fpsms/modules/jobOrder/service/JoPickOrderService.kt +++ b/src/main/java/com/ffii/fpsms/modules/jobOrder/service/JoPickOrderService.kt @@ -1917,9 +1917,15 @@ open fun getJobOrderLotsHierarchicalByPickOrderId(pickOrderId: Long): JobOrderLo // 获取 stock in lines 通过 inventoryLotLineId(用于填充 stockInLineId) val stockInLinesByInventoryLotLineId = if (inventoryLotLineIds.isNotEmpty()) { - inventoryLotLineIds.associateWith { illId -> - stockInLineRepository.findStockInLineInfoByInventoryLotLineId(illId).orElse(null)?.id - }.filterValues { it != null } + // ✅ 修复:直接使用已加载的 inventoryLotLines 实体获取 stockInLineId + inventoryLotLines.associateBy { it.id!! } + .mapNotNull { (illId, ill) -> + // 通过关系链:InventoryLotLine -> InventoryLot -> StockInLine -> id + ill.inventoryLot?.stockInLine?.id?.let { stockInLineId -> + illId to stockInLineId + } + } + .toMap() } else { emptyMap() }