新增一批一次性排查脚本(script/tmp-*.cjs),与仓库既有 script/tmp- 约定保持一致, 覆盖波次池边界与优先级核对、库位/出库报表核对、订单状态与更新范围核验等场景
66 lines
1.8 KiB
JavaScript
66 lines
1.8 KiB
JavaScript
'use strict';
|
|
|
|
/**
|
|
* 检查联调订单实际字段与任务状态。
|
|
*
|
|
* @return {Promise<void>}
|
|
*/
|
|
|
|
const mysql = require('mysql2/promise');
|
|
|
|
async function main() {
|
|
const connection = await mysql.createConnection({
|
|
host: '127.0.0.1',
|
|
port: 3307,
|
|
user: 'wms',
|
|
password: 'dspxmRwRdRbWtbm7',
|
|
database: 'wms',
|
|
});
|
|
|
|
try {
|
|
const [ orderRows ] = await connection.query(
|
|
`SELECT id, sys_platform_code, logistics_code, sys_logistics_code,
|
|
post_status, storage_status, step, status, wave_id, wave_scan_result,
|
|
wave_strategy_version, items_hash
|
|
FROM wms_order_delivery_100000
|
|
WHERE id IN (122546, 122547, 122548)
|
|
ORDER BY id ASC`
|
|
);
|
|
console.log('===== 联调订单字段 =====');
|
|
console.log(JSON.stringify(orderRows));
|
|
|
|
const [ taskRows ] = await connection.query(
|
|
`SELECT id, task_no, status, pick_mode, wave_id, pick_user_id
|
|
FROM wms_wave_pick_task
|
|
WHERE warehouse_id = 100000 AND status IN (0, 1)
|
|
ORDER BY id DESC
|
|
LIMIT 5`
|
|
);
|
|
console.log('===== 活跃拣货任务 =====');
|
|
console.log(JSON.stringify(taskRows));
|
|
|
|
const [ strategyRows ] = await connection.query(
|
|
`SELECT id, strategy_name, strategy_type, batch_mode, min_same_structure, status
|
|
FROM wms_wave_strategy
|
|
WHERE warehouse_id = 100000
|
|
ORDER BY id DESC
|
|
LIMIT 5`
|
|
);
|
|
console.log('===== 最近策略 =====');
|
|
console.log(JSON.stringify(strategyRows));
|
|
|
|
const [ versionRows ] = await connection.query(
|
|
`SELECT subject_config FROM wms_store_warehouse WHERE id = 100000`
|
|
);
|
|
console.log('===== 仓库 subject_config(版本) =====');
|
|
console.log(JSON.stringify(versionRows));
|
|
} finally {
|
|
await connection.end();
|
|
}
|
|
}
|
|
|
|
main().catch(error => {
|
|
console.error(`查询失败: ${error.message}`);
|
|
process.exit(1);
|
|
});
|