Files
FTC25009/docs/superpowers/plans/2026-07-14-inbound-outbound-lift-conflict.md

2.7 KiB

Inbound/Outbound Lift Conflict Exclusion Implementation Plan

For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (- [ ]) syntax for tracking.

Goal: Prevent warehouse-03 inbound layer/location allocation from using a floor currently being retrieved by an executing outbound job targeting the same station as the inbound entrance.

Architecture: Resolve blocked floors directly in SQL by joining the current inbound job (v_job_id/jobId) to executing outbound jobs where outbound.exit_id = inbound.entrance_id, then join the outbound source location to obtain the_floor. Apply the same exclusion predicate to first-stage layer planning, second-stage atomic location allocation, and occupied-location reallocation so no path can bypass the lift-conflict rule.

Tech Stack: MyBatis XML, SQL Server CTEs, JUnit 5/AssertJ, Maven, rollback-only database scenarios.


Task 1: Prove the conflict-floor contract

Files:

  • Modify: ruoyi-admin/src/test/java/com/ruoyi/pda/mapper/PdaMapperSqlTest.java

  • Modify: ruoyi-admin/src/test/java/com/ruoyi/bas/cargospace/mapper/BasCargoSpaceMapperSqlTest.java

  • Write failing SQL tests requiring status = '3', outbound in_or_out >= 20, equal outbound exit_id and current inbound entrance_id, source cargo-space join, and the_floor exclusion in planner, final lock, and reallocation SQL.

  • Run the two mapper test classes and confirm failure because no conflict-floor CTE exists.

Task 2: Exclude lift-conflict floors everywhere

Files:

  • Modify: ruoyi-admin/src/main/resources/mapper/pda/PdaMapper.xml

  • Modify: ruoyi-admin/src/main/resources/mapper/bas/BasCargoSpaceMapper.xml

  • Add lift_conflict_floors before available_slots in both warehouse-03 allocation CTEs.

  • Filter candidate slots with NOT EXISTS against the candidate floor.

  • Add the equivalent CTE and predicate to warehouse-03 occupied-location reallocation.

  • Run focused tests and confirm pass.

Task 3: Database and regression verification

Files:

  • Verify all files above.

  • In a rollback transaction, create an inbound job and an executing outbound job with the same port; prove the outbound source floor is unavailable while another layer remains selectable.

  • Change the outbound status away from 3 and prove the floor becomes available again.

  • Change the outbound exit to another port and prove the floor becomes available again.

  • Run mvn test and require all tests to pass.

  • Audit that first-stage planning, second-stage locking, and exception reallocation all enforce the rule before marking complete.