5.2 KiB
WMS 移库管理功能实现计划
面向 AI 代理的工作者: 在当前会话内按任务顺序执行,使用 TDD 验证核心找位和锁定行为。
目标: 实现移库单 CRUD、库存与目标仓位选择、仓位锁定,以及按来源载具自动找位建单的内部 API。
架构: WMS Server 新增独立 moveinv 业务包,主 Service 维护单据事务,MoveTargetStructSelector 专门负责目标仓位选择。数据库查询集中在 Mapper XML;跨模块自动建单契约放在 WMS API。前端沿用出库页面的 Vben 表格、抽屉和弹窗模式。
技术栈: Java 17、Spring Boot、MyBatis/MyBatis-Plus、OpenFeign、Vue 3、TypeScript、Ant Design Vue。
任务 1:数据模型和 Mapper
文件:
-
创建:
nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/moveinv/MoveInvDO.java -
创建:
nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/moveinvdtl/MoveInvDtlDO.java -
创建:
nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/mysql/moveinv/MoveInvMapper.java -
创建:
nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/mysql/moveinvdtl/MoveInvDtlMapper.java -
创建:
nl-module-wms/nl-module-wms-server/src/main/resources/mapper/moveinv/MoveInvMapper.xml -
创建:
nl-module-wms/nl-module-wms-server/src/main/resources/mapper/moveinvdtl/MoveInvDtlMapper.xml -
修改:
nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/mysql/structAttr/StrucAttrMapper.java -
修改:
nl-module-wms/nl-module-wms-server/src/main/resources/mapper/structAttr/StrucAttrMapper.xml -
映射两张移库表全部字段。
-
增加分页、详情、按载具查询来源库存、同层空闲目标仓位查询。
-
增加移出锁、移入锁和按移库单释放锁的条件更新。
任务 2:目标仓位选择器
文件:
-
创建:
nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/moveinv/MoveTargetStructSelector.java -
创建:
nl-module-wms/nl-module-wms-server/src/test/java/cn/code/nl/module/wms/service/moveinv/MoveTargetStructSelectorTest.java -
先写测试,覆盖同层、距离排序和批次目标去重。
-
运行测试确认因选择器不存在而失败。
-
实现最小选择算法并运行测试通过。
任务 3:后端业务和管理端接口
文件:
-
创建:
nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/moveinv/vo/*.java -
创建:
nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/moveinv/MoveInvController.java -
创建:
nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/moveinv/MoveInvService.java -
创建:
nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/moveinv/MoveInvServiceImpl.java -
修改:
nl-module-wms/nl-module-wms-api/src/main/java/cn/code/nl/module/wms/enums/ErrorCodeConstants.java -
实现分页、详情、可用库存、可用目标仓位。
-
实现新增、修改、删除事务。
-
创建时给来源仓位加
4移出锁、目标仓位加5移入锁。 -
修改/删除时只释放当前移库单持有的锁。
任务 4:自动找位建单 API
文件:
-
创建:
nl-module-wms/nl-module-wms-api/src/main/java/cn/code/nl/module/wms/api/moveinv/MoveInvApi.java -
创建:
nl-module-wms/nl-module-wms-api/src/main/java/cn/code/nl/module/wms/api/moveinv/dto/MoveInvAutoCreateReqDTO.java -
创建:
nl-module-wms/nl-module-wms-api/src/main/java/cn/code/nl/module/wms/api/moveinv/dto/MoveInvAutoCreateRespDTO.java -
创建:
nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/api/moveinv/MoveInvApiImpl.java -
API 只接收来源载具编码列表。
-
Service 逐载具选择同库区同层目标仓位,确保目标不重复。
-
任意载具不可用或无目标时整单回滚。
任务 5:前端管理页面
文件:
-
创建:
nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/moveinv/index.ts -
创建:
nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/moveinv/data.ts -
创建:
nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/moveinv/index.vue -
创建:
nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/moveinv/modules/form.vue -
创建:
nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/moveinv/modules/inventory-select.vue -
创建:
nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/moveinv/modules/struct-select.vue -
创建:
nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/moveinv/modules/detail.vue -
实现列表和生成状态操作限制。
-
新增/修改抽屉默认全屏并回填明细。
-
每个载具分别选择不同目标仓位。
-
实现详情展示。
任务 6:验证
- 运行后端核心测试。
- 运行 WMS reactor 编译。
- 运行前端类型检查。
- 检查工作区差异,不覆盖既有用户修改。