From 6daee996ef5082b263f8578c7832a6b161de6f8c 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: Thu, 27 Nov 2025 13:41:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E7=94=A8=E8=AE=B0=E5=BD=95=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AutoTaskServiceImpl.java | 2 +- .../impl/WcsIntegrationServiceImpl.java | 48 +++++++++---------- .../modules/warehouse/entity/Pallet.java | 17 ++++++- .../WcsIntegrationMapper.xml | 9 +++- 4 files changed, 48 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/AutoTaskServiceImpl.java b/src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/AutoTaskServiceImpl.java index 8d60271..2e0721e 100644 --- a/src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/AutoTaskServiceImpl.java +++ b/src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/AutoTaskServiceImpl.java @@ -378,7 +378,7 @@ public class AutoTaskServiceImpl implements AutoTaskService { throw new RuntimeException("栈板不存在:" + inData.getPalletId()); } if(!"N".equals(pallet.getCallingFlag())){ - throw new RuntimeException("栈板状态异常:栈板正在被调用中,无法创建新任务"); + throw new RuntimeException("栈板状态异常:栈板正在被调用中,最近一次调用备注:"+pallet.getRemark()); } // 验证栈板是否已有未完成任务(更严格的检查)- rqrq diff --git a/src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsIntegrationServiceImpl.java b/src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsIntegrationServiceImpl.java index fbb793e..99ba1b3 100644 --- a/src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsIntegrationServiceImpl.java +++ b/src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsIntegrationServiceImpl.java @@ -229,9 +229,9 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService { String palletId = item.getPalletId(); // 1. 检查栈板是否正在被调用 - rqrq - String callingFlag = wcsIntegrationMapper.checkPalletCallingFlag(item.getSite(), palletId); - if ("Y".equals(callingFlag)) { - throw new RuntimeException("栈板正在被调用中"); + com.gaotao.modules.warehouse.entity.Pallet pallet = wcsIntegrationMapper.getPalletByCode(item.getSite(), palletId); + if (pallet != null && "Y".equals(pallet.getCallingFlag())) { + throw new RuntimeException("栈板正在被调用中,最近一次调用备注:" + (pallet.getRemark() != null ? pallet.getRemark() : "无")); } // 2. 生成任务编号 - rqrq @@ -322,7 +322,8 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService { String callingFlag = (String) palletInfo.get("calling_flag"); if ("Y".equals(callingFlag)) { // if ("Y".equals(callingFlag)&&!BufferZoneConfig.BUFFER_Station_ID.getValue().equals(palletInfo.get("locationCode"))) { - throw new RuntimeException("栈板正在被调用中,无法进行打托操作"); + String remark = (String) palletInfo.get("remark"); + throw new RuntimeException("栈板正在被调用中,无法进行打托操作,最近一次调用备注:" + (remark != null ? remark : "无")); } // 获取栈板类型的位置信息 @@ -423,11 +424,10 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService { throw new Exception("参数不能为空"); } Map palletData = wcsIntegrationMapper.getPalletInfo(site, palletId); - // 检查栈板是否正在被调用 - String callingFlag = wcsIntegrationMapper.checkPalletCallingFlag(site, palletId); - // if ("Y".equals(callingFlag)&&!BufferZoneConfig.BUFFER_Station_ID.getValue().equals(palletData.get("locationCode"))) { - if ("Y".equals(callingFlag)) { - throw new Exception("栈板正在被调用中,无法进行打托操作"); + // 检查栈板是否正在被调用 - rqrq + com.gaotao.modules.warehouse.entity.Pallet pallet = wcsIntegrationMapper.getPalletByCode(site, palletId); + if (pallet != null && "Y".equals(pallet.getCallingFlag())) { + throw new Exception("栈板正在被调用中,无法进行打托操作,最近一次调用备注:" + (pallet.getRemark() != null ? pallet.getRemark() : "无")); } // 1. 验证标签 @@ -544,11 +544,10 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService { } Map palletData = wcsIntegrationMapper.getPalletInfo(site, palletId); - // 检查栈板是否正在被调用 - String callingFlag = wcsIntegrationMapper.checkPalletCallingFlag(site, palletId); - // if ("Y".equals(callingFlag)&&!BufferZoneConfig.BUFFER_Station_ID.getValue().equals(palletData.get("locationCode"))) { - if ("Y".equals(callingFlag)) { - throw new Exception("栈板正在被调用中,无法进行扫出操作"); + // 检查栈板是否正在被调用 - rqrq + com.gaotao.modules.warehouse.entity.Pallet pallet = wcsIntegrationMapper.getPalletByCode(site, palletId); + if (pallet != null && "Y".equals(pallet.getCallingFlag())) { + throw new Exception("栈板正在被调用中,无法进行扫出操作,最近一次调用备注:" + (pallet.getRemark() != null ? pallet.getRemark() : "无")); } // 检查标签是否在本栈板中 @@ -594,9 +593,9 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService { ", position=" + data.getOriginalPosition() + ", layer=" + data.getOriginalLayer() + ", wcsFlag=" + data.getWcsFlag()); // 检查原栈板是否正在被调用 - rqrq - String callingFlag = wcsIntegrationMapper.checkPalletCallingFlag(data.getSite(), data.getOriginalPalletId()); - if ("Y".equals(callingFlag)) { - throw new Exception("原栈板正在被调用中,无法恢复标签"); + com.gaotao.modules.warehouse.entity.Pallet pallet = wcsIntegrationMapper.getPalletByCode(data.getSite(), data.getOriginalPalletId()); + if (pallet != null && "Y".equals(pallet.getCallingFlag())) { + throw new Exception("原栈板正在被调用中,无法恢复标签,最近一次调用备注:" + (pallet.getRemark() != null ? pallet.getRemark() : "无")); } // 执行恢复操作(先删除当前记录,再插入到原栈板)- rqrq @@ -716,11 +715,10 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService { } Map palletData = wcsIntegrationMapper.getPalletInfo(site, palletId); - // 检查栈板是否正在被调用 - String callingFlag = wcsIntegrationMapper.checkPalletCallingFlag(site, palletId); - //if ("Y".equals(callingFlag)&&!BufferZoneConfig.BUFFER_Station_ID.getValue().equals(palletData.get("locationCode"))) { - if ("Y".equals(callingFlag)) { - throw new Exception("栈板正在被调用中,无法进行位置调整"); + // 检查栈板是否正在被调用 - rqrq + com.gaotao.modules.warehouse.entity.Pallet pallet = wcsIntegrationMapper.getPalletByCode(site, palletId); + if (pallet != null && "Y".equals(pallet.getCallingFlag())) { + throw new Exception("栈板正在被调用中,无法进行位置调整,最近一次调用备注:" + (pallet.getRemark() != null ? pallet.getRemark() : "无")); } // 验证标签是否在当前栈板中 @@ -820,9 +818,9 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService { String username = ((SysUserEntity) SecurityUtils.getSubject().getPrincipal()).getUsername(); // 检查栈板calling_flag状态 - rqrq - String callingFlag = wcsIntegrationMapper.checkPalletCallingFlag(site, palletId); - if ("Y".equals(callingFlag)) { - throw new Exception("栈板正在被调用中,无法创建运输任务"); + com.gaotao.modules.warehouse.entity.Pallet pallet = wcsIntegrationMapper.getPalletByCode(site, palletId); + if (pallet != null && "Y".equals(pallet.getCallingFlag())) { + throw new Exception("栈板正在被调用中,无法创建运输任务,最近一次调用备注:" + (pallet.getRemark() != null ? pallet.getRemark() : "无")); } // 使用统一的运输任务调度方法 - rqrq diff --git a/src/main/java/com/gaotao/modules/warehouse/entity/Pallet.java b/src/main/java/com/gaotao/modules/warehouse/entity/Pallet.java index 87fe222..7086acf 100644 --- a/src/main/java/com/gaotao/modules/warehouse/entity/Pallet.java +++ b/src/main/java/com/gaotao/modules/warehouse/entity/Pallet.java @@ -73,7 +73,22 @@ public class Pallet { private String locationCode; /** - * 备注信息 + * 备注信息 - rqrq + *

用途:记录最近一次栈板调用情况

+ *

当calling_flag='Y'时,此字段记录调用的业务信息,格式示例:

+ *
    + *
  • 领料申请单:工厂:1 领料申请单IN001 订单号SO001
  • + *
  • 任务类型:立库取货 任务单号:WOT001 物料:RM001
  • + *
+ *

系统维护逻辑:

+ *
+     * // 场景1:领料申请单调用时更新 - rqrq
+     * String remark = "领料申请单:工厂:" + site + " 领料申请单" + notifyNo + " 订单号" + productionOrderNo;
+     * mapper.updatePalletCallingFlag(site, palletIds, remark);
+     * 
+     * // 场景2:WCS调用时可选更新 - rqrq
+     * mapper.updatePalletCallingFlag(site, palletId, "Y", remark, updatedBy);
+     * 
*/ private String remark; diff --git a/src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml b/src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml index 4d71191..a61964b 100644 --- a/src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml +++ b/src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml @@ -130,7 +130,14 @@