商品SABC打标全部源码:页面/筛选/经营总览、服务端核算规则、同款商品编码匹配、 每日同步(聚水潭档案/销售日表/替换规则/类目档位/产品类型回填)、API 与导出、测试用例。
25 lines
1.1 KiB
Bash
Executable File
25 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
||
# 本地一键刷新(手动入口):聚水潭档案同步 → 销售日数据同步 → 正式库对齐 → 上月 SABC 重算。
|
||
# 实际逻辑在 scripts/local-sync-archive.mjs。
|
||
# 用法:
|
||
# bash scripts/local-sync-archive.sh # 同步档案、对齐正式库并重算上个月 SABC
|
||
# bash scripts/local-sync-archive.sh --month=2026-08 # 指定核算月份
|
||
# bash scripts/local-sync-archive.sh --dry-run # 只预览差异,不写库、不重算
|
||
# bash scripts/local-sync-archive.sh --skip-sabc # 只同步档案,不重算 SABC
|
||
set -euo pipefail
|
||
|
||
BASE="$(cd "$(dirname "$0")/.." && pwd)"
|
||
|
||
NODE_BIN="${NODE_BIN:-}"
|
||
if [ -z "$NODE_BIN" ]; then
|
||
if command -v node >/dev/null 2>&1; then
|
||
NODE_BIN="$(command -v node)"
|
||
elif [ -x "$HOME/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin/node" ]; then
|
||
NODE_BIN="$HOME/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin/node"
|
||
else
|
||
echo "找不到 node,请安装 Node.js 或设置 NODE_BIN。" >&2
|
||
exit 1
|
||
fi
|
||
fi
|
||
exec "$NODE_BIN" "$BASE/scripts/local-sync-archive.mjs" "$@"
|