From 6607f4739105a66dbfb9ad1eb29cb746dbecd6a3 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, 7 Oct 2025 02:44:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E9=80=81bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/WcsIntegrationMapper.java | 2 +- .../impl/WcsIntegrationServiceImpl.java | 32 +++++++++++++------ .../WcsIntegrationMapper.xml | 13 ++++++++ 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/gaotao/modules/automatedWarehouse/mapper/WcsIntegrationMapper.java b/src/main/java/com/gaotao/modules/automatedWarehouse/mapper/WcsIntegrationMapper.java index f20d974..0545a70 100644 --- a/src/main/java/com/gaotao/modules/automatedWarehouse/mapper/WcsIntegrationMapper.java +++ b/src/main/java/com/gaotao/modules/automatedWarehouse/mapper/WcsIntegrationMapper.java @@ -192,7 +192,7 @@ public interface WcsIntegrationMapper { void reUpdatePalletDetailWcsFlag(@Param("site") String site, @Param("palletId") String palletId); List getPalletDetailsNewDetail(@Param("site") String site, @Param("palletId") String palletId); - + void updateSOIssueNotifyOrderMaterialListDetailOutWcsFlag(@Param("site") String site, @Param("serialNo") String serialNo); void insertWmsTransportTaskDetail(WmsTransportTaskDetail inData); void insertWmsOrderTaskDetail(WmsOrderTaskDetail inData); 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 c1cd5d5..e6958d1 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 @@ -291,7 +291,7 @@ 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("栈板正在被调用中,无法进行打托操作"); } @@ -352,10 +352,10 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService { !StringUtils.hasText(position) || layer == null || !StringUtils.hasText(serialNo)) { throw new Exception("参数不能为空"); } - + Map palletData = wcsIntegrationMapper.getPalletInfo(site, palletId); // 检查栈板是否正在被调用 String callingFlag = wcsIntegrationMapper.checkPalletCallingFlag(site, palletId); - if ("Y".equals(callingFlag)) { + if ("Y".equals(callingFlag)&&!BufferZoneConfig.BUFFER_Station_ID.getValue().equals(palletData.get("locationCode"))) { throw new Exception("栈板正在被调用中,无法进行打托操作"); } @@ -451,10 +451,11 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService { if (!StringUtils.hasText(site) || !StringUtils.hasText(palletId) || !StringUtils.hasText(serialNo)) { throw new Exception("参数不能为空"); } - + Map palletData = wcsIntegrationMapper.getPalletInfo(site, palletId); + // 检查栈板是否正在被调用 String callingFlag = wcsIntegrationMapper.checkPalletCallingFlag(site, palletId); - if ("Y".equals(callingFlag)) { + if ("Y".equals(callingFlag)&&!BufferZoneConfig.BUFFER_Station_ID.getValue().equals(palletData.get("locationCode"))) { throw new Exception("栈板正在被调用中,无法进行扫出操作"); } @@ -536,10 +537,11 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService { !StringUtils.hasText(serialNo) || !StringUtils.hasText(newPosition) || newLayer == null) { throw new Exception("参数不能为空"); } - + Map palletData = wcsIntegrationMapper.getPalletInfo(site, palletId); + // 检查栈板是否正在被调用 String callingFlag = wcsIntegrationMapper.checkPalletCallingFlag(site, palletId); - if ("Y".equals(callingFlag)) { + if ("Y".equals(callingFlag)&&!BufferZoneConfig.BUFFER_Station_ID.getValue().equals(palletData.get("locationCode"))) { throw new Exception("栈板正在被调用中,无法进行位置调整"); } @@ -1281,10 +1283,20 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService { throw new Exception("栈板不存在"); } - // 调用AGV接口创建任务 - // List targets = Arrays.asList(request.getStartStation()); - // agvClientUtil.createTask(task.getTaskNo(), targets, null, task.getPriority()); + // 根据序列号去修改最新的发货通知单 + + List newDetail=wcsIntegrationMapper.getPalletDetailsNewDetail(site, palletId); + if(newDetail.isEmpty()){ + return; + } + //判断是分拣目的栈板 不在立库缓冲区 + if (!BufferZoneConfig.BUFFER_Station_ID.getValue().equals(palletInfo.get("locationCode"))) { + for (int i = 0; i < newDetail.size(); i++) { + wcsIntegrationMapper.updateSOIssueNotifyOrderMaterialListDetailOutWcsFlag(site, newDetail.get(i).getSerialNo()); + } + } + //根据序列号去更新最新的 // 调用pushPalletDetailNew方法推送组托数据 diff --git a/src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml b/src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml index f7a0cd8..7db44dd 100644 --- a/src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml +++ b/src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml @@ -450,6 +450,19 @@ where a.site=#{site} and a.pallet_id=#{palletId} and a.wcs_flag = 1 + + WITH RankedRecords AS ( + SELECT + out_wcs_flag, + ROW_NUMBER() OVER (ORDER BY notifyNo DESC) AS rn + FROM SOIssueNotifyOrderMaterialList_detail + WHERE site = #{site} + AND serialNo = #{serialNo} + ) + UPDATE RankedRecords + SET out_wcs_flag = 'Y' + WHERE rn = 1; + insert into wms_transport_task_detail( site,task_no,item_no,seq_no,action_type,[comment],from_location,to_location,agv_code,[status],start_time,