Class OracleDbQueryRepository
- All Implemented Interfaces:
DbQueryRepository
This class executes Oracle WMS queries against the WMSP schema to retrieve shipment data with all related information (orders, lines, pallets, lots, etc.).
Uses prepared statements to prevent SQL injection and proper resource management with try-with-resources.
Database: Oracle WMS at site-specific location (e.g., TBG3002 at 10.19.68.61:1521/WMSP) Schema: WMSP (schema name is prepended to all table references) User: RPTADM (read-only reporting user)
-
Constructor Summary
ConstructorsConstructorDescriptionOracleDbQueryRepository(DataSource dataSource) Creates a new OracleDbQueryRepository. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the repository and releases any resources.findCarrierMoveStops(String carrierMoveId) Resolves shipment rows for a carrier move using stop assignments.findRailFootprintsByShortCode(List<String> shortCodes) Resolves WMS footprint candidates keyed by short code.findRailStopsByTrainId(String trainId) Resolves train/load rows for rail label generation from live WMS rail receive tables.findShipmentSkuFootprints(String shipmentId) Retrieves shipment-level SKU totals with footprint maintenance data.findShipmentWithLpnsAndLineItems(String shipmentId) Retrieves a complete shipment with all LPNs and line items.getStagingLocation(String shipmentId) Returns the staging location for a shipment.booleanshipmentExists(String shipmentId) Validates that a shipment exists and has at least one LPN.
-
Constructor Details
-
OracleDbQueryRepository
Creates a new OracleDbQueryRepository.- Parameters:
dataSource- the connection pool providing database connections- Throws:
IllegalArgumentException- if dataSource is null
-
-
Method Details
-
findShipmentWithLpnsAndLineItems
Description copied from interface:DbQueryRepositoryRetrieves a complete shipment with all LPNs and line items.This is a read-only operation that gathers: - Shipment header information (destination, carrier, dates) - All LPNs (pallets) tied to this shipment - All line items within each LPN - Staging location for routing decisions
- Specified by:
findShipmentWithLpnsAndLineItemsin interfaceDbQueryRepository- Parameters:
shipmentId- the shipment identifier- Returns:
- the complete shipment with all associated data
-
shipmentExists
Description copied from interface:DbQueryRepositoryValidates that a shipment exists and has at least one LPN.Lightweight check to verify shipment is printable without fetching all associated data.
- Specified by:
shipmentExistsin interfaceDbQueryRepository- Parameters:
shipmentId- the shipment identifier- Returns:
- true if shipment exists and has at least one LPN, false otherwise
-
getStagingLocation
Description copied from interface:DbQueryRepositoryReturns the staging location for a shipment.Used for printer routing decisions. All LPNs in a shipment should be in the same staging location.
- Specified by:
getStagingLocationin interfaceDbQueryRepository- Parameters:
shipmentId- the shipment identifier- Returns:
- the staging location (e.g., "ROSSI", "OFFICE"), or null if not found
-
findShipmentSkuFootprints
Description copied from interface:DbQueryRepositoryRetrieves shipment-level SKU totals with footprint maintenance data.Data is sourced from shipment lines plus PRTFTP / PRTFTP_DTL to provide units-per-case, units-per-pallet, and pallet dimensions for planning.
- Specified by:
findShipmentSkuFootprintsin interfaceDbQueryRepository- Parameters:
shipmentId- the shipment identifier- Returns:
- one row per SKU in the shipment
-
findCarrierMoveStops
Description copied from interface:DbQueryRepositoryResolves shipment rows for a carrier move using stop assignments.Rows are expected to be sorted by stop sequence and then shipment ID.
- Specified by:
findCarrierMoveStopsin interfaceDbQueryRepository- Parameters:
carrierMoveId- carrier move identifier- Returns:
- stop-mapped shipment rows for the carrier move
-
findRailStopsByTrainId
Description copied from interface:DbQueryRepositoryResolves train/load rows for rail label generation from live WMS rail receive tables.- Specified by:
findRailStopsByTrainIdin interfaceDbQueryRepository- Parameters:
trainId- full train ID (example: JC03032026)- Returns:
- flattened rail stop rows with short-code items
-
findRailFootprintsByShortCode
public Map<String,List<RailFootprintCandidate>> findRailFootprintsByShortCode(List<String> shortCodes) Description copied from interface:DbQueryRepositoryResolves WMS footprint candidates keyed by short code.Some short codes may map to multiple item numbers; callers are expected to apply deterministic conflict handling and diagnostics.
- Specified by:
findRailFootprintsByShortCodein interfaceDbQueryRepository- Parameters:
shortCodes- short code values from rail rows- Returns:
- map of short code to candidate rows
-
close
public void close()Description copied from interface:DbQueryRepositoryCloses the repository and releases any resources.Implementors must ensure underlying connections are closed properly.
- Specified by:
closein interfaceDbQueryRepository
-