# FormationCommonStackerCraneJob Refactor Implementation Plan > **For agentic workers:** REQUIRED: Use superpowers:subagent-driven-development (if subagents available) or superpowers:executing-plans to implement this plan. Steps use checkbox (`- [ ]`) syntax for tracking. **Goal:** 在不改变业务行为的前提下,降低 `FormationCommonStackerCraneJob` 复杂度,拆分“任务选择”和“命令构建”职责。 **Architecture:** 保留 `FormationCommonStackerCraneJob` 作为 Quartz Job 入口,仅负责调度;将任务选择和命令构建下沉到同目录新类,通过构造函数组装依赖,改动限定在 `FormationStackerCraneJob` 目录。 **Tech Stack:** .NET 6, Quartz, 现有 WCS Task/Router 服务接口 --- ## Chunk 1: 结构拆分 ### Task 1: 拆分任务选择器 **Files:** - Create: `WIDESEAWCS_Tasks/FormationStackerCraneJob/FormationStackerCraneTaskSelector.cs` - Modify: `WIDESEAWCS_Tasks/FormationStackerCraneJob/FormationCommonStackerCraneJob.cs` - [ ] Step 1: 迁移任务挑选和站台可用性逻辑 - [ ] Step 2: Job 中改为调用任务选择器 ### Task 2: 拆分命令构建器 **Files:** - Create: `WIDESEAWCS_Tasks/FormationStackerCraneJob/FormationStackerCraneCommandBuilder.cs` - Modify: `WIDESEAWCS_Tasks/FormationStackerCraneJob/FormationCommonStackerCraneJob.cs` - [ ] Step 1: 迁移命令转换与地址解析逻辑 - [ ] Step 2: Job 中改为调用命令构建器 ## Chunk 2: 清理与验证 ### Task 3: Job 入口瘦身 **Files:** - Modify: `WIDESEAWCS_Tasks/FormationStackerCraneJob/FormationCommonStackerCraneJob.cs` - [ ] Step 1: 删除迁移后的私有方法和无用 using - [ ] Step 2: 补关键流程注释 ### Task 4: 编译验收 **Files:** - Modify: `WIDESEAWCS_Tasks/FormationStackerCraneJob/*.cs`(如需微调) - [ ] Step 1: 运行 `dotnet build WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj -c Debug` - [ ] Step 2: 最小修复直到通过