|
|
@@ -1917,9 +1917,15 @@ open fun getJobOrderLotsHierarchicalByPickOrderId(pickOrderId: Long): JobOrderLo |
|
|
|
|
|
|
|
|
// 获取 stock in lines 通过 inventoryLotLineId(用于填充 stockInLineId) |
|
|
// 获取 stock in lines 通过 inventoryLotLineId(用于填充 stockInLineId) |
|
|
val stockInLinesByInventoryLotLineId = if (inventoryLotLineIds.isNotEmpty()) { |
|
|
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 { |
|
|
} else { |
|
|
emptyMap() |
|
|
emptyMap() |
|
|
} |
|
|
} |
|
|
|