|
|
|
@@ -3475,7 +3475,6 @@ ORDER BY |
|
|
|
} |
|
|
|
// ... existing code ... |
|
|
|
|
|
|
|
// Fix the method signature and return types |
|
|
|
open fun getAllPickOrderLotsWithDetailsHierarchical(userId: Long): Map<String, Any?> { |
|
|
|
println("=== Debug: getAllPickOrderLotsWithDetailsHierarchical (NEW STRUCTURE) ===") |
|
|
|
println("userId filter: $userId") |
|
|
|
@@ -3701,37 +3700,22 @@ open fun getAllPickOrderLotsWithDetailsHierarchical(userId: Long): Map<String, A |
|
|
|
"lots" to lots // ✅ 即使是空数组也返回 |
|
|
|
) |
|
|
|
} |
|
|
|
}.filterNotNull() |
|
|
|
|
|
|
|
mapOf( |
|
|
|
"pickOrderId" to pickOrderId, |
|
|
|
"pickOrderCode" to poInfo["pick_order_code"], |
|
|
|
"doOrderId" to poInfo["do_order_id"], |
|
|
|
"deliveryOrderCode" to poInfo["delivery_order_code"], |
|
|
|
"consoCode" to poInfo["consoCode"], |
|
|
|
"status" to poInfo["status"], |
|
|
|
"targetDate" to poInfo["targetDate"], |
|
|
|
"pickOrderLines" to pickOrderLines |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
// ✅ 构建 FG 信息 |
|
|
|
val fgInfo = mapOf( |
|
|
|
"doPickOrderId" to doPickOrderId, |
|
|
|
"ticketNo" to doPickOrderInfo["ticket_no"], |
|
|
|
"storeId" to doPickOrderInfo["store_id"], |
|
|
|
"shopCode" to doPickOrderInfo["ShopCode"], |
|
|
|
"shopName" to doPickOrderInfo["ShopName"], |
|
|
|
"truckLanceCode" to doPickOrderInfo["TruckLanceCode"], |
|
|
|
"departureTime" to doPickOrderInfo["truck_departure_time"] |
|
|
|
) |
|
|
|
|
|
|
|
// Pick order line with item and lots |
|
|
|
mapOf( |
|
|
|
"id" to pickOrderLineId, |
|
|
|
"requiredQty" to firstLot["pickOrderLineRequiredQty"], |
|
|
|
"status" to firstLot["pickOrderLineStatus"], |
|
|
|
"item" to itemInfo, |
|
|
|
"lots" to lotsInfo |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
return mapOf( |
|
|
|
"fgInfo" to fgInfo, |
|
|
|
"pickOrders" to pickOrders |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
// Fix the type issues in the getPickOrdersByDateAndStore method |
|
|
|
open fun getPickOrdersByDateAndStore(storeId: String): Map<String, Any?> { |
|
|
|
println("=== Debug: getPickOrdersByDateAndStore ===") |
|
|
|
|