'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', 'F=/www/wwwroot/qimen/v2/app/service/systemMethods/order/wave.js', 'echo "===GREP_FUNCS==="', 'grep -n "async batchCancel\\|batchCancelWave\\|cancelSingleWave\\|wave_status = -1\\|wave_status: -1" "$F" 2>/dev/null | head -20 || true', 'echo "===SHOW_BATCHCANCEL_REGION==="', 'S=$(grep -n "async batchCancel(" "$F" | head -1 | cut -d: -f1)', 'if [ -n "$S" ]; then sed -n "${S},$((S+120))p" "$F"; fi', ].join('\n'); } const config = loadDeployConfig('production'); console.log(runSsh(config, buildRemoteScript(), { stdio: 'pipe' }));