- workbench: 工作台成员拆分 wms_workbench_member 表,下线 barcode 字段,新增绑定/移除成员接口 - order: 订单配送新增 wave_scope 波次范围字段与历史回填,自动分配快递排除备注与储位分配限制修复 - storage.transaction.list: 重写为 wms_storage_transaction 逐条明细查询,消除聚合慢查询 - stock.report: 分页默认生效、排序白名单扩充、where.stock_id 数组兼容修复 - storage.entry: quickInbound/commit 新增 noNeedNotice 通知开关 - storage.inventory.list: stock_query 支持数组多关键字并集匹配 - store: 手工单回传通知策略 notify_manual_sync - docs: 同步接口文档与变更记录、路由表;test: 补充快递排除与储位分配限制测试
49 lines
1.6 KiB
JavaScript
49 lines
1.6 KiB
JavaScript
'use strict';
|
||
|
||
/**
|
||
* 临时核验脚本 v2:核实生产库历史领料人回填来源(wms_operation_log)。
|
||
*/
|
||
|
||
const dbConfig = require('../database/config.js');
|
||
const Sequelize = require('sequelize');
|
||
|
||
(async () => {
|
||
const cfg = dbConfig.production;
|
||
const s = new Sequelize(cfg.database, cfg.username, cfg.password, {
|
||
host: cfg.host,
|
||
port: cfg.port,
|
||
dialect: cfg.dialect || 'mysql',
|
||
logging: false,
|
||
});
|
||
|
||
const q = async sql => {
|
||
const rows = await s.query(sql, { type: Sequelize.QueryTypes.SELECT });
|
||
return Array.isArray(rows) ? rows : [];
|
||
};
|
||
|
||
const claimLogTotal = await q(
|
||
"SELECT COUNT(*) AS c, COUNT(DISTINCT warehouse_id) AS wh "
|
||
+ "FROM wms_operation_log WHERE operation_code = 'ORDER_WAVE_CLAIM'"
|
||
);
|
||
console.log('A. 领料日志总数/仓库数:', JSON.stringify(claimLogTotal));
|
||
|
||
const claimLogSample = await q(
|
||
"SELECT id, business_type, business_id, operation_code, operator_id, operator_name, message, warehouse_id, created_at "
|
||
+ "FROM wms_operation_log WHERE operation_code = 'ORDER_WAVE_CLAIM' "
|
||
+ "ORDER BY id DESC LIMIT 5"
|
||
);
|
||
console.log('B. 领料日志最近5条:', JSON.stringify(claimLogSample, null, 2));
|
||
|
||
const claimLogByOperator = await q(
|
||
"SELECT operator_id, operator_name, COUNT(*) AS c FROM wms_operation_log "
|
||
+ "WHERE operation_code = 'ORDER_WAVE_CLAIM' GROUP BY operator_id, operator_name "
|
||
+ "ORDER BY c DESC LIMIT 10"
|
||
);
|
||
console.log('C. 领料日志按操作人分布:', JSON.stringify(claimLogByOperator, null, 2));
|
||
|
||
await s.close();
|
||
})().catch(e => {
|
||
console.error('ERROR:', e.message);
|
||
process.exit(1);
|
||
});
|