From 0b77a1c63eb613cb52629c5ebbba70955761cd79 Mon Sep 17 00:00:00 2001 From: liufumingren Date: Sun, 2 Aug 2026 22:40:03 +0800 Subject: [PATCH] =?UTF-8?q?fix(pick):=20wavePickTaskBindCart=20=E9=98=B2?= =?UTF-8?q?=E9=87=8D=E6=A3=80=E6=9F=A5=E4=B8=8D=E5=86=8D=E6=8C=89=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E7=8A=B6=E6=80=81=E6=94=BE=E8=BF=87=E2=80=94=E2=80=94?= =?UTF-8?q?=E4=BB=85=E4=BB=A5=20is=5Factive=3D1=20=E4=B8=BA=E5=87=86?= =?UTF-8?q?=EF=BC=8C=E9=98=BB=E6=AD=A2=E4=B8=80=E8=BD=A6=E5=A4=9A=E7=BB=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/systems/pick.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/app/service/systems/pick.js b/app/service/systems/pick.js index 832f995..3937e23 100644 --- a/app/service/systems/pick.js +++ b/app/service/systems/pick.js @@ -2418,8 +2418,7 @@ class PickSystemService extends Service { SELECT b.id, b.task_id, - t.task_no, - t.status AS task_status + t.task_no FROM wms_pick_task_cart_binding b INNER JOIN wms_wave_pick_task t ON t.id = b.task_id @@ -2442,7 +2441,6 @@ class PickSystemService extends Service { : null; if (cartActiveBinding) { const boundTaskId = Number(cartActiveBinding.task_id || 0); - const boundTaskStatus = Number(cartActiveBinding.task_status || 0); if (boundTaskId === taskId) { throw this.createBusinessError('该任务已绑定此拣货车,无需重复绑定', 409, { task_id: taskId, @@ -2450,14 +2448,13 @@ class PickSystemService extends Service { cart_code: targetCartCode, }); } - if ([ 0, 1 ].includes(boundTaskStatus)) { - throw this.createBusinessError('该拣货车已绑定其他活动任务,请先解绑后再重新绑定', 409, { - task_id: boundTaskId, - task_no: String(cartActiveBinding.task_no || '').trim() || null, - cart_id: targetCartId, - cart_code: targetCartCode, - }); - } + // 车已有其他活跃绑定,无论旧任务状态如何均应阻止 + throw this.createBusinessError('该拣货车已绑定其他任务,请先解绑后再重新绑定', 409, { + task_id: boundTaskId, + task_no: String(cartActiveBinding.task_no || '').trim() || null, + cart_id: targetCartId, + cart_code: targetCartCode, + }); } await ctx.model.query(`