--- description: "Task list for 商家前端账单功能 feature implementation" --- # Tasks: 商家前端账单功能 **Input**: Design documents from `specs/003-merchant-billing/` **Prerequisites**: plan.md, spec.md **Tests**: 手动测试(项目无自动化测试框架) **Organization**: Tasks are grouped by backend API changes and frontend implementation. ## Format: `[ID] [P?] [Story] Description` - **[P]**: Can run in parallel (different files, no dependencies) - **[Story]**: Which phase this task belongs to (BE=后端, FE=前端) - Include exact file paths in descriptions --- ## Phase 1: 后端 — 新增商家端账单接口 **Purpose**: 新增商家端专用的账单列表和汇总接口 - [x] T001 [BE] UserBillingController.java 新增 storeBillingList 方法 — `ruoyi-admin/src/main/java/com/ruoyi/app/pay/UserBillingController.java` - GET /billing/storeBillingList - 支持 mdId、type、startDate、endDate 筛选 - userType=1 按 user_id 查,userType=4 按 store_id 查 - 返回分页账单列表 + 门店信息 - [x] T002 [BE] UserBillingController.java 新增 storeBillingSummary 方法 — `ruoyi-admin/src/main/java/com/ruoyi/app/pay/UserBillingController.java` - GET /billing/storeBillingSummary - 参数同 storeBillingList - 返回 { totalAmount, totalDivvy, netIncome } **Checkpoint**: 商家端账单列表和汇总接口可用 --- ## Phase 2: 后端 — 现有账单接口增加 mdId 过滤 **Purpose**: 修改日/周/月账单接口,支持按门店筛选 - [x] T003 [P] [BE] UserBillingMapper.getdaylist / getdaysum / getShDaysum 增加 mdId 过滤条件 — `ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserBillingMapper.java` - SQL: `(#{mdId} IS NULL OR md_id = #{mdId})` - join 查询使用 `b.md_id` - [x] T004 [P] [BE] UserBillingMapper.getmeeklist / getmeeksum / getShMeeksum 增加 mdId 过滤条件 — `ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserBillingMapper.java` - SQL: `(#{mdId} IS NULL OR md_id = #{mdId})` - join 查询使用 `b.md_id` - [x] T005 [P] [BE] UserBillingMapper.getmatlist / getmatsum / getshMonthsum 增加 mdId 过滤条件 — `ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserBillingMapper.java` - SQL: `(#{mdId} IS NULL OR md_id = #{mdId})` - join 查询使用 `b.md_id` **Checkpoint**: 所有账单接口支持 mdId 可选过滤 --- ## Phase 3: 前端 — 账单管理页面 **Purpose**: 商家前端新增财务管理模块和账单管理页面 - [x] T006 [P] [FE] 创建 billing.js API 层 — `foodie-store/src/api/billing.js` - getStoreBillingList(params) - getStoreBillingSummary(params) - [x] T007 [FE] 创建 BillingManage.vue 账单管理页面 — `foodie-store/src/views/BillingManage.vue` - 筛选条件:门店选择、账单类型、时间范围 - 汇总区域:总金额、总抽成、净收入 - 账单列表表格 + 分页 - 权限区分:商家可选门店,摊位主自动限定 - [x] T008 [FE] router/index.js 添加账单管理路由 — `foodie-store/src/router/index.js` - [x] T009 [FE] Aside.vue 添加「财务管理 > 账单管理」菜单项 — `foodie-store/src/components/Aside.vue` **Checkpoint**: 商家登录 → 财务管理 → 账单管理 → 筛选查看账单 --- ## Phase 4: 收尾 **Purpose**: 文档更新和代码提交 - [x] T010 更新 spec.md 记录实现状态和涉及文件 - [x] T011 补充 plan.md 和 tasks.md 文档 - [x] T012 提交代码: `git commit -m "feat(billing): 商家端账单功能 — 列表查询、汇总、mdId 过滤"` --- ## Dependencies & Execution Order ### Phase Dependencies - **Phase 1 (新增接口)**: 无依赖,立即开始 - **Phase 2 (mdId 过滤)**: 无依赖,可与 Phase 1 并行 - **Phase 3 (前端页面)**: 依赖 Phase 1 完成(前端需要调用新增接口) - **Phase 4 (收尾)**: 依赖所有 Phase 完成 ### Parallel Opportunities - Phase 1 和 Phase 2 可并行(不同接口,独立修改) - T006 可与 T007 并行(API 层和页面可同时开发) - T003, T004, T005 可并行(修改不同 SQL 方法组) --- ## Notes - 无数据库 Schema 变更(UserBilling 已有 md_id 字段) - mdId 过滤采用 `(#{mdId} IS NULL OR md_id = #{mdId})` 模式,不传时查全部 - 前端日/周/月账单明细页(getzddaylist / getzdmeeklist / getzdmatlist)尚未在前端实现,仅后端接口已就绪