From 9b76e260eeb36b9cd6ccf760e38cf44edb736514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=B8=E7=86=9F=E5=90=B4=E5=BD=A6=E7=A5=96?= Date: Tue, 27 Oct 2026 17:04:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=B7=E5=AE=89=E7=A9=BA=E6=89=98=E7=9B=98?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AgvTaskServiceImpl.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/AgvTaskServiceImpl.java b/src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/AgvTaskServiceImpl.java index 4bc19806..4cec8bc6 100644 --- a/src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/AgvTaskServiceImpl.java +++ b/src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/AgvTaskServiceImpl.java @@ -720,14 +720,23 @@ public class AgvTaskServiceImpl implements AgvTaskService { if (task.getToLocation() == null || task.getToLocation().trim().isEmpty()) { throw new RuntimeException("任务没有目标站点,不能重发补盘"); } - if (task.getPalletType() == null || task.getPalletType().trim().isEmpty()) { - throw new RuntimeException("任务没有托盘类型,不能重发补盘"); + // 任务上没有托盘类型时,用托盘号查托盘当前类型。两种都没有就还没取消,避免空报文把任务取消掉 - rqrq + String wmsPalletType = task.getPalletType() == null ? "" : task.getPalletType().trim(); + if (wmsPalletType.isEmpty()) { + if (task.getPalletId() == null || task.getPalletId().trim().isEmpty()) { + throw new RuntimeException("任务没有托盘类型,也没有托盘号,不能重发补盘"); + } + Pallet pallet = wcsIntegrationMapper.getPalletByCode(task.getSite(), task.getPalletId().trim()); + if (pallet == null || pallet.getPalletType() == null || pallet.getPalletType().trim().isEmpty()) { + throw new RuntimeException("托盘【" + task.getPalletId().trim() + "】不存在或没有托盘类型,不能重发补盘"); + } + wmsPalletType = pallet.getPalletType().trim(); } // 用任务所属工厂查托盘类型主数据,取出 WCS 整型托盘类型和底托类型。查不到就不能拼报文,此时还没取消 - rqrq - PalletType palletType = wcsIntegrationMapper.getPalletType(task.getSite(), task.getPalletType().trim()); + PalletType palletType = wcsIntegrationMapper.getPalletType(task.getSite(), wmsPalletType); if (palletType == null || palletType.getWcsPalletType() == null || palletType.getWcsBasePalletType() == null) { - throw new RuntimeException("托盘类型【" + task.getPalletType().trim() + "】未配置WCS托盘类型或底托类型,不能重发补盘"); + throw new RuntimeException("托盘类型【" + wmsPalletType + "】未配置WCS托盘类型或底托类型,不能重发补盘"); } // 走现有取消。TUSK 失败时取消结果仍是成功,WMS 任务、站点和 calling_flag 会按原逻辑处理;这里不因 TUSK 失败中断 - rqrq