{"id":22239673,"url":"https://github.com/dddplus/dddplus-archetype-demo","last_synced_at":"2025-07-27T23:32:18.630Z","repository":{"id":45133456,"uuid":"307917115","full_name":"dddplus/dddplus-archetype-demo","owner":"dddplus","description":"♨️  Using dddplus-archetype build a WMS in 5 minutes. 5分钟搭建一个仓储中台WMS！","archived":false,"fork":false,"pushed_at":"2022-01-06T07:44:25.000Z","size":98,"stargazers_count":63,"open_issues_count":0,"forks_count":37,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-04T09:44:51.360Z","etag":null,"topics":["ddd","ddd-architecture","ddd-example","dddplus","scaffold","skeleton","wms"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dddplus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-28T05:37:21.000Z","updated_at":"2025-03-30T13:21:13.000Z","dependencies_parsed_at":"2022-07-21T06:32:16.415Z","dependency_job_id":null,"html_url":"https://github.com/dddplus/dddplus-archetype-demo","commit_stats":null,"previous_names":[],"tags_count":3,"template":true,"template_full_name":null,"purl":"pkg:github/dddplus/dddplus-archetype-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dddplus%2Fdddplus-archetype-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dddplus%2Fdddplus-archetype-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dddplus%2Fdddplus-archetype-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dddplus%2Fdddplus-archetype-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dddplus","download_url":"https://codeload.github.com/dddplus/dddplus-archetype-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dddplus%2Fdddplus-archetype-demo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267441238,"owners_count":24087771,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ddd","ddd-architecture","ddd-example","dddplus","scaffold","skeleton","wms"],"created_at":"2024-12-03T03:20:56.033Z","updated_at":"2025-07-27T23:32:18.347Z","avatar_url":"https://github.com/dddplus.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dddplus-archetype-demo\nUsing [dddplus-archetype](https://github.com/dddplus/dddplus-archetype) build a WMS in 5 minutes. 利用 [dddplus-archetype](https://github.com/dddplus/dddplus-archetype) 5分钟搭建一个仓储中台WMS！\n\n![Requirement](https://img.shields.io/badge/JDK-8+-green.svg)\n[![DDDplus version](https://img.shields.io/badge/DDDplus-1.0.2--SNAPSHOT-blue)](https://github.com/funkygao/cp-ddd-framework)\n\n## 演示简介\n\n仓储系统，WMS(warehouse managment system)，在整个供应链中起着至关重要的作用，它主要由四大部分组成：\n- 入库管理\n- 在库管理\n- 出库管理\n- 基础数据\n\n本演示目标：\n- 快速搭建一个WMS的入库(inbound，简称ib)中台骨架\n- 完成一个不算简单的use case：创建上架任务\n\n## 第一分钟：利用dddplus-archtype创建项目\n\n``` bash\nmvn archetype:generate                              \\\n    -DarchetypeGroupId=io.github.dddplus            \\\n    -DarchetypeArtifactId=dddplus-archetype         \\\n    -DarchetypeVersion=1.0.2-SNAPSHOT               \\\n    -DgroupId=io.wms -DartifactId=wms-ib            \\\n    -Dpackage=io.wms.ib -Dversion=1.0.0-SNAPSHOT    \\\n    -B\n```\n\n[github上查看该步骤提交的代码](https://github.com/dddplus/dddplus-archetype-demo/compare/7e150d0...minute-1).\n\n该过程，不需要开发代码，完全自动生成。\n\n## 第二分钟：实现`创建上架任务`用例的骨架\n\n### 业务介绍\n\n创建上架任务，是指采购的货品已送达仓库，完成了扫码、验收，现在要存放到库房的货架上。\n\n具体地，仓库工人会对货品进行验收，利用手持设备扫描每个商品条码，都完成后点击`验收完毕`按钮，服务器会调用`创建上架任务`API。\n\n本演示就是要完成该API，通过`Apache Dubbo`形式提供。\n\n`上架`，这里使用英文`shelving`。\n\n### 开发内容\n\n- wms-ib-api 模块，定义对外暴露的API\n- wms-ib-facade 模块，实现该API\n- wms-ib-application 模块，编排领域服务，在 use case 层实现该API\n- wms-ib-domain 模块，实现核心业务逻辑\n   - 定义领域模型、领域服务\n   - wms-ib-spec 模块，定义领域模型规范\n   - 通过依赖倒置定义基础设施层需要实现的技术细节接口\n- wms-ib-infrastructure 模块，实现领域层要求的技术细节接口\n   - 定义物理模型\n- wms-ib-test 模块，单元测试模块，主要针对domain层编写测试用例\n\n[github上查看该步骤提交的代码](https://github.com/dddplus/dddplus-archetype-demo/compare/minute-1...minute-2).\n\n## 后三分钟：完成`创建上架任务`业务逻辑\n\n### 业务分析和抽象\n\n需要领域专家和研发同学共同参与完成。\n\n`创建上架任务`从业务上被抽象成如下步骤来完成：\n- 根据上架任务编号进行防重校验\n- 通过RPC调用`人工智能系统：推荐储位`服务\n   - 一个sku，可能推荐到多个储位\n   - 因此需要根据储位数量重新拆分上架任务明细\n      - 例如：上架要求是2个明细项，推荐储位计算后可能拆分成3个\n- 储位库存预占\n- 落库保存，等待后续的任务分配\n- 上架任务的冗余数据预加载，以提升真正上架时的工人效率\n\n### 多场景下业务多态\n\n真正的上架任务，其实非常复杂：\n- 业务场景\n   - 采购入库\n   - 退货入库\n   - 内配入库\n   - 搬仓入库\n   - 加工入库\n   - 调拨入库\n   - etc\n- 上架操作方式\n   - 整箱上架\n   - 拆箱上架\n   - etc\n- 每个仓库的设备、场地、规模、运营要求等不同，上架会有不同\n- 标准件商品和异形商品上架会不同\n- 不同KA可能在对上架任务有要求，例如是否允许混分、拆包\n- 有些行业可能对上架也有特殊要求，例如：医药，冷链等\n\n### 开发内容\n\n- wms-ib-domain 模块\n   - 定义领域步骤\n   - 补充领域模型\n- wms-ib-infrastructure 模块，实现所有相关\n   - 包括事务\n   - 此处省略了 cache/DAO/MQ/RPC dubbo 等实现\n\n[github上查看该步骤提交的代码](https://github.com/dddplus/dddplus-archetype-demo/compare/minute-2...minute-3).\n\n## 后续\n\n- 根据业务的多态性，针对更多的业务场景，定义扩展点\n- 根据业务复杂度和自治性，抽象出多个支撑域\n- 根据组织上的前中台架构，和业务特征，定义 Partner 和 Pattern，并绑定扩展点实现\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdddplus%2Fdddplus-archetype-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdddplus%2Fdddplus-archetype-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdddplus%2Fdddplus-archetype-demo/lists"}