WMS_MAIN/script/tmp-check-hidden-tables.cjs
liufumingren 3352fbaff6 test(storage): directPutaway 与 quickPutaway 链路对比测试脚本
- tmp-test-putaway-full-compare.cjs:全链路真实接口对比(A 两步 quickPutaway→addItem→commit / B 一步 directPutaway),支持 A|B 参数单独跑
- tmp-test-putaway-batch-compare.cjs:批次维度对比(不同批次建行 / 同批次累加)
- tmp-verify-all-tables.cjs:15 张表逐表核对输出
- tmp-check-*:条码、请求日志、通知失败表、权限、库存行/流水等定点核对
- tmp-clear-user-cache.cjs:清 Redis 用户缓存(权限变更后刷新)
- 测试数据保留不清理(收货单 1521-1535、入库单 381-392 等)
2026-08-24 03:23:23 +08:00

43 lines
2.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
const mysql = require('mysql2/promise');
(async () => {
const c = await mysql.createConnection({ host: '127.0.0.1', port: 3307, user: 'wms', password: 'dspxmRwRdRbWtbm7', database: 'wms' });
// 1. 请求日志表:本次重测 A(1530)/B(1531) 相关的接口调用日志
const [sysLogs] = await c.query(`
SELECT id, method, v, store_id, use_time, LEFT(body, 120) AS body_snip, created_at
FROM wms_system_log
WHERE body LIKE '%R20688012%' OR body LIKE '%R20688013%'
OR body LIKE '%"receiving_id":1530%' OR body LIKE '%"receiving_id":1531%'
OR body LIKE '%"ids":[1530%' OR body LIKE '%"ids":[1531%'
OR body LIKE '%"entry_order_id":387%' OR body LIKE '%"entry_order_id":388%'
ORDER BY id`);
console.log('== wms_system_log 请求日志(本次重测相关,共 ' + sysLogs.length + ' 条) ==');
console.log(JSON.stringify(sysLogs, null, 2));
// 2. 通知发送日志表(失败才写)
const [notiLogs] = await c.query(`
SELECT id, trace_id, store_id, warehouse_id, business_name, event, status, http_status, created_at
FROM wms_notification_send_log
WHERE created_at >= DATE_SUB(NOW(), INTERVAL 2 DAY)
ORDER BY id DESC LIMIT 10`);
console.log('== wms_notification_send_log 最近两天(共 ' + notiLogs.length + ' 条) ==');
console.log(JSON.stringify(notiLogs, null, 2));
// 3. 商品资料异步补全相关(无图片/无重量时应无写入)
const [stockRow] = await c.query(
`SELECT id, is_images, gross_weight FROM wms_stock_warehouse WHERE id IN (159061, 159064)`
);
console.log('== 商品资料快照(is_images/gross_weight,验证异步补全未触发) ==');
console.log(JSON.stringify(stockRow, null, 2));
const [fileRefs] = await c.query(
`SELECT id, business_type, business_id, file_id FROM wms_file_reference WHERE business_type='stock' AND business_id IN ('159061','159064')`
);
console.log('== wms_file_reference(stock 类型,共 ' + fileRefs.length + ' 行) ==');
console.log(JSON.stringify(fileRefs, null, 2));
await c.end();
process.exit(0);
})().catch(e => { console.error(e); process.exit(1); });