WMS_MAIN/script/tmp-trace-wave-closure-cause.cjs
liufumingren c3f1c67592 chore(script): 沉淀波次池/报表/库存/订单本地排查脚本
新增一批一次性排查脚本(script/tmp-*.cjs),与仓库既有 script/tmp- 约定保持一致,
覆盖波次池边界与优先级核对、库位/出库报表核对、订单状态与更新范围核验等场景
2026-09-13 15:31:27 +08:00

27 lines
1.0 KiB
JavaScript

'use strict';
/**
* 只读排查脚本:追踪 2026-09-12 当天与波次 1777888535813505 相关的 SQL 及订单表 DDL。
* 仅执行 grep / cut / uniq 等只读命令。
*/
const { loadDeployConfig, runSsh } = require('./deploy-lib.cjs');
const WAVE_ID = '1777888535813505';
function buildRemoteScript() {
return [
'set -uo pipefail',
'D=/root/logs/wms/wms-web.log.2026-09-12',
'echo "===WRITES_AT_184428_CST==="',
'grep -a "2026-09-12 18:44:2[0-9]" "$D" 2>/dev/null | grep -a "wms_order_delivery_1000028" | cut -c1-420 | head -20 || true',
'echo "===WAVE_ID_CLEAR_STMTS_0912==="',
'grep -a "UPDATE .wms_order_delivery_1000028. SET .wave_id" "$D" 2>/dev/null | cut -c1-19 | uniq -c | head -30 || true',
'echo "===POST_METHODS_AT_162533==="',
'grep -a "2026-09-12 16:25:33" "$D" 2>/dev/null | grep -ao "POST /system?method=[a-zA-Z.]*" | sort | uniq -c | head -20 || true',
].join('\n');
}
const config = loadDeployConfig('production');
console.log(runSsh(config, buildRemoteScript(), { stdio: 'pipe' }));