feat(web): 采购管理与 SYB 商品按当前筛选导出全部页 Excel,采购管理新增下单日期筛选 #372
Open
opened 2026-10-09 10:07:31 +08:00 by ila
·
11 comments
No Branch/Tag Specified
main
fix/370-horizontal-grid
feat/372-export-shop
feat/378-heartbeat-diagnostics
feat/372-export-price
feat/372-list-export
fix/377-rejected-purchase-outbox
fix/376-pre-address-spec-verification
fix/374-final-spec-confirmation
fix/373-navigation-diagnostics
fix/370-color-discovery
feat/367-last-batch-repurchase
fix/368-image-search-partial-link
integration/364-365-366-main
feat/364-purchase-failure-snapshot
integration/365-366-validation
fix/365-order-result-observation
fix/366-address-editor-ready
fix/359-auto-match-resume
feat/363-inner-code-page-size
fix/362-truncated-spec-card
fix/361-spec-probe-click
docs/agents-worktree-rules
fix/358-syb-size-weight
feat/357-syb-cancel-status
feat/356-purchase-order-filter
fix/355-syb-list-timeout
feat/353-syb-shop-multiselect
fix/354-syb-top-pagination
fix/352-syb-source-created
fix/348-reveal-swipe
feat/340-syb-excluded-products
fix/351-inner-code-apply-selection
fix/350-match-layout
fix/350-inner-code-matching
feat/349-batch-return-use
feat/347-batch-return-cancel
feat/345-yeeke-reship
fix/346-root-serves-spa
fix/344-inner-code-stall-match
fix/343-syb-writeback-session
feat/339-syb-page-size
feat/338-return-match
feat/337-yeeke-admin-ui
feat/336-yeeke-return-sync
fix/335-bottom-submit-node
fix/334-spec-probe-top-swipe
fix/333-purchaser-device-owner
fix/331-spec-panel-recognition
fix/330-syb-writeback-session
feat/327-syb-writeback-filter
feat/326-order-information
fix/325-order-result
feat/316-chrome-order-backfill
fix/307-backfill-entry
feat/305-syb-order-writeback
feat/306-order-paid-amount
release/283
fix/283-purchase-mapping-consistency
fix/230-horizontal-spec-selection
feat/263-spec-rematch
fix/262-purchase-handoff
fix/260-261-purchase-readiness
fix/259-partial-collection-link
feat/258-one-click-replace
fix/257-color-normalized-match
fix/256-collection-single-dimension
fix/255-current-page-reidentify
feat/253-one-click-link
fix/254-match-loading
fix/251-syb-spec-candidates
feat/250-continuous-collection
fix/249-local-purchase-diagnostics
fix/248-bottom-submit
fix/247-short-address-panel
fix/246-address-return-panel
fix/245-purchase-failure-diagnostics
fix/244-selected-card-duplicates
fix/243-spec-entry-recovery
feat/242-agent-order-backfill
feat/241-order-backfill-endpoint
fix/239-syb-partial-sync
fix/238-spec-panel-preswipe
feat/237-client-api-keys
feat/236-purchaser-syb-sync
fix/235-syb-pagination-overlap
release/234-integrated
fix/229-address-entry-dedup
fix/228-selection-proof-panel-transition
fix/227-address-panel-return
fix/226-reopen-pdd-on-manual-retry
fix/225-in-place-purchase-retry
fix/224-final-spec-revalidation
fix/223-probed-confirmed-mapping
chore/221-devharness-sync
feat/218-purchase-result-bubble
fix/217-agent-retry-current-spec
fix/216-syb-spec-role-order
feat/215-mandatory-live-spec-probe
feat/214-verified-purchase-actions
fix/212-syb-sync-shop-snapshot
feat/211-spec-entry-ready-wait
feat/210-order-result-payment-transition
feat/209-pdd-bottom-spec-entry
feat/200-ai-match-result-purchase-ready
feat/199-job-execution-logs
feat/198-syb-ai-parse
feat/195-scheduled-spec-auto-match
fix/197-ai-write-timeout
feat/190-syb-inline-correction
fix/193-address-entry-reveal
feat/194-one-click-spec-match
fix/192-order-result-scroll
No results found.
Labels
No items
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: OPC/goauto#372
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
基本信息
72a15f8)、v2(4ad59bd)已于 2026-10-10 合并 main 并发布,待验收;v3 需求变更(见下)已确认,待实施。shopName,与页面「店铺」列一致,即 SYB 订单的店铺(虾皮商品档案的店铺也由此写入);不使用店铺筛选下拉里的显示名;已核验事实(
origin/maine450ac28989de6827328b411e4bdc050dded9ab3)web/src/vendor/Export2Excel.js(xlsx+file-saver,已是依赖)把this.list(当前页已加载的行)存成 Excel。服务端没有导出接口;web/src/api/admin/sys-user.js的/api/v1/sys-user/export在服务端不存在。GoAuto 页面(采购管理、SYB 商品)没有导出。web/src/views/goauto/purchase-tasks/index.vue,接口GET /api/admin/v1/purchase-tasks):AdminTaskItem已有shopeeOrderNoSnapshot、shopeeItemIdSnapshot、targetColorSnapshot、targetSizeSnapshot、quantity、status、pddOrderNo、orderSubmittedAt、pddOrderAmountCent。pddOrderAmountCent由 Agent 在结果页读取应付金额(PurchaseLiveAutomation.parsePayableAmount);旧版 Agent 或人工补录前可能为空。pageSize服务端上限 100(admin_query.go)。handler_access_test.go)。web/src/views/goauto/syb-products/index.vue):return_used「已用退货」、purchase_succeeded「采购成功」)、采购类型、创建时间;每页最多 500。GET /api/admin/v1/return-matches?sybProductId=…(returnmatch.Service.List),ListItem含matchedAt、status、orderSn、variationName,不含 yeeke 数量。variation_name字段,颜色和尺码写在一起(与 SYB 侧颜色,尺码对比,见returnmatch/normalize.go)。return-matches列表对任何已登录 Admin 用户可读。目标
非目标
方案
共用
Export2Excel生成.xlsx。YYYY-MM-DD HH:mm:ss(本地时区);金额单位为元,保留两位小数;空值留空。0.00显示格式时就设置;做不到就如实记录,不为此改动自带页面。采购导出_YYYYMMDD-HHmmss.xlsx、SYB商品导出_YYYYMMDD-HHmmss.xlsx。采购管理
shopeeOrderNoSnapshotshopeeItemIdSnapshottargetColorSnapshot(SYB 规格)targetSizeSnapshot(SYB 规格)quantitypddOrderNoorderSubmittedAtpddOrderAmountCent / 100(PDD 待付款页读取的应付金额,没读到时留空);v2 起为数字单元格AdminListRequest新增orderSubmittedFrom/orderSubmittedTo(日期,含首尾两天,按order_submitted_at过滤);前端在筛选栏加日期范围选择。时区处理与 SYB 商品页现有的创建时间筛选保持一致。没有下单时间的任务,在设置这个筛选时不会出现。SYB 商品
shopName,与页面「店铺」列同值;空值留空unitPriceCent / 100,即页面「售价」列的同一值(SYBdetail/listByStock的productPrice,单件成交单价,元/TWD);数字单元格;为空时留空matched或confirmed)对应的variationName,按第一个英文或中文逗号拆分;没有逗号时整段放在 yeeke 颜色matchedAtreturn-matches列表补齐匹配信息,不逐行请求。没有有效匹配的商品,yeeke 列和匹配时间留空。returnmatch.ListItem增加 yeeke 退货商品数量(只读字段,来自现有 join 查询),不改其他返回内容。设计证据(低保真,待用户确认)
状态:正常、空(无数据提示)、加载中(进度、禁用)、失败(提示,不生成文件)、超限(提示)。权限:能打开列表的用户都可以用,不新增按钮权限。
子项目影响、依赖与并行
purchase列表新增下单日期筛选;returnmatch.ListItem新增 yeeke 数量。无数据库迁移、无新接口。验收标准
INVALID_REQUEST;return-matches列表返回 yeeke 数量。如实记录。
SYB订单、虾皮商品ID、SYB售价(TWD)、SYB颜色、SYB尺码、SYB数量、yeeke颜色、yeeke尺码、yeeke数量、匹配时间;售价unitPriceCent1230 → 数值 12.3、0 → 0、空 → 留空;采购导出价格列同样为数值,空值留空;生成的工作表中这两列单元格类型为数字。SYB订单、店铺、虾皮商品ID、SYB售价(TWD)、SYB颜色、SYB尺码、SYB数量、yeeke颜色、yeeke尺码、yeeke数量、匹配时间;shopName有值时原样输出,null/undefined 留空;售价列仍为数字单元格且0.00格式落在新的列号上。风险与回退
文档影响
return-matches列表新增数量字段。备注
本单由 Claude Code 依据代码阅读和用户确认的需求起草。
开始实施
3ee8dfc(origin/main;正文核验基线为e450ac2,动手前会重新核对)feat/372-list-exportD:/OPC/goauto-worktrees/issue-372待验收回写(Claude Code,Sonnet subagent,2026-10-10)
分支
feat/372-list-export,已推送,未合并、未发布、未删除 worktree(D:/OPC/goauto-worktrees/issue-372)。基线origin/main3ee8dfc。提交
a4a793ffeat(web): export all filtered pages to Excel for purchase tasks and SYB products (#372)b311885docs: sync Wiki mirror for list export (#372)动手前核对
3ee8dfc上仍成立:AdminListRequest无日期筛选、pageSize上限 100;returnmatch.ListItem无 yeeke 数量;return-matches列表本来就支持一次传多个sybProductId(c.QueryArray),不需要扩展接口。实现摘要
purchase.AdminListRequest新增OrderSubmittedFrom/To,handler 读取orderSubmittedFrom/orderSubmittedTo;含首尾两天,按order_submitted_at,日期边界 UTC+8(与 SYB 创建时间筛选一致);格式错误或起止倒置返回INVALID_REQUEST。returnmatch.ListItem新增只读yeekeQuantity,来自既有yeeke_return_itemjoin。web/src/utils/list-export.js(总数超 5000 不导出、逐页读取、进度、任一页/批次失败不生成文件、无数据提示、时间/金额/文件名格式、yeeke 规格拆分、行映射)和web/src/utils/save-excel.js(按需加载Export2Excel)。采购管理页新增「下单日期」范围筛选和「导出」按钮;SYB 商品页新增「导出」按钮,逐页读商品后每 200 个商品 ID 调一次return-matches,只用matched/confirmed,variationName按第一个英文或中文逗号拆分。导出期间按钮显示「导出中 n/m」并禁用,筛选条件在点击时复制固定。不新增按钮权限,不导出收货人、地址、账号。12.30(保证两位小数);若用户希望 Excel 里可求和的数值列,需另行确认。改动文件
server/app/goauto/purchase/admin_query.go、handler.go、admin_submitted_range_test.go(新增)server/app/goauto/returnmatch/service.go、service_test.goweb/src/utils/list-export.js、web/src/utils/save-excel.js、web/tests/unit/list-export.test.cjs(均新增)web/src/views/goauto/purchase-tasks/index.vue、web/src/views/goauto/syb-products/index.vuedocs/02-architecture-and-code-map.md、docs/03-business-rules-and-glossary.md(Wiki 镜像)测试(真实结果)
本机默认 go 1.24 不满足
go.mod要求,用已缓存的 go1.26.5 工具链、CGO_ENABLED=1、GOTOOLCHAIN=local运行。go test -count=1 ./app/goauto/purchase/ ./app/goauto/returnmatch/:通过。新增覆盖:下单日期首尾两天含边界、仅起/仅止/单日、与 status 组合、无下单时间行、日期格式错误与起止倒置(service 和 handler 均INVALID_REQUEST、purchaser 角色可访问);return-matches列表返回yeekeQuantity(含 JSON 字段)。go test -count=1 ./app/goauto/...:除sybimport外全部 ok;go build ./...通过。sybimport有 12 个失败(解析/AI 解析相关)。我在干净的origin/main临时 worktree 上单独跑go test ./app/goauto/sybimport同样 FAIL,所以是既有失败,与本单无关,未处理(临时 worktree 已删除)。node --test web/tests/unit/*.cjs:90 个全部通过,其中新增 10 个(行到列映射、金额换算、空值、yeeke 英文逗号/中文逗号/无逗号拆分、取消的匹配被忽略、5000 条允许与 5001 条只读第 1 页后拒绝、无数据不保存、中途失败不保存、批量补匹配按批而非逐行并在失败时不保存)。pnpm install --frozen-lockfile:通过。pnpm run build:prod:通过。pnpm run lint:失败,但失败是既有的(collection-tasks、devices.js、syb-product-filters.js、yeeke-returns、purchase-tasks里已有的混用 tab/缩进错误等)。本单新增代码已单独检查,没有新增 lint 错误;purchase-tasks/index.vue里剩余的brace-style等错误在原有代码行上。scripts/verify.ps1,因为go test ./...会撞上上面的既有sybimport失败,改为按包分别执行。未验证项
Export2Excel的 xlsx 生成路径只靠既有 vendor 代码,未跑过真实下载。Wiki
有长期文档影响,已处理:先读取线上最新内容和 revision(写前未发现他人并发修改),只追加 #372 段落,写后回读核对一致。
Architecture-and-Code-Map:76854d9→08da88a4f106004cb5f02448260d2fc22a83e9ccBusiness-Rules-and-Glossary:7cdfe55→1c57a8670034fe08420bcac48b58a9c4b2755f23harness.py sync和一次sync --check(通过)。镜像同步还带入了线上他人已更新的部分内容(与 #372 无关的旧差异)。docs/06-troubleshooting.md因线上已更新也被同步改动,但不属于本单,已还原未提交;该镜像在main上本来就滞后,需要时另行同步。其它
2026-10-10 合并 main 与线上发布(Claude Code)
用户授权:「合并到main,并发布」。
合并
feat/372-list-export以--no-ff合并为 main72a15f8。合并前 main 已含 #377 的 Android 提交(8b75a95、309dce3、4a669bc)。docs/03-business-rules-and-glossary.md镜像冲突:选用同时包含 #377 和 #372 段落的较新导出版本(Business-Rules-and-Glossary@1c57a86),sync --check通过。go test ./app/goauto/purchase/ ./app/goauto/returnmatch/通过;node --test web/tests/unit/*.cjs90/90 通过;pnpm run build:prod通过。发布(122.228.200.167)
/home/goauto/releases/20261010-72a15f8-372;回滚目录/home/goauto/releases/20261009-e26743c-integrated保留。e26743c以来,Server/Web 源码只有 #372 的变化;无数据库迁移、无权限变更,未执行 migrate。ab3943a1261f438eaad4d4acf006910e8a996cf97afc18a399ad5bee6c8f3a1f(运行进程一致);index.html SHA256c3465960bd6f450d7b0d51994475bfdc126c7b6a47068d92bad9b4ac751d0529。/、/login返回同一 index(含id="app",无欢迎页);10 项 JS/CSS 200;health 200;验证码 code=200;未登录访问采购列表(带下单日期参数)和 return-matches 业务码 401;日志无 panic/fatal/1146/1054。Wiki
3f69f2e→ad212f537b7d153e6337b3f2851e661680bfba20,回读一致。919744e,sync --check通过。未验证(待业务验收)
价格列目前导出为文本(如
12.30),是否改为数值待用户决定。2026-10-10 worktree 清理(Claude Code)
D:/OPC/goauto-worktrees/issue-372、D:/OPC/goauto-worktrees/release-372:删除前确认 HEAD 是origin/main的祖先、git status --porcelain为空、没有进程或 supervisor 配置引用、没有指向外部的链接。git worktree remove(未加--force)和git worktree prune。两个 worktree 都已取消登记,分支feat/372-list-export和提交历史保留。web/node_modules是 pnpm 依赖(各约 5 万个被 Git 忽略的文件),git 没能删掉,按规则没有强删。残留路径:D:/OPC/goauto-worktrees/issue-372/web/node_modulesD:/OPC/goauto-worktrees/release-372/web/node_modules里面不含源码或数据,可以之后手动删除。
v2 开始实施
919744e(origin/main)feat/372-export-price;worktree:D:/OPC/goauto-worktrees/issue-372-v2v2 待验收(回写)
分支
feat/372-export-price,未合并 main、未发布。实现
unitPriceCent / 100(与页面「售价」列同源),数字单元格;空值留空,0 写 0。表头顺序:SYB订单、虾皮商品ID、SYB售价(TWD)、SYB颜色、SYB尺码、SYB数量、yeeke颜色、yeeke尺码、yeeke数量、匹配时间。centToYuanNumber)。0.00显示格式:export_json_to_excel新增可选参数numberFormatCols(默认空数组),只对传入的列、且值为数字的单元格设置z='0.00';go-admin 自带页面(字典、参数、日志、岗位)不传该参数,导出结果不变(测试中验证了不传时无0.00格式)。改动文件
web/src/utils/list-export.jsweb/src/vendor/Export2Excel.jsweb/src/views/goauto/purchase-tasks/index.vueweb/src/views/goauto/syb-products/index.vueweb/tests/unit/list-export.test.cjsdocs/03-business-rules-and-glossary.md(Wiki 镜像)测试(真实结果)
cd web && node --test tests/unit/*.cjs:93 项通过,0 失败。新增覆盖:表头顺序;售价 1230→12.3、0→0、null/undefined→'';采购价格数值与空值;用真实Export2Excel写出 xlsx 后读回,验证这两列单元格类型为n、格式0.00、未传参数时不带该格式。说明:空值在工作表里是空字符串单元格(与既有其他空列写法一致),类型不是数字。pnpm run build:prod:成功(exit 0)。eslint对三个相关文件:修改前后均为 35 个问题(24 error、11 warning,既有),未新增。未验证项
提交
d8d9ab9d528c74Wiki
35c42f6136426bd3c295fe912d491c3fd980fcb4,已回读与写入内容一致;sync与sync --check各执行一次,仅提交该页镜像。title写成带.-的路径名,导致页面标题与路径被改(...Glossary.-.-);已立即用原标题Business-Rules-and-Glossary修回,路径恢复为Business-Rules-and-Glossary.-,页面列表核对仅此一个同名页。2026-10-10 v2 合并 main 与纯 Web 发布(Claude Code)
用户授权:「合并 #372 v2,并部署到线上」「先让sonnet做完,在合并 #372 v2在更新线上」。
合并前审核
d8d9ab9的 diff:unitPriceCent,与页面「售价」同源;centToYuanNumber,空值留空、0 保留;Export2Excel的numberFormatCols是可选参数,默认空,go-admin 自带页面导出不变。合并
feat/372-export-price(d528c74)以--no-ff合并为 main4ad59bd;sync --check通过。node --test tests/unit/*.cjs93/93 通过,pnpm run build:prod通过。72a15f8相比,Server 源码没有变化。纯 Web 发布(122.228.200.167)
/home/goauto/releases/20261010-4ad59bd-372v2-web,只替换 dist:83c2dfa845c29073234bbdaaabac0690c46b51d32c85609aaf2743b854915a57。GOAUTO_WEB_DIST都指向/home/goauto/current/dist,所以只原子切换 current,没有重启 GoAuto 和 Nginx:切换前后 PID 4786 不变,服务 active。/、/login返回新 index;/home/goauto/releases/20261010-72a15f8-372,不需要重启。ad212f5→77f9ed70e5cd9ab0fffa20e0899fdbef4adaadb5,回读一致。未验证(待业务验收)
2026-10-10 v2 worktree 清理(Claude Code)
issue-372-v2和release-372-v2:HEAD 都是origin/main的祖先,git status为空。git worktree remove(未加--force)和prune。两个 worktree 已取消登记,分支feat/372-export-price保留。镜像提交在 main 上,为575d5f3。web/node_modules,按规则没有强删。残留路径:D:/OPC/goauto-worktrees/issue-372-v2/web/node_modulesD:/OPC/goauto-worktrees/release-372-v2/web/node_modulesv3 开始实施
db64a49(origin/main)feat/372-export-shop,worktreeD:/OPC/goauto-worktrees/issue-372-v3shopName),同步调整售价数字格式列号。v3 待验收
实现:SYB 商品导出在「SYB订单」右边新增「店铺」列,取商品行
shopName(与页面「店铺」列同值),文本单元格,null/undefined 留空。SYB_PRODUCT_EXPORT_NUMBER_COLS由[2]改为[3],0.00格式仍落在「SYB售价(TWD)」列。采购导出、服务端、接口、数据库、Export2Excel.js均未改。提交:
e351a69,分支feat/372-export-shop(已推送,基线db64a49,未合并、未发布)。改动文件
web/src/utils/list-export.jsweb/tests/unit/list-export.test.cjsdocs/03-business-rules-and-glossary.md(Wiki 镜像,仅 revision 和 #372 段落变化)测试
node --test tests/unit/*.cjs(web 目录):93 项通过,0 失败。新增或更新覆盖:表头顺序为SYB订单、店铺、虾皮商品ID、SYB售价(TWD)、SYB颜色、SYB尺码、SYB数量、yeeke颜色、yeeke尺码、yeeke数量、匹配时间;shopName有值原样输出、null/undefined 留空;用真实Export2Excel写出再读回,售价列(D 列)为数字且格式0.00,店铺列(B 列)为文本且无0.00格式。pnpm run build:prod:成功(退出码 0)。npx eslint src/utils/list-export.js:无告警(退出码 0)。未验证:浏览器验证(导出的「店铺」与页面「店铺」列一致、Excel 实际打开效果)未执行;未登录任何 Admin;未发布。
Wiki:Business-Rules-and-Glossary 的 #372 段落已加入「店铺」列,写入后回读确认;新 revision
d427a46283561df71714929c13b7156ee42debea。已执行一次sync和一次sync --check(通过),镜像只带出docs/03-business-rules-and-glossary.md,无其他无关变化。PATCH 的title使用Business-Rules-and-Glossary,回读标题正确。worktree:
D:/OPC/goauto-worktrees/issue-372-v3保留,未删除。2026-10-10 v3 合并 main 与纯 Web 发布(Claude Code)
用户授权:「合并 #372 v3,并部署到线上」。
合并
e351a69的 diff:新列取shopName;SYB_PRODUCT_EXPORT_NUMBER_COLS从 2 改为 3,售价格式跟着移到新列号。未发现问题。feat/372-export-shop以--no-ff合并为 main3d5e964。build:prod通过,sync --check通过。纯 Web 发布
/home/goauto/releases/20261010-3d5e964-372v3-web。b900a40ec4691f0fb2c3d89e1e20826e7ca3205db311a33c24087767a515979a。/和/login返回新 index;SYB订单, 店铺, 虾皮商品ID, SYB售价(TWD), …;72a15f8构建。/home/goauto/releases/20261010-4ad59bd-372v2-web,不需要重启。b50250e→d08a0dfbb8356f9cd7212d495e4f11beca59e293,回读一致;镜像已提交 main23dafcf。未验证(待业务验收)