fix(lastleg): enforce container warehouse plan facts

This commit is contained in:
2026-09-08 11:00:39 +08:00
parent 61ffff1be0
commit cc6df5993f
8 changed files with 161 additions and 35 deletions
@@ -16,6 +16,17 @@ public interface InboundPlanOrderMapper {
String orderType) { }
record ReceivingWarehouseSnapshot(String overseasWarehouseId, String overseasWarehouseCode,
String overseasWarehouseName) { }
record ContainerWarehouseRef(String customerId, Long orderId, String sourceContainerBookingId,
String overseasWarehouseId) { }
@Select("SELECT c.customer_id AS customerId,c.id AS orderId," +
"c.source_container_booking_id AS sourceContainerBookingId,c.overseas_warehouse_id AS overseasWarehouseId " +
"FROM ll_order target JOIN ll_order c ON c.source_container_booking_id=target.source_container_booking_id " +
"WHERE target.customer_id=#{customerId} AND target.id=#{orderId} " +
"AND target.source_container_booking_id IS NOT NULL AND target.source_container_booking_id!='' " +
"ORDER BY c.customer_id,c.id FOR UPDATE")
List<ContainerWarehouseRef> lockContainerWarehouseFacts(@Param("customerId") String customerId,
@Param("orderId") Long orderId);
@Select("SELECT customer_id AS customerId,id AS orderId,current_status AS currentStatus,container_no AS containerNo," +
"order_type AS orderType " +