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 (
- [x]) syntax for tracking.
Goal: 为商家前端(foodie-store)新增"财务管理"模块,包含账单查询、汇总功能,支持按门店筛选。
Architecture: 后端新增 2 个商家端账单接口(列表+汇总),修改 3 个现有账单接口增加 mdId 过滤。前端商家端新增账单管理页面,集成菜单和路由。
Tech Stack: Java / Spring Boot / MyBatis / MySQL / Vue 2 / Element UI
Language/Version: Java 8+, Vue 2 Primary Dependencies: RuoYi framework, MyBatis, Element UI Storage: MySQL Testing: 手动测试(项目无自动化测试框架) Target Platform: Web (商家管理后台) Project Type: Web application (前后端分离)
注意事项:
md_id 字段,无需数据库变更(#{mdId} IS NULL OR md_id = #{mdId}) 模式,不传时查全部specs/003-merchant-billing/
├── spec.md # 需求文档
├── plan.md # 本文件(实施计划)
└── tasks.md # 任务清单
foodie_server/
├── ruoyi-admin/src/main/java/com/ruoyi/app/pay/
│ └── UserBillingController.java # [修改] 新增 storeBillingList、storeBillingSummary 接口
├── ruoyi-system/src/main/java/com/ruoyi/system/
│ └── mapper/
│ └── UserBillingMapper.java # [修改] SQL 增加 mdId 过滤条件
foodie-store/ # 商家前端
├── src/
│ ├── api/billing.js # [新建] 账单 API
│ ├── views/
│ │ └── BillingManage.vue # [新建] 账单管理页面
│ ├── components/
│ │ └── Aside.vue # [修改] 侧边栏菜单
│ └── router/index.js # [修改] 路由配置
Files:
Modify: ruoyi-admin/src/main/java/com/ruoyi/app/pay/UserBillingController.java
[x] Step 1: 实现 storeBillingList 方法
在 UserBillingController 中新增 GET /billing/storeBillingList 接口:
返回分页账单列表 + 门店信息
[x] Step 2: 验证
使用 Postman 测试不同 userType 的查询结果。
Files:
Modify: ruoyi-admin/src/main/java/com/ruoyi/app/pay/UserBillingController.java
[x] Step 1: 实现 storeBillingSummary 方法
在 UserBillingController 中新增 GET /billing/storeBillingSummary 接口:
返回 { totalAmount, totalDivvy, netIncome }
[x] Step 2: 验证
测试汇总数据是否正确。
Files:
Modify: ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserBillingMapper.java
[x] Step 1: getdaylist SQL 增加 mdId 条件
添加 (#{mdId} IS NULL OR md_id = #{mdId})
添加 (#{mdId} IS NULL OR md_id = #{mdId})
添加 (#{mdId} IS NULL OR b.md_id = #{mdId})
测试传入/不传 mdId 的查询结果。
Files:
Modify: ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserBillingMapper.java
[x] Step 1: getmeeklist SQL 增加 mdId 条件
添加 (#{mdId} IS NULL OR md_id = #{mdId})
添加 (#{mdId} IS NULL OR md_id = #{mdId})
添加 (#{mdId} IS NULL OR b.md_id = #{mdId})
测试传入/不传 mdId 的查询结果。
Files:
Modify: ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserBillingMapper.java
[x] Step 1: getmatlist SQL 增加 mdId 条件
添加 (#{mdId} IS NULL OR md_id = #{mdId})
添加 (#{mdId} IS NULL OR md_id = #{mdId})
添加 (#{mdId} IS NULL OR b.md_id = #{mdId})
测试传入/不传 mdId 的查询结果。
Files:
Create: E:\QtwCode\foodie\foodie-store\src\api\billing.js
[x] Step 1: 创建 billing.js
提供 API 方法:getStoreBillingList、getStoreBillingSummary
Files:
E:\QtwCode\foodie\foodie-store\src\views\BillingManage.vueE:\QtwCode\foodie\foodie-store\src\router\index.jsModify: E:\QtwCode\foodie\foodie-store\src\components\Aside.vue
[x] Step 1: 创建 BillingManage.vue 页面
页面包含:
[x] Step 2: 修改 router/index.js 添加账单管理路由
[x] Step 3: 修改 Aside.vue 添加「财务管理 > 账单管理」菜单项
[x] Step 4: 验证
启动前端,登录商家账号,验证账单管理页面功能正常。
[x] Step 1: 更新 spec.md 记录实现状态
[x] Step 2: 提交代码
git commit -m "feat(billing): 商家端账单功能 — 列表查询、汇总、mdId 过滤"