feat(pick): 大团购任务 pick_mode 修正为 5,波次/订单/拣货任务表新增领料人与抓取人字段,领料人非本人拦截重领并覆盖
This commit is contained in:
parent
68c279b896
commit
6a71957686
@ -425,6 +425,30 @@ module.exports = app => {
|
||||
defaultValue: '',
|
||||
comment: '波次号,空字符串表示未分配',
|
||||
},
|
||||
grab_operator_id: {
|
||||
type: BIGINT(20),
|
||||
allowNull: true,
|
||||
defaultValue: null,
|
||||
comment: '抓取人工号ID',
|
||||
},
|
||||
grab_operator: {
|
||||
type: STRING(50),
|
||||
allowNull: true,
|
||||
defaultValue: null,
|
||||
comment: '抓取人',
|
||||
},
|
||||
claim_operator_id: {
|
||||
type: BIGINT(20),
|
||||
allowNull: true,
|
||||
defaultValue: null,
|
||||
comment: '领料人工号ID',
|
||||
},
|
||||
claim_operator: {
|
||||
type: STRING(50),
|
||||
allowNull: true,
|
||||
defaultValue: null,
|
||||
comment: '领料人',
|
||||
},
|
||||
wave_strategy_version: {
|
||||
type: INTEGER(10),
|
||||
allowNull: false,
|
||||
|
||||
@ -46,6 +46,16 @@ module.exports = app => {
|
||||
allowNull: true,
|
||||
comment: '拣货员',
|
||||
},
|
||||
claim_operator: {
|
||||
type: STRING(50),
|
||||
allowNull: true,
|
||||
comment: '领料人',
|
||||
},
|
||||
claim_time: {
|
||||
type: DATE,
|
||||
allowNull: true,
|
||||
comment: '领料时间',
|
||||
},
|
||||
picking_start_time: {
|
||||
type: DATE,
|
||||
allowNull: true,
|
||||
|
||||
@ -975,6 +975,9 @@ class WaveService extends OrderBaseService {
|
||||
: 0;
|
||||
const normalizedSourceInput = Number(normalizedOptions.source);
|
||||
const normalizedSource = [ 0, 1, 2 ].includes(normalizedSourceInput) ? normalizedSourceInput : 0;
|
||||
const logOperator = this.getOrderLogOperator() || {};
|
||||
const claimOperator = String(logOperator.name || '').trim() || null;
|
||||
const grabOperatorId = Number(logOperator.id || 0) > 0 ? Number(logOperator.id) : null;
|
||||
const normalizedMinGroupOrderFetchQuantity = Number.isInteger(Number(minGroupOrderFetchQuantity))
|
||||
&& Number(minGroupOrderFetchQuantity) > 0
|
||||
? Number(minGroupOrderFetchQuantity)
|
||||
@ -1039,6 +1042,8 @@ class WaveService extends OrderBaseService {
|
||||
await model.update({
|
||||
wave_id: waveId,
|
||||
wave_no: waveNo,
|
||||
grab_operator_id: grabOperatorId,
|
||||
grab_operator: claimOperator,
|
||||
}, {
|
||||
where: {
|
||||
id: { [Op.in]: candidateOrderIds },
|
||||
@ -1047,6 +1052,23 @@ class WaveService extends OrderBaseService {
|
||||
transaction,
|
||||
});
|
||||
|
||||
// 抓取波次(source=1/2)无需领料:将抓取人冗余写入领料人字段,便于追溯
|
||||
if ([ 1, 2 ].includes(normalizedSource) && claimOperator) {
|
||||
await ctx.model.WaveBatch.update(
|
||||
{
|
||||
claim_operator: claimOperator,
|
||||
claim_time: new Date(),
|
||||
},
|
||||
{
|
||||
where: {
|
||||
wave_id: waveId,
|
||||
warehouse_id: warehouseId,
|
||||
},
|
||||
transaction,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
const grabbedRows = await model.findAll({
|
||||
where: {
|
||||
id: { [Op.in]: candidateOrderIds },
|
||||
@ -7091,6 +7113,9 @@ class WaveService extends OrderBaseService {
|
||||
}
|
||||
|
||||
const warehouseId = contextWarehouseId;
|
||||
const logOperator = this.getOrderLogOperator() || {};
|
||||
const grabOperatorId = Number(logOperator.id || 0) > 0 ? Number(logOperator.id) : null;
|
||||
const grabOperator = String(logOperator.name || '').trim() || null;
|
||||
const rawIds = data && (
|
||||
data.ids !== undefined
|
||||
? data.ids
|
||||
@ -7206,6 +7231,8 @@ class WaveService extends OrderBaseService {
|
||||
await orderModel.update({
|
||||
wave_id: waveId,
|
||||
wave_no: waveNo,
|
||||
grab_operator_id: grabOperatorId,
|
||||
grab_operator: grabOperator,
|
||||
}, {
|
||||
where: {
|
||||
id: { [Op.in]: fetchableOrderIds },
|
||||
@ -10892,6 +10919,8 @@ class WaveService extends OrderBaseService {
|
||||
* @param {number|string} params.waveType 波次类型(1-团购,2-散单)。
|
||||
* @param {string} params.wavePrefix 波次前缀。
|
||||
* @param {number|string} [params.source=0] 波次来源。
|
||||
* @param {string} [params.claimOperator] 抓取人姓名:抓取波次(source=1/2)无需领料,
|
||||
* 将该值冗余写入波次表领料人字段(claim_operator)。
|
||||
* @param {Object} params.transaction 事务对象。
|
||||
* @return {Promise<{ waveId: number, waveNo: string, selectedOrderIds: Array<number> }>} 创建结果。
|
||||
*/
|
||||
@ -10901,6 +10930,10 @@ class WaveService extends OrderBaseService {
|
||||
const wavePrefix = String(params.wavePrefix || '').trim() || (waveType === 2 ? 'A' : 'B');
|
||||
const sourceInput = Number(params.source);
|
||||
const source = [ 0, 1, 2 ].includes(sourceInput) ? sourceInput : 0;
|
||||
const claimOperator = String(params.claimOperator || '').trim() || null;
|
||||
const claimOperatorId = Number(params.claimOperatorId || 0) > 0
|
||||
? Number(params.claimOperatorId)
|
||||
: null;
|
||||
const transaction = params.transaction;
|
||||
const orderIds = this.normalizeIdsInput(params.orderIds || []);
|
||||
if (orderIds.length === 0) {
|
||||
@ -10960,6 +10993,8 @@ class WaveService extends OrderBaseService {
|
||||
await orderModel.update({
|
||||
wave_id: waveId,
|
||||
wave_no: waveNo,
|
||||
grab_operator_id: claimOperatorId,
|
||||
grab_operator: claimOperator,
|
||||
}, {
|
||||
where: {
|
||||
id: { [Op.in]: fetchableOrderIds },
|
||||
@ -11011,6 +11046,23 @@ class WaveService extends OrderBaseService {
|
||||
});
|
||||
}
|
||||
|
||||
// 抓取波次(source=1/2)无需领料:将抓取人冗余写入领料人字段,便于追溯
|
||||
if ([ 1, 2 ].includes(source) && claimOperator) {
|
||||
await this.ctx.model.WaveBatch.update(
|
||||
{
|
||||
claim_operator: claimOperator,
|
||||
claim_time: new Date(),
|
||||
},
|
||||
{
|
||||
where: {
|
||||
wave_id: waveId,
|
||||
warehouse_id: warehouseId,
|
||||
},
|
||||
transaction,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
await this.rebuildOrderWaveIndex({
|
||||
warehouseId,
|
||||
waveId,
|
||||
@ -11051,6 +11103,8 @@ class WaveService extends OrderBaseService {
|
||||
const strategyType = Number(strategyRow.strategy_type || plan.strategy_type || 0);
|
||||
const operatorInfo = this.isPlainObject(plan.operator) ? plan.operator : {};
|
||||
const operatorId = Number((operatorInfo.operator_id ?? operatorInfo.id) || 0);
|
||||
const claimOperator = String(operatorInfo.operator_name || operatorInfo.name || '').trim() || null;
|
||||
const claimOperatorId = operatorId > 0 ? operatorId : null;
|
||||
|
||||
await this.ensureNoActiveWavePickTaskForOperator({
|
||||
warehouseId,
|
||||
@ -11114,6 +11168,8 @@ class WaveService extends OrderBaseService {
|
||||
waveType: 1,
|
||||
wavePrefix: wavePrefixResolution.wavePrefix,
|
||||
source: waveBatchSource,
|
||||
claimOperator,
|
||||
claimOperatorId,
|
||||
transaction,
|
||||
});
|
||||
result.selected_wave_ids.push(created.waveId);
|
||||
@ -11181,6 +11237,8 @@ class WaveService extends OrderBaseService {
|
||||
waveType: 2,
|
||||
wavePrefix: wavePrefixResolution.wavePrefix,
|
||||
source: waveBatchSource,
|
||||
claimOperator,
|
||||
claimOperatorId,
|
||||
transaction,
|
||||
});
|
||||
|
||||
@ -11236,6 +11294,11 @@ class WaveService extends OrderBaseService {
|
||||
const warehouseId = this.normalizeRequiredPositiveInteger(plan.warehouse_id, 'warehouse_id');
|
||||
const strategyId = this.normalizeRequiredPositiveInteger(plan.strategy_id, 'strategy_id');
|
||||
const strategyType = Number(strategyRow.strategy_type || plan.strategy_type || 0);
|
||||
const operatorInfo = this.isPlainObject(plan.operator) ? plan.operator : {};
|
||||
const claimOperator = String(operatorInfo.operator_name || operatorInfo.name || '').trim() || null;
|
||||
const claimOperatorId = Number((operatorInfo.operator_id ?? operatorInfo.id) || 0) > 0
|
||||
? Number((operatorInfo.operator_id ?? operatorInfo.id))
|
||||
: null;
|
||||
const transaction = await this.ctx.model.transaction();
|
||||
|
||||
try {
|
||||
@ -11279,6 +11342,8 @@ class WaveService extends OrderBaseService {
|
||||
waveType: 1,
|
||||
wavePrefix: wavePrefixResolution.wavePrefix,
|
||||
source: waveBatchSource,
|
||||
claimOperator,
|
||||
claimOperatorId,
|
||||
transaction,
|
||||
});
|
||||
createdWaveIds.push(created.waveId);
|
||||
@ -11308,6 +11373,8 @@ class WaveService extends OrderBaseService {
|
||||
waveType: 2,
|
||||
wavePrefix: wavePrefixResolution.wavePrefix,
|
||||
source: waveBatchSource,
|
||||
claimOperator,
|
||||
claimOperatorId,
|
||||
transaction,
|
||||
});
|
||||
createdWaveIds.push(createdWave.waveId);
|
||||
@ -11479,20 +11546,34 @@ class WaveService extends OrderBaseService {
|
||||
});
|
||||
}
|
||||
|
||||
// 散单模式:从波次表读取 wave_no 并写入任务 batch_no
|
||||
let resolvedBatchNo = null;
|
||||
if ([ 2, 3, 4 ].includes(pickMode) && selectedWaveIds.length > 0) {
|
||||
const batchRows = await this.ctx.model.query(
|
||||
'SELECT wave_no FROM wms_wave_batch WHERE wave_id = :waveId AND warehouse_id = :warehouseId LIMIT 1',
|
||||
// 查询所有选中波次的 wave_no(用于任务主表 batch_no_array 与任务波次关联记录)
|
||||
const waveNoMap = new Map();
|
||||
if (selectedWaveIds.length > 0) {
|
||||
const waveNoRows = await this.ctx.model.query(
|
||||
`SELECT wave_id, wave_no
|
||||
FROM wms_wave_batch
|
||||
WHERE wave_id IN (:waveIds)
|
||||
AND warehouse_id = :warehouseId`,
|
||||
{
|
||||
replacements: { waveId: selectedWaveIds[0], warehouseId },
|
||||
replacements: { waveIds: selectedWaveIds, warehouseId },
|
||||
type: this.ctx.model.QueryTypes.SELECT,
|
||||
transaction,
|
||||
}
|
||||
);
|
||||
resolvedBatchNo = (batchRows.length > 0 && batchRows[0].wave_no) ? String(batchRows[0].wave_no).trim() : null;
|
||||
for (const row of Array.isArray(waveNoRows) ? waveNoRows : []) {
|
||||
const wid = Number(row && row.wave_id || 0);
|
||||
const wno = String(row && row.wave_no || '').trim();
|
||||
if (wid > 0 && wno) {
|
||||
waveNoMap.set(wid, wno);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 散单模式:取第一个选中波次的 wave_no 写入任务 batch_no
|
||||
const resolvedBatchNo = [ 2, 3, 4 ].includes(pickMode) && selectedWaveIds.length > 0
|
||||
? (waveNoMap.get(selectedWaveIds[0]) || null)
|
||||
: null;
|
||||
|
||||
const taskPayload = this.buildTaskCreatePayload({
|
||||
plan: effectivePlan,
|
||||
data: effectiveRequestData,
|
||||
@ -11503,6 +11584,14 @@ class WaveService extends OrderBaseService {
|
||||
if (resolvedBatchNo !== null) {
|
||||
taskPayload.batch_no = resolvedBatchNo;
|
||||
}
|
||||
// 逗号分隔写入任务主表 batch_no_array,便于统计与查询
|
||||
const batchNoArray = selectedWaveIds
|
||||
.map(waveId => waveNoMap.get(waveId) || '')
|
||||
.filter(Boolean)
|
||||
.join(',');
|
||||
if (batchNoArray) {
|
||||
taskPayload.batch_no_array = batchNoArray;
|
||||
}
|
||||
|
||||
if (selectedWaveIds.length > 0 && [ 1, 2 ].includes(waveBatchSource)) {
|
||||
await this.ctx.model.query(`
|
||||
@ -11525,29 +11614,6 @@ class WaveService extends OrderBaseService {
|
||||
const taskId = Number(taskCreateResult.task_id || 0);
|
||||
const taskNo = String(taskCreateResult.task_no || '').trim();
|
||||
|
||||
// 查询所有选中波次的 wave_no,用于填充任务波次关联记录
|
||||
const waveNoMap = new Map();
|
||||
if (selectedWaveIds.length > 0) {
|
||||
const waveNoRows = await this.ctx.model.query(
|
||||
`SELECT wave_id, wave_no
|
||||
FROM wms_wave_batch
|
||||
WHERE wave_id IN (:waveIds)
|
||||
AND warehouse_id = :warehouseId`,
|
||||
{
|
||||
replacements: { waveIds: selectedWaveIds, warehouseId },
|
||||
type: this.ctx.model.QueryTypes.SELECT,
|
||||
transaction,
|
||||
}
|
||||
);
|
||||
for (const row of Array.isArray(waveNoRows) ? waveNoRows : []) {
|
||||
const wid = Number(row && row.wave_id || 0);
|
||||
const wno = String(row && row.wave_no || '').trim();
|
||||
if (wid > 0 && wno) {
|
||||
waveNoMap.set(wid, wno);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const taskWaveRows = this.buildTaskWaveRows({
|
||||
taskId,
|
||||
plan: effectivePlan,
|
||||
@ -11733,8 +11799,9 @@ class WaveService extends OrderBaseService {
|
||||
source: sourceCode,
|
||||
wave_count: selectedWaveIds.length,
|
||||
order_count: selectedOrderIds.length,
|
||||
box_count: 0,
|
||||
box_count: pickMode === 5 ? 1 : 0,
|
||||
batch_no: null,
|
||||
batch_no_array: null,
|
||||
pick_user_id: pickUserId,
|
||||
pick_user_name: pickUserName,
|
||||
current_cart_id: Number(options && options.cartId || 0) > 0 ? Number(options.cartId) : null,
|
||||
@ -12280,6 +12347,7 @@ class WaveService extends OrderBaseService {
|
||||
const insertPayload = {
|
||||
...payload,
|
||||
task_no: candidateTaskNo,
|
||||
batch_no_array: String(payload.batch_no_array || '').trim() || null,
|
||||
};
|
||||
|
||||
try {
|
||||
@ -12296,6 +12364,7 @@ class WaveService extends OrderBaseService {
|
||||
order_count,
|
||||
box_count,
|
||||
batch_no,
|
||||
batch_no_array,
|
||||
pick_user_id,
|
||||
pick_user_name,
|
||||
current_cart_id,
|
||||
@ -12319,6 +12388,7 @@ class WaveService extends OrderBaseService {
|
||||
:order_count,
|
||||
:box_count,
|
||||
:batch_no,
|
||||
:batch_no_array,
|
||||
:pick_user_id,
|
||||
:pick_user_name,
|
||||
:current_cart_id,
|
||||
|
||||
@ -137,7 +137,7 @@ class PickService extends MainService {
|
||||
[this.app.Sequelize.Op.in]: normalizedOrderIds,
|
||||
},
|
||||
},
|
||||
attributes: [ 'id', 'intercept_status', 'claim_status' ],
|
||||
attributes: [ 'id', 'intercept_status', 'claim_status', 'claim_operator_id', 'claim_operator' ],
|
||||
raw: true,
|
||||
});
|
||||
|
||||
@ -155,11 +155,14 @@ class PickService extends MainService {
|
||||
}
|
||||
}
|
||||
|
||||
// 领料语义(普通波次 source=0):未领料订单(claim_status != fin)不参与拣货数量计算,直接剔除
|
||||
// 领料语义(普通波次 source=0):未领料或领料人非本人的订单不参与拣货数量计算,直接剔除
|
||||
const unclaimedOrderIds = excludeUnclaimed
|
||||
? new Set(normalizedOrderIds.filter(id => {
|
||||
const row = orderRowMap.get(id);
|
||||
return !row || String(row && row.claim_status || '') !== 'fin';
|
||||
if (!row || String(row && row.claim_status || '') !== 'fin') {
|
||||
return true;
|
||||
}
|
||||
return Number(row && row.claim_operator_id || 0) !== operatorId;
|
||||
}))
|
||||
: new Set();
|
||||
if (unclaimedOrderIds.size > 0) {
|
||||
@ -178,6 +181,11 @@ class PickService extends MainService {
|
||||
throw Object.assign(new Error(emptyReason), { code: 400 });
|
||||
}
|
||||
|
||||
// 取首个活跃订单的领料人冗余写入任务主表(整波领单同波次领料人一致)
|
||||
const firstActiveOrderRow = orderRowMap.get(activeOrderIds[0]) || null;
|
||||
const claimOperatorId = Number(firstActiveOrderRow && firstActiveOrderRow.claim_operator_id || 0);
|
||||
const claimOperator = String(firstActiveOrderRow && firstActiveOrderRow.claim_operator || '').trim();
|
||||
|
||||
const orderNoMap = new Map((Array.isArray(orderRows) ? orderRows : [])
|
||||
.map(row => [ Number(row && row.id || 0), '' ]));
|
||||
|
||||
@ -190,6 +198,10 @@ class PickService extends MainService {
|
||||
task_no,
|
||||
warehouse_id,
|
||||
wave_id,
|
||||
claim_operator_id,
|
||||
claim_operator,
|
||||
batch_no,
|
||||
batch_no_array,
|
||||
pick_mode,
|
||||
status,
|
||||
source,
|
||||
@ -205,6 +217,10 @@ class PickService extends MainService {
|
||||
:taskNo,
|
||||
:warehouseId,
|
||||
:waveId,
|
||||
:claimOperatorId,
|
||||
:claimOperator,
|
||||
:batchNo,
|
||||
:batchNoArray,
|
||||
:pickMode,
|
||||
0,
|
||||
:source,
|
||||
@ -223,6 +239,10 @@ class PickService extends MainService {
|
||||
taskNo,
|
||||
warehouseId,
|
||||
waveId,
|
||||
claimOperatorId: claimOperatorId > 0 ? claimOperatorId : null,
|
||||
claimOperator: claimOperator || null,
|
||||
batchNo: waveNo,
|
||||
batchNoArray: waveNo,
|
||||
pickMode,
|
||||
source,
|
||||
orderCount: activeOrderIds.length,
|
||||
@ -375,14 +395,14 @@ class PickService extends MainService {
|
||||
}
|
||||
);
|
||||
|
||||
// 更新任务主表的 box_count
|
||||
// 更新任务主表的 box_count(大团购固定 1,其余按实际筐数)
|
||||
await ctx.model.query(
|
||||
`UPDATE wms_wave_pick_task
|
||||
SET box_count = :boxCount,
|
||||
update_time = NOW()
|
||||
WHERE id = :taskId`,
|
||||
{
|
||||
replacements: { taskId, boxCount: boxValuesSql.length },
|
||||
replacements: { taskId, boxCount: pickMode === 5 ? 1 : boxValuesSql.length },
|
||||
transaction,
|
||||
}
|
||||
);
|
||||
@ -454,7 +474,7 @@ class PickService extends MainService {
|
||||
|
||||
await transaction.commit();
|
||||
|
||||
// 写入 order_operation_log 抓取波次日志
|
||||
// 写入 order_operation_log 开始拣货日志
|
||||
try {
|
||||
const operationLogService = this.ctx
|
||||
&& this.ctx.service
|
||||
@ -464,13 +484,13 @@ class PickService extends MainService {
|
||||
const logPayloads = activeOrderIds.map(orderId => ({
|
||||
businessType: 'order',
|
||||
businessId: `${orderId}`,
|
||||
operationCode: 'ORDER_WAVE_GRAB',
|
||||
operationCode: 'ORDER_PICKING',
|
||||
operator: {
|
||||
id: operatorId ? String(operatorId) : null,
|
||||
name: operatorName || 'system',
|
||||
},
|
||||
extras: {
|
||||
message: `订单${orderId}抓取波次成功`,
|
||||
message: `订单${orderId}开始拣货(波次 ${waveNo})`,
|
||||
warehouseId,
|
||||
externalLogType: 'API',
|
||||
},
|
||||
@ -830,9 +850,10 @@ class PickService extends MainService {
|
||||
warehouseId: normalizedWarehouseId,
|
||||
waveId: targetWaveId,
|
||||
waveNo: targetWaveNo,
|
||||
claimOperatorId: operatorId,
|
||||
});
|
||||
if (claimGateStats.total_order_count > 0 && claimGateStats.unclaimed_order_count > 0) {
|
||||
return this.fail('订单未领料,请先领料后再拣货', {
|
||||
return this.fail('订单未领料或领料人不是本人,请先领料后再拣货', {
|
||||
action: 'wave_claim',
|
||||
wave_id: targetWaveId,
|
||||
wave_no: targetWaveNo,
|
||||
@ -1011,7 +1032,7 @@ class PickService extends MainService {
|
||||
} catch (e) {
|
||||
// 查询失败不影响主流程,退回默认拣货模式
|
||||
}
|
||||
const pickMode = isGroupWave ? 1 : (isManualIdsWave ? 3 : 2);
|
||||
const pickMode = isGroupWave ? 5 : (isManualIdsWave ? 3 : 2);
|
||||
|
||||
if (selectedOrderIds.length === 0) {
|
||||
let orderModel = null;
|
||||
@ -1442,7 +1463,7 @@ class PickService extends MainService {
|
||||
} catch (e) {
|
||||
// 查询失败不影响主流程,退回默认拣货模式
|
||||
}
|
||||
const pickMode = isGroupWave ? 1 : (isManualIdsWaveWP ? 3 : 2);
|
||||
const pickMode = isGroupWave ? 5 : (isManualIdsWaveWP ? 3 : 2);
|
||||
|
||||
try {
|
||||
const createdTask = await this.createWavePickTask({
|
||||
@ -1608,14 +1629,16 @@ class PickService extends MainService {
|
||||
* 统计口径:
|
||||
* - total_order_count:波次下全部订单数(含拦截订单);
|
||||
* - intercepted_order_count:拦截订单数(intercept_status != none);
|
||||
* - unclaimed_order_count:非拦截且未领料(claim_status != fin)订单数,
|
||||
* 拦截订单未领料不阻隔拣货,不计入该数量。
|
||||
* - unclaimed_order_count:非拦截且需要领料的订单数,包括未领料
|
||||
* (claim_status != fin)与已领料但领料人非本人(claim_operator_id != 操作人)两种;
|
||||
* 拦截订单不阻隔拣货,不计入该数量。
|
||||
*
|
||||
* @param {Object} params 统计参数。
|
||||
* @param {Object} params.orderModel 订单分表模型。
|
||||
* @param {number} params.warehouseId 仓库ID。
|
||||
* @param {number} params.waveId 波次ID。
|
||||
* @param {string} [params.waveNo=''] 波次编码(wave_id 未命中时回退按 wave_no 统计)。
|
||||
* @param {number} [params.claimOperatorId=0] 当前操作人工号(判断领料人是否本人)。
|
||||
* @return {Promise<{total_order_count: number, intercepted_order_count: number, unclaimed_order_count: number}>}
|
||||
* 统计结果。
|
||||
*/
|
||||
@ -1625,6 +1648,7 @@ class PickService extends MainService {
|
||||
const warehouseId = Number(params && params.warehouseId || 0);
|
||||
const waveId = Number(params && params.waveId || 0);
|
||||
const waveNo = String(params && params.waveNo || '').trim();
|
||||
const claimOperatorId = Number(params && params.claimOperatorId || 0);
|
||||
if (!orderModel || typeof orderModel.findAll !== 'function') {
|
||||
ctx.logger.warn('[pick.getWaveClaimGateStats] 订单模型不可用,返回空统计');
|
||||
return { total_order_count: 0, intercepted_order_count: 0, unclaimed_order_count: 0 };
|
||||
@ -1637,7 +1661,7 @@ class PickService extends MainService {
|
||||
warehouse_id: warehouseId,
|
||||
wave_id: waveId,
|
||||
},
|
||||
attributes: [ 'id', 'claim_status', 'intercept_status' ],
|
||||
attributes: [ 'id', 'claim_status', 'intercept_status', 'claim_operator_id' ],
|
||||
raw: true,
|
||||
});
|
||||
rows = Array.isArray(rows) ? rows : [];
|
||||
@ -1648,7 +1672,7 @@ class PickService extends MainService {
|
||||
warehouse_id: warehouseId,
|
||||
wave_no: waveNo,
|
||||
},
|
||||
attributes: [ 'id', 'claim_status', 'intercept_status' ],
|
||||
attributes: [ 'id', 'claim_status', 'intercept_status', 'claim_operator_id' ],
|
||||
raw: true,
|
||||
});
|
||||
rows = Array.isArray(fallbackRows) ? fallbackRows : [];
|
||||
@ -1662,9 +1686,17 @@ class PickService extends MainService {
|
||||
.map(item => Number(item && item.id || 0))
|
||||
.filter(id => Number.isInteger(id) && id > 0));
|
||||
const unclaimedOrderCount = rows
|
||||
.filter(item => String(item && item.claim_status || '') !== 'fin'
|
||||
&& orderIds.includes(Number(item && item.id || 0))
|
||||
&& !interceptedOrderIds.has(Number(item && item.id || 0)))
|
||||
.filter(item => {
|
||||
const orderIdItem = Number(item && item.id || 0);
|
||||
if (!orderIds.includes(orderIdItem) || interceptedOrderIds.has(orderIdItem)) {
|
||||
return false;
|
||||
}
|
||||
if (String(item && item.claim_status || '') !== 'fin') {
|
||||
return true;
|
||||
}
|
||||
// 已领料但领料人不是本人:仍视为需要领料
|
||||
return claimOperatorId > 0 && Number(item && item.claim_operator_id || 0) !== claimOperatorId;
|
||||
})
|
||||
.length;
|
||||
|
||||
return {
|
||||
@ -1841,7 +1873,7 @@ class PickService extends MainService {
|
||||
warehouse_id: normalizedWarehouseId,
|
||||
wave_id: targetWaveId,
|
||||
},
|
||||
attributes: [ 'id', 'claim_status', 'print_status', 'intercept_status' ],
|
||||
attributes: [ 'id', 'claim_status', 'print_status', 'intercept_status', 'claim_operator_id' ],
|
||||
raw: true,
|
||||
});
|
||||
let waveOrders = Array.isArray(waveOrderRows) ? waveOrderRows : [];
|
||||
@ -1851,7 +1883,7 @@ class PickService extends MainService {
|
||||
warehouse_id: normalizedWarehouseId,
|
||||
wave_no: targetWaveNo,
|
||||
},
|
||||
attributes: [ 'id', 'claim_status', 'print_status', 'intercept_status' ],
|
||||
attributes: [ 'id', 'claim_status', 'print_status', 'intercept_status', 'claim_operator_id' ],
|
||||
raw: true,
|
||||
});
|
||||
waveOrders = Array.isArray(fallbackRows) ? fallbackRows : [];
|
||||
@ -1871,7 +1903,23 @@ class PickService extends MainService {
|
||||
.filter(id => Number.isInteger(id) && id > 0));
|
||||
|
||||
const unclaimedOrderIds = [ ...new Set(waveOrders
|
||||
.filter(item => String(item && item.claim_status || '') !== 'fin'
|
||||
.filter(item => {
|
||||
const orderIdItem = Number(item && item.id || 0);
|
||||
if (interceptedWaveOrderIds.has(orderIdItem)) {
|
||||
return false;
|
||||
}
|
||||
if (String(item && item.claim_status || '') !== 'fin') {
|
||||
return true;
|
||||
}
|
||||
// 已领料但领料人不是本人:重新领料并覆盖领料人
|
||||
return Number(item && item.claim_operator_id || 0) !== operatorId;
|
||||
})
|
||||
.map(item => Number(item && item.id || 0))
|
||||
.filter(id => Number.isInteger(id) && id > 0)) ];
|
||||
|
||||
const ownClaimedOrderIds = [ ...new Set(waveOrders
|
||||
.filter(item => String(item && item.claim_status || '') === 'fin'
|
||||
&& Number(item && item.claim_operator_id || 0) === operatorId
|
||||
&& !interceptedWaveOrderIds.has(Number(item && item.id || 0)))
|
||||
.map(item => Number(item && item.id || 0))
|
||||
.filter(id => Number.isInteger(id) && id > 0)) ];
|
||||
@ -1892,9 +1940,9 @@ class PickService extends MainService {
|
||||
return this.success('ok', {
|
||||
data: {
|
||||
...baseResponse,
|
||||
claimed_order_count: 0,
|
||||
claimed_order_count: ownClaimedOrderIds.length,
|
||||
status: 'already_claimed',
|
||||
tip: '该波次已领料,无需重复领取',
|
||||
tip: '该波次订单已领料(本人),无需重复领取',
|
||||
},
|
||||
code: 200,
|
||||
});
|
||||
@ -1921,12 +1969,15 @@ class PickService extends MainService {
|
||||
const transaction = await ctx.model.transaction();
|
||||
try {
|
||||
await orderModel.update(
|
||||
{ claim_status: 'fin' },
|
||||
{
|
||||
claim_status: 'fin',
|
||||
claim_operator_id: operatorId > 0 ? operatorId : null,
|
||||
claim_operator: operatorName,
|
||||
},
|
||||
{
|
||||
where: {
|
||||
id: { [Op.in]: unclaimedOrderIds },
|
||||
warehouse_id: normalizedWarehouseId,
|
||||
claim_status: { [Op.ne]: 'fin' },
|
||||
},
|
||||
transaction,
|
||||
}
|
||||
@ -1946,24 +1997,40 @@ class PickService extends MainService {
|
||||
.map(item => Number(item && item.id || 0))
|
||||
.filter(id => Number.isInteger(id) && id > 0)) ];
|
||||
|
||||
if (claimedOrderIds.length > 0
|
||||
&& operationLogService
|
||||
&& typeof operationLogService.createOperationLogs === 'function') {
|
||||
await operationLogService.createOperationLogs(claimedOrderIds.map(orderId => ({
|
||||
businessType: 'order',
|
||||
businessId: `${orderId}`,
|
||||
operationCode: 'ORDER_WAVE_CLAIM',
|
||||
operator: {
|
||||
id: operatorId ? String(operatorId) : null,
|
||||
name: operatorName || 'system',
|
||||
if (claimedOrderIds.length > 0) {
|
||||
// 回写波次表领料人、领料时间
|
||||
await ctx.model.WaveBatch.update(
|
||||
{
|
||||
claim_operator: operatorName,
|
||||
claim_time: new Date(),
|
||||
},
|
||||
operationAction: 'UPDATE',
|
||||
extras: {
|
||||
message: `整波领单完成(波次 ${targetWaveNo})`,
|
||||
warehouseId: normalizedWarehouseId,
|
||||
externalLogType: 'API',
|
||||
},
|
||||
})), { transaction });
|
||||
{
|
||||
where: {
|
||||
wave_id: targetWaveId,
|
||||
warehouse_id: normalizedWarehouseId,
|
||||
},
|
||||
transaction,
|
||||
}
|
||||
);
|
||||
|
||||
if (operationLogService
|
||||
&& typeof operationLogService.createOperationLogs === 'function') {
|
||||
await operationLogService.createOperationLogs(claimedOrderIds.map(orderId => ({
|
||||
businessType: 'order',
|
||||
businessId: `${orderId}`,
|
||||
operationCode: 'ORDER_WAVE_CLAIM',
|
||||
operator: {
|
||||
id: operatorId ? String(operatorId) : null,
|
||||
name: operatorName || 'system',
|
||||
},
|
||||
operationAction: 'UPDATE',
|
||||
extras: {
|
||||
message: `整波领单完成(波次 ${targetWaveNo})`,
|
||||
warehouseId: normalizedWarehouseId,
|
||||
externalLogType: 'API',
|
||||
},
|
||||
})), { transaction });
|
||||
}
|
||||
}
|
||||
|
||||
await transaction.commit();
|
||||
|
||||
@ -1387,8 +1387,8 @@ class PickSystemService extends Service {
|
||||
picking_view: pickingView,
|
||||
};
|
||||
|
||||
// 团购小波次不需要返回拣货明细,减少带宽浪费
|
||||
if (pickMode !== 1) {
|
||||
// 团购模式(小波次 pick_mode=1 / 大波次 pick_mode=5)不需要返回拣货明细,减少带宽浪费
|
||||
if (pickMode !== 1 && pickMode !== 5) {
|
||||
result.picking_details = pickingDetails;
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,62 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* 为拣货任务表 wms_wave_pick_task 增加 batch_no_array 字段。
|
||||
*
|
||||
* 背景:
|
||||
* 一个拣货任务可能涉及多个波次,此前任务主表未冗余波次号,
|
||||
* 统计/查询需要关联 wms_wave_pick_task_wave,不便。
|
||||
*
|
||||
* 变更:
|
||||
* 1. wms_wave_pick_task 新增 batch_no_array:TEXT,可空,
|
||||
* 存储逗号分隔的波次号列表,如 'WAVE202401001,WAVE202401002',
|
||||
* 便于 FIND_IN_SET / LIKE 等统计与查询。
|
||||
*/
|
||||
|
||||
/**
|
||||
* 获取表字段定义。
|
||||
*
|
||||
* @param {import('sequelize').QueryInterface} queryInterface 查询接口。
|
||||
* @param {string} tableName 表名。
|
||||
* @return {Promise<Object>} 字段定义对象。
|
||||
*/
|
||||
const getTableColumns = async (queryInterface, tableName) => {
|
||||
return queryInterface.describeTable(tableName);
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* 正向迁移:为拣货任务表补充 batch_no_array 字段。
|
||||
*
|
||||
* @param {import('sequelize').QueryInterface} queryInterface 查询接口。
|
||||
* @param {typeof import('sequelize')} Sequelize Sequelize 类型集合。
|
||||
* @return {Promise<void>} 无返回值。
|
||||
*/
|
||||
up: async (queryInterface, Sequelize) => {
|
||||
const tableName = 'wms_wave_pick_task';
|
||||
const columnsBefore = await getTableColumns(queryInterface, tableName);
|
||||
|
||||
if (!columnsBefore.batch_no_array) {
|
||||
await queryInterface.addColumn(tableName, 'batch_no_array', {
|
||||
type: Sequelize.TEXT,
|
||||
allowNull: true,
|
||||
comment: '波次号列表(逗号分隔),方便统计和查询',
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 回滚迁移:若 batch_no_array 字段存在则删除。
|
||||
*
|
||||
* @param {import('sequelize').QueryInterface} queryInterface 查询接口。
|
||||
* @return {Promise<void>} 无返回值。
|
||||
*/
|
||||
down: async queryInterface => {
|
||||
const tableName = 'wms_wave_pick_task';
|
||||
const columnsBefore = await getTableColumns(queryInterface, tableName);
|
||||
|
||||
if (columnsBefore.batch_no_array) {
|
||||
await queryInterface.removeColumn(tableName, 'batch_no_array');
|
||||
}
|
||||
},
|
||||
};
|
||||
@ -0,0 +1,74 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* 为波次表 wms_wave_batch 增加领料人字段。
|
||||
*
|
||||
* 背景:
|
||||
* 整波领单(pick.waveClaimScan)是波次级操作,此前仅写入订单操作日志
|
||||
* (ORDER_WAVE_CLAIM),波次表无领料人记录,不便于核对领料人与领料时间。
|
||||
*
|
||||
* 变更:
|
||||
* 1. wms_wave_batch 新增 claim_operator:VARCHAR(50),可空,领料人姓名。
|
||||
* 2. wms_wave_batch 新增 claim_time:DATETIME,可空,领料时间。
|
||||
* 3. 模型定义同步更新(app/model/wave_batch.js)。
|
||||
*/
|
||||
|
||||
const TABLE_NAME = 'wms_wave_batch';
|
||||
|
||||
/**
|
||||
* 获取表字段定义。
|
||||
*
|
||||
* @param {import('sequelize').QueryInterface} queryInterface 查询接口。
|
||||
* @param {string} tableName 表名。
|
||||
* @return {Promise<Object>} 字段定义对象。
|
||||
*/
|
||||
const getTableColumns = async (queryInterface, tableName) => {
|
||||
return queryInterface.describeTable(tableName);
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* 正向迁移:为波次表补充领料人、领料时间字段。
|
||||
*
|
||||
* @param {import('sequelize').QueryInterface} queryInterface 查询接口。
|
||||
* @param {typeof import('sequelize')} Sequelize Sequelize 类型集合。
|
||||
* @return {Promise<void>} 无返回值。
|
||||
*/
|
||||
up: async (queryInterface, Sequelize) => {
|
||||
const columnsBefore = await getTableColumns(queryInterface, TABLE_NAME);
|
||||
|
||||
if (!columnsBefore.claim_operator) {
|
||||
await queryInterface.addColumn(TABLE_NAME, 'claim_operator', {
|
||||
type: Sequelize.STRING(50),
|
||||
allowNull: true,
|
||||
comment: '领料人',
|
||||
});
|
||||
}
|
||||
|
||||
if (!columnsBefore.claim_time) {
|
||||
await queryInterface.addColumn(TABLE_NAME, 'claim_time', {
|
||||
type: Sequelize.DATE,
|
||||
allowNull: true,
|
||||
comment: '领料时间',
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 回滚迁移:若领料字段存在则删除。
|
||||
*
|
||||
* @param {import('sequelize').QueryInterface} queryInterface 查询接口。
|
||||
* @return {Promise<void>} 无返回值。
|
||||
*/
|
||||
down: async queryInterface => {
|
||||
const columnsBefore = await getTableColumns(queryInterface, TABLE_NAME);
|
||||
|
||||
if (columnsBefore.claim_time) {
|
||||
await queryInterface.removeColumn(TABLE_NAME, 'claim_time');
|
||||
}
|
||||
|
||||
if (columnsBefore.claim_operator) {
|
||||
await queryInterface.removeColumn(TABLE_NAME, 'claim_operator');
|
||||
}
|
||||
},
|
||||
};
|
||||
@ -0,0 +1,73 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* 为拣货任务表 wms_wave_pick_task 增加领料人字段。
|
||||
*
|
||||
* 背景:
|
||||
* 整波领单(pick.waveClaimScan)会回写订单表 claim_operator_id/claim_operator;
|
||||
* 拣货任务创建时需从订单冗余领料人,便于任务列表追溯领料人。
|
||||
*
|
||||
* 变更:
|
||||
* 1. wms_wave_pick_task 新增 claim_operator_id:BIGINT,可空,领料人工号ID。
|
||||
* 2. wms_wave_pick_task 新增 claim_operator:VARCHAR(50),可空,领料人姓名。
|
||||
*/
|
||||
|
||||
const TABLE_NAME = 'wms_wave_pick_task';
|
||||
|
||||
/**
|
||||
* 获取表字段定义。
|
||||
*
|
||||
* @param {import('sequelize').QueryInterface} queryInterface 查询接口。
|
||||
* @param {string} tableName 表名。
|
||||
* @return {Promise<Object>} 字段定义对象。
|
||||
*/
|
||||
const getTableColumns = async (queryInterface, tableName) => {
|
||||
return queryInterface.describeTable(tableName);
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* 正向迁移:为拣货任务表补充领料人工号与姓名字段。
|
||||
*
|
||||
* @param {import('sequelize').QueryInterface} queryInterface 查询接口。
|
||||
* @param {typeof import('sequelize')} Sequelize Sequelize 类型集合。
|
||||
* @return {Promise<void>} 无返回值。
|
||||
*/
|
||||
up: async (queryInterface, Sequelize) => {
|
||||
const columnsBefore = await getTableColumns(queryInterface, TABLE_NAME);
|
||||
|
||||
if (!columnsBefore.claim_operator_id) {
|
||||
await queryInterface.addColumn(TABLE_NAME, 'claim_operator_id', {
|
||||
type: Sequelize.BIGINT,
|
||||
allowNull: true,
|
||||
comment: '领料人工号ID',
|
||||
});
|
||||
}
|
||||
|
||||
if (!columnsBefore.claim_operator) {
|
||||
await queryInterface.addColumn(TABLE_NAME, 'claim_operator', {
|
||||
type: Sequelize.STRING(50),
|
||||
allowNull: true,
|
||||
comment: '领料人',
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 回滚迁移:若领料字段存在则删除。
|
||||
*
|
||||
* @param {import('sequelize').QueryInterface} queryInterface 查询接口。
|
||||
* @return {Promise<void>} 无返回值。
|
||||
*/
|
||||
down: async queryInterface => {
|
||||
const columnsBefore = await getTableColumns(queryInterface, TABLE_NAME);
|
||||
|
||||
if (columnsBefore.claim_operator) {
|
||||
await queryInterface.removeColumn(TABLE_NAME, 'claim_operator');
|
||||
}
|
||||
|
||||
if (columnsBefore.claim_operator_id) {
|
||||
await queryInterface.removeColumn(TABLE_NAME, 'claim_operator_id');
|
||||
}
|
||||
},
|
||||
};
|
||||
78
script/fix-order-claim-operator-column.cjs
Normal file
78
script/fix-order-claim-operator-column.cjs
Normal file
@ -0,0 +1,78 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* 幂等补齐订单分表的 claim_operator_id / claim_operator 列。
|
||||
*
|
||||
* 背景:这两列由订单模型(app/model/order_delivery.js)定义,分表工厂
|
||||
* (order_delivery_factory.js)在首次访问某张分表时自动同步;history /
|
||||
* outsourced 等长期不被访问的表可能滞后,可用本脚本提前补齐。
|
||||
*
|
||||
* 用法:
|
||||
* 开发:node script/fix-order-claim-operator-column.cjs
|
||||
* 生产:PowerShell 中 $env:NODE_ENV='production'; node script/fix-order-claim-operator-column.cjs
|
||||
*
|
||||
* 安全:只 ADD 缺失列(与模型定义一致),不触碰 id / AUTO_INCREMENT,
|
||||
* 不修改已有列,可重复执行。
|
||||
*/
|
||||
(async () => {
|
||||
try {
|
||||
const configs = require('../database/config.js');
|
||||
const env = process.env.NODE_ENV || 'development';
|
||||
const cfg = configs[env];
|
||||
if (!cfg) {
|
||||
console.error('NO_CONFIG_FOR_ENV');
|
||||
process.exit(2);
|
||||
}
|
||||
|
||||
const mysql = require('mysql2/promise');
|
||||
const conn = await mysql.createConnection({
|
||||
host: cfg.host,
|
||||
port: cfg.port || 3306,
|
||||
user: cfg.username,
|
||||
password: cfg.password,
|
||||
database: cfg.database,
|
||||
});
|
||||
|
||||
const [ tables ] = await conn.query(
|
||||
`SELECT TABLE_NAME FROM information_schema.TABLES
|
||||
WHERE TABLE_SCHEMA = ? AND TABLE_NAME LIKE 'wms_order_delivery\\_%'
|
||||
ORDER BY TABLE_NAME`,
|
||||
[ cfg.database ]
|
||||
);
|
||||
|
||||
console.log(`环境: ${env}, 库: ${cfg.host}:${cfg.port}/${cfg.database}`);
|
||||
console.log(`订单分表数量: ${tables.length}\n`);
|
||||
|
||||
const targetColumns = [
|
||||
{ name: 'claim_operator_id', sql: "ADD COLUMN claim_operator_id BIGINT(20) NULL COMMENT '领料人工号ID'" },
|
||||
{ name: 'claim_operator', sql: "ADD COLUMN claim_operator VARCHAR(50) NULL COMMENT '领料人'" },
|
||||
];
|
||||
let added = 0;
|
||||
let ok = 0;
|
||||
|
||||
for (const row of tables) {
|
||||
const tableName = row.TABLE_NAME || row.table_name;
|
||||
for (const column of targetColumns) {
|
||||
const [ columns ] = await conn.query(
|
||||
`SELECT COLUMN_NAME FROM information_schema.COLUMNS
|
||||
WHERE TABLE_SCHEMA = ? AND TABLE_NAME = ? AND COLUMN_NAME = ?`,
|
||||
[ cfg.database, tableName, column.name ]
|
||||
);
|
||||
if (columns.length === 0) {
|
||||
await conn.query(`ALTER TABLE \`${tableName}\` ${column.sql}`);
|
||||
console.log(`[ADD] ${tableName}.${column.name}`);
|
||||
added += 1;
|
||||
} else {
|
||||
ok += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`\n完成: 已存在 ${ok} 列, 新增 ${added} 列`);
|
||||
await conn.end();
|
||||
process.exit(0);
|
||||
} catch (err) {
|
||||
console.error('ERROR', err.message);
|
||||
process.exit(3);
|
||||
}
|
||||
})();
|
||||
78
script/fix-order-grab-operator-column.cjs
Normal file
78
script/fix-order-grab-operator-column.cjs
Normal file
@ -0,0 +1,78 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* 幂等补齐订单分表的 grab_operator_id / grab_operator 列。
|
||||
*
|
||||
* 背景:这两列由订单模型(app/model/order_delivery.js)定义,分表工厂
|
||||
* (order_delivery_factory.js)在首次访问某张分表时自动同步;history /
|
||||
* outsourced 等长期不被访问的表可能滞后,可用本脚本提前补齐。
|
||||
*
|
||||
* 用法:
|
||||
* 开发:node script/fix-order-grab-operator-column.cjs
|
||||
* 生产:PowerShell 中 $env:NODE_ENV='production'; node script/fix-order-grab-operator-column.cjs
|
||||
*
|
||||
* 安全:只 ADD 缺失列(与模型定义一致),不触碰 id / AUTO_INCREMENT,
|
||||
* 不修改已有列,可重复执行。
|
||||
*/
|
||||
(async () => {
|
||||
try {
|
||||
const configs = require('../database/config.js');
|
||||
const env = process.env.NODE_ENV || 'development';
|
||||
const cfg = configs[env];
|
||||
if (!cfg) {
|
||||
console.error('NO_CONFIG_FOR_ENV');
|
||||
process.exit(2);
|
||||
}
|
||||
|
||||
const mysql = require('mysql2/promise');
|
||||
const conn = await mysql.createConnection({
|
||||
host: cfg.host,
|
||||
port: cfg.port || 3306,
|
||||
user: cfg.username,
|
||||
password: cfg.password,
|
||||
database: cfg.database,
|
||||
});
|
||||
|
||||
const [ tables ] = await conn.query(
|
||||
`SELECT TABLE_NAME FROM information_schema.TABLES
|
||||
WHERE TABLE_SCHEMA = ? AND TABLE_NAME LIKE 'wms_order_delivery\\_%'
|
||||
ORDER BY TABLE_NAME`,
|
||||
[ cfg.database ]
|
||||
);
|
||||
|
||||
console.log(`环境: ${env}, 库: ${cfg.host}:${cfg.port}/${cfg.database}`);
|
||||
console.log(`订单分表数量: ${tables.length}\n`);
|
||||
|
||||
const targetColumns = [
|
||||
{ name: 'grab_operator_id', sql: "ADD COLUMN grab_operator_id BIGINT(20) NULL COMMENT '抓取人工号ID'" },
|
||||
{ name: 'grab_operator', sql: "ADD COLUMN grab_operator VARCHAR(50) NULL COMMENT '抓取人'" },
|
||||
];
|
||||
let added = 0;
|
||||
let ok = 0;
|
||||
|
||||
for (const row of tables) {
|
||||
const tableName = row.TABLE_NAME || row.table_name;
|
||||
for (const column of targetColumns) {
|
||||
const [ columns ] = await conn.query(
|
||||
`SELECT COLUMN_NAME FROM information_schema.COLUMNS
|
||||
WHERE TABLE_SCHEMA = ? AND TABLE_NAME = ? AND COLUMN_NAME = ?`,
|
||||
[ cfg.database, tableName, column.name ]
|
||||
);
|
||||
if (columns.length === 0) {
|
||||
await conn.query(`ALTER TABLE \`${tableName}\` ${column.sql}`);
|
||||
console.log(`[ADD] ${tableName}.${column.name}`);
|
||||
added += 1;
|
||||
} else {
|
||||
ok += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`\n完成: 已存在 ${ok} 列, 新增 ${added} 列`);
|
||||
await conn.end();
|
||||
process.exit(0);
|
||||
} catch (err) {
|
||||
console.error('ERROR', err.message);
|
||||
process.exit(3);
|
||||
}
|
||||
})();
|
||||
64
script/tmp-check-pick-mode-backfill-scope.cjs
Normal file
64
script/tmp-check-pick-mode-backfill-scope.cjs
Normal file
@ -0,0 +1,64 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* 临时脚本:影响范围确认(只读)——
|
||||
* wms_wave_pick_task WHERE pick_mode = 1 AND source = 2 的回填范围。
|
||||
*/
|
||||
|
||||
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 total = await q(
|
||||
"SELECT COUNT(*) AS c FROM wms_wave_pick_task WHERE pick_mode = 1 AND source = 2"
|
||||
);
|
||||
console.log('A. 目标行数 (pick_mode=1 AND source=2):', JSON.stringify(total));
|
||||
|
||||
const byStatus = await q(
|
||||
'SELECT status, COUNT(*) AS cnt FROM wms_wave_pick_task WHERE pick_mode = 1 AND source = 2 GROUP BY status ORDER BY status'
|
||||
);
|
||||
console.log('B. 按任务状态分布:', JSON.stringify(byStatus));
|
||||
|
||||
const byWaveCount = await q(
|
||||
'SELECT wave_count, COUNT(*) AS cnt FROM wms_wave_pick_task WHERE pick_mode = 1 AND source = 2 GROUP BY wave_count ORDER BY wave_count'
|
||||
);
|
||||
console.log('C. 按 wave_count 分布(确认单波次):', JSON.stringify(byWaveCount));
|
||||
|
||||
const byTaskNoPrefix = await q(
|
||||
"SELECT LEFT(task_no, 2) AS prefix, COUNT(*) AS cnt FROM wms_wave_pick_task "
|
||||
+ "WHERE pick_mode = 1 AND source = 2 GROUP BY prefix"
|
||||
);
|
||||
console.log('D. task_no 前缀分布(PK=拣货创建):', JSON.stringify(byTaskNoPrefix));
|
||||
|
||||
const waveRel = await q(
|
||||
'SELECT COUNT(*) AS c FROM wms_wave_pick_task t '
|
||||
+ 'INNER JOIN wms_wave_pick_task_wave tw ON tw.task_id = t.id '
|
||||
+ 'WHERE t.pick_mode = 1 AND t.source = 2'
|
||||
);
|
||||
console.log('E. 目标任务中已有波次关联记录的任务数:', JSON.stringify(waveRel));
|
||||
|
||||
const noWaveRel = await q(
|
||||
'SELECT COUNT(*) AS c FROM wms_wave_pick_task t '
|
||||
+ 'LEFT JOIN wms_wave_pick_task_wave tw ON tw.task_id = t.id '
|
||||
+ 'WHERE t.pick_mode = 1 AND t.source = 2 AND tw.task_id IS NULL'
|
||||
);
|
||||
console.log('F. 目标任务中无波次关联记录的任务数:', JSON.stringify(noWaveRel));
|
||||
|
||||
await s.close();
|
||||
})().catch(e => {
|
||||
console.error('ERROR:', e.message);
|
||||
process.exit(1);
|
||||
});
|
||||
75
script/tmp-check-wave-pick-task-mode.cjs
Normal file
75
script/tmp-check-wave-pick-task-mode.cjs
Normal file
@ -0,0 +1,75 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* 临时核验脚本:核实生产库 wms_wave_pick_task 的 pick_mode / source / wave_count /
|
||||
* batch_no 写入情况,以及团购任务(pick_mode=1/5)是否单波次。
|
||||
*/
|
||||
|
||||
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,
|
||||
});
|
||||
|
||||
console.log('=== 1) 主表按 source/pick_mode 统计(batch_no / batch_no_array 非空数、wave_count 分布) ===');
|
||||
const [ rows1 ] = await s.query(`
|
||||
SELECT t.source,
|
||||
t.pick_mode,
|
||||
COUNT(*) AS cnt,
|
||||
SUM(t.batch_no IS NOT NULL AND t.batch_no <> '') AS with_batch_no,
|
||||
SUM(t.batch_no_array IS NOT NULL AND t.batch_no_array <> '') AS with_batch_no_array,
|
||||
MIN(t.wave_count) AS min_wave_count,
|
||||
MAX(t.wave_count) AS max_wave_count
|
||||
FROM wms_wave_pick_task t
|
||||
GROUP BY t.source, t.pick_mode
|
||||
ORDER BY t.source, t.pick_mode
|
||||
`, { type: Sequelize.QueryTypes.SELECT });
|
||||
console.table(rows1);
|
||||
|
||||
console.log('=== 2) 团购任务(pick_mode IN (1,5))与波次关联表记录数分布(判断单波次/多波次) ===');
|
||||
const [ rows2 ] = await s.query(`
|
||||
SELECT t.source,
|
||||
t.pick_mode,
|
||||
t.wave_count,
|
||||
COUNT(*) AS cnt
|
||||
FROM wms_wave_pick_task t
|
||||
WHERE t.pick_mode IN (1, 5)
|
||||
GROUP BY t.source, t.pick_mode, t.wave_count
|
||||
ORDER BY t.source, t.pick_mode, t.wave_count
|
||||
`, { type: Sequelize.QueryTypes.SELECT });
|
||||
console.table(rows2);
|
||||
|
||||
console.log('=== 3) 团购任务主表 wave_id 非空占比与 wave_count 实际值(抽样) ===');
|
||||
const [ rows3 ] = await s.query(`
|
||||
SELECT t.id, t.task_no, t.source, t.pick_mode, t.wave_id, t.wave_count, t.batch_no, t.batch_no_array,
|
||||
(SELECT COUNT(*) FROM wms_wave_pick_task_wave tw WHERE tw.task_id = t.id) AS task_wave_rows
|
||||
FROM wms_wave_pick_task t
|
||||
WHERE t.pick_mode IN (1, 5)
|
||||
ORDER BY t.id DESC
|
||||
LIMIT 20
|
||||
`, { type: Sequelize.QueryTypes.SELECT });
|
||||
console.table(rows3);
|
||||
|
||||
console.log('=== 4) wms_wave_pick_task_wave 中单任务波次数 > 1 的任务(按 task_id 分组) ===');
|
||||
const [ rows4 ] = await s.query(`
|
||||
SELECT tw.task_id, t.source, t.pick_mode, t.wave_count, COUNT(*) AS task_wave_rows
|
||||
FROM wms_wave_pick_task_wave tw
|
||||
INNER JOIN wms_wave_pick_task t ON t.id = tw.task_id
|
||||
GROUP BY tw.task_id, t.source, t.pick_mode, t.wave_count
|
||||
HAVING COUNT(*) > 1
|
||||
ORDER BY tw.task_id DESC
|
||||
LIMIT 20
|
||||
`, { type: Sequelize.QueryTypes.SELECT });
|
||||
console.table(rows4);
|
||||
|
||||
await s.close();
|
||||
})().catch(e => {
|
||||
console.error('ERROR:', e.message);
|
||||
process.exit(1);
|
||||
});
|
||||
68
script/tmp-check-wave-pick-task-mode2.cjs
Normal file
68
script/tmp-check-wave-pick-task-mode2.cjs
Normal file
@ -0,0 +1,68 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* 临时核验脚本(v2):JSON 输出核实生产库 wms_wave_pick_task 的
|
||||
* pick_mode/source 分布与团购任务波次数。
|
||||
*/
|
||||
|
||||
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 [ total ] = await s.query('SELECT COUNT(*) AS c FROM wms_wave_pick_task', { type: Sequelize.QueryTypes.SELECT });
|
||||
console.log('A. 主表总数:', JSON.stringify(total));
|
||||
|
||||
const [ byMode ] = await s.query(
|
||||
'SELECT pick_mode, source, COUNT(*) AS cnt FROM wms_wave_pick_task GROUP BY pick_mode, source ORDER BY pick_mode, source',
|
||||
{ type: Sequelize.QueryTypes.SELECT }
|
||||
);
|
||||
console.log('B. pick_mode/source 分布:', JSON.stringify(byMode));
|
||||
|
||||
const [ byWaveCount ] = await s.query(
|
||||
'SELECT pick_mode, wave_count, COUNT(*) AS cnt FROM wms_wave_pick_task WHERE pick_mode IN (1, 5) GROUP BY pick_mode, wave_count ORDER BY pick_mode, wave_count',
|
||||
{ type: Sequelize.QueryTypes.SELECT }
|
||||
);
|
||||
console.log('C. 团购任务 wave_count 分布:', JSON.stringify(byWaveCount));
|
||||
|
||||
const [ multiWave ] = await s.query(
|
||||
'SELECT tw.task_id, t.pick_mode, t.source, t.wave_count, COUNT(*) AS task_wave_rows '
|
||||
+ 'FROM wms_wave_pick_task_wave tw '
|
||||
+ 'INNER JOIN wms_wave_pick_task t ON t.id = tw.task_id '
|
||||
+ 'GROUP BY tw.task_id, t.pick_mode, t.source, t.wave_count '
|
||||
+ 'ORDER BY tw.task_id DESC LIMIT 10',
|
||||
{ type: Sequelize.QueryTypes.SELECT }
|
||||
);
|
||||
console.log('D. 任务-波次关联(最近10条):', JSON.stringify(multiWave));
|
||||
|
||||
const [ taskWaveTotal ] = await s.query('SELECT COUNT(*) AS c FROM wms_wave_pick_task_wave', { type: Sequelize.QueryTypes.SELECT });
|
||||
console.log('E. 波次关联表总数:', JSON.stringify(taskWaveTotal));
|
||||
|
||||
const [ sampleGroup ] = await s.query(
|
||||
"SELECT id, task_no, source, pick_mode, wave_id, wave_count, batch_no, "
|
||||
+ "(SELECT COUNT(*) FROM wms_wave_pick_task_wave tw WHERE tw.task_id = t.id) AS task_wave_rows "
|
||||
+ "FROM wms_wave_pick_task t WHERE pick_mode = 1 ORDER BY id DESC LIMIT 10",
|
||||
{ type: Sequelize.QueryTypes.SELECT }
|
||||
);
|
||||
console.log('F. 团购任务最近10条:', JSON.stringify(sampleGroup));
|
||||
|
||||
const [ sampleScatter ] = await s.query(
|
||||
"SELECT id, task_no, source, pick_mode, wave_id, wave_count, batch_no, "
|
||||
+ "(SELECT COUNT(*) FROM wms_wave_pick_task_wave tw WHERE tw.task_id = t.id) AS task_wave_rows "
|
||||
+ "FROM wms_wave_pick_task t WHERE pick_mode IN (2, 3, 4) ORDER BY id DESC LIMIT 10",
|
||||
{ type: Sequelize.QueryTypes.SELECT }
|
||||
);
|
||||
console.log('G. 散单任务最近10条:', JSON.stringify(sampleScatter));
|
||||
|
||||
await s.close();
|
||||
})().catch(e => {
|
||||
console.error('ERROR:', e.message);
|
||||
process.exit(1);
|
||||
});
|
||||
76
script/tmp-check-wave-pick-task-mode3.cjs
Normal file
76
script/tmp-check-wave-pick-task-mode3.cjs
Normal file
@ -0,0 +1,76 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* 临时核验脚本(v3):修正 SELECT 结果解构,JSON 输出核实生产库
|
||||
* wms_wave_pick_task 的 pick_mode/source 分布与团购任务波次数。
|
||||
*/
|
||||
|
||||
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 total = await q('SELECT COUNT(*) AS c FROM wms_wave_pick_task');
|
||||
console.log('A. 主表总数:', JSON.stringify(total));
|
||||
|
||||
const byMode = await q(
|
||||
'SELECT pick_mode, source, COUNT(*) AS cnt FROM wms_wave_pick_task GROUP BY pick_mode, source ORDER BY pick_mode, source'
|
||||
);
|
||||
console.log('B. pick_mode/source 分布:', JSON.stringify(byMode));
|
||||
|
||||
const byWaveCount = await q(
|
||||
'SELECT pick_mode, wave_count, COUNT(*) AS cnt FROM wms_wave_pick_task WHERE pick_mode IN (1, 5) GROUP BY pick_mode, wave_count ORDER BY pick_mode, wave_count'
|
||||
);
|
||||
console.log('C. 团购任务 wave_count 分布:', JSON.stringify(byWaveCount));
|
||||
|
||||
const multiWave = await q(
|
||||
'SELECT tw.task_id, t.pick_mode, t.source, t.wave_count, COUNT(*) AS task_wave_rows '
|
||||
+ 'FROM wms_wave_pick_task_wave tw '
|
||||
+ 'INNER JOIN wms_wave_pick_task t ON t.id = tw.task_id '
|
||||
+ 'GROUP BY tw.task_id, t.pick_mode, t.source, t.wave_count '
|
||||
+ 'HAVING COUNT(*) > 1 '
|
||||
+ 'ORDER BY tw.task_id DESC LIMIT 10'
|
||||
);
|
||||
console.log('D. 多波次任务样例:', JSON.stringify(multiWave));
|
||||
|
||||
const singleWave = await q(
|
||||
'SELECT tw.task_id, t.pick_mode, t.source, t.wave_count, COUNT(*) AS task_wave_rows '
|
||||
+ 'FROM wms_wave_pick_task_wave tw '
|
||||
+ 'INNER JOIN wms_wave_pick_task t ON t.id = tw.task_id '
|
||||
+ 'GROUP BY tw.task_id, t.pick_mode, t.source, t.wave_count '
|
||||
+ 'HAVING COUNT(*) = 1 '
|
||||
+ 'ORDER BY tw.task_id DESC LIMIT 10'
|
||||
);
|
||||
console.log('E. 单波次任务样例:', JSON.stringify(singleWave));
|
||||
|
||||
const sampleGroup = await q(
|
||||
'SELECT id, task_no, source, pick_mode, wave_id, wave_count, batch_no, '
|
||||
+ '(SELECT COUNT(*) FROM wms_wave_pick_task_wave tw WHERE tw.task_id = t.id) AS task_wave_rows '
|
||||
+ 'FROM wms_wave_pick_task t WHERE pick_mode = 1 ORDER BY id DESC LIMIT 10'
|
||||
);
|
||||
console.log('F. 团购任务最近10条:', JSON.stringify(sampleGroup));
|
||||
|
||||
const sampleScatter = await q(
|
||||
'SELECT id, task_no, source, pick_mode, wave_id, wave_count, batch_no, '
|
||||
+ '(SELECT COUNT(*) FROM wms_wave_pick_task_wave tw WHERE tw.task_id = t.id) AS task_wave_rows '
|
||||
+ 'FROM wms_wave_pick_task t WHERE pick_mode IN (2, 3, 4) ORDER BY id DESC LIMIT 10'
|
||||
);
|
||||
console.log('G. 散单任务最近10条:', JSON.stringify(sampleScatter));
|
||||
|
||||
await s.close();
|
||||
})().catch(e => {
|
||||
console.error('ERROR:', e.message);
|
||||
process.exit(1);
|
||||
});
|
||||
37
script/tmp-verify-batch-no-array.cjs
Normal file
37
script/tmp-verify-batch-no-array.cjs
Normal file
@ -0,0 +1,37 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* 临时核验脚本:查询生产库 wms_wave_pick_task.batch_no_array 字段是否已添加。
|
||||
*/
|
||||
|
||||
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 [ rows ] = await s.query(
|
||||
"SELECT COLUMN_NAME, COLUMN_TYPE, IS_NULLABLE, COLUMN_DEFAULT, COLUMN_COMMENT "
|
||||
+ "FROM INFORMATION_SCHEMA.COLUMNS "
|
||||
+ "WHERE TABLE_SCHEMA = DATABASE() "
|
||||
+ "AND TABLE_NAME = 'wms_wave_pick_task' "
|
||||
+ "AND COLUMN_NAME = 'batch_no_array'"
|
||||
);
|
||||
console.log(JSON.stringify(rows, null, 2));
|
||||
|
||||
const [ meta ] = await s.query(
|
||||
"SELECT name FROM SequelizeMeta WHERE name = '20260904120000-add-batch-no-array-to-wms-wave-pick-task.js'"
|
||||
);
|
||||
console.log('SequelizeMeta 记录:', JSON.stringify(meta));
|
||||
|
||||
await s.close();
|
||||
})().catch(e => {
|
||||
console.error('ERROR:', e.message);
|
||||
process.exit(1);
|
||||
});
|
||||
39
script/tmp-verify-claim-operator.cjs
Normal file
39
script/tmp-verify-claim-operator.cjs
Normal file
@ -0,0 +1,39 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* 临时核验脚本:查询生产库 wms_wave_batch 领料字段与 SequelizeMeta 记录。
|
||||
*/
|
||||
|
||||
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 rows = await s.query(
|
||||
"SELECT COLUMN_NAME, COLUMN_TYPE, IS_NULLABLE, COLUMN_COMMENT "
|
||||
+ "FROM INFORMATION_SCHEMA.COLUMNS "
|
||||
+ "WHERE TABLE_SCHEMA = DATABASE() "
|
||||
+ "AND TABLE_NAME = 'wms_wave_batch' "
|
||||
+ "AND COLUMN_NAME IN ('claim_operator', 'claim_time')",
|
||||
{ type: Sequelize.QueryTypes.SELECT }
|
||||
);
|
||||
console.log('字段:', JSON.stringify(rows));
|
||||
|
||||
const meta = await s.query(
|
||||
"SELECT name FROM SequelizeMeta WHERE name = '20260904130000-add-claim-operator-to-wms-wave-batch.js'",
|
||||
{ type: Sequelize.QueryTypes.SELECT }
|
||||
);
|
||||
console.log('Meta:', JSON.stringify(meta));
|
||||
|
||||
await s.close();
|
||||
})().catch(e => {
|
||||
console.error('ERROR:', e.message);
|
||||
process.exit(1);
|
||||
});
|
||||
39
script/tmp-verify-pick-task-claim.cjs
Normal file
39
script/tmp-verify-pick-task-claim.cjs
Normal file
@ -0,0 +1,39 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* 临时核验脚本:查询生产库 wms_wave_pick_task 领料字段与 SequelizeMeta 记录。
|
||||
*/
|
||||
|
||||
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 rows = await s.query(
|
||||
"SELECT COLUMN_NAME, COLUMN_TYPE, IS_NULLABLE, COLUMN_COMMENT "
|
||||
+ "FROM INFORMATION_SCHEMA.COLUMNS "
|
||||
+ "WHERE TABLE_SCHEMA = DATABASE() "
|
||||
+ "AND TABLE_NAME = 'wms_wave_pick_task' "
|
||||
+ "AND COLUMN_NAME IN ('claim_operator_id', 'claim_operator')",
|
||||
{ type: Sequelize.QueryTypes.SELECT }
|
||||
);
|
||||
console.log('字段:', JSON.stringify(rows));
|
||||
|
||||
const meta = await s.query(
|
||||
"SELECT name FROM SequelizeMeta WHERE name = '20260904140000-add-claim-operator-to-wms-wave-pick-task.js'",
|
||||
{ type: Sequelize.QueryTypes.SELECT }
|
||||
);
|
||||
console.log('Meta:', JSON.stringify(meta));
|
||||
|
||||
await s.close();
|
||||
})().catch(e => {
|
||||
console.error('ERROR:', e.message);
|
||||
process.exit(1);
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user